/* ─── Design System ─── */
:root {
    --bg: #f8fafc;
    --surface: #ffffff;
    --text: #0f172a;
    --text-secondary: #475569;
    --text-muted: #94a3b8;
    --primary: #0d9488;
    --primary-hover: #0f766e;
    --primary-light: #f0fdfa;
    --success: #059669;
    --success-light: #ecfdf5;
    --warning: #d97706;
    --danger: #dc2626;
    --danger-light: #fef2f2;
    --border: #e2e8f0;
    --radius: 12px;
    --radius-sm: 8px;
    --shadow: 0 1px 3px 0 rgb(0 0 0 / .04), 0 1px 2px -1px rgb(0 0 0 / .04);
}

/* ─── Reset ─── */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

/* ═══════════════════════════════════════════
   Login Page
   ═══════════════════════════════════════════ */

.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #0f172a;
    background-image:
        radial-gradient(at 25% 40%, rgba(79, 70, 229, .15) 0%, transparent 50%),
        radial-gradient(at 75% 60%, rgba(79, 70, 229, .08) 0%, transparent 50%);
}

.login-container {
    background: var(--surface);
    border-radius: 16px;
    padding: 48px;
    width: 100%;
    max-width: 440px;
    box-shadow: 0 25px 50px -12px rgb(0 0 0 / .25);
}

.login-brand { text-align: center; margin-bottom: 36px; }

.login-brand h1 {
    font-size: 22px;
    font-weight: 700;
    letter-spacing: -.3px;
}

.login-brand h1 span { color: var(--primary); }

.login-tagline {
    color: var(--text-muted);
    font-size: 14px;
    margin-top: 6px;
}

.form-group { margin-bottom: 16px; }

.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.form-group input {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-family: inherit;
    outline: none;
    transition: border-color .15s, box-shadow .15s;
}

.form-group input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, .1);
}

.btn-primary {
    display: block;
    width: 100%;
    padding: 11px 20px;
    background: var(--primary);
    color: #fff;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: background .15s;
    margin-top: 24px;
}

.btn-primary:hover { background: var(--primary-hover); }

.login-divider {
    display: flex;
    align-items: center;
    margin: 28px 0 16px;
    color: var(--text-muted);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: .5px;
}

.login-divider::before,
.login-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border);
}

.login-divider span { padding: 0 14px; }

.login-helper {
    font-size: 12px;
    color: var(--text-muted);
    margin: -4px 0 12px;
}

.business-list { list-style: none; }

.business-list li + li { margin-top: 2px; }

.business-shortcut {
    display: block;
    width: 100%;
    padding: 10px 14px;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    text-align: left;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-family: inherit;
    cursor: pointer;
    transition: background .15s, color .15s;
}

.business-shortcut:hover,
.business-shortcut:focus-visible {
    background: var(--primary-light);
    color: var(--primary);
    outline: none;
}

.form-error {
    background: var(--danger-light);
    color: var(--danger);
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    margin-bottom: 16px;
}

/* ═══════════════════════════════════════════
   Top Bar
   ═══════════════════════════════════════════ */

.topbar {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
}

.topbar-inner {
    max-width: 1320px;
    margin: 0 auto;
    padding: 0 24px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.brand { font-size: 17px; font-weight: 700; letter-spacing: -.3px; }
.brand span { color: var(--primary); }

.topbar-right { display: flex; align-items: center; gap: 16px; }

.business-badge {
    background: var(--primary-light);
    color: var(--primary);
    padding: 5px 14px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
}

.btn-signout {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 13px;
    transition: color .15s;
}

.btn-signout:hover { color: var(--text); }

/* ═══════════════════════════════════════════
   Dashboard Layout
   ═══════════════════════════════════════════ */

.dashboard {
    max-width: 1320px;
    margin: 0 auto;
    padding: 18px 24px 64px;
}

.dashboard > * + * { margin-top: 20px; }

.dashboard [hidden] { display: none !important; }

.dashboard > .dashboard-view-section + .dashboard-view-section,
.dashboard > .filter-bar + .dashboard-view-section {
    margin-top: 28px;
}

.dashboard-views {
    display: flex;
    gap: 10px;
    padding-bottom: 4px;
    overflow-x: auto;
    scrollbar-width: none;
}

.dashboard-views::-webkit-scrollbar { display: none; }

.dashboard-view-tab {
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text-secondary);
    border-radius: 999px;
    padding: 9px 14px;
    font-size: 13px;
    font-weight: 600;
    font-family: inherit;
    white-space: nowrap;
    cursor: pointer;
    transition: background .15s, color .15s, border-color .15s;
}

.dashboard-view-tab:hover,
.dashboard-view-tab:focus-visible {
    border-color: #cbd5e1;
    color: var(--text);
    outline: none;
}

.dashboard-view-tab.is-active {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}

.explainer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    background: var(--primary-light);
    border: 1px solid #d4d0f8;
    border-radius: var(--radius);
    padding: 16px 24px;
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.55;
}

.explainer strong { color: var(--text); }
.explainer .scan-date { white-space: nowrap; flex-shrink: 0; font-size: 12px; }
.explainer-content { flex: 1; }
.explainer-dismiss {
    flex-shrink: 0;
    background: none;
    border: none;
    font-size: 20px;
    line-height: 1;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0 4px;
    align-self: flex-start;
}
.explainer-dismiss:hover { color: var(--text); }

.card {
    background: var(--surface);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    padding: 24px;
    box-shadow: var(--shadow);
}

.card h3 {
    font-size: 11px;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: .8px;
    margin-bottom: 16px;
}

/* ═══════════════════════════════════════════
   Metric Cards
   ═══════════════════════════════════════════ */

.metrics-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

.metric-card { text-align: center; padding: 28px 24px; }

.metric-label {
    font-size: 11px;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: .8px;
    margin-bottom: 10px;
}

.metric-value {
    font-size: 52px;
    font-weight: 700;
    letter-spacing: -2px;
    line-height: 1;
    margin-bottom: 8px;
}

.metric-delta { font-size: 13px; font-weight: 600; }
.metric-delta.positive { color: var(--success); }
.metric-delta.negative { color: var(--danger); }
.metric-delta.neutral  { color: var(--text-muted); }

.metric-sub { font-size: 13px; color: var(--text-muted); }
.metric-clarifier { font-size: 11px; color: var(--text-muted); margin-top: 4px; font-style: italic; }

/* ═══════════════════════════════════════════
   Charts
   ═══════════════════════════════════════════ */

.charts-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

.chart-container { height: 240px; position: relative; }

/* ═══════════════════════════════════════════
   Provider Rankings
   ═══════════════════════════════════════════ */

.hint {
    font-size: 11px;
    font-weight: 400;
    color: var(--text-muted);
    letter-spacing: 0;
    text-transform: none;
}

.provider-list { display: flex; flex-direction: column; gap: 0; }

.provider-block { border-bottom: 1px solid var(--bg); }
.provider-block:last-child { border-bottom: none; }

.provider-row {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 10px 0;
    background: transparent;
    border: none;
    text-align: left;
    font-family: inherit;
    cursor: pointer;
    transition: background .1s;
    border-radius: var(--radius-sm);
    margin: 0 -8px;
    padding-left: 8px;
    padding-right: 8px;
}

.provider-row:hover { background: var(--bg); }
.provider-row:focus-visible {
    outline: 2px solid rgba(79, 70, 229, .25);
    outline-offset: 2px;
}

.provider-color {
    width: 4px;
    height: 36px;
    border-radius: 2px;
    flex-shrink: 0;
}

.provider-name {
    width: 100px;
    font-size: 14px;
    font-weight: 600;
    flex-shrink: 0;
}

.provider-rank {
    width: 48px;
    font-size: 22px;
    font-weight: 700;
    text-align: center;
    flex-shrink: 0;
}

.provider-rank.rank-none { color: var(--text-muted); font-size: 18px; }

.provider-change {
    width: 60px;
    font-size: 12px;
    font-weight: 700;
    text-align: center;
    flex-shrink: 0;
}

.change-up   { color: var(--success); }
.change-down { color: var(--danger); }
.change-stable { color: var(--text-muted); }
.change-new  { color: var(--primary); }
.change-dropped { color: var(--danger); }

.provider-bar-container {
    flex: 1;
    height: 6px;
    background: var(--bg);
    border-radius: 3px;
    overflow: hidden;
}

.provider-bar {
    height: 100%;
    border-radius: 3px;
    transition: width .6s ease;
}

.provider-vis {
    width: 40px;
    text-align: right;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    flex-shrink: 0;
}

.expand-arrow {
    width: 20px;
    text-align: center;
    font-size: 12px;
    color: var(--text-muted);
    flex-shrink: 0;
    transition: transform .2s;
}

.expanded .expand-arrow { transform: rotate(-180deg); }

/* ─── Drill-down panels ─── */

.drilldown {
    max-height: 0;
    overflow: hidden;
    transition: max-height .3s ease, padding .2s ease;
    padding: 0 8px;
}

.drilldown.open {
    max-height: 2000px;
    padding: 8px 8px 16px;
}

.drilldown-query { margin-bottom: 16px; }
.drilldown-query:last-child { margin-bottom: 0; }

.dq-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
    padding-bottom: 6px;
    border-bottom: 1px solid var(--border);
}

.dq-text {
    font-size: 13px;
    color: var(--text-secondary);
    font-style: italic;
    flex: 1;
    margin-right: 12px;
}

.dq-rank {
    font-size: 12px;
    font-weight: 700;
    padding: 2px 10px;
    border-radius: 12px;
    flex-shrink: 0;
}

.dq-rank.rank-found { background: var(--success-light); color: var(--success); }
.dq-rank.rank-missing { background: var(--bg); color: var(--text-muted); }

.dq-list {
    list-style: none;
    counter-reset: dq-counter;
    padding: 0;
    margin: 0;
}

.dq-list li {
    counter-increment: dq-counter;
    display: grid;
    grid-template-columns: 24px 1fr;
    grid-template-rows: auto auto;
    row-gap: 5px;
    column-gap: 6px;
    padding: 10px 0;
    font-size: 13px;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border);
}

.dq-list li:last-child { border-bottom: none; }

.dq-list li::before {
    content: counter(dq-counter) ".";
    font-weight: 600;
    color: var(--text-muted);
    grid-column: 1;
    grid-row: 1;
    padding-top: 1px;
}

.dq-item-main {
    grid-column: 2;
    grid-row: 1;
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 6px;
}

.dq-source {
    grid-column: 2;
    grid-row: 2;
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 5px 10px;
    border-radius: 6px;
    border-left: 3px solid var(--border);
    background: var(--bg);
    font-size: 11px;
    color: var(--text-secondary);
    font-family: 'SF Mono', 'Fira Code', monospace;
}

.dq-source-url {
    color: var(--text-muted);
    word-break: break-all;
    font-size: 11px;
}

/* Per-type source accent colors */
.dq-source-brand  { border-left-color: #818cf8; background: #f5f3ff; }
.dq-source-social { border-left-color: #f59e0b; background: #fffbeb; }
.dq-source-earned { border-left-color: #10b981; background: #f0fdf4; }

.dq-list li.is-target {
    color: var(--text);
    font-weight: 600;
    background: var(--primary-light);
    margin: 0 -8px;
    padding-left: 8px;
    padding-right: 8px;
    border-radius: 6px;
}

.dq-biz-name { font-weight: 500; }

.dq-reason {
    color: var(--text-muted);
    font-weight: 400;
    font-size: 12px;
}

.dq-tag {
    display: inline-block;
    font-family: 'Inter', sans-serif;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .5px;
    padding: 2px 7px;
    border-radius: 4px;
    flex-shrink: 0;
    white-space: nowrap;
}

.dq-tag-brand  { background: #ede9fe; color: #6366f1; }
.dq-tag-social { background: #fef3c7; color: #d97706; }
.dq-tag-earned { background: #d1fae5; color: #059669; }

/* ═══════════════════════════════════════════
   Query Browser
   ═══════════════════════════════════════════ */

.query-list { display: flex; flex-direction: column; gap: 0; }

.query-block { border-bottom: 1px solid var(--bg); }
.query-block:last-child { border-bottom: none; }

.query-row {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 12px 8px;
    margin: 0 -8px;
    background: transparent;
    border: none;
    text-align: left;
    font-family: inherit;
    cursor: pointer;
    border-radius: var(--radius-sm);
    transition: background .1s;
}

.query-row:hover { background: var(--bg); }
.query-row:focus-visible {
    outline: 2px solid rgba(79, 70, 229, .25);
    outline-offset: 2px;
}

.query-text {
    flex: 1;
    font-size: 14px;
    color: var(--text);
    font-weight: 500;
}

.query-intent {
    font-size: 11px;
    font-weight: 500;
    color: var(--text-muted);
    text-transform: none;
    letter-spacing: .2px;
    background: var(--bg);
    padding: 3px 8px;
    border-radius: 4px;
    flex-shrink: 0;
}

.query-providers-summary {
    display: flex;
    gap: 4px;
    flex-shrink: 0;
}

.qps-dot {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 700;
    color: #fff;
}

.drilldown-provider { margin-bottom: 14px; }
.drilldown-provider:last-child { margin-bottom: 0; }

.dp-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
    padding-bottom: 4px;
    border-bottom: 1px solid var(--border);
}

.dp-color {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}

.dp-name {
    font-size: 13px;
    font-weight: 600;
    flex: 1;
}

/* ═══════════════════════════════════════════
   Two-Column Layout
   ═══════════════════════════════════════════ */

.two-col {
    display: grid;
    grid-template-columns: 3fr 2fr;
    gap: 16px;
}

/* ═══════════════════════════════════════════
   Recommendations
   ═══════════════════════════════════════════ */

.rec-list { display: flex; flex-direction: column; gap: 16px; }

.rec-item { display: flex; gap: 12px; align-items: flex-start; }

.rec-title { font-size: 14px; font-weight: 600; }

.rec-detail {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.55;
}

/* ═══════════════════════════════════════════
   Source Attribution
   ═══════════════════════════════════════════ */

.source-bars { display: flex; flex-direction: column; gap: 14px; margin-bottom: 16px; }

.source-row { display: flex; align-items: center; gap: 12px; }

.source-label {
    width: 56px;
    font-size: 13px;
    font-weight: 600;
    flex-shrink: 0;
}

.source-bar-track {
    flex: 1;
    height: 8px;
    background: var(--bg);
    border-radius: 4px;
    overflow: hidden;
}

.source-bar-fill {
    height: 100%;
    border-radius: 4px;
    transition: width .6s ease;
}

.source-brand  { background: #6366f1; }
.source-social { background: #f59e0b; }
.source-earned { background: #10b981; }

.source-pct {
    width: 36px;
    text-align: right;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
}

.source-legend { display: flex; gap: 16px; font-size: 12px; color: var(--text-muted); }

.legend-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: 5px;
    vertical-align: middle;
}

.legend-dot.brand  { background: #6366f1; }
.legend-dot.social { background: #f59e0b; }
.legend-dot.earned { background: #10b981; }

/* ═══════════════════════════════════════════
   Changes Feed
   ═══════════════════════════════════════════ */

.changes-feed { display: flex; flex-direction: column; gap: 2px; }

.change-item {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    padding: 10px 0;
    border-bottom: 1px solid var(--bg);
    color: var(--text-secondary);
}

.change-item:last-child { border-bottom: none; }

.change-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    padding: 3px 8px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 700;
    flex-shrink: 0;
}

.change-badge.up      { background: var(--success-light); color: var(--success); }
.change-badge.down    { background: var(--danger-light); color: var(--danger); }
.change-badge.new     { background: var(--primary-light); color: var(--primary); }
.change-badge.dropped { background: var(--danger-light); color: var(--danger); }
.change-badge.discovery { background: #fef9c3; color: #854d0e; font-size: 11px; }

.change-item-discovery {
    background: #fffbeb;
    border: 1px solid #fde68a;
    border-radius: 8px;
    padding: 10px 14px;
    gap: 12px;
}
.change-discovery-body {
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.change-discovery-label {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .4px;
    color: #92400e;
}
.change-discovery-url {
    font-size: 13px;
    color: var(--text);
    word-break: break-all;
}

/* ═══════════════════════════════════════════
   Brand Perception
   ═══════════════════════════════════════════ */

.brand-queries { display: flex; flex-direction: column; gap: 0; }

.brand-query-block { border-bottom: 1px solid var(--border); }
.brand-query-block:last-child { border-bottom: none; }

.brand-query-header {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 14px 0;
    background: transparent;
    border: none;
    text-align: left;
    font-family: inherit;
    cursor: pointer;
    user-select: none;
}
.brand-query-header:hover { opacity: .85; }
.brand-query-header:focus-visible {
    outline: 2px solid rgba(79, 70, 229, .25);
    outline-offset: 2px;
}

.brand-query-header .query-text { flex: 1; }
.brand-query-header .query-intent { flex-shrink: 0; }

.brand-provider-answer {
    padding: 12px 0 16px 0;
    border-top: 1px solid var(--border);
}

.brand-provider-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.brand-answer {
    font-size: 13px;
    line-height: 1.65;
    color: var(--text-secondary);
    white-space: pre-wrap;
    word-break: break-word;
    max-height: 240px;
    overflow-y: auto;
    padding: 12px 16px;
    background: var(--bg);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
}

.brand-answer-error { color: var(--danger); font-style: italic; }
.brand-answer-empty { color: var(--text-muted); font-style: italic; }
.brand-truncated { color: var(--text-muted); font-style: italic; }

/* ═══════════════════════════════════════════
   Empty State
   ═══════════════════════════════════════════ */

.empty-state {
    text-align: center;
    padding: 100px 24px;
}

.empty-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 24px;
    background: var(--primary-light);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.empty-icon svg { width: 28px; height: 28px; color: var(--primary); }

.empty-state h2 {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 8px;
}

.empty-state p {
    color: var(--text-secondary);
    font-size: 14px;
    margin-bottom: 12px;
}

.empty-state-btn {
    width: auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin: 8px 0 0;
    min-width: 180px;
}

.empty-scan-elapsed {
    margin-top: 12px;
    text-align: center;
}

.code-block {
    display: inline-block;
    background: #0f172a;
    color: #e2e8f0;
    padding: 12px 24px;
    border-radius: var(--radius-sm);
    font-family: 'SF Mono', 'Fira Code', 'Consolas', monospace;
    font-size: 13px;
    margin: 4px 0 8px;
}

.text-muted { color: var(--text-muted); font-size: 13px; }

.scan-date {
    font-size: 12px;
    color: var(--text-muted);
    text-align: right;
    margin-bottom: -8px;
}

/* ═══════════════════════════════════════════
   Admin Panel
   ═══════════════════════════════════════════ */

.admin-badge {
    display: inline-block;
    background: #fef3c7;
    color: #d97706;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .5px;
    padding: 3px 8px;
    border-radius: 4px;
    margin-left: 8px;
    vertical-align: middle;
}

.admin-topbar .topbar-inner { max-width: 1100px; }

.admin-nav {
    display: flex;
    align-items: center;
    gap: 4px;
}

.admin-nav a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    padding: 6px 12px;
    border-radius: 6px;
    transition: background .15s, color .15s;
}

.admin-nav a:hover { background: var(--bg); color: var(--text); }
.admin-nav a.active { background: var(--primary-light); color: var(--primary); font-weight: 600; }
.admin-nav .nav-logout { color: var(--text-muted); }
.admin-nav .nav-logout:hover { color: var(--danger); }

.admin-main {
    max-width: 1100px;
    margin: 0 auto;
    padding: 28px 24px 64px;
}

.admin-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

.admin-header h2 {
    font-size: 20px;
    font-weight: 700;
}

.admin-header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.admin-grid {
    display: grid;
    gap: 20px;
}

/* ── Flash messages ── */
.flash {
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    margin-bottom: 16px;
}

.flash-success { background: var(--success-light); color: var(--success); border: 1px solid #a7f3d0; }
.flash-error   { background: var(--danger-light); color: var(--danger); border: 1px solid #fca5a5; }

/* ── Admin table ── */
.admin-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.admin-table th {
    text-align: left;
    font-size: 11px;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: .5px;
    padding: 10px 12px;
    border-bottom: 2px solid var(--border);
}

.admin-table td {
    padding: 14px 12px;
    border-bottom: 1px solid var(--bg);
    vertical-align: middle;
}

.admin-table tr:last-child td { border-bottom: none; }

.cell-center { text-align: center; }

.biz-link {
    color: var(--text);
    text-decoration: none;
    font-weight: 600;
    transition: color .15s;
}

.biz-link:hover { color: var(--primary); }

.biz-notes {
    display: block;
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 2px;
}

/* ── Status badges ── */
.status-badge {
    display: inline-block;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .4px;
    padding: 3px 10px;
    border-radius: 12px;
}

.status-badge.active   { background: var(--success-light); color: var(--success); }
.status-badge.inactive { background: var(--bg); color: var(--text-muted); }

.plan-badge {
    display: inline-block;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .4px;
    padding: 3px 10px;
    border-radius: 12px;
    background: var(--bg);
    color: var(--text-muted);
    border: 1px solid var(--border);
}
.plan-badge.plan-advanced {
    background: var(--accent-light, var(--success-light));
    color: var(--accent, var(--success));
    border-color: transparent;
}

.sub-badge {
    display: inline-block;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .4px;
    padding: 2px 8px;
    border-radius: 10px;
    background: var(--bg);
    color: var(--text-muted);
    vertical-align: middle;
}
.sub-badge.sub-active   { background: var(--success-light); color: var(--success); }
.sub-badge.sub-trialing { background: var(--accent-light, var(--success-light)); color: var(--accent, var(--success)); }
.sub-badge.sub-past_due { background: #fef3c7; color: #b45309; }
.sub-badge.sub-paused   { background: var(--bg); color: var(--text-muted); }
.sub-badge.sub-canceled { background: var(--danger-light, #fee2e2); color: var(--danger, #b91c1c); }

.cost-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 12px;
    margin-bottom: 12px;
}
.cost-cell {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 10px 12px;
    background: var(--bg);
    border-radius: 8px;
}
.cost-label { font-size: 11px; color: var(--text-muted); text-transform: uppercase; letter-spacing: .3px; }
.cost-value { font-size: 18px; font-weight: 700; }
.cost-value .pos, .cost-value.pos { color: var(--success); }
.cost-value .neg, .cost-value.neg { color: var(--danger, #b91c1c); }
.cost-sub { font-size: 11px; color: var(--text-muted); }

/* ── Worker liveness badge (admin topbar) ── */
.worker-badge {
    display: inline-block;
    margin-left: 8px;
    font-size: 11px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 10px;
    vertical-align: middle;
    white-space: nowrap;
}
.worker-badge.worker-ok      { background: var(--success-light); color: var(--success); }
.worker-badge.worker-stale   { background: #fef3c7; color: #b45309; }
.worker-badge.worker-down    { background: var(--danger-light, #fee2e2); color: var(--danger, #b91c1c); }
.worker-badge.worker-unknown { background: var(--bg); color: var(--text-muted); }

/* ── Portfolio rollup + list controls ── */
.portfolio-rollup .cost-grid { margin-bottom: 0; }

.table-controls {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    margin: 16px 0 12px;
}
.table-search {
    flex: 1 1 220px;
    max-width: 320px;
    padding: 7px 12px;
    font-size: 13px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--card-bg, #fff);
    color: var(--text);
}
.table-search:focus { outline: none; border-color: var(--primary); }
.filter-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.filter-chip {
    font-size: 12px;
    font-weight: 600;
    padding: 5px 12px;
    border-radius: 14px;
    border: 1px solid var(--border);
    background: var(--card-bg, #fff);
    color: var(--text-muted);
    cursor: pointer;
}
.filter-chip:hover { color: var(--text); border-color: var(--text-muted); }
.filter-chip.active {
    background: var(--primary-light);
    color: var(--primary);
    border-color: transparent;
}
.table-count { font-size: 12px; color: var(--text-muted); margin-left: auto; }

/* ── Sortable table headers ── */
.admin-table th.sortable { cursor: pointer; user-select: none; white-space: nowrap; }
.admin-table th.sortable:hover { color: var(--primary); }
.admin-table th.sortable::after { content: " ⇅"; opacity: .35; font-size: 10px; }
.admin-table th.sort-asc::after  { content: " ↑"; opacity: 1; }
.admin-table th.sort-desc::after { content: " ↓"; opacity: 1; }

/* ── Business-detail hero strip + cost groupings ── */
.hero-metrics { margin-bottom: 20px; }
.hero-metrics .metric-card { padding: 18px 20px; text-align: left; }
.metric-value-sm { font-size: 18px; }
.metric-value.metric-pos { color: var(--success); }
.metric-value.metric-neg { color: var(--danger, #b91c1c); }

.cost-card .cost-subhead {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .4px;
    color: var(--text-muted);
    margin: 4px 0 8px;
}
.cost-card .cost-subhead:not(:first-of-type) { margin-top: 18px; }
.cost-card .cost-subhead .hint { text-transform: none; letter-spacing: 0; font-weight: 400; }

/* ── One-time access-key reveal banner ── */
.key-reveal-banner {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 20px;
    padding: 14px 16px;
    background: #fffbeb;
    border: 1px solid #fcd34d;
    border-left: 4px solid #f59e0b;
    border-radius: 8px;
}
.key-reveal-title { font-size: 13px; font-weight: 700; color: #b45309; }
.key-reveal-row { display: flex; align-items: center; gap: 8px; margin: 8px 0 6px; flex-wrap: wrap; }
.key-reveal-value {
    font-size: 15px;
    font-weight: 700;
    letter-spacing: .5px;
    padding: 4px 10px;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 6px;
    user-select: all;
}
.key-reveal-hint { font-size: 11px; color: var(--text-muted); }
.key-reveal-dismiss {
    flex: none;
    background: none;
    border: none;
    font-size: 20px;
    line-height: 1;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0 4px;
}
.key-reveal-dismiss:hover { color: var(--text); }

.btn-copy.copied { background: var(--success-light); color: var(--success); border-color: transparent; }

/* ── Sticky save bar (long config form) ── */
.form-actions-sticky {
    position: sticky;
    bottom: 0;
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 24px -24px -24px;     /* bleed to the card edges (card padding is 24px) */
    padding: 14px 24px;
    background: var(--surface);
    border-top: 1px solid var(--border);
    border-radius: 0 0 var(--radius) var(--radius);
    z-index: 5;
}
.form-actions-hint { font-size: 12px; color: var(--text-muted); margin-left: auto; }

/* ── Failed-scan flag (business list) ── */
.scan-error-flag {
    display: inline-block;
    margin-top: 3px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .3px;
    padding: 2px 7px;
    border-radius: 10px;
    background: var(--danger-light, #fee2e2);
    color: var(--danger, #b91c1c);
}

/* ── Small buttons ── */
.btn-sm {
    display: inline-block;
    padding: 8px 16px;
    font-size: 13px;
    font-weight: 600;
    font-family: inherit;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface);
    color: var(--text);
    text-decoration: none;
    cursor: pointer;
    transition: background .15s, border-color .15s;
}

.btn-sm:hover { background: var(--bg); }

.btn-primary-sm {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

.btn-primary-sm:hover { background: var(--primary-hover); border-color: var(--primary-hover); }

.btn-xs {
    display: inline-block;
    padding: 4px 10px;
    font-size: 12px;
    font-weight: 600;
    font-family: inherit;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--surface);
    color: var(--text-secondary);
    text-decoration: none;
    cursor: pointer;
    transition: background .15s;
}

.btn-xs:hover { background: var(--bg); }

.btn-danger-xs { color: var(--danger); border-color: #fca5a5; }
.btn-danger-xs:hover { background: var(--danger-light); }

.btn-success-xs { color: var(--success); border-color: #a7f3d0; }
.btn-success-xs:hover { background: var(--success-light); }

.action-group { display: flex; gap: 6px; align-items: center; }

/* ── Key display ── */
.key-display {
    font-family: 'SF Mono', 'Fira Code', monospace;
    font-size: 12px;
    background: var(--bg);
    padding: 3px 8px;
    border-radius: 4px;
    color: var(--text-secondary);
}

/* ── Info grid ── */
.info-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.info-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.info-label {
    font-size: 11px;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: .5px;
}

.info-value {
    font-size: 14px;
    font-weight: 500;
    color: var(--text);
}

/* ── Config sections ── */
.config-section {
    margin-bottom: 24px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--border);
}

.config-section:last-of-type { border-bottom: none; }

.config-section h4 {
    font-size: 13px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 14px;
}

/* ── Form elements ── */
.form-row {
    margin-bottom: 14px;
}

.form-row label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.form-row input[type="text"],
.form-row input[type="number"],
.form-row input[type="password"],
.form-row textarea {
    width: 100%;
    padding: 9px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-family: inherit;
    outline: none;
    transition: border-color .15s, box-shadow .15s;
}

.form-row textarea {
    font-family: 'SF Mono', 'Fira Code', monospace;
    font-size: 12px;
    resize: vertical;
}

.form-row input:focus,
.form-row textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, .1);
}

.form-row-inline {
    display: grid;
    grid-template-columns: 180px 1fr;
    align-items: center;
    gap: 12px;
}

.form-row-inline label { margin-bottom: 0; }
.form-row-inline .form-hint { grid-column: 2; }

.form-hint {
    display: block;
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 4px;
}

.form-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 20px;
}

.btn-cancel {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    padding: 10px 16px;
    transition: color .15s;
}

.btn-cancel:hover { color: var(--text); }

/* ── Checkbox group ── */
.checkbox-group {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: var(--text-secondary);
    cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
    accent-color: var(--primary);
    width: 16px;
    height: 16px;
}

/* ── Formula preview ── */
.formula-preview {
    background: #0f172a;
    color: #e2e8f0;
    padding: 14px 20px;
    border-radius: var(--radius-sm);
    font-family: 'SF Mono', 'Fira Code', monospace;
    font-size: 13px;
    margin-bottom: 24px;
    text-align: center;
}

/* ── Empty admin state ── */
.empty-admin {
    text-align: center;
    padding: 48px 24px;
    color: var(--text-muted);
}

.empty-admin p { margin-bottom: 16px; }

/* ── Prompt override UI ── */
.prompt-label-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
}

.prompt-label-row label { margin-bottom: 0; }

.prompt-badge {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .4px;
    padding: 2px 8px;
    border-radius: 10px;
    flex-shrink: 0;
}

.prompt-badge-default { background: var(--bg); color: var(--text-muted); }
.prompt-badge-custom  { background: #ede9fe; color: #6366f1; }

.prompt-default-toggle {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 6px;
}

.btn-toggle-default {
    background: none;
    border: none;
    padding: 0;
    font-size: 12px;
    color: var(--text-muted);
    cursor: pointer;
    font-family: inherit;
    transition: color .15s;
}

.btn-toggle-default:hover { color: var(--primary); }
.btn-toggle-default .toggle-icon { font-size: 10px; }

.btn-reset-prompt {
    background: none;
    border: none;
    padding: 0;
    font-size: 12px;
    color: var(--danger);
    cursor: pointer;
    font-family: inherit;
    transition: color .15s;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.btn-reset-prompt:hover { color: #b91c1c; }

.prompt-default-preview {
    margin-top: 10px;
    padding: 14px 16px;
    background: #0f172a;
    color: #94a3b8;
    border-radius: var(--radius-sm);
    font-family: 'SF Mono', 'Fira Code', monospace;
    font-size: 11px;
    line-height: 1.6;
    white-space: pre-wrap;
    word-break: break-word;
    max-height: 320px;
    overflow-y: auto;
    border: 1px solid #1e293b;
}

/* ── Scan status feedback ── */
.scan-spinner {
    display: inline-block;
    width: 12px;
    height: 12px;
    border: 2px solid rgba(255,255,255,.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin .7s linear infinite;
    vertical-align: middle;
    margin-right: 6px;
}
@keyframes spin { to { transform: rotate(360deg); } }

.scan-elapsed {
    color: #94a3b8;
    font-size: 12px;
    margin-left: 12px;
    font-variant-numeric: tabular-nums;
}
.scan-message {
    margin-top: 10px;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 13px;
}
.scan-success {
    background: rgba(34,197,94,.12);
    color: #22c55e;
    border: 1px solid rgba(34,197,94,.25);
}
.scan-error {
    background: rgba(239,68,68,.12);
    color: #ef4444;
    border: 1px solid rgba(239,68,68,.25);
}

/* ── Sparklines ── */
.sparkline {
    vertical-align: middle;
}
.trend-single, .trend-none {
    color: #64748b;
    font-size: 12px;
}

/* ── Scan history / audit log ── */
.scan-history-table {
    font-size: 13px;
}
.scan-history-table td {
    vertical-align: middle;
}
.cell-nowrap {
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
    font-size: 12px;
    color: #94a3b8;
}
.score-up {
    color: #22c55e;
    font-weight: 600;
    font-size: 12px;
}
.score-down {
    color: #ef4444;
    font-weight: 600;
    font-size: 12px;
}
.score-flat {
    color: #475569;
    font-size: 12px;
}
.rank-pills {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
}
.rank-pill {
    display: inline-block;
    background: var(--bg);
    color: #94a3b8;
    font-size: 10px;
    padding: 2px 5px;
    border-radius: 4px;
    font-family: 'SF Mono', 'Fira Code', monospace;
    border: 1px solid var(--border);
}
.prompt-hash {
    font-size: 11px;
    color: #64748b;
    background: var(--bg);
    padding: 2px 6px;
    border-radius: 4px;
}
.hash-changed {
    color: #f59e0b;
    background: rgba(245,158,11,.1);
    border: 1px solid rgba(245,158,11,.25);
}

/* ── Admin responsive ── */
@media (max-width: 768px) {
    .admin-nav { gap: 2px; }
    .admin-nav a { font-size: 12px; padding: 5px 8px; }
    .admin-table { font-size: 13px; }
    .admin-table th, .admin-table td { padding: 10px 8px; }
    .info-grid { grid-template-columns: 1fr; }
    .form-row-inline { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
    .admin-main { padding: 16px 12px 48px; }
    .admin-header h2 { font-size: 17px; }
    .admin-nav { flex-wrap: wrap; }
    .admin-table { font-size: 12px; }
    .admin-table th:nth-child(n+5),
    .admin-table td:nth-child(n+5) { display: none; }
    .scan-history-table th:nth-child(n+4),
    .scan-history-table td:nth-child(n+4) { display: none; }
}

/* ═══════════════════════════════════════════
   Responsive
   ═══════════════════════════════════════════ */

@media (max-width: 900px) {
    .charts-grid { grid-template-columns: 1fr; }
    .two-col { grid-template-columns: 1fr; }
    .metrics-grid { grid-template-columns: repeat(3, 1fr); gap: 10px; }
    .metric-card { padding: 20px 12px; }
    .metric-label { font-size: 10px; letter-spacing: .5px; }
    .metric-value { font-size: 40px; }
}

@media (max-width: 768px) {
    .metrics-grid { grid-template-columns: 1fr 1fr; }
    .metrics-grid .card:last-child { grid-column: 1 / -1; }
    .explainer {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    .explainer .scan-date {
        white-space: normal;
        align-self: flex-end;
    }
}

@media (max-width: 640px) {
    /* ── Login ── */
    .login-container { padding: 32px 24px; margin: 16px; }

    /* ── Top bar ── */
    .topbar-inner {
        padding: 0 12px;
        height: 48px;
    }
    .brand { font-size: 14px; }
    .topbar-right { gap: 10px; }
    .business-badge { font-size: 11px; padding: 4px 10px; }
    .btn-signout { font-size: 12px; }

    /* ── Dashboard shell ── */
    .dashboard { padding: 16px 12px 48px; }
    .dashboard > * + * { margin-top: 14px; }
    .dashboard-views { gap: 8px; margin-top: 4px; }
    .dashboard-view-tab { font-size: 12px; padding: 8px 12px; }

    /* ── Explainer banner: stack vertically ── */
    .explainer {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
        padding: 14px 16px;
        font-size: 13px;
    }
    .explainer .scan-date {
        white-space: normal;
        align-self: flex-end;
    }

    /* ── Metric cards: single column, compact ── */
    .metrics-grid { grid-template-columns: 1fr; gap: 10px; }
    .metric-card { padding: 20px 16px; }
    .metric-value { font-size: 40px; }

    /* ── Cards ── */
    .card { padding: 16px; }

    /* ── Charts: taller on mobile for legibility ── */
    .chart-container { height: 220px; }

    /* ── Provider rows: compact layout ── */
    .provider-row {
        flex-wrap: wrap;
        gap: 6px;
        padding: 10px 8px;
    }
    .provider-name { width: 72px; font-size: 13px; }
    .provider-rank { font-size: 18px; width: 36px; }
    .provider-change { width: 50px; font-size: 11px; }
    .provider-bar-container { flex: 1; min-width: 60px; }
    .provider-vis { width: 36px; font-size: 12px; }
    .expand-arrow { width: 16px; font-size: 10px; }

    /* ── Query browser rows: stack on mobile ── */
    .query-row {
        flex-wrap: wrap;
        gap: 8px;
        padding: 12px 8px;
    }
    .query-text {
        flex: 1 1 100%;
        font-size: 13px;
        line-height: 1.4;
    }
    .query-intent {
        font-size: 10px;
        padding: 2px 6px;
    }
    .query-providers-summary { gap: 3px; }
    .qps-dot { width: 24px; height: 24px; font-size: 10px; }
    .expand-arrow { margin-left: auto; }

    /* ── Drill-down details ── */
    .dq-header { flex-wrap: wrap; gap: 6px; }
    .dq-text { font-size: 12px; margin-right: 0; }
    .dq-list li { font-size: 12px; grid-template-columns: 20px 1fr; }
    .dq-source { font-size: 10px; padding: 4px 8px; }
    .dq-source-url { font-size: 10px; }
    .dq-tag { font-size: 9px; padding: 1px 5px; }

    /* ── Recommendations ── */
    .rec-item { gap: 10px; }
    .rec-title { font-size: 13px; }
    .rec-detail { font-size: 12px; }

    /* ── Source attribution ── */
    .source-label { width: 48px; font-size: 12px; }
    .source-pct { font-size: 12px; }
    .source-legend { gap: 10px; font-size: 11px; }

    /* ── Dense data views: keep tables scrollable on mobile ── */
    .heatmap-wrap:not(.v2-heatmap-wrap),
    .geo-table-wrap:not(.v2-heatmap-wrap) { display: none; }
    .heatmap-mobile-list,
    .geo-mobile-list { display: flex; }

    /* ── Changes feed ── */
    .change-item { font-size: 12px; gap: 8px; }
    .change-badge { font-size: 10px; min-width: 28px; padding: 2px 6px; }

    /* ── Empty state ── */
    .empty-state { padding: 60px 16px; }
    .code-block { font-size: 11px; padding: 10px 16px; }
}

/* ── Extra small (< 380px, e.g. iPhone SE) ── */
@media (max-width: 380px) {
    .brand { font-size: 13px; }
    .business-badge { font-size: 10px; padding: 3px 8px; }
    .metric-value { font-size: 36px; }
    .provider-name { width: 64px; font-size: 12px; }
    .provider-rank { font-size: 16px; width: 32px; }
    .provider-change { width: 44px; font-size: 10px; }
}

/* ─── Brand Score Pills ─── */
.brand-score-pills {
    display: inline-flex;
    gap: 4px;
    margin-left: 8px;
}
.brand-pill {
    display: inline-block;
    font-size: 11px;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 4px;
    background: var(--bg);
    color: var(--text-secondary);
}
.brand-pill[class*="sentiment-4"],
.brand-pill[class*="sentiment-5"],
.brand-pill[class*="accuracy-4"],
.brand-pill[class*="accuracy-5"],
.brand-pill[class*="completeness-4"],
.brand-pill[class*="completeness-5"] {
    background: var(--success-light);
    color: var(--success);
}
.brand-pill[class*="sentiment-1"],
.brand-pill[class*="sentiment-2"],
.brand-pill[class*="accuracy-1"],
.brand-pill[class*="accuracy-2"],
.brand-pill[class*="completeness-1"],
.brand-pill[class*="completeness-2"] {
    background: var(--danger-light);
    color: var(--danger);
}
.brand-score-summary {
    font-size: 13px;
    color: var(--text-muted);
    font-style: italic;
    padding: 4px 0 2px 24px;
}

/* ─── Geographic Breakdown Table ─── */
.geo-table-wrap {
    overflow-x: auto;
}
.geo-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}
.geo-table th, .geo-table td {
    padding: 10px 12px;
    text-align: left;
    border-bottom: 1px solid var(--border);
}
.geo-table th {
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: var(--text-muted);
}
.geo-prov-col {
    width: 48px;
    text-align: center;
}
.geo-prov-dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
}
.geo-area {
    font-weight: 500;
}
.geo-vis-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 120px;
}
.geo-vis-fill {
    height: 6px;
    border-radius: 3px;
    background: var(--primary);
    flex-shrink: 0;
}
.geo-vis-label {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    white-space: nowrap;
}
.geo-rank-cell {
    text-align: center;
}
.geo-rank {
    font-weight: 600;
    font-size: 14px;
}
.geo-rank-none {
    color: var(--text-muted);
}

.geo-mobile-list {
    display: none;
}

.geo-mobile-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
}

.geo-mobile-ranks {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 10px;
}

/* ═══════════════════════════════════════════
   Visibility Gauge
   ═══════════════════════════════════════════ */

.gauge-card { padding: 24px 24px 20px; }

.gauge-wrap {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 6px;
}

.gauge-svg {
    width: 140px;
    height: 90px;
}

.gauge-fill {
    transition: stroke-dasharray .8s ease;
}

.gauge-value {
    font-size: 42px;
    font-weight: 700;
    letter-spacing: -2px;
    line-height: 1;
    margin-top: -38px;
}

.gauge-zone {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .5px;
    color: var(--text-muted);
    margin-top: 4px;
}

/* ═══════════════════════════════════════════
   Cross-Provider Heatmap
   ═══════════════════════════════════════════ */

.heatmap-wrap {
    overflow-x: auto;
}

.heatmap-mobile-list {
    display: none;
}

.heatmap-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.heatmap-row-clickable {
    cursor: pointer;
    transition: background .12s;
}
.heatmap-row-clickable:hover {
    background: #f8fafc;
}
.heatmap-row-clickable:hover .heatmap-query {
    color: var(--primary);
}

.query-browser-explainer {
    font-size: 13px;
    color: var(--text-muted);
    margin: -8px 0 16px;
}

.heatmap-table th,
.heatmap-table td {
    padding: 10px 12px;
    border-bottom: 1px solid var(--border);
}

.heatmap-query-col {
    text-align: left;
    width: 100%;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: none;
    letter-spacing: .2px;
}

.heatmap-prov-col {
    text-align: center;
    width: 72px;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: none;
    letter-spacing: .2px;
}

.heatmap-prov-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: 4px;
    vertical-align: middle;
}

.heatmap-prov-name {
    vertical-align: middle;
}

.heatmap-query {
    font-size: 13px;
    color: var(--text-secondary);
    white-space: normal;
    overflow-wrap: anywhere;
    line-height: 1.4;
}

.heatmap-cell {
    text-align: center;
    font-weight: 700;
    font-size: 13px;
    width: 72px;
}

.heatmap-mobile-list {
    flex-direction: column;
    gap: 12px;
}

.heatmap-mobile-card,
.geo-mobile-card {
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 14px;
    background: var(--surface);
}

.heatmap-mobile-query {
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 10px;
    line-height: 1.5;
}

.heatmap-mobile-providers {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.heatmap-mobile-pill {
    display: inline-flex;
    align-items: center;
    padding: 4px 8px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
}

.heatmap-rank-1 { background: #dcfce7; color: #15803d; }
.heatmap-rank-2 { background: #ecfdf5; color: #059669; }
.heatmap-rank-3 { background: #f0fdf4; color: #16a34a; }
.heatmap-rank-4 { background: #fffbeb; color: #d97706; }
.heatmap-rank-5 { background: #fef3c7; color: #b45309; }
.heatmap-rank-low { background: #fef2f2; color: #dc2626; }
.heatmap-mentioned { background: #f0fdf4; color: #059669; }
.heatmap-miss { color: var(--text-muted); background: var(--bg); }

/* ═══════════════════════════════════════════
   Recommendations (updated with priority)
   ═══════════════════════════════════════════ */

.rec-icon {
    width: 32px;
    height: 32px;
    min-width: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    margin-top: 1px;
}

.rec-icon-content  { background: #eef2ff; color: #4f46e5; }
.rec-icon-reviews  { background: #fef3c7; color: #d97706; }
.rec-icon-technical { background: #f0fdf4; color: #059669; }
.rec-icon-social   { background: #fce7f3; color: #db2777; }
.rec-icon-media    { background: #ecfeff; color: #0891b2; }

.rec-body { flex: 1; min-width: 0; }

.rec-title-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 2px;
}

.rec-impact {
    display: inline-block;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .4px;
    padding: 2px 8px;
    border-radius: 10px;
    flex-shrink: 0;
}

.rec-impact-high   { background: #dcfce7; color: #15803d; }
.rec-impact-medium { background: #fef3c7; color: #b45309; }
.rec-impact-low    { background: var(--bg); color: var(--text-muted); }

.rec-category {
    display: inline-block;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .4px;
    color: var(--text-muted);
    margin-bottom: 4px;
}

/* ═══════════════════════════════════════════
   Heatmap & Gauge Responsive
   ═══════════════════════════════════════════ */

@media (max-width: 640px) {
    .gauge-svg { width: 110px; height: 72px; }
    .gauge-value { font-size: 34px; margin-top: -32px; }
    .heatmap-prov-name { display: none; }
    .heatmap-prov-col { width: 40px; }
    .heatmap-query { max-width: 140px; font-size: 12px; }
    .heatmap-cell { width: 40px; font-size: 12px; }
    .rec-icon { width: 28px; height: 28px; min-width: 28px; font-size: 13px; border-radius: 6px; }
}

/* ═══════════════════════════════════════════
   Expanded Queries (Real-World Query Types)
   ═══════════════════════════════════════════ */

.expanded-queries { display: flex; flex-direction: column; gap: 24px; }

.expanded-subtype-group { display: flex; flex-direction: column; gap: 0; }

.expanded-subtype-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 0 8px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 4px;
}

.expanded-subtype-icon {
    width: 28px;
    height: 28px;
    min-width: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    font-size: 14px;
}

.expanded-icon-comparison { background: #ede9fe; color: #7c3aed; }
.expanded-icon-situational { background: #e0f2fe; color: #0284c7; }
.expanded-icon-problem { background: #fef3c7; color: #d97706; }
.expanded-icon-review { background: #ecfdf5; color: #059669; }

.expanded-subtype-label {
    font-weight: 600;
    font-size: 14px;
    color: var(--text);
}

.expanded-subtype-desc {
    font-size: 12px;
    color: var(--text-muted);
}

.expanded-recommended {
    font-size: 11px;
    color: var(--primary);
    font-weight: 500;
    margin-left: auto;
    padding: 2px 8px;
    background: var(--primary-light);
    border-radius: 4px;
}

.expanded-mentions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    padding: 8px 0 4px;
}

.expanded-mentions-label {
    font-size: 11px;
    color: var(--text-muted);
    font-weight: 500;
}

.expanded-mention-chip {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 500;
    background: #f1f5f9;
    color: var(--text-secondary);
}

.expanded-mention-chip.is-target {
    background: var(--primary-light);
    color: var(--primary);
    font-weight: 600;
}

@media (max-width: 640px) {
    .expanded-subtype-desc { display: none; }
    .expanded-recommended { display: none; }
}

/* ═══════════════════════════════════════════
   V2 Dashboard Redesign
   ═══════════════════════════════════════════ */

/* ── Score Strip (top of Visibility view) ── */
.v2-score-strip {
    display: flex;
    align-items: center;
    gap: 32px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px 32px;
    box-shadow: var(--shadow);
}

.v2-score-main {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 160px;
}

.v2-gauge-wrap {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 4px;
}

.v2-quick-stats {
    display: flex;
    gap: 32px;
    flex: 1;
    justify-content: center;
}

.v2-stat { text-align: center; }

.v2-stat-value {
    font-size: 36px;
    font-weight: 700;
    letter-spacing: -1px;
    line-height: 1.1;
    color: var(--text);
}

.v2-stat-denom {
    font-size: 20px;
    font-weight: 400;
    color: var(--text-muted);
}

.v2-stat-label {
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 500;
    margin-top: 2px;
}

.v2-stat-detail {
    display: block;
    font-size: 11px;
    color: var(--text-muted);
    font-weight: 400;
}

/* ── Recommendations (top priority card) ── */
.v2-recs-card {
    border-left: 4px solid var(--primary);
}

.v2-recs-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.v2-rec-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 8px 0;
    border-bottom: 1px solid var(--bg);
}

.v2-rec-item:last-child { border-bottom: none; }

.v2-rec-impact {
    display: inline-block;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .4px;
    padding: 3px 10px;
    border-radius: 10px;
    flex-shrink: 0;
    margin-top: 2px;
    min-width: 56px;
    text-align: center;
}

.v2-rec-impact-high { background: #dcfce7; color: #15803d; }
.v2-rec-impact-medium { background: #fef3c7; color: #b45309; }
.v2-rec-impact-low { background: var(--bg); color: var(--text-muted); }

.v2-rec-body { flex: 1; min-width: 0; }

.v2-rec-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
    line-height: 1.4;
}

.v2-rec-detail {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.5;
    margin-top: 2px;
}

/* ── Provider Grid (compact cards, no expand) ── */
.v2-provider-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 12px;
}

.v2-provider-card {
    background: var(--bg);
    border-radius: var(--radius-sm);
    padding: 14px 16px;
}

.v2-prov-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.v2-prov-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}

.v2-prov-name {
    font-size: 14px;
    font-weight: 600;
    flex: 1;
}

.v2-prov-rank {
    font-size: 20px;
    font-weight: 700;
}

.v2-prov-rank.rank-none { color: var(--text-muted); font-size: 16px; }

.v2-prov-change {
    font-size: 11px;
    font-weight: 700;
}

.v2-prov-bar-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.v2-prov-bar-track {
    flex: 1;
    height: 6px;
    background: var(--surface);
    border-radius: 3px;
    overflow: hidden;
}

.v2-prov-bar-fill {
    height: 100%;
    border-radius: 3px;
    transition: width .6s ease;
}

.v2-prov-vis {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    flex-shrink: 0;
    width: 36px;
    text-align: right;
}

.v2-prov-top {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.v2-top-biz {
    display: inline-block;
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 4px;
    background: var(--surface);
    color: var(--text-secondary);
    font-weight: 500;
}

.v2-top-biz.is-you {
    background: var(--primary-light);
    color: var(--primary);
    font-weight: 600;
}

/* ── Heatmap v2 (horizontally scrollable on mobile) ── */
.v2-heatmap-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.v2-heatmap-scroll-hint {
    display: none;
    font-size: 11px;
    color: var(--text-muted);
    text-align: center;
    padding-top: 8px;
}

/* ── Query Feed (inline cards, no drill-downs) ── */
.v2-query-feed {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.v2-query-card {
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 16px;
    background: var(--surface);
}

.v2-query-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.v2-query-text {
    font-size: 15px;
    font-weight: 600;
    color: var(--text);
    flex: 1;
    min-width: 200px;
}

.v2-query-providers {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    gap: 14px;
}

.v2-qp-block {
    background: var(--bg);
    border-radius: 8px;
    padding: 14px 16px;
}

.v2-qp-header {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 6px;
}

.v2-qp-name {
    font-size: 12px;
    font-weight: 600;
    flex: 1;
}

/* ── Inline ranked lists ── */
.v2-ranked-list {
    list-style: none;
    counter-reset: v2-rank;
    padding: 0;
    margin: 0;
}

.v2-ranked-list li {
    counter-increment: v2-rank;
    display: flex;
    align-items: baseline;
    gap: 7px;
    padding: 5px 0;
    font-size: 12.5px;
    line-height: 1.35;
    color: var(--text-secondary);
}

.v2-ranked-list li::before {
    content: counter(v2-rank) ".";
    font-weight: 600;
    color: var(--text-muted);
    min-width: 16px;
    flex-shrink: 0;
}

.v2-ranked-list li.is-target {
    color: var(--primary);
    font-weight: 600;
}

.v2-ranked-list li.is-target .v2-rl-name {
    color: var(--primary);
}

.v2-rl-name {
    flex: 1;
    min-width: 0;
    font-weight: 500;
    white-space: normal;
    overflow-wrap: anywhere;
}

.v2-rl-more {
    color: var(--text-muted);
    font-style: italic;
    font-size: 11px;
    padding-top: 2px;
}

.v2-rl-more::before { content: none; }

/* ── Answer previews (inline) ── */
.v2-answer-preview {
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.55;
    margin-top: 4px;
    padding: 6px 0;
    border-top: 1px solid var(--border);
}

.v2-answer-error {
    color: var(--danger);
}

.v2-brand-summary {
    font-size: 12px;
    color: var(--text-muted);
    font-style: italic;
    margin-top: 2px;
    margin-bottom: 4px;
}

/* ── Mention chips (inline) ── */
.v2-mentions-row {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 6px;
}

.v2-mention-chip {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 500;
    background: #f1f5f9;
    color: var(--text-secondary);
}

.v2-mention-chip.is-target {
    background: var(--primary-light);
    color: var(--primary);
    font-weight: 600;
}

/* ── Subtype dividers ── */
.v2-subtype-divider {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 0;
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    border-bottom: 1px solid var(--border);
}

.v2-subtype-icon {
    width: 26px;
    height: 26px;
    min-width: 26px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    font-size: 13px;
}

/* ── Collapsible section (Geography) ── */
.v2-section-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    background: none;
    border: none;
    cursor: pointer;
    font-family: inherit;
    padding: 0;
}

.v2-toggle-arrow {
    font-size: 14px;
    color: var(--text-muted);
    transition: transform .2s;
}

.v2-collapsible {
    max-height: 0;
    overflow: hidden;
    transition: max-height .3s ease, margin .2s ease;
    margin-top: 0;
}

.v2-expanded .v2-toggle-arrow {
    transform: rotate(-180deg);
}

.v2-expanded .v2-collapsible {
    max-height: 2000px;
    margin-top: 16px;
}

/* ═══════════════════════════════════════════
   V3 Analytical Refinements
   ═══════════════════════════════════════════ */

/* ── Sentence-case headings ── */
.card h3 {
    text-transform: none;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    letter-spacing: .2px;
}

/* ── Compact metadata bar (replaces gauge) ── */
.v3-meta-bar {
    display: flex;
    align-items: center;
    gap: 16px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 12px 20px;
    box-shadow: var(--shadow);
    flex-wrap: wrap;
    font-size: 14px;
    color: var(--text-secondary);
}

.v3-meta-score {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

.v3-score-num {
    font-size: 24px;
    font-weight: 700;
    color: var(--text);
    letter-spacing: -1px;
    line-height: 1;
}

.v3-score-denom {
    font-size: 14px;
    font-weight: 400;
    color: var(--text-muted);
}

.v3-score-bar {
    width: 48px;
    height: 4px;
    background: #e2e8f0;
    border-radius: 2px;
    overflow: hidden;
    margin-left: 4px;
}

.v3-score-bar-fill {
    height: 100%;
    background: var(--text-secondary);
    border-radius: 2px;
    transition: width .4s ease;
}

.v3-meta-sep {
    width: 1px;
    height: 16px;
    background: var(--border);
    flex-shrink: 0;
}

.v3-meta-item {
    white-space: nowrap;
    font-size: 13px;
}

.v3-meta-item strong {
    color: var(--text);
    font-weight: 600;
}

.v3-meta-date {
    color: var(--text-muted);
    font-size: 12px;
}

.v3-meta-delta {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-muted);
}

.v3-meta-delta.v3-up { color: #059669; }
.v3-meta-delta.v3-down { color: #dc2626; }

/* ── Provider list (subtle left-border rows) ── */
.v3-provider-list {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.v3-provider-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-left: 3px solid var(--border);
    border-bottom: 1px solid var(--bg);
    flex-wrap: wrap;
}

.v3-provider-row:last-child { border-bottom: none; }

.v3-prov-name {
    font-size: 13px;
    font-weight: 600;
    width: 80px;
    flex-shrink: 0;
    color: var(--text);
}

.v3-prov-rank {
    font-size: 16px;
    font-weight: 700;
    width: 36px;
    text-align: center;
    flex-shrink: 0;
    color: var(--text);
}

.v3-prov-rank.rank-none { color: var(--text-muted); }

.v3-prov-delta {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    width: 40px;
    flex-shrink: 0;
}

.v3-prov-delta.v3-up { color: #059669; }
.v3-prov-delta.v3-down { color: #dc2626; }

.v3-prov-bar {
    flex: 1;
    height: 4px;
    background: #e2e8f0;
    border-radius: 2px;
    overflow: hidden;
    min-width: 60px;
}

.v3-prov-bar-fill {
    height: 100%;
    background: var(--text-muted);
    border-radius: 2px;
    transition: width .4s ease;
}

.v3-prov-pct {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-secondary);
    width: 32px;
    text-align: right;
    flex-shrink: 0;
}

.v3-prov-top {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    width: 100%;
    padding-left: 3px;
}

.v3-top-biz {
    font-size: 11px;
    color: var(--text-muted);
    font-weight: 400;
}

.v3-top-biz.is-you {
    color: var(--text);
    font-weight: 600;
    text-decoration: underline;
    text-decoration-color: var(--border);
    text-underline-offset: 2px;
}

.v3-top-biz + .v3-top-biz::before {
    content: "\00b7  ";
    color: var(--border);
}

/* ── Change tags (muted) ── */
.v3-change-tag {
    display: inline-block;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    background: var(--bg);
    padding: 2px 8px;
    border-radius: 4px;
    min-width: 40px;
    text-align: center;
    flex-shrink: 0;
}

.v3-change-pos { color: #059669; background: #f0fdf4; }
.v3-change-neg { color: #dc2626; background: #fef2f2; }

/* ── Recommendations (muted, at bottom) ── */
.v3-recs-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.v3-rec-item {
    display: flex;
    align-items: baseline;
    gap: 10px;
    padding: 6px 0;
    border-bottom: 1px solid var(--bg);
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.5;
}

.v3-rec-item:last-child { border-bottom: none; }

.v3-rec-impact {
    font-size: 11px;
    font-weight: 500;
    color: var(--text-muted);
    text-transform: lowercase;
    flex-shrink: 0;
    min-width: 32px;
}

.v3-rec-body { flex: 1; min-width: 0; }

.v3-rec-title {
    font-weight: 500;
    color: var(--text);
}

.v3-rec-detail {
    font-weight: 400;
    color: var(--text-muted);
}

/* ── Muted source tags (replaces colored ones) ── */
.v3-tag {
    display: inline-block;
    font-size: 10px;
    font-weight: 500;
    color: var(--text-muted);
    border: 1px solid var(--border);
    padding: 1px 6px;
    border-radius: 3px;
    text-transform: lowercase;
    letter-spacing: .2px;
}

/* ── Query provider blocks with left border ── */
.v3-qp-block {
    border-left: 3px solid var(--border);
    background: var(--bg);
    padding-left: 10px;
}

/* ── Muted source bars (single color) ── */
.v3-source-bar {
    background: var(--text-muted);
}

/* ── Brand perception summary table ── */
.v3-brand-table-wrap,
.v3-expanded-table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.v3-brand-table,
.v3-expanded-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.v3-brand-table th,
.v3-brand-table td,
.v3-expanded-table th,
.v3-expanded-table td {
    padding: 8px 10px;
    border-bottom: 1px solid var(--border);
    text-align: left;
}

.v3-brand-table th,
.v3-expanded-table th {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
}

.v3-brand-table th:not(:first-child) {
    text-align: center;
    width: 72px;
}

.v3-brand-cell {
    text-align: center;
}

.v3-brand-query {
    font-size: 13px;
    color: var(--text-secondary);
    max-width: 280px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.v3-sentiment {
    display: inline-block;
    font-size: 11px;
    font-weight: 500;
    padding: 2px 8px;
    border-radius: 3px;
    color: var(--text-secondary);
    background: var(--bg);
}

.v3-sentiment-positive { color: #059669; background: #f0fdf4; }
.v3-sentiment-negative { color: #dc2626; background: #fef2f2; }
.v3-sentiment-neutral  { color: var(--text-muted); background: var(--bg); }
.v3-sentiment-miss     { color: var(--text-muted); background: transparent; }
.v3-sentiment-err      { color: var(--text-muted); background: transparent; }

/* ── Expanded query mention summary ── */
.v3-eq-query {
    max-width: 360px;
}

.v3-eq-text {
    display: block;
    font-size: 13px;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.v3-eq-subtype {
    display: block;
    font-size: 10px;
    color: var(--text-muted);
    font-weight: 500;
    margin-top: 1px;
}

.v3-eq-mention {
    white-space: nowrap;
}

.v3-eq-ratio {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
}

.v3-eq-full { color: #059669; }
.v3-eq-none { color: var(--text-muted); }

.v3-eq-sentiment {
    white-space: nowrap;
}

/* ── Heatmap: remove colored dots from headers ── */
.heatmap-rank-1 { background: #f0fdf4; color: #15803d; }
.heatmap-rank-2,
.heatmap-rank-3 { background: var(--bg); color: var(--text-secondary); }
.heatmap-rank-4,
.heatmap-rank-5 { background: var(--bg); color: var(--text-muted); }

/* ── V2 Responsive ── */
@media (max-width: 900px) {
    .v2-score-strip {
        flex-direction: column;
        gap: 16px;
        padding: 20px 24px;
    }
    .v2-quick-stats { gap: 24px; }
}

@media (max-width: 640px) {
    .v3-meta-bar { padding: 10px 14px; gap: 10px; }
    .v3-score-num { font-size: 20px; }
    .v3-meta-sep { display: none; }
    .v3-meta-item { font-size: 12px; }
    .v3-provider-row { gap: 8px; padding: 8px 10px; }
    .v3-prov-name { width: 64px; font-size: 12px; }
    .v3-prov-rank { font-size: 14px; width: 28px; }
    .v2-provider-grid { grid-template-columns: 1fr; }
    .v2-query-providers { grid-template-columns: 1fr; }
    .v2-query-text { font-size: 13px; min-width: 0; }
    .v2-heatmap-scroll-hint { display: block; }
    .heatmap-wrap.v2-heatmap-wrap { display: block; }
}

@media (max-width: 380px) {
    .v2-stat-value { font-size: 24px; }
    .v2-prov-rank { font-size: 16px; }
}

/* ═══════════════════════════════════════════
   Landing Page
   ═══════════════════════════════════════════ */

.landing-page {
    background: #ffffff;
    min-height: 100vh;
    overflow-x: hidden;
}

html { scroll-behavior: smooth; }

/* ── Nav ── */

.landing-nav {
    position: sticky;
    top: 0;
    z-index: 10;
    background: #ffffff;
    border-bottom: 1px solid var(--border);
}

.landing-nav-inner {
    max-width: 1080px;
    margin: 0 auto;
    padding: 16px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.landing-wordmark {
    font-size: 20px;
    font-weight: 700;
    color: var(--text);
    letter-spacing: -.4px;
    display: flex;
    align-items: center;
    gap: 10px;
}


.landing-wordmark-text span {
    color: var(--primary);
}

.landing-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    flex-shrink: 0;
    font-family: 'Fraunces', Georgia, serif;
    font-size: 18px;
    font-weight: 700;
    color: #ffffff;
    background: linear-gradient(150deg, #134e4a 0%, #0d9488 100%);
    border-radius: 9px;
    box-shadow: 0 2px 6px rgba(13, 148, 136, .35), inset 0 1px 0 rgba(255, 255, 255, .25);
    position: relative;
}

.landing-mark::after {
    content: '';
    position: absolute;
    top: 6px;
    right: 6px;
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: #5eead4;
    box-shadow: 0 0 0 2px rgba(94, 234, 212, .25);
}

.landing-wordmark-dot {
    display: none;
}

.landing-nav-links {
    display: flex;
    align-items: center;
    gap: 28px;
}

.landing-nav-link {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    text-decoration: none;
    transition: color .15s;
}

.landing-nav-link:hover {
    color: var(--text);
}

.landing-signin {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    text-decoration: none;
}

.landing-signin:hover {
    color: var(--text);
}

/* ── Shared ── */

.landing-narrow {
    max-width: 640px;
    margin: 0 auto;
    padding: 0 24px;
}

.landing-wide {
    max-width: 1080px;
    margin: 0 auto;
    padding: 0 24px;
}

.landing-eyebrow {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
    margin: 0 0 20px;
}

.landing-h1 {
    font-family: 'Fraunces', Georgia, 'Times New Roman', serif;
    font-size: 40px;
    font-weight: 600;
    font-optical-sizing: auto;
    line-height: 1.12;
    letter-spacing: -.6px;
    color: var(--text);
    margin: 0 0 24px;
    text-wrap: balance;
}

.landing-h2 {
    font-family: 'Fraunces', Georgia, 'Times New Roman', serif;
    font-size: 30px;
    font-weight: 600;
    line-height: 1.22;
    letter-spacing: -.4px;
    color: var(--text);
    margin: 0 0 24px;
}

.landing-subhead {
    font-size: 18px;
    line-height: 1.7;
    color: var(--text-secondary);
    margin: 0 0 32px;
}

.landing-section {
    padding: 64px 0;
}

.landing-section .landing-eyebrow {
    display: block;
    text-align: left;
    font-size: 14px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text);
    margin: 0 0 20px;
}

.landing-reality-section,
.landing-how-section,
.landing-method-section,
.landing-features-section,
.landing-pricing-section,
.landing-final-cta {
    position: relative;
    border-top: 1px solid rgba(226, 232, 240, .9);
}

.landing-reality-section::before,
.landing-how-section::before,
.landing-method-section::before,
.landing-features-section::before,
.landing-pricing-section::before,
.landing-final-cta::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    width: min(1080px, calc(100% - 48px));
    height: 1px;
    transform: translateX(-50%);
    background: linear-gradient(90deg, transparent, rgba(13, 148, 136, .22), transparent);
}

.landing-reality-section {
    background: linear-gradient(180deg, #ffffff 0%, #fbfdfc 100%);
}

.landing-how-section {
    background: #ffffff;
}

.landing-features-section,
.landing-pricing-section {
    background: #fbfdfc;
}

/* ── Hero ── */

.landing-hero {
    padding: 80px 0 56px;
    position: relative;
    overflow: hidden;
    background: linear-gradient(160deg, #121a2d 0%, #0e1626 62%, #0b1322 100%);
}

.landing-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    pointer-events: none;
    background:
        radial-gradient(circle at 18% 14%, rgba(120, 147, 132, .14), transparent 38%),
        radial-gradient(circle at 85% 100%, rgba(10, 16, 28, .72), transparent 56%);
}

.landing-hero::after {
    content: '';
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: linear-gradient(180deg, rgba(255, 255, 255, .02), rgba(255, 255, 255, 0));
}

.landing-hero > * {
    position: relative;
    z-index: 1;
}

.landing-hero .landing-eyebrow {
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 1.7px;
    color: rgba(226, 232, 240, .58);
    margin-bottom: 18px;
}

.landing-hero .landing-h1 {
    color: #f8fafc;
}

.landing-hero .landing-subhead {
    color: #cbd5e1;
    font-size: 17px;
    line-height: 1.65;
}

.landing-hero .landing-cta-subline {
    color: #94a3b8;
}

.landing-hero .landing-btn-secondary {
    color: #e2e8f0;
    border-color: rgba(148, 163, 184, .4);
}

.landing-hero .landing-btn-secondary:hover {
    border-color: #8da995;
    color: #ffffff;
}

.landing-hero .landing-btn-primary {
    background: #1f5a4b;
    color: #ffffff;
    font-weight: 700;
    box-shadow: none;
    white-space: nowrap;
}

.landing-hero .landing-btn-primary:hover {
    background: #17483b;
}

.landing-hero-inner {
    max-width: 1080px;
    margin: 0 auto;
    padding: 0 24px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(390px, 460px);
    gap: 56px;
    align-items: start;
}

.landing-hero-text {
    max-width: 580px;
    padding-top: 10px;
    display: flex;
    flex-direction: column;
}

.landing-hero-trust {
    margin-top: auto;
    padding-top: 48px;
}

.landing-hero-trust-label {
    display: block;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1.4px;
    color: #64748b;
    margin-bottom: 14px;
}

.landing-hero-trust-logos {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px 22px;
}

.landing-hero-trust-logos span {
    font-size: 15px;
    font-weight: 600;
    color: #94a3b8;
    letter-spacing: -.2px;
}

.landing-hero .landing-subhead {
    max-width: 520px;
}

.landing-icp-line {
    font-size: 15px;
    line-height: 1.7;
    color: var(--text-secondary);
    margin: -8px 0 28px;
}

.landing-icp-line strong {
    color: var(--text);
}

.landing-cta-row {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 0;
}

.landing-btn-primary {
    display: inline-block;
    padding: 14px 32px;
    background: var(--primary);
    color: #ffffff;
    font-size: 15px;
    font-weight: 600;
    border-radius: var(--radius-sm);
    text-decoration: none;
    transition: background .15s;
}

.landing-btn-primary:hover {
    background: var(--primary-hover);
}

.landing-btn-secondary {
    display: inline-block;
    padding: 14px 24px;
    background: transparent;
    color: var(--text-secondary);
    font-size: 15px;
    font-weight: 500;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    text-decoration: none;
    transition: border-color .15s, color .15s;
}

.landing-btn-secondary:hover {
    border-color: var(--text-muted);
    color: var(--text);
}

/* ── Hero auto-playing demo ── */

.landing-hero-demo {
    margin: 4px 0 28px;
    width: 100%;
    min-height: 96px;
}

.hero-demo-bar {
    display: flex;
    align-items: flex-start;
    gap: 11px;
    padding: 14px 18px;
    min-height: 76px;
    box-sizing: border-box;
    background: rgba(255, 255, 255, .04);
    border: 1px solid rgba(148, 163, 184, .28);
    border-radius: 14px;
    box-shadow: 0 12px 30px rgba(2, 6, 23, .35);
}

.hero-demo-icon {
    flex-shrink: 0;
    width: 18px;
    height: 18px;
    margin-top: 2px;
    color: #a2c2b2;
}

.hero-demo-input {
    flex: 1;
    min-width: 0;
    min-height: 44px;
    font-size: 15px;
    font-weight: 500;
    color: #f8fafc;
    letter-spacing: -.1px;
    line-height: 1.45;
    word-break: break-word;
}

.hero-demo-caret {
    display: inline-block;
    width: 2px;
    height: 18px;
    margin-left: 1px;
    background: #a2c2b2;
    border-radius: 1px;
    animation: hero-demo-blink 1s steps(1) infinite;
}

.hero-demo-caret.is-hidden {
    display: none;
}

@keyframes hero-demo-blink {
    0%, 50% { opacity: 1; }
    50.01%, 100% { opacity: 0; }
}

.hero-demo-status {
    display: flex;
    align-items: center;
    gap: 9px;
    margin-top: 12px;
    padding-left: 4px;
    font-size: 13px;
    font-weight: 600;
    color: #94a3b8;
    letter-spacing: .1px;
}

.hero-demo-spinner {
    flex-shrink: 0;
    width: 13px;
    height: 13px;
    border-radius: 50%;
    border: 2px solid rgba(162, 194, 178, .25);
    border-top-color: #a2c2b2;
    animation: hero-demo-spin .7s linear infinite;
}

@keyframes hero-demo-spin {
    to { transform: rotate(360deg); }
}

.hero-demo-status.is-done {
    color: #a2c2b2;
}

.hero-demo-status.is-done .hero-demo-spinner {
    border: none;
    background: #a2c2b2;
    animation: none;
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6L9 17l-5-5'/%3E%3C/svg%3E") center/12px no-repeat;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6L9 17l-5-5'/%3E%3C/svg%3E") center/12px no-repeat;
}

.landing-cta-sublink {
    color: #b6cec2;
    text-decoration: underline;
    text-underline-offset: 2px;
    font-weight: 600;
    white-space: nowrap;
}

.landing-cta-sublink:hover {
    color: #d9e6df;
    text-decoration-thickness: 2px;
}

/* ── CTA subline & mini-steps ── */

.landing-cta-subline {
    font-size: 14px;
    color: #a5b4c7;
    margin: 16px 0 0;
}

.landing-sample-widget {
    margin-top: 24px;
    padding: 18px 20px;
    border-radius: 16px;
    background: rgba(255, 255, 255, .82);
    border: 1px solid rgba(148, 163, 184, .22);
    box-shadow: 0 16px 40px rgba(15, 23, 42, .05);
    backdrop-filter: blur(14px);
}

.landing-sample-label {
    font-size: 12px;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: .6px;
    margin: 0 0 12px;
}

.landing-sample-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.landing-sample-btn {
    border: 1px solid var(--border);
    background: #ffffff;
    color: var(--text-secondary);
    border-radius: 999px;
    padding: 10px 14px;
    font-size: 13px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: transform .15s, border-color .15s, color .15s, box-shadow .15s, background .15s;
}

.landing-sample-btn:hover {
    border-color: #94a3b8;
    color: var(--text);
    transform: translateY(-1px);
}

.landing-sample-btn.is-active {
    color: #ffffff;
    border-color: transparent;
    background: linear-gradient(135deg, #0f766e, #0d9488);
    box-shadow: 0 10px 24px rgba(15, 118, 110, .24);
}

/* ── Stat callout ── */

.landing-reality-grid {
    display: grid;
    grid-template-columns: minmax(0, .92fr) minmax(0, 1.08fr);
    gap: 44px;
    align-items: center;
}

.landing-reality-copy {
    text-align: left;
}

.landing-reality-copy .landing-h2 {
    margin-bottom: 18px;
}

.landing-reality-copy .landing-body {
    max-width: none;
    margin: 0;
}

.landing-stat-callout {
    background: #f6faf9;
    border: 1px solid var(--border);
    border-left: 3px solid var(--primary);
    border-radius: var(--radius);
    padding: 28px 32px;
    margin-bottom: 32px;
    text-align: center;
}

.landing-reality-copy .landing-stat-callout {
    text-align: left;
    padding: 24px 26px;
    margin-bottom: 28px;
}

.landing-reality-copy .landing-stat-number {
    font-size: 50px;
}

.landing-stat-number {
    display: block;
    font-size: 56px;
    font-weight: 800;
    color: var(--primary);
    line-height: 1;
    letter-spacing: -1px;
    margin-bottom: 8px;
}

.landing-stat-text {
    display: block;
    font-size: 17px;
    font-weight: 500;
    color: var(--text);
    line-height: 1.5;
}

.landing-stat-source {
    display: block;
    font-size: 13px;
    font-family: 'Fraunces', Georgia, serif;
    font-weight: 500;
    letter-spacing: .1px;
    color: var(--text-muted);
    margin-top: 8px;
}

/* ── SEO illusion: earned media vs. website SEO ── */

.landing-seo-illusion {
    margin-top: 0;
    padding: 32px;
    background: #f6faf9;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    text-align: left;
}

.landing-seo-illusion-title {
    font-family: 'Fraunces', Georgia, 'Times New Roman', serif;
    font-size: 24px;
    font-weight: 600;
    letter-spacing: -.2px;
    color: var(--text);
    margin: 0 0 14px;
}

.landing-seo-illusion-lead {
    font-size: 16px;
    line-height: 1.65;
    color: var(--text-secondary);
    margin: 0 0 22px;
}

.landing-seo-illusion-lead strong {
    color: var(--text);
    font-weight: 600;
}

.landing-seo-compare {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 22px;
}

.landing-seo-col {
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 16px 18px;
}

.landing-seo-col-ai {
    border-color: var(--primary);
    box-shadow: 0 4px 16px rgba(13, 148, 136, .12);
}

.landing-seo-col-label {
    display: block;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .8px;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.landing-seo-col-ai .landing-seo-col-label {
    color: var(--primary);
}

.landing-seo-col-text {
    font-size: 14.5px;
    line-height: 1.6;
    color: var(--text-secondary);
    margin: 0;
}

.landing-seo-stat {
    font-size: 15px;
    line-height: 1.65;
    color: var(--text);
    margin: 0 0 16px;
    padding-left: 16px;
    border-left: 3px solid var(--primary);
}

.landing-seo-stat strong {
    color: var(--primary);
    font-weight: 700;
}

.landing-seo-source {
    font-size: 12.5px;
    line-height: 1.55;
    color: var(--text-muted);
    margin: 0;
}

.landing-seo-source a {
    color: var(--text-secondary);
    text-decoration: underline;
}

.landing-seo-source a:hover {
    color: var(--primary);
}

/* ── Dashboard mockup ── */

.mockup-card {
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: 0 4px 24px rgb(0 0 0 / .06), 0 1px 3px rgb(0 0 0 / .04);
    overflow: hidden;
}

.landing-hero-visual {
    position: relative;
    align-self: start;
}

.landing-hero-visual::before {
    content: '';
    position: absolute;
    inset: 28px -18px -24px 36px;
    background: linear-gradient(135deg, rgba(13, 148, 136, .18), rgba(59, 130, 246, .14));
    border-radius: 28px;
    filter: blur(6px);
}

.landing-sample-panel {
    display: none;
    position: relative;
    z-index: 1;
    flex-direction: column;
    gap: 14px;
    width: 100%;
}

.landing-sample-panel.is-active {
    display: flex;
}

.landing-sample-panel::before,
.landing-sample-panel::after {
    pointer-events: none;
    opacity: 0;
    transition: opacity .3s ease;
}

.landing-sample-panel.is-analyzing::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 22px;
    border: 1px solid rgba(148, 163, 184, .12);
    background:
        linear-gradient(105deg, transparent 30%, rgba(148, 163, 184, .07) 42%, transparent 54%) 0 0 / 260% 100%,
        linear-gradient(145deg, rgba(22, 32, 52, .85), rgba(11, 19, 34, .8));
    opacity: 1;
    z-index: 2;
    animation: mockup-loading-shimmer 3.4s ease-in-out infinite;
}

.landing-sample-panel.is-analyzing::after {
    content: 'Loading report...';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 11px;
    font-weight: 500;
    color: rgba(148, 163, 184, .65);
    letter-spacing: .4px;
    opacity: 1;
    z-index: 3;
}

@keyframes mockup-loading-shimmer {
    0% {
        background-position: 130% 0, 0 0;
    }
    100% {
        background-position: -130% 0, 0 0;
    }
}

/* Demo states — content fades while "analyzing", then reorganizes on reveal */
.landing-sample-panel .mockup-verdict,
.landing-sample-panel .mockup-rank-card,
.landing-sample-panel .mockup-output-card {
    transition: opacity .5s ease, transform .5s ease;
}

.landing-sample-panel.is-analyzing .mockup-verdict,
.landing-sample-panel.is-analyzing .mockup-rank-card,
.landing-sample-panel.is-analyzing .mockup-output-card {
    opacity: 0;
    transform: translateY(10px);
    pointer-events: none;
}

.landing-sample-panel.is-ready .mockup-verdict,
.landing-sample-panel.is-ready .mockup-rank-card,
.landing-sample-panel.is-ready .mockup-output-card {
    opacity: 1;
    transform: none;
}

@media (prefers-reduced-motion: reduce) {
    .landing-sample-panel::before,
    .landing-sample-panel::after,
    .landing-sample-panel .mockup-verdict,
    .landing-sample-panel .mockup-rank-card,
    .landing-sample-panel .mockup-output-card,
    .mockup-rank-bar-fill {
        transition: none;
    }

    .landing-sample-panel.is-analyzing::before {
        animation: none;
    }
}

/* Verdict — leads the panel, the strongest line */
.mockup-verdict {
    position: relative;
    z-index: 1;
    padding: 30px 30px 32px;
    background:
        linear-gradient(135deg, rgba(239, 68, 68, .16), transparent 46%),
        linear-gradient(145deg, #15203a, #0b1322);
    border: 1px solid rgba(248, 113, 113, .42);
    border-left: 7px solid #ef4444;
    border-radius: 22px;
    box-shadow: 0 30px 80px rgba(2, 6, 23, .62), 0 0 0 1px rgba(255, 255, 255, .04) inset;
}

.mockup-verdict-label {
    display: block;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.8px;
    color: #fca5a5;
    margin-bottom: 12px;
}

.mockup-verdict-text {
    margin: 0;
    min-height: 2.24em;
    font-family: 'Fraunces', Georgia, 'Times New Roman', serif;
    font-size: 30px;
    line-height: 1.12;
    font-weight: 700;
    letter-spacing: -.8px;
    color: #f8fafc;
}

.mockup-verdict-text strong {
    color: #fca5a5;
}

/* Header (shared) */
.mockup-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px;
    border-bottom: 1px solid rgba(148, 163, 184, .18);
}

.mockup-biz-name {
    font-family: 'Fraunces', Georgia, 'Times New Roman', serif;
    font-size: 14px;
    font-weight: 500;
    letter-spacing: .1px;
    color: #d8e0ec;
}

/* Ranking card — supporting data, deliberately quieter */
.mockup-rank-card {
    background:
        linear-gradient(145deg, rgba(22, 32, 52, .98), rgba(11, 19, 34, .98));
    box-shadow: 0 18px 48px rgba(2, 6, 23, .42);
    border-color: rgba(148, 163, 184, .22);
    transform: scale(.96);
    transform-origin: top center;
    opacity: .94;
}

.mockup-rank-card .mockup-header {
    background: transparent;
}

/* Visibility score with a reference band */
.mockup-score-row {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 18px 18px 20px;
    margin-bottom: 6px;
    border-bottom: 1px solid rgba(148, 163, 184, .22);
}

.mockup-score-main {
    display: flex;
    align-items: baseline;
    line-height: 1;
}

.mockup-score-num {
    font-size: 34px;
    font-weight: 800;
    letter-spacing: -1px;
    color: #f8fafc;
}

.mockup-score-max {
    font-size: 15px;
    font-weight: 600;
    color: #64748b;
}

.mockup-score-context {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.mockup-score-band {
    align-self: flex-start;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .4px;
    padding: 2px 9px;
    border-radius: 999px;
}

.mockup-score-band-fair {
    background: rgba(245, 158, 11, .12);
    color: #fbbf24;
    border: 1px solid rgba(251, 191, 36, .32);
}

.mockup-score-band-poor {
    background: rgba(239, 68, 68, .13);
    color: #f87171;
    border: 1px solid rgba(248, 113, 113, .34);
}

.mockup-score-band-good {
    background: rgba(45, 212, 191, .13);
    color: #5eead4;
    border: 1px solid rgba(94, 234, 212, .32);
}

.mockup-score-note {
    font-size: 11px;
    color: #94a3b8;
}

/* Provider rows — name, visibility bar, explicit rank label */
.mockup-providers-caption {
    padding: 12px 18px 4px;
    margin: 0;
    font-size: 11.5px;
    line-height: 1.5;
    color: #cbd5e1;
}

.mockup-providers-caption span {
    color: #64748b;
}

.mockup-providers {
    padding: 4px 0;
}

.mockup-provider {
    display: grid;
    grid-template-columns: 78px 1fr auto;
    align-items: center;
    gap: 12px;
    padding: 8px 18px;
}

.mockup-provider:not(:last-child) {
    border-bottom: 1px solid rgba(148, 163, 184, .12);
}

.mockup-provider-name {
    font-family: 'Fraunces', Georgia, 'Times New Roman', serif;
    font-size: 14px;
    font-weight: 500;
    color: #e2e8f0;
}

.mockup-rank-bar {
    height: 7px;
    border-radius: 999px;
    background: rgba(148, 163, 184, .16);
    overflow: hidden;
}

.mockup-rank-bar-fill {
    display: block;
    height: 100%;
    border-radius: 999px;
    transition: width .9s cubic-bezier(.22, 1, .36, 1);
}

.mockup-bar-good {
    background: linear-gradient(90deg, #2f6b59, #5f8d78);
}

.mockup-bar-warn {
    background: linear-gradient(90deg, #d97706, #fbbf24);
}

.mockup-rank-label {
    justify-self: end;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: -.2px;
    white-space: nowrap;
}

.mockup-rank-good {
    color: #9ebcae;
}

.mockup-rank-warn {
    color: #fbbf24;
}

.mockup-rank-bad {
    color: #f87171;
}

/* Legend — explains the color coding */
.mockup-legend,
.mockup-output-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 16px;
    padding: 11px 18px;
    border-top: 1px solid rgba(148, 163, 184, .16);
}

.mockup-legend-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    color: #94a3b8;
}

.mockup-legend-swatch {
    width: 10px;
    height: 10px;
    border-radius: 3px;
    flex-shrink: 0;
}

.swatch-good { background: var(--success); }
.swatch-warn { background: var(--warning); }
.swatch-competitor { background: #ef4444; }
.swatch-target { background: var(--primary); }

/* Proof card — live answer, the elevated evidence */
.mockup-output-card {
    background:
        linear-gradient(145deg, rgba(22, 32, 52, .98), rgba(11, 19, 34, .98));
    border: 1px solid rgba(148, 163, 184, .22);
    box-shadow: 0 16px 42px rgba(2, 6, 23, .36);
    transform: scale(.96);
    transform-origin: top center;
    opacity: .94;
}

.mockup-output-card::before {
    content: '';
    display: block;
    height: 3px;
    background: linear-gradient(90deg, var(--primary), #2dd4bf);
}

.mockup-output-header {
    padding: 14px 18px 12px;
    border-bottom: 1px solid rgba(148, 163, 184, .16);
}

.mockup-output-live {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    font-weight: 700;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: .5px;
}

.mockup-live-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #ef4444;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, .18);
    animation: mockup-pulse 1.8s ease-in-out infinite;
}

@keyframes mockup-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: .4; }
}

.mockup-output-query {
    font-family: 'Fraunces', Georgia, serif;
    font-size: 17px;
    font-weight: 600;
    line-height: 1.3;
    letter-spacing: -.3px;
    color: #f8fafc;
    margin: 8px 0 0;
}

.mockup-output-body {
    padding: 14px 18px;
}

.mockup-output-body {
    min-height: 88px;
}

.mockup-output-body p {
    font-size: 13px;
    line-height: 1.75;
    color: #cbd5e1;
    margin: 0 0 12px;
}

.mockup-output-body p:last-child {
    margin-bottom: 0;
}

.mockup-output-leak {
    margin: 0;
    padding: 10px 18px 0;
    font-size: 11px;
    font-weight: 600;
    line-height: 1.5;
    color: #fca5a5;
    letter-spacing: .01em;
}

.mockup-output-mark {
    display: inline;
    padding: 1px 4px;
    border-radius: 4px;
    font-weight: 600;
}

.mockup-output-mark.competitor {
    background: rgba(239, 68, 68, .20);
    color: #fecaca;
}

.mockup-output-mark.target {
    background: rgba(95, 141, 120, .24);
    color: #d3e2d9;
}

/* ── The Shift ── */

.landing-section .landing-narrow {
    text-align: center;
}

.landing-body {
    text-align: left;
    max-width: 580px;
    margin: 0 auto;
}

.landing-body p {
    font-size: 16px;
    line-height: 1.75;
    color: var(--text-secondary);
    margin: 0 0 16px;
}

.landing-body p:last-child {
    margin-bottom: 0;
}

/* ── How It Works ── */

.landing-steps {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 48px;
    margin-top: 40px;
}

.landing-how-intro {
    max-width: 760px;
    font-size: 16px;
    line-height: 1.75;
    color: var(--text-secondary);
}

.landing-step {
    border-top: 1px solid var(--border);
    padding-top: 24px;
}

.landing-step-num {
    display: block;
    font-size: 48px;
    font-weight: 700;
    color: var(--text);
    opacity: .12;
    line-height: 1;
    margin-bottom: 16px;
}

.landing-step-title {
    font-family: 'Fraunces', Georgia, 'Times New Roman', serif;
    font-size: 22px;
    font-weight: 600;
    line-height: 1.28;
    color: var(--text);
    letter-spacing: -.2px;
    margin: 0 0 12px;
}

.landing-step-desc {
    font-size: 15px;
    line-height: 1.7;
    color: var(--text-secondary);
    margin: 0;
}

.landing-query-examples {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 16px;
}

.landing-query-chip {
    display: inline-flex;
    align-items: center;
    padding: 7px 12px;
    border-radius: 999px;
    background: #f4f8f6;
    border: 1px solid #cad8d1;
    color: #1f2937;
    font-size: 12px;
    line-height: 1.4;
}

/* ── Methodology ── */

.landing-method-section {
    background: #f6faf9;
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
}

.landing-method {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
    gap: 48px;
    align-items: center;
}

.landing-method-copy .landing-eyebrow {
    margin-bottom: 18px;
}

.landing-method-copy .landing-h2 {
    margin-bottom: 16px;
}

.landing-method-text {
    font-size: 16px;
    line-height: 1.75;
    color: var(--text-secondary);
    margin: 0;
}

.landing-method-points {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.landing-method-points li {
    display: flex;
    align-items: center;
    gap: 18px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border);
}

.landing-method-points li:last-child {
    padding-bottom: 0;
    border-bottom: none;
}

.landing-method-point-num {
    flex-shrink: 0;
    min-width: 64px;
    font-family: 'Fraunces', Georgia, serif;
    font-size: 34px;
    font-weight: 700;
    letter-spacing: -1px;
    color: var(--primary);
    line-height: 1;
}

.landing-method-point-text {
    font-size: 15px;
    line-height: 1.6;
    color: var(--text);
}

/* ── Features ── */

.landing-features {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 40px 56px;
    margin-top: 40px;
}

.landing-feature {
    padding-left: 20px;
    border-left: 3px solid var(--primary);
}

.landing-feature-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: 'Fraunces', Georgia, 'Times New Roman', serif;
    font-size: 21px;
    font-weight: 600;
    line-height: 1.25;
    letter-spacing: -.15px;
    color: var(--text);
    margin: 0 0 10px;
}

.landing-feature-title::before {
    content: '';
    width: 8px;
    height: 8px;
    border-radius: 999px;
    background: #315f4c;
    box-shadow: 0 0 0 2px rgba(49, 95, 76, .12);
    flex-shrink: 0;
}

.landing-feature p {
    font-size: 14px;
    line-height: 1.7;
    color: var(--text-secondary);
    margin: 0;
}

.landing-secondary-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    padding: 28px 32px;
    border: 1px solid #bfdbfe;
    border-radius: 24px;
    background: linear-gradient(135deg, #f8fbff, #f0fdfa);
    box-shadow: 0 12px 32px rgba(15, 23, 42, .05);
}

.landing-secondary-copy .landing-eyebrow {
    margin-bottom: 12px;
}

.landing-secondary-copy .landing-h2 {
    margin-bottom: 12px;
}

.landing-secondary-copy .landing-subhead {
    margin-bottom: 0;
    max-width: 620px;
}

.landing-secondary-actions {
    flex-shrink: 0;
}

/* ── Pricing ── */

.pricing-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 24px;
    max-width: 760px;
    margin: 40px auto 0;
    align-items: stretch;
}

.pricing-card {
    display: flex;
    flex-direction: column;
    padding: 32px 28px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: 0 4px 24px rgb(0 0 0 / .04);
}

.pricing-card-featured {
    border-color: var(--primary);
    box-shadow: 0 16px 40px rgba(13, 148, 136, .12);
    position: relative;
}

.pricing-badge {
    display: inline-block;
    align-self: flex-start;
    margin-bottom: 14px;
    padding: 4px 12px;
    border-radius: 999px;
    background: var(--primary);
    color: #ffffff;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .5px;
    line-height: 1.2;
}

.pricing-badge-spacer {
    visibility: hidden;
    pointer-events: none;
}

.pricing-name {
    margin: 0 0 12px;
    font-family: 'Fraunces', Georgia, 'Times New Roman', serif;
    font-size: 22px;
    font-weight: 600;
    line-height: 1.2;
    letter-spacing: -.2px;
    color: var(--text);
}

.pricing-price {
    display: flex;
    align-items: baseline;
    gap: 4px;
    margin-bottom: 8px;
}

.pricing-amount {
    font-size: 44px;
    font-weight: 800;
    letter-spacing: -1px;
    color: var(--text);
    line-height: 1;
}

.pricing-period {
    font-size: 15px;
    color: var(--text-muted);
}

.pricing-billed-note {
    margin: 0 0 12px;
    font-size: 13px;
    font-weight: 600;
    color: var(--primary);
    min-height: 18px;
}

.pricing-tagline {
    margin: 0 0 20px;
    font-size: 14px;
    color: var(--text-secondary);
}

/* ── Billing toggle ── */

.pricing-toggle {
    display: flex;
    width: fit-content;
    gap: 4px;
    margin: 28px auto 0;
    padding: 4px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 999px;
}

.pricing-toggle-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 18px;
    border: none;
    background: transparent;
    border-radius: 999px;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-secondary);
    cursor: pointer;
    transition: background .15s ease, color .15s ease;
}

.pricing-toggle-btn.is-active {
    background: var(--primary);
    color: #ffffff;
}

.pricing-toggle-save {
    padding: 2px 8px;
    border-radius: 999px;
    background: var(--success-light);
    color: #059669;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .4px;
}

.pricing-toggle-btn.is-active .pricing-toggle-save {
    background: rgba(255, 255, 255, .2);
    color: #ffffff;
}

.pricing-features {
    list-style: none;
    margin: 0 0 28px;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
    flex: 1;
}

.pricing-features li {
    position: relative;
    padding-left: 26px;
    font-size: 14px;
    line-height: 1.5;
    color: var(--text);
}

.pricing-features li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 3px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--success-light);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23059669' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6L9 17l-5-5'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: center;
    background-size: 11px;
}

.pricing-cta {
    width: 100%;
    text-align: center;
    box-sizing: border-box;
}

.pricing-cta-featured {
    background: #1f5a4b;
    border: 1px solid #1f5a4b;
    box-shadow: none;
}

.pricing-cta-featured:hover {
    background: #17483b;
}

@media (max-width: 640px) {
    .pricing-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }
}

/* ── Final CTA ── */

.landing-final-cta {
    padding: 52px 0 64px;
    background: linear-gradient(180deg, #f6faf9 0%, var(--bg) 100%);
}

.landing-cta-card {
    max-width: 560px;
    margin: 0 auto;
    padding: 32px 32px 28px;
    text-align: center;
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: 0 16px 40px rgba(15, 23, 42, .06);
}

.landing-cta-card .landing-eyebrow {
    margin-bottom: 14px;
}

.landing-cta-card .landing-h2 {
    margin-bottom: 12px;
}

.landing-cta-card .landing-subhead {
    max-width: none;
    margin: 0 0 24px;
    font-size: 16px;
}

.landing-lead-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.landing-lead-fields {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.landing-lead-input {
    width: 100%;
    padding: 13px 16px;
    font-size: 15px;
    font-family: inherit;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface);
    color: var(--text);
    outline: none;
    transition: border-color .15s, box-shadow .15s;
    box-sizing: border-box;
}

.landing-lead-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(13, 148, 136, .12);
}

.landing-lead-submit {
    width: 100%;
    padding-top: 14px;
    padding-bottom: 14px;
}

/* ── Final CTA: stronger presence so it reads as the page's main action ── */
.landing-final-cta { padding: 80px 0 96px; }
.landing-final-cta .landing-narrow { max-width: 760px; }
.landing-cta-card {
    max-width: 720px;
    padding: 44px 52px 40px;
    box-shadow: 0 24px 64px rgba(15, 23, 42, .12);
    border-top: 4px solid var(--primary);
}
.landing-cta-card .landing-h2 { font-size: 30px; line-height: 1.18; }
.landing-cta-card .landing-subhead { font-size: 17px; }
.landing-lead-input { padding: 15px 16px; font-size: 16px; }
.landing-lead-submit { padding-top: 16px; padding-bottom: 16px; font-size: 16px; }

/* ── Welcome / goals step (step 2 of the waitlist) ── */
.welcome-section { padding: 72px 0 96px; }
.welcome-card {
    max-width: 600px;
    padding: 44px 48px 40px;
    text-align: center;
    border-top: 4px solid var(--primary);
}
.welcome-biz { color: var(--primary); }
.welcome-check {
    width: 54px; height: 54px; margin: 0 auto 16px;
    display: flex; align-items: center; justify-content: center;
    font-size: 28px; font-weight: 700; color: #fff;
    background: var(--primary); border-radius: 50%;
}
.welcome-goals-form { margin-top: 6px; text-align: left; }
.goals-list {
    list-style: none; margin: 0; padding: 0;
    display: flex; flex-direction: column; gap: 10px;
}
.goal-row {
    display: flex; align-items: center; gap: 12px;
    padding: 13px 14px;
    border: 1px solid var(--border); border-radius: var(--radius-sm);
    background: var(--surface); cursor: grab;
    transition: border-color .15s, box-shadow .15s, background .15s;
}
.goal-row.is-on { border-color: var(--primary); background: var(--primary-light); }
.goal-row.dragging { opacity: .55; box-shadow: 0 8px 24px rgba(15, 23, 42, .14); }
.goal-handle {
    color: var(--text-muted); font-size: 13px; letter-spacing: -3px;
    cursor: grab; user-select: none; line-height: 1;
}
.goal-label {
    display: flex; align-items: center; gap: 10px; flex: 1; margin: 0;
    cursor: pointer; font-size: 15px; color: var(--text);
}
.goal-check { width: 18px; height: 18px; accent-color: var(--primary); flex-shrink: 0; }
.goal-rank {
    font-size: 12px; font-weight: 700; color: var(--primary);
    min-width: 22px; text-align: right;
}
.welcome-actions { display: flex; align-items: center; gap: 16px; }
.welcome-actions .landing-btn-primary { flex: 1; padding-top: 14px; padding-bottom: 14px; }
.welcome-skip {
    background: none; border: none; color: var(--text-muted);
    font-size: 14px; cursor: pointer; text-decoration: underline;
    font-family: inherit; white-space: nowrap;
}
.welcome-back { display: inline-block; margin-top: 22px; }

/* "Special" non-draggable A/B checkbox, pinned under the goals.
   Amber/yellow hue (vs the teal goals) so it reads as a distinct experiment. */
.goal-extra {
    cursor: pointer;
    margin-top: 10px;                 /* match the gap between goal rows */
    border-style: dashed;
    border-color: #fbbf24;            /* amber-400 */
    background: #fffbeb;              /* amber-50 */
}
.goal-extra:has(input:checked) {
    border-style: solid;
    border-color: #d97706;            /* amber-600 */
    background: #fef3c7;              /* amber-100 */
    box-shadow: 0 0 0 2px rgba(217, 119, 6, .14);
}
.goal-extra .goal-check { accent-color: #d97706; }
.goal-extra-spark { color: #d97706; font-size: 14px; line-height: 1; width: 14px; text-align: center; }
.goal-extra-label { flex: 1; }
.goal-extra-tag {
    font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em;
    color: #b45309; background: #fef3c7;   /* amber-700 on amber-100 */
    border: 1px solid #fbbf24; border-radius: 999px; padding: 1px 7px;
    white-space: nowrap;
}

/* Plan-intent (optional routing signal on the goals step) */
.plan-intent { text-align: left; margin: 22px 0; }
.plan-intent-q { font-size: 14px; font-weight: 600; color: var(--text); margin: 0 0 10px; }
.plan-intent-opt-note { font-weight: 400; color: var(--text-muted); }
.plan-intent-opts { display: flex; gap: 10px; flex-wrap: wrap; }
.plan-opt {
    flex: 1; min-width: 140px;
    display: flex; align-items: center; gap: 9px;
    padding: 11px 13px; cursor: pointer;
    border: 1px solid var(--border); border-radius: var(--radius-sm);
    background: var(--surface);
    transition: border-color .15s, background .15s, box-shadow .15s;
}
.plan-opt input { accent-color: var(--primary); flex-shrink: 0; }
.plan-opt:has(input:checked) {
    border-color: var(--primary); background: var(--primary-light);
    box-shadow: 0 0 0 2px rgba(13, 148, 136, .12);
}
.plan-opt-body { display: flex; flex-direction: column; line-height: 1.2; }
.plan-opt-label { font-size: 14px; font-weight: 600; color: var(--text); }
.plan-opt-blurb { font-size: 12px; color: var(--text-muted); }

.queue-plan { background: var(--surface); color: var(--text-secondary); border: 1px solid var(--border); }
.queue-lab { background: var(--primary-light); color: var(--primary); border: 1px solid var(--primary); font-weight: 600; }

/* Lead's stated onboarding preference, shown by the admin plan controls */
.lead-intent-note {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 12px;
    margin: 0 0 14px;
    padding: 10px 12px;
    font-size: 13px;
    color: var(--text-secondary);
    background: var(--primary-light);
    border: 1px solid var(--border);
    border-left: 3px solid var(--primary);
    border-radius: var(--radius-sm);
}
.lead-intent-tag {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: var(--primary);
}
.lead-intent-item strong { color: var(--text); }

/* Legacy inline form (demo pages) */
.landing-inline-form {
    display: flex;
    gap: 12px;
    justify-content: center;
    align-items: center;
    margin-top: 28px;
    flex-wrap: wrap;
}

.landing-inline-input {
    padding: 12px 16px;
    font-size: 15px;
    font-family: inherit;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface);
    color: var(--text);
    min-width: 200px;
    outline: none;
    transition: border-color .15s;
}

.landing-inline-input:focus {
    border-color: var(--primary);
}

.landing-inline-form .landing-btn-primary {
    white-space: nowrap;
}

.btn-demo-topbar {
    padding: 8px 12px;
    font-size: 12px;
}

.demo-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 14px;
    border-radius: var(--radius-sm);
    background: #ecfeff;
    border: 1px solid #99f6e4;
}

.demo-banner p {
    margin: 0;
    color: var(--text-secondary);
    font-size: 13px;
}

.demo-report-hidden {
    opacity: 0;
    pointer-events: none;
}

.demo-loading {
    position: fixed;
    inset: 0;
    z-index: 60;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(248, 250, 252, 0.94);
    backdrop-filter: blur(2px);
}

.demo-loading-card {
    width: min(460px, 100%);
    padding: 22px 24px;
    border-radius: var(--radius);
    background: #ffffff;
    border: 1px solid var(--border);
    box-shadow: 0 14px 36px rgba(15, 23, 42, 0.12);
}

.demo-loading-title {
    margin: 0 0 10px;
    color: var(--text);
    font-size: 16px;
    font-weight: 700;
}

.demo-loading-step {
    margin: 0;
    color: var(--text-secondary);
    font-size: 14px;
}

.demo-lead-card {
    margin-top: 8px;
}

.demo-lead-card h3 {
    margin: 0 0 6px;
}

.demo-lead-card p {
    margin: 0 0 14px;
    color: var(--text-secondary);
}

.demo-lead-form {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
}

.demo-lead-form input {
    width: 100%;
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    font-size: 14px;
}

.demo-lead-form button {
    width: 100%;
}

.demo-cta-footer {
    position: fixed;
    left: 50%;
    bottom: 14px;
    transform: translateX(-50%);
    z-index: 70;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.95);
    color: #ffffff;
    box-shadow: 0 12px 26px rgba(15, 23, 42, 0.3);
}

.demo-cta-footer p {
    margin: 0;
    font-size: 13px;
}

/* ── Footer ── */

.landing-footer {
    padding: 14px 24px;
    border-top: 1px solid var(--border);
    background: #ffffff;
    color: var(--text-muted);
    font-size: 13px;
}

.landing-footer-inner {
    max-width: 1080px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.landing-footer-links {
    display: flex;
    align-items: center;
    gap: 18px;
}

.landing-footer-links a {
    color: var(--text-secondary);
    text-decoration: none;
    transition: color .15s;
}

.landing-footer-links a:hover {
    color: var(--primary);
}

/* ── Legal pages ── */

.legal-page {
    min-height: 100vh;
    background: #f8fafc;
    color: var(--text);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

.legal-wrap {
    max-width: 860px;
    margin: 0 auto;
    padding: 40px 24px 64px;
}

.legal-back {
    display: inline-flex;
    margin-bottom: 22px;
    color: var(--primary);
    font-weight: 700;
    text-decoration: none;
}

.legal-card {
    padding: 44px;
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: 0 12px 32px rgba(15, 23, 42, .05);
}

.legal-card h1 {
    font-family: 'Fraunces', Georgia, 'Times New Roman', serif;
    font-size: 36px;
    line-height: 1.15;
    letter-spacing: -.4px;
    margin: 0 0 18px;
}

.legal-card h2 {
    font-size: 18px;
    line-height: 1.35;
    margin: 34px 0 10px;
}

.legal-card h3 {
    font-size: 15px;
    line-height: 1.4;
    margin: 22px 0 8px;
}

.legal-card p {
    color: var(--text-secondary);
    font-size: 15px;
    line-height: 1.75;
    margin: 0 0 14px;
}

.legal-card strong {
    color: var(--text);
    font-weight: 700;
}

/* ── Landing Responsive ── */

@media (max-width: 768px) {
    .landing-footer-inner {
        flex-direction: column;
        justify-content: center;
    }

    .landing-footer-links {
        gap: 14px;
    }

    .legal-wrap {
        padding: 28px 16px 48px;
    }

    .legal-card {
        padding: 28px 22px;
    }

    .legal-card h1 {
        font-size: 30px;
    }

    .landing-h1 {
        font-size: 28px;
        letter-spacing: -.3px;
    }

    .landing-h2 {
        font-size: 22px;
    }

    .landing-hero {
        padding: 48px 0 40px;
    }

    .landing-hero-inner {
        grid-template-columns: 1fr;
        gap: 40px;
    }

    .landing-hero-text {
        text-align: center;
        max-width: 100%;
    }

    .landing-hero .landing-subhead {
        max-width: 100%;
    }

    .landing-hero-trust {
        padding-top: 28px;
    }

    .landing-hero-trust-logos {
        justify-content: center;
    }

    .landing-section {
        padding: 56px 0;
    }

    .landing-reality-grid {
        grid-template-columns: 1fr;
        gap: 28px;
    }

    .landing-subhead {
        font-size: 16px;
    }

    .landing-cta-row {
        flex-direction: column;
        gap: 12px;
        align-items: stretch;
    }

    .landing-hero-demo {
        margin-left: auto;
        margin-right: auto;
    }

    .hero-demo-status {
        justify-content: center;
    }

    .landing-method {
        grid-template-columns: 1fr;
        gap: 32px;
    }

    .landing-cta-subline {
        text-align: center;
    }

    .landing-stat-number {
        font-size: 44px;
    }

    .landing-stat-callout {
        padding: 24px 20px;
    }

    .landing-seo-illusion {
        padding: 24px 20px;
    }

    .landing-seo-compare {
        grid-template-columns: 1fr;
    }

    .landing-btn-primary,
    .landing-btn-secondary {
        width: 100%;
        text-align: center;
        box-sizing: border-box;
    }

    .landing-hero-visual {
        max-width: 420px;
        margin: 0 auto;
    }

    .landing-hero-visual::before {
        inset: 20px -10px -18px 20px;
    }

    .landing-steps {
        grid-template-columns: 1fr;
        gap: 32px;
    }

    .landing-features {
        grid-template-columns: 1fr;
        gap: 28px;
    }

    .landing-final-cta {
        padding: 40px 0 48px;
    }

    .landing-cta-card {
        padding: 28px 20px 24px;
    }

    .landing-lead-fields {
        grid-template-columns: 1fr;
    }

    .landing-inline-form {
        flex-direction: column;
        align-items: stretch;
    }

    .landing-inline-input {
        min-width: 0;
        width: 100%;
        box-sizing: border-box;
    }

    .landing-inline-form .landing-btn-primary {
        width: 100%;
        text-align: center;
        box-sizing: border-box;
    }

    .landing-secondary-card {
        flex-direction: column;
        align-items: flex-start;
        padding: 24px 20px;
    }

    .landing-secondary-actions {
        width: 100%;
    }

    .landing-secondary-actions .landing-btn-secondary {
        width: 100%;
        text-align: center;
        box-sizing: border-box;
    }

    .demo-lead-form {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 640px) {
    .demo-banner {
        flex-direction: column;
        align-items: flex-start;
    }

    .demo-lead-form {
        grid-template-columns: 1fr;
    }

    .demo-cta-footer {
        width: calc(100% - 24px);
        justify-content: space-between;
        border-radius: 12px;
    }

    .btn-demo-topbar {
        display: none;
    }
}

/* ═══════════════════════════════════════════
   Expand / Collapse & Filter Controls
   ═══════════════════════════════════════════ */

/* ── Generic expand button ── */
.btn-expand {
    background: none;
    border: none;
    color: var(--primary);
    font-size: 12px;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    padding: 2px 0;
    margin-top: 2px;
}
.btn-expand:hover {
    color: var(--primary-hover);
    text-decoration: underline;
}

/* ── Truncated text (clickable) ── */
.is-truncated {
    cursor: pointer;
}
.is-truncated:hover {
    color: var(--primary);
}

/* ── Full answer (hidden by default, shown on toggle) ── */
.v2-answer-full {
    white-space: pre-wrap;
    word-break: break-word;
}

/* ── Full recommendation detail ── */
.v3-rec-detail-full {
    display: inline;
}

/* ── Filter bar ── */
.filter-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: #f1f5f9;
    border: 1px solid #cbd5e1;
    border-radius: var(--radius-sm);
    flex-wrap: wrap;
    justify-content: flex-start;
}

.filter-label {
    font-size: 12px;
    font-weight: 800;
    color: var(--text);
    text-transform: uppercase;
    letter-spacing: .3px;
    white-space: nowrap;
}

.filter-toggles {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.filter-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text-muted);
    border-radius: 999px;
    padding: 5px 12px;
    font-size: 12px;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    transition: background .15s, color .15s, border-color .15s, opacity .15s;
}

.filter-btn:hover {
    border-color: #cbd5e1;
    color: var(--text-secondary);
}

.filter-btn.is-active {
    background: var(--primary-light);
    border-color: var(--primary);
    color: var(--primary);
}

.filter-btn:not(.is-active) {
    opacity: .5;
}

.filter-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.filter-btn:not(.is-active) .filter-dot {
    opacity: .35;
}

@media (max-width: 640px) {
    .filter-bar {
        padding: 8px 12px;
        gap: 8px;
    }
    .filter-label {
        font-size: 11px;
        width: 100%;
    }
    .filter-btn {
        font-size: 11px;
        padding: 4px 10px;
    }
}

/* ═══════════════════════════════════════════
   V4 — Plain-English Summary Card
   ═══════════════════════════════════════════ */

.summary-card {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(200px, 240px);
    grid-template-rows: auto 1fr;
    gap: 14px 20px;
    background: var(--surface);
    border: 1px solid #cbd5e1;
    border-top: 4px solid var(--primary);
    border-radius: var(--radius);
    padding: 16px 20px 18px;
    box-shadow: 0 14px 34px -26px rgba(15, 23, 42, .42);
    align-items: stretch;
}

.summary-report-header {
    grid-column: 1 / -1;
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px 20px;
    flex-wrap: wrap;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border);
}

.summary-business {
    font-size: 18px;
    font-weight: 700;
    color: var(--text);
    letter-spacing: -.2px;
    line-height: 1.2;
    margin: 0;
}

.summary-report-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    margin: 0;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    line-height: 1.4;
}

.summary-report-meta .summary-meta-sep {
    color: var(--text-muted);
}

.summary-meta-sep {
    color: #cbd5e1;
    user-select: none;
}

.summary-main {
    min-width: 0;
}

.summary-score-badge {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 12px 12px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: #f8fafc;
    text-align: center;
}

.summary-score-gauge {
    width: 100%;
    max-width: 148px;
    margin-bottom: -6px;
}


.summary-score-gauge-svg {
    display: block;
    width: 100%;
    height: auto;
}

.summary-score-gauge-track,
.summary-score-gauge-fill {
    fill: none;
    stroke-width: 7;
    stroke-linecap: round;
}

.summary-score-gauge-track {
    stroke: #e2e8f0;
}

.summary-score-gauge-fill {
    transition: stroke-dashoffset .5s ease;
}

.summary-score-gauge-fill.bp-tone-good { stroke: var(--success); }
.summary-score-gauge-fill.bp-tone-ok   { stroke: var(--primary); }
.summary-score-gauge-fill.bp-tone-warn { stroke: var(--warning); }
.summary-score-gauge-fill.bp-tone-bad  { stroke: var(--danger); }
.summary-score-gauge-fill.bp-tone-muted { stroke: var(--text-muted); }

.summary-score-num {
    font-size: 48px;
    font-weight: 700;
    color: var(--text);
    line-height: 1;
    letter-spacing: -2px;
    margin-top: -4px;
}


.summary-score-label {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 2px;
}

.summary-score-note {
    margin-top: 6px;
    font-size: 10px;
    line-height: 1.35;
    color: var(--text-muted);
}

.summary-text {
    flex: 1;
    min-width: 0;
}

.summary-kicker {
    font-size: 12px;
    font-weight: 800;
    color: var(--text);
    text-transform: uppercase;
    letter-spacing: .04em;
    margin-bottom: 8px;
    text-align: left;
}

.summary-narrative {
    font-size: 15px;
    line-height: 1.45;
    color: var(--text-secondary);
    margin: 0 0 6px;
}

.summary-stats {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px 12px;
    margin: 0 0 10px;
    padding: 0;
    list-style: none;
    font-size: 12px;
    color: var(--text-muted);
}

.summary-stats li {
    position: relative;
    padding-left: 15px;
}

.summary-stats li::before {
    content: "";
    position: absolute;
    left: 0;
    top: 50%;
    width: 3px;
    height: 3px;
    border-radius: 50%;
    background: var(--text-muted);
    transform: translateY(-50%);
    opacity: .55;
}

.summary-stats li:first-child {
    padding-left: 0;
}

.summary-stats li:first-child::before {
    display: none;
}

.summary-stats strong {
    color: var(--text);
    font-weight: 700;
}

.summary-delta.v3-up {
    color: var(--success);
    font-weight: 600;
}

.summary-delta.v3-down {
    color: var(--danger);
    font-weight: 600;
}

.summary-side {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-self: stretch;
    gap: 10px;
}

.summary-export-wrap {
    padding: 0;
}

.summary-next-step {
    width: 100%;
    max-width: none;
    padding: 10px 12px 10px 14px;
    border-left: 3px solid var(--primary);
}

.summary-next-step.is-expandable {
    cursor: pointer;
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    transition: background .15s;
}

.summary-next-step.is-expandable:hover {
    background: var(--primary-light);
}

.summary-next-label {
    display: inline-block;
    font-size: 10px;
    font-weight: 700;
    color: var(--primary);
    text-transform: uppercase;
    letter-spacing: .4px;
    margin-bottom: 2px;
}

.summary-next-title {
    display: block;
    font-size: 14px;
    font-weight: 700;
    color: var(--text);
    line-height: 1.35;
}

.summary-next-detail {
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.45;
    margin-top: 2px;
}

.summary-next-expand {
    display: inline-block;
    margin-top: 4px;
    padding: 0;
    border: none;
    background: none;
    font-size: 12px;
    font-weight: 600;
    font-family: inherit;
    color: var(--primary);
    cursor: pointer;
}

.summary-next-expand:hover {
    color: var(--primary-hover);
    text-decoration: underline;
}

.summary-inline-link {
    display: inline-block;
    margin-top: 8px;
    font-size: 13px;
    font-weight: 600;
    color: var(--primary);
    text-decoration: none;
}

.summary-inline-link:hover {
    color: var(--primary-hover);
    text-decoration: underline;
}

.summary-export-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    width: 100%;
    padding: 8px 12px;
    font-size: 12px;
    font-weight: 600;
    color: #fff;
    background: var(--primary);
    border: 1px solid var(--primary);
    border-radius: var(--radius-sm);
    text-decoration: none;
    transition: background .15s, color .15s;
    white-space: nowrap;
}

.summary-export-btn:hover {
    background: var(--primary-hover);
    color: #fff;
}

.top-section-head {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-start;
    gap: 12px;
    margin-bottom: 18px;
    text-align: left;
}

.top-section-head h3 {
    font-size: 20px;
    font-weight: 800;
    color: var(--text);
    margin-bottom: 0;
    letter-spacing: -.2px;
}

.top-section-subhead {
    font-size: 13px;
    color: var(--text-muted);
    margin-top: -6px;
}

/* Dashboard section cards — unified teal top accent */
.summary-card,
.dashboard-view-section.card {
    border-color: #cbd5e1;
    border-top: 4px solid var(--primary);
    box-shadow: 0 12px 30px -26px rgba(15, 23, 42, .45);
}

.dashboard > .filter-bar.dashboard-view-section {
    border-top: 4px solid var(--primary);
}

.provider-snapshot-dot {
    display: inline-block;
    width: 9px;
    height: 9px;
    border-radius: 50%;
    flex-shrink: 0;
    vertical-align: middle;
}

.provider-snapshot-trend {
    font-size: 11px;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: .3px;
    flex-shrink: 0;
}

/* Engine matrix — one scannable row per AI assistant */
.engine-matrix-wrap {
    overflow-x: auto;
    scrollbar-width: thin;
}

.engine-matrix {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
    font-size: 13px;
}

.em-engine-col { width: 16%; }
.em-note-col   { width: 28%; }

.engine-matrix thead th {
    text-align: left;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .3px;
    color: var(--text-muted);
    padding: 0 16px 9px 0;
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}

.engine-matrix thead th:last-child {
    text-align: right;
    padding-right: 0;
}

.engine-matrix thead th.em-rank-col {
    text-align: center;
}

.engine-matrix tbody td {
    padding: 13px 16px 13px 0;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}

.engine-matrix tbody td:last-child {
    padding-right: 0;
    text-align: right;
}

.engine-matrix tbody td.em-rank-col {
    text-align: center;
}

.engine-matrix tbody tr:last-child td {
    border-bottom: none;
}

.engine-matrix tbody tr:hover {
    background: var(--bg);
}

.em-engine {
    white-space: nowrap;
}

.em-engine .provider-snapshot-dot {
    margin-right: 8px;
}

.em-engine-name {
    font-weight: 700;
    color: var(--text);
    vertical-align: middle;
}

.em-engine .provider-snapshot-trend {
    margin-left: 8px;
}

.em-vis-col {
    width: 40%;
}

.em-rank-col {
    width: 16%;
}

.em-vis {
    display: flex;
    align-items: center;
    gap: 10px;
}

.em-vis-bar {
    flex: 1;
    height: 6px;
    background: #eef2f6;
    border-radius: 999px;
    overflow: hidden;
    min-width: 70px;
}

.em-vis-fill {
    height: 100%;
    border-radius: 999px;
}

.em-vis-fill.em-vis-high { background: var(--success); }
.em-vis-fill.em-vis-mid  { background: var(--warning); }
.em-vis-fill.em-vis-low  { background: var(--danger); }

.em-vis-pct {
    font-weight: 700;
    color: var(--text);
    min-width: 38px;
}

.em-rank {
    font-size: 15px;
    font-weight: 700;
    color: var(--text);
}

.em-rank.rank-none {
    color: var(--text-muted);
    font-weight: 600;
}

.em-rank-primary {
    display: block;
    font-size: 15px;
    font-weight: 700;
    color: var(--text);
    line-height: 1.2;
}

.em-rank-range {
    display: block;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    letter-spacing: .2px;
}

.em-note {
    color: var(--text-secondary);
    line-height: 1.4;
}

.em-note-ok {
    color: var(--text-muted);
}

.em-row-muted .em-engine-name {
    color: var(--text-muted);
}

.em-unavailable {
    color: var(--text-muted);
    font-style: italic;
}

.insight-and-competitor-grid {
    display: grid;
    grid-template-columns: minmax(0, .9fr) minmax(320px, 1.1fr);
    gap: 16px;
}

.insight-and-competitor-grid.is-single {
    grid-template-columns: 1fr;
}

/* Query themes — compact strong/weak rows */
.theme-rows {
    display: flex;
    flex-direction: column;
}

.theme-row {
    display: flex;
    align-items: baseline;
    gap: 10px;
    flex-wrap: wrap;
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
}

.theme-row:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.theme-row:first-child {
    padding-top: 0;
}

.theme-tag {
    flex-shrink: 0;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .4px;
    padding: 2px 8px;
    border-radius: 999px;
}

.theme-tag-strong {
    color: var(--success);
    background: var(--success-light);
}

.theme-tag-weak {
    color: var(--danger);
    background: var(--danger-light);
}

.theme-name {
    font-size: 15px;
    font-weight: 700;
    color: var(--text);
}

.theme-stat {
    margin-left: auto;
    font-size: 13px;
    color: var(--text-muted);
    white-space: nowrap;
}

.theme-stat strong {
    color: var(--text);
}

/* Competitor pressure — table layout */
.competitor-table .ct-num-col {
    width: 1%;
    white-space: nowrap;
}

.ct-name {
    font-weight: 700;
    color: var(--text);
}

.ct-num {
    font-size: 15px;
    font-weight: 700;
    color: var(--text);
}

.ct-sub {
    display: block;
    font-size: 11px;
    font-weight: 500;
    color: var(--text-muted);
}

.competitor-pressure-providers {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.competitor-pressure-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 9px;
    border-radius: 999px;
    background: var(--surface);
    border: 1px solid var(--border);
    font-size: 11px;
    font-weight: 600;
    color: var(--text-secondary);
}

.competitor-pressure-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.section-empty-state {
    border: 1px dashed #cbd5e1;
    border-radius: var(--radius-sm);
    padding: 16px 18px;
    background: #fcfdff;
    font-size: 13px;
    line-height: 1.6;
    color: var(--text-secondary);
}

.section-empty-state strong {
    color: var(--text);
}

.section-empty-state-inline {
    margin-bottom: 14px;
}

.matrix-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 18px;
    text-align: left;
}

.matrix-header h3 {
    font-size: 20px;
    font-weight: 800;
    color: var(--text);
    letter-spacing: -.2px;
}

.matrix-subhead {
    font-size: 13px;
    color: var(--text-muted);
    margin-top: 4px;
}

.matrix-view-tabs {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.matrix-view-tab {
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text-secondary);
    border-radius: 999px;
    padding: 7px 12px;
    font-size: 12px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
}

.matrix-view-tab.is-active {
    background: var(--primary-light);
    border-color: var(--primary);
    color: var(--primary);
}

.matrix-view-panel + .matrix-view-panel {
    margin-top: 0;
}

.heatmap-query-main {
    display: block;
    color: var(--text-secondary);
}

.heatmap-query-sub {
    display: block;
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 3px;
}

.provider-weakness-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 12px;
}

.provider-weakness-card {
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 16px;
    background: var(--bg);
}

.provider-weakness-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
}

.provider-weakness-name-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
}

.provider-weakness-name {
    font-size: 14px;
    font-weight: 700;
    color: var(--text);
}

.provider-weakness-metric {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
}

.provider-weakness-copy {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.55;
}

.provider-weakness-list {
    list-style: none;
    margin-top: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.provider-weakness-list li {
    display: flex;
    flex-direction: column;
    gap: 3px;
    padding-top: 8px;
    border-top: 1px solid var(--border);
}

.provider-weakness-example {
    font-size: 13px;
    color: var(--text);
}

.provider-weakness-theme {
    font-size: 11px;
    color: var(--text-muted);
}

@media (max-width: 1100px) {
    .insight-and-competitor-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 640px) {
    .summary-card {
        grid-template-columns: 1fr;
        padding: 14px 16px;
        gap: 10px;
    }
    .summary-main {
        text-align: left;
    }
    .summary-business {
        font-size: 17px;
    }
    .summary-report-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }
    .summary-side {
        text-align: left;
        justify-content: flex-start;
    }
    .summary-score-badge {
        min-height: auto;
    }
    .summary-export-btn {
        width: 100%;
    }
    .summary-score-num {
        font-size: 36px;
    }
    .summary-narrative {
        font-size: 15px;
    }
    .top-section-head {
        flex-direction: column;
        align-items: flex-start;
        margin-bottom: 12px;
    }
    .insight-and-competitor-grid {
        grid-template-columns: 1fr;
    }
    .matrix-header {
        flex-direction: column;
        align-items: flex-start;
    }
    .matrix-view-tabs {
        width: 100%;
    }
    .matrix-view-tab {
        flex: 1 1 auto;
        text-align: center;
    }
}

/* ═══════════════════════════════════════════
   V4 — Collapsible Sections
   ═══════════════════════════════════════════ */

.v4-section-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    background: none;
    border: none;
    cursor: pointer;
    font-family: inherit;
    padding: 0;
}

.v4-section-toggle:hover {
    opacity: .8;
}

.v4-toggle-arrow {
    font-size: 14px;
    color: var(--text-muted);
    transition: transform .2s;
}

.v4-collapsible {
    max-height: 0;
    overflow: hidden;
    transition: max-height .35s ease, margin .2s ease;
    margin-top: 0;
}

.v4-expanded .v4-toggle-arrow {
    transform: rotate(-180deg);
}

.v4-expanded .v4-collapsible {
    max-height: 3000px;
    margin-top: 16px;
}

/* ── Query feedback panel ─────────────────────────────────── */
.qf-help {
    color: var(--text-secondary);
    font-size: 13px;
    line-height: 1.5;
    margin: 0 0 12px 0;
}

.qf-list {
    list-style: none;
    padding: 0;
    margin: 0 0 18px 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.qf-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: #fff;
    transition: border-color .12s ease;
}

.qf-item:hover { border-color: #cbd5e1; }

.qf-text {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 8px;
}

.qf-q {
    font-size: 13px;
    color: var(--text);
    line-height: 1.4;
    word-break: break-word;
}

.qf-tag {
    display: inline-block;
    font-size: 10px;
    font-weight: 500;
    color: var(--text-muted);
    border: 1px solid var(--border);
    padding: 1px 6px;
    border-radius: 3px;
    text-transform: lowercase;
    letter-spacing: .2px;
    flex-shrink: 0;
}

.qf-actions {
    display: flex;
    gap: 4px;
    flex-shrink: 0;
}

.qf-btn {
    width: 28px;
    height: 28px;
    border: 1px solid var(--border);
    background: #fff;
    color: var(--text-muted);
    border-radius: 4px;
    cursor: pointer;
    font-size: 11px;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background .12s ease, border-color .12s ease, color .12s ease;
}

.qf-btn:hover:not(:disabled) {
    border-color: #94a3b8;
    color: var(--text);
}

.qf-btn:disabled {
    opacity: .5;
    cursor: not-allowed;
}

.qf-up.is-active {
    background: var(--primary-light);
    border-color: var(--primary);
    color: var(--primary);
}

.qf-down.is-active {
    background: #fef2f2;
    border-color: #ef4444;
    color: #ef4444;
}

/* ── Suggest-a-query form ─────────────────────────────────── */
.qf-suggest {
    border-top: 1px solid var(--border);
    padding-top: 16px;
    margin-top: 4px;
}

.qf-suggest-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    margin: 0 0 10px 0;
}

#qf-suggest-form {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    width: 100%;
}

.qf-suggest-input {
    flex: 1;
    min-width: 0;
    padding: 8px 12px;
    font-size: 13px;
    font-family: inherit;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: #fff;
    color: var(--text);
    transition: border-color .12s ease;
}

.qf-suggest-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}

.qf-suggest-btn {
    /* .btn-primary is full-width for login forms — keep this row inline */
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: auto;
    margin-top: 0;
    padding: 8px 18px;
    flex: 0 0 auto;
    white-space: nowrap;
}

.qf-error {
    margin: 8px 0 0 0;
    padding: 6px 10px;
    background: #fef2f2;
    color: #b91c1c;
    border: 1px solid #fecaca;
    border-radius: 4px;
    font-size: 12px;
}

.qf-suggestions {
    list-style: none;
    padding: 0;
    margin: 12px 0 0 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.qf-suggestions[data-empty="true"] { display: none; }

.qf-suggestion {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 8px 10px 8px 12px;
    background: var(--primary-light);
    border: 1px solid #ccfbf1;
    border-radius: 4px;
    font-size: 12px;
}

.qf-s-text {
    color: var(--text);
    line-height: 1.4;
    word-break: break-word;
}

.qf-remove {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    padding: 0 4px;
    flex-shrink: 0;
    border-radius: 3px;
    transition: color .12s ease, background .12s ease;
}

.qf-remove:hover {
    color: #b91c1c;
    background: #fee2e2;
}

@media (max-width: 640px) {
    .qf-item {
        flex-direction: column;
        align-items: stretch;
    }
    .qf-actions { justify-content: flex-end; }
    #qf-suggest-form { flex-direction: column; align-items: stretch; }
    .qf-suggest-input {
        flex: none;
        width: 100%;
    }
    .qf-suggest-btn {
        width: 100%;
        margin-top: 0;
    }
}

/* ── Admin onboarding queue ─────────────────────────────────── */
.nav-badge {
    display: inline-block;
    min-width: 18px;
    padding: 1px 6px;
    margin-left: 2px;
    font-size: 11px;
    font-weight: 700;
    line-height: 16px;
    text-align: center;
    color: #fff;
    background: var(--danger);
    border-radius: 999px;
    vertical-align: middle;
}

.admin-section { margin-bottom: 32px; }
.admin-section > h3 {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 15px;
    font-weight: 600;
    color: var(--text);
    margin: 0 0 12px;
}
.queue-count {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 1px 8px;
}
.muted { color: var(--text-muted); font-size: 14px; }

.queue-card { margin-bottom: 12px; }
.queue-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}
.queue-email { font-weight: 600; color: var(--text); }
.queue-firm { color: var(--text-secondary); }
.queue-tag {
    font-size: 12px;
    color: var(--text-secondary);
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 2px 8px;
}
.queue-date { margin-left: auto; font-size: 12px; color: var(--text-muted); }

.queue-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 16px;
}
.queue-approve, .queue-reject {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}
.queue-actions input[type="text"] {
    padding: 8px 10px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 14px;
    min-width: 200px;
}
.queue-approve { flex: 1; }
.queue-reject input[type="text"] { min-width: 140px; }

.btn-secondary {
    display: inline-block;
    padding: 9px 16px;
    font-size: 14px;
    font-weight: 600;
    color: var(--primary);
    background: var(--primary-light);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    text-decoration: none;
    cursor: pointer;
}
.btn-secondary:hover { border-color: var(--primary); }

.queue-closed { display: flex; align-items: center; gap: 12px; }
.queue-status {
    font-size: 12px;
    font-weight: 600;
    border-radius: 999px;
    padding: 2px 10px;
}
.status-activated { color: var(--success); background: var(--success-light); }
.status-rejected { color: var(--danger); background: var(--danger-light); }
.queue-note { font-size: 13px; color: var(--text-muted); }
.queue-link { font-size: 13px; color: var(--primary); text-decoration: none; }
.queue-link:hover { text-decoration: underline; }

.queue-repeat { color: var(--warning, #b45309); border-color: var(--warning, #b45309); }

.queue-place {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin: -4px 0 12px;
    font-size: 13px;
    color: var(--text-secondary);
}
.queue-place-badge {
    font-size: 12px;
    font-weight: 600;
    color: var(--primary);
    background: var(--primary-light);
    border-radius: 999px;
    padding: 2px 8px;
}
.queue-place-loc { font-weight: 600; color: var(--text); }
.queue-place-addr { color: var(--text-muted); }

.queue-goals {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    margin: -2px 0 12px;
}
.queue-goals-label { font-size: 12px; font-weight: 600; color: var(--text-muted); }
.queue-goal {
    font-size: 12px;
    color: var(--primary);
    background: var(--primary-light);
    border-radius: 999px;
    padding: 2px 9px;
}

.queue-delivery {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    margin-top: 12px;
    padding: 10px 12px;
    border-radius: var(--radius-sm);
}
.queue-delivery.is-pending { background: var(--warning-light, #fffbeb); border: 1px solid var(--warning, #f59e0b); }
.queue-delivery.is-delivered { background: var(--bg); border: 1px solid var(--border); }
.queue-warn { font-size: 13px; font-weight: 600; color: var(--warning, #b45309); margin-right: auto; }
.queue-inline { display: inline; }
.btn-link {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 12px;
    cursor: pointer;
    text-decoration: underline;
    padding: 0;
}

.v3-prov-unavailable {
    color: var(--text-muted);
    font-weight: 600;
    font-size: 12px;
    font-style: italic;
}

/* ════════════════════════════════════════════════════════════
   Brand perception — "What does AI say about you?" (dashboard lead)
   ════════════════════════════════════════════════════════════ */
.bp-section { margin-bottom: 20px; }
.bp-kicker {
    font-size: 12px;
    font-weight: 800;
    letter-spacing: .04em;
    text-transform: uppercase;
    color: var(--text);
    margin-bottom: 6px;
    text-align: left;
}
.bp-headline {
    font-size: 21px;
    font-weight: 600;
    line-height: 1.35;
    color: var(--text);
    margin: 0 0 18px;
}
.bp-body {
    display: grid;
    grid-template-columns: 1fr minmax(240px, 300px);
    gap: 28px;
    align-items: start;
}
@media (max-width: 760px) { .bp-body { grid-template-columns: 1fr; gap: 20px; } }

.bp-quote { margin: 0; padding: 2px 0 2px 16px; border-left: 3px solid var(--primary); }
.bp-quote blockquote {
    margin: 0;
    font-size: 15px;
    line-height: 1.6;
    color: var(--text-secondary);
    font-style: italic;
}
.bp-quote figcaption {
    margin-top: 10px;
    font-size: 12px;
    font-weight: 600;
    font-style: normal;
    color: var(--text-muted);
}

.bp-meters { display: flex; flex-direction: column; gap: 14px; }
.bp-meter-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 5px; }
.bp-meter-name { font-size: 13px; font-weight: 600; color: var(--text); }
.bp-meter-verdict { font-size: 12px; font-weight: 700; }
.bp-meter-bar { height: 7px; border-radius: 999px; background: var(--bg); overflow: hidden; }
.bp-meter-fill { height: 100%; border-radius: 999px; }
.bp-meter-hint { display: block; margin-top: 4px; font-size: 11px; color: var(--text-muted); }

.bp-alert {
    margin-top: 18px;
    padding: 12px 14px;
    font-size: 13px;
    line-height: 1.5;
    color: #92400e;
    background: #fffbeb;
    border: 1px solid #fde68a;
    border-radius: var(--radius-sm);
}

.bp-providers { margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--border); }
.bp-providers-label { font-size: 13px; font-weight: 600; color: var(--text); margin-bottom: 12px; }
.bp-prov-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; }
.bp-prov { padding: 12px 14px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); }
.bp-prov-head { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.bp-prov-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.bp-prov-name { font-size: 13px; font-weight: 600; color: var(--text); }
.bp-prov-chip { margin-left: auto; font-size: 11px; font-weight: 700; padding: 1px 8px; border-radius: 999px; }
.bp-prov-summary { margin: 0; font-size: 13px; line-height: 1.5; color: var(--text-secondary); }

/* Tone system (shared by meters, chips, score verdict) */
.bp-tone-good { color: var(--success); }
.bp-tone-ok   { color: var(--primary); }
.bp-tone-warn { color: var(--warning); }
.bp-tone-bad  { color: var(--danger); }
.bp-tone-muted { color: var(--text-muted); }
.bp-meter-fill.bp-tone-good { background: var(--success); }
.bp-meter-fill.bp-tone-ok   { background: var(--primary); }
.bp-meter-fill.bp-tone-warn { background: var(--warning); }
.bp-meter-fill.bp-tone-bad  { background: var(--danger); }
.bp-meter-fill.bp-tone-muted { background: var(--text-muted); }
.bp-prov-chip.bp-tone-good { color: var(--success); background: var(--success-light); }
.bp-prov-chip.bp-tone-ok   { color: var(--primary); background: var(--primary-light); }
.bp-prov-chip.bp-tone-warn { color: #92400e; background: #fffbeb; }
.bp-prov-chip.bp-tone-bad  { color: var(--danger); background: var(--danger-light); }
.bp-prov-chip.bp-tone-muted { color: var(--text-muted); background: var(--bg); }

/* "Since your last scan" change band */
.change-band { padding: 16px 20px; }
.change-band-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
}
.change-band-title {
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--text-muted);
}
.change-band-range {
    font-size: 0.8rem;
    color: var(--text-muted);
    white-space: nowrap;
}
.change-band-list { list-style: none; margin: 0; padding: 0; }
.change-band-item {
    display: flex;
    align-items: baseline;
    gap: 8px;
    padding: 3px 0;
    font-size: 0.95rem;
}
.change-band-dot { font-size: 1.1rem; line-height: 1; }
.change-band-text { color: var(--text); }
.change-band-note,
.change-band-empty {
    margin: 0;
    font-size: 0.9rem;
    line-height: 1.4;
}
.change-band-empty { color: var(--text-muted); }

/* "Do this to get found" action center */
.action-center { padding: 20px 22px; }
.action-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.action-item {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    padding: 12px 14px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--bg);
}
.action-rank {
    flex: 0 0 auto;
    width: 24px; height: 24px;
    display: flex; align-items: center; justify-content: center;
    border-radius: 50%;
    background: var(--primary); color: #fff;
    font-size: 0.8rem; font-weight: 700;
}
.action-body { flex: 1 1 auto; min-width: 0; }
.action-title-row { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.action-title { font-weight: 650; color: var(--text); }
.action-cat {
    font-size: 0.68rem; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase;
    color: var(--text-muted); background: var(--bg-subtle, #f1f5f9);
    padding: 2px 7px; border-radius: 999px;
}
.action-evidence { margin: 4px 0 0; font-size: 0.9rem; color: var(--text-muted); line-height: 1.4; }
.action-link { display: inline-block; margin-top: 6px; font-size: 0.85rem; font-weight: 600; color: var(--primary); text-decoration: none; }
.action-link:hover { text-decoration: underline; }

/* "What customers actually see" — verbatim answers */
.customer-view { padding: 20px 22px; }
.customer-view-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 16px; }
.cv-card {
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 16px 18px;
    background: var(--card-bg, #fff);
    display: flex;
    flex-direction: column;
}
.cv-card-miss { border-top: 3px solid var(--warning); }
.cv-card-win { border-top: 3px solid var(--success); }
.cv-card-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 10px; }
.cv-badge { font-size: 0.72rem; font-weight: 800; letter-spacing: 0.04em; text-transform: uppercase; padding: 4px 9px; border-radius: 999px; }
.cv-badge-miss { color: #92400e; background: #fffbeb; }
.cv-badge-win { color: var(--success); background: var(--success-light); }
.cv-provider {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--cv-prov, var(--text));
}
.cv-provider-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--cv-prov, var(--text-muted)); }
.cv-query { margin: 0 0 10px; font-style: italic; color: var(--text); font-size: 1rem; line-height: 1.4; }
.cv-leader { margin: 0 0 12px; font-size: 0.9rem; color: #92400e; font-weight: 600; }
.cv-answer-wrap { padding-top: 12px; border-top: 1px solid var(--border); }
.cv-answer { font-size: 0.95rem; line-height: 1.7; color: var(--text); }
.cv-answer .cv-mark { background: var(--success-light); color: var(--success); padding: 0 3px; border-radius: 3px; font-weight: 600; }
.cv-expand {
    margin-top: 10px;
    padding: 0;
    background: none;
    border: none;
    color: var(--primary);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
}
.cv-expand:hover { text-decoration: underline; }

/* Plain-English verdict pill on the visibility score */
.summary-score-verdict {
    display: inline-block;
    margin-top: 6px;
    font-size: 12px;
    font-weight: 700;
    padding: 2px 10px;
    border-radius: 999px;
    background: var(--bg);
}

/* ════════════════════════════════════════════════════════════
   Source attribution — "Where does AI get its info about you?"
   ════════════════════════════════════════════════════════════ */
.sa-section { margin-bottom: 20px; }
.sa-head {
    text-align: left;
}
.sa-headline {
    font-size: 20px;
    font-weight: 800;
    line-height: 1.4;
    color: var(--text);
    margin: 0 0 20px;
    letter-spacing: -.2px;
}
.sa-mix { display: flex; flex-direction: column; gap: 14px; }
.sa-row { display: grid; grid-template-columns: minmax(140px, 220px) 1fr 44px; align-items: center; gap: 16px; }
.sa-row-label { display: flex; flex-direction: column; }
.sa-row-name { font-size: 14px; font-weight: 600; color: var(--text); }
.sa-row-hint { font-size: 12px; color: var(--text-muted); }
.sa-row-bar { height: 9px; border-radius: 999px; background: var(--bg); overflow: hidden; }
.sa-row-fill { height: 100%; border-radius: 999px; }
.sa-row-pct { font-size: 14px; font-weight: 700; color: var(--text-secondary); text-align: right; }

.sa-domains { margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--border); }
.sa-domains-label { font-size: 13px; font-weight: 600; color: var(--text); margin-bottom: 10px; }
.sa-domain-list { display: flex; flex-wrap: wrap; gap: 8px; }
.sa-domain-chip {
    font-size: 13px;
    color: var(--text-secondary);
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 4px 10px;
}
.sa-domain-count { color: var(--text-muted); font-weight: 600; }

.sa-insight {
    margin-top: 20px;
    padding: 14px 16px;
    font-size: 13.5px;
    line-height: 1.55;
    color: var(--text-secondary);
    background: var(--primary-light);
    border-radius: var(--radius-sm);
}
@media (max-width: 600px) {
    .sa-row { grid-template-columns: 1fr; gap: 6px; }
    .sa-row-pct { text-align: left; }
}

/* Evidence: keep source-type tag intact while names wrap */
.v2-ranked-list .v3-tag { flex-shrink: 0; }

/* Source-attribution bar fills (tone colors) */
.sa-row-fill.bp-tone-good { background: var(--success); }
.sa-row-fill.bp-tone-ok   { background: var(--primary); }
.sa-row-fill.bp-tone-warn { background: var(--warning); }
.sa-row-fill.bp-tone-bad  { background: var(--danger); }
.sa-row-fill.bp-tone-muted { background: var(--text-muted); }

/* Clickable cited-domain chips (anchor variant) */
a.sa-domain-chip { text-decoration: none; cursor: pointer; transition: border-color .12s, color .12s; }
a.sa-domain-chip:hover { border-color: var(--primary); color: var(--primary); }

/* ── Source gap: independent sources lifting competitors but not you ── */
.sa-gap { margin-top: 22px; padding-top: 20px; border-top: 1px solid var(--border); }
.sa-gap-label { font-size: 14px; font-weight: 700; color: var(--text); }
.sa-gap-sub { margin: 4px 0 14px; font-size: 13px; color: var(--text-muted); }
.sa-gap-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.sa-gap-item {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 12px;
    padding: 10px 14px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
}
.sa-gap-domain { font-size: 14px; font-weight: 600; color: var(--primary); text-decoration: none; }
.sa-gap-domain:hover { text-decoration: underline; }
.sa-gap-type {
    font-size: 11px;
    font-weight: 700;
    padding: 1px 8px;
    border-radius: 999px;
    color: var(--warning);
    background: #fffbeb;
}
.sa-gap-type-social { color: var(--success); background: var(--success-light); }
.sa-gap-who { font-size: 12.5px; color: var(--text-secondary); margin-left: auto; }
@media (max-width: 600px) { .sa-gap-who { margin-left: 0; width: 100%; } }

/* ── Collapsible "Visibility diagnosis" (advanced, secondary) ── */
.diagnosis-details > summary { list-style: none; cursor: pointer; }
.diagnosis-details > summary::-webkit-details-marker { display: none; }
.diagnosis-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}
.diagnosis-summary h3 { margin: 0; display: flex; align-items: center; gap: 8px; }
.diagnosis-advanced-tag {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
    color: var(--text-muted);
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 1px 7px;
}
.diagnosis-summary-arrow { color: var(--text-muted); font-size: 16px; transition: transform .15s; flex-shrink: 0; }
.diagnosis-details[open] .diagnosis-summary-arrow { transform: rotate(180deg); }
.matrix-header-tabs-only { margin-top: 16px; justify-content: flex-start; }

/* "See more" toggle for per-assistant description cards */
.bp-more-btn {
    margin-top: 12px;
    padding: 7px 14px;
    font-size: 13px;
    font-weight: 600;
    color: var(--primary);
    background: none;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: border-color .12s, background .12s;
}
.bp-more-btn:hover { border-color: var(--primary); background: var(--primary-light); }

/* ── Engine-matrix section: grouped sub-blocks (matrix · themes · competitors) ── */
.engine-matrix-section .em-subblock { margin-top: 18px; }
.engine-matrix-section .insight-and-competitor-grid .em-subblock { margin-top: 0; }
.em-subhead {
    font-size: 14px;
    font-weight: 700;
    color: var(--text);
    margin: 0 0 2px;
}
.em-subhead-note {
    font-size: 13px;
    color: var(--text-muted);
    margin: 0 0 14px;
}
.em-divider {
    border-top: 1px solid var(--border);
    margin: 26px 0 2px;
}

/* ── Report header (page-level, above the section cards) ── */
.report-header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 4px 16px;
    margin: 0 2px 10px;
}
.report-header-name {
    font-size: 20px;
    font-weight: 700;
    color: var(--text);
    margin: 0;
}
.report-header-meta {
    margin: 0;
    font-size: 13px;
    color: var(--text-muted);
}
.report-header-meta .report-meta-sep { margin: 0 7px; opacity: .6; }

/* ── Query themes: slim inline strip ── */
.theme-strip { display: flex; flex-wrap: wrap; gap: 10px; }
.theme-chip {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1 1 280px;
    padding: 10px 14px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
}
.theme-chip .theme-name { font-weight: 600; color: var(--text); }
.theme-chip .theme-stat { margin-left: auto; font-size: 13px; color: var(--text-secondary); white-space: nowrap; }

/* ── Who AI recommends instead: compact card grid ── */
.comp-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 10px;
}
.comp-card {
    padding: 12px 14px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
}
.comp-card-top { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 9px; }
.comp-name { font-size: 14px; font-weight: 600; color: var(--text); }
.comp-ahead { font-size: 14px; font-weight: 700; color: var(--text); white-space: nowrap; }
.comp-ahead-sub { font-size: 11px; font-weight: 500; color: var(--text-muted); }

/* ── Source gap: compact card grid (mirrors competitor cards) ── */
.sa-gap-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(330px, 1fr));
    gap: 10px;
}
.sa-gap-card {
    display: block;
    padding: 12px 14px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    text-decoration: none;
    transition: border-color .12s;
}
.sa-gap-card:hover { border-color: var(--primary); }
.sa-gap-card-top { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.sa-gap-card .sa-gap-domain { font-size: 14px; font-weight: 600; color: var(--primary); }
.sa-gap-cites { font-size: 13px; line-height: 1.45; color: var(--text-secondary); }
