/* ═══════════════════════════════════════════════════════════════
   Site Optimised — site.css
   Design System: Visitors (refero.design)
   Typography: DM Sans → Inter fallback
   Modes: Light (default) | Dark via html[data-theme="dark"]
═══════════════════════════════════════════════════════════════ */

/* ── Light tokens (default) ─────────────────────────────────── */
:root {
  /* Visitors brand palette */
  --primary:      #918df6;
  --primary-dark: #7b75e8;
  --primary-lt:   #c4c2fa;
  --mint:         #33c758;
  --mint-wash:    #def6e4;
  --amber:        #ffa600;
  --amber-lt:     #fff3cd;
  --sky:          #2c78fc;
  --magenta:      #d6409f;
  --magenta-lt:   rgba(214,64,159,.1);
  --ember:        #ff3e00;

  /* Neutrals */
  --carbon:       #181925;
  --graphite:     #666666;
  --ash:          #999999;
  --fog:          #e8e8e8;
  --mist:         #f5f5f5;
  --linen:        #fafafa;
  --paper:        #ffffff;

  /* Semantic surface tokens */
  --bg:           #f5f5f5;
  --surface:      #ffffff;
  --surface-2:    #fafafa;
  --border:       #e8e8e8;
  --text:         #181925;
  --text-mid:     #666666;
  --text-muted:   #999999;
  --red:          #dc2626;
  --red-lt:       #fee2e2;

  /* Backward-compat aliases (keep all existing views working) */
  --navy:         #181925;
  --navy-mid:     #1e2232;
  --indigo:       #918df6;
  --indigo-lt:    #c4c2fa;
  --indigo-dark:  #7b75e8;
  --white:        #ffffff;
  --off-white:    #fafafa;
  --slate-1:      #f5f5f5;
  --slate-2:      #e8e8e8;
  --slate-3:      #999999;
  --slate-4:      #666666;
  --green:        #33c758;
  --green-lt:     #def6e4;

  /* Insights colour aliases — used by Insights Hub views */
  --mint-lt:      #dcfce7;
  --mint-dk:      #14532d;
  --sky-lt:       #dbeafe;
  --sky-dk:       #1e3a8a;
  --amber-dk:     #78350f;
  --red-dk:       #7f1d1d;
  --primary-xlt:  #f0efff;

  --purple:       #d6409f;
  --purple-lt:    rgba(214,64,159,.1);

  /* Semantic state token pairs — theme-aware status colours */
  --c-pass-bg:  #dcfce7;   --c-pass-fg:  #14532d;
  --c-fail-bg:  #fee2e2;   --c-fail-fg:  #7f1d1d;
  --c-run-bg:   #dbeafe;   --c-run-fg:   #1d4ed8;
  --c-queue-bg: #fef3c7;   --c-queue-fg: #92400e;
  --c-info-bg:  #eff6ff;   --c-info-fg:  #1e40af;
  --c-warn-bg:  #fffbeb;   --c-warn-fg:  #78350f;

  /* Always-dark hero gradient anchors — do NOT flip in dark mode */
  --hero-from:     #181925; --hero-to:     #1e2d5a;
  --hero-seo-from: #1e1b4b; --hero-seo-to: #312e81;

  /* Border radius — Visitors spec */
  --radius-pill:  9999px;
  --radius:       16px;
  --radius-sm:    8px;
  --radius-xs:    6px;

  /* Elevation */
  --shadow:       0 1px 1px 1px rgba(0,0,0,.08), 0 0 0 0.5px rgba(0,0,0,.06);
  --shadow-lg:    0 1px 3px rgba(0,0,0,.06), 0 8px 16px rgba(0,0,0,.06), 0 0 0 1px rgba(0,0,0,.02);

  /* Typography */
  --font-display: 'DM Sans', 'Inter', system-ui, sans-serif;
  --font-body:    'DM Sans', 'Inter', system-ui, sans-serif;
}

/* ── Dark tokens ─────────────────────────────────────────────── */
html[data-theme="dark"] {
  --primary:      #918df6;
  --primary-dark: #a9a6f8;
  --primary-lt:   #c4c2fa;
  --mint:         #33c758;
  --mint-wash:    rgba(51,199,88,.15);
  --amber:        #ffa600;
  --amber-lt:     rgba(255,166,0,.12);
  --magenta:      #e05cb5;
  --magenta-lt:   rgba(224,92,181,.12);

  --carbon:       #e8eaf0;
  --graphite:     #adb5c8;
  --ash:          #7a8399;
  --fog:          #2a2d3e;
  --mist:         #1e2030;
  --linen:        #1a1d2a;
  --paper:        #141622;

  --bg:           #0f1117;
  --surface:      #141622;
  --surface-2:    #1a1d2a;
  --border:       #2a2d3e;
  --text:         #e8eaf0;
  --text-mid:     #adb5c8;
  --text-muted:   #7a8399;
  --red:          #f87171;
  --red-lt:       rgba(248,113,113,.12);

  --navy:         #e8eaf0;
  --navy-mid:     #adb5c8;
  --indigo:       #918df6;
  --indigo-lt:    #c4c2fa;
  --indigo-dark:  #a9a6f8;
  --white:        #141622;
  --off-white:    #1a1d2a;
  --slate-1:      #1e2030;
  --slate-2:      #2a2d3e;
  --slate-3:      #7a8399;
  --slate-4:      #adb5c8;
  --green:        #33c758;
  --green-lt:     rgba(51,199,88,.15);

  /* Insights colour aliases — dark overrides */
  --mint-lt:      rgba(51,199,88,.15);
  --mint-dk:      #4ade80;
  --sky-lt:       rgba(96,165,250,.12);
  --sky-dk:       #93c5fd;
  --amber-dk:     #fbbf24;
  --red-dk:       #f87171;
  --primary-xlt:  rgba(145,141,246,.1);

  --purple:       #e05cb5;
  --purple-lt:    rgba(224,92,181,.12);

  /* Semantic state tokens — dark overrides */
  --c-pass-bg:  rgba(51,199,88,.15);    --c-pass-fg:  #4ade80;
  --c-fail-bg:  rgba(248,113,113,.12);  --c-fail-fg:  #f87171;
  --c-run-bg:   rgba(96,165,250,.12);   --c-run-fg:   #60a5fa;
  --c-queue-bg: rgba(251,191,36,.12);   --c-queue-fg: #fbbf24;
  --c-info-bg:  rgba(96,165,250,.10);   --c-info-fg:  #93c5fd;
  --c-warn-bg:  rgba(251,191,36,.10);   --c-warn-fg:  #fbbf24;
  /* Hero anchors stay dark even in dark mode */
  --hero-from:     #0f1117; --hero-to:     #1a1d2a;
  --hero-seo-from: #1e1b4b; --hero-seo-to: #312e81;

  --shadow:       0 1px 1px rgba(0,0,0,.3), 0 0 0 0.5px rgba(0,0,0,.2);
  --shadow-lg:    0 1px 3px rgba(0,0,0,.3), 0 8px 16px rgba(0,0,0,.2), 0 0 0 1px rgba(255,255,255,.03);
}

/* ═══════════════════════════════════════════════════════════════
   BASE
═══════════════════════════════════════════════════════════════ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font-body);
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
  font-size: 15px;
  transition: background .2s, color .2s;
}

/* ── Typography ── */
h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 600; line-height: 1.2; color: var(--text); }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── Layout utilities ── */
.container          { max-width: 1200px; margin: 0 auto; padding: 0 24px; }
.container--narrow  { max-width: 680px; }
.section            { padding: 80px 0; }
.section--dark      { background: var(--carbon); color: var(--paper); }
.text-center        { text-align: center; }

/* ═══════════════════════════════════════════════════════════════
   BUTTONS — pill shape per Visitors spec
═══════════════════════════════════════════════════════════════ */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 10px 20px; border-radius: var(--radius-pill);
  font-family: var(--font-body); font-size: 14px; font-weight: 500;
  cursor: pointer; border: none; transition: all .15s;
  text-decoration: none; white-space: nowrap;
}
.btn-primary        { background: var(--primary); color: #fff; box-shadow: var(--shadow); }
.btn-primary:hover  { background: var(--primary-dark); color: #fff; text-decoration: none; }
.btn-ghost          { background: transparent; color: var(--text); border: 1px solid var(--border); }
.btn-ghost:hover    { background: var(--mist); text-decoration: none; }
.btn[disabled], button[disabled] { opacity: .45; cursor: not-allowed; pointer-events: auto; }
.btn-danger-ghost   { background: transparent; color: var(--red); border: 1px solid var(--red); }
.btn-danger-ghost:hover { background: var(--red-lt); text-decoration: none; }
.btn-navy           { background: var(--carbon); color: #fff; }
.btn-navy:hover     { opacity: .88; text-decoration: none; color: #fff; }
.btn-lg             { padding: 13px 26px; font-size: 15px; }
.btn-sm             { padding: 6px 14px; font-size: 13px; }
.btn-block          { width: 100%; justify-content: center; }
.btn:disabled, .btn[disabled] { opacity: .4; cursor: not-allowed; pointer-events: none; }

/* The "SO" tile (.logo-mark) and the wordmark text (.logo-text) that used to sit
   beside it were removed when every placement moved to the real logo image.
   See brand.css for .brand-logo. */

/* ═══════════════════════════════════════════════════════════════
   PUBLIC HEADER
═══════════════════════════════════════════════════════════════ */
.public-header {
  position: sticky; top: 0; z-index: 200;
  background: rgba(255,255,255,.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  transition: background .2s, border-color .2s;
}
html[data-theme="dark"] .public-header {
  background: rgba(20,22,34,.92);
}
.public-header .container {
  display: flex; align-items: center; justify-content: space-between; height: 88px;
}

.pub-logo {
  display: flex; align-items: center; gap: 10px;
  font-family: var(--font-display); font-weight: 700; font-size: 17px;
  color: var(--text); text-decoration: none;
}
.pub-logo:hover { text-decoration: none; }

.pub-nav { display: flex; align-items: center; gap: 24px; }
.pub-nav > a {
  color: var(--text-mid); font-size: 14px; font-weight: 500;
  text-decoration: none; transition: color .12s;
}
.pub-nav > a:hover { color: var(--primary); text-decoration: none; }

/* ── Hamburger button ── */
.nav-hamburger {
  display: none; flex-direction: column; justify-content: center; gap: 5px;
  width: 36px; height: 36px; background: none; border: none; cursor: pointer; padding: 4px;
}
.nav-hamburger span {
  display: block; height: 2px; border-radius: 2px; background: var(--text);
  transition: transform .25s, opacity .25s, width .25s;
}
.nav-hamburger span:nth-child(2) { width: 75%; }
.nav-hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-hamburger.open span:nth-child(2) { opacity: 0; }
.nav-hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ── Theme toggle ── */
.theme-toggle {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 12px; border-radius: var(--radius-pill);
  background: var(--mist); border: 1px solid var(--border);
  font-family: var(--font-body); font-size: 12px; font-weight: 600;
  color: var(--text-mid); cursor: pointer; transition: background .15s;
  white-space: nowrap;
}
.theme-toggle:hover { background: var(--fog); }

/* ── Mobile nav overlay ── */
.mobile-nav-overlay {
  display: none; position: fixed; inset: 0; z-index: 190;
  background: rgba(0,0,0,.4); backdrop-filter: blur(2px);
}
.mobile-nav-overlay.open { display: block; }
.mobile-nav-panel {
  position: absolute; top: 64px; left: 0; right: 0;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 16px 24px 24px;
  display: flex; flex-direction: column; gap: 4px;
  box-shadow: var(--shadow-lg);
  animation: slideDown .2s ease-out;
}
.mobile-nav-panel a {
  display: block; padding: 12px 8px;
  font-size: 15px; font-weight: 500; color: var(--text-mid);
  border-bottom: 1px solid var(--border);
  text-decoration: none; transition: color .12s;
}
.mobile-nav-panel a:last-of-type { border-bottom: none; }
.mobile-nav-panel a:hover { color: var(--primary); }
.mobile-nav-panel .mobile-nav-actions {
  display: flex; gap: 10px; padding-top: 16px; flex-wrap: wrap;
}
@keyframes slideDown { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: translateY(0); } }

/* ═══════════════════════════════════════════════════════════════
   PUBLIC FOOTER
═══════════════════════════════════════════════════════════════ */
.public-footer {
  border-top: 1px solid var(--border);
  padding: 32px 0;
  font-size: 13px; color: var(--text-muted);
  background: var(--surface);
  transition: background .2s, border-color .2s;
}
.public-footer .container {
  display: flex; flex-direction: column; align-items: flex-start; gap: 6px;
}
.public-footer-logo { display: inline-flex; text-decoration: none; margin-left: -4px; }
.public-footer-logo:hover { text-decoration: none; }

/* ═══════════════════════════════════════════════════════════════
   HERO
═══════════════════════════════════════════════════════════════ */
.hero {
  padding: 100px 0 80px;
  background: linear-gradient(160deg, var(--paper) 0%, var(--linen) 100%);
}
html[data-theme="dark"] .hero {
  background: linear-gradient(160deg, var(--surface) 0%, var(--linen) 100%);
}
.hero-eyebrow { font-size: 13px; font-weight: 600; color: var(--primary); text-transform: uppercase; letter-spacing: .06em; margin-bottom: 16px; }
.hero-headline { font-size: clamp(32px,5vw,56px); font-weight: 700; color: var(--text); margin-bottom: 20px; line-height: 1.1; letter-spacing: -1px; }
.hero-sub { font-size: 17px; color: var(--text-mid); max-width: 540px; margin-bottom: 36px; }
.hero-cta { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.hero-note { font-size: 13px; color: var(--text-muted); }

/* ── Stats bar ── */
.stats-bar { background: var(--carbon); padding: 32px 0; }
html[data-theme="dark"] .stats-bar { background: var(--surface); border-top: 1px solid var(--border); }
.stats-bar .container { display: flex; gap: 48px; flex-wrap: wrap; }
.stat-item { display: flex; flex-direction: column; }
.stat-num { font-family: var(--font-display); font-size: 32px; font-weight: 700; color: var(--primary-lt); }
.stat-label { font-size: 13px; color: var(--ash); max-width: 160px; }

/* ── Section title ── */
.section-title { font-size: 30px; color: var(--text); margin-bottom: 40px; }

/* ── Cards (3-col) ── */
.cards-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 24px; }
.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 28px;
  box-shadow: var(--shadow); transition: background .2s, border-color .2s;
}
.card h3 { font-size: 17px; margin: 12px 0 8px; }
.card p { font-size: 14px; color: var(--text-mid); }
.card-icon { display: inline-block; padding: 6px 12px; border-radius: var(--radius-sm); font-family: var(--font-display); font-weight: 700; font-size: 13px; margin-bottom: 4px; }
.card-icon--blue   { background: rgba(145,141,246,.12); color: var(--primary); }
.card-icon--purple { background: var(--magenta-lt); color: var(--magenta); }
.card-icon--green  { background: var(--mint-wash); color: var(--mint); }

/* ── Inline audit form ── */
.inline-audit-form { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-top: 24px; }
.input-url {
  padding: 12px 16px; border: 1.5px solid rgba(255,255,255,.2);
  border-radius: var(--radius-sm); background: rgba(255,255,255,.1);
  color: #fff; font-size: 15px; min-width: 280px; max-width: 100%;
}
.input-url::placeholder { color: rgba(255,255,255,.5); }

/* ═══════════════════════════════════════════════════════════════
   FREE AUDIT / RESULT
═══════════════════════════════════════════════════════════════ */
.free-result { padding: 40px 0 60px; }
.fr-scores { display: grid; grid-template-columns: repeat(3,1fr); gap: 16px; margin-bottom: 28px; }
.fr-score-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px 16px; text-align: center; position: relative; transition: background .2s, border-color .2s; }
.fr-score-card--locked { opacity: .55; }
.fr-score-card--locked::after { content: "🔒 Paid"; position: absolute; top: 10px; right: 10px; font-size: 11px; background: var(--amber); color: white; padding: 2px 7px; border-radius: var(--radius-pill); font-weight: 600; }
.fr-score-label { font-size: 11px; color: var(--text-muted); text-transform: uppercase; letter-spacing: .04em; margin-bottom: 8px; }
.fr-score-num { font-family: var(--font-display); font-size: 44px; font-weight: 700; line-height: 1; }
.fr-score-num span { font-size: 16px; }
.fr-score-sub { font-size: 12px; color: var(--text-muted); margin-top: 4px; }
.score-good { color: var(--mint); }
.score-mid  { color: var(--amber); }
.score-low  { color: var(--red); }

.audit-section { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; margin-bottom: 20px; transition: background .2s, border-color .2s; }
.audit-section h3 { font-size: 15px; color: var(--text); margin-bottom: 16px; display: flex; align-items: center; gap: 8px; }
.section-badge { font-size: 11px; font-weight: 600; padding: 3px 8px; border-radius: var(--radius-pill); }
.badge-aeo  { background: var(--amber-lt); color: #92400E; }
html[data-theme="dark"] .badge-aeo { color: var(--amber); }
.badge-tech { background: var(--mist); color: var(--text-muted); }
.badge-paid { background: rgba(145,141,246,.12); color: var(--primary); }

.detail-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.detail-item { display: flex; justify-content: space-between; align-items: center; padding: 9px 12px; background: var(--linen); border-radius: var(--radius-sm); font-size: 13px; transition: background .2s; }
.detail-item strong { color: var(--text); }
.badge-yes { background: var(--mint-wash); color: #14532D; padding: 2px 8px; border-radius: var(--radius-pill); font-size: 12px; font-weight: 500; }
html[data-theme="dark"] .badge-yes { color: var(--mint); }
.badge-no  { background: var(--red-lt); color: #7F1D1D; padding: 2px 8px; border-radius: var(--radius-pill); font-size: 12px; font-weight: 500; }
html[data-theme="dark"] .badge-no { color: var(--red); }
.badge-warn { background: var(--amber-lt); color: #78350F; padding: 2px 8px; border-radius: var(--radius-pill); font-size: 12px; font-weight: 500; }
html[data-theme="dark"] .badge-warn { color: var(--amber); }

.check-mini { width: 100%; font-size: 13px; border-collapse: collapse; margin-top: 12px; }
.check-mini td { padding: 8px 12px; border-bottom: 1px solid var(--border); vertical-align: top; }
.check-mini tr:last-child td { border-bottom: none; }
.check-mini tr.pass { background: rgba(51,199,88,.06); }
.check-mini tr.fail { background: rgba(255,166,0,.06); }
.pass-icon { color: var(--mint); font-weight: 700; }
.fail-icon { color: var(--red); font-weight: 700; }
.fix-hint  { color: var(--text-mid); font-size: 12px; margin-top: 2px; }

.paid-gate { background: linear-gradient(135deg, var(--carbon), var(--primary-dark)); color: white; border-radius: var(--radius); padding: 32px; margin-top: 28px; text-align: center; }
.paid-gate h3 { color: white; font-size: 20px; margin-bottom: 8px; }
.paid-gate p { color: rgba(255,255,255,.8); margin-bottom: 16px; }
.paid-features { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: 10px 24px; justify-content: center; margin-bottom: 24px; }
.paid-features li { color: rgba(255,255,255,.9); font-size: 14px; }
.paid-features li::before { content: "✓ "; color: var(--primary-lt); font-weight: 700; }

/* Score hero (free result page) */
.score-hero { display: flex; align-items: center; gap: 40px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 32px; margin-bottom: 32px; transition: background .2s, border-color .2s; }
.score-circle { width: 120px; height: 120px; border-radius: 50%; display: flex; flex-direction: column; align-items: center; justify-content: center; flex-shrink: 0; }
.score-circle--good { background: var(--mint-wash); }
.score-circle--mid  { background: var(--amber-lt); }
.score-circle--low  { background: var(--red-lt); }
.score-big { font-family: var(--font-display); font-size: 42px; font-weight: 700; }
.score-circle--good .score-big { color: var(--mint); }
.score-circle--mid .score-big  { color: var(--amber); }
.score-circle--low .score-big  { color: var(--red); }
.score-sub { font-size: 11px; color: var(--text-muted); }
.score-context h2 { font-size: 20px; color: var(--text); margin-bottom: 8px; }
.score-context p { font-size: 14px; color: var(--text-mid); }
.free-audit-gate { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 32px; transition: background .2s, border-color .2s; }
.free-audit-gate h3 { font-size: 20px; color: var(--text); margin-bottom: 8px; }
.audit-features { padding-left: 0; list-style: none; margin: 16px 0 24px; }
.audit-features li { font-size: 14px; color: var(--text-mid); padding: 5px 0; }
.gate-cta { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.gate-note { font-size: 13px; color: var(--text-muted); }

/* Audit details */
.audit-details { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px; margin-top: 20px; box-shadow: var(--shadow); transition: background .2s, border-color .2s; }
.details-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; align-items: start; }
.detail-card { background: transparent; padding: 10px; border-radius: var(--radius-sm); }
.detail-label { font-size: 13px; color: var(--text-muted); margin-bottom: 6px; }
.detail-value { font-size: 16px; font-weight: 600; color: var(--text); }

.tag-list { display: flex; gap: 8px; flex-wrap: wrap; list-style: none; padding-left: 0; margin: 8px 0 0; }
.tag { background: var(--mist); color: var(--text); padding: 5px 12px; border-radius: var(--radius-pill); font-size: 13px; border: 1px solid var(--border); }

.details-section { margin-top: 16px; }
.alerts .issue-list, .recommendations-list { list-style: none; padding-left: 0; margin: 8px 0 0; }
.alert-item { padding: 10px 12px; border-radius: var(--radius-sm); background: var(--amber-lt); color: var(--amber); margin-bottom: 8px; font-size: 14px; }
.alert-item.alert-warning { background: var(--amber-lt); color: var(--amber); }
.recommendations-list .recommendation-item { padding: 8px 10px; background: rgba(145,141,246,.05); border-left: 2px solid var(--primary-lt); border-radius: 0 var(--radius-xs) var(--radius-xs) 0; margin-bottom: 8px; color: var(--text-mid); }

.badge { display: inline-block; padding: 4px 10px; border-radius: var(--radius-pill); font-weight: 600; font-size: 13px; }
.badge-success { background: var(--mint-wash); color: var(--mint); }
.badge-warning { background: var(--amber-lt); color: var(--amber); }

.vitals-grid { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 8px; }
.vital { background: var(--linen); padding: 10px 12px; border-radius: var(--radius-sm); min-width: 110px; border: 1px solid var(--border); transition: background .2s, border-color .2s; }
.vital-name  { display: block; font-size: 12px; color: var(--text-muted); }
.vital-value { display: block; font-weight: 700; font-size: 16px; color: var(--text); }

/* ─── FREE RESULT — BEM component styles (redesigned view) ─── */
/* Score cards with SVG rings */
.score-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 20px 16px 16px;
  text-align: center; position: relative;
  display: flex; flex-direction: column; align-items: center;
  transition: background .2s, border-color .2s;
}
.score-card__ring {
  position: relative; width: 90px; height: 90px; margin-bottom: 10px;
}
.score-card .score-ring {
  width: 90px; height: 90px; transform: rotate(-90deg); display: block;
}
.score-card__num {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.35rem; font-weight: 700; color: var(--text); line-height: 1;
}
.score-card__label {
  font-size: 12px; font-weight: 600; color: var(--text-mid);
  text-transform: uppercase; letter-spacing: .04em; margin-bottom: 4px;
}
.score-card__tag  { font-size: 11px; color: var(--text-muted); }
.score-card__lock { font-size: 11px; color: var(--text-muted); margin-top: 2px; }
.score-card--locked { opacity: .5; }
.score-card__ring--blur { filter: blur(2px); }

/* Ring fill colour for free-result AEO/GEO/AIO */
.score-card .ring-fill          { stroke: var(--indigo); stroke-width: 8; }
.score-card .ring-bg            { stroke-width: 8; }
.score-card .ring-fill--geo     { stroke: var(--green); }
.score-card .ring-fill--aio     { stroke: var(--amber); }

/* Score quality colour modifiers */
.score--good .score-card__num   { color: var(--green); }
.score--mid  .score-card__num   { color: var(--amber); }
.score--low  .score-card__num   { color: var(--red); }

/* Score pill (section header badge) */
.score-pill {
  display: inline-block; font-size: 12px; font-weight: 700;
  padding: 3px 10px; border-radius: var(--radius-pill);
  background: var(--mist); color: var(--text-mid);
}
.score-pill.score--good { background: var(--mint-wash); color: var(--mint); }
.score-pill.score--mid  { background: var(--amber-lt);  color: var(--amber); }
.score-pill.score--low  { background: var(--red-lt);    color: var(--red); }

/* fr-header */
.fr-header { margin-bottom: 24px; }
.fr-header__back { font-size: 13px; margin-bottom: 8px; }
.fr-header__back a { color: var(--text-muted); text-decoration: none; }
.fr-header__back a:hover { color: var(--primary); }
.fr-header__title { font-size: 28px; font-weight: 700; color: var(--text); margin: 0 0 4px; }
.fr-header__sub   { font-size: 13px; color: var(--text-muted); margin: 0; }

/* fr-section-card */
.fr-section-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 24px;
  margin-bottom: 20px; transition: background .2s, border-color .2s;
  position: relative; overflow: hidden;
}
.fr-section-card__header {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; margin-bottom: 8px; flex-wrap: wrap;
}
.fr-section-card__header h2 {
  font-size: 17px; font-weight: 700; color: var(--text);
  margin: 0; display: flex; align-items: center; gap: 8px;
}
.fr-section-card__desc {
  font-size: 13px; color: var(--text-mid); margin: 0 0 16px;
}
.fr-section-card--locked { overflow: visible; }

/* Locked overlay (GEO teaser) */
.fr-locked-overlay {
  text-align: center; padding: 24px 16px 20px; position: relative; z-index: 2;
}
.fr-locked__icon { font-size: 28px; display: block; margin-bottom: 8px; }
.fr-locked-overlay h3  { font-size: 16px; color: var(--text); margin: 0 0 6px; font-weight: 700; }
.fr-locked-overlay p   { font-size: 13px; color: var(--text-mid); margin: 0 0 16px; }
.fr-locked-blur {
  filter: blur(4px); pointer-events: none; user-select: none; opacity: .6;
}

/* Check table */
.check-table-wrap { overflow-x: auto; margin-top: 4px; }
.check-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.check-table thead tr { border-bottom: 2px solid var(--border); }
.check-table th {
  padding: 8px 12px; text-align: left; font-size: 11px;
  font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: .04em;
}
.check-table td { padding: 10px 12px; vertical-align: top; color: var(--text); }
.check-table tbody tr:last-child td { border-bottom: none; }
.check-row--pass { background: rgba(51,199,88,.04); }
.check-row--fail { background: rgba(239,68,68,.04); }
.check-name  { font-weight: 500; display: flex; align-items: flex-start; gap: 6px; min-width: 130px; }
.check-icon  { flex-shrink: 0; font-weight: 700; }
.check-row--pass .check-icon { color: var(--green); }
.check-row--fail .check-icon { color: var(--red); }
.check-detail { color: var(--text-mid); }
.check-fix {
  margin-top: 5px; font-size: 12px; color: var(--text-mid);
  padding: 4px 8px; background: rgba(251,191,36,.1);
  border-radius: var(--radius-sm); border-left: 2px solid var(--amber);
}
.wt-col       { width: 64px; text-align: center; white-space: nowrap; }
.st-col       { width: 72px; text-align: center; white-space: nowrap; }
.weight-badge {
  display: inline-block; background: var(--mist); color: var(--text-muted);
  font-size: 11px; font-weight: 600; padding: 2px 7px; border-radius: var(--radius-pill);
}

/* Vital BEM sub-elements */
.vital__label { display: block; font-size: 11px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: .04em; margin-bottom: 2px; }
.vital__val   { display: block; font-size: 22px; font-weight: 700; color: var(--text); line-height: 1; margin-bottom: 2px; }
.vital__desc  { display: block; font-size: 11px; color: var(--text-muted); }
.vital--good  { border-color: var(--green); background: rgba(34,197,94,.06); }
.vital--mid   { border-color: var(--amber); background: rgba(251,191,36,.06); }
.vital--bad   { border-color: var(--red);   background: rgba(239,68,68,.06); }
.vital--good .vital__val { color: var(--green); }
.vital--mid  .vital__val { color: var(--amber); }
.vital--bad  .vital__val { color: var(--red); }

/* badge-danger */
.badge-danger { background: var(--red-lt); color: var(--red); }

/* fr-cta */
.fr-cta {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 32px;
  text-align: center; margin-top: 24px;
  transition: background .2s, border-color .2s;
}
.fr-cta h2 { font-size: 22px; color: var(--text); margin: 0 0 10px; }
.fr-cta > p { font-size: 14px; color: var(--text-mid); margin: 0 0 20px; max-width: 540px; margin-left: auto; margin-right: auto; }
.fr-cta__actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

/* ═══════════════════════════════════════════════════════════════
   FORMS
═══════════════════════════════════════════════════════════════ */
.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-size: 13px; font-weight: 500; color: var(--text-mid); margin-bottom: 6px; }
.form-input {
  width: 100%; padding: 10px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 14px; font-family: var(--font-body);
  background: var(--surface); color: var(--text);
  transition: border-color .15s, background .2s, color .2s;
}
.form-input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(145,141,246,.15); }
.form-input::placeholder { color: var(--text-muted); }
.form-check { display: flex; align-items: center; gap: 8px; font-size: 14px; margin-bottom: 20px; color: var(--text-mid); }
.field-error { font-size: 12px; color: var(--red); }

/* ═══════════════════════════════════════════════════════════════
   AUTH PAGES
═══════════════════════════════════════════════════════════════ */
.auth-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: var(--bg); padding: 24px; }
.auth-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 40px; width: 100%; max-width: 420px; box-shadow: var(--shadow-lg); transition: background .2s, border-color .2s; }
.auth-logo { text-align: center; margin-bottom: 20px; }
.auth-title { font-size: 22px; color: var(--text); text-align: center; margin-bottom: 28px; }
.auth-switch { text-align: center; font-size: 14px; color: var(--text-muted); margin-top: 20px; }

/* Social login buttons */
.social-login { display: flex; flex-direction: column; gap: 10px; margin-bottom: 20px; }
.social-login form { margin: 0; }
.btn-social {
    display: flex; align-items: center; justify-content: center; gap: 10px;
    width: 100%; padding: 10px 16px; border-radius: var(--radius-sm);
    font-size: 14px; font-weight: 500; cursor: pointer;
    border: 1px solid var(--border); background: var(--surface);
    color: var(--text); transition: background .15s, border-color .15s;
}
.btn-social:hover { background: var(--surface-raised); border-color: var(--border-strong); }
.btn-social--apple { background: #000; color: #fff; border-color: #000; }
.btn-social--apple:hover { background: #222; border-color: #222; }
.social-icon { width: 18px; height: 18px; flex-shrink: 0; }

.auth-divider {
    display: flex; align-items: center; gap: 12px;
    margin: 4px 0 20px; color: var(--text-muted); font-size: 13px;
}
.auth-divider::before, .auth-divider::after {
    content: ''; flex: 1; height: 1px; background: var(--border);
}

/* ═══════════════════════════════════════════════════════════════
   ALERTS
═══════════════════════════════════════════════════════════════ */
.alert { padding: 12px 16px; border-radius: var(--radius-sm); font-size: 14px; margin-bottom: 16px; }
.alert-success { background: var(--mint-wash); color: #14532D; border: 1px solid rgba(51,199,88,.3); }
html[data-theme="dark"] .alert-success { color: var(--mint); }
.alert-error { background: var(--red-lt); color: #7F1D1D; border: 1px solid rgba(220,38,38,.3); }
html[data-theme="dark"] .alert-error { color: var(--red); }
.alert-warning { background: var(--amber-lt); color: #78350F; border: 1px solid rgba(245,158,11,.3); }
html[data-theme="dark"] .alert-warning { color: var(--amber); }
/* Hide empty ASP.NET validation summary when no errors are present */
.validation-summary-valid { display: none !important; }

/* ═══════════════════════════════════════════════════════════════
   PORTAL LAYOUT
═══════════════════════════════════════════════════════════════ */
.portal-layout { display: flex; min-height: 100vh; background: var(--bg); transition: background .2s; }

/* ── Sidebar ── */
.sidebar {
  width: 224px; min-height: 100vh;
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column; flex-shrink: 0;
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
  transition: background .2s, border-color .2s;
}
/* The logo image carries ~22.5% of its own height as padding above and below the
   mark, so the box padding here is lighter than the 18/14 the old icon+text
   lockup needed — otherwise the rule below it drifts away from the mark. */
.sidebar-logo {
  padding: 8px 14px 6px;
  border-bottom: 1px solid var(--border);
}
.sidebar-logo a {
  display: flex; align-items: center; gap: 10px;
  color: var(--text); font-family: var(--font-display); font-weight: 700; font-size: 15px;
  text-decoration: none;
}
.sidebar-logo a:hover { text-decoration: none; }
.sidebar-nav { flex: 1; padding: 10px 10px; display: flex; flex-direction: column; gap: 2px; }
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 10px; border-radius: 9px;
  color: var(--text-mid); font-size: 13px; font-weight: 500;
  text-decoration: none; transition: background .12s, color .12s;
}
.nav-item:hover { background: var(--mist); color: var(--text); text-decoration: none; }
.nav-item.active {
  background: rgba(145,141,246,.1);
  color: var(--primary); font-weight: 600;
}
.nav-item svg { flex-shrink: 0; transition: color .12s, opacity .12s; }

/* Per-item icon colours — muted when inactive, full when active/hover */
.nav-item--dashboard svg { color: #6366F1; opacity: .55; }
.nav-item--sources   svg { color: #0EA5E9; opacity: .55; }
.nav-item--ads       svg { color: #8B5CF6; opacity: .55; }
.nav-item--billing   svg { color: #10B981; opacity: .55; }
.nav-item--ask       svg { color: #F59E0B; opacity: .55; }
.nav-item--admin     svg { color: #94A3B8; opacity: .55; }
.nav-item:hover svg, .nav-item.active svg { opacity: 1; }

.sidebar-footer {
  padding: 12px 14px;
  border-top: 1px solid var(--border);
  display: flex; flex-direction: column; gap: 4px;
}
.user-name {
  display: block; font-size: 13px; font-weight: 600;
  color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  margin-bottom: 2px;
}
.sidebar-settings-link {
  display: flex; align-items: center; gap: 7px;
  padding: 6px 8px; margin: 2px -8px;
  border-radius: 7px;
  font-size: 12px; font-weight: 600; color: var(--text-mid);
  text-decoration: none; transition: background .12s, color .12s;
}
.sidebar-settings-link svg { flex-shrink: 0; opacity: .6; transition: opacity .12s; }
.sidebar-settings-link:hover { background: var(--mist); color: var(--text); text-decoration: none; }
.sidebar-settings-link:hover svg, .sidebar-settings-link.active svg { opacity: 1; }
.sidebar-settings-link.active { background: var(--mist); color: var(--primary); }
.logout-link { font-size: 11px; font-weight: 500; color: var(--text-mid); }
.logout-link:hover { color: var(--primary); text-decoration: none; }
.sidebar-theme-row { margin-top: 8px; }
.sidebar-theme-row .theme-toggle {
  width: 100%; justify-content: center;
  font-size: 11px; font-weight: 500; padding: 5px 10px;
}

/* ── Portal content ── */
.portal-content { flex: 1; min-width: 0; padding: 32px 36px; }

/* ── Form controls ── */
.form-control {
  display: block; width: 100%;
  padding: 8px 12px;
  font-size: .875rem; font-family: var(--font-body); color: var(--text);
  background: var(--white); border: 1px solid var(--border);
  border-radius: var(--radius-sm); outline: none;
  transition: border-color .15s, box-shadow .15s;
  appearance: none; -webkit-appearance: none;
}
.form-control:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(145,141,246,.18); }
.form-control::placeholder { color: var(--text-muted); }
.form-control--sm { padding: 6px 10px; font-size: .8rem; }
/* Select dropdown styling */
select.form-control {
  padding-right: 32px;
  background-image: url("data:image/svg+xml;charset=UTF-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%23666666' d='M1 1l5 5 5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 12px 8px;
  cursor: pointer;
}
select.form-control:focus {
  background-image: url("data:image/svg+xml;charset=UTF-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%23918df6' d='M1 1l5 5 5-5'/%3E%3C/svg%3E");
}
html[data-theme="dark"] select.form-control {
  background-image: url("data:image/svg+xml;charset=UTF-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%23adb5c8' d='M1 1l5 5 5-5'/%3E%3C/svg%3E");
}
html[data-theme="dark"] select.form-control:focus {
  background-image: url("data:image/svg+xml;charset=UTF-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%23918df6' d='M1 1l5 5 5-5'/%3E%3C/svg%3E");
}
.form-label { display: block; font-size: .8rem; font-weight: 600; color: var(--text); margin-bottom: 6px; }

/* ── Page header ── */
.page-header { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 28px; gap: 12px; flex-wrap: wrap; }
.page-title { font-size: 24px; color: var(--text); letter-spacing: -.3px; }
.page-sub { font-size: 14px; color: var(--text-muted); margin-top: 2px; }

/* ── Website cards ── */
.website-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 24px; margin-bottom: 20px;
  box-shadow: var(--shadow-lg); transition: background .2s, border-color .2s;
}
.website-card-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 20px; gap: 12px; flex-wrap: wrap; }
.website-name { font-size: 17px; color: var(--text); font-weight: 700; letter-spacing: -.2px; }
.website-url { font-size: 13px; color: var(--text-muted); }

/* ── Score badge ── */
.score-badge { text-align: center; background: var(--mint-wash); border-radius: var(--radius-sm); padding: 10px 16px; flex-shrink: 0; }
.score-num { font-family: var(--font-display); font-size: 36px; font-weight: 700; line-height: 1; }
.score-label { font-size: 12px; color: var(--text-muted); }
.score-badge--good .score-num { color: var(--mint); }
.score-badge--mid  { background: var(--amber-lt); }
.score-badge--mid .score-num  { color: var(--amber); }
.score-badge--low  { background: var(--red-lt); }
.score-badge--low .score-num  { color: var(--red); }
.score-trend { font-size: 12px; font-weight: 600; margin-left: 4px; }
.trend-up   { color: var(--mint); }
.trend-down { color: var(--red); }

/* ── Score bars ── */
.score-breakdown { display: flex; flex-direction: column; gap: 8px; margin-bottom: 20px; }
.score-pill { display: flex; align-items: center; gap: 12px; font-size: 13px; }
.score-pill-label { width: 32px; font-weight: 600; color: var(--text-mid); }
.score-bar { flex: 1; height: 5px; background: var(--mist); border-radius: var(--radius-pill); overflow: hidden; transition: background .2s; }
.score-bar-fill { height: 100%; background: var(--primary); border-radius: var(--radius-pill); transition: width .7s cubic-bezier(.4,0,.2,1); }
.score-bar-fill--purple  { background: var(--magenta); }
.score-bar-fill--green   { background: var(--mint); }
.score-bar-fill--navy    { background: var(--carbon); }
.score-bar-fill--navy-lt { background: var(--graphite); }
.score-pill-val { width: 28px; text-align: right; font-weight: 500; color: var(--text-mid); }
.website-card-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.no-audit-msg { color: var(--text-muted); font-size: 14px; }

/* ── Empty state ── */
.empty-state {
  text-align: center; padding: 80px 40px;
  background: var(--surface); border: 1.5px dashed var(--border);
  border-radius: var(--radius); transition: background .2s, border-color .2s;
}
.empty-icon { font-size: 40px; margin-bottom: 16px; }
.empty-state h3 { font-size: 20px; color: var(--text); margin-bottom: 8px; }
.empty-state p { color: var(--text-muted); margin-bottom: 24px; }

/* ── Connector cards ── */
.connectors-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px,1fr)); gap: 20px; margin-bottom: 40px; }
.connector-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow); transition: border-color .15s, background .2s; }
.connector-card--connected { border-color: rgba(51,199,88,.4); }
.connector-card-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.connector-logo { height: 28px; width: auto; }
.connector-status { display: flex; align-items: center; gap: 6px; font-size: 12px; }
.status-dot { width: 8px; height: 8px; border-radius: 50%; }
.status-dot--green { background: var(--mint); }
.status-dot--grey  { background: var(--fog); }
.status-dot--amber { background: var(--amber); }
.connector-card--stale { border-color: rgba(245,158,11,.45); }

/* ── Period tabs (date range picker for Insights pages) ───────────────── */
.period-tabs { display: inline-flex; gap: 2px; background: var(--slate-1); border-radius: var(--radius-sm); padding: 3px; }
.period-tab  { padding: 4px 10px; font-size: .72rem; font-weight: 600; color: var(--text-mid); border-radius: calc(var(--radius-sm) - 2px); text-decoration: none; transition: background .12s, color .12s; white-space: nowrap; }
.period-tab:hover { color: var(--text); background: var(--mist); }
.period-tab--active { background: var(--surface); color: var(--text); box-shadow: 0 1px 3px rgba(0,0,0,.08); }
.connector-name { font-size: 15px; font-weight: 600; color: var(--text); margin-bottom: 6px; }
.connector-desc { font-size: 13px; color: var(--text-mid); margin-bottom: 16px; }
.connector-meta { font-size: 12px; color: var(--text-muted); margin-bottom: 10px; }
.connectors-info { background: var(--linen); border-radius: var(--radius); padding: 24px; border: 1px solid var(--border); transition: background .2s, border-color .2s; }
.connectors-info h3 { font-size: 15px; color: var(--text); margin-bottom: 12px; }
.connectors-info ul { padding-left: 20px; font-size: 14px; color: var(--text-mid); margin-bottom: 12px; }
.connectors-info li { margin-bottom: 6px; }
.info-note { font-size: 13px; color: var(--text-muted); }

/* ── Score methodology panel ── */
.methodology-panel { border: 1px solid var(--border); border-radius: var(--radius); background: var(--off-white); overflow: hidden; }
.methodology-summary { padding: 10px 16px; font-size: 13px; color: var(--text-mid); cursor: pointer; list-style: none; user-select: none; }
.methodology-summary::-webkit-details-marker { display: none; }
.methodology-summary:hover { color: var(--text); }
.methodology-body { padding: 16px; border-top: 1px solid var(--border); }
.method-grid { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; align-items: center; }
.method-label { font-size: 13px; color: var(--text); }
.method-weight { font-size: 12px; font-weight: 600; color: var(--text-mid); }
.method-weight--na { color: var(--slate-3); font-weight: 400; }
.method-bar-wrap { grid-column: 1 / -1; height: 4px; background: var(--slate-1); border-radius: 2px; margin-bottom: 10px; }
.method-bar { height: 100%; border-radius: 2px; transition: width .4s ease; }
.method-note { font-size: 12px; color: var(--text-mid); margin-top: 8px; }

/* ── Breadcrumbs ── */
.breadcrumb { display: flex; align-items: center; gap: 4px; font-size: 13px; margin-bottom: 16px; flex-wrap: wrap; }
.breadcrumb-item { color: var(--text-muted); text-decoration: none; font-weight: 500; transition: color .12s; }
.breadcrumb-item:hover { color: var(--primary); text-decoration: none; }
.breadcrumb-active { color: var(--text-mid); font-weight: 600; }
.breadcrumb-sep { color: var(--ash); font-size: 15px; }

/* ── Audit status badges ── */
.badge-running { background: rgba(44,120,252,.1); color: var(--sky); padding: 3px 9px; border-radius: var(--radius-pill); font-size: 12px; font-weight: 500; }
.badge-queued  { background: var(--mist); color: var(--text-muted); padding: 3px 9px; border-radius: var(--radius-pill); font-size: 12px; font-weight: 500; }

/* ── MCP badge ── */
.wd-mcp-badge { font-size: 11px; color: var(--primary); background: rgba(145,141,246,.1); border: 1px solid rgba(145,141,246,.2); padding: 2px 7px; border-radius: var(--radius-pill); }

/* ── SEO button ── */
.btn-seo { background: var(--carbon); color: #fff; border: none; }
.btn-seo:hover { opacity: .88; color: #fff; text-decoration: none; }
html[data-theme="dark"] .btn-seo { background: var(--fog); color: var(--text); }

/* ── Disabled ── */
a.disabled { pointer-events: none; opacity: .45; }

/* ── Keyword tags ── */
.keyword-tag {
  display: inline-flex; align-items: center; gap: 4px;
  background: rgba(145,141,246,.12); color: var(--primary);
  border: 1px solid rgba(145,141,246,.25);
  padding: 3px 10px; border-radius: var(--radius-pill); font-size: 13px; margin-right: 6px; margin-bottom: 6px;
}
.keyword-tag button { background: none; border: none; cursor: pointer; color: var(--primary); font-size: 14px; line-height: 1; padding: 0; }

/* ── Website meta pills ── */
.website-meta-pill {
  display: inline-block; margin-left: 8px; font-size: 11px;
  padding: 2px 8px; border-radius: var(--radius-pill);
  background: var(--mist); color: var(--text-mid); border: 1px solid var(--border);
}
.website-meta-pill--loc { background: rgba(145,141,246,.08); border-color: rgba(145,141,246,.2); color: var(--primary); }

/* ── Bottom tab bar (portal mobile) ── */
.portal-bottom-nav {
  display: none;
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 100;
  background: var(--surface); border-top: 1px solid var(--border);
  padding: 6px 0 max(6px, env(safe-area-inset-bottom));
  transition: background .2s, border-color .2s;
}
.pbn-items { display: flex; }
.pbn-item {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: 6px 4px; font-size: 10px; font-weight: 600; color: var(--text-muted);
  text-decoration: none; transition: color .12s;
}
.pbn-item:hover { text-decoration: none; color: var(--primary); }
.pbn-item.active { color: var(--primary); }
.pbn-icon { font-size: 20px; line-height: 1; }

/* ═══════════════════════════════════════════════════════════════
   RESPONSIVE — mobile-first breakpoints
═══════════════════════════════════════════════════════════════ */
@media (max-width: 768px) {
  /* Public header */
  .pub-nav > a,
  .pub-nav > .btn { display: none; }
  .nav-hamburger { display: flex; }

  /* Portal sidebar → drawer on mobile, show bottom nav */
  .sidebar { display: flex; transform: translateX(-100%); transition: transform .3s cubic-bezier(.4,0,.2,1); }
  .sidebar--open { transform: translateX(0); }
  .portal-content { padding: 20px 16px 80px; }
  .portal-bottom-nav { display: block; }

  /* Page header stacks */
  .page-header { flex-direction: column; gap: 12px; }
  .page-header .btn { width: 100%; justify-content: center; }

  /* Website card */
  .website-card { padding: 16px; }
  .website-card-header { flex-direction: column; }

  /* Hero */
  .hero { padding: 60px 0 50px; }
  .hero-headline { font-size: clamp(28px,7vw,42px); }
  .hero-cta { flex-direction: column; }
  .hero-cta .btn { width: 100%; justify-content: center; }

  /* Auth */
  .auth-card { padding: 28px 20px; }

  /* Score hero */
  .score-hero { flex-direction: column; align-items: flex-start; }

  /* Stats bar */
  .stats-bar .container { flex-direction: column; gap: 24px; }

  /* Free result scores */
  .fr-scores { grid-template-columns: 1fr; }
  .detail-grid-2 { grid-template-columns: 1fr; }

  /* Cards */
  .cards-3 { grid-template-columns: 1fr; }

  /* Connectors */
  .connectors-grid { grid-template-columns: 1fr; }

  /* Gate CTA */
  .gate-cta { flex-direction: column; }
  .gate-cta .btn { width: 100%; justify-content: center; }

  /* Vitals */
  .vitals-grid { flex-direction: column; }
  .vital { min-width: unset; }

  /* Details grid */
  .details-grid { grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); }

  /* Score bar inline audit form */
  .inline-audit-form { flex-direction: column; }
  .input-url { min-width: unset; width: 100%; }
}

@media (max-width: 480px) {
  .container { padding: 0 16px; }
  .section { padding: 56px 0; }
}

/* ═══════════════════════════════════════════════════════════════
   ANIMATIONS & MOTION
═══════════════════════════════════════════════════════════════ */
@keyframes fadeUp   { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }
@keyframes fadeIn   { from { opacity: 0; } to { opacity: 1; } }
@keyframes scaleIn  { from { opacity: 0; transform: scale(.95); } to { opacity: 1; transform: scale(1); } }
@keyframes spin     { to { transform: rotate(360deg); } }
@keyframes pulse    { 0%,100% { opacity: 1; } 50% { opacity: .5; } }
@keyframes slideUp  { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }

.animate-fade-up  { animation: fadeUp .35s ease-out both; }
.animate-fade-in  { animation: fadeIn .25s ease-out both; }
.animate-scale-in { animation: scaleIn .2s ease-out both; }
.animate-spin     { animation: spin 1s linear infinite; }
.animate-pulse    { animation: pulse 1.5s ease-in-out infinite; }

/* Stagger helpers */
.anim-d1 { animation-delay: .05s; } .anim-d2 { animation-delay: .10s; }
.anim-d3 { animation-delay: .15s; } .anim-d4 { animation-delay: .20s; }

/* Card hover lift — applied to key container types */
.card,
.website-card,
.connector-card,
.fr-score-card,
.dash-product-card,
.plan-card,
.mcp-preset-card {
  transition: transform .18s ease, box-shadow .18s ease, background .2s, border-color .2s;
}
.card:hover,
.connector-card:hover,
.dash-product-card:hover,
.mcp-preset-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

/* Button press feedback */
.btn:active { transform: scale(.97); transition: transform .08s; }

/* ═══════════════════════════════════════════════════════════════
   THEME-AWARE STATUS BADGES
   Use semantic token pairs so colours adapt to light/dark.
═══════════════════════════════════════════════════════════════ */

/* ── Pass / success / positive ── */
.status-pass, .wdps--done, .ph-badge--done,
.sc-badge--up, .rep-theme-tag--pos,
.badge-cited, .await-security,
.tsc--green, .wd-sig--pass, .provider-card--cited { background: var(--c-pass-bg); color: var(--c-pass-fg); }

/* ── Fail / error / negative ── */
.status-fail, .wdps--fail, .ph-badge--fail,
.sc-badge--dn, .rep-theme-tag--neg,
.badge-not-cited, .tsc--red,
.wd-sig--fail, .provider-card--not-cited, .btn-danger { background: var(--c-fail-bg); color: var(--c-fail-fg); }

/* ── Running / info / blue ── */
.wdps--run, .ph-badge--run,
.running-banner, .wd-running-banner,
.status-pill--running, .status-running,
.cap-tag, .alert-info { background: var(--c-info-bg); color: var(--c-info-fg); }
.running-banner, .wd-running-banner { border: 1px solid rgba(96,165,250,.25); }

/* ── Queued / warning / amber ── */
.status-queued, .ph-badge--queue,
.tsc--amber, .rep-info-card,
.await-spam-note { background: var(--c-warn-bg); color: var(--c-warn-fg); }
.rep-info-card   { border: 1px solid rgba(251,191,36,.3); }
.await-spam-note { border: 1px solid rgba(251,191,36,.3); }

/* ── Complete ── */
.status-complete, .status-pill--done { background: var(--c-pass-bg); color: var(--c-pass-fg); }

/* ── Failed (audit status list) ── */
.status-failed { background: var(--c-fail-bg); color: var(--c-fail-fg); }

/* Badge sizing helpers (inherit) */
.wdps--done, .wdps--fail, .wdps--run,
.ph-badge--done, .ph-badge--fail, .ph-badge--run, .ph-badge--queue,
.sc-badge--up, .sc-badge--dn,
.status-pill--running, .status-pill--done,
.status-complete, .status-running, .status-failed, .status-queued {
  display: inline-block; padding: 3px 10px; border-radius: var(--radius-pill); font-size: 12px; font-weight: 600;
}

/* ── Impact tag (MCP) ── */
.impact-tag { border-radius: var(--radius-pill); padding: 2px 8px; font-size: 11px; font-weight: 600; }

/* ── Cap tag (MCP capabilities) ── */
.cap-tag { border-radius: var(--radius-pill); padding: 2px 8px; font-size: 11px; font-weight: 600; }

/* ── Danger button (MCP / connectors) ── */
.btn-danger {
  border-radius: var(--radius-pill); padding: 6px 14px; font-size: 13px; font-weight: 500;
  border: 1px solid var(--c-fail-fg); cursor: pointer; display: inline-flex; align-items: center; gap: 6px;
}
.btn-danger:hover { opacity: .85; }

/* ── Warning ghost button (stop audit) ── */
.btn-warning-ghost   { background: transparent; color: var(--amber); border: 1px solid var(--amber); }
.btn-warning-ghost:hover { background: var(--amber-lt); text-decoration: none; }

/* ── Audit stop button inside running banner ── */
.wd-stop-btn {
  background: rgba(255,255,255,.12); color: #fff; border: 1px solid rgba(255,255,255,.35);
  margin-left: auto; flex-shrink: 0;
}
.wd-stop-btn:hover { background: rgba(255,255,255,.22); text-decoration: none; color: #fff; }

/* ── Audit delete/stop confirmation modal ── */
.audit-modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.45);
  display: flex; align-items: center; justify-content: center; z-index: 9900;
}
.audit-modal-box {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 28px 32px; max-width: 420px; width: 90%; box-shadow: 0 8px 32px rgba(0,0,0,.18);
}
.audit-modal-title { font-size: 16px; font-weight: 700; margin: 0 0 10px; color: var(--text); }
.audit-modal-body  { font-size: 13px; color: var(--text-mid); margin: 0 0 24px; line-height: 1.5; }
.audit-modal-actions { display: flex; gap: 10px; justify-content: flex-end; }

/* ── Upgrade banners / upsells ── */
.upgrade-banner, .await-upsell {
  background: var(--c-info-bg); color: var(--c-info-fg);
  border: 1px solid rgba(96,165,250,.2); border-radius: var(--radius-sm); padding: 16px;
}

/* ── Await security notice ── */
.await-security { border: 1px solid var(--c-pass-fg); border-radius: var(--radius-sm); padding: 12px 16px; }

/* ═══════════════════════════════════════════════════════════════
   DOMAIN NAME / ATB (Always-Themed-Bar) — used in audit & SEO pages
═══════════════════════════════════════════════════════════════ */
.atb-domain, .wd-atb-domain {
  background: var(--carbon); color: var(--paper);
  padding: 3px 10px; border-radius: var(--radius-pill); font-size: 13px; font-weight: 600;
}

/* Audit URL bar */
.audit-url-bar {
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 10px 16px;
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 20px;
}

/* ═══════════════════════════════════════════════════════════════
   DASHBOARD — product cards
═══════════════════════════════════════════════════════════════ */
.dash-product-grid {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 16px; margin-bottom: 8px;
}
@media (max-width: 700px) { .dash-product-grid { grid-template-columns: 1fr; } }

.dash-product-card {
  border-radius: var(--radius); padding: 18px 20px;
  border: 1.5px solid var(--border);
  background: var(--surface);
}

/* AI Audit — indigo accent */
.dash-product-card--audit {
  border-color: rgba(145,141,246,.25);
  background: linear-gradient(135deg, rgba(145,141,246,.06) 0%, var(--surface) 60%);
}
/* SEO — navy accent */
.dash-product-card--seo {
  border-color: rgba(145,141,246,.12);
  background: linear-gradient(135deg, rgba(145,141,246,.04) 0%, var(--surface) 60%);
}

.dash-product-header {
  display: flex; align-items: flex-start; gap: 10px; margin-bottom: 14px;
}
.dash-product-icon  { font-size: 22px; }
.dash-product-title {
  font-family: var(--font-display); font-weight: 600; font-size: 14px;
  color: var(--text); line-height: 1.3;
}
.dash-product-sub {
  font-size: 11px; color: var(--text-muted); margin-top: 2px;
  font-weight: 500; text-transform: uppercase; letter-spacing: .04em;
}
.dash-product-date { margin-left: auto; font-size: 11px; color: var(--text-muted); white-space: nowrap; }
.dash-score-rows   { display: flex; flex-direction: column; gap: 8px; margin-bottom: 14px; }
.dash-score-row    { display: flex; align-items: center; gap: 10px; font-size: 12px; }
.dsr-label {
  width: 36px; font-weight: 700; font-size: 10px; letter-spacing: .05em;
  padding: 2px 5px; border-radius: 4px; text-align: center;
}
.dsr-label--aeo  { background: rgba(145,141,246,.15); color: var(--indigo); }
.dsr-label--geo  { background: rgba(214,64,159,.12);  color: var(--purple); }
.dsr-label--aio  { background: rgba(51,199,88,.12);   color: var(--green);  }
.dsr-label--seo  { background: var(--mist);            color: var(--text);   }
.dsr-val { width: 26px; text-align: right; font-weight: 600; color: var(--text-mid); }
.dash-product-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.dash-no-data         { font-size: 12px; color: var(--text-muted); margin-bottom: 14px; }

/* ═══════════════════════════════════════════════════════════════
   WEBSITE DETAIL — wd-* classes
═══════════════════════════════════════════════════════════════ */
.wd-hero {
  border-radius: var(--radius); padding: 32px; margin-bottom: 24px; color: #fff;
  background: linear-gradient(135deg, var(--hero-from) 0%, var(--hero-to) 100%);
  animation: fadeUp .35s ease-out both;
}
.wd-hero-title   { font-size: 22px; font-weight: 700; color: #fff; margin-bottom: 4px; }
.wd-hero-url     { font-size: 13px; color: rgba(255,255,255,.7); }
.wd-hero-badges  { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.wd-hero-score   { text-align: right; flex-shrink: 0; }
.wd-hero-score .score-big { font-size: 48px; font-weight: 700; color: #fff; }
.wd-hero-score .score-sub { color: rgba(255,255,255,.65); }
.wd-hero-row     { display: flex; justify-content: space-between; align-items: flex-start; flex-wrap: wrap; gap: 16px; }

.wd-section { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; margin-bottom: 20px; }
.wd-section-title { font-size: 15px; font-weight: 700; color: var(--text); margin-bottom: 16px; }
.wd-sig {
  display: flex; align-items: center; gap: 12px; padding: 10px 14px;
  border-radius: var(--radius-sm); margin-bottom: 8px; font-size: 13px;
}
.wd-sig--pass { background: var(--c-pass-bg); color: var(--c-pass-fg); }
.wd-sig--fail { background: var(--c-fail-bg); color: var(--c-fail-fg); }
.wd-sig--warn { background: var(--c-warn-bg); color: var(--c-warn-fg); }
.wd-running-banner {
  background: var(--c-info-bg); color: var(--c-info-fg);
  border: 1px solid rgba(96,165,250,.25); border-radius: var(--radius-sm);
  padding: 14px 18px; margin-bottom: 20px; display: flex; align-items: center; gap: 10px;
  animation: slideUp .3s ease-out both;
}

/* ═══════════════════════════════════════════════════════════════
   AUDIT/SEO — report navigation tabs
═══════════════════════════════════════════════════════════════ */
.run-nav { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 24px; }
.run-nav__link {
  padding: 8px 16px; border-radius: var(--radius-pill); font-size: 13px; font-weight: 500;
  color: var(--text-mid); text-decoration: none; border: 1px solid var(--border);
  transition: background .12s, color .12s;
}
.run-nav__link:hover { background: var(--mist); color: var(--text); text-decoration: none; }
.run-nav__link--active { background: var(--carbon); color: var(--paper); border-color: transparent; }

/* ═══════════════════════════════════════════════════════════════
   AUDIT REPORT — report-score-card, tsc-*, badges
═══════════════════════════════════════════════════════════════ */
.report-score-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 24px; text-align: center; transition: background .2s, border-color .2s;
}
.report-score-card--total {
  background: linear-gradient(135deg, var(--hero-from) 0%, var(--hero-to) 100%);
  border: none; color: #fff;
}
.report-score-card--total .rsc-label { color: rgba(255,255,255,.7); }
.rsc-value       { font-family: var(--font-display); font-size: 40px; font-weight: 700; line-height: 1; }
.rsc-value--light { color: var(--primary-lt); }
.rsc-label        { font-size: 12px; color: var(--text-muted); text-transform: uppercase; letter-spacing: .04em; }

/* Technical signal checks */
.tsc {
  display: flex; align-items: center; gap: 10px; padding: 8px 12px;
  border-radius: var(--radius-sm); font-size: 13px; margin-bottom: 6px;
}
.tsc--green { background: var(--c-pass-bg); color: var(--c-pass-fg); border: 1px solid rgba(74,222,128,.2); }
.tsc--amber { background: var(--c-warn-bg); color: var(--c-warn-fg); border: 1px solid rgba(251,191,36,.2); }
.tsc--red   { background: var(--c-fail-bg); color: var(--c-fail-fg); border: 1px solid rgba(248,113,113,.2); }

/* ═══════════════════════════════════════════════════════════════
   SEO RESULT — provider cited badges
═══════════════════════════════════════════════════════════════ */
.badge-cited, .badge-not-cited {
  display: inline-block; padding: 3px 10px; border-radius: var(--radius-pill); font-size: 12px; font-weight: 600;
}
.badge-cited     { background: var(--c-pass-bg); color: var(--c-pass-fg); }
.badge-not-cited { background: var(--c-fail-bg); color: var(--c-fail-fg); }
.provider-card--cited { border-color: var(--c-pass-fg); }

/* Rec cards */
.rec-card {
  display: flex; gap: 12px; padding: 12px 14px;
  background: rgba(145,141,246,.05); border-left: 2px solid var(--primary-lt);
  border-radius: 0 var(--radius-xs) var(--radius-xs) 0; margin-bottom: 8px;
  animation: fadeIn .2s ease-out both;
}
.rec-num { font-weight: 700; color: var(--primary); flex-shrink: 0; }
.rec-text { font-size: 13px; color: var(--text-mid); }

/* ═══════════════════════════════════════════════════════════════
   SCORE HISTORY — sc-badge
═══════════════════════════════════════════════════════════════ */
.sc-badge {
  display: inline-block; padding: 3px 9px; border-radius: var(--radius-pill); font-size: 12px; font-weight: 600;
}
.sc-badge--up { background: var(--c-pass-bg); color: var(--c-pass-fg); }
.sc-badge--dn { background: var(--c-fail-bg); color: var(--c-fail-fg); }
.sc-badge--eq { background: var(--mist); color: var(--text-muted); }
.sc-tr--latest td { background: rgba(145,141,246,.04); }

/* ═══════════════════════════════════════════════════════════════
   DOMAIN REPORT — dr-*, delta
═══════════════════════════════════════════════════════════════ */
.dr-hero {
  background: linear-gradient(135deg, var(--hero-from) 0%, var(--hero-to) 100%);
  color: #fff; border-radius: var(--radius); padding: 32px; margin-bottom: 24px;
  animation: fadeUp .35s ease-out both;
}
.dr-section { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; margin-bottom: 20px; }
.delta--up { color: var(--c-pass-fg); }
.delta--dn { color: var(--c-fail-fg); }
.dr-insights .up col { background: var(--c-pass-bg); }
.dr-insights .dn col { background: var(--c-fail-bg); }

/* ═══════════════════════════════════════════════════════════════
   FREE AUDIT HERO
═══════════════════════════════════════════════════════════════ */
.free-hero {
  background: linear-gradient(135deg, var(--hero-from) 0%, var(--hero-to) 100%);
  color: #fff; padding: 60px 0 50px; text-align: center;
  animation: fadeIn .3s ease-out both;
}
.free-hero h1, .free-hero h2 { color: #fff; }
.free-hero p { color: rgba(255,255,255,.8); }
.free-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow-lg);
  transition: background .2s, border-color .2s;
}
.stats-strip {
  background: var(--surface-2); border-top: 1px solid var(--border); padding: 32px 0;
}
.stats-strip__grid {
  display: flex; justify-content: center; gap: 48px; flex-wrap: wrap;
}
.stats-strip .stat-item .stat-num { color: var(--primary); }

/* ── Free hero inner elements ── */
.free-hero__badge {
  display: inline-block; padding: 4px 14px; border-radius: var(--radius-pill);
  background: rgba(255,255,255,.15); color: #fff; border: 1px solid rgba(255,255,255,.25);
  font-size: 12px; font-weight: 600; letter-spacing: .04em; margin-bottom: 16px;
}
.free-hero__title { font-size: clamp(26px, 5vw, 42px); font-weight: 800; color: #fff; margin-bottom: 12px; line-height: 1.15; }
.free-hero__sub { color: rgba(255,255,255,.8); font-size: 16px; margin-bottom: 24px; line-height: 1.6; }
.free-card__url-row, .free-card__email-row { display: flex; gap: 12px; margin-bottom: 14px; }
.free-card__trust {
  display: flex; flex-wrap: wrap; gap: 6px 16px; justify-content: center;
  margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--border);
}
.free-card__trust span { font-size: 12px; color: var(--text-muted); }
.free-security-note {
  margin-top: 16px; font-size: 13px; color: rgba(255,255,255,.65);
  background: rgba(0,0,0,.15); border-radius: var(--radius-sm); padding: 10px 16px;
}
.free-upsell {
  margin-top: 20px; font-size: 14px; color: rgba(255,255,255,.8);
  background: rgba(255,255,255,.07); border: 1px solid rgba(255,255,255,.12);
  border-radius: var(--radius-sm); padding: 14px 18px; line-height: 1.5;
}
.free-upsell a { color: #fff; font-weight: 600; text-decoration: underline; }
@media (max-width: 600px) {
  .stats-strip__grid { gap: 28px; }
  .free-card__trust  { gap: 6px 12px; }
}

/* ── Free awaiting email page ── */
.await-hero { text-align: center; padding: 60px 0 40px; }
.await-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 32px; max-width: 540px; margin: 0 auto 20px;
  box-shadow: var(--shadow-lg); animation: scaleIn .25s ease-out both;
}
.await-security { display: flex; align-items: flex-start; gap: 10px; }
.await-upsell {
  background: var(--c-info-bg); color: var(--c-info-fg);
  border: 1px solid rgba(96,165,250,.2); border-radius: var(--radius-sm); padding: 16px;
}
.await-icon   { margin-bottom: 16px; }
.await-title  { font-size: 24px; font-weight: 700; color: var(--text); margin: 0 0 8px; }
.await-sub    { font-size: 14px; color: var(--text-mid); margin: 0 0 24px; }
.await-email  { color: var(--indigo); font-weight: 600; }
.await-steps  { display: flex; flex-direction: column; gap: 14px; margin-bottom: 20px; text-align: left; }
.await-step   { display: flex; align-items: flex-start; gap: 14px; }
.step-num {
  flex-shrink: 0; width: 28px; height: 28px; border-radius: 50%;
  background: var(--indigo); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700; line-height: 1; margin-top: 1px;
}
.step-hint    { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.security-icon { font-size: 18px; flex-shrink: 0; margin-top: 1px; }
.await-spam-note { border-radius: var(--radius-sm); padding: 12px 16px; margin: 20px; font-size: 13px; }
.await-actions {
  display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin: 20px 0 16px;
}

/* ── Free SEO check hero ── */
.free-hero--seo {
  background: linear-gradient(135deg, var(--hero-seo-from) 0%, var(--hero-seo-to) 100%);
  color: #fff; padding: 60px 0 50px; text-align: center;
}
.free-hero--seo h1, .free-hero--seo h2 { color: #fff; }
.free-hero--seo p { color: rgba(255,255,255,.8); }

/* ═══════════════════════════════════════════════════════════════
   PLANS & PRICING (Package 037)

   ONE card family, shared by /billing/plans and /pricing through
   Views/Shared/_PlanCard.cshtml. It replaces the old .billing-* block and a
   near-identical dead .pricing-* block that no view referenced — two copies of
   the same card are how the two pricing pages came to disagree about what a
   plan includes.

   Price is per site per month on every tier, so a card carries a quantity
   stepper and a live total; wwwroot/js/plan-picker.js drives both.
═══════════════════════════════════════════════════════════════ */
.plans-hero { text-align: center; max-width: 760px; margin: 0 auto 40px; }
.plans-hero h1 {
  font-family: 'Source Serif 4', Georgia, serif; font-size: clamp(28px, 4vw, 40px);
  font-weight: 400; letter-spacing: -.8px; color: var(--text); margin-bottom: 14px;
}
.plans-hero p { font-size: 16px; color: var(--text-mid); line-height: 1.65; margin-bottom: 10px; }
.plans-hero .plans-hero__note { font-size: 13px; color: var(--text-muted); }
.plans-hero .plans-hero__note strong { color: var(--text); }

/* Four tiers: 4 across, then 2, then 1. Explicit counts rather than auto-fit, which leaves an
   orphan card on its own row.

   The count is not fixed, though: the free tier drops out for a signed-in viewer, and four columns
   holding three cards leaves a hole where a card should be. The view states how many it is
   rendering (PlansPageViewModel.GridColumns) so the track count follows the card count instead of
   a number written here. The narrow-screen rules come after, and so still win when they match. */
.plans-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; align-items: stretch; margin-bottom: 40px; }
.plans-grid--3 { grid-template-columns: repeat(3, 1fr); }
.plans-grid--2 { grid-template-columns: repeat(2, 1fr); }
/* Two classes deliberately: a lone card is already as narrow as it should be, so this is the one
   count the narrow-screen rules below must not reach in and change. */
.plans-grid.plans-grid--1 { grid-template-columns: minmax(0, 380px); justify-content: center; }
@media (max-width: 1100px) { .plans-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 680px)  { .plans-grid { grid-template-columns: 1fr; } }

.plan-card {
  background: var(--surface); border: 1.5px solid var(--border);
  border-radius: var(--radius); padding: 28px 22px 22px;
  display: flex; flex-direction: column;
  transition: transform .18s ease, box-shadow .18s ease, background .2s, border-color .2s;
}
.plan-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); border-color: var(--primary); }

/* Featured: an indigo ring over the theme's own surface, so it stays legible in
   dark mode. Never a hardcoded dark gradient here — the card holds body text. */
.plan-card--featured {
  border-color: var(--primary);
  background: linear-gradient(160deg, rgba(145,141,246,.08) 0%, var(--surface) 100%);
  box-shadow: 0 0 0 3px rgba(145,141,246,.18), var(--shadow);
  position: relative;
}
.plan-card--current { border-color: var(--mint); }

.plan-badge {
  display: inline-block; align-self: flex-start;
  font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
  color: var(--primary); background: rgba(145,141,246,.12);
  border-radius: var(--radius-pill); padding: 3px 10px; margin-bottom: 16px;
}
.plan-badge--popular { background: var(--primary); color: #fff; }
.plan-badge--current { background: var(--mint); color: #fff; }

.plan-name { font-size: 20px; font-weight: 700; color: var(--text); margin-bottom: 6px; }
.plan-price { font-family: var(--font-display); font-size: 34px; font-weight: 800; color: var(--text); line-height: 1; margin-bottom: 4px; }
.plan-price sub { font-size: 14px; font-weight: 500; color: var(--text-muted); vertical-align: middle; }
.plan-per-site { font-size: 12px; color: var(--text-muted); margin-bottom: 14px; }
.plan-desc { font-size: 13px; color: var(--text-mid); line-height: 1.55; margin-bottom: 18px; min-height: 52px; }

/* ── Quantity stepper + live total ── */
.plan-qty { margin-bottom: 16px; }
.plan-qty__label { display: block; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--text-muted); margin-bottom: 6px; }
.plan-qty__row { display: flex; align-items: stretch; gap: 0; max-width: 140px; }
.plan-qty__btn {
  width: 32px; flex: 0 0 32px; border: 1px solid var(--border); background: var(--linen);
  color: var(--text); font-size: 16px; font-weight: 700; line-height: 1; cursor: pointer;
  transition: background .15s, border-color .15s;
}
.plan-qty__btn:first-child { border-radius: var(--radius-sm) 0 0 var(--radius-sm); }
.plan-qty__btn:last-child  { border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }
.plan-qty__btn:hover:not(:disabled) { background: var(--primary); border-color: var(--primary); color: #fff; }
.plan-qty__btn:disabled { opacity: .4; cursor: not-allowed; }
.plan-qty__input {
  flex: 1 1 auto; min-width: 0; width: 100%; text-align: center;
  border: 1px solid var(--border); border-left: none; border-right: none;
  background: var(--surface); color: var(--text);
  font-family: var(--font-display); font-size: 15px; font-weight: 700; padding: 6px 0;
  -moz-appearance: textfield; appearance: textfield;
}
.plan-qty__input::-webkit-outer-spin-button,
.plan-qty__input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.plan-qty__input:focus { outline: 2px solid var(--primary); outline-offset: -2px; }
/* A tier whose site count IS its definition (Solo = 1 site) shows a statement, not a control. */
.plan-qty__fixed { font-size: 13px; font-weight: 600; color: var(--text-mid); }

.plan-total { margin-bottom: 16px; }
.plan-total__amount { font-family: var(--font-display); font-size: 22px; font-weight: 800; color: var(--text); }
.plan-total__unit { font-size: 12px; color: var(--text-muted); margin-left: 4px; }
.plan-credits { font-size: 12px; color: var(--text-muted); margin-bottom: 16px; }

.plan-features { list-style: none; padding: 0; margin: 0 0 22px; flex: 1; }
.plan-features li {
  font-size: 13px; color: var(--text-mid); padding: 6px 0; line-height: 1.5;
  display: flex; align-items: flex-start; gap: 8px;
  border-bottom: 1px solid var(--border);
}
.plan-features li:last-child { border-bottom: none; }
.plan-features li::before { content: '✓'; color: var(--mint); font-size: 12px; font-weight: 700; flex-shrink: 0; margin-top: 2px; }
.plan-features li.locked { color: var(--text-muted); opacity: .6; }
.plan-features li.locked::before { content: '—'; color: var(--slate-2); }

/* The one control the whole card exists to get clicked, so it is sized like one: a full-width
   target 46px tall rather than the 20px sliver it inherited. .btn-outline is a 12px/4px utility
   built for toolbars, and a card's call to action landing on it read as a disabled hint — the
   two-class selector here outranks it without changing the utility everything else uses.
   justify-content matters too: site.css's .btn has none, so a width:100% button left-aligned its
   label on /billing/plans, where public.css (which centres it) is not loaded. */
.plan-cta { margin-top: auto; }
.plan-cta .btn {
  width: 100%; justify-content: center;
  min-height: 46px; padding: 13px 20px;
  font-size: 15px; font-weight: 600; line-height: 1.2;
  border-radius: var(--radius-pill);
}
.plan-cta .btn-outline {
  color: var(--text); border: 1.5px solid var(--text-mid);
  transition: background .15s, border-color .15s, color .15s;
}
.plan-cta .btn-outline:hover { background: var(--text); border-color: var(--text); color: var(--surface); }
.plan-cta .btn:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
/* The Checkout and ChangeSubscription actions wrap their button in a form, which would otherwise
   add a line of margin between the card's bullets and its call to action. */
.plan-cta form { margin: 0; }
.plan-note { text-align: center; font-size: 13px; color: var(--text-muted); margin-top: 8px; }
.plan-note a { color: var(--primary); font-weight: 600; }

/* ── Current-subscription banner + managed services ── */
.plan-current-banner {
  background: rgba(145,141,246,.1); border: 1px solid var(--primary);
  border-radius: var(--radius); padding: 16px 20px;
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap; margin-bottom: 32px;
}
.plan-current-banner__body { flex: 1 1 260px; }
.plan-current-banner strong { color: var(--primary); }

.managed-banner {
  background: var(--linen); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 28px 32px; display: flex; align-items: center; gap: 24px; margin-bottom: 40px;
}
.managed-banner__icon { font-size: 32px; flex-shrink: 0; }
.managed-banner__body { flex: 1; }
.managed-banner__body h3 { font-size: 16px; font-weight: 700; color: var(--text); margin-bottom: 4px; }
.managed-banner__body p { font-size: 13px; color: var(--text-mid); margin: 0; }
@media (max-width: 600px) {
  .managed-banner { flex-direction: column; text-align: center; padding: 24px; }
}

/* ═══════════════════════════════════════════════════════════════
   MCP SERVERS
═══════════════════════════════════════════════════════════════ */
.mcp-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 20px; }
.mcp-preset-card, .mcp-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow);
  transition: background .2s, border-color .2s;
}
.mcp-preset-card--added { border-color: rgba(74,222,128,.35); background: var(--c-pass-bg); }
.cap-tag { background: var(--c-info-bg); color: var(--c-info-fg); }
.impact-tag { background: var(--c-pass-bg); color: var(--c-pass-fg); }

/* ═══════════════════════════════════════════════════════════════
   PAGES (CRUD)
═══════════════════════════════════════════════════════════════ */
.pages-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 20px; }
.page-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow);
  transition: background .2s, border-color .2s;
}
.status-pill {
  display: inline-block; padding: 3px 10px; border-radius: var(--radius-pill); font-size: 11px; font-weight: 600;
}
.status-pill--done    { background: var(--c-pass-bg); color: var(--c-pass-fg); }
.status-pill--running { background: var(--c-info-bg); color: var(--c-info-fg); }
.status-pill--queued  { background: var(--c-queue-bg); color: var(--c-queue-fg); }
.status-pill--failed  { background: var(--c-fail-bg); color: var(--c-fail-fg); }

/* ═══════════════════════════════════════════════════════════════
   REPUTATION
═══════════════════════════════════════════════════════════════ */
.rep-hero {
  border-radius: var(--radius); padding: 32px; color: #fff; margin-bottom: 24px;
  background: linear-gradient(135deg, #0B1120 0%, #1E1B4B 60%, #312E81 100%);
  animation: fadeUp .35s ease-out both;
}
.rep-hero h1, .rep-hero h2 { color: #fff; }
.rep-hero p { color: rgba(255,255,255,.8); }
.rep-section { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; margin-bottom: 20px; }
.rep-info-card { border-radius: var(--radius-sm); padding: 14px 16px; }
.rep-theme-tag {
  display: inline-block; padding: 4px 12px; border-radius: var(--radius-pill); font-size: 12px; font-weight: 600; margin: 3px;
}
.rep-theme-tag--pos { background: var(--c-pass-bg); color: var(--c-pass-fg); }
.rep-theme-tag--neg { background: var(--c-fail-bg); color: var(--c-fail-fg); }
.rep-theme-tag--neu { background: var(--mist); color: var(--text-muted); }

/* ═══════════════════════════════════════════════════════════════
   RUNNING BANNER (shared)
═══════════════════════════════════════════════════════════════ */
.running-banner {
  display: flex; align-items: center; gap: 12px;
  background: var(--c-info-bg); color: var(--c-info-fg);
  border: 1px solid rgba(96,165,250,.25); border-radius: var(--radius-sm);
  padding: 14px 18px; margin-bottom: 20px;
  animation: slideUp .3s ease-out both;
}
.running-banner .spinner {
  width: 16px; height: 16px; border: 2px solid rgba(96,165,250,.3);
  border-top-color: var(--c-info-fg); border-radius: 50%;
  animation: spin 1s linear infinite; flex-shrink: 0;
}

/* ═══════════════════════════════════════════════════════════════
   TABLES (shared audit/SEO)
═══════════════════════════════════════════════════════════════ */
.data-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.data-table th { text-align: left; padding: 10px 12px; font-size: 11px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: .05em; border-bottom: 1px solid var(--border); }
.data-table td { padding: 10px 12px; border-bottom: 1px solid var(--border); color: var(--text); vertical-align: top; }
.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: var(--mist); }
@media (max-width: 640px) { .data-table { display: block; overflow-x: auto; } }

/* ═══════════════════════════════════════════════════════════════
   EXTENDED MOBILE RESPONSIVE
═══════════════════════════════════════════════════════════════ */
@media (max-width: 768px) {
  /* Billing */
  .plans-grid { grid-template-columns: 1fr; }

  /* MCP / pages */
  .mcp-grid, .pages-grid { grid-template-columns: 1fr; }

  /* Website detail hero */
  .wd-hero { padding: 20px; }
  .wd-hero-row { flex-direction: column; }
  .wd-hero-score { text-align: left; }

  /* Domain report hero */
  .dr-hero { padding: 20px; }

  /* Reputation hero */
  .rep-hero { padding: 20px; }

  /* Dash product grid (already handled above, but reinforce) */
  .dash-product-grid { grid-template-columns: 1fr; }

  /* Run nav wraps */
  .run-nav { gap: 4px; }
  .run-nav__link { padding: 6px 12px; font-size: 12px; }

  /* Free result score grid */
  .fr-scores { grid-template-columns: 1fr; }

  /* Billing card */
  .plan-card { padding: 24px 20px 20px; }

  /* Score card row */
  .report-score-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
}
@media (max-width: 480px) {
  .report-score-cards { grid-template-columns: 1fr; }
  .free-hero { padding: 40px 0 30px; }
  .wd-hero .wd-hero-score .score-big { font-size: 36px; }
}

/* ═══════════════════════════════════════════════════════════════
   WEBSITE DETAIL — wd-* component classes
═══════════════════════════════════════════════════════════════ */

/* Hero layout (flex row: identity left, rings right) */
.wd-hero {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 20px; flex-wrap: wrap;
}
.wd-hero-identity { display: flex; align-items: flex-start; gap: 14px; flex: 1; min-width: 0; }
.wd-favicon {
  width: 36px; height: 36px; border-radius: 8px;
  background: rgba(255,255,255,.15);
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.wd-brand { font-size: 22px; font-weight: 700; color: #fff; margin: 0 0 4px; }
.wd-url { font-size: 13px; color: rgba(255,255,255,.7); text-decoration: none; }
.wd-url:hover { color: #fff; text-decoration: underline; }
.wd-meta-row { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.wd-meta-pill {
  font-size: 11px; padding: 2px 8px; border-radius: var(--radius-pill);
  background: rgba(255,255,255,.15); color: rgba(255,255,255,.85);
}
.wd-pill--niche { background: rgba(145,141,246,.3); }
.wd-pill--loc   { background: rgba(51,199,88,.25); }
.wd-pill--kw    { background: rgba(255,166,0,.25); }

/* Score rings */
.wd-score-rings { display: flex; gap: 10px; align-items: center; flex-shrink: 0; flex-wrap: wrap; }
.wd-ring-wrap   { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.wd-ring-svg    { display: block; }
.wd-ring-track  { stroke: rgba(255,255,255,.18); }
.wd-ring-fill   { stroke-linecap: round; transform-origin: center; transform: rotate(-90deg); }
.wd-ring-text   { fill: #fff; font-weight: 700; font-family: var(--font-display); }
.wd-ring-label  { font-size: 10px; color: rgba(255,255,255,.7); font-weight: 600; text-align: center; }

/* Mini spinner */
.mini-spin {
  display: inline-block; width: 12px; height: 12px;
  border: 2px solid rgba(255,255,255,.3); border-top-color: #fff;
  border-radius: 50%; animation: spin 1s linear infinite; vertical-align: middle;
}
.mini-spin--lg { width: 18px; height: 18px; border-width: 2.5px; flex-shrink: 0; }

/* Trend bar */
.wd-trend-bar {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 12px 16px; margin-bottom: 20px;
  transition: background .2s, border-color .2s;
}
.wd-trend-lbl  { font-size: 13px; font-weight: 600; }
.wd-trend-meta { font-size: 12px; color: var(--text-muted); }
.wd-trend-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-left: auto; }

/* Running banner right-side group */
.wd-running-since { font-size: 11px; color: var(--c-info-fg); white-space: nowrap; margin-left: auto; }

/* Body grid: 2-col */
.wd-body-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-bottom: 24px; }
.wd-panel {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 20px; transition: background .2s, border-color .2s;
}
.wd-panel--chart { grid-column: 1 / -1; }
.wd-panel-title {
  font-size: 14px; font-weight: 700; color: var(--text); margin-bottom: 14px;
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
}

/* Signal pill grid */
.wd-sig-grid { display: flex; gap: 6px; flex-wrap: wrap; }
.wd-sig-pill {
  font-size: 12px; padding: 4px 10px; border-radius: var(--radius-pill); font-weight: 500;
}

/* Keywords */
.wd-kw-list { display: flex; gap: 6px; flex-wrap: wrap; }
.wd-kw-tag {
  font-size: 12px; padding: 4px 10px; border-radius: var(--radius-pill);
  background: rgba(145,141,246,.1); color: var(--primary);
  border: 1px solid rgba(145,141,246,.2);
}

/* SEO mini score bars */
.wd-seo-row   { display: flex; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }
.wd-seo-mini  { flex: 1; min-width: 70px; }
.wd-seo-mini-label { font-size: 11px; color: var(--text-muted); margin-bottom: 4px; }
.wd-seo-mini-bar   { height: 4px; background: var(--mist); border-radius: 2px; overflow: hidden; transition: background .2s; }
.wd-seo-mini-fill  { height: 100%; border-radius: 2px; }
.wd-seo-mini-val   { font-size: 14px; font-weight: 700; margin-top: 4px; }

/* Domain / page badge */
.wd-audit-badge { display: inline-block; }
.wd-atb-page {
  background: var(--mist); color: var(--text-mid);
  padding: 3px 10px; border-radius: var(--radius-pill); font-size: 13px; font-weight: 600;
}

/* Competitors */
.comp-grid { display: flex; flex-direction: column; }
.comp-row {
  display: flex; align-items: center; gap: 10px; padding: 10px 0;
  border-bottom: 1px solid var(--border); font-size: 13px; flex-wrap: wrap;
}
.comp-row:last-child { border-bottom: none; }
.comp-name { flex: 1; display: flex; align-items: center; gap: 6px; min-width: 0; }
.comp-you-badge {
  font-size: 10px; font-weight: 700; background: var(--primary); color: #fff;
  padding: 2px 6px; border-radius: var(--radius-pill); white-space: nowrap;
}
.comp-scores  { display: flex; gap: 16px; flex-shrink: 0; }
.comp-score   { display: flex; flex-direction: column; align-items: center; min-width: 34px; }
.comp-score-val { font-size: 15px; font-weight: 700; color: var(--text); }
.comp-score-lbl { font-size: 10px; color: var(--text-muted); }
.comp-score--better .comp-score-val { color: var(--mint); }
.comp-score--worse  .comp-score-val { color: var(--red); }
.comp-del-btn {
  width: 22px; height: 22px; border-radius: 50%; background: none;
  border: 1px solid var(--border); cursor: pointer; font-size: 11px;
  color: var(--text-muted); display: inline-flex; align-items: center; justify-content: center;
  flex-shrink: 0; transition: background .12s, color .12s; font-family: var(--font-body);
}
.comp-del-btn:hover { background: var(--red-lt); color: var(--red); border-color: var(--red); }
.comp-url { color: var(--text); text-decoration: none; font-weight: 500; }
.comp-url:hover { color: var(--primary); text-decoration: underline; }
.comp-pending { font-size: 11px; color: var(--text-muted); }
.comp-add-details summary::-webkit-details-marker { display: none; }
.comp-add-details summary { list-style: none; }

/* Pages mini list */
.wd-pages-mini { display: flex; flex-direction: column; gap: 0; margin-bottom: 8px; }
.wd-page-row {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 7px 0; border-bottom: 1px solid var(--border);
}
.wd-page-row:last-child { border-bottom: none; }
.wd-page-info  { display: flex; align-items: center; gap: 8px; }
.wd-page-label { font-size: 13px; color: var(--text); }
.wd-page-status {
  font-size: 11px; padding: 2px 8px; border-radius: var(--radius-pill); font-weight: 600;
}
.wdps--idle { background: var(--mist); color: var(--text-muted); }

/* Edit modal */
.wd-modal-overlay {
  position: fixed; inset: 0; z-index: 1000;
  background: rgba(0,0,0,.45); backdrop-filter: blur(2px);
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
}
.wd-modal-box {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  width: 100%; max-width: 640px; max-height: 90vh; overflow-y: auto;
  padding: 24px; box-shadow: 0 20px 60px rgba(0,0,0,.25);
}
.wd-modal-header {
  display: flex; align-items: center; justify-content: space-between;
  font-weight: 600; font-size: 15px; margin-bottom: 20px;
}
.wd-modal-close {
  background: none; border: none; cursor: pointer; font-size: 16px;
  color: var(--text-muted); padding: 4px 8px; border-radius: 4px;
  line-height: 1;
}
.wd-modal-close:hover { background: var(--mist); color: var(--text); }
.wd-form-grid   { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-hint      { font-size: 11px; color: var(--text-muted); font-weight: 400; }
.keyword-input-wrap {
  display: flex; flex-wrap: wrap; gap: 6px; padding: 8px;
  border: 1.5px solid var(--border); border-radius: var(--radius-sm);
  background: var(--surface); cursor: text; transition: border-color .15s, background .2s;
}
.keyword-input-wrap:focus-within { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(145,141,246,.15); }
.keyword-input-wrap .form-input { flex: 1; min-width: 120px; border: none; padding: 2px 4px; background: transparent; box-shadow: none; }
.keyword-input-wrap .form-input:focus { box-shadow: none; outline: none; }
.kw-tag {
  display: inline-flex; align-items: center; gap: 4px; background: rgba(145,141,246,.12);
  color: var(--primary); border: 1px solid rgba(145,141,246,.25);
  padding: 2px 8px; border-radius: var(--radius-pill); font-size: 12px;
}
.kw-tag button { background: none; border: none; cursor: pointer; color: var(--primary); font-size: 13px; line-height: 1; padding: 0; }

/* Tabs */
.wd-tabs {
  display: flex; gap: 4px; border-bottom: 1px solid var(--border);
  margin-bottom: 20px; flex-wrap: wrap;
}
.wd-tab {
  padding: 10px 16px; font-size: 13px; font-weight: 500; color: var(--text-muted);
  background: none; border: none; border-bottom: 2px solid transparent; cursor: pointer;
  transition: color .12s, border-color .12s; display: flex; align-items: center; gap: 6px;
  font-family: var(--font-body);
}
.wd-tab:hover       { color: var(--text); }
.wd-tab--active     { color: var(--primary); border-bottom-color: var(--primary); font-weight: 600; }
.wd-tab-badge {
  font-size: 11px; background: var(--mist); color: var(--text-muted);
  padding: 1px 6px; border-radius: var(--radius-pill);
}
.wd-tab-panel.hidden { display: none; }

/* History table */
.wd-history-table-wrap { overflow-x: auto; }
.wd-history-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.wd-history-table th {
  padding: 8px 10px; text-align: left; font-size: 11px; font-weight: 600;
  color: var(--text-muted); text-transform: uppercase; letter-spacing: .04em;
  border-bottom: 1px solid var(--border); white-space: nowrap;
}
.wd-history-table td   { padding: 10px; border-bottom: 1px solid var(--border); vertical-align: middle; color: var(--text); }
.wd-history-table tr:last-child td { border-bottom: none; }
.wd-history-table tr:hover td { background: var(--mist); }
.wd-history-table .text-center { text-align: center; }
.wd-history-table .text-right  { text-align: right; }
.wd-row--latest td { background: rgba(145,141,246,.04); }

.wd-date         { font-size: 13px; color: var(--text); }
.wd-time         { font-size: 11px; color: var(--text-muted); display: block; }
.wd-latest-badge { font-size: 10px; background: var(--primary); color: #fff; padding: 1px 6px; border-radius: var(--radius-pill); font-weight: 600; margin-left: 6px; white-space: nowrap; }
.wd-latest-badge--seo { background: var(--carbon); }
html[data-theme="dark"] .wd-latest-badge--seo { background: var(--fog); color: var(--text); }

.wd-score     { font-weight: 700; font-size: 15px; }
.wd-score--good { color: var(--mint); }
.wd-score--mid  { color: var(--amber); }
.wd-score--low  { color: var(--red); }
.wd-score-sm   { color: var(--text-mid); font-size: 13px; }
.wd-url-path   { font-size: 11px; color: var(--text-muted); font-family: monospace; display: block; max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Pager */
.wd-pager      { display: flex; align-items: center; gap: 10px; justify-content: center; padding: 16px 0; }
.wd-pager-info { font-size: 13px; color: var(--text-muted); }

/* Empty states inside tabs */
.wd-empty      { text-align: center; padding: 40px 24px; }
.wd-empty-icon { font-size: 36px; margin-bottom: 12px; }
.wd-empty p    { color: var(--text-muted); font-size: 14px; margin-bottom: 16px; }

/* ═══════════════════════════════════════════════════════════════
   SCORE HISTORY PAGE — sc-* classes
═══════════════════════════════════════════════════════════════ */
.sc-headline {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 12px; flex-wrap: wrap; margin-bottom: 24px;
}
.sc-title { font-size: 22px; font-weight: 700; color: var(--text); letter-spacing: -.3px; }
.sc-sub   { font-size: 14px; color: var(--text-muted); margin-top: 2px; }

.sc-empty      { text-align: center; padding: 80px 40px; }
.sc-empty-icon { margin-bottom: 16px; }
.sc-empty h3   { font-size: 18px; color: var(--text); margin-bottom: 8px; }
.sc-empty p    { color: var(--text-muted); font-size: 14px; }

/* Rings row */
.sc-rings-row {
  display: flex; gap: 16px; align-items: flex-end; flex-wrap: wrap;
  margin-bottom: 20px; padding: 24px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  transition: background .2s, border-color .2s;
}
.sc-ring-wrap       { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.sc-ring-label      { font-size: 11px; color: var(--text-muted); font-weight: 600; text-align: center; }
.sc-ring-delta      { font-size: 11px; font-weight: 700; }
.sc-ring-delta--up  { color: var(--mint); }
.sc-ring-delta--dn  { color: var(--red); }
.sc-arc             { transition: stroke-dasharray 1.2s cubic-bezier(.4,0,.2,1); }

/* Cards */
.sc-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 24px; margin-bottom: 20px; transition: background .2s, border-color .2s;
}
.sc-card-header {
  display: flex; justify-content: space-between; align-items: flex-start;
  gap: 12px; flex-wrap: wrap; margin-bottom: 16px;
}
.sc-card-title { font-size: 16px; font-weight: 700; color: var(--text); }
.sc-card-sub   { font-size: 13px; color: var(--text-muted); margin-top: 2px; }
.sc-trend-badge { font-size: 13px; font-weight: 700; padding: 6px 14px; border-radius: var(--radius-pill); white-space: nowrap; }

/* Mini grid */
.sc-mini-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; margin-bottom: 20px; }
.sc-mini-title { font-size: 14px; font-weight: 700; margin-bottom: 4px; }
.sc-mini-desc  { font-size: 12px; color: var(--text-muted); margin-bottom: 12px; line-height: 1.5; }

/* Score table */
.sc-table-wrap  { overflow-x: auto; margin-top: 8px; }
.sc-table       { width: 100%; border-collapse: collapse; font-size: 13px; }
.sc-table th    { padding: 10px 12px; text-align: left; font-size: 11px; color: var(--text-muted); font-weight: 600; text-transform: uppercase; letter-spacing: .04em; border-bottom: 1px solid var(--border); white-space: nowrap; }
.sc-table td    { padding: 10px 12px; border-bottom: 1px solid var(--border); color: var(--text); }
.sc-table tr:last-child td { border-bottom: none; }
.sc-table tr:hover td { background: var(--mist); }

.sc-score-pill {
  display: inline-block; border: 1.5px solid; color: var(--c, #4F46E5);
  border-color: var(--c, #4F46E5);
  font-weight: 700; padding: 2px 10px; border-radius: var(--radius-pill); font-size: 13px;
}
.sc-latest-badge {
  font-size: 10px; background: var(--primary); color: #fff;
  padding: 1px 6px; border-radius: var(--radius-pill); font-weight: 600; margin-left: 6px;
}
.sc-delta        { font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: var(--radius-pill); }
.sc-delta--up    { background: var(--c-pass-bg); color: var(--c-pass-fg); }
.sc-delta--dn    { background: var(--c-fail-bg); color: var(--c-fail-fg); }
.sc-delta--flat  { color: var(--text-muted); }

/* ═══════════════════════════════════════════════════════════════
   MCP SERVERS PAGE — mcp-*, preset-*, msr-* classes
═══════════════════════════════════════════════════════════════ */
.mcp-benefit-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.mcp-benefit      { display: flex; gap: 12px; }
.mcp-benefit-icon {
  width: 40px; height: 40px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center; font-size: 18px; flex-shrink: 0;
}
.mcp-benefit strong { display: block; font-size: 13px; font-weight: 700; color: var(--text); margin-bottom: 4px; }
.mcp-benefit p  { font-size: 12px; color: var(--text-mid); line-height: 1.5; margin-bottom: 8px; }
.mcp-tags       { display: flex; gap: 4px; flex-wrap: wrap; }
.mcp-tag        { font-size: 11px; padding: 2px 8px; border-radius: var(--radius-pill); background: var(--mist); color: var(--text-muted); border: 1px solid var(--border); }

.count-badge {
  display: inline-flex; align-items: center; justify-content: center;
  width: 22px; height: 22px; border-radius: 50%;
  background: var(--primary); color: #fff; font-size: 11px; font-weight: 700; margin-left: 4px;
}

.empty-state-sm { text-align: center; padding: 20px; color: var(--text-muted); font-size: 14px; }

/* Connected server list */
.mcp-server-list { display: flex; flex-direction: column; }
.mcp-server-row {
  display: flex; align-items: center; gap: 10px; padding: 12px 0;
  border-bottom: 1px solid var(--border); flex-wrap: wrap; font-size: 13px;
}
.mcp-server-row:last-child  { border-bottom: none; }
.mcp-server-row--disabled   { opacity: .5; }
.msr-name   { display: flex; align-items: center; gap: 8px; font-weight: 600; color: var(--text); min-width: 150px; flex-shrink: 0; }
.msr-url    { font-size: 11px; color: var(--text-muted); flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-family: monospace; }
.msr-caps   { display: flex; gap: 4px; flex-wrap: wrap; }
.msr-impact { display: flex; gap: 4px; flex-wrap: wrap; }
.msr-actions { display: flex; gap: 6px; flex-shrink: 0; }

/* Extra button sizes */
.btn-xs { padding: 4px 10px; font-size: 12px; }
.btn-outline {
  background: transparent; color: var(--text-mid); border: 1px solid var(--border);
  border-radius: var(--radius-pill); padding: 4px 10px; font-size: 12px;
  cursor: pointer; font-family: var(--font-body); transition: background .12s;
}
.btn-outline:hover { background: var(--mist); text-decoration: none; }

/* Preset grid */
.preset-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.preset-card {
  background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 16px; transition: border-color .15s, background .2s;
}
.preset-card:hover { border-color: var(--primary); }
.preset-card--added { border-color: rgba(74,222,128,.4); }
html[data-theme="dark"] .preset-card--added { background: rgba(51,199,88,.06); }

.pc-top         { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 6px; }
.pc-name        { font-size: 14px; font-weight: 700; color: var(--text); }
.pc-added-badge { font-size: 11px; background: var(--c-pass-bg); color: var(--c-pass-fg); padding: 2px 8px; border-radius: var(--radius-pill); font-weight: 600; white-space: nowrap; }
.pc-desc        { font-size: 12px; color: var(--text-mid); margin-bottom: 10px; line-height: 1.5; }
.pc-caps        { display: flex; gap: 4px; flex-wrap: wrap; margin-bottom: 8px; }
.pc-impact      { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.pc-impact-label { font-size: 11px; color: var(--text-muted); font-weight: 500; }

/* ═══════════════════════════════════════════════════════════════
   MOBILE OVERRIDES — wd-*, sc-*, mcp-*
═══════════════════════════════════════════════════════════════ */
@media (max-width: 768px) {
  /* Website detail hero */
  .wd-hero              { flex-direction: column; }
  .wd-score-rings       { justify-content: flex-start; }
  .wd-body-grid         { grid-template-columns: 1fr; }
  .wd-panel--chart { grid-column: auto; }
  .wd-form-grid         { grid-template-columns: 1fr; }
  .wd-trend-actions     { margin-left: 0; }
  .wd-trend-bar         { gap: 8px; }

  /* Score history */
  .sc-rings-row  { gap: 10px; padding: 16px; }
  .sc-mini-grid  { grid-template-columns: 1fr 1fr; }
  .sc-headline   { flex-direction: column; }

  /* MCP */
  .mcp-benefit-grid { grid-template-columns: 1fr; }
  .preset-grid      { grid-template-columns: 1fr; }
  .mcp-server-row   { flex-direction: column; align-items: flex-start; }
  .msr-url          { max-width: 100%; }
}
@media (max-width: 480px) {
  .sc-mini-grid { grid-template-columns: 1fr; }
  .sc-rings-row { gap: 8px; padding: 12px; }
  .wd-score-rings { gap: 6px; }
  .comp-scores  { gap: 10px; }
}

/* ═══════════════════════════════════════════════════════════════
   PACKAGE 010 ─ MISSING PAGE CSS (Audit, SEO, Reputation, Pages, BulkAdd)
═══════════════════════════════════════════════════════════════ */

/* ── Portal mobile header bar ─────────────────────────────────────── */
.portal-mobile-bar {
  display: none;
  position: fixed; top: 0; left: 0; right: 0; z-index: 200;
  height: 68px; padding: 0 16px;
  background: var(--surface); border-bottom: 1px solid var(--border);
  align-items: center; justify-content: space-between;
  box-shadow: 0 1px 8px rgba(0,0,0,.08);
}
.portal-hamburger {
  width: 36px; height: 36px; display: flex; flex-direction: column;
  justify-content: center; align-items: center; gap: 5px;
  background: none; border: none; cursor: pointer; border-radius: var(--radius-sm);
  padding: 4px;
}
.portal-hamburger span {
  display: block; width: 20px; height: 2px; background: var(--text);
  border-radius: 2px; transition: transform .25s, opacity .2s;
}
.portal-hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.portal-hamburger.open span:nth-child(2) { opacity: 0; }
.portal-hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
.portal-mobile-logo {
  display: flex; align-items: center; gap: 8px; text-decoration: none;
  color: var(--text); font-weight: 700; font-size: 15px;
}
.portal-sidebar-backdrop {
  position: fixed; inset: 0; background: rgba(0,0,0,.35); z-index: 249;
  backdrop-filter: blur(2px);
}

/* ── Utility ───────────────────────────────────────────────────────── */
.hidden { display: none !important; }

.running-spinner, .mini-spinner {
  display: inline-block; border-radius: 50%;
  border-style: solid; border-color: transparent;
  border-top-color: currentColor; animation: spin .7s linear infinite;
  flex-shrink: 0;
}
.running-spinner { width: 18px; height: 18px; border-width: 2.5px; }
.mini-spinner    { width: 12px; height: 12px; border-width: 2px; }
.running-eta     { font-size: 12px; color: var(--text-muted); }
@keyframes spin  { to { transform: rotate(360deg); } }

/* ── Form fields ───────────────────────────────────────────────────── */
.field-label {
  display: block; font-size: 13px; font-weight: 600;
  color: var(--text-mid); margin-bottom: 6px;
}
.field-input {
  display: block; width: 100%; padding: 9px 12px;
  border: 1.5px solid var(--border); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--text); font-size: 14px;
  transition: border-color .15s, box-shadow .15s; box-sizing: border-box;
}
.field-input:focus {
  outline: none; border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(145,141,246,.18);
}
.field-hint { display: block; font-size: 12px; color: var(--text-muted); margin-top: 4px; }

/* ── Score pill badge variant (combined with bar-*) ────────────────── */
.score-pill.bar-green, .score-pill.bar-amber,
.score-pill.bar-red,   .score-pill.bar-grey {
  display: inline-block; padding: 2px 9px;
  border-radius: var(--radius-pill); font-weight: 700;
  font-size: 13px; min-width: 36px; text-align: center; gap: 0;
}
.score-pill.bar-green { background: var(--c-pass-bg); color: var(--c-pass-fg); }
.score-pill.bar-amber { background: var(--c-warn-bg); color: var(--c-warn-fg); }
.score-pill.bar-red   { background: var(--c-fail-bg); color: var(--c-fail-fg); }
.score-pill.bar-grey  { background: var(--mist);      color: var(--text-muted); }

/* ── URL display ────────────────────────────────────────────────────── */
.page-url  { font-size: 13px; color: var(--text-muted); margin-top: 4px; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.url-label { font-weight: 600; color: var(--text-mid); }
.url-link  { color: var(--primary); text-decoration: none; word-break: break-all; }
.url-link:hover { text-decoration: underline; }
.audit-url-label { font-size: 12px; color: var(--text-muted); font-weight: 500; }
.audit-url-value { font-size: 13px; color: var(--text); }

/* atb-page badge */
.atb-page {
  display: inline-block; padding: 2px 8px; border-radius: var(--radius-pill);
  font-size: 11px; font-weight: 600;
  background: rgba(145,141,246,.12); color: var(--primary);
  border: 1px solid rgba(145,141,246,.25);
}

/* Connector / MCP / source badges */
.connector-badge, .mcp-badge {
  display: inline-block; padding: 1px 7px; border-radius: var(--radius-pill);
  font-size: 11px; font-weight: 600;
  background: rgba(145,141,246,.12); color: var(--primary);
  border: 1px solid rgba(145,141,246,.22); vertical-align: middle;
}
.source-tag {
  display: inline-block; padding: 2px 7px; border-radius: var(--radius-pill);
  font-size: 11px; font-weight: 500;
  background: var(--mist); color: var(--text-mid); border: 1px solid var(--border);
}

/* ══════════════════════════════════════════════════════════════
   AI AUDIT INDEX ─ checks grid + history table (aht-*)
══════════════════════════════════════════════════════════════ */
.ai-checks-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.ai-check-item  { display: flex; gap: 14px; align-items: flex-start; }
.ai-check-item p        { margin: 4px 0 0; font-size: 13px; color: var(--text-mid); }
.ai-check-item strong   { display: block; font-size: 14px; font-weight: 600; color: var(--text); }
.ai-check-icon {
  width: 36px; height: 36px; border-radius: 50%; display: flex; align-items: center;
  justify-content: center; font-size: 16px; flex-shrink: 0; margin-top: 2px;
}
.ai-icon--blue   { background: rgba(59,130,246,.12);  color: #3b82f6; }
.ai-icon--purple { background: rgba(145,141,246,.12); color: var(--primary); }
.ai-icon--green  { background: var(--c-pass-bg);      color: var(--c-pass-fg); }
.ai-icon--amber  { background: var(--c-warn-bg);      color: var(--c-warn-fg); }

.ai-history-table { display: flex; flex-direction: column; }
.aht-header, .aht-row {
  display: grid;
  grid-template-columns: 120px 1fr 50px 50px 50px 56px 90px 80px;
  gap: 10px; align-items: center; padding: 10px 12px; font-size: 13px;
}
.aht-header {
  font-size: 11px; font-weight: 600; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: .04em;
  border-bottom: 1px solid var(--border); padding-bottom: 8px;
}
.aht-row        { border-bottom: 1px solid var(--border); transition: background .15s; }
.aht-row:last-child { border-bottom: none; }
.aht-row:hover  { background: var(--mist); }
.aht-date small { display: block; font-size: 11px; color: var(--text-muted); }
.aht-url        { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.aht-url-path   { font-size: 12px; color: var(--text-muted); word-break: break-all; }

/* ══════════════════════════════════════════════════════════════
   SEO INDEX ─ checks grid + history table (sht-*)
══════════════════════════════════════════════════════════════ */
.seo-checks-grid { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; }
.seo-check-item  { display: flex; gap: 14px; align-items: flex-start; }
.seo-check-item p      { margin: 4px 0 0; font-size: 13px; color: var(--text-mid); }
.seo-check-item strong { display: block; font-size: 14px; font-weight: 600; color: var(--text); }
.seo-check-icon {
  width: 36px; height: 36px; border-radius: 50%; display: flex; align-items: center;
  justify-content: center; font-size: 16px; flex-shrink: 0; margin-top: 2px;
}
.seo-icon--navy   { background: rgba(30,41,59,.1);    color: #1e293b; }
.seo-icon--purple { background: rgba(145,141,246,.12); color: var(--primary); }
.seo-icon--green  { background: var(--c-pass-bg);     color: var(--c-pass-fg); }
.seo-icon--amber  { background: var(--c-warn-bg);     color: var(--c-warn-fg); }

.seo-history-table { display: flex; flex-direction: column; }
.sht-header, .sht-row {
  display: grid;
  grid-template-columns: 130px 1fr 56px 56px 56px 56px 1fr 90px;
  gap: 10px; align-items: center; padding: 10px 12px; font-size: 13px;
}
.sht-header {
  font-size: 11px; font-weight: 600; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: .04em;
  border-bottom: 1px solid var(--border); padding-bottom: 8px;
}
.sht-row        { border-bottom: 1px solid var(--border); transition: background .15s; }
.sht-row:last-child { border-bottom: none; }
.sht-row:hover  { background: var(--mist); }
.sht-date small { display: block; font-size: 11px; color: var(--text-muted); }
.sht-url        { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.sht-url-path   { font-size: 12px; color: var(--text-muted); word-break: break-all; }
.sht-sources    { display: flex; flex-wrap: wrap; gap: 4px; }

/* ══════════════════════════════════════════════════════════════
   AUDIT REPORT ─ scores, section-nav, sections, signals
══════════════════════════════════════════════════════════════ */
.report-scores {
  display: grid; grid-template-columns: repeat(5, 1fr); gap: 16px; margin-bottom: 24px;
}
.rsc-hint { font-size: 11px; color: var(--text-muted); margin-top: 6px; }
.score-card--locked { opacity: .5; pointer-events: none; }
.lock-icon { font-size: 20px; display: block; margin-bottom: 6px; }

/* Section navigation */
.section-nav {
  display: flex; gap: 4px; flex-wrap: wrap;
  border-bottom: 1px solid var(--border); margin-bottom: 24px;
}
.snav-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 14px; border-radius: var(--radius-sm) var(--radius-sm) 0 0;
  border: 1px solid transparent; border-bottom: none;
  background: none; color: var(--text-muted); font-size: 13px; font-weight: 500;
  cursor: pointer; transition: all .15s; white-space: nowrap;
}
.snav-btn:hover { background: var(--mist); color: var(--text); }
.snav-btn--active {
  background: var(--surface); color: var(--text);
  border-color: var(--border); border-bottom-color: var(--surface);
  font-weight: 600; margin-bottom: -1px;
}
.run-nav__label     { font-size: 11px; color: var(--text-muted); }
.run-nav__score     { font-size: 13px; font-weight: 700; color: var(--text); margin-top: 2px; }
.run-nav__link--all {
  font-size: 12px; color: var(--primary); text-decoration: none;
  padding: 4px 8px; border-radius: var(--radius-sm);
}
.run-nav__link--all:hover { background: rgba(145,141,246,.1); }

/* Report sections */
.report-section {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 24px; margin-bottom: 20px;
  transition: background .2s, border-color .2s;
}
.section-title-row {
  display: flex; align-items: center; gap: 10px; margin-bottom: 20px; flex-wrap: wrap;
}
.report-section-title {
  font-size: 17px; font-weight: 700; color: var(--text);
  margin: 0; display: flex; align-items: center; gap: 8px;
}
.section-badge--navy, .section-badge--blue,
.section-badge--purple, .section-badge--green {
  display: inline-block; padding: 3px 9px; border-radius: var(--radius-pill);
  font-size: 11px; font-weight: 600;
}
.section-badge--navy   { background: rgba(30,41,59,.08);    color: #1e293b; border: 1px solid rgba(30,41,59,.15); }
.section-badge--blue   { background: rgba(59,130,246,.1);   color: #2563eb; border: 1px solid rgba(59,130,246,.2); }
.section-badge--purple { background: rgba(145,141,246,.12); color: var(--primary); border: 1px solid rgba(145,141,246,.25); }
.section-badge--green  { background: var(--c-pass-bg); color: var(--c-pass-fg); border: 1px solid rgba(74,222,128,.25); }
.section-toggle {
  margin-left: auto; background: none; border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 4px 10px; font-size: 12px;
  color: var(--text-muted); cursor: pointer; transition: all .15s;
}
.section-toggle:hover { background: var(--mist); color: var(--text); }

/* Signal table */
.signal-grid { display: flex; flex-direction: column; }
.signal-row  {
  display: grid; grid-template-columns: 1fr auto auto;
  gap: 10px; align-items: center; padding: 9px 0;
  border-bottom: 1px solid var(--border); font-size: 13px;
}
.signal-row:last-child { border-bottom: none; }
.signal-row > :first-child { color: var(--text-mid); }
.signal-row > :nth-child(2) { font-weight: 600; text-align: right; white-space: nowrap; }
.signal-row > :nth-child(3) { font-size: 11px; color: var(--text-muted); white-space: nowrap; }

/* GBP sig-item — local citation readiness tiles in GEO section */
.sig-block { }
.sig-item {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 10px 12px; border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}
.sig-item--pass { background: var(--c-pass-bg, rgba(22,163,74,.06)); border-color: rgba(22,163,74,.2); }
.sig-item--warn { background: rgba(245,158,11,.06); border-color: rgba(245,158,11,.25); }
.sig-item--fail { background: var(--c-fail-bg, rgba(239,68,68,.06)); border-color: rgba(239,68,68,.2); }
.sig-item--muted { background: var(--mist, #f6f6f8); border-color: var(--border); }
.sig-icon { font-size: 1.1rem; line-height: 1; margin-top: 2px; flex-shrink: 0; }
.sig-label { font-size: 11px; color: var(--text-mid); font-weight: 500; }
.sig-val   { font-size: 13px; font-weight: 700; color: var(--text-mid); margin-top: 2px; }

/* Schema tags */
.schema-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.schema-tag  {
  display: inline-block; padding: 2px 9px; border-radius: var(--radius-pill);
  font-size: 12px; font-weight: 500; border: 1px solid transparent;
}
.schema-tag--green { background: var(--c-pass-bg); color: var(--c-pass-fg); border-color: rgba(74,222,128,.25); }
.schema-tag--red   { background: var(--c-fail-bg); color: var(--c-fail-fg); border-color: rgba(248,113,113,.25); }

/* GEO / Provider grid */
.geo-summary {
  background: rgba(145,141,246,.05); border: 1px solid rgba(145,141,246,.15);
  border-radius: var(--radius-sm); padding: 14px 16px; margin-bottom: 16px;
  font-size: 14px; color: var(--text-mid);
}
.provider-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(500px,1fr)); gap: 12px;
  margin-bottom: 16px;
}
.provider-card {
  border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 14px 16px;
  text-align: left; display: flex; flex-direction: column; align-items: flex-start; gap: 0;
  transition: border-color .2s; overflow: hidden; min-width: 0;
}
.provider-card--cited { border-color: var(--c-pass-fg); background: rgba(34,197,94,.03); }
.provider-card-header {
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap;
  width: 100%; margin-bottom: 10px; gap: 6px;
}
.provider-name { font-size: 14px; font-weight: 700; color: var(--text); min-width: 0; }
.provider-status { font-size: 12px; color: var(--text-muted); width: 100%; min-width: 0; }
.citation-context {
  border-left: 3px solid var(--primary); padding: 10px 14px;
  background: rgba(145,141,246,.06);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-size: 13px; color: var(--text-mid); margin: 8px 0 0;
  font-style: normal; line-height: 1.6; white-space: pre-wrap;
  word-break: break-word; overflow-wrap: anywhere; max-width: 100%;
}
.citation-details { margin-top: 10px; width: 100%; }
.citation-details summary {
  font-size: 11px; font-weight: 600; color: var(--slate-3); cursor: pointer; user-select: none;
  list-style: none; display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 8px; border-radius: var(--radius-sm); background: var(--slate-1);
  transition: color .15s;
}
.citation-details summary::-webkit-details-marker { display: none; }
.citation-details summary:hover { color: var(--text-mid); }
.citation-details[open] summary { color: var(--text-mid); }
.competitor-list { margin-top: 8px; font-size: 11px; color: var(--slate-3); line-height: 1.8; word-break: break-word; overflow-wrap: anywhere; }
.competitor-list a { color: var(--red); margin-right: 6px; text-decoration: none; }
.competitor-list a:hover { text-decoration: underline; }
.query-used { margin-top: 8px; font-size: 10px; color: var(--slate-3); line-height: 1.5; }
.citation-source-list { margin-top: 8px; font-size: 11px; color: var(--slate-3); line-height: 1.8; }
.citation-source-list a { color: var(--primary); margin-right: 6px; text-decoration: none; }
.citation-source-list a:hover { text-decoration: underline; }

/* Technical scores */
.tech-pagespeed-warn {
  display: flex; align-items: center; gap: 10px; padding: 12px 14px;
  background: var(--c-warn-bg); border-radius: var(--radius-sm); margin-bottom: 16px;
  font-size: 13px; color: var(--c-warn-fg);
}
.tech-warn-icon { font-size: 18px; flex-shrink: 0; }
.tech-scores-grid {
  display: grid; grid-template-columns: repeat(4,1fr); gap: 12px; margin: 16px 0;
}
.tech-score-card {
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 16px; text-align: center; transition: border-color .2s;
}
.tsc-ring  { font-size: 28px; font-weight: 700; font-family: var(--font-display); line-height: 1; margin-bottom: 4px; display: block; }
.tsc-label { font-size: 12px; color: var(--text-muted); display: block; }
.tsc-hint  { font-size: 11px; color: var(--text-muted); margin-top: 6px; display: block; }
.tsc--grey .tsc-ring { color: var(--text-muted); }

/* Issues list */
.issues-list { margin-top: 12px; }
.issues-list h4 { font-size: 13px; font-weight: 600; color: var(--c-fail-fg); margin: 0 0 8px; }
.issues-list ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.issues-list li, .issue-item {
  padding: 8px 12px; background: var(--c-fail-bg);
  border-radius: var(--radius-sm); font-size: 13px; color: var(--c-fail-fg);
}

/* Recommendations */
.recs-section  { margin-top: 24px; }
.recs-heading  {
  display: flex; align-items: center; gap: 8px;
  font-size: 14px; font-weight: 600; color: var(--text); margin-bottom: 12px;
}
.recs-grid { display: flex; flex-direction: column; gap: 8px; }
.recs-count-badge {
  display: inline-block; padding: 1px 7px; border-radius: var(--radius-pill);
  font-size: 12px; font-weight: 700;
}
.recs-count-badge--purple { background: rgba(145,141,246,.15); color: var(--primary); }
.recs-count-badge--green  { background: var(--c-pass-bg); color: var(--c-pass-fg); }

/* Check / pass-fail table — real <table> elements */
.check-report-table {
  width: 100%; border-collapse: collapse; table-layout: auto; font-size: 13px;
}
.check-report-table thead th {
  font-size: 11px; font-weight: 600; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: .04em; white-space: nowrap;
  padding: 8px 10px; border-bottom: 2px solid var(--border);
  background: var(--mist); text-align: left;
}
.check-report-table thead th:first-child { width: 32px; text-align: center; }
.check-report-table thead th:last-child  { width: 40px; text-align: center; }
.check-report-table tbody tr td {
  padding: 9px 10px; border-bottom: 1px solid var(--border);
  vertical-align: middle; font-size: 13px; transition: background .15s;
}
.check-report-table tbody tr:last-child td { border-bottom: none; }
.check-report-table tbody tr:hover td     { background: var(--mist); }
.check-report-table tbody tr.crt-snippet-row:hover td { background: var(--surface-2); }
.crt-pass { color: var(--c-pass-fg); font-weight: 600; }
.crt-fail { color: var(--c-fail-fg); font-weight: 600; }
.crt-snip-toggle {
  background: color-mix(in srgb, var(--indigo) 12%, transparent);
  border: 1px solid color-mix(in srgb, var(--indigo) 35%, transparent);
  border-radius: 20px;
  padding: 3px 10px; font-size: 11px; font-weight: 600;
  color: var(--indigo-dark); cursor: pointer;
  letter-spacing: .01em; transition: background .15s, border-color .15s, color .15s;
  vertical-align: middle;
}
.crt-snip-toggle:hover {
  background: color-mix(in srgb, var(--indigo) 22%, transparent);
  border-color: var(--indigo); color: var(--indigo);
}
.crt-snippet-row { background: var(--surface-2); }
.crt-snip-body   { padding: 10px 12px 14px 46px; }
.crt-code {
  display: block; background: var(--carbon); color: var(--paper);
  border-radius: var(--radius-sm); padding: 10px 12px;
  font-family: monospace; font-size: 12px;
  overflow-x: auto; max-height: 200px; white-space: pre-wrap; word-break: break-all;
}
.crt-copy-btn {
  display: inline-flex; align-items: center; gap: 4px;
  background: color-mix(in srgb, var(--indigo) 14%, transparent);
  border: 1px solid color-mix(in srgb, var(--indigo) 40%, transparent);
  border-radius: 20px;
  padding: 4px 12px; font-size: 11px; font-weight: 600; cursor: pointer;
  color: var(--indigo-dark); margin-top: 8px;
  transition: background .15s, border-color .15s, color .15s;
}
.crt-copy-btn:hover {
  background: color-mix(in srgb, var(--indigo) 25%, transparent);
  border-color: var(--indigo); color: var(--indigo);
}
.crt-copy-btn.copied {
  background: color-mix(in srgb, var(--green) 15%, transparent);
  border-color: color-mix(in srgb, var(--green) 45%, transparent);
  color: var(--green);
}

/* Gate / paywall */
.gate-section { position: relative; margin-top: 24px; }
.gate-overlay {
  position: relative; border-radius: var(--radius); overflow: hidden;
  background: var(--surface); border: 1px solid var(--border);
}
.gate-overlay::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(to bottom, transparent 0%, var(--surface) 65%);
  pointer-events: none;
}
.gate-content {
  position: absolute; bottom: 24px; left: 50%; transform: translateX(-50%);
  z-index: 2; text-align: center; width: 90%; max-width: 440px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow-lg);
}
.gate-icon { font-size: 28px; display: block; margin-bottom: 8px; }

/* ══════════════════════════════════════════════════════════════
   REPUTATION PAGE ─ comprehensive rep-* components
══════════════════════════════════════════════════════════════ */
.rep-hero {
  background: linear-gradient(135deg, #1e1b4b 0%, #4338ca 100%);
  border-radius: var(--radius); padding: 32px; margin-bottom: 24px;
  position: relative; overflow: hidden; animation: fadeUp .35s ease-out both;
}
.rep-hero-bg {
  position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(circle at 80% 50%, rgba(255,255,255,.06) 0%, transparent 60%);
}
.rep-hero-content {
  position: relative; z-index: 1;
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 24px; flex-wrap: wrap;
}
.rep-hero-left  { display: flex; align-items: flex-start; gap: 16px; }
.rep-icon-wrap  {
  width: 52px; height: 52px; border-radius: 50%;
  background: rgba(255,255,255,.15); display: flex; align-items: center;
  justify-content: center; font-size: 24px; flex-shrink: 0;
}
.rep-icon    { font-size: 24px; }
.rep-title   { font-size: 22px; font-weight: 700; color: #fff; margin: 0 0 4px; }
.rep-sub     { font-size: 14px; color: rgba(255,255,255,.75); margin: 0 0 8px; }
.rep-url     { font-size: 13px; }
.rep-url a   { color: rgba(255,255,255,.6); text-decoration: none; }
.rep-url a:hover { color: #fff; }
.rep-score-row { display: flex; gap: 20px; align-items: center; flex-wrap: wrap; }
.rep-score     { text-align: center; }
.rep-score-num { font-size: 32px; font-weight: 700; font-family: var(--font-display); line-height: 1; }
.rep-score-lbl { font-size: 12px; color: rgba(255,255,255,.6); margin-top: 2px; }

/* Action cards */
.rep-actions-grid {
  display: grid; grid-template-columns: repeat(3,1fr); gap: 20px; margin-bottom: 20px;
}
.rep-action-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 24px; display: flex; flex-direction: column; gap: 10px; transition: border-color .2s;
}
.rep-action-card h3 { margin: 0; font-size: 16px; font-weight: 700; color: var(--text); }
.rep-action-card p  { margin: 0; font-size: 13px; color: var(--text-mid); flex: 1; }
.rep-action-card--primary {
  border-color: rgba(145,141,246,.35); background: rgba(145,141,246,.03);
}
.rep-action-icon { font-size: 24px; }
.btn-block { width: 100%; }

/* Draft controls */
.rep-draft-controls { display: flex; flex-direction: column; gap: 6px; margin: 8px 0; }
.rep-draft-label    { font-size: 13px; font-weight: 500; color: var(--text-mid); }
.rep-draft-row      { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.rep-num-input {
  width: 60px; padding: 6px 8px; border: 1.5px solid var(--border);
  border-radius: var(--radius-sm); background: var(--surface);
  color: var(--text); font-size: 14px; text-align: center;
}
.rep-draft-suffix { font-size: 13px; color: var(--text-mid); }
.rep-disclaimer   { font-size: 12px; color: var(--text-muted); margin: 4px 0 0; }

/* Platform list */
.rep-platform-list { display: flex; flex-direction: column; gap: 8px; margin: 10px 0; }
.rep-platform {
  display: flex; align-items: center; gap: 10px; padding: 8px 12px;
  border-radius: var(--radius-sm); border: 1px solid var(--border); font-size: 13px;
}
.rep-platform--on   { border-color: rgba(74,222,128,.25); }
.rep-platform--off  { opacity: .75; }
.rep-platform--soon { opacity: .5; }
.rep-platform-icon   { font-size: 16px; flex-shrink: 0; }
.rep-platform-name   { flex: 1; font-weight: 500; color: var(--text); }
.rep-platform-status { font-size: 12px; font-weight: 600; }
.rep-platform--on  .rep-platform-status { color: var(--c-pass-fg); }
.rep-platform--off .rep-platform-status { color: var(--text-muted); }
.rep-platform-soon-lbl { color: var(--text-muted); font-weight: 400; }
.rep-connect-btn { font-size: 11px; padding: 2px 10px; line-height: 1.6; margin-left: auto; }
.btn-xs { padding: 2px 10px; font-size: 11px; }
.rep-info-icon { font-size: 28px; flex-shrink: 0; }

/* Latest result */
.rep-latest-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 24px; margin-bottom: 20px;
}
.rep-latest-header      { margin-bottom: 20px; }
.rep-latest-header h3   { margin: 0; font-size: 16px; font-weight: 700; color: var(--text); }
.rep-stats-row {
  display: grid; grid-template-columns: repeat(4,1fr); gap: 16px; margin-bottom: 20px;
}
.rep-stat     { text-align: center; }
.rep-stat-val { font-size: 28px; font-weight: 700; font-family: var(--font-display); line-height: 1; }
.rep-stat-lbl { font-size: 12px; color: var(--text-muted); margin-top: 4px; }
.rep-themes       { margin-bottom: 12px; }
.rep-themes-label { font-size: 13px; font-weight: 600; color: var(--text-mid); margin-bottom: 8px; }
.rep-themes-list  { display: flex; flex-wrap: wrap; gap: 6px; }

/* Platform breakdown */
.rep-platforms-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 24px; margin-bottom: 20px;
}
.rep-platforms-title { font-size: 16px; font-weight: 700; color: var(--text); margin: 0 0 16px; }
.rep-platforms-grid  {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(200px,1fr)); gap: 16px;
}
.rep-plat-card    { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 16px; }
.rep-plat-header  { display: flex; align-items: center; justify-content: space-between; margin-bottom: 4px; }
.rep-plat-rating  { font-weight: 700; color: var(--c-warn-fg); font-size: 15px; }
.rep-plat-count   { font-size: 12px; color: var(--text-muted); margin-bottom: 10px; }
.rep-plat-bar     { height: 6px; background: var(--mist); border-radius: 3px; overflow: hidden; }
.rep-plat-fill    { height: 100%; background: var(--primary); border-radius: 3px; transition: width .6s ease-out; }

/* ══════════════════════════════════════════════════════════════
   PAGES ─ add form + pages list
══════════════════════════════════════════════════════════════ */
.add-page-row {
  display: grid; grid-template-columns: 1fr 1fr auto; gap: 16px; align-items: start;
}
.add-page-url, .add-page-label { display: flex; flex-direction: column; }
.add-page-action {
  display: flex; flex-direction: column; justify-content: flex-end; padding-bottom: 1px;
}
.pages-list { display: flex; flex-direction: column; gap: 12px; }
.page-block {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden;
}
.page-row   { display: flex; align-items: flex-start; gap: 16px; padding: 16px; flex-wrap: wrap; }
.page-row--running { border-left: 3px solid var(--primary); }
.page-row-info    { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.page-row-label   { display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 600; color: var(--text); }
.page-url-link    { font-size: 12px; color: var(--primary); word-break: break-all; text-decoration: none; }
.page-url-link:hover { text-decoration: underline; }
.page-row-status  { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 4px; }
.page-row-actions {
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap; flex-shrink: 0; padding-top: 2px;
}
.processed-badge {
  display: inline-block; padding: 1px 7px; border-radius: var(--radius-pill);
  font-size: 11px; font-weight: 600; background: var(--c-pass-bg); color: var(--c-pass-fg);
}
.page-history-panel { border-top: 1px solid var(--border); background: var(--surface-2); animation: fadeIn .2s ease-out both; }
.page-history-inner { padding: 16px; }
.ph-loading { font-size: 13px; color: var(--text-muted); font-style: italic; }

/* ══════════════════════════════════════════════════════════════
   BULK ADD ─ bulk-grid, options, divider, sitemap tips
══════════════════════════════════════════════════════════════ */
.bulk-grid {
  display: grid; grid-template-columns: 1fr 40px 1fr; align-items: start;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden; margin-bottom: 20px;
}
.bulk-option        { padding: 28px; }
.bulk-option-header { margin-bottom: 20px; }
.bulk-option-badge  {
  display: inline-block; padding: 2px 10px; border-radius: var(--radius-pill);
  font-size: 11px; font-weight: 700; background: rgba(145,141,246,.15);
  color: var(--primary); margin-bottom: 8px;
}
.bulk-option-badge--alt { background: rgba(30,41,59,.08); color: #1e293b; }
.bulk-option-title  { font-size: 17px; font-weight: 700; color: var(--text); margin: 0 0 6px; }
.bulk-option-sub    { font-size: 13px; color: var(--text-mid); margin: 0; }
.bulk-textarea-wrap { display: flex; flex-direction: column; gap: 6px; }
.bulk-textarea {
  width: 100%; padding: 10px 12px; border: 1.5px solid var(--border);
  border-radius: var(--radius-sm); background: var(--surface); color: var(--text);
  font-size: 13px; font-family: monospace; resize: vertical;
  transition: border-color .15s; box-sizing: border-box; min-height: 220px;
}
.bulk-textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(145,141,246,.15); }
.bulk-url-count { font-size: 12px; color: var(--text-muted); text-align: right; font-weight: 500; }
.bulk-divider {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 28px 0; gap: 8px; background: var(--surface-2);
}
.bulk-divider-line { flex: 1; width: 1px; background: var(--border); min-height: 40px; }
.bulk-divider-text { font-size: 13px; font-weight: 600; color: var(--text-muted); }
.sitemap-tips {
  background: var(--mist); border-radius: var(--radius-sm); padding: 14px 16px; margin-top: 16px;
}
.tips-title      { font-size: 13px; font-weight: 600; color: var(--text-mid); margin: 0 0 8px; }
.sitemap-tips ul { margin: 0; padding-left: 16px; }
.sitemap-tips li { font-size: 13px; color: var(--text-mid); margin-bottom: 4px; }
.sitemap-tips code { background: rgba(0,0,0,.06); padding: 1px 4px; border-radius: 3px; font-size: 12px; }
.bulk-limits-note {
  display: flex; gap: 16px; flex-wrap: wrap; font-size: 13px; color: var(--text-muted);
  padding: 12px 16px; background: var(--mist); border-radius: var(--radius-sm); margin-bottom: 20px;
}
.bulk-actions { display: flex; align-items: center; justify-content: flex-end; gap: 12px; }
.spin { animation: spin .8s linear infinite; }

/* ══════════════════════════════════════════════════════════════
   CONNECTOR LOGO IMAGE
══════════════════════════════════════════════════════════════ */
.connector-logo { width: 32px; height: 32px; object-fit: contain; border-radius: 4px; }

/* ══════════════════════════════════════════════════════════════
   RESPONSIVE ─ all new sections
══════════════════════════════════════════════════════════════ */
@media (max-width: 768px) {
  /* Portal mobile header */
  .portal-mobile-bar { display: flex; }
  .portal-content    { padding-top: calc(68px + 20px) !important; }
  .sidebar {
    position: fixed !important; top: 0; left: 0; bottom: 0; z-index: 250;
    height: 100vh !important; min-height: 100vh;
    box-shadow: 4px 0 24px rgba(0,0,0,.15);
  }
  .sidebar--open { transform: translateX(0) !important; }
  .portal-sidebar-backdrop { display: block; }

  /* Checks grids */
  .ai-checks-grid  { grid-template-columns: 1fr; }
  .seo-checks-grid { grid-template-columns: 1fr; }

  /* History tables ─ horizontal scroll */
  .ai-history-table { overflow-x: auto; }
  .seo-history-table { overflow-x: auto; }
  .aht-header, .aht-row { min-width: 680px; }
  .check-report-table { display: block; overflow-x: auto; }
  .sht-header, .sht-row { min-width: 680px; }

  /* Report */
  .report-scores    { grid-template-columns: 1fr 1fr; }
  .tech-scores-grid { grid-template-columns: 1fr 1fr; }
  .section-nav      { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 2px; }
  .provider-grid    { grid-template-columns: 1fr; }

  /* Reputation */
  .rep-hero-content   { flex-direction: column; }
  .rep-actions-grid   { grid-template-columns: 1fr; }
  .rep-stats-row      { grid-template-columns: 1fr 1fr; }
  .rep-platforms-grid { grid-template-columns: 1fr; }

  /* Pages */
  .add-page-row     { grid-template-columns: 1fr; }
  .page-row         { flex-direction: column; }
  .page-row-actions { width: 100%; }

  /* Bulk add */
  .bulk-grid    { grid-template-columns: 1fr; }
  .bulk-divider { flex-direction: row; padding: 16px; }
  .bulk-divider-line { flex: 1; height: 1px; width: auto; min-height: auto; }
  .bulk-actions { flex-wrap: wrap; }
}

@media (max-width: 480px) {
  .report-scores    { grid-template-columns: 1fr 1fr; }
  .tech-scores-grid { grid-template-columns: 1fr 1fr; }
  .rep-stats-row    { grid-template-columns: 1fr 1fr; }
  .rep-score-row    { gap: 12px; }
}


/* ═══════════════════════════════════════════════════════════════
   PACKAGE 010 PATCH — Mobile tables, missing classes
   (Appended to fix: check-report-table, aht columns, seo/result)
═══════════════════════════════════════════════════════════════ */

/* ── Section nav links (snav-link — SEO Result page) ── */
.snav-link {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 14px; font-size: 13px; font-weight: 500;
  color: var(--text-muted); text-decoration: none; white-space: nowrap;
  border-bottom: 2px solid transparent;
  transition: color .15s, border-color .15s;
}
.snav-link:hover { color: var(--text); border-bottom-color: var(--border); text-decoration: none; }
.snav-link--active { color: var(--primary); border-bottom-color: var(--primary); font-weight: 600; }

/* ── Tech metric colour classes ── */
.tech-metric--good { color: var(--c-pass-fg); font-weight: 600; }
.tech-metric--mid  { color: var(--c-warn-fg); font-weight: 600; }
.tech-metric--bad  { color: var(--c-fail-fg); font-weight: 600; }

/* ── Score chip badge (keyword position) ── */
.score-chip {
  display: inline-block; padding: 2px 8px; border-radius: var(--radius-pill);
  font-size: 12px; font-weight: 700; white-space: nowrap;
}
.score-chip.good { background: var(--c-pass-bg); color: var(--c-pass-fg); }
.score-chip.mid  { background: var(--c-warn-bg); color: var(--c-warn-fg); }
.score-chip.low  { background: var(--c-fail-bg); color: var(--c-fail-fg); }

/* ── Keyword table ── */
.kw-summary { display: flex; gap: 24px; flex-wrap: wrap; margin-bottom: 16px; }
.kw-stat { font-size: 14px; color: var(--text-mid); }
.kw-stat strong { color: var(--text); font-weight: 700; }
.kw-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }

/* ── Reports table (keyword rankings, etc.) ── */
.reports-table {
  width: 100%; border-collapse: collapse; table-layout: auto; font-size: 13px;
}
.reports-table th {
  font-size: 11px; font-weight: 600; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: .04em; white-space: nowrap;
  padding: 8px 12px; border-bottom: 2px solid var(--border);
  background: var(--mist); text-align: left;
}
.reports-table td {
  padding: 9px 12px; border-bottom: 1px solid var(--border); vertical-align: middle;
}
.reports-table tr:last-child td { border-bottom: none; }
.reports-table tr:hover td { background: var(--mist); }

/* ── Backlinks list ── */
.backlinks-list { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; }
.backlink-row {
  display: flex; align-items: center; gap: 12px; padding: 8px 12px;
  background: var(--mist); border-radius: var(--radius-sm); flex-wrap: wrap;
}
.bl-domain { font-size: 13px; font-weight: 600; color: var(--text); word-break: break-all; }
.bl-anchor { font-size: 13px; color: var(--text-mid); flex: 1; min-width: 80px; }
.bl-da     { font-size: 12px; font-weight: 600; color: var(--primary); white-space: nowrap; }

/* ── Provider tag (Ahrefs / Semrush label in section header) ── */
.provider-tag {
  display: inline-block; padding: 1px 8px; border-radius: var(--radius-pill);
  font-size: 11px; font-weight: 500; background: var(--mist);
  color: var(--text-mid); border: 1px solid var(--border); vertical-align: middle;
}

/* ── Connect prompt (empty state for Ahrefs/Semrush sections) ── */
.connect-prompt {
  display: flex; align-items: flex-start; gap: 16px;
  padding: 16px 18px; background: rgba(145,141,246,.05);
  border: 1px solid rgba(145,141,246,.15); border-radius: var(--radius-sm);
  margin-bottom: 16px; flex-wrap: wrap;
}
.connect-prompt > div { flex: 1; min-width: 0; }
.connect-prompt p { margin: 0 0 4px; font-size: 14px; color: var(--text); }

/* ── Upgrade banner fix (flex + proper wrap) ── */
.upgrade-banner {
  display: flex !important; align-items: center; gap: 14px;
  flex-wrap: wrap;
}
.upgrade-banner__icon { font-size: 20px; flex-shrink: 0; }
.upgrade-banner > div { flex: 1; min-width: 0; }

/* ── BulkAdd: prevent long code/URL overflow on mobile ── */
.sitemap-tips code {
  word-break: break-all; overflow-wrap: break-word;
}
.bulk-option-sub, .bulk-option-sub strong {
  word-break: break-word;
}
.bulk-limits-note span { line-height: 1.5; }

/* ── form-group (used in BulkAdd option B) ── */
.form-group { display: flex; flex-direction: column; gap: 6px; }

/* ── snippet row display fix (tbody tr.crt-snippet-row) ── */
.crt-snippet-row { background: var(--surface-2); }
.crt-snippet-row > td { padding: 0 !important; }
.crt-snip-body { padding: 10px 12px 12px 44px; }
.crt-snip-body.hidden, .crt-snippet-row:not(.open) .crt-snip-body { display: none; }

/* ── Additional responsive fixes ── */
@media (max-width: 768px) {
  /* Section nav scroll */
  .section-nav { flex-wrap: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch; padding-bottom: 2px; }
  .snav-link   { white-space: nowrap; }

  /* Keyword table */
  .kw-table-wrap { overflow-x: auto; }

  /* Report scores — already 1fr 1fr at 768px — also fix score card text */
  .report-score-card { padding: 16px 12px; }
  .rsc-value { font-size: 28px; }

  /* Connect prompt stacks */
  .connect-prompt { flex-direction: column; gap: 12px; }
  .connect-prompt > div:last-child { flex-shrink: 0; align-self: flex-start; }

  /* Backlinks */
  .backlink-row { flex-direction: column; align-items: flex-start; gap: 4px; }

  /* Bulk add extra overflow guard */
  .bulk-option { overflow: hidden; }
  .bulk-textarea { min-height: 160px; }

  /* kw summary stacks */
  .kw-summary { gap: 16px; }
}

@media (max-width: 480px) {
  .report-scores { grid-template-columns: 1fr 1fr; }
  .bulk-actions  { flex-direction: column; }
  .bulk-actions .btn { width: 100%; text-align: center; }
}

/* ── Page History panel (ph-*) — _PageHistory.cshtml partial ── */
.ph-root { display: flex; flex-direction: column; gap: 0; }
.ph-section { }
.ph-section-title {
  font-size: 13px; font-weight: 600; color: var(--text-mid);
  padding: 10px 0 8px; border-bottom: 1px solid var(--border); margin-bottom: 0;
}
.ph-empty { font-size: 13px; color: var(--text-muted); padding: 12px 0; margin: 0; }
.ph-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.ph-table {
  width: 100%; border-collapse: collapse; font-size: 13px; table-layout: auto;
}
.ph-table thead th {
  font-size: 11px; font-weight: 600; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: .04em; white-space: nowrap;
  padding: 8px 10px; border-bottom: 2px solid var(--border);
  background: var(--mist); text-align: left;
}
.ph-table thead th.text-center { text-align: center; }
.ph-table tbody td {
  padding: 9px 10px; border-bottom: 1px solid var(--border); vertical-align: middle;
}
.ph-table tbody tr:last-child td { border-bottom: none; }
.ph-table tbody tr:hover td { background: var(--mist); }
.ph-table .text-center { text-align: center; }
.ph-table .text-right  { text-align: right; }
.ph-date { display: block; font-size: 13px; color: var(--text); }
.ph-time { display: block; font-size: 11px; color: var(--text-muted); margin-top: 2px; }
.ph-score {
  display: inline-block; padding: 3px 10px; border-radius: var(--radius-pill);
  font-size: 13px; font-weight: 700;
}
.ph-score--good { background: var(--c-pass-bg); color: var(--c-pass-fg); }
.ph-score--mid  { background: var(--c-warn-bg); color: var(--c-warn-fg); }
.ph-score--low  { background: var(--c-fail-bg); color: var(--c-fail-fg); }
.ph-score-sm { font-size: 13px; font-weight: 600; color: var(--text-mid); }
.ph-badge {
  display: inline-block; padding: 2px 8px; border-radius: var(--radius-pill);
  font-size: 11px; font-weight: 600;
}
.ph-mcp { font-size: 12px; color: var(--primary); font-weight: 500; }
@media (max-width: 600px) {
  .ph-table-wrap { font-size: 12px; }
}

/* ═══════════════════════════════════════════════════════════════
   INSIGHTS HUB — shared utility classes (Package 011)
═══════════════════════════════════════════════════════════════ */

/* Grid layouts */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.grid-5 { display: grid; grid-template-columns: repeat(5, 1fr); gap: 16px; }
@media (max-width: 900px) { .grid-2 { grid-template-columns: 1fr; } }
@media (max-width: 900px) { .grid-5 { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 700px) { .grid-4 { grid-template-columns: 1fr 1fr; } .grid-5 { grid-template-columns: 1fr 1fr; } }
@media (max-width: 480px) { .grid-4 { grid-template-columns: 1fr; } .grid-5 { grid-template-columns: 1fr; } }

/* Card sub-components */
.card-header {
  display: flex; align-items: flex-start; justify-content: space-between;
  margin-bottom: 16px; gap: 10px; flex-wrap: wrap;
}
.card-title { font-size: 14px; font-weight: 700; color: var(--text); }
.card-sub   { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.card-sm    { padding: 16px; }

/* Status pills */
.pill       { display: inline-block; padding: 3px 9px; border-radius: var(--radius-pill); font-size: 11px; font-weight: 600; }
.pill-mint  { background: var(--c-pass-bg); color: var(--c-pass-fg); }
.pill-amber { background: var(--c-warn-bg); color: var(--c-warn-fg); }
.pill-red   { background: var(--c-fail-bg); color: var(--c-fail-fg); }
.pill-blue  { background: rgba(44,120,252,.1); color: var(--sky); }

/* Breadcrumb separator alias */
.sep { color: var(--text-muted); font-size: 15px; }
nav.breadcrumb a { color: var(--text-mid); text-decoration: none; }
nav.breadcrumb a:hover { color: var(--primary); text-decoration: underline; }

/* Score rings (_ScoreRing.cshtml) */
.score-ring-wrap { display: flex; flex-direction: column; align-items: center; }
.score-ring      { position: relative; width: 80px; height: 80px; }
.score-ring svg  { width: 100%; height: 100%; }
.score-ring-num  {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  font-size: 1.1rem; font-weight: 700; line-height: 1;
}
.score-label { font-size: .6rem; color: var(--text-muted); font-weight: 500; text-align: center; margin-top: 2px; }

/* Score colour classes (shared) */
.score-good { color: var(--c-pass-fg); }
.score-mid  { color: var(--c-warn-fg); }
.score-low  { color: var(--c-fail-fg); }

/* Connector groups (Connectors/Index.cshtml) */
.conn-group         { margin-bottom: 36px; }
.conn-group__title  { font-size: 16px; font-weight: 700; color: var(--text); margin-bottom: 4px; }
.conn-group__sub    { font-size: 13px; color: var(--text-muted); margin-bottom: 16px; }
.conn-action        { margin-top: 8px; }
.conn-props-link    { display: inline-block; margin-bottom: 8px; font-size: 12px; font-weight: 500; color: var(--indigo); text-decoration: none; }
.conn-props-link:hover { text-decoration: underline; }
.conn-cta           { margin-top: auto; align-self: flex-start; }
/* Package 038 - a connector this plan cannot use. Still a real link, to the plans page: a disabled
   button tells the reader nothing about why, or what would fix it. */
.conn-cta--locked   { font-weight: 600; }
.conn-sites         { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 8px; }
.conn-site-chip     { font-size: 11px; background: var(--green-lt); color: var(--green); border-radius: 4px; padding: 2px 7px; font-weight: 500; }
.conn-info__grid    { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px,1fr)); gap: 12px; margin-bottom: 16px; }
.conn-info__item    { font-size: 13px; color: var(--text-mid); line-height: 1.5; }
.conn-info__item strong { display: flex; align-items: center; gap: 7px; margin-bottom: 4px; color: var(--text); font-size: 13px; }
.conn-info__item strong img { width: 20px; height: 20px; object-fit: contain; border-radius: 4px; flex-shrink: 0; }

/* ═══════════════════════════════════════════════════════════════
   INSIGHTS HUB — additional component classes
═══════════════════════════════════════════════════════════════ */

/* Grid - 3 column */
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }

/* Badge colour variants (for use alongside .badge base class) */
.badge-primary { background: rgba(145,141,246,.12); color: var(--primary); }
.badge-green   { background: var(--c-pass-bg); color: var(--c-pass-fg); }
.badge-amber   { background: var(--c-warn-bg); color: var(--c-warn-fg); }
.badge-red     { background: var(--c-fail-bg); color: var(--c-fail-fg); }
.badge-muted   { background: var(--mist); color: var(--text-muted); }

/* Stat tiles */
.stat-tile       { display: flex; flex-direction: column; justify-content: center; }
.stat-tile-val   { font-size: 1.6rem; font-weight: 700; color: var(--text); line-height: 1; }
.stat-tile-label { font-size: .75rem; color: var(--text-muted); margin-top: 4px; }
.stat-tile-delta { font-size: .72rem; font-weight: 600; margin-top: 6px; }
.delta-up { color: var(--mint); }
.delta-dn { color: var(--red); }

/* Track pills (section type indicators) */
.track-pill    { display: inline-flex; align-items: center; padding: 3px 8px; border-radius: 9999px; font-size: .62rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; }
.track-seo     { background: var(--sky-lt); color: var(--sky); }
.track-ai      { background: var(--primary-xlt); color: var(--primary); }
.track-ai-pill { display: inline-flex; align-items: center; padding: 3px 8px; border-radius: 9999px; font-size: .62rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; background: var(--primary-xlt); color: var(--primary); }

/* Progress bars */
.prog-bar      { height: 8px; background: var(--border); border-radius: 9999px; overflow: hidden; }
.prog-bar-fill { height: 100%; border-radius: 9999px; transition: width .3s ease; }

/* Insight tables */
.tbl-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.ins-tbl  { width: 100%; border-collapse: collapse; font-size: .84rem; }
.ins-tbl th {
  text-align: left; padding: 9px 12px; font-size: .7rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: .05em; color: var(--text-muted);
  border-bottom: 1px solid var(--border); white-space: nowrap; background: transparent;
}
.ins-tbl td     { padding: 10px 12px; border-bottom: 1px solid var(--border); color: var(--text); vertical-align: middle; }
.ins-tbl tr:last-child td { border-bottom: none; }
.ins-tbl tr:hover td      { background: var(--mist); }

/* Tab bar (Insights tab switching) */
.tab-bar  { display: flex; gap: 0; margin-bottom: 20px; /*overflow-x: auto;*/ }
.tab-btn  {
  padding: 10px 16px; font-size: .84rem; font-weight: 600; color: var(--text-muted);
  background: none; border: none; border-bottom: 2px solid transparent;
  cursor: pointer; white-space: nowrap; margin-bottom: -1px;
  transition: color .15s, border-color .15s; font-family: var(--font-body);
}
.tab-btn:hover          { color: var(--text); }
.tab-btn.active         { color: var(--primary); border-bottom-color: var(--primary); }
.tab-pane               { display: none; }
.tab-pane.active        { display: block; }
.tab-panel              { display: none; }
.tab-panel.active       { display: block; }

/* Insights connection status bar */
.conn-bar        { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; padding: 10px 14px; background: var(--off-white); border: 1px solid var(--slate-2); border-radius: var(--radius-sm); }
.conn-bar-label  { font-size: .68rem; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; color: var(--text-mid); margin-right: 4px; }
.conn-bar-item   { display: inline-flex; align-items: center; gap: 4px; font-size: .78rem; font-weight: 500; padding: 3px 8px; border-radius: 999px; }
.conn-on         { color: var(--green); background: var(--green-lt); }
.conn-off        { color: var(--text-mid); text-decoration: none; }
.conn-off:hover  { color: var(--indigo); }
.conn-off strong { color: var(--indigo); }

/* Competitor bar chart */
.comp-chart          { display: flex; flex-direction: column; gap: 8px; }
.comp-chart-row      { display: flex; align-items: center; gap: 10px; }
.comp-chart-label    { width: 120px; font-size: .8rem; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.comp-chart-bar-wrap { flex: 1; height: 20px; background: var(--mist); border-radius: 4px; overflow: hidden; }
.comp-chart-bar      { height: 100%; border-radius: 4px; min-width: 2px; transition: width .3s ease; }
.comp-chart-score    { width: 36px; font-size: .8rem; font-weight: 700; text-align: right; font-variant-numeric: tabular-nums; }

/* Extra pill variants */
.pill-primary { background: var(--primary-xlt); color: var(--primary); }
.pill-sky     { background: var(--sky-lt); color: var(--sky); }
.pill-grey    { background: var(--mist); color: var(--text-muted); }

/* Responsive */
@media (max-width: 900px) {
  .grid-3 { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 480px) {
  .grid-3 { grid-template-columns: 1fr; }
}

/* ═══════════════════════════════════════════════════════════════
   COMPETITOR INTELLIGENCE — Package 015
   Animated side-by-side comparison, gap tables, opportunities
═══════════════════════════════════════════════════════════════ */

/* ── Score rings strip (top of page) ────────────────────────── */
.comp-scores-strip {
  display: flex; gap: 16px; flex-wrap: wrap;
  margin-bottom: 20px;
}
.comp-scores-tile {
  flex: 1; min-width: 100px; max-width: 160px;
  display: flex; flex-direction: column; align-items: center;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 16px 8px 12px;
  transition: box-shadow .2s, transform .2s;
}
.comp-scores-tile:hover { box-shadow: 0 4px 16px rgba(0,0,0,.08); transform: translateY(-2px); }
.comp-score-ring {
  position: relative; width: 64px; height: 64px; margin-bottom: 8px;
}
.comp-score-ring svg { width: 64px; height: 64px; transform: rotate(-90deg); }
.ring-bg   { fill: none; stroke: var(--border); stroke-width: 5; }
.ring-fill {
  fill: none; stroke-width: 5; stroke-linecap: round;
  stroke-dasharray: 0 150.8;
  transition: stroke-dasharray .9s cubic-bezier(.4,0,.2,1);
}
.ring-label {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: .95rem; font-weight: 700; color: var(--text);
}
.comp-scores-tile-name { font-size: .72rem; font-weight: 700; color: var(--text); }
.comp-scores-tile-sub  { font-size: .65rem; color: var(--text-muted); }

/* ── Competitor card ─────────────────────────────────────────── */
.comp-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 20px;
  margin-bottom: 16px;
  animation: compCardIn .35s ease both;
}
@keyframes compCardIn {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}
.comp-card-header {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 12px; flex-wrap: wrap; margin-bottom: 18px;
}
.comp-card-meta    { flex: 1; min-width: 0; }
.comp-card-name    { font-size: .95rem; font-weight: 700; color: var(--text); }
.comp-card-url     { font-size: .72rem; color: var(--text-muted); margin-top: 2px; word-break: break-all; }

/* ── Gap badge ───────────────────────────────────────────────── */
.gap-badge {
  display: inline-block; padding: 3px 10px;
  border-radius: var(--radius-pill);
  font-size: .75rem; font-weight: 700; white-space: nowrap;
}
.gap-ahead  { background: var(--c-fail-bg); color: var(--c-fail-fg); }
.gap-behind { background: var(--c-pass-bg); color: var(--c-pass-fg); }
.gap-tied   { background: var(--mist); color: var(--text-muted); }

/* ── Dimension bar comparison ────────────────────────────────── */
.comp-dims {
  display: flex; flex-direction: column; gap: 8px;
  margin-bottom: 16px;
}
.comp-dim-row {
  display: flex; align-items: center; gap: 10px;
}
.comp-dim-label {
  width: 44px; font-size: .72rem; font-weight: 700; color: var(--text-muted); flex-shrink: 0;
}
.comp-dim-bars {
  flex: 1; display: flex; flex-direction: column; gap: 3px;
}
.comp-dim-bar-wrap {
  height: 10px; background: var(--mist); border-radius: 99px; overflow: hidden;
}
.comp-dim-bar {
  height: 100%; border-radius: 99px; min-width: 2px;
  width: 0%;
  transition: width .75s cubic-bezier(.4,0,.2,1);
}
.comp-dim-bar--you  { background: var(--primary); }
.comp-dim-bar--them { background: var(--slate-3, #94a3b8); }
.comp-dim-scores {
  display: flex; align-items: center; gap: 4px;
  font-size: .78rem; font-weight: 700; flex-shrink: 0; min-width: 72px;
}

/* ── Meta row (sparkline + projected) ───────────────────────── */
.comp-meta-row {
  display: flex; gap: 20px; flex-wrap: wrap;
  align-items: center; margin-bottom: 16px;
}
.comp-sparkline-wrap { display: flex; flex-direction: column; }
.comp-sparkline { display: block; width: 120px; height: 36px; }
.comp-projected {
  display: flex; flex-direction: column; gap: 2px;
  background: var(--primary-xlt); border-radius: var(--radius-sm);
  padding: 8px 12px;
}
.comp-projected-label  { font-size: .7rem; color: var(--text-muted); }
.comp-projected-val    { display: flex; align-items: center; gap: 6px; }
.comp-projected-current { font-size: 1rem; font-weight: 600; color: var(--text-muted); }
.comp-projected-arrow  { color: var(--text-muted); font-size: .85rem; }
.comp-projected-target {
  font-size: 1.1rem; font-weight: 700; color: var(--primary);
  animation: pulseNum .6s ease .8s both;
}
@keyframes pulseNum {
  0%   { transform: scale(.8); opacity: .4; }
  60%  { transform: scale(1.1); }
  100% { transform: scale(1); opacity: 1; }
}

/* ── No-detail prompt ────────────────────────────────────────── */
.comp-no-detail {
  display: flex; align-items: center; gap: 8px;
  padding: 12px 14px; background: var(--mist);
  border-radius: var(--radius-sm); font-size: .82rem; color: var(--text-muted);
  border: 1px dashed var(--border);
}

/* ── Section title (within card) ────────────────────────────── */
.comp-section-title {
  display: flex; align-items: center; gap: 6px;
  font-size: .8rem; font-weight: 700; color: var(--text);
  margin-bottom: 10px; margin-top: 4px;
}

/* ── Opportunities list ──────────────────────────────────────── */
.opp-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 16px; }
.opp-item {
  padding: 10px 14px; border-radius: var(--radius-sm);
  border-left: 3px solid var(--border);
  background: var(--surface-2);
  animation: oppIn .3s ease both;
}
@keyframes oppIn {
  from { opacity: 0; transform: translateX(-6px); }
  to   { opacity: 1; transform: translateX(0); }
}
.opp-item-top {
  display: flex; align-items: center; justify-content: space-between;
  gap: 8px; flex-wrap: wrap; margin-bottom: 4px;
}
.opp-title { font-size: .82rem; font-weight: 600; color: var(--text); }
.opp-body  { font-size: .78rem; color: var(--text-muted); line-height: 1.5; }
.opp-impact {
  display: inline-block; padding: 2px 8px; border-radius: var(--radius-pill);
  font-size: .68rem; font-weight: 700; white-space: nowrap; flex-shrink: 0;
}
.opp-impact--high { background: var(--c-fail-bg); color: var(--c-fail-fg); }
.opp-impact--mid  { background: var(--c-warn-bg); color: var(--c-warn-fg); }
.opp-impact--low  { background: var(--mist); color: var(--text-muted); }

/* ── Collapsible check details ───────────────────────────────── */
.comp-checks-details { margin-top: 4px; }
.comp-checks-details[open] > .comp-checks-summary { margin-bottom: 12px; }
.comp-checks-summary {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  padding: 10px 0; font-size: .82rem; font-weight: 600; color: var(--text);
  cursor: pointer; list-style: none; user-select: none;
}
.comp-checks-summary::-webkit-details-marker { display: none; }
.comp-checks-summary svg {
  flex-shrink: 0; color: var(--text-muted);
  transition: transform .2s ease;
}
.comp-checks-badge {
  display: inline-block; padding: 2px 7px; border-radius: var(--radius-pill);
  font-size: .66rem; font-weight: 700;
}
.comp-checks-badge--lose { background: var(--c-fail-bg); color: var(--c-fail-fg); }
.comp-checks-badge--win  { background: var(--c-pass-bg); color: var(--c-pass-fg); }
.comp-checks-section {
  font-size: .72rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .06em; color: var(--text-muted); margin-bottom: 8px;
}

/* ── Gap table ───────────────────────────────────────────────── */
.gap-tbl-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; margin-bottom: 4px; }
.gap-tbl {
  width: 100%; border-collapse: collapse; font-size: .8rem;
}
.gap-tbl th {
  text-align: left; padding: 7px 10px;
  font-size: .68rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .05em; color: var(--text-muted);
  border-bottom: 1px solid var(--border);
  background: var(--mist); white-space: nowrap;
}
.gap-tbl td { padding: 8px 10px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.gap-tbl tr:last-child td { border-bottom: none; }
.gap-row--lose { background: rgba(220,38,38,.03); }
.gap-row--win  { background: rgba(51,199,88,.03); }
.gap-row--tie  { }
.gap-row:hover td { background: var(--mist); }
.gap-name { font-weight: 500; color: var(--text); min-width: 140px; }
.gap-fix  { font-size: .76rem; color: var(--text-muted); line-height: 1.4; min-width: 180px; max-width: 300px; }

/* ── Check pass/fail indicators ─────────────────────────────── */
.check-pass { color: var(--mint); font-weight: 700; font-size: .9rem; }
.check-fail { color: var(--red);  font-weight: 700; font-size: .9rem; }

/* ── Legend ──────────────────────────────────────────────────── */
.comp-legend {
  display: flex; gap: 16px; flex-wrap: wrap;
  font-size: .75rem; color: var(--text-muted);
  padding: 12px 0; margin-top: 4px; align-items: center;
}
.comp-legend-item { display: flex; align-items: center; gap: 4px; }

/* ── Responsive ──────────────────────────────────────────────── */
@media (max-width: 700px) {
  .comp-scores-strip     { gap: 8px; }
  .comp-scores-tile      { min-width: 80px; max-width: 110px; padding: 12px 6px 10px; }
  .comp-score-ring       { width: 52px; height: 52px; }
  .comp-score-ring svg   { width: 52px; height: 52px; }
  .comp-scores-tile-name { font-size: .65rem; }
  .comp-card             { padding: 14px; }
  .comp-dim-label        { width: 36px; }
  .gap-tbl               { font-size: .74rem; }
  .gap-fix               { min-width: 120px; max-width: 200px; }
}
@media (max-width: 480px) {
  .comp-scores-strip { justify-content: center; }
  .comp-dim-scores   { display: none; }
}


/* == Priority Matrix ================================================ */
.priority-matrix-section { margin-top: 32px; }
.priority-matrix-wrap    { overflow-x: auto; }
.priority-matrix-table   { width: 100%; border-collapse: collapse; font-size: .8rem; }
.priority-matrix-table th {
  background: var(--slate-1); color: var(--text-mid);
  font-weight: 600; font-size: .72rem; text-transform: uppercase;
  letter-spacing: .04em; padding: 8px 12px; text-align: left;
  border-bottom: 2px solid var(--slate-2);
}
.priority-matrix-table td { padding: 9px 12px; border-bottom: 1px solid var(--slate-1); vertical-align: middle; }
.priority-matrix-table tr:hover td { background: var(--off-white); }
.pm-check-name  { font-weight: 600; max-width: 180px; }
.pm-fix         { color: var(--text-mid); font-size: .77rem; max-width: 260px; }
.pm-bar-wrap    { position: relative; background: var(--slate-1); border-radius: 4px; height: 16px; min-width: 90px; }
.pm-bar         { position: absolute; left: 0; top: 0; height: 100%; background: var(--indigo); border-radius: 4px; transition: width .6s ease; }
.pm-bar-label   { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); font-size: .68rem; font-weight: 600; color: var(--text); }
.pm-priority    { display: inline-block; padding: 2px 8px; border-radius: 20px; font-size: .68rem; font-weight: 700; }
.pm-high        { background: var(--red-lt);    color: var(--red); }
.pm-mid         { background: var(--amber-lt);  color: var(--amber); }
.pm-low         { background: var(--green-lt);  color: var(--green); }

/* == Industry Benchmark ============================================= */
.bm-section { margin-top: 32px; }
.bm-card    { display: flex; gap: 24px; flex-wrap: wrap; padding: 20px 24px; background: var(--white); border: 1px solid var(--slate-2); border-radius: var(--radius); }
.bm-stat    { display: flex; flex-direction: column; gap: 4px; min-width: 120px; }
.bm-stat-label { font-size: .72rem; color: var(--text-mid); text-transform: uppercase; letter-spacing: .04em; }
.bm-stat-value { font-size: 1.8rem; font-weight: 800; color: var(--text); line-height: 1; }

/* == AI Battle Plan ================================================= */
.battle-plan-section { margin-top: 32px; background: var(--white); border: 1px solid var(--slate-2); border-radius: var(--radius); padding: 24px 28px; }
.battle-plan-header  { display: flex; gap: 16px; align-items: flex-start; justify-content: space-between; flex-wrap: wrap; margin-bottom: 16px; }
.battle-plan-body    { border-top: 1px solid var(--slate-1); padding-top: 16px; }
.battle-plan-pre {
  white-space: pre-wrap; word-break: break-word;
  font-family: inherit; font-size: .82rem; line-height: 1.65;
  color: var(--text); margin: 0; padding: 0;
}
.battle-plan-empty   { padding: 28px 0; text-align: center; color: var(--text-mid); }
.battle-plan-empty p { margin: 0 0 4px; }

/* == Insights section headings ====================================== */
.insights-section-title { font-size: 1rem; font-weight: 700; color: var(--text); margin: 0 0 12px; }
.insights-section-sub   { display: block; font-size: .72rem; font-weight: 400; color: var(--text-mid); margin-top: 2px; }

.insights-section { margin-top: 32px; }

/* == Admin Dashboard (Package 016) ================================== */
.kpi-grid          { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px,1fr)); gap: 14px; }
.kpi-card          { background: var(--white); border: 1px solid var(--slate-2); border-radius: var(--radius); padding: 18px 20px; }
.kpi-card--accent  { border-color: var(--amber); background: var(--amber-lt); }
.kpi-num           { font-size: 2rem; font-weight: 800; color: var(--text); line-height: 1; margin-bottom: 4px; }
.kpi-label         { font-size: .8rem; font-weight: 600; color: var(--text); }
.kpi-sub           { font-size: .72rem; color: var(--text-mid); margin-top: 2px; }
.kpi-sub a         { color: var(--indigo); text-decoration: none; }

.detail-grid  { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px,1fr)); gap: 12px; }
.detail-card  { background: var(--white); border: 1px solid var(--slate-2); border-radius: var(--radius-sm); padding: 12px 16px; }
.detail-label { font-size: .7rem; font-weight: 600; color: var(--text-mid); text-transform: uppercase; letter-spacing: .04em; margin-bottom: 4px; }
.detail-value { font-size: .88rem; font-weight: 600; color: var(--text); }

/* Impersonation banner */
.impersonation-banner {
    display: flex; align-items: center; gap: 8px;
    background: var(--amber-lt); border: 1px solid var(--amber);
    border-radius: var(--radius-sm); padding: 10px 16px;
    font-size: .82rem; color: var(--text); margin-bottom: 20px;
}
.impersonation-banner svg { flex-shrink: 0; color: var(--amber); }
.impersonation-stop {
    background: var(--amber); color: var(--white); border: none;
    border-radius: var(--radius-sm); padding: 4px 12px;
    font-size: .78rem; font-weight: 600; cursor: pointer;
}
.impersonation-stop:hover { opacity: .85; }

/* Admin sub-nav */
.nav-sub      { display: flex; flex-direction: column; gap: 2px; margin-bottom: 4px; }
.nav-sub-item { font-size: .78rem; color: var(--text-mid); padding: 4px 8px; border-radius: var(--radius-sm); text-decoration: none; }
.nav-sub-item:hover { background: var(--slate-1); color: var(--text); }

/* Tab row (used in Audits view) */
.tab-row     { display: flex; gap: 4px; }
.tab-btn     { padding: 6px 14px; font-size: .9rem; font-weight: 500; border-radius: 20px; text-decoration: none; color: var(--text-mid); background: transparent; border: 1px solid transparent; }
.tab-btn:hover        { background: var(--slate-1); color: var(--text); }
.tab-btn--active      { background: var(--indigo); color: var(--white); border-color: var(--indigo); }

/* Badge variants */
.badge         { display: inline-block; padding: 2px 8px; border-radius: 20px; font-size: .7rem; font-weight: 600; }
.badge--indigo { background: var(--indigo-lt); color: var(--indigo); }
.badge--green  { background: var(--green-lt);  color: var(--green); }
.badge--slate  { background: var(--slate-2);   color: var(--text-mid); }

/* Back link */
.back-link     { font-size: .8rem; color: var(--text-mid); text-decoration: none; display: inline-block; margin-bottom: 6px; }
.back-link:hover { color: var(--text); }

/* Danger button variant */
.btn--danger   { background: var(--red); color: var(--white); }
.btn--danger:hover { opacity: .85; }

/* ── Priority Fix Plan ──────────────────────────────────────────────── */
.fixplan-panel  { background: var(--white); border: 1.5px solid var(--amber); border-radius: var(--radius); margin: 0 0 20px; overflow: hidden; }
.fixplan-summary { display: flex; align-items: center; gap: 10px; padding: 14px 18px; cursor: pointer; user-select: none; font-weight: 700; font-size: .95rem; color: var(--text); list-style: none; }
.fixplan-summary::-webkit-details-marker { display: none; }
.fixplan-summary::before { content: '▾'; font-size: .7rem; color: var(--amber); transition: transform .2s; }
details.fixplan-panel:not([open]) .fixplan-summary::before { transform: rotate(-90deg); }
.fixplan-icon   { font-size: 1.1rem; }
.fixplan-count  { margin-left: auto; background: var(--amber); color: var(--white); border-radius: 20px; padding: 2px 10px; font-size: .72rem; font-weight: 700; }
.fixplan-body   { padding: 0 18px 18px; border-top: 1px solid var(--amber-lt); }
.fixplan-intro  { font-size: .8rem; color: var(--text-mid); margin: 12px 0 14px; }
.fixplan-list   { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 10px; }
.fixplan-item   { background: var(--off-white); border-radius: var(--radius-sm); padding: 12px 14px; }
.fixplan-item-header { display: flex; align-items: center; gap: 8px; margin-bottom: 5px; }
.fixplan-num    { background: var(--navy); color: var(--white); border-radius: 50%; width: 22px; height: 22px; display: inline-flex; align-items: center; justify-content: center; font-size: .7rem; font-weight: 800; flex-shrink: 0; }
.fixplan-section-tag { font-size: .65rem; font-weight: 700; padding: 2px 7px; border-radius: 20px; background: var(--slate-1); color: var(--text-mid); white-space: nowrap; }
.fixplan-name   { font-size: .88rem; color: var(--text); }
.fixplan-detail { font-size: .78rem; color: var(--text-mid); margin-bottom: 6px; }
.fixplan-fix    { font-size: .8rem; color: var(--text); background: var(--white); border-left: 3px solid var(--amber); padding: 7px 10px; border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }
.fixplan-arrow  { color: var(--amber); font-weight: 700; margin-right: 4px; }
.fixplan-snippet { margin-top: 8px; }
.btn--xs       { padding: 3px 10px; font-size: .75rem; }

/* ── Reputation Result page ─────────────────────────────────────────── */
.rep-result-hero { display: flex; align-items: center; gap: 28px; background: var(--white); border-radius: var(--radius); padding: 24px 28px; margin-bottom: 20px; border: 1px solid var(--slate-1); flex-wrap: wrap; }
.rep-result-score-ring { position: relative; flex-shrink: 0; }
.rep-result-score-inner { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.rep-result-score-num  { font-size: 1.6rem; font-weight: 800; line-height: 1; color: var(--text); }
.rep-result-score-label { font-size: .65rem; font-weight: 700; color: var(--text-mid); text-transform: uppercase; letter-spacing: .04em; margin-top: 2px; }
.rep-result-kpis { display: flex; gap: 14px; flex-wrap: wrap; flex: 1; }
.rep-kpi-card   { background: var(--off-white); border-radius: var(--radius-sm); padding: 14px 18px; min-width: 110px; display: flex; flex-direction: column; gap: 3px; }
.rep-kpi-val    { font-size: 1.3rem; font-weight: 800; color: var(--text); line-height: 1; }
.rep-kpi-lbl    { font-size: .7rem; color: var(--text-mid); font-weight: 600; text-transform: uppercase; letter-spacing: .03em; }
.rep-star       { color: var(--amber); font-size: .9em; }

.rep-sentiment-card { margin-bottom: 20px; }
.rep-sent-bar-wrap  { display: flex; height: 20px; border-radius: 10px; overflow: hidden; margin: 10px 0 8px; gap: 2px; }
.rep-sent-seg   { display: flex; align-items: center; justify-content: center; font-size: .65rem; font-weight: 700; color: var(--white); transition: width .4s; min-width: 24px; }
.rep-sent-pos   { background: var(--green); border-radius: 10px 0 0 10px; }
.rep-sent-neu   { background: var(--amber); }
.rep-sent-neg   { background: var(--red); border-radius: 0 10px 10px 0; }
.rep-sent-legend { display: flex; gap: 16px; font-size: .75rem; color: var(--text-mid); margin-bottom: 14px; flex-wrap: wrap; }
.rep-sent-dot   { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 4px; vertical-align: middle; }
.rep-sent-pos-dot { background: var(--green); }
.rep-sent-neu-dot { background: var(--amber); }
.rep-sent-neg-dot { background: var(--red); }
.rep-themes-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 6px; }
.rep-themes-col  { display: flex; flex-direction: column; gap: 6px; }
.rep-themes-title { font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; margin-bottom: 4px; }
.rep-themes-pos  { color: var(--green); }
.rep-themes-neg  { color: var(--red); }
.rep-theme-chip  { display: inline-block; border-radius: 20px; padding: 3px 10px; font-size: .73rem; font-weight: 600; margin-right: 4px; margin-bottom: 4px; }
.rep-theme-pos   { background: var(--green-lt); color: var(--green); }
.rep-theme-neg   { background: var(--red-lt); color: var(--red); }

.rep-platform-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 16px; margin-bottom: 28px; }
.rep-plat-card  { background: var(--white); border: 1px solid var(--slate-1); border-radius: var(--radius); padding: 18px 20px; }
.rep-plat-disconnected { opacity: .7; }
.rep-plat-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.rep-plat-name  { font-size: .95rem; font-weight: 700; color: var(--text); }
.rep-plat-badge { font-size: .62rem; font-weight: 700; border-radius: 20px; padding: 2px 8px; text-transform: uppercase; letter-spacing: .03em; }
.rep-plat-badge-on  { background: var(--green-lt); color: var(--green); }
.rep-plat-badge-off { background: var(--slate-1); color: var(--text-mid); }
.rep-plat-rating-row { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.rep-plat-rating-val { font-size: 1.4rem; font-weight: 800; color: var(--text); }
.rep-plat-stars { display: flex; gap: 1px; }
.rep-star-filled { color: var(--amber); font-size: .85rem; }
.rep-star-empty  { color: var(--slate-1); font-size: .85rem; }
.rep-plat-count  { font-size: .75rem; color: var(--text-mid); margin-left: auto; }
.rep-plat-bar   { height: 5px; background: var(--slate-1); border-radius: 3px; margin-bottom: 14px; overflow: hidden; }
.rep-plat-bar-fill { height: 100%; background: var(--amber); border-radius: 3px; }
.rep-plat-disconnected-msg { font-size: .78rem; color: var(--text-mid); font-style: italic; }
.rep-plat-empty  { font-size: .78rem; color: var(--text-mid); }

.rep-reviews-list { display: flex; flex-direction: column; gap: 10px; }
.rep-review-item { border-radius: var(--radius-sm); padding: 10px 12px; border-left: 3px solid var(--slate-1); background: var(--off-white); }
.rep-review-pos  { border-left-color: var(--green); }
.rep-review-neg  { border-left-color: var(--red); }
.rep-review-neu  { border-left-color: var(--amber); }
.rep-review-meta { display: flex; align-items: center; gap: 8px; margin-bottom: 5px; flex-wrap: wrap; }
.rep-review-author { font-size: .8rem; font-weight: 700; color: var(--text); }
.rep-review-date   { font-size: .72rem; color: var(--text-mid); }
.rep-review-stars  { display: flex; gap: 1px; margin-left: auto; }
.rep-review-text   { font-size: .78rem; color: var(--text-mid); margin: 0; line-height: 1.5; }
.rep-owner-reply   { margin-top: 8px; background: var(--white); border-radius: var(--radius-sm); padding: 7px 10px; }
.rep-reply-badge   { font-size: .62rem; font-weight: 700; text-transform: uppercase; color: var(--indigo); background: var(--indigo-lt); border-radius: 20px; padding: 1px 7px; display: inline-block; margin-bottom: 4px; }
.rep-reply-text    { font-size: .76rem; color: var(--text-mid); margin: 0; line-height: 1.5; }
.rep-more-reviews  { font-size: .73rem; color: var(--text-mid); text-align: center; margin: 4px 0 0; }

/* ── Shared card/section helpers ────────────────────────────────────────── */
.card-section-title { font-size: .9rem; font-weight: 700; color: var(--text); margin: 0 0 14px; }
.section-heading    { font-size: 1rem; font-weight: 700; color: var(--text); margin: 24px 0 12px; }

/* ── Score page — audit run history section ─────────────────────────────── */
.sc-section        { background: var(--white); border: 1px solid var(--slate-1); border-radius: var(--radius); padding: 20px 22px; margin-bottom: 24px; }
.sc-section-title  { font-size: .95rem; font-weight: 700; color: var(--text); margin: 0 0 4px; }
.sc-section-sub    { font-size: .78rem; color: var(--text-mid); margin: 0 0 14px; }
.sc-run-link       { font-size: .75rem; font-weight: 600; color: var(--indigo); text-decoration: none; white-space: nowrap; }
.sc-run-link:hover { text-decoration: underline; }

/* ════════════════════════════════════════════════════════════════════════════
   ANIMATED SCORE RINGS  (SVG stroke-dashoffset draw-on)
   ════════════════════════════════════════════════════════════════════════════ */
.score-ring-wrap      { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.score-ring-svg       { transform: rotate(-90deg); }
.score-ring-track     { fill: none; stroke: var(--slate-2); }
.score-ring-fill      { fill: none; stroke-linecap: round; transition: stroke-dashoffset 1.2s cubic-bezier(.4,0,.2,1); }
.score-ring-label     { font-size: .72rem; font-weight: 600; color: var(--text-mid); text-transform: uppercase; letter-spacing: .05em; text-align: center; }
.score-ring-value     { font-size: 1.6rem; font-weight: 800; color: var(--text); line-height: 1; }
.score-ring-sub       { font-size: .68rem; color: var(--text-mid); }
.score-ring-fill--total  { stroke: var(--indigo); }
.score-ring-fill--seo    { stroke: var(--navy); }
.score-ring-fill--aeo    { stroke: var(--indigo); }
.score-ring-fill--geo    { stroke: var(--green); }
.score-ring-fill--aio    { stroke: var(--amber); }
.score-rings-hero { display: flex; gap: 24px; justify-content: center; flex-wrap: wrap; margin: 24px 0; }

/* ════════════════════════════════════════════════════════════════════════════
   SKELETON LOADERS  (pulse shimmer during audit-in-progress)
   ════════════════════════════════════════════════════════════════════════════ */
@keyframes skeleton-pulse {
  0%,100% { opacity: 1; }
  50%      { opacity: .45; }
}
.skeleton {
  background: var(--slate-2);
  border-radius: var(--radius-sm);
  animation: skeleton-pulse 1.6s ease-in-out infinite;
}
.skeleton-text  { height: 14px; border-radius: 4px; }
.skeleton-title { height: 22px; border-radius: 4px; width: 55%; }
.skeleton-ring  { width: 88px; height: 88px; border-radius: 50%; }
.skeleton-card  { height: 110px; border-radius: var(--radius); }
.skeleton-line  { height: 10px; border-radius: 4px; }
.skeleton-short { width: 40%; }
.skeleton-mid   { width: 65%; }
.score-skeleton-panel { display: flex; gap: 20px; justify-content: center; flex-wrap: wrap; margin: 24px 0; }
.score-skeleton-item  { display: flex; flex-direction: column; align-items: center; gap: 10px; }

/* ════════════════════════════════════════════════════════════════════════════
   RADAR CHART  (ECharts)
   ════════════════════════════════════════════════════════════════════════════ */
.radar-chart-wrap {
  background: var(--white); border: 1px solid var(--slate-1);
  border-radius: var(--radius); padding: 20px;
  margin-bottom: 24px;
}
.radar-chart-title { font-size: .88rem; font-weight: 700; color: var(--navy); margin: 0 0 4px; }
.radar-chart-sub   { font-size: .75rem; color: var(--text-mid); margin: 0 0 16px; }

/* Score breakdown bars */
.sbb-grid       { display: flex; flex-direction: column; gap: 14px; }
.sbb-row        { display: grid; grid-template-columns: 130px 1fr 36px; align-items: center; gap: 12px; }
.sbb-label-col  { display: flex; flex-direction: column; gap: 1px; }
.sbb-tag        { font-size: .72rem; font-weight: 700; color: var(--navy); text-transform: uppercase; letter-spacing: .04em; }
.sbb-sub        { font-size: .68rem; color: var(--text-mid); }
.sbb-track      { height: 10px; background: var(--slate-1); border-radius: 99px; overflow: hidden; }
.sbb-fill       { height: 100%; border-radius: 99px; transition: width .6s ease; }
.sbb-fill--locked { background: var(--slate-2); }
.sbb-value      { font-size: .78rem; font-weight: 700; color: var(--navy); text-align: right; }

/* ════════════════════════════════════════════════════════════════════════════
   MOTION ONE CARD REVEALS
   ════════════════════════════════════════════════════════════════════════════ */
.will-animate { opacity: 0; transform: translateY(18px); }
.will-animate.animated { opacity: 1; transform: translateY(0); transition: opacity .45s ease, transform .45s ease; }

@media (prefers-reduced-motion: reduce) {
  .will-animate, .will-animate.animated { opacity: 1; transform: none; transition: none; }
  .score-ring-fill { transition: none; }
  .skeleton { animation: none; }
}

/* ════════════════════════════════════════════════════════════════════════════
   ADMIN / ASK PAGE — missing component classes
   ════════════════════════════════════════════════════════════════════════════ */

/* btn-- variants (double-dash convention used by admin views) */
.btn--ghost   { background: transparent; color: var(--text); border: 1px solid var(--border); }
.btn--ghost:hover { background: var(--mist); text-decoration: none; }
.btn--primary { background: var(--primary); color: #fff; }
.btn--primary:hover { background: var(--primary-dark); color: #fff; text-decoration: none; }
.btn--indigo  { background: var(--indigo); color: #fff; }
.btn--indigo:hover { opacity: .88; color: #fff; text-decoration: none; }
.btn--sm      { padding: 6px 14px; font-size: 13px; }
.btn--xs      { padding: 3px 10px; font-size: .75rem; }
.btn--danger  { background: var(--red); color: #fff; }
.btn--danger:hover { opacity: .85; color: #fff; }

/* Status chips */
.status-chip          { display: inline-block; padding: 2px 10px; border-radius: 20px; font-size: .72rem; font-weight: 600; background: var(--slate-1); color: var(--text-mid); }
.status-chip--complete { background: var(--green-lt); color: var(--green); }
.status-chip--failed   { background: var(--red-lt); color: var(--red); }
.status-chip--running  { background: var(--amber-lt); color: var(--amber); }
.status-chip--queued   { background: var(--indigo-lt); color: var(--indigo); }

/* Page header actions bar */
.page-header-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

/* Ask AI page — category header */
.ask-cat-section  { margin-bottom: 28px; }
.ask-cat-header   { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.ask-cat-icon     { font-size: 1rem; line-height: 1; }
.ask-cat-label    { font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; color: var(--text-mid); }

/* Ask AI page — question grid */
.ask-question-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px,1fr)); gap: 10px; }
.ask-q-card {
    display: flex; align-items: flex-start; justify-content: space-between; gap: 12px;
    background: var(--white); border: 1px solid var(--slate-2); border-radius: var(--radius-sm);
    padding: 16px 18px; text-align: left; cursor: pointer; width: 100%;
    font-family: var(--font-body); font-size: .875rem; color: var(--text);
    transition: border-color .15s, background .15s, box-shadow .15s; line-height: 1.5;
    box-shadow: 0 1px 3px rgba(0,0,0,.04);
}
.ask-q-card:hover { border-color: var(--indigo); background: rgba(99,102,241,.03); box-shadow: 0 2px 8px rgba(99,102,241,.12); }
.ask-q-text { flex: 1; }
.ask-q-arrow-wrap {
    flex-shrink: 0; width: 26px; height: 26px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    background: var(--slate-1); color: var(--text-mid);
    transition: background .15s, color .15s;
    margin-top: 1px;
}
.ask-q-card:hover .ask-q-arrow-wrap { background: var(--indigo); color: var(--white); }
.ask-q-card--disabled {
    opacity: .5; cursor: not-allowed; pointer-events: none;
    background: var(--off-white); border-color: var(--slate-2);
    flex-direction: column; gap: 6px;
}
.ask-q-missing {
    font-size: .72rem; color: var(--text-mid); font-weight: 500;
    background: var(--slate-1); border-radius: 4px; padding: 2px 8px;
    display: inline-block; margin-top: 2px;
}

/* Tom Select overrides */
.ts-wrapper.form-control { padding: 0; }
.ts-control { border: none !important; box-shadow: none !important; padding: 7px 12px !important; min-height: 0 !important; background: transparent !important; }
.ts-dropdown { border: 1px solid var(--border); border-radius: var(--radius-sm); box-shadow: var(--shadow); z-index: 9999; }
.ts-dropdown .option { padding: 8px 12px; font-size: .85rem; }
.ts-dropdown .option:hover, .ts-dropdown .option.active { background: var(--mist); color: var(--text); }
.ts-dropdown input { padding: 8px 12px; border-bottom: 1px solid var(--border); font-size: .85rem; width: 100%; outline: none; }

/* Admin mobile */
@media (max-width: 768px) {
    .page-header-actions { width: 100%; }
    .page-header-actions .btn,
    .page-header-actions .btn--ghost { flex: 1; justify-content: center; min-width: 0; }
    .kpi-grid { grid-template-columns: 1fr 1fr; }
    .section-header { flex-direction: column; align-items: flex-start !important; }
    .section-header form { width: 100%; margin-left: 0 !important; flex-direction: column; }
    .section-header form input { width: 100% !important; }
    .section-header form .btn,
    .section-header form .btn--primary { width: 100%; justify-content: center; }
}
@media (max-width: 480px) {
    .kpi-grid { grid-template-columns: 1fr; }
    .ask-question-grid { grid-template-columns: 1fr; }
    .ask-q-card { padding: 13px 14px; font-size: .83rem; }
}

/* ════════════════════════════════════════════════════════════════════════════
   AIV RENDER-SPEC BLOCKS  (Agent answer rendering)
   ════════════════════════════════════════════════════════════════════════════ */
@keyframes aivFadeUp {
    from { opacity: 0; transform: translateY(14px); }
    to   { opacity: 1; transform: translateY(0); }
}

.aiv-spec { }

.aiv-headline {
    font-size: 1.25rem; font-weight: 800; color: var(--text);
    margin: 0 0 8px; line-height: 1.3;
}
.aiv-summary {
    font-size: .92rem; color: var(--text-mid); margin: 0 0 20px; line-height: 1.6;
}

/* anime.js animates blocks in once rendered. The CSS keyframe stays as the
   fallback for when the motion library is unavailable, so content is never
   left invisible. */
.aiv-block {
    margin-bottom: 20px;
    animation: aivFadeUp .38s ease-out both;
    animation-delay: calc(var(--i, 0) * 70ms);
}
.aiv-block[data-revealed] { animation: none; }

/* Block title (section heading above each block) */
.block-title {
    font-size: .78rem; font-weight: 700; text-transform: uppercase;
    letter-spacing: .06em; color: var(--text-mid);
    margin: 0 0 10px; display: flex; align-items: center; gap: 6px;
}
.block-title::before {
    content: ''; display: inline-block; width: 3px; height: 12px;
    background: var(--indigo); border-radius: 2px; flex-shrink: 0;
}

/* ── KPI row ── */
.aiv-kpi-row {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 12px;
}
.aiv-kpi-row .kpi-card {
    background: var(--white); border: 1px solid var(--slate-2);
    border-radius: var(--radius); padding: 16px 18px;
    transition: border-color .15s, box-shadow .15s;
}
.aiv-kpi-row .kpi-card:hover {
    border-color: var(--indigo); box-shadow: 0 0 0 3px var(--indigo-lt);
}
.aiv-kpi-row .kpi-card.score-good { border-top: 3px solid var(--green); }
.aiv-kpi-row .kpi-card.score-mid  { border-top: 3px solid var(--amber); }
.aiv-kpi-row .kpi-card.score-low  { border-top: 3px solid var(--red); }
.aiv-kpi-row .kpi-num  { font-size: 1.7rem; font-weight: 800; line-height: 1; margin-bottom: 4px; }
.aiv-kpi-row .kpi-label { font-size: .75rem; font-weight: 600; color: var(--text-mid); }
.aiv-kpi-row .kpi-sub        { font-size: .7rem; color: var(--text-mid); margin-top: 3px; }
.aiv-kpi-row .kpi-sub--up   { font-size: .7rem; color: var(--green); margin-top: 3px; font-weight: 600; }
.aiv-kpi-row .kpi-sub--down { font-size: .7rem; color: var(--red);   margin-top: 3px; font-weight: 600; }
.aiv-kpi-row .score-good .kpi-num { color: var(--green); }
.aiv-kpi-row .score-mid  .kpi-num { color: var(--amber); }
.aiv-kpi-row .score-low  .kpi-num { color: var(--red); }

/* ── Charts (ECharts, rendered by aiv-answer.js) ── */
.aiv-chart-wrap {
    background: var(--white); border: 1px solid var(--slate-2);
    border-radius: var(--radius); padding: 16px 20px;
    position: relative;
}
.aiv-chart { width: 100%; }
.block-subtitle {
    font-size: .78rem; color: var(--text-mid);
    margin: -4px 0 10px; line-height: 1.5;
}

/* ── Table ── */
.table-wrap {
    overflow-x: auto; -webkit-overflow-scrolling: touch;
    border: 1px solid var(--slate-2); border-radius: var(--radius);
    background: var(--white);
}
.aiv-data-table { width: 100%; border-collapse: collapse; font-size: .83rem; }
.aiv-data-table thead tr { background: var(--off-white); }
.aiv-data-table th {
    padding: 10px 14px; text-align: left;
    font-size: .7rem; font-weight: 700; text-transform: uppercase;
    letter-spacing: .05em; color: var(--text-mid);
    border-bottom: 2px solid var(--slate-2);
    white-space: nowrap; user-select: none;
    cursor: pointer; position: relative;
}
.aiv-data-table th:after {
    content: ' ⇅'; opacity: .3; font-size: .65rem;
}
.aiv-data-table th[data-dir="asc"]:after  { content: ' ↑'; opacity: .8; color: var(--indigo); }
.aiv-data-table th[data-dir="desc"]:after { content: ' ↓'; opacity: .8; color: var(--indigo); }
.aiv-data-table th:hover { color: var(--indigo); background: var(--indigo-lt); }
.aiv-data-table td {
    padding: 10px 14px; border-bottom: 1px solid var(--slate-2);
    color: var(--text); vertical-align: middle;
}
.aiv-data-table tr:last-child td { border-bottom: none; }
.aiv-data-table tbody tr:hover td { background: var(--indigo-lt); }

/* ── Recommendations ── */
.recs-list { display: flex; flex-direction: column; gap: 10px; }
.rec-card {
    display: flex; gap: 14px; padding: 14px 16px;
    border-radius: var(--radius); border: 1px solid var(--slate-2);
    background: var(--white); transition: border-color .15s, box-shadow .15s;
}
.rec-card:hover { border-color: var(--indigo); box-shadow: 0 0 0 3px var(--indigo-lt); }
.rec-card--good { border-left: 4px solid var(--green);  background: var(--green-lt);  border-color: var(--green); }
.rec-card--warn { border-left: 4px solid var(--amber);  background: var(--amber-lt);  border-color: var(--amber); }
.rec-card--bad  { border-left: 4px solid var(--red);    background: var(--red-lt);    border-color: var(--red); }
.rec-card--info { border-left: 4px solid var(--indigo); }
.rec-num {
    flex-shrink: 0; width: 26px; height: 26px; border-radius: 50%;
    background: var(--indigo); color: var(--white);
    display: flex; align-items: center; justify-content: center;
    font-size: .72rem; font-weight: 800; margin-top: 1px;
}
.rec-card--good .rec-num { background: var(--green); }
.rec-card--warn .rec-num { background: var(--amber); }
.rec-card--bad  .rec-num { background: var(--red); }
.rec-body { flex: 1; min-width: 0; }
.rec-title  { font-size: .88rem; font-weight: 700; color: var(--text); margin-bottom: 4px; }
.rec-detail { font-size: .8rem; color: var(--text-mid); line-height: 1.55; margin-bottom: 6px; }
.rec-meta   { display: flex; gap: 6px; flex-wrap: wrap; }

/* ── Callout ── */
.callout {
    border-radius: var(--radius); padding: 14px 16px;
    border: 1px solid var(--slate-2); border-left: 4px solid var(--indigo);
    background: var(--indigo-lt);
}
.callout--good { border-color: var(--green);  border-left-color: var(--green);  background: var(--green-lt);  }
.callout--warn { border-color: var(--amber);  border-left-color: var(--amber);  background: var(--amber-lt);  }
.callout--bad  { border-color: var(--red);    border-left-color: var(--red);    background: var(--red-lt);    }
.callout--info { border-color: var(--indigo); border-left-color: var(--indigo); background: var(--indigo-lt); }
.callout-title { font-size: .85rem; font-weight: 700; color: var(--text); margin-bottom: 5px; }
.callout p { font-size: .83rem; color: var(--text-mid); margin: 0; line-height: 1.55; }

/* ── Text block ── */
.aiv-text { font-size: .88rem; color: var(--text-mid); line-height: 1.65; margin: 0; }

/* ── Actions row ── */
.aiv-actions-row { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 4px; }

/* ── Sources / caveat ── */
.aiv-sources {
    display: flex; align-items: center; flex-wrap: wrap; gap: 6px;
    margin-top: 20px; padding-top: 12px; border-top: 1px solid var(--slate-2);
    font-size: .75rem;
}
.aiv-sources-label { color: var(--text-mid); font-weight: 600; margin-right: 2px; }
.aiv-caveat {
    margin-top: 12px; font-size: .75rem; color: var(--text-mid);
    font-style: italic; border-top: 1px solid var(--slate-2);
    padding-top: 10px; line-height: 1.5;
}


/* ═══════════════════════════════════════════════════════════════════
   Package 025 — Agent answer blocks
   Steps, comparison, connector gaps, markdown, and the data log.
   ═══════════════════════════════════════════════════════════════════ */

/* ── Shared chips ── */
.aiv-chip {
    display: inline-flex; align-items: center; gap: 4px;
    padding: 2px 9px; border-radius: 20px;
    font-size: .68rem; font-weight: 600; letter-spacing: .01em;
    border: 1px solid var(--slate-2); background: var(--slate-1); color: var(--text-mid);
    white-space: nowrap;
}
.aiv-chip--when          { border-color: var(--indigo); background: var(--indigo-lt); color: var(--indigo); }
.aiv-chip--impact-high   { border-color: var(--green);  background: var(--green-lt);  color: var(--green); }
.aiv-chip--impact-medium { border-color: var(--amber);  background: var(--amber-lt);  color: var(--amber); }
.aiv-chip--impact-low    { border-color: var(--slate-3); }
.aiv-chip--effort        { border-color: var(--slate-3); }

/* ── Markdown inside text and detail blocks ── */
.aiv-text { font-size: .9rem; color: var(--text); line-height: 1.65; }
.aiv-text p { margin: 0 0 10px; }
.aiv-text p:last-child { margin-bottom: 0; }
.aiv-text strong { font-weight: 700; color: var(--text); }
.aiv-text code,
.rec-detail code,
.aiv-step-detail code {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: .82em; padding: 1px 5px; border-radius: 4px;
    background: var(--slate-1); border: 1px solid var(--slate-2); color: var(--indigo);
}
.aiv-text a { color: var(--indigo); text-decoration: underline; text-underline-offset: 2px; }
.aiv-md-list { margin: 0 0 10px; padding-left: 20px; }
.aiv-md-list li { margin-bottom: 5px; line-height: 1.6; }
.aiv-md-list li:last-child { margin-bottom: 0; }

/* ── Steps: the ordered action plan ── */
.aiv-steps { list-style: none; margin: 0; padding: 0; position: relative; }
.aiv-step {
    display: flex; gap: 14px; padding: 0 0 18px 0;
    position: relative; opacity: 1;
}
/* Connector line running down through the markers */
.aiv-step:not(:last-child)::before {
    content: ''; position: absolute;
    left: 15px; top: 34px; bottom: 2px; width: 2px;
    background: linear-gradient(to bottom, var(--indigo), var(--slate-2));
    border-radius: 1px;
}
.aiv-step-marker { flex-shrink: 0; z-index: 1; }
.aiv-step-num {
    display: flex; align-items: center; justify-content: center;
    width: 32px; height: 32px; border-radius: 50%;
    background: var(--indigo); color: #fff;
    font-size: .82rem; font-weight: 800;
    box-shadow: 0 0 0 4px var(--indigo-lt);
}
.aiv-step-body {
    flex: 1; min-width: 0;
    background: var(--white); border: 1px solid var(--slate-2);
    border-radius: var(--radius); padding: 13px 16px;
    transition: border-color .15s, box-shadow .15s;
}
.aiv-step-body:hover { border-color: var(--indigo); box-shadow: 0 0 0 3px var(--indigo-lt); }
.aiv-step-title  { font-size: .9rem; font-weight: 700; color: var(--text); line-height: 1.45; }
.aiv-step-detail { font-size: .82rem; color: var(--text-mid); line-height: 1.6; margin-top: 5px; }
.aiv-step-detail p { margin: 0 0 6px; }
.aiv-step-detail p:last-child { margin-bottom: 0; }
.aiv-step-meta   { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 9px; }

/* ── Comparison: two periods side by side ── */
.aiv-comparison {
    display: grid; grid-template-columns: 1fr auto 1fr; gap: 10px;
    align-items: stretch;
}
.aiv-cmp-side {
    background: var(--white); border: 1px solid var(--slate-2);
    border-radius: var(--radius); padding: 14px 16px;
}
.aiv-cmp-side--after { border-color: var(--indigo); box-shadow: 0 0 0 3px var(--indigo-lt); }
.aiv-cmp-label {
    font-size: .7rem; font-weight: 700; text-transform: uppercase;
    letter-spacing: .06em; color: var(--text-mid); margin-bottom: 2px;
}
.aiv-cmp-caption { font-size: .72rem; color: var(--text-mid); margin-bottom: 10px; opacity: .85; }
.aiv-cmp-row {
    display: flex; align-items: baseline; justify-content: space-between;
    gap: 10px; padding: 6px 0; border-bottom: 1px dashed var(--slate-2);
}
.aiv-cmp-row:last-child { border-bottom: none; }
.aiv-cmp-key { font-size: .78rem; color: var(--text-mid); }
.aiv-cmp-val { font-size: .95rem; font-weight: 700; color: var(--text); text-align: right; }
.aiv-cmp-val--good { color: var(--green); }
.aiv-cmp-val--bad  { color: var(--red); }
.aiv-cmp-val--warn { color: var(--amber); }
.aiv-delta { display: block; font-size: .68rem; font-weight: 600; margin-top: 1px; }
.aiv-delta--up   { color: var(--green); }
.aiv-delta--down { color: var(--red); }
.aiv-cmp-arrow {
    display: flex; align-items: center; justify-content: center;
    color: var(--indigo); opacity: .55;
}
@media (max-width: 640px) {
    .aiv-comparison { grid-template-columns: 1fr; }
    .aiv-cmp-arrow { transform: rotate(90deg); padding: 2px 0; }
}

/* ── Connector gaps: "enable this for a better answer" ── */
.aiv-gap-block {
    border: 1px solid var(--border); background: var(--surface-2);
    border-radius: var(--radius); padding: 16px 18px;
}
.aiv-gap-head { display: flex; gap: 10px; align-items: flex-start; margin-bottom: 12px; color: var(--text-mid); }
.aiv-gap-head svg { flex-shrink: 0; margin-top: 2px; }
.aiv-gap-title { font-size: .86rem; font-weight: 700; color: var(--text); line-height: 1.4; }
.aiv-gap-sub   { font-size: .76rem; color: var(--text-mid); margin-top: 2px; }
.aiv-gap-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px;
}
.aiv-gap-card {
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius-sm); padding: 12px 14px;
    display: flex; flex-direction: column; gap: 6px; overflow: hidden;
}
.aiv-gap-card--high { border-color: var(--amber); }
.aiv-gap-card-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.aiv-gap-name    { font-size: .84rem; font-weight: 700; color: var(--text); }
.aiv-gap-reason  { font-size: .72rem; color: var(--text-mid); font-style: italic; }
.aiv-gap-unlocks { font-size: .78rem; color: var(--text-mid); line-height: 1.55; }
.aiv-gap-btn     { align-self: stretch; margin-top: 6px; text-align: center; white-space: normal; word-break: break-word; }

/* ── Data log: collapsed record of everything fetched ── */
.aiv-datalog {
    margin-top: 20px;
    border: 1px solid var(--slate-2); border-radius: var(--radius);
    background: var(--off-white); overflow: hidden;
}
.aiv-datalog-summary {
    display: flex; align-items: center; gap: 8px;
    padding: 10px 14px; cursor: pointer; user-select: none;
    font-size: .78rem; font-weight: 600; color: var(--text-mid);
    list-style: none; transition: background .15s;
}
.aiv-datalog-summary::-webkit-details-marker { display: none; }
.aiv-datalog-summary:hover { background: var(--slate-1); color: var(--indigo); }
.aiv-datalog-caret { flex-shrink: 0; transition: transform .18s ease; }
.aiv-datalog[open] > .aiv-datalog-summary > .aiv-datalog-caret { transform: rotate(90deg); }
.aiv-datalog-label  { flex: 1; }
.aiv-datalog-counts { display: flex; gap: 5px; flex-wrap: wrap; }
.aiv-datalog-pill {
    padding: 1px 8px; border-radius: 20px; font-size: .67rem; font-weight: 600;
    background: var(--slate-1); border: 1px solid var(--slate-2); color: var(--text-mid);
}
.aiv-datalog-pill--ok  { border-color: var(--green); color: var(--green); background: var(--green-lt); }
.aiv-datalog-pill--err { border-color: var(--red);   color: var(--red);   background: var(--red-lt); }

.aiv-datalog-body { padding: 4px 14px 14px; border-top: 1px solid var(--slate-2); background: var(--white); }
.aiv-datalog-meta {
    display: flex; flex-wrap: wrap; gap: 8px 20px;
    padding: 12px 0; margin-bottom: 6px; border-bottom: 1px dashed var(--slate-2);
}
.aiv-datalog-meta-item { display: flex; flex-direction: column; gap: 1px; min-width: 90px; }
.aiv-datalog-meta-key {
    font-size: .63rem; font-weight: 700; text-transform: uppercase;
    letter-spacing: .06em; color: var(--text-mid); opacity: .75;
}
.aiv-datalog-meta-val { font-size: .78rem; color: var(--text); font-weight: 600; }
.aiv-datalog-empty { font-size: .8rem; color: var(--text-mid); padding: 10px 0; margin: 0; }

.aiv-datalog-round {
    font-size: .64rem; font-weight: 700; text-transform: uppercase;
    letter-spacing: .07em; color: var(--text-mid);
    margin: 14px 0 7px; opacity: .7;
}
.aiv-datalog-call {
    border: 1px solid var(--slate-2); border-left: 3px solid var(--green);
    border-radius: var(--radius-sm); padding: 9px 12px; margin-bottom: 8px;
    background: var(--white);
}
.aiv-datalog-call--err { border-left-color: var(--red); background: var(--red-lt); }
.aiv-datalog-call-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.aiv-datalog-status { font-weight: 800; color: var(--green); }
.aiv-datalog-call--err .aiv-datalog-status { color: var(--red); }
.aiv-datalog-kind {
    font-size: .6rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em;
    padding: 1px 6px; border-radius: 3px;
    background: var(--indigo-lt); color: var(--indigo);
}
.aiv-datalog-tool {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: .76rem; font-weight: 600; color: var(--text);
}
.aiv-datalog-src    { font-size: .7rem; color: var(--text-mid); }
.aiv-datalog-spacer { flex: 1; }
.aiv-datalog-stat   { font-size: .67rem; color: var(--text-mid); opacity: .8; white-space: nowrap; }

.aiv-datalog-field { display: flex; gap: 7px; align-items: baseline; margin-top: 6px; flex-wrap: wrap; }
.aiv-datalog-field-key {
    font-size: .63rem; font-weight: 700; text-transform: uppercase;
    letter-spacing: .05em; color: var(--text-mid); opacity: .75;
}
.aiv-datalog-args {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: .72rem; color: var(--text-mid);
    background: var(--slate-1); border: 1px solid var(--slate-2);
    border-radius: 4px; padding: 1px 6px; word-break: break-all;
}
.aiv-datalog-error {
    margin-top: 6px; font-size: .75rem; color: var(--red); line-height: 1.5;
}
.aiv-datalog-note {
    margin-top: 6px; font-size: .72rem; color: var(--text-mid); font-style: italic; opacity: .8;
}

.aiv-datalog-payload { margin-top: 7px; }
.aiv-datalog-payload > summary {
    cursor: pointer; font-size: .72rem; font-weight: 600; color: var(--indigo);
    display: flex; align-items: center; gap: 6px;
}
.aiv-datalog-payload > summary:hover { text-decoration: underline; }
.aiv-datalog-trunc {
    font-size: .64rem; font-weight: 500; color: var(--amber);
    background: var(--amber-lt); border-radius: 3px; padding: 0 5px;
}
.aiv-log-json {
    margin: 7px 0 0; padding: 10px 12px;
    max-height: 320px; overflow: auto;
    background: var(--navy, #0f172a); color: #cbd5e1;
    border-radius: var(--radius-sm);
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: .71rem; line-height: 1.55;
    white-space: pre; tab-size: 2;
}

/* Live tool-call feed while a turn is still running */
.ads-live-call { margin-bottom: 3px; }


/* ═══════════════════════════════════════════════════════════════
   Package 027 — Growth hub (/growth): Audit · Rankings · Improve
   Uses the shared tokens only, so light/dark follow data-theme.
═══════════════════════════════════════════════════════════════ */
/* Growth nav: five sections that each answer one question, plus sub-tabs for the active section only */
.gr-tabs { display:flex; flex-wrap:wrap; gap:6px; margin-bottom:0; padding:6px; background:var(--surface); border:1px solid var(--border);
  border-radius:var(--radius-sm); }
.gr-tab { flex:1 1 150px; min-width:0; display:flex; align-items:center; gap:10px; padding:10px 14px; border-radius:8px;
  color:var(--text-mid); text-decoration:none; transition:background .15s,color .15s; }
.gr-tab:hover { background:var(--mist); color:var(--text); text-decoration:none; }
.gr-tab.active { background:rgba(145,141,246,.14); color:var(--primary); box-shadow:inset 0 -2px 0 var(--primary); }
.gr-tab-icon { font-size:1.2rem; line-height:1; }
.gr-tab-text { display:flex; flex-direction:column; line-height:1.2; }
.gr-tab-label { font-size:.88rem; font-weight:700; color:inherit; display:inline-flex; align-items:center; gap:6px; }
.gr-tab.active .gr-tab-label { color:var(--primary); }
.gr-tab-q { font-size:.72rem; color:var(--text-muted); margin-top:2px; }
.gr-tab-badge { min-width:18px; height:18px; padding:0 5px; border-radius:9px; background:var(--red); color:#fff;
  font-size:.66rem; font-weight:700; display:inline-flex; align-items:center; justify-content:center; }
.gr-tab-settings { flex:0 0 auto; }
.gr-subtabs { display:flex; align-items:center; gap:4px; flex-wrap:wrap; margin:10px 0 22px; padding:0 4px; }
.gr-subtab { padding:6px 12px; border-radius:var(--radius-pill); font-size:.8rem; font-weight:600; color:var(--text-mid);
  text-decoration:none; border:1px solid var(--border); background:var(--surface); white-space:nowrap; }
.gr-subtab:hover { color:var(--text); border-color:var(--text-muted); text-decoration:none; }
.gr-subtab.active { background:var(--primary); border-color:var(--primary); color:#fff; }
.gr-subtabs-hint { font-size:.76rem; color:var(--text-muted); margin-left:8px; }
.gr-tabs-gap { height:22px; }

/* ── Package 029: the data-source strip every Growth page carries ────────────
   Reads as one quiet line when everything is connected; only the sources the
   user can act on carry a button, so the strip never competes with the page. */
.gr-srcs { display:flex; align-items:center; gap:8px; flex-wrap:wrap; margin:0 0 18px; padding:0 4px; }
.gr-srcs-label { font-size:.74rem; font-weight:600; color:var(--text-muted); text-transform:uppercase; letter-spacing:.04em; }
.gr-src { display:inline-flex; align-items:center; gap:6px; padding:4px 10px; border-radius:var(--radius-pill);
  border:1px solid var(--border); background:var(--surface); font-size:.78rem; font-weight:600; white-space:nowrap; }
.gr-src-logo { width:14px; height:14px; object-fit:contain; }
.gr-src-icon { font-size:.72rem; line-height:1; }
.gr-src--ok    { color:var(--c-pass-fg); border-color:rgba(51,199,88,.3);  background:var(--c-pass-bg); }
.gr-src--warn  { color:var(--c-warn-fg); border-color:rgba(245,158,11,.35); background:var(--c-warn-bg); }
.gr-src--bad   { color:var(--c-fail-fg); border-color:rgba(220,38,38,.3);  background:var(--c-fail-bg); }
.gr-src--off   { color:var(--text-muted); }
.gr-src--muted { color:var(--text-muted); font-weight:500; }
.gr-src-form { display:inline; margin:0; }
.gr-src-cta { font-size:.74rem; font-weight:700; color:inherit; text-decoration:underline; background:none;
  border:0; padding:0 0 0 2px; cursor:pointer; font-family:inherit; }
.gr-src-cta:hover { opacity:.75; }
.gr-srcs-all { font-size:.74rem; color:var(--text-muted); text-decoration:none; margin-left:auto; }
.gr-srcs-all:hover { color:var(--text); text-decoration:underline; }
@media (max-width: 640px) { .gr-srcs-all { margin-left:0; } }

@media (max-width: 900px) { .gr-tab-q, .gr-subtabs-hint { display:none; } .gr-tab { padding:9px 12px; } }
@media (max-width: 640px) { .gr-tab { flex:1 1 40%; gap:6px; padding:8px 10px; } }

.gr-header { display:flex; justify-content:space-between; align-items:flex-start; gap:16px; flex-wrap:wrap; margin-bottom:20px; }
.gr-header h1 { font-size:1.55rem; margin:0 0 4px; }
.gr-header p { margin:0; color:var(--text-mid); font-size:.9rem; max-width:720px; }
.gr-actions { display:flex; gap:8px; flex-wrap:wrap; align-items:center; }
.gr-actions form { margin:0; }

.gr-kpis { display:grid; grid-template-columns:repeat(auto-fill, minmax(170px, 1fr)); gap:14px; margin-bottom:22px; }
.gr-kpi { background:var(--surface); border:1px solid var(--border); border-radius:var(--radius-sm); padding:14px 16px; }
.gr-kpi-label { font-size:.72rem; font-weight:600; letter-spacing:.03em; text-transform:uppercase; color:var(--text-muted); }
.gr-kpi-value { font-size:1.65rem; font-weight:700; color:var(--text); line-height:1.15; margin-top:6px; }
.gr-kpi-delta { font-size:.76rem; font-weight:600; margin-top:4px; }
.gr-kpi-src { font-size:.68rem; color:var(--text-muted); margin-top:2px; }
.gr-up { color:var(--mint); }
.gr-down { color:var(--red); }
.gr-flat { color:var(--text-muted); }

.gr-grid-2 { display:grid; grid-template-columns:1fr 1fr; gap:18px; margin-bottom:18px; }
.gr-grid-3 { display:grid; grid-template-columns:repeat(3, 1fr); gap:18px; margin-bottom:18px; }
.gr-grid-2 > .gr-card, .gr-grid-3 > .gr-card { margin-bottom:0; }
@media (max-width: 960px) { .gr-grid-2, .gr-grid-3 { grid-template-columns:1fr; } }

.gr-card { background:var(--surface); border:1px solid var(--border); border-radius:var(--radius-sm); padding:18px 20px; margin-bottom:18px; min-width:0; }
.gr-card > h2, .gr-card > h3, .gr-card-head h2, .gr-card-head h3 { font-size:1rem; margin:0 0 4px; }
.gr-card-sub { font-size:.8rem; color:var(--text-muted); margin:0 0 14px; }
.gr-card-head { display:flex; justify-content:space-between; align-items:flex-start; gap:10px; margin-bottom:10px; flex-wrap:wrap; }
.gr-card-head .gr-card-sub { margin-bottom:0; }
.gr-chart { width:100%; height:260px; }
.gr-chart-sm { width:100%; height:180px; }

.gr-callout { display:flex; gap:14px; align-items:flex-start; padding:16px 18px; border-radius:var(--radius-sm);
  background:var(--c-info-bg); color:var(--c-info-fg); border:1px solid rgba(44,120,252,.18); margin-bottom:18px; font-size:.88rem; }
.gr-callout.warn { background:var(--c-warn-bg); color:var(--c-warn-fg); border-color:rgba(245,158,11,.25); }
.gr-callout.bad { background:var(--c-fail-bg); color:var(--c-fail-fg); border-color:rgba(220,38,38,.2); }
.gr-callout.good { background:var(--c-pass-bg); color:var(--c-pass-fg); border-color:rgba(51,199,88,.25); }
.gr-callout-icon { font-size:1.3rem; line-height:1; }
.gr-callout strong { display:block; margin-bottom:2px; }
.gr-callout form { margin:8px 0 0; display:inline-block; }

.gr-running { display:flex; align-items:center; gap:12px; padding:12px 16px; border-radius:var(--radius-sm);
  background:var(--c-run-bg); color:var(--c-run-fg); margin-bottom:18px; font-size:.88rem; }
.gr-spinner { width:16px; height:16px; border-radius:50%; border:2px solid currentColor; border-right-color:transparent; animation:spin .8s linear infinite; flex-shrink:0; }

.gr-table { width:100%; border-collapse:collapse; font-size:.83rem; }
.gr-table th { text-align:left; padding:8px 10px; font-size:.68rem; font-weight:700; letter-spacing:.04em; text-transform:uppercase;
  color:var(--text-muted); border-bottom:1px solid var(--border); white-space:nowrap; }
.gr-table td { padding:9px 10px; border-bottom:1px solid var(--border); vertical-align:top; color:var(--text); }
.gr-table tr:last-child td { border-bottom:none; }
.gr-table tbody tr:hover td { background:var(--mist); }
.gr-table .num { text-align:right; font-variant-numeric:tabular-nums; white-space:nowrap; }
.gr-table .muted { color:var(--text-muted); }
.gr-table form { margin:0; display:inline; }
.gr-table-wrap { overflow-x:auto; }
.gr-url { color:var(--text-mid); font-size:.76rem; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; max-width:280px; }
.gr-url a { color:inherit; display:block; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
a.gr-url { display:block; }
.gr-link-btn { background:none; border:none; padding:0; color:var(--primary); cursor:pointer; font:inherit; font-size:.78rem; font-weight:600; }
.gr-link-btn:hover { text-decoration:underline; }
.gr-link-btn.danger { color:var(--red); }

.gr-pill { display:inline-block; padding:2px 8px; border-radius:var(--radius-pill); font-size:.68rem; font-weight:700; letter-spacing:.02em; white-space:nowrap; }
.gr-pill.good { background:var(--c-pass-bg); color:var(--c-pass-fg); }
.gr-pill.warn { background:var(--c-warn-bg); color:var(--c-warn-fg); }
.gr-pill.bad { background:var(--c-fail-bg); color:var(--c-fail-fg); }
.gr-pill.info { background:var(--c-info-bg); color:var(--c-info-fg); }
.gr-pill.run { background:var(--c-run-bg); color:var(--c-run-fg); }
.gr-pill.neutral { background:var(--mist); color:var(--text-mid); border:1px solid var(--border); }
.gr-pill.brand { background:rgba(145,141,246,.14); color:var(--primary); }

.gr-pos { display:inline-flex; min-width:34px; justify-content:center; padding:3px 7px; border-radius:6px; font-weight:700; font-size:.8rem; font-variant-numeric:tabular-nums; }
.gr-pos.p3 { background:var(--c-pass-bg); color:var(--c-pass-fg); }
.gr-pos.p10 { background:rgba(145,141,246,.14); color:var(--primary); }
.gr-pos.p20 { background:var(--c-warn-bg); color:var(--c-warn-fg); }
.gr-pos.pout { background:var(--mist); color:var(--text-muted); }
.gr-chg { font-size:.72rem; font-weight:700; margin-left:4px; white-space:nowrap; }

.gr-dist { display:flex; height:10px; border-radius:var(--radius-pill); overflow:hidden; background:var(--mist); margin:8px 0 6px; }
.gr-dist > span { display:block; height:100%; }
.gr-legend { display:flex; gap:14px; flex-wrap:wrap; font-size:.74rem; color:var(--text-mid); }
.gr-legend i { display:inline-block; width:9px; height:9px; border-radius:2px; margin-right:5px; vertical-align:-1px; }

.gr-bar { height:8px; border-radius:var(--radius-pill); background:var(--mist); overflow:hidden; min-width:80px; }
.gr-bar > span { display:block; height:100%; background:var(--primary); border-radius:var(--radius-pill); }
.gr-bar.you > span { background:var(--mint); }

.gr-tabs { display:flex; gap:0; border-bottom:1px solid var(--border); margin-bottom:18px; overflow-x:auto; }
.gr-tab { padding:10px 16px; font-size:.86rem; font-weight:600; color:var(--text-mid); text-decoration:none; border-bottom:2px solid transparent; white-space:nowrap; }
.gr-tab:hover { color:var(--text); text-decoration:none; }
.gr-tab.active { color:var(--primary); border-bottom-color:var(--primary); }
.gr-period { display:inline-flex; border:1px solid var(--border); border-radius:var(--radius-pill); overflow:hidden; }
.gr-period a { padding:5px 12px; font-size:.78rem; font-weight:600; color:var(--text-mid); text-decoration:none; }
.gr-period a.active { background:var(--primary); color:#fff; }

.gr-form-row { display:flex; gap:10px; flex-wrap:wrap; align-items:flex-end; }
.gr-form-row .form-control { min-width:180px; width:auto; }
.gr-field { display:flex; flex-direction:column; gap:4px; font-size:.78rem; color:var(--text-mid); font-weight:600; }
.gr-textarea { width:100%; min-height:90px; font-family:inherit; }
.gr-code { margin:8px 0 0; padding:10px 12px; background:#1e2232; color:#e2e8f0; border-radius:var(--radius-sm);
  font-family:ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size:.74rem; line-height:1.5; white-space:pre-wrap; word-break:break-word; max-height:320px; overflow:auto; }
html[data-theme="dark"] .gr-code { background:#0b0d14; }

.gr-check { display:flex; gap:10px; padding:9px 0; border-bottom:1px solid var(--border); font-size:.84rem; }
.gr-check:last-child { border-bottom:none; }
.gr-check-icon { flex-shrink:0; width:20px; height:20px; border-radius:50%; display:flex; align-items:center; justify-content:center; font-size:.7rem; font-weight:800; }
.gr-check-icon.ok { background:var(--c-pass-bg); color:var(--c-pass-fg); }
.gr-check-icon.no { background:var(--c-fail-bg); color:var(--c-fail-fg); }
.gr-check-name { font-weight:600; color:var(--text); }
.gr-check-detail { color:var(--text-mid); font-size:.78rem; margin-top:1px; }
.gr-check-fix { color:var(--text-muted); font-size:.76rem; margin-top:3px; }

.gr-issue { border:1px solid var(--border); border-radius:var(--radius-sm); margin-bottom:10px; background:var(--surface); }
.gr-issue > summary { list-style:none; cursor:pointer; display:flex; gap:10px; align-items:center; padding:12px 14px; }
.gr-issue > summary::-webkit-details-marker { display:none; }
.gr-issue[open] > summary { border-bottom:1px solid var(--border); }
.gr-issue-title { font-weight:600; flex:1; font-size:.88rem; }
.gr-issue-count { font-weight:700; font-variant-numeric:tabular-nums; color:var(--text-mid); }
.gr-issue-body { padding:12px 14px; font-size:.82rem; }
.gr-issue-body p { margin:0 0 8px; color:var(--text-mid); }

.gr-matrix td.cell { text-align:center; font-weight:700; width:92px; }
.gr-matrix td.yes { background:var(--c-pass-bg); color:var(--c-pass-fg); }
.gr-matrix td.no { background:var(--c-fail-bg); color:var(--c-fail-fg); }
.gr-matrix td.na { color:var(--text-muted); }
.gr-answer { border-left:3px solid var(--border); padding:8px 12px; margin:8px 0; font-size:.82rem; color:var(--text-mid); white-space:pre-wrap; max-height:260px; overflow:auto; }
.gr-answer mark { background:rgba(51,199,88,.28); color:inherit; padding:0 2px; border-radius:3px; }
.gr-answer mark.comp { background:rgba(245,158,11,.25); }

.gr-grid-map { display:grid; gap:6px; max-width:420px; }
.gr-grid-cell { aspect-ratio:1; border-radius:10px; display:flex; flex-direction:column; align-items:center; justify-content:center; font-weight:800; font-size:1rem; color:#fff; }
.gr-grid-cell small { font-size:.58rem; font-weight:600; opacity:.85; }
.gr-grid-cell.r3 { background:#22a447; } .gr-grid-cell.r10 { background:#d98b06; } .gr-grid-cell.r20 { background:#ea580c; }
.gr-grid-cell.rnone { background:#dc2626; } .gr-grid-cell.rerr { background:var(--mist); color:var(--text-muted); }
.gr-grid-cell.center { outline:3px solid var(--primary); outline-offset:2px; }

.gr-task { border:1px solid var(--border); border-radius:var(--radius-sm); padding:14px 16px; margin-bottom:10px; background:var(--surface); }
.gr-task.done { opacity:.75; }
.gr-task-head { display:flex; gap:10px; align-items:flex-start; justify-content:space-between; flex-wrap:wrap; }
.gr-task-title { font-weight:700; font-size:.92rem; color:var(--text); }
.gr-task-meta { display:flex; gap:6px; flex-wrap:wrap; margin-top:6px; align-items:center; }
.gr-task-body { font-size:.82rem; color:var(--text-mid); margin-top:8px; white-space:pre-wrap; }
.gr-task-form { display:flex; gap:8px; flex-wrap:wrap; align-items:center; margin-top:10px; padding-top:10px; border-top:1px dashed var(--border); }
.gr-task-form .form-control { padding:6px 10px; font-size:.8rem; min-width:0; width:auto; }
.gr-verified { margin-top:8px; font-size:.78rem; font-weight:600; }

.gr-timeline { list-style:none; margin:0; padding:0; }
.gr-timeline li { display:flex; gap:10px; padding:8px 0; border-bottom:1px solid var(--border); font-size:.82rem; }
.gr-timeline li:last-child { border-bottom:none; }
.gr-timeline time { color:var(--text-muted); font-size:.74rem; min-width:78px; }
.gr-dot { width:9px; height:9px; border-radius:50%; margin-top:5px; flex-shrink:0; background:var(--primary); }
.gr-dot.ai { background:var(--magenta); } .gr-dot.crawl { background:var(--sky); } .gr-dot.action { background:var(--mint); }

.gr-empty { text-align:center; padding:36px 18px; color:var(--text-mid); }
.gr-empty h3 { margin:0 0 6px; color:var(--text); font-size:1.05rem; }
.gr-empty p { margin:0 auto 14px; max-width:540px; font-size:.86rem; }

.gr-brief h4 { font-size:.9rem; margin:18px 0 6px; }
.gr-brief ul { margin:0; padding-left:20px; font-size:.86rem; }
.gr-brief li { margin-bottom:4px; }
.gr-copy-line { display:flex; gap:8px; align-items:center; padding:8px 10px; border:1px solid var(--border); border-radius:8px; margin-bottom:8px; font-size:.86rem; }
.gr-copy-line .lbl { font-size:.68rem; font-weight:700; text-transform:uppercase; color:var(--text-muted); min-width:82px; }
.gr-copy-line .val { flex:1; }

.gr-toggle-row { display:flex; justify-content:space-between; align-items:center; gap:14px; padding:12px 0; border-bottom:1px solid var(--border); }
.gr-toggle-row:last-child { border-bottom:none; }
.gr-toggle-row strong { display:block; font-size:.9rem; }
.gr-toggle-row span { font-size:.8rem; color:var(--text-mid); }

@media print {
  .gr-tabs, .gr-subtabs, .gr-actions, .portal-sidebar, .portal-mobile-bar, .breadcrumb, .no-print { display:none !important; }
  .gr-card { break-inside:avoid; border:none; }
}

/* Growth: pages moved from the Insights hub (Traffic, Competitors) */
.gr-muted { color:var(--text-muted); font-size:.78rem; }
.gr-trunc { font-weight:600; font-size:.84rem; max-width:340px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.gr-bar-row { display:flex; align-items:center; gap:8px; }
.gr-bar-row .gr-bar { flex:1; }
.gr-bar-row .gr-muted { width:36px; text-align:right; }
.gr-review { padding:10px 12px; border:1px solid var(--border); border-radius:var(--radius-sm); margin-top:8px; font-size:.84rem; }
.gr-stars { color:var(--amber); margin:0 6px; }
.gr-vs { display:grid; grid-template-columns:120px 1fr 1fr; gap:6px 12px; align-items:center; font-size:.82rem; }
.gr-vs-head { font-size:.7rem; font-weight:700; text-transform:uppercase; letter-spacing:.05em; color:var(--text-muted); }

/* Package 028 — change log, competitor gaps, directory listings */
.gr-dot.change { background:var(--amber); }
.gr-stack-form { display:flex; flex-direction:column; gap:8px; }
.gr-plain-list { margin:0; padding-left:18px; font-size:.84rem; color:var(--text-mid); line-height:1.55; }
.gr-plain-list li { margin-bottom:6px; }
.gr-detail { white-space:pre-wrap; font-family:inherit; font-size:.8rem; color:var(--text-mid); background:var(--mist); border-radius:var(--radius-sm); padding:8px 10px; margin:8px 0 0; max-width:760px; }


/* =============================================================
   AI CREDIT METER (Package 037)
============================================================= */
.credit-bar {
  height: 10px; border-radius: var(--radius-pill); background: var(--linen);
  border: 1px solid var(--border); overflow: hidden; margin-top: 16px;
}
.credit-bar__fill {
  height: 100%; background: var(--mint); border-radius: var(--radius-pill);
  transition: width .3s ease;
}
.credit-bar__fill--mid  { background: var(--amber); }
.credit-bar__fill--high { background: var(--red); }

/* =============================================================
   GROWTH HUB — MOBILE TABLE FIXES
   All gr-table-wrap containers already have overflow-x:auto.
   These rules improve touch scrolling, add visual scroll cues,
   prevent date columns from breaking, and stack the action-plan
   task form so it's usable on narrow screens.
============================================================= */
@media (max-width: 640px) {
  /* Smooth touch scrolling + right-edge shadow hints at overflow content.
     Inset box-shadow always hugs the visible right edge of the container,
     so it works as a reliable "more content →" cue without JS. */
  .gr-table-wrap {
    -webkit-overflow-scrolling: touch;
    box-shadow: inset -20px 0 12px -10px rgba(0,0,0,.08);
  }

  /* Prevent date/time cells from wrapping in audit history table */
  .wd-history-table td:first-child { white-space: nowrap; }

  /* Action plan task form: stack vertically so controls are usable */
  .gr-task-form {
    flex-direction: column;
    align-items: stretch;
    gap: 6px;
  }
  .gr-task-form .form-control {
    width: 100% !important;
    min-width: 0 !important;
  }
  .gr-task-form .btn { width: 100%; justify-content: center; }

  /* Keep date cells on one line */
  .gr-date-cell { white-space: nowrap; }
}

/* Scroll hint injected by growth.js next to overflowing tables */
.gr-scroll-hint {
  display: none;
}
@media (max-width: 640px) {
  .gr-scroll-hint {
    display: block;
    font-size: 11px;
    color: var(--text-muted);
    text-align: center;
    padding: 4px 0 0;
    letter-spacing: .02em;
    user-select: none;
  }
}

/* =============================================================
   SIGNAL-ROW — MOBILE LAYOUT
   Desktop: 3-column grid [label | badge | hint].
   Mobile ≤640px: collapse to [label | badge] with hint below,
   so the label always has 1fr and never squashes to 2 words.
============================================================= */
@media (max-width: 640px) {
  .signal-row {
    grid-template-columns: 1fr auto;
    row-gap: 2px;
  }
  .signal-row > :nth-child(3) {
    grid-column: 1 / -1;
    text-align: left;
    white-space: normal;
    padding-bottom: 4px;
  }
}

/* =============================================================
   SEO RESULT + AUDIT REPORT — MOBILE TABLE & LAYOUT FIXES
   check-report-table already gets display:block;overflow-x:auto
   at ≤768px. These min-widths prevent the text columns from
   being squeezed to 2 words per line.
============================================================= */
.check-report-table td:nth-child(2),
.check-report-table th:nth-child(2) { min-width: 140px; }
.check-report-table td:nth-child(3),
.check-report-table th:nth-child(3) { min-width: 200px; }
.check-report-table td:nth-child(4),
.check-report-table th:nth-child(4) { min-width: 200px; }

/* Keywords table — keyword names need room to read */
.reports-table th:first-child,
.reports-table td:first-child { min-width: 160px; }

/* Audit URL bar — truncate the URL so it doesn't wrap messily on narrow screens */
.audit-url-value {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: min(400px, 60vw);
  display: inline-block;
  vertical-align: middle;
}

/* =============================================================
   AUDIT REPORT PAGE — MOBILE LAYOUT
============================================================= */
@media (max-width: 640px) {
  /* Reduce section card padding so content has more room */
  .report-section { padding: 14px; }

  /* Page header: stack the button row; each form/button fills width */
  .page-header > div:last-child { width: 100%; }
  .page-header > div:last-child form,
  .page-header > div:last-child > a.btn { display: block; width: 100%; }
  .page-header > div:last-child .btn { width: 100%; text-align: center; }

  /* Section title: let it wrap cleanly on narrow screens */
  .report-section-title { font-size: 15px; flex-wrap: wrap; }
  .section-title-row    { gap: 6px; margin-bottom: 14px; }

  /* Section nav: smaller text, clear scroll */
  .snav-btn { font-size: 11px; padding: 6px 10px; }

  /* Fix plan item: let the check name wrap instead of squashing */
  .fixplan-item-header  { flex-wrap: wrap; }
  .fixplan-name         { flex: 1 1 100%; }
  .fixplan-item         { padding: 10px 12px; }
  .fixplan-body         { padding: 0 12px 14px; }

  /* CrUX metric header: wrap target text on narrow screens */
  .crux-metric__hdr { flex-wrap: wrap; }
  .crux-metric__tgt { flex-basis: 100%; margin-top: 2px; }
  .crux-metric__val { margin-left: auto; }

  /* Crawler bot row: let the user-agent wrap below the bot name */
  .signal-row span:has(strong) { flex-wrap: wrap; }

  /* Run-nav history: smaller on mobile */
  .run-nav { gap: 4px; flex-wrap: wrap; }
}
