/* ===========================================================
   SEOWise — design tokens (matches the Lovable palette)
   ===========================================================
   oklch() needs modern Chrome 111+, Safari 15.4+, Firefox 113+.
   We keep oklch as the source of truth but add hex/rgb fallbacks
   on the high-visibility surfaces (buttons, gradients, score
   ring) so the page is still legible on older browsers where
   oklch silently fails to a transparent gradient.
   =========================================================== */
:root {
  --background: oklch(100% 0 0);
  --foreground: oklch(18% .04 255);

  --card: oklch(100% 0 0);
  --card-foreground: oklch(18% .04 255);

  --muted: oklch(97% .015 250);
  --muted-foreground: oklch(50% .04 255);

  --accent: oklch(95% .05 250);
  --accent-foreground: oklch(40% .2 262);

  --border: oklch(92% .02 250);
  --input: oklch(92% .02 250);

  --primary: oklch(55% .22 258);
  --primary-deep: oklch(40% .2 262);
  --primary-glow: oklch(70% .18 245);
  --primary-foreground: oklch(100% 0 0);

  --gradient-hero: linear-gradient(135deg, oklch(55% .22 258) 0%, oklch(70% .18 245) 100%);
  --gradient-soft: linear-gradient(180deg, oklch(98% .02 250) 0%, oklch(100% 0 0) 100%);
  --gradient-radial: radial-gradient(ellipse at top, oklch(92% .06 250 / .6), transparent 70%);

  --shadow-soft:    0  8px 30px -10px oklch(55% .22 258 / .18);
  --shadow-elegant: 0 20px 60px -20px oklch(55% .22 258 / .35);
  --shadow-glow:    0  0  80px       oklch(70% .18 245 / .40);

  --score-good: oklch(65% .19 145);
  --score-mid:  oklch(75% .16 80);
  --score-bad:  oklch(60% .22 25);

  --radius-sm: 8px;
  --radius:   12px;
  --radius-lg:16px;
  --radius-xl:24px;
  --radius-2xl:28px;

  --container: 1180px;
}

/* ===========================================================
   Reset + base typography
   =========================================================== */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  color: var(--foreground);
  background: var(--background);
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3 { margin: 0 0 .5em; line-height: 1.15; letter-spacing: -0.02em; font-weight: 700; }
h1 { font-size: clamp(2.2rem, 4.5vw, 3.6rem); }
h2 { font-size: clamp(1.8rem, 3.2vw, 2.6rem); }
h3 { font-size: 1.25rem; }
p  { margin: 0 0 1em; color: var(--muted-foreground); }
a  { color: inherit; text-decoration: none; }

.container { width: 100%; max-width: var(--container); margin: 0 auto; padding: 0 24px; }

.grad-text {
  /* Fallback: solid brand blue. Modern browsers override with the gradient. */
  color: #4666e0;
  background: linear-gradient(135deg, #4666e0 0%, #6aa5f5 100%);
  background: var(--gradient-hero);
  -webkit-background-clip: text;
  background-clip: text;
}
@supports (background-clip: text) or (-webkit-background-clip: text) {
  .grad-text { color: transparent; }
}
.eyebrow {
  display: inline-block;
  font-size: .78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .14em;
  color: var(--primary);
  margin-bottom: 1rem;
  padding: .35rem .7rem;
  border-radius: 999px;
  background: var(--accent);
}
.lead { font-size: 1.125rem; color: var(--muted-foreground); }
.lead--center { max-width: 760px; margin-left: auto; margin-right: auto; text-align: center; }

/* ===========================================================
   Buttons
   =========================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  height: 40px;
  padding: 0 1rem;
  font-size: .95rem;
  font-weight: 600;
  border-radius: 10px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform .25s ease, box-shadow .25s ease, background .2s ease;
  white-space: nowrap;
}
.btn-lg { height: 48px; padding: 0 1.75rem; font-size: 1rem; border-radius: 12px; }
.btn-xl { height: 56px; padding: 0 2.25rem; font-size: 1.05rem; border-radius: 14px; }

.btn-primary {
  /* Solid fallback for browsers that don't understand oklch in gradients */
  background-color: #4666e0;
  background-image: linear-gradient(135deg, #4666e0 0%, #6aa5f5 100%);
  background-image: var(--gradient-hero);
  color: #fff;
  color: var(--primary-foreground);
  box-shadow: 0 20px 60px -20px rgba(70, 102, 224, 0.35);
  box-shadow: var(--shadow-elegant);
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 80px rgba(106, 165, 245, 0.4);
  box-shadow: var(--shadow-glow);
}

.btn-outline {
  background: transparent;
  border-color: var(--border);
  color: var(--foreground);
}
.btn-outline:hover { background: var(--accent); }

.btn-ghost {
  background: transparent;
  color: var(--muted-foreground);
}
.btn-ghost:hover { color: var(--foreground); }

/* ===========================================================
   Header
   =========================================================== */
.site-header {
  position: sticky; top: 0; z-index: 50;
  backdrop-filter: saturate(180%) blur(12px);
  background: oklch(100% 0 0 / .85);
  border-bottom: 1px solid var(--border);
}
.header-inner {
  display: flex; align-items: center; justify-content: space-between;
  height: 72px;
}
.logo { display: flex; align-items: center; gap: .6rem; font-weight: 700; }
.logo-mark {
  width: 32px; height: 32px;
  display: grid; place-items: center;
  background-color: #4666e0;
  background-image: linear-gradient(135deg, #4666e0 0%, #6aa5f5 100%);
  background-image: var(--gradient-hero);
  color: white;
  border-radius: 8px;
  font-weight: 800;
  box-shadow: var(--shadow-soft);
}
.logo-text { font-size: 1.1rem; letter-spacing: -.01em; }
.main-nav { display: flex; gap: 2rem; }
.main-nav a {
  font-size: .95rem; color: var(--muted-foreground); font-weight: 500;
  transition: color .15s ease;
}
.main-nav a:hover { color: var(--foreground); }
.header-cta { display: flex; align-items: center; gap: .5rem; }

@media (max-width: 820px) {
  .main-nav { display: none; }
  .header-cta .btn-ghost { display: none; }
}

/* ===========================================================
   Hero
   =========================================================== */
.hero {
  position: relative;
  padding: 88px 0 120px;
  background:
    var(--gradient-radial),
    var(--gradient-soft);
}
.hero-grid {
  display: grid;
  grid-template-columns: 1.05fr .95fr;
  gap: 64px;
  align-items: center;
}
@media (max-width: 980px) {
  .hero-grid { grid-template-columns: 1fr; gap: 56px; }
}
.hero-text h1 { margin-top: .25rem; }
.hero-text .lead { font-size: 1.2rem; max-width: 560px; margin-bottom: 2rem; }
.hero-actions { display: flex; gap: .75rem; flex-wrap: wrap; margin-bottom: 1.75rem; }
.hero-meta {
  display: flex; align-items: center; gap: .5rem;
  font-size: .85rem; color: var(--muted-foreground);
}
.hero-meta .dot {
  width: 8px; height: 8px; border-radius: 999px;
  background: var(--primary);
  box-shadow: 0 0 0 4px oklch(70% .18 245 / .25);
}

/* Hero card stack */
.hero-card-wrap { position: relative; }
.hero-glow {
  position: absolute; inset: -28px;
  background: var(--gradient-hero);
  opacity: .15;
  filter: blur(60px);
  border-radius: 32px;
  z-index: 0;
}

.search-card {
  position: relative; z-index: 1;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-2xl);
  box-shadow: var(--shadow-elegant);
  padding: 18px;
  display: grid;
  gap: 14px;
}
.search-bar {
  display: flex; align-items: center; gap: .75rem;
  padding: .85rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--background);
}
.search-bar .icon { width: 18px; height: 18px; color: var(--muted-foreground); }
.search-query { color: var(--foreground); font-size: .95rem; }

.ai-answer {
  border-radius: var(--radius-lg);
  padding: 16px;
  background: linear-gradient(135deg, oklch(95% .05 250) 0%, oklch(98% .02 250) 100%);
  border: 1px solid var(--border);
}
.ai-answer-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: .6rem;
}
.ai-badge {
  font-size: .7rem; font-weight: 700; letter-spacing: .12em;
  text-transform: uppercase;
  padding: .25rem .55rem;
  background: var(--gradient-hero);
  color: white;
  border-radius: 999px;
}
.ai-source { font-size: .75rem; color: var(--muted-foreground); }
.ai-text { color: var(--foreground); font-size: .95rem; margin: 0 0 .8rem; }
.ai-cites { display: flex; flex-wrap: wrap; gap: .35rem; align-items: center; }
.cite { font-size: .72rem; color: var(--muted-foreground); margin-right: .25rem; }
.cite-chip {
  font-size: .72rem; padding: .2rem .55rem;
  background: var(--card); border: 1px solid var(--border);
  border-radius: 999px; color: var(--muted-foreground);
}
.cite-chip--brand {
  color: var(--primary);
  border-color: oklch(70% .18 245 / .5);
  background: oklch(95% .05 250);
}

.organic {
  border-top: 1px dashed var(--border);
  padding-top: 14px;
  display: grid;
  gap: 12px;
}
.organic-label {
  font-size: .7rem; text-transform: uppercase; letter-spacing: .14em;
  color: var(--muted-foreground); font-weight: 600;
}
.organic-row { padding: .25rem 0; }
.organic-title {
  font-size: .95rem; color: var(--primary-deep); font-weight: 600;
}
.organic-snippet { font-size: .85rem; color: var(--muted-foreground); }

/* Floating mini cards */
.float-card {
  position: absolute; z-index: 2;
  display: flex; align-items: center; gap: .75rem;
  padding: .85rem 1rem;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-soft);
}
.float-card--tl { top: -28px; left: -28px; }
.float-card--br { bottom: -28px; right: -28px; }
.float-icon {
  width: 36px; height: 36px;
  display: grid; place-items: center;
  background: var(--gradient-hero);
  color: white; font-weight: 700;
  border-radius: 10px;
  box-shadow: var(--shadow-soft);
}
.float-num { font-weight: 700; font-size: 1.1rem; color: var(--foreground); }
.float-label { font-size: .75rem; color: var(--muted-foreground); }
@media (max-width: 640px) {
  .float-card { display: none; }
}

/* ===========================================================
   Sections
   =========================================================== */
.section { padding: 96px 0; }
.section--soft { background: var(--gradient-soft); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.section--cta  { background: var(--gradient-soft); padding: 120px 0; }

.section-head { text-align: center; margin-bottom: 64px; }
.section-head h2 { margin-bottom: 1rem; }

/* ===========================================================
   Stats grid
   =========================================================== */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  margin-bottom: 48px;
}
@media (max-width: 880px) { .stats-grid { grid-template-columns: 1fr; } }

.stat-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 32px;
  transition: transform .3s ease, box-shadow .3s ease, border-color .3s ease;
}
.stat-card:hover {
  transform: translateY(-4px);
  border-color: oklch(70% .18 245 / .4);
  box-shadow: var(--shadow-elegant);
}
.stat-card--featured {
  background: var(--gradient-hero);
  border-color: transparent;
  color: white;
}
.stat-card--featured h3,
.stat-card--featured .stat-num { color: white; }
.stat-card--featured p { color: oklch(100% 0 0 / .85); }

.stat-num {
  font-size: clamp(2.4rem, 4.5vw, 3.2rem);
  font-weight: 800;
  letter-spacing: -.03em;
  margin-bottom: .5rem;
  background: var(--gradient-hero);
  -webkit-background-clip: text; background-clip: text;
  color: transparent;
}
.stat-card--featured .stat-num {
  background: none; -webkit-text-fill-color: white;
}

.callout {
  text-align: center;
  font-size: 1.1rem;
  color: var(--foreground);
  padding: 20px;
  border-radius: var(--radius-lg);
  background: oklch(95% .05 250);
  border: 1px solid var(--border);
}

/* ===========================================================
   Framework
   =========================================================== */
.framework-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}
@media (max-width: 880px) { .framework-grid { grid-template-columns: 1fr; } }

.framework-card {
  position: relative;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 36px 32px;
  transition: all .3s ease;
}
.framework-card:hover {
  transform: translateY(-4px);
  border-color: oklch(70% .18 245 / .5);
  box-shadow: var(--shadow-elegant);
}
.step-badge {
  display: inline-block;
  font-size: .8rem; font-weight: 700; letter-spacing: .12em;
  padding: .35rem .7rem;
  background: var(--gradient-hero);
  color: white;
  border-radius: 999px;
  margin-bottom: 1rem;
  box-shadow: var(--shadow-soft);
}
.framework-sub {
  font-style: italic;
  color: var(--primary);
  margin-bottom: 1rem;
  font-size: .95rem;
}
.check-list {
  list-style: none;
  padding: 0;
  margin: 1.25rem 0 0;
  display: grid;
  gap: .55rem;
}
.check-list li {
  position: relative;
  padding-left: 1.5rem;
  font-size: .92rem;
  color: var(--foreground);
}
.check-list li::before {
  content: "";
  position: absolute;
  left: 0; top: .42rem;
  width: 16px; height: 16px;
  border-radius: 999px;
  background: var(--gradient-hero);
  box-shadow: inset 0 0 0 2px white;
}

/* ===========================================================
   Compare table
   =========================================================== */
.compare-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  overflow: hidden;
  box-shadow: var(--shadow-soft);
}
.compare-head, .compare-row {
  display: grid;
  grid-template-columns: 1fr 1.4fr 1.4fr;
}
.compare-head {
  background: oklch(95% .05 250);
  border-bottom: 1px solid var(--border);
}
.compare-head > div {
  padding: 18px 22px;
  font-size: .8rem;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--primary-deep);
}
.compare-row { border-bottom: 1px solid var(--border); }
.compare-row:last-child { border-bottom: 0; }
.compare-row > div {
  padding: 20px 22px;
  font-size: .95rem;
  color: var(--foreground);
}
.compare-row > div + div { border-left: 1px solid var(--border); }
.row-label { font-weight: 600; color: var(--muted-foreground); }

@media (max-width: 760px) {
  .compare-head { display: none; }
  .compare-row { grid-template-columns: 1fr; }
  .compare-row > div + div { border-left: 0; border-top: 1px solid var(--border); }
  .row-label { background: oklch(95% .05 250); }
}

/* ===========================================================
   Audit CTA
   =========================================================== */
.audit-wrap { max-width: 760px; margin: 0 auto; }

.audit-form {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-2xl);
  padding: 32px;
  box-shadow: var(--shadow-elegant);
}
.audit-row {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 16px;
  margin-bottom: 16px;
}
@media (max-width: 640px) { .audit-row { grid-template-columns: 1fr; } }

.field { display: grid; gap: .35rem; }
.field span {
  font-size: .85rem; font-weight: 600; color: var(--foreground);
}
.field input, .field select {
  height: 48px;
  padding: 0 1rem;
  border: 1px solid var(--input);
  background: var(--background);
  border-radius: 10px;
  font-size: 1rem;
  color: var(--foreground);
  transition: border-color .15s ease, box-shadow .15s ease;
}
.field input:focus, .field select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px oklch(70% .18 245 / .2);
}
.audit-form .btn { width: 100%; }
.audit-fine {
  text-align: center;
  margin: 1rem 0 0;
  font-size: .85rem;
  color: var(--muted-foreground);
}

/* ===========================================================
   Footer
   =========================================================== */
.site-footer {
  background: var(--background);
  border-top: 1px solid var(--border);
  padding: 40px 0;
}
.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}
.footer-brand { display: flex; align-items: center; gap: .6rem; font-weight: 700; }
.footer-nav { display: flex; gap: 1.5rem; }
.footer-nav a { font-size: .9rem; color: var(--muted-foreground); }
.footer-nav a:hover { color: var(--foreground); }
.footer-copy { font-size: .85rem; color: var(--muted-foreground); }

/* ===========================================================
   Audit error + loading spinner
   =========================================================== */
.audit-error { color: var(--score-bad); }

.spinner {
  width: 56px; height: 56px; margin: 32px auto 0;
  border: 4px solid oklch(92% .02 250);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin .9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ===========================================================
   Results page
   =========================================================== */
.results-hero { padding-top: 64px; padding-bottom: 96px; }
.results-hero h1 { margin-top: 1rem; }
.results-hero .lead { max-width: 700px; margin-bottom: 2.5rem; }

.score-grid {
  display: grid;
  grid-template-columns: minmax(280px, 360px) 1fr;
  gap: 40px;
  align-items: center;
  margin-bottom: 32px;
}
@media (max-width: 880px) {
  .score-grid { grid-template-columns: 1fr; gap: 32px; }
}

/* Single-card layout — when there are no side stats, centre the score card */
.score-grid--solo {
  grid-template-columns: 1fr;
  justify-items: center;
  margin-bottom: 16px;
}
.score-grid--solo .score-card {
  max-width: 420px;
  width: 100%;
}

.score-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-2xl);
  padding: 40px 32px;
  box-shadow: var(--shadow-elegant);
  text-align: center;
}

.score-ring {
  --score-pct: 0%;
  --score-color: var(--primary);
  width: 200px; height: 200px;
  margin: 0 auto 1.25rem;
  border-radius: 50%;
  background:
    conic-gradient(var(--score-color) var(--score-pct), oklch(94% .02 250) 0);
  display: grid; place-items: center;
  transition: background 1s ease;
}
.score-ring-inner {
  width: 160px; height: 160px;
  background: var(--card);
  border-radius: 50%;
  display: grid; place-items: center;
}
.score-number {
  font-size: 3.4rem;
  font-weight: 800;
  letter-spacing: -.04em;
  line-height: 1;
  color: var(--foreground);
}
.score-label {
  font-size: .8rem;
  text-transform: uppercase;
  letter-spacing: .14em;
  color: var(--muted-foreground);
  margin-top: .35rem;
  font-weight: 600;
}
.score-blurb {
  color: var(--foreground);
  font-size: 1.05rem;
  margin: 0;
}

.score-stats { display: grid; gap: 20px; }
.score-stat {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 24px 28px;
  box-shadow: var(--shadow-soft);
}
.score-stat-num {
  font-size: 2.4rem; font-weight: 800; letter-spacing: -.03em;
  background: var(--gradient-hero);
  -webkit-background-clip: text; background-clip: text;
  color: transparent;
  margin-bottom: .25rem;
}
.score-stat-label {
  font-size: .95rem; font-weight: 600; color: var(--foreground);
  margin-bottom: .25rem;
}
.score-stat p { margin: 0; font-size: .9rem; }

.results-cta { text-align: center; margin-top: 16px; }
.results-cta .audit-fine { margin-top: 1rem; }

/* ===========================================================
   Data tables
   =========================================================== */
.data-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  overflow: hidden;
  box-shadow: var(--shadow-soft);
}
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .95rem;
}
.data-table th, .data-table td {
  padding: 16px 22px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}
.data-table tbody tr:last-child td { border-bottom: 0; }
.data-table th {
  background: oklch(95% .05 250);
  font-size: .75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .12em;
  color: var(--primary-deep);
}
.data-table td.num, .data-table th.num { text-align: right; font-variant-numeric: tabular-nums; }
.data-table tbody tr:hover { background: oklch(98% .015 250); }

.pill {
  display: inline-block;
  padding: .25rem .65rem;
  border-radius: 999px;
  font-size: .75rem;
  font-weight: 600;
}
.pill--good { background: oklch(94% .08 145); color: oklch(40% .18 145); }
.pill--bad  { background: oklch(94% .07 25);  color: oklch(45% .2 25); }
.pill--info { background: var(--accent); color: var(--accent-foreground); }
.pill--muted{ background: var(--muted); color: var(--muted-foreground); }

.chip {
  display: inline-block;
  padding: .2rem .55rem;
  border-radius: 999px;
  background: var(--accent);
  font-size: .75rem;
  color: var(--accent-foreground);
  margin-right: 4px;
  font-weight: 500;
}
.muted { color: var(--muted-foreground); }

@media (max-width: 720px) {
  .data-table { font-size: .85rem; }
  .data-table th, .data-table td { padding: 12px 14px; }
}

/* ===========================================================
   Progress steps (streaming audit)
   =========================================================== */
.progress-steps {
  list-style: none;
  padding: 0;
  margin: 32px 0 24px;
  display: grid;
  gap: 12px;
  max-width: 540px;
}
.step {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  font-size: .95rem;
  color: var(--muted-foreground);
  transition: all .25s ease;
}
.step-icon {
  width: 20px; height: 20px;
  border-radius: 50%;
  border: 2px solid var(--border);
  background: var(--card);
  flex-shrink: 0;
  position: relative;
  transition: all .25s ease;
}
.step--active {
  border-color: var(--primary);
  color: var(--foreground);
  box-shadow: var(--shadow-soft);
}
.step--active .step-icon {
  border-color: var(--primary);
  border-top-color: transparent;
  animation: spin .8s linear infinite;
}
.step--done {
  color: var(--foreground);
  border-color: oklch(80% .15 145 / .5);
  background: oklch(98% .04 145);
}
.step--done .step-icon {
  background: var(--score-good);
  border-color: var(--score-good);
}
.step--done .step-icon::after {
  content: "";
  position: absolute;
  inset: 3px 4px 4px 3px;
  background: white;
  clip-path: polygon(14% 44%, 0 60%, 40% 100%, 100% 20%, 86% 6%, 39% 70%);
}

/* ===========================================================
   Skeleton placeholders (rows that are still loading)
   =========================================================== */
.skeleton {
  display: inline-block;
  background: linear-gradient(
    90deg,
    oklch(94% .02 250) 0%,
    oklch(97% .015 250) 50%,
    oklch(94% .02 250) 100%
  );
  background-size: 200% 100%;
  border-radius: 999px;
  animation: shimmer 1.4s ease-in-out infinite;
}
.skeleton--pill { width: 70px; height: 20px; }
.skeleton--chip { width: 120px; height: 18px; }
@keyframes shimmer {
  0%   { background-position: -200% 0; }
  100% { background-position:  200% 0; }
}

/* ===========================================================
   AI Overview vs Classic SEO comparison
   =========================================================== */
.compare-pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin-bottom: 24px;
}
@media (max-width: 760px) {
  .compare-pair { grid-template-columns: 1fr; }
}

.compare-side {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 28px 28px 24px;
  box-shadow: var(--shadow-soft);
  transition: transform .3s ease, box-shadow .3s ease;
}
.compare-side:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-elegant);
}

.compare-side--ai {
  background-color: #4666e0;
  background-image: linear-gradient(135deg, #4666e0 0%, #6aa5f5 100%);
  background-image: var(--gradient-hero);
  border-color: transparent;
  color: white;
}
.compare-side--ai .compare-side-sub,
.compare-side--ai .compare-label {
  color: rgba(255,255,255,.82);
}
.compare-side--ai .compare-num {
  color: white;
  -webkit-text-fill-color: white;
  background: none;
}

.compare-side-head {
  display: grid;
  gap: 4px;
  margin-bottom: 20px;
}
.compare-side-icon {
  font-size: 1.5rem;
  display: inline-block;
}
.compare-side-title {
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: -.01em;
}
.compare-side-sub {
  font-size: .85rem;
  color: var(--muted-foreground);
  font-weight: 500;
}

.compare-side-score {
  font-size: 3.4rem;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -.03em;
  margin: 8px 0 6px;
  color: var(--foreground);
}
.compare-side-score .pct {
  font-size: 1.6rem;
  font-weight: 700;
  margin-left: 2px;
  opacity: .85;
  vertical-align: top;
}
.compare-side--ai .compare-side-score {
  color: white;
}

.compare-stats {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 14px;
}
.compare-stats li {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 14px;
  align-items: baseline;
  padding: 8px 0;
  border-top: 1px solid rgba(0,0,0,.06);
}
.compare-side--ai .compare-stats li {
  border-top-color: rgba(255,255,255,.15);
}
.compare-stats li:first-child { border-top: 0; padding-top: 0; }

.compare-num {
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -.02em;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  background: var(--gradient-hero);
  -webkit-background-clip: text;
  background-clip: text;
  color: #4666e0;
}
@supports (background-clip: text) or (-webkit-background-clip: text) {
  .compare-side:not(.compare-side--ai) .compare-num { color: transparent; }
}
.compare-label {
  font-size: .9rem;
  line-height: 1.4;
  color: var(--muted-foreground);
}
.compare-side--ai .compare-label { color: rgba(255,255,255,.85); }

.compare-gap {
  text-align: center;
  font-size: 1.05rem;
  color: var(--foreground);
  max-width: 720px;
  margin: 24px auto 0;
  padding: 18px 24px;
  background: oklch(95% .05 250);
  background: var(--accent);
  border-radius: var(--radius-lg);
}

/* ===========================================================
   Custom keyword checker (below keywords table)
   =========================================================== */
.custom-kw {
  margin-top: 40px;
  padding: 32px;
  background: var(--card);
  border: 1px dashed var(--border);
  border-radius: var(--radius-xl);
}
.custom-kw-head h3 {
  font-size: 1.2rem;
  margin: 0 0 .35rem;
}
.custom-kw-head p {
  font-size: .95rem;
  margin: 0 0 1.5rem;
  max-width: 620px;
}
.custom-kw-inputs {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}
.custom-kw-inputs input {
  height: 44px;
  padding: 0 14px;
  border: 1px solid var(--input);
  background: var(--background);
  border-radius: 10px;
  font-size: .95rem;
  color: var(--foreground);
  transition: border-color .15s ease, box-shadow .15s ease;
}
.custom-kw-inputs input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px oklch(70% .18 245 / .2);
}
.custom-kw-form .btn { min-width: 220px; }

.row-added { background: oklch(98% .04 250); }
.row-added:hover { background: oklch(96% .05 250); }
.added-badge {
  display: inline-block;
  margin-left: .5rem;
  padding: .15rem .55rem;
  font-size: .68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .08em;
  background: var(--accent);
  color: var(--accent-foreground);
  border-radius: 999px;
  vertical-align: middle;
}

/* ===========================================================
   Featured framework card (backlinks page) + equation
   =========================================================== */
.framework-card--feature {
  background-color: #4666e0;
  background-image: linear-gradient(135deg, #4666e0 0%, #6aa5f5 100%);
  background-image: var(--gradient-hero);
  border-color: transparent;
  color: white;
}
.framework-card--feature h3,
.framework-card--feature p { color: white; }
.framework-card--feature .framework-sub { color: rgba(255,255,255,.88); }
.step-badge--feature {
  background: rgba(255,255,255,.18);
  color: #fff;
  font-size: 1rem;
  display: inline-grid; place-items: center;
  width: 36px; height: 36px;
  padding: 0;
  border-radius: 10px;
  box-shadow: none;
}
.framework-equation {
  margin-top: 1.25rem;
  padding: 14px 16px;
  background: rgba(255,255,255,.12);
  border-radius: var(--radius-lg);
  font-size: .95rem;
  text-align: center;
  color: white;
}
.eq-plus, .eq-eq {
  display: inline-block;
  margin: 0 .3rem;
  opacity: .8;
}

/* ===========================================================
   Pricing cards
   =========================================================== */
.pricing-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  align-items: stretch;
  margin-bottom: 32px;
}
@media (max-width: 980px) { .pricing-grid { grid-template-columns: 1fr; max-width: 480px; margin-left: auto; margin-right: auto; } }

.pricing-card {
  position: relative;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 36px 32px;
  display: flex;
  flex-direction: column;
  transition: transform .3s ease, box-shadow .3s ease;
}
.pricing-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-elegant);
}
.pricing-card--featured {
  border: 2px solid #4666e0;
  border-color: var(--primary);
  box-shadow: var(--shadow-elegant);
  transform: translateY(-8px);
}
@media (max-width: 980px) { .pricing-card--featured { transform: none; } }

.pricing-ribbon {
  position: absolute;
  top: -14px; left: 50%;
  transform: translateX(-50%);
  background-color: #4666e0;
  background-image: var(--gradient-hero);
  color: white;
  font-size: .72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .14em;
  padding: 6px 14px;
  border-radius: 999px;
  box-shadow: var(--shadow-soft);
  white-space: nowrap;
}

.pricing-head { margin-bottom: 24px; }
.pricing-tier {
  font-size: .9rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .14em;
  color: var(--primary);
  margin-bottom: .5rem;
}
.pricing-amount {
  font-size: 2.6rem;
  font-weight: 800;
  letter-spacing: -.03em;
  color: var(--foreground);
  line-height: 1;
  margin-bottom: .65rem;
}
.pricing-amount .currency { font-size: 1.4rem; vertical-align: top; margin-right: 2px; opacity: .7; }
.pricing-amount .cadence { font-size: 1rem; color: var(--muted-foreground); font-weight: 600; margin-left: 4px; }
.pricing-blurb {
  font-size: .95rem;
  color: var(--muted-foreground);
  line-height: 1.5;
}

.pricing-features {
  list-style: none;
  padding: 0;
  margin: 0 0 28px;
  flex: 1;
  display: grid;
  gap: .55rem;
}
.pricing-features li {
  position: relative;
  padding-left: 1.6rem;
  font-size: .92rem;
  color: var(--foreground);
}
.pricing-features li::before {
  content: "";
  position: absolute;
  left: 0; top: .42rem;
  width: 16px; height: 16px;
  border-radius: 999px;
  background-color: #4666e0;
  background-image: var(--gradient-hero);
  box-shadow: inset 0 0 0 2px white;
}
.pricing-features li.muted { color: var(--muted-foreground); font-style: italic; font-size: .85rem; }
.pricing-features li.muted::before { background: var(--muted); opacity: .5; }

.pricing-cta { width: 100%; }
.pricing-foot {
  text-align: center;
  font-size: .85rem;
  color: var(--muted-foreground);
  max-width: 640px;
  margin: 16px auto 0;
}

/* 4-column pricing grid for /order.html — wraps responsively. */
.pricing-grid--4 {
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}
.pricing-grid--4 .pricing-card { padding: 32px 24px; }
.pricing-grid--4 .pricing-amount { font-size: 2.2rem; }
.pricing-grid--4 .pricing-tier { font-size: .82rem; }
.pricing-grid--4 .pricing-features li { font-size: .88rem; }
@media (max-width: 1180px) {
  .pricing-grid--4 { grid-template-columns: repeat(2, 1fr); }
  .pricing-grid--4 .pricing-card--featured { transform: none; }
}
@media (max-width: 600px) {
  .pricing-grid--4 { grid-template-columns: 1fr; max-width: 480px; margin-left: auto; margin-right: auto; }
}

/* ===========================================================
   Comparison table (pricing comparison on /order.html)
   =========================================================== */
.compare-card {
  padding: 0;
  overflow-x: auto;
}
.compare-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .92rem;
}
.compare-table th,
.compare-table td {
  padding: 14px 18px;
  text-align: center;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.compare-table thead th {
  font-size: 1rem;
  font-weight: 800;
  color: var(--foreground);
  background: var(--muted);
  padding: 18px;
  letter-spacing: -.01em;
}
.compare-table thead .compare-th--feat {
  color: var(--primary);
  position: relative;
}
.compare-table thead .compare-th--feat::after {
  content: "MOST POPULAR";
  display: block;
  font-size: .62rem;
  letter-spacing: .12em;
  color: var(--primary);
  margin-top: 4px;
  font-weight: 700;
}
.compare-table .compare-feat-col {
  text-align: left;
  font-weight: 600;
  color: var(--foreground);
  width: 32%;
  background: transparent;
}
.compare-table .compare-price-row td,
.compare-table .compare-price-row th {
  background: rgba(70, 102, 224, .04);
  font-size: 1.05rem;
}
.compare-table .compare-blurb-row td,
.compare-table .compare-blurb-row th {
  font-size: .85rem;
  color: var(--muted-foreground);
}
.compare-table .compare-cat-row td {
  background: var(--muted);
  text-align: left;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .14em;
  font-size: .78rem;
  color: var(--muted-foreground);
  padding: 14px 18px;
}
.compare-table .compare-cat-row .compare-cat-sub {
  text-transform: none;
  letter-spacing: 0;
  font-weight: 500;
  color: var(--muted-foreground);
  margin-left: 6px;
}
.compare-table .tick {
  display: inline-block;
  width: 22px; height: 22px;
  line-height: 22px;
  border-radius: 999px;
  background-color: #4666e0;
  background-image: var(--gradient-hero);
  color: white;
  font-size: .8rem;
  font-weight: 700;
}
.compare-table .dash {
  color: var(--muted-foreground);
  opacity: .5;
}
.compare-table .muted-inline {
  display: block;
  font-size: .72rem;
  color: var(--muted-foreground);
  margin-top: 2px;
}
@media (max-width: 760px) {
  .compare-table th,
  .compare-table td { padding: 10px 8px; font-size: .82rem; }
  .compare-table .compare-feat-col { width: 36%; font-size: .82rem; }
}

/* ===========================================================
   FAQ list
   =========================================================== */
.faq-list {
  display: grid;
  gap: 14px;
}
.faq-item {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px 22px;
  transition: border-color .2s ease;
}
.faq-item[open] {
  border-color: var(--primary);
}
.faq-item summary {
  cursor: pointer;
  font-weight: 700;
  font-size: 1rem;
  color: var(--foreground);
  list-style: none;
  position: relative;
  padding-right: 28px;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
  content: "+";
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1.6rem;
  font-weight: 400;
  color: var(--primary);
  line-height: 1;
}
.faq-item[open] summary::after { content: "−"; }
.faq-item p {
  margin: 12px 0 0;
  color: var(--muted-foreground);
  line-height: 1.6;
  font-size: .95rem;
}

/* ===========================================================
   Content recommendations — filter chips + status badges
   =========================================================== */
.idea-filters {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 20px;
  padding: 18px 0;
}
.idea-filter-group {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.idea-filter-label {
  font-size: .72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .12em;
  color: var(--muted-foreground);
  margin-right: 4px;
}
.idea-filter-actions { margin-left: auto; }
.idea-chip {
  background: var(--card);
  border: 1px solid var(--border);
  color: var(--foreground);
  font-family: inherit;
  font-size: .85rem;
  font-weight: 500;
  padding: 6px 12px;
  border-radius: 999px;
  cursor: pointer;
  transition: background .15s ease, border-color .15s ease, color .15s ease;
  white-space: nowrap;
}
.idea-chip:hover {
  border-color: var(--primary);
}
.idea-chip--active {
  background-color: #4666e0;
  background-image: var(--gradient-hero);
  color: white;
  border-color: transparent;
}
.idea-chip-count {
  display: inline-block;
  background: rgba(255, 255, 255, .25);
  padding: 1px 7px;
  border-radius: 999px;
  font-size: .72rem;
  font-weight: 700;
  margin-left: 4px;
  vertical-align: middle;
}
.idea-chip:not(.idea-chip--active) .idea-chip-count {
  background: var(--muted);
  color: var(--muted-foreground);
}

/* Refresh-due alert banner shown above filter chips when articles are overdue */
.refresh-alert {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 20px;
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, rgba(239, 68, 68, .08), rgba(239, 68, 68, .04));
  border: 1px solid rgba(239, 68, 68, .25);
  border-left: 4px solid rgb(220, 38, 38);
  margin-bottom: 16px;
}
.refresh-alert-icon {
  font-size: 1.6rem;
  line-height: 1;
  flex: 0 0 auto;
}
.refresh-alert-text {
  flex: 1;
  min-width: 0;
}
.refresh-alert-text strong {
  display: block;
  color: rgb(153, 27, 27);
  font-size: 1rem;
  margin-bottom: 2px;
}
.refresh-alert-text span {
  font-size: .85rem;
  color: var(--muted-foreground);
  line-height: 1.4;
}
.refresh-alert .btn {
  flex: 0 0 auto;
}

/* "Needs refresh" chip — red dot to draw the eye */
.idea-chip--needs-refresh {
  border-color: rgba(220, 38, 38, .35);
  color: rgb(153, 27, 27);
}
.idea-chip--needs-refresh:hover {
  border-color: rgb(220, 38, 38);
}
.idea-chip--needs-refresh.idea-chip--active {
  background-color: rgb(220, 38, 38);
  background-image: none;
  border-color: transparent;
  color: white;
}
.idea-chip-count--alert {
  background: rgba(220, 38, 38, .15) !important;
  color: rgb(153, 27, 27) !important;
}
.idea-chip--active .idea-chip-count--alert {
  background: rgba(255, 255, 255, .3) !important;
  color: white !important;
}

/* Content-recommendations top header — heading + summary + CTA */
.content-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
}
.content-header-cta {
  flex: 0 0 auto;
  white-space: nowrap;
}
@media (max-width: 720px) {
  .content-header { align-items: stretch; }
  .content-header-cta { width: 100%; }
}

/* ───────────────────────────────────────────────────────────
   Elegant idea cards — refined pill styling, hidden due-date
   editor by default, restrained colour palette
   ─────────────────────────────────────────────────────────── */

/* Override the old loud pill style — keep them small and quiet */
.idea-card .idea-pill {
  font-size: .68rem !important;
  font-weight: 600 !important;
  padding: 2px 8px !important;
  letter-spacing: .04em !important;
  text-transform: none !important;
  border: 1px solid transparent;
}

/* Subtler palette — pastel backgrounds, refined ink colors */
.idea-card .idea-pill--seasonal {
  background: rgba(245, 158, 11, .08);
  color: rgb(146, 64, 14);
  border-color: rgba(245, 158, 11, .15);
}
.idea-card .idea-pill--evergreen {
  background: rgba(16, 185, 129, .08);
  color: rgb(6, 95, 70);
  border-color: rgba(16, 185, 129, .15);
}
.idea-card .idea-pill--paa {
  background: rgba(99, 102, 241, .08);
  color: rgb(67, 56, 202);
  border-color: rgba(99, 102, 241, .15);
}
.idea-card .tier-easy {
  background: rgba(34, 197, 94, .08);
  color: rgb(21, 128, 61);
  border-color: rgba(34, 197, 94, .15);
}
.idea-card .tier-mid {
  background: rgba(245, 158, 11, .08);
  color: rgb(146, 64, 14);
  border-color: rgba(245, 158, 11, .15);
}
.idea-card .tier-hard {
  background: rgba(239, 68, 68, .08);
  color: rgb(153, 27, 27);
  border-color: rgba(239, 68, 68, .15);
}
.idea-card .idea-pill--season {
  background: rgba(118, 64, 198, .06);
  color: rgb(91, 33, 182);
  border-color: rgba(118, 64, 198, .12);
  text-transform: capitalize;
}

/* Status badges — slightly more emphasis than pills, but still calm */
.idea-badges {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin: 0 0 10px;
}
.idea-status {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: .72rem;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: 999px;
}
.idea-status--generated {
  background: rgba(70, 102, 224, .08);
  color: var(--primary);
}
.idea-status--published {
  background: rgba(34, 197, 94, .10);
  color: rgb(21, 128, 61);
}

/* Refined left-border accent for status (thinner than before) */
.idea-card--published { border-left: 3px solid rgb(34, 197, 94); }
.idea-card--generated:not(.idea-card--published) { border-left: 3px solid var(--primary); }

/* Tighten card meta spacing */
.idea-card .idea-meta {
  gap: 5px !important;
  margin-bottom: 10px !important;
}

/* Title hierarchy — bigger, query muted, rationale even quieter */
.idea-card .idea-title {
  font-size: 1.05rem !important;
  font-weight: 700 !important;
  line-height: 1.35 !important;
  margin: 0 0 8px !important;
  color: var(--foreground);
}
.idea-card .idea-query {
  font-size: .82rem !important;
  color: var(--muted-foreground);
  margin: 0 0 8px;
}
.idea-card .idea-query strong {
  color: var(--foreground) !important;
  font-weight: 500;
}
.idea-card .idea-rationale {
  font-size: .85rem !important;
  color: var(--muted-foreground);
  line-height: 1.5;
  margin: 0 0 12px !important;
}

/* Action buttons — clean row at the bottom */
.idea-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 14px;
}
.idea-actions .btn {
  font-size: .82rem;
  padding: 6px 14px;
}

/* Due-date control — hidden by default until clicked, restrained styling */
.idea-due {
  margin-top: 10px;
  font-size: .78rem;
  color: var(--muted-foreground);
}
.idea-due-toggle {
  background: transparent;
  border: none;
  color: var(--muted-foreground);
  font-family: inherit;
  font-size: .78rem;
  cursor: pointer;
  padding: 0;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.idea-due-toggle:hover { color: var(--primary); }
.idea-due--overdue .idea-due-toggle {
  color: rgb(220, 38, 38);
  font-weight: 600;
}

/* CRITICAL: [hidden] must beat display:flex — use attribute selector */
.idea-due-edit[hidden] { display: none !important; }
.idea-due-edit {
  margin-top: 8px;
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  align-items: center;
}
.idea-due-input {
  font-family: inherit;
  font-size: .85rem;
  padding: 5px 9px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--card);
}
.idea-due-edit .btn { font-size: .78rem; padding: 4px 10px; }

/* ===========================================================
   Article preview — featured image placeholder
   =========================================================== */
.article-image-placeholder {
  width: 100%;
  aspect-ratio: 16 / 9;
  border: 2px dashed rgba(70, 102, 224, .35);
  background: linear-gradient(135deg, rgba(70, 102, 224, .04), rgba(118, 64, 198, .04));
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 28px;
}
.article-image-placeholder-inner {
  text-align: center;
  padding: 24px;
}
.article-image-placeholder-icon {
  display: block;
  font-size: 2.4rem;
  margin-bottom: 10px;
  opacity: .7;
}
.article-image-placeholder-inner strong {
  display: block;
  color: var(--foreground);
  font-size: 1rem;
  margin-bottom: 6px;
}
.article-image-placeholder-sub {
  display: block;
  color: var(--muted-foreground);
  font-size: .85rem;
  line-height: 1.4;
}
@media (max-width: 600px) {
  .article-image-placeholder-icon { font-size: 1.8rem; }
  .article-image-placeholder-inner strong { font-size: .9rem; }
}

/* ===========================================================
   Article generation — rotating phase indicator
   =========================================================== */
.loading-steps {
  list-style: none;
  padding: 0;
  margin: 28px auto 0;
  max-width: 380px;
  text-align: left;
}
.loading-step {
  position: relative;
  padding: 10px 12px 10px 38px;
  font-size: .92rem;
  color: var(--muted-foreground);
  border-radius: var(--radius);
  margin-bottom: 4px;
  transition: background .2s ease, color .2s ease;
}
.loading-step::before {
  content: "○";
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  font-size: 1.1rem;
  font-weight: 700;
}
.loading-step--active {
  background: rgba(70, 102, 224, .08);
  color: var(--foreground);
  font-weight: 600;
}
.loading-step--active::before {
  content: "◐";
  color: var(--primary);
  animation: phase-spin 1.5s linear infinite;
}
.loading-step--done {
  color: var(--muted-foreground);
  opacity: .7;
}
.loading-step--done::before {
  content: "✓";
  color: rgb(34, 197, 94);
  animation: none;
}
@keyframes phase-spin {
  to { transform: translateY(-50%) rotate(360deg); }
}

/* ===========================================================
   Settings sub-tabs (Tone of voice ↔ One-click publish)
   =========================================================== */
.settings-tabs {
  border-bottom: 1px solid var(--border);
  background: var(--background);
  position: sticky;
  top: 0;
  z-index: 10;
}
.settings-tabs .container {
  display: flex;
  gap: 4px;
  padding-top: 12px;
  padding-bottom: 0;
  max-width: 760px;
}
.settings-tab {
  background: transparent;
  border: none;
  border-bottom: 3px solid transparent;
  font-family: inherit;
  font-size: .95rem;
  font-weight: 600;
  color: var(--muted-foreground);
  padding: 12px 18px;
  cursor: pointer;
  transition: color .15s ease, border-color .15s ease;
  margin-bottom: -1px;
}
.settings-tab:hover { color: var(--foreground); }
.settings-tab--active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}
@media (max-width: 600px) {
  .settings-tab { padding: 10px 12px; font-size: .88rem; }
}

/* ===========================================================
   Publishing & CMS — Settings section + Article publish button
   =========================================================== */
.cms-status-banner {
  background: linear-gradient(135deg, rgba(34, 197, 94, .10), rgba(34, 197, 94, .05));
  border: 1px solid rgba(34, 197, 94, .35);
  border-radius: var(--radius-lg);
  padding: 14px 18px;
  margin-bottom: 20px;
}
.cms-status-inner {
  display: flex;
  align-items: center;
  gap: 14px;
}
.cms-status-icon {
  width: 32px; height: 32px;
  line-height: 32px;
  text-align: center;
  border-radius: 999px;
  background: rgb(34, 197, 94);
  color: white;
  font-weight: 700;
  flex: 0 0 auto;
}
.cms-status-text {
  flex: 1;
  min-width: 0;
}
.cms-status-text strong { display: block; color: var(--foreground); }
.cms-status-text span   { display: block; font-size: .85rem; }

.cms-provider-fields .field { display: block; }
.cms-action-row {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 18px;
  flex-wrap: wrap;
}
.cms-test-status {
  margin: 0;
  flex: 1 1 280px;
  font-size: .9rem;
  padding: 10px 14px;
  border-radius: var(--radius);
}
.cms-test-status--ok  { background: rgba(34, 197, 94, .10); color: rgb(21, 128, 61); border: 1px solid rgba(34, 197, 94, .25); }
.cms-test-status--err { background: rgba(239, 68, 68, .10); color: rgb(153, 27, 27); border: 1px solid rgba(239, 68, 68, .25); }

.field-help {
  font-size: .8rem;
  font-weight: 500;
  color: var(--primary);
  margin-left: 8px;
  text-decoration: none;
}
.field-help:hover { text-decoration: underline; }

/* Inline "How do I get this?" toggle button */
.field-help-btn {
  font-size: .8rem;
  font-weight: 500;
  color: var(--primary);
  margin-left: 8px;
  background: transparent;
  border: none;
  padding: 0;
  cursor: pointer;
  font-family: inherit;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.field-help-btn:hover { color: var(--foreground); }

/* The expandable help-panel content shown by the button */
.field-help-panel {
  background: rgba(70, 102, 224, .04);
  border: 1px solid rgba(70, 102, 224, .18);
  border-radius: var(--radius-lg);
  margin: 12px 0 4px;
  padding: 0;
  overflow: hidden;
  transition: background .2s ease;
}
.field-help-panel[open] {
  background: rgba(70, 102, 224, .07);
}
.field-help-panel > summary {
  cursor: pointer;
  padding: 14px 18px;
  font-weight: 600;
  font-size: .92rem;
  color: var(--foreground);
  list-style: none;
  position: relative;
  padding-right: 36px;
}
.field-help-panel > summary::-webkit-details-marker { display: none; }
.field-help-panel > summary::after {
  content: "▸";
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--primary);
  transition: transform .2s ease;
}
.field-help-panel[open] > summary::after { transform: translateY(-50%) rotate(90deg); }

.field-help-panel ol.help-steps {
  margin: 0;
  padding: 0 22px 14px 40px;
  font-size: .9rem;
  line-height: 1.6;
  color: var(--foreground);
}
.field-help-panel ol.help-steps > li { margin-bottom: 6px; }
.field-help-panel ol.help-steps > li:last-child { margin-bottom: 0; }
.field-help-panel ol.help-steps ul {
  margin: 6px 0;
  padding-left: 20px;
}
.field-help-panel ol.help-steps ul li { margin-bottom: 2px; }
.field-help-panel code {
  background: rgba(70, 102, 224, .12);
  padding: 1px 5px;
  border-radius: 4px;
  font-size: .85em;
}
.field-help-panel .help-note {
  margin: 4px 18px 16px;
  padding: 10px 14px;
  background: rgba(255, 193, 7, .10);
  border-left: 3px solid rgb(255, 193, 7);
  border-radius: 4px;
  font-size: .85rem;
  color: var(--foreground);
  line-height: 1.5;
}

/* Publish modal on /article.html */
.publish-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, .55);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
}
.publish-modal-backdrop[hidden] { display: none; }
.publish-modal {
  background: var(--card);
  border-radius: var(--radius-xl);
  padding: 32px 32px 28px;
  max-width: 520px;
  width: 100%;
  box-shadow: 0 24px 80px rgba(15, 23, 42, .25);
}
.publish-modal h3 {
  margin: 0 0 6px;
  font-size: 1.4rem;
  letter-spacing: -.02em;
}
.publish-modal .publish-modal-sub {
  color: var(--muted-foreground);
  margin: 0 0 22px;
  font-size: .95rem;
}
.publish-modal .field { margin-bottom: 14px; }
.publish-modal-cta {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-top: 20px;
  flex-wrap: wrap;
}
.publish-modal-cta .btn-ghost { margin-left: auto; }
.publish-result {
  margin-top: 16px;
  padding: 14px 16px;
  border-radius: var(--radius-lg);
  font-size: .95rem;
  line-height: 1.5;
}
.publish-result--ok {
  background: rgba(34, 197, 94, .10);
  border: 1px solid rgba(34, 197, 94, .25);
  color: rgb(21, 128, 61);
}
.publish-result--err {
  background: rgba(239, 68, 68, .10);
  border: 1px solid rgba(239, 68, 68, .25);
  color: rgb(153, 27, 27);
}
.publish-result a {
  display: inline-block;
  margin-right: 12px;
  font-weight: 600;
}

/* ===========================================================
   Plan gating — blurred rows + upgrade modal + gated buttons
   =========================================================== */

/* Free-tier row blur: keep visible structure but obscure values. */
.data-table tr.row-locked > * {
  filter: blur(5px);
  opacity: .55;
  pointer-events: none;
  user-select: none;
  transition: filter .2s ease, opacity .2s ease;
}

/* The CTA row inserted right after the last locked row. */
.data-table tr.row-locked-overlay > td {
  padding: 0;
  border: none;
  background: transparent;
}
.row-locked-cta {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 22px 24px;
  margin: 8px 0;
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg,
    rgba(70, 102, 224, .10) 0%,
    rgba(118, 64, 198, .08) 100%);
  border: 1px dashed rgba(70, 102, 224, .35);
  flex-wrap: wrap;
}
.row-locked-cta strong {
  font-size: 1rem;
  color: var(--foreground);
  flex: 0 0 auto;
}
.row-locked-cta span {
  color: var(--muted-foreground);
  font-size: .9rem;
  flex: 1 1 240px;
}
.row-locked-cta .btn {
  flex: 0 0 auto;
}

/* Gated button — visible but signals "upgrade required" on hover. */
.btn-gated {
  position: relative;
  opacity: .65;
}
.btn-gated::after {
  content: "🔒";
  margin-left: 6px;
  font-size: .85em;
}

/* Upgrade-modal backdrop + dialog. */
.upgrade-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, .55);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
  animation: upgrade-fade-in .15s ease-out;
}
.upgrade-modal-backdrop[hidden] { display: none; }
@keyframes upgrade-fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}
.upgrade-modal {
  position: relative;
  background: var(--card);
  border-radius: var(--radius-xl);
  padding: 36px 36px 32px;
  max-width: 480px;
  width: 100%;
  box-shadow: 0 24px 80px rgba(15, 23, 42, .25);
  animation: upgrade-pop-in .2s cubic-bezier(.16, 1, .3, 1);
}
@keyframes upgrade-pop-in {
  from { transform: scale(.94); opacity: 0; }
  to   { transform: scale(1);   opacity: 1; }
}
.upgrade-modal-close {
  position: absolute;
  top: 14px; right: 18px;
  background: transparent;
  border: none;
  font-size: 1.8rem;
  line-height: 1;
  color: var(--muted-foreground);
  cursor: pointer;
  padding: 4px 8px;
  border-radius: var(--radius);
  transition: background .15s ease, color .15s ease;
}
.upgrade-modal-close:hover {
  background: var(--muted);
  color: var(--foreground);
}
.upgrade-modal-eyebrow {
  font-size: .72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .16em;
  color: var(--primary);
  margin-bottom: 12px;
}
.upgrade-modal-title {
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -.02em;
  margin: 0 0 14px;
  color: var(--foreground);
}
.upgrade-modal-body {
  margin: 0 0 24px;
  color: var(--muted-foreground);
  line-height: 1.6;
  font-size: .98rem;
}
.upgrade-modal-cta {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}
.upgrade-modal-cta .btn-ghost {
  margin-left: auto;
}

/* ===========================================================
   Strategic Partnership — premium invite-only upsell block
   =========================================================== */
.strategic-partnership {
  position: relative;
  border-radius: var(--radius-xl);
  background: linear-gradient(135deg,
    rgba(70, 102, 224, .08) 0%,
    rgba(118, 64, 198, .06) 50%,
    rgba(70, 102, 224, .08) 100%);
  border: 1px solid rgba(70, 102, 224, .22);
  padding: 48px 44px;
  box-shadow: var(--shadow-elegant);
}
.strategic-partnership::before {
  content: "";
  position: absolute;
  top: 0; left: 0;
  width: 6px; height: 100%;
  background-image: var(--gradient-hero);
  border-radius: var(--radius-xl) 0 0 var(--radius-xl);
}
.sp-head { margin-bottom: 32px; max-width: 680px; }
.sp-badge {
  display: inline-block;
  background-color: #4666e0;
  background-image: var(--gradient-hero);
  color: white;
  font-size: .68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .16em;
  padding: 6px 14px;
  border-radius: 999px;
  margin-bottom: 16px;
}
.sp-head h2 {
  font-size: 2rem;
  line-height: 1.15;
  letter-spacing: -.02em;
  margin: 0 0 14px;
  color: var(--foreground);
}
.sp-lead {
  font-size: 1.05rem;
  line-height: 1.6;
  color: var(--muted-foreground);
  margin: 0;
}
.sp-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 36px;
  align-items: start;
}
@media (max-width: 820px) {
  .strategic-partnership { padding: 32px 24px; }
  .sp-head h2 { font-size: 1.55rem; }
  .sp-grid { grid-template-columns: 1fr; gap: 28px; }
}
.sp-features {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 14px;
}
.sp-features li {
  position: relative;
  padding-left: 28px;
  font-size: .95rem;
  line-height: 1.55;
  color: var(--foreground);
}
.sp-features li::before {
  content: "✓";
  position: absolute;
  left: 0; top: 0;
  width: 20px; height: 20px;
  line-height: 20px;
  text-align: center;
  font-size: .78rem;
  font-weight: 700;
  border-radius: 999px;
  background-color: #4666e0;
  background-image: var(--gradient-hero);
  color: white;
}
.sp-features strong { color: var(--foreground); font-weight: 700; }
.sp-cta-box {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px 24px;
  box-shadow: var(--shadow-soft);
  text-align: center;
}
.sp-price-line {
  font-size: 1rem;
  color: var(--muted-foreground);
  margin-bottom: 4px;
}
.sp-price-line strong {
  color: var(--foreground);
  font-weight: 800;
  font-size: 1.6rem;
  display: block;
  margin-top: 4px;
  letter-spacing: -.01em;
}
.sp-cta-blurb {
  font-size: .9rem;
  color: var(--muted-foreground);
  line-height: 1.5;
  margin: 14px 0 20px;
}
.sp-fine {
  font-size: .78rem;
  color: var(--muted-foreground);
  margin: 14px 0 0;
  line-height: 1.5;
}

/* ===========================================================
   Order page summary
   =========================================================== */
.order-summary {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px 22px;
  display: grid;
  gap: 10px;
  box-shadow: var(--shadow-soft);
}
.order-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: .95rem;
}
.order-row-label {
  color: var(--muted-foreground);
  font-weight: 500;
}
.order-row-value {
  font-weight: 700;
  color: var(--foreground);
}

/* ===========================================================
   Dashboard — metric cards + data-card heading
   =========================================================== */
.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}
@media (max-width: 760px) { .metric-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 460px) { .metric-grid { grid-template-columns: 1fr; } }

.metric-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 24px 22px;
  box-shadow: var(--shadow-soft);
  transition: transform .2s ease, box-shadow .2s ease;
}
.metric-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-elegant); }
.metric-num {
  font-size: 2.2rem;
  font-weight: 800;
  letter-spacing: -.03em;
  line-height: 1;
  background-color: #4666e0;
  background-image: var(--gradient-hero);
  -webkit-background-clip: text;
  background-clip: text;
  color: #4666e0;
}
@supports (background-clip: text) or (-webkit-background-clip: text) {
  .metric-num { color: transparent; }
}
.metric-label {
  margin-top: .5rem;
  font-size: .85rem;
  font-weight: 600;
  color: var(--muted-foreground);
}

.data-card-head {
  padding: 14px 22px;
  font-size: .75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .12em;
  color: var(--primary-deep);
  border-bottom: 1px solid var(--border);
  background: oklch(95% .05 250);
  background: var(--accent);
}

/* AI Visibility metric card — same shape as the others but gradient bg */
.metric-card--ai {
  background-color: #4666e0;
  background-image: linear-gradient(135deg, #4666e0 0%, #6aa5f5 100%);
  background-image: var(--gradient-hero);
  border-color: transparent;
  color: white;
}
.metric-card--ai .metric-num {
  -webkit-text-fill-color: white;
  background: none;
  color: white;
}
.metric-card--ai .metric-label { color: rgba(255,255,255,.85); }
.metric-link {
  display: inline-block;
  margin-top: .35rem;
  font-size: .8rem;
  font-weight: 600;
  color: white;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.metric-link:hover { opacity: .85; }

.skeleton--num { width: 80px; height: 36px; border-radius: 8px; }

/* ===========================================================
   Dashboard nav (4 pages)
   =========================================================== */
.dash-nav {
  border-top: 1px solid var(--border);
  background: var(--card);
}
.dash-nav .container {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.dash-nav-link {
  padding: 14px 18px;
  font-size: .92rem;
  font-weight: 600;
  color: var(--muted-foreground);
  border-bottom: 2px solid transparent;
  transition: color .15s ease, border-color .15s ease;
}
.dash-nav-link:hover { color: var(--foreground); }
.dash-nav-link--active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}
.dash-nav-link--active:hover { color: var(--primary); }

/* Compact header input — used on dashboard pages */
.header-domain-input,
.header-ga4-input {
  height: 36px;
  padding: 0 12px;
  font-size: .9rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--background);
  color: var(--foreground);
}
.header-domain-input { width: 200px; }
.header-ga4-input { width: 110px; }
.header-domain-input:focus,
.header-ga4-input:focus {
  outline: none;
  border-color: var(--primary);
}

/* Property dropdown that replaces the text input when authenticated */
.header-domain-select {
  height: 36px;
  padding: 0 30px 0 12px;
  font-size: .9rem;
  font-weight: 600;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--background);
  color: var(--foreground);
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'><path fill='%23748' d='M4 6l4 4 4-4z'/></svg>");
  background-position: right 8px center;
  background-repeat: no-repeat;
  background-size: 14px;
}
.header-domain-select:hover { border-color: var(--primary); }
.header-domain-select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px oklch(70% .18 245 / .2);
}

/* ===========================================================
   Settings page — Tone of Voice
   =========================================================== */
.settings-form {
  margin-top: 8px;
}
.settings-group {
  margin: 0 0 32px;
  padding: 28px 28px 24px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-soft);
}
.settings-group legend {
  font-size: .85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .14em;
  color: var(--primary);
  padding: 0 10px;
  margin-left: -10px;
}
.settings-help {
  font-size: .92rem;
  color: var(--muted-foreground);
  margin: 0 0 16px;
  line-height: 1.55;
}
.settings-help em { color: var(--primary-deep); font-style: normal; font-weight: 600; }

.settings-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px 20px;
}
.settings-grid .field { margin: 0; }
.settings-grid .full-width { grid-column: 1 / -1; }
@media (max-width: 640px) {
  .settings-grid { grid-template-columns: 1fr; }
}

.settings-group .field span:first-child {
  display: block;
  font-size: .85rem;
  font-weight: 600;
  color: var(--foreground);
  margin-bottom: 6px;
}
.settings-group input[type="text"],
.settings-group input[type="url"],
.settings-group select,
.settings-group textarea {
  width: 100%;
  padding: 11px 14px;
  border: 1px solid var(--input);
  background: var(--background);
  border-radius: 10px;
  font: inherit;
  font-size: .95rem;
  color: var(--foreground);
  transition: border-color .15s ease, box-shadow .15s ease;
}
.settings-group select {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 32px;
  cursor: pointer;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'><path fill='%23748' d='M4 6l4 4 4-4z'/></svg>");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 14px;
}
.settings-group textarea {
  resize: vertical;
  min-height: 84px;
  line-height: 1.55;
  font-family: inherit;
}
.settings-group input:focus,
.settings-group select:focus,
.settings-group textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px oklch(70% .18 245 / .2);
}

.char-count { font-variant-numeric: tabular-nums; color: var(--primary-deep); font-weight: 600; }

.settings-actions {
  position: sticky;
  bottom: 16px;
  z-index: 10;
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 18px 22px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-elegant);
  margin-top: 24px;
}
.settings-status {
  margin: 0;
  font-size: .9rem;
  font-weight: 600;
}
.settings-status--ok    { color: var(--score-good); }
.settings-status--error { color: var(--score-bad); }

/* Signed-in user chip */
.header-user {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: .85rem;
  color: var(--muted-foreground);
  padding: 0 4px;
}
.header-user-email {
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
@media (max-width: 760px) {
  .header-user-email { display: none; }
  .header-domain-select { max-width: 160px; }
}
.btn-sm { height: 36px; padding: 0 .9rem; font-size: .85rem; border-radius: 8px; }

@media (max-width: 760px) {
  .header-domain-input { width: 140px; }
  .header-ga4-input { display: none; }
}

/* 5- and 3-column metric grids */
.metric-grid--5 { grid-template-columns: repeat(5, 1fr); }
.metric-grid--3 { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 1100px) { .metric-grid--5 { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 760px)  { .metric-grid--5, .metric-grid--3 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 480px)  { .metric-grid--5, .metric-grid--3 { grid-template-columns: 1fr; } }

.metric-foot { margin-top: .35rem; font-size: .75rem; color: var(--muted-foreground); }
.metric-card--ai .metric-foot { color: rgba(255,255,255,.75); }
.metric-card--llm .metric-num {
  color: var(--primary-deep);
  -webkit-text-fill-color: initial;
  background: none;
}
.muted-num { color: var(--muted-foreground); font-weight: 600; }

.row-title {
  font-size: .8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .14em;
  color: var(--muted-foreground);
  margin: 24px 0 12px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

/* ===========================================================
   Narrative card (summary on dashboard Home)
   =========================================================== */
.narrative-section { padding-top: 24px !important; padding-bottom: 32px !important; }
.narrative-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-2xl);
  padding: 36px 40px;
  box-shadow: var(--shadow-soft);
  max-width: 880px;
  margin: 0 auto;
}
.narrative-headline {
  font-size: 1.6rem;
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: -.02em;
  margin: 0 0 .9rem;
  color: var(--foreground);
}
.narrative-lead {
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1.55;
  color: var(--foreground);
  margin: 0 0 1.25rem;
}
.narrative-lead b {
  color: var(--primary-deep);
  font-weight: 800;
}
.narrative-body p {
  font-size: .98rem;
  line-height: 1.65;
  color: var(--foreground);
  margin: 0 0 .85rem;
}
.narrative-body p:last-child { margin-bottom: 0; }
.narrative-body b {
  color: var(--primary-deep);
  font-weight: 700;
}

/* Recommendations card under narrative */
.recommendations-card {
  background: linear-gradient(180deg, oklch(98% .04 250) 0%, oklch(100% 0 0) 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 28px 32px;
  margin: 24px auto 0;
  max-width: 880px;
}
.recommendations-title {
  font-size: .8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .14em;
  color: var(--primary);
  margin: 0 0 1rem;
}
.recommendations-list {
  list-style: none; padding: 0; margin: 0;
  display: grid; gap: 14px;
}
.recommendations-list li { padding-left: 20px; position: relative; }
.recommendations-list li::before {
  content: "→"; position: absolute; left: 0; top: 1px;
  color: var(--primary); font-weight: 700;
}
.recommendations-list h5 { font-size: 1rem; font-weight: 700; margin: 0 0 .3rem; color: var(--foreground); }
.recommendations-list p { font-size: .9rem; line-height: 1.55; margin: 0; color: var(--muted-foreground); }
.recommendations-list code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: .85em;
  background: var(--muted);
  padding: 1px 6px;
  border-radius: 4px;
}

/* YoY indicators on revenue cards */
/* YoY deltas — only positive changes are shown. Negative YoY on
   organic metrics is almost always misread (customers don't connect
   it to AI Overview intercepting clicks) so the dashboard simply
   omits the number and shows a soft context line instead. */
.yoy-up {
  color: var(--muted-foreground);
  font-weight: 500;
}
.yoy-down { display: none; } /* never rendered — kept for back-compat */

/* ===========================================================
   Brand grouping in Organic insights
   =========================================================== */
.brand-row {
  background: oklch(95% .05 250);
  background: var(--accent);
}
.brand-row td { font-weight: 600; }

/* ===========================================================
   Climbing — keywords whose Google rank improved most
   =========================================================== */
.climbing-list {
  display: grid;
  gap: 10px;
  margin-bottom: 18px;
}
.climbing-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 18px;
  border-radius: var(--radius-lg);
  background: rgba(34, 197, 94, .04);
  border: 1px solid rgba(34, 197, 94, .18);
  transition: background .15s ease, border-color .15s ease;
}
.climbing-row:hover {
  background: rgba(34, 197, 94, .07);
  border-color: rgba(34, 197, 94, .30);
}
.climbing-row-text {
  flex: 1;
  min-width: 0;
}
.climbing-query {
  margin: 0 0 2px;
  font-size: 1rem;
  font-weight: 700;
  color: var(--foreground);
  line-height: 1.3;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.climbing-meta {
  margin: 0;
  font-size: .82rem;
  color: var(--muted-foreground);
}
.climbing-delta {
  flex: 0 0 auto;
  font-size: .9rem;
  font-weight: 700;
  color: rgb(21, 128, 61);
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(34, 197, 94, .12);
  white-space: nowrap;
}
.climbing-empty {
  padding: 24px;
  text-align: center;
}
.climbing-actions {
  text-align: center;
  margin-top: 8px;
}
@media (max-width: 600px) {
  .climbing-row { flex-direction: column; align-items: flex-start; gap: 8px; }
  .climbing-row-text { width: 100%; }
}

/* Contextual add-on upsell shown under truncated expand panels */
.addon-upsell {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 18px;
  margin: 10px 0 4px;
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, rgba(70, 102, 224, .07), rgba(118, 64, 198, .05));
  border: 1px dashed rgba(70, 102, 224, .35);
}
.addon-upsell-text { flex: 1; min-width: 0; }
.addon-upsell-text strong {
  display: block;
  color: var(--foreground);
  font-size: .95rem;
  margin-bottom: 2px;
}
.addon-upsell-text span {
  font-size: .82rem;
  color: var(--muted-foreground);
  line-height: 1.5;
}
.addon-upsell-text em {
  color: var(--primary);
  font-style: normal;
  font-weight: 600;
}
.addon-upsell .btn { flex: 0 0 auto; white-space: nowrap; }
@media (max-width: 640px) {
  .addon-upsell { flex-direction: column; align-items: stretch; }
  .addon-upsell .btn { width: 100%; }
}

/* Total summary row at top — slightly stronger emphasis */
.brand-row.total-row {
  background: linear-gradient(90deg, rgba(70, 102, 224, .08), rgba(118, 64, 198, .05));
  border-top: 2px solid rgba(70, 102, 224, .25);
  border-bottom: 2px solid rgba(70, 102, 224, .25);
}
.brand-row.total-row .brand-toggle-label {
  color: var(--primary);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .08em;
  font-size: .85rem;
}

/* Brand row — soft lilac-blue (uses the gradient's purple endpoint).
   Reads as "established / a step back from the bold primary blue". */
.brand-row.brand-row--brand {
  background: linear-gradient(90deg, rgba(118, 64, 198, .06), rgba(118, 64, 198, .02));
  border-left: 4px solid rgba(118, 64, 198, .55);
}
.brand-row.brand-row--brand .brand-toggle-label {
  color: rgb(91, 33, 182);
}
.brand-row.brand-row--brand .brand-count {
  background: rgba(118, 64, 198, .14);
  color: rgb(91, 33, 182);
}

/* Generic row — bright sky-blue (uses the gradient's blue endpoint).
   Reads as "the action zone / where to focus next". */
.brand-row.brand-row--generic {
  background: linear-gradient(90deg, rgba(14, 165, 233, .07), rgba(14, 165, 233, .02));
  border-left: 4px solid rgb(14, 165, 233);
}
.brand-row.brand-row--generic .brand-toggle-label {
  color: rgb(7, 89, 133);
}
.brand-row.brand-row--generic .brand-count {
  background: rgba(14, 165, 233, .14);
  color: rgb(7, 89, 133);
}

/* Total stays blue — keep its count chip readable */
.brand-row.total-row .brand-count {
  background: rgba(70, 102, 224, .15);
  color: var(--primary);
}
.brand-toggle {
  background: transparent;
  border: 0;
  padding: 0;
  font: inherit;
  font-weight: 700;
  color: var(--foreground);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.brand-toggle:hover { color: var(--primary); }
.brand-toggle-arrow {
  display: inline-block;
  width: 12px;
  color: var(--muted-foreground);
  font-size: .8rem;
}
.brand-count {
  display: inline-block;
  margin-left: .5rem;
  padding: .15rem .55rem;
  font-size: .72rem;
  font-weight: 600;
  background: var(--card);
  color: var(--muted-foreground);
  border-radius: 999px;
  border: 1px solid var(--border);
}
.brand-expand > td { padding: 0 !important; background: var(--background); }
.data-table--inner { box-shadow: none; }
.data-table--inner th {
  background: oklch(98% .015 250);
  font-size: .68rem;
}
.data-table--inner td { padding: 10px 22px; }

/* AI likelihood pills on the AI insights table */
.likelihood-pill {
  display: inline-block;
  padding: .2rem .65rem;
  border-radius: 999px;
  font-size: .8rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.likelihood-pill--good { background: oklch(94% .08 145); color: oklch(40% .18 145); }
.likelihood-pill--mid  { background: oklch(96% .12 80);  color: oklch(45% .18 75);  }
.likelihood-pill--bad  { background: oklch(94% .07 25);  color: oklch(45% .2 25);   }

/* Expandable rows on AI insights — click any verified row with an AI Overview to see the answer */
.row-expandable { cursor: pointer; }
.row-expandable:hover { background: oklch(98% .015 250); }
.row-toggle {
  display: inline-block;
  width: 14px;
  color: var(--muted-foreground);
  font-size: .85rem;
  margin-right: 4px;
}
.row-expanded > td {
  background: linear-gradient(180deg, oklch(98% .04 250) 0%, oklch(100% 0 0) 100%);
  padding: 22px 26px !important;
  border-top: 0 !important;
}
.ai-detail-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 28px;
  align-items: start;
}
@media (max-width: 880px) {
  .ai-detail-grid { grid-template-columns: 1fr; }
}
.ai-detail-heading {
  font-size: .8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .14em;
  color: var(--primary);
  margin: 0 0 .75rem;
}
.ai-detail-answer {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px 22px;
  font-size: .95rem;
  line-height: 1.6;
  color: var(--foreground);
}
.ai-detail-answer p { margin: 0 0 .8rem; }
.ai-detail-answer p:last-child { margin-bottom: 0; }
.ai-detail-answer ul { margin: 0 0 .8rem 1.4rem; }
.ai-detail-answer li { margin-bottom: .2rem; }
.ai-detail-answer strong { color: var(--primary-deep); }

.ai-detail-side { display: grid; gap: 18px; }
.ai-detail-sources h5 {
  font-size: .8rem;
  text-transform: uppercase;
  letter-spacing: .12em;
  color: var(--muted-foreground);
  margin: 0 0 .55rem;
}
.ai-detail-chips { display: flex; flex-wrap: wrap; gap: 6px 4px; }

.gap-fix-btn { width: 100%; }
.gap-result {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px 18px;
  font-size: .92rem;
  line-height: 1.55;
  color: var(--foreground);
}
.gap-priority {
  padding: 12px 14px;
  background: oklch(95% .07 145);
  color: oklch(35% .18 145);
  border-radius: 8px;
  margin-bottom: 14px;
  font-size: .9rem;
}
.gap-block { margin-bottom: 14px; }
.gap-block:last-child { margin-bottom: 0; }
.gap-block h6 {
  font-size: .72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .12em;
  color: var(--primary);
  margin: 0 0 .4rem;
}
.gap-block ul { margin: 0; padding-left: 1.2rem; }
.gap-block li { margin-bottom: .35rem; }
.gap-list-detailed li { margin-bottom: .65rem; }
.gap-block p { margin: 0; }
.gap-error { color: var(--score-bad); margin: 0; }

/* Brand chips on AI insights table after verification */
.brands-cell {
  vertical-align: middle;
  line-height: 1.8;
}
.brand-chip {
  display: inline-block;
  padding: .15rem .55rem;
  margin: 2px 4px 2px 0;
  font-size: .72rem;
  border-radius: 999px;
  background: var(--muted);
  color: var(--muted-foreground);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  font-weight: 500;
}
.brand-chip--customer {
  background-color: #4666e0;
  background-image: var(--gradient-hero);
  color: white;
  font-weight: 700;
}

/* Live SERP verification bar on AI insights */
.verify-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 22px;
  background: linear-gradient(180deg, oklch(98% .04 250) 0%, oklch(100% 0 0) 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  margin-bottom: 24px;
}
.verify-bar-info { flex: 1; line-height: 1.45; font-size: .92rem; color: var(--muted-foreground); }
.verify-bar-info strong { color: var(--foreground); display: block; margin-bottom: 2px; }
@media (max-width: 640px) {
  .verify-bar { flex-direction: column; align-items: stretch; }
}

/* PAA suggestion rows in AI insights table */
.row-paa { background: oklch(98% .04 250); }
.row-paa:hover { background: oklch(96% .05 250); }
.paa-badge {
  display: inline-block;
  padding: .2rem .55rem;
  font-size: .7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  background: var(--accent);
  color: var(--accent-foreground);
  border-radius: 999px;
}

/* PAA cards in Content recommendations */
.idea-card--paa { border-color: oklch(80% .12 80 / .4); }
.idea-pill--paa { background: oklch(96% .12 80); color: oklch(45% .18 75); }

/* Generate article button on each idea card */
.idea-generate { margin-top: 1rem; align-self: start; }

/* Settings nav link — push to right side */
.dash-nav-link--settings { margin-left: auto; opacity: .85; }

/* Settings form helper text */
.field-hint {
  display: block;
  margin-top: .3rem;
  font-size: .8rem;
  color: var(--muted-foreground);
}
.field textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--input);
  background: var(--background);
  border-radius: 10px;
  font: inherit;
  font-size: .95rem;
  color: var(--foreground);
  resize: vertical;
  min-height: 80px;
}
.field textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px oklch(70% .18 245 / .2);
}

/* ===========================================================
   Article viewer
   =========================================================== */
.article-tabs-bar {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 18px 0 12px;
  border-bottom: 1px solid var(--border);
}
.article-tab {
  background: transparent;
  border: 0;
  padding: 8px 14px;
  font: inherit;
  font-size: .9rem;
  font-weight: 600;
  color: var(--muted-foreground);
  cursor: pointer;
  border-radius: 8px 8px 0 0;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}
.article-tab:hover { color: var(--foreground); }
.article-tab--active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}
.article-view { padding: 32px 0 64px; }
.article-container { max-width: 760px; }

.article-preview h1 {
  font-size: 2.2rem;
  font-weight: 800;
  letter-spacing: -.02em;
  line-height: 1.2;
  margin: 0 0 1.2rem;
}
.article-ingress {
  font-size: 1.1rem;
  font-weight: 700;
  line-height: 1.55;
  color: var(--foreground);
  border-left: 4px solid var(--primary);
  padding-left: 18px;
  margin: 0 0 1.5rem;
}
.article-preview p {
  font-size: 1.02rem;
  line-height: 1.7;
  color: var(--foreground);
  margin: 0 0 1.2rem;
}
.article-bullets {
  margin: 0 0 1.5rem;
  padding: 0 0 0 1.2rem;
  display: grid;
  gap: .55rem;
}
.article-bullets li {
  font-size: 1rem;
  line-height: 1.55;
  color: var(--foreground);
}
.article-bullets li::marker { color: var(--primary); }
.article-faq-heading {
  font-size: 1.5rem;
  font-weight: 700;
  margin: 2rem 0 1.25rem;
}
.article-faq { margin-bottom: 1.4rem; }
.article-faq h3 {
  font-size: 1.1rem;
  font-weight: 700;
  margin: 0 0 .5rem;
  color: var(--foreground);
}
.article-faq p {
  margin: 0;
  color: var(--foreground);
  line-height: 1.65;
}
.article-byline {
  margin-top: 2.5rem !important;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border);
  color: var(--foreground);
  font-size: .95rem !important;
  line-height: 1.6;
}
.article-byline a { color: var(--primary); text-decoration: underline; text-underline-offset: 3px; }
.article-byline-lead { font-weight: 700; }
.article-byline-bio {
  display: block;
  margin-top: 4px;
  color: var(--muted-foreground);
  font-style: italic;
  font-size: .92rem;
}

.code-block {
  background: oklch(20% .04 255);
  color: oklch(94% .02 255);
  padding: 24px 28px;
  border-radius: var(--radius-lg);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: .85rem;
  line-height: 1.65;
  overflow-x: auto;
  white-space: pre-wrap;
  word-break: break-word;
  margin: 0;
}

/* ===========================================================
   Onboarding flow
   =========================================================== */
.copy-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  border: 1px solid var(--border);
  background: var(--muted);
  border-radius: var(--radius-lg);
  margin: 16px 0;
  flex-wrap: wrap;
}
.copy-row code {
  flex: 1 1 200px;
  min-width: 0;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: .88rem;
  color: var(--foreground);
  background: transparent;
  padding: 0;
  white-space: normal;
  word-break: keep-all;
  overflow-wrap: anywhere;
  line-height: 1.4;
}
.copy-row .btn { flex-shrink: 0; }
@media (max-width: 520px) {
  .copy-row code { font-size: .82rem; }
}
.onboarding-steps {
  margin: 1.25rem 0 0;
  padding-left: 1.25rem;
  display: grid;
  gap: .6rem;
}
.onboarding-steps li {
  font-size: .95rem;
  line-height: 1.5;
  color: var(--foreground);
}
.onboarding-steps a { color: var(--primary); text-decoration: underline; }

/* ===========================================================
   Content recommendations
   =========================================================== */
.ideas-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}
@media (max-width: 880px) { .ideas-grid { grid-template-columns: 1fr; } }

.idea-card {
  display: grid;
  grid-template-columns: 56px 1fr;
  gap: 16px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 24px 26px;
  box-shadow: var(--shadow-soft);
  transition: transform .2s ease, box-shadow .2s ease;
}
.idea-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-elegant); }
.idea-num {
  font-size: 1.4rem;
  font-weight: 800;
  background-color: #4666e0;
  background-image: var(--gradient-hero);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  line-height: 1;
}
.idea-meta { display: flex; gap: 6px; margin-bottom: 8px; }
.idea-pill {
  font-size: .7rem;
  font-weight: 700;
  padding: .2rem .55rem;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: .08em;
}
.idea-pill--seasonal { background: oklch(96% .12 80); color: oklch(45% .18 75); }
.idea-pill--evergreen { background: oklch(94% .08 145); color: oklch(40% .18 145); }
.idea-pill--tier { background: var(--accent); color: var(--accent-foreground); }
.tier-easy { background: oklch(94% .08 145); color: oklch(40% .18 145); }
.tier-mid  { background: oklch(96% .12 80);  color: oklch(45% .18 75);  }
.tier-hard { background: oklch(94% .07 25);  color: oklch(45% .2 25);   }

.idea-title {
  font-size: 1.05rem;
  margin: 0 0 .5rem;
  color: var(--foreground);
  line-height: 1.3;
}
.idea-query {
  font-size: .85rem;
  color: var(--muted-foreground);
  margin-bottom: .5rem;
}
.idea-query strong { color: var(--primary-deep); }
.idea-rationale {
  font-size: .9rem;
  margin: 0;
  color: var(--muted-foreground);
  line-height: 1.5;
}

/* ===========================================================
   Sortable table headers
   =========================================================== */
th.sortable {
  cursor: pointer;
  user-select: none;
  position: relative;
  padding-right: 28px !important;
  transition: color .15s ease, background .15s ease;
}
th.sortable:hover { color: var(--primary); }
th.sortable::after {
  content: "⇅";
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  opacity: .35;
  font-size: .8rem;
  letter-spacing: -2px;
  transition: opacity .15s ease;
}
th.sortable:hover::after { opacity: .7; }
th.sortable.sort-asc::after  { content: "▲"; opacity: 1; color: var(--primary); }
th.sortable.sort-desc::after { content: "▼"; opacity: 1; color: var(--primary); }
th.sortable.sort-asc,
th.sortable.sort-desc { color: var(--primary); }
@media (max-width: 640px) {
  .narrative-card { padding: 28px 22px; }
  .narrative-headline { font-size: 1.25rem; }
}
@media (max-width: 760px) {
  .ga4-tables { grid-template-columns: 1fr !important; }
}

/* ===========================================================
   Dashboard shell — sidebar layout (Phase 4)
   =========================================================== */
body.dash-shell {
  display: flex;
  min-height: 100vh;
  background: oklch(97.5% .01 250);
}

.dash-sidebar {
  width: 216px;
  flex-shrink: 0;
  background: var(--card);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  z-index: 100;
}

.dash-sidebar-logo {
  padding: 16px 14px 14px;
  border-bottom: 1px solid var(--border);
}

.dash-sidebar-body {
  flex: 1;
  padding: 10px 8px;
  overflow-y: auto;
}

.dash-sidebar-nav {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.dash-sidebar-nav li { margin: 0; padding: 0; }

.dash-sidebar-link {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 9px 11px;
  border-radius: var(--radius-sm);
  font-size: .875rem;
  font-weight: 600;
  color: var(--muted-foreground);
  transition: background .15s, color .15s;
  text-decoration: none;
  white-space: nowrap;
}
.dash-sidebar-link:hover {
  background: var(--muted);
  color: var(--foreground);
}
.dash-sidebar-link--active {
  background: var(--accent);
  color: var(--primary);
}
.dash-sidebar-link--active:hover { color: var(--primary); }

.dash-sidebar-icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  opacity: .7;
}
.dash-sidebar-link--active .dash-sidebar-icon { opacity: 1; }

.dash-sidebar-footer {
  padding: 10px 8px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.dash-sidebar-user {
  padding: 6px 11px;
  font-size: .78rem;
  color: var(--muted-foreground);
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.dash-sidebar-email {
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 190px;
}
.dash-sidebar-signout {
  color: var(--primary);
  font-size: .78rem;
  font-weight: 600;
  text-decoration: none;
  padding: 2px 0;
}
.dash-sidebar-signout:hover { opacity: .75; }

.dash-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.dash-topbar {
  background: var(--card);
  border-bottom: 1px solid var(--border);
  padding: 10px 24px;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  min-height: 52px;
}
.dash-topbar-domain {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* State screens — loading, error, empty */
.dash-state {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 64px 24px;
  text-align: center;
}
/* class-level display:flex overrides [hidden] UA stylesheet — force it back */
.dash-state[hidden] { display: none !important; }

.dash-content {
  padding: 28px 28px 56px;
  flex: 1;
}

/* Page heading row */
.dash-page-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 28px;
  flex-wrap: wrap;
}
.dash-page-domain {
  font-size: clamp(1.35rem, 2.4vw, 1.8rem);
  font-weight: 800;
  letter-spacing: -.025em;
  margin: 0;
  color: var(--foreground);
}
.dash-page-note {
  margin: .35rem 0 0;
  font-size: .875rem;
  color: var(--muted-foreground);
}
.period-badge {
  display: inline-flex;
  align-items: center;
  padding: 5px 12px;
  border-radius: 999px;
  background: var(--accent);
  font-size: .78rem;
  font-weight: 600;
  color: var(--primary);
  white-space: nowrap;
  margin-top: .2rem;
}

/* ===========================================================
   Home — section wrappers
   =========================================================== */
.home-section {
  margin-bottom: 32px;
}
.home-section-title {
  font-size: .72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .14em;
  color: var(--muted-foreground);
  margin-bottom: 14px;
}
.home-section-note {
  font-size: .875rem;
  color: var(--muted-foreground);
  margin: -6px 0 14px;
  line-height: 1.55;
}

/* Two-col: rings left, highlights right */
.home-two-col {
  display: grid;
  grid-template-columns: 1fr 224px;
  gap: 14px;
  align-items: start;
}
@media (max-width: 860px) {
  .home-two-col { grid-template-columns: 1fr; }
}

/* ===========================================================
   Donut ring cards
   =========================================================== */
.rings-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}
@media (max-width: 580px) {
  .rings-grid { grid-template-columns: 1fr 1fr; }
}

.ring-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 22px 14px 18px;
  box-shadow: var(--shadow-soft);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  transition: transform .2s, box-shadow .2s;
  text-align: center;
}
.ring-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-elegant);
}

/* Conic-gradient donut ring */
.ring-donut {
  --ring-pct: 0%;
  --ring-color: #4666e0;
  --ring-bg: oklch(93% .025 250);
  --ring-size: 108px;
  --ring-hole: 76px;
  width: var(--ring-size);
  height: var(--ring-size);
  border-radius: 50%;
  background: conic-gradient(var(--ring-color) var(--ring-pct), var(--ring-bg) 0%);
  display: grid;
  place-items: center;
  transition: background 1s ease;
}
.ring-donut-inner {
  width: var(--ring-hole);
  height: var(--ring-hole);
  background: var(--card);
  border-radius: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.ring-num {
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -.03em;
  line-height: 1;
  color: #4666e0;
  background: linear-gradient(135deg, #4666e0, #6aa5f5);
  background: var(--gradient-hero);
  -webkit-background-clip: text;
  background-clip: text;
}
@supports (background-clip: text) or (-webkit-background-clip: text) {
  .ring-num { color: transparent; }
}
.ring-num--position { font-size: 1.2rem; }

.ring-card-body {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
}
.ring-card-label {
  font-size: .82rem;
  font-weight: 700;
  color: var(--foreground);
}
.ring-card-sub {
  font-size: .72rem;
  color: var(--muted-foreground);
  line-height: 1.4;
}

/* ===========================================================
   Highlights sidebar card
   =========================================================== */
.highlights-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 16px 16px 10px;
  box-shadow: var(--shadow-soft);
}
.highlights-title {
  font-size: .72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .14em;
  color: var(--muted-foreground);
  margin-bottom: 12px;
}
.highlight-item {
  padding: 9px 0;
  border-bottom: 1px solid var(--border);
}
.highlight-item:last-child { border-bottom: none; padding-bottom: 0; }
.highlight-label {
  font-size: .78rem;
  color: var(--muted-foreground);
  margin-bottom: 2px;
}
.highlight-value {
  font-size: 1.3rem;
  font-weight: 800;
  letter-spacing: -.025em;
  line-height: 1;
  color: #4666e0;
  background: var(--gradient-hero);
  -webkit-background-clip: text;
  background-clip: text;
}
@supports (background-clip: text) or (-webkit-background-clip: text) {
  .highlight-value { color: transparent; }
}
.highlight-sub { font-size: .72rem; color: var(--muted-foreground); margin-top: 2px; }

/* ===========================================================
   ROAS & revenue section
   =========================================================== */
.roas-section-grid {
  display: grid;
  grid-template-columns: 176px 1fr;
  gap: 14px;
  align-items: start;
}
@media (max-width: 640px) {
  .roas-section-grid { grid-template-columns: 1fr; }
}

.roas-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 20px 18px;
  box-shadow: var(--shadow-soft);
}
.roas-card-label {
  font-size: .72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .12em;
  color: var(--muted-foreground);
  margin-bottom: 8px;
}
.roas-card-num {
  font-size: 2.4rem;
  font-weight: 800;
  letter-spacing: -.04em;
  line-height: 1;
  color: #4666e0;
  background: var(--gradient-hero);
  -webkit-background-clip: text;
  background-clip: text;
  margin-bottom: 6px;
}
@supports (background-clip: text) or (-webkit-background-clip: text) {
  .roas-card-num { color: transparent; }
}
.roas-card-formula {
  font-size: .76rem;
  color: var(--muted-foreground);
  line-height: 1.45;
}

/* Narrative section max-width reset when inside sidebar layout */
body.dash-shell .narrative-card,
body.dash-shell .recommendations-card {
  max-width: 100%;
}

/* Mobile: sidebar collapses to top scrollable bar */
@media (max-width: 768px) {
  body.dash-shell { flex-direction: column; }
  .dash-sidebar {
    width: 100%;
    height: auto;
    position: static;
    flex-direction: row;
    border-right: none;
    border-bottom: 1px solid var(--border);
    overflow-x: auto;
  }
  .dash-sidebar-logo {
    border-bottom: none;
    border-right: 1px solid var(--border);
    padding: 10px 12px;
    flex-shrink: 0;
  }
  .dash-sidebar-body {
    flex: 1;
    padding: 6px 4px;
    overflow-y: visible;
    overflow-x: auto;
  }
  .dash-sidebar-nav { flex-direction: row; }
  .dash-sidebar-link { padding: 8px 10px; font-size: .8rem; }
  .dash-sidebar-footer {
    border-top: none;
    border-left: 1px solid var(--border);
    flex-direction: row;
    padding: 6px 8px;
    align-items: center;
    flex-shrink: 0;
  }
  .dash-sidebar-user { display: none; }
  .dash-content { padding: 16px 16px 40px; }
}

/* Reduce heavy section padding inside sidebar-layout pages */
body.dash-shell .section { padding: 40px 0; }
body.dash-shell .section-head { margin-bottom: 32px; }

/* ===========================================================
   Channel overview table
   =========================================================== */
.channel-table-wrap {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  overflow: hidden;
  box-shadow: var(--shadow-soft);
}

.channel-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .9rem;
}
.channel-table th {
  padding: 10px 18px;
  text-align: left;
  font-size: .72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .12em;
  color: var(--muted-foreground);
  border-bottom: 1px solid var(--border);
  background: var(--accent);
}
.channel-table th.num { text-align: right; }

.channel-table td {
  padding: 11px 18px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.channel-table td.num { text-align: right; font-variant-numeric: tabular-nums; }
.channel-table tbody tr:last-child td { border-bottom: none; }

/* Main channel row */
.ch-row td { background: var(--card); }
.ch-row:hover td { background: var(--muted); transition: background .12s; }

/* Sub-source rows (hidden by default) */
.ch-source-row td {
  background: oklch(98.5% .008 250);
  padding-top: 8px;
  padding-bottom: 8px;
  font-size: .85rem;
  color: var(--muted-foreground);
  border-bottom: 1px solid var(--border);
}
.ch-source-row:last-of-type td { border-bottom: 1px solid var(--border); }
.ch-source-row[hidden] { display: none !important; }

/* Channel name cell with color dot */
.ch-name {
  display: flex;
  align-items: center;
  gap: 9px;
  font-weight: 600;
  color: var(--foreground);
}
.ch-dot {
  width: 9px; height: 9px;
  border-radius: 50%;
  flex-shrink: 0;
}
.ch-dot--organic  { background: oklch(62% .19 145); }
.ch-dot--paid     { background: oklch(65% .19 50);  }
.ch-dot--llm      { background: oklch(62% .22 280); }
.ch-dot--referral { background: oklch(60% .15 195); }
.ch-dot--direct   { background: oklch(58% .12 255); }
.ch-dot--social   { background: oklch(62% .19 350); }
.ch-dot--email    { background: oklch(65% .16 70);  }
.ch-dot--display  { background: oklch(65% .16 30);  }
.ch-dot--other    { background: oklch(60% .04 255); }

/* Toggle arrow button */
.ch-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px; height: 22px;
  margin-left: 4px;
  background: none;
  border: 1px solid var(--border);
  border-radius: 5px;
  cursor: pointer;
  font-size: .75rem;
  color: var(--muted-foreground);
  line-height: 1;
  transition: background .12s, color .12s;
  flex-shrink: 0;
}
.ch-toggle:hover { background: var(--accent); color: var(--primary); }
.ch-toggle[aria-expanded="true"] { background: var(--accent); color: var(--primary); }

/* Source name indented */
.ch-source-name {
  padding-left: 26px;
  color: var(--muted-foreground);
}

/* Sessions share bar */
.ch-bar-cell { width: 80px; padding-right: 20px; }
.ch-bar {
  height: 5px;
  border-radius: 3px;
  background: oklch(92% .02 250);
  overflow: hidden;
}
.ch-bar-fill {
  height: 100%;
  border-radius: 3px;
  background: linear-gradient(90deg, #4666e0, #6aa5f5);
  background: var(--gradient-hero);
  transition: width .5s ease;
}
.ch-dot--llm ~ .ch-bar-fill { background: oklch(62% .22 280); }

/* ===========================================================
   GA4 event chips in channel table
   =========================================================== */
.ch-event-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 3px;
}
.ch-event-chip {
  font-size: .7rem;
  color: var(--muted-foreground);
  background: oklch(95% .015 250);
  border-radius: 4px;
  padding: 1px 5px;
  white-space: nowrap;
}

/* GA4 events settings pane */
.ga4-events-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 14px 0;
  max-height: 340px;
  overflow-y: auto;
  padding-right: 4px;
}
.ga4-event-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--card);
  cursor: pointer;
  transition: background .12s;
}
.ga4-event-item:hover { background: var(--muted); }
.ga4-event-item input[type="checkbox"] {
  width: 15px; height: 15px; flex-shrink: 0; cursor: pointer;
  accent-color: var(--primary);
}
.ga4-event-name {
  flex: 1;
  font-size: .9rem;
  font-weight: 600;
  color: var(--foreground);
}
.ga4-event-custom {
  font-size: .7rem;
  font-weight: 600;
  color: var(--primary);
  background: var(--accent);
  padding: 2px 6px;
  border-radius: 4px;
}
.ga4-event-count {
  font-size: .8rem;
  color: var(--muted-foreground);
  font-variant-numeric: tabular-nums;
}
.ga4-events-empty {
  text-align: center;
  padding: 24px;
  color: var(--muted-foreground);
  font-size: .9rem;
}

/* ===========================================================
   AI Gap generate content UI
   =========================================================== */
.gap-generate-wrap {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.gap-generated-card {
  background: oklch(97% .02 145 / .4);
  border: 1px solid oklch(80% .1 145);
  border-radius: var(--radius-lg);
  padding: 16px 18px;
  margin-top: 12px;
}

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

.gap-generated-badge {
  font-size: .78rem;
  font-weight: 700;
  color: oklch(38% .15 145);
  background: oklch(88% .12 145);
  padding: 3px 9px;
  border-radius: 999px;
}

.gap-generated-preview {
  margin-bottom: 14px;
  font-size: .9rem;
  color: var(--foreground);
}

.gap-generated-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.gap-expiry-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

/* AI Gap badge on content idea cards */
.idea-source-badge {
  display: inline-block;
  font-size: .68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--primary);
  background: var(--accent);
  padding: 2px 7px;
  border-radius: 4px;
  margin-left: 6px;
  vertical-align: middle;
}
