/* ============================================================================
   TopTable — design system. Light, elegant, modern. Restrained by default.
   Tokens → base → layout → components → marketing → responsive → a11y.
   ========================================================================== */

/* ----------------------------- Design tokens ----------------------------- */
:root {
  /* Brand — deep SAPPHIRE: an elegant, premium jewel-blue that pairs with the warm
     Cloud Dancer cream and Apple neutrals, and flows into the teal-cyan accent as a
     refined sapphire→teal gradient (analogous harmony). Replaces the former violet. */
  --brand: #2f54c9;          /* sapphire */
  --brand-600: #2745aa;
  --brand-700: #1f3686;
  --cyan: #0b8fb0;           /* teal-cyan accent (unchanged) */
  --cyan-bright: #16b3cf;
  --accent: var(--brand);
  --accent-2: var(--cyan);

  /* Surfaces — Apple-style neutral off-white + white panels, neutral separators
     (replaces the cool slate-tinted grays). */
  --bg: #f5f5f7;
  --bg-tint: #ffffff;
  --panel: #ffffff;
  --panel-2: #f1f1f4;
  --panel-3: #e8e8ed;
  --line: rgba(0, 0, 0, 0.08);
  --line-strong: rgba(0, 0, 0, 0.13);

  /* Seasonal accent — Pantone Color of the Year. Swap these two lines yearly.
     2026: Cloud Dancer (PANTONE 11-4201), a soft warm off-white — used as a calm
     "cloud" surface on the hero/featured/CTA elements (the sapphire stays the brand
     pop). A neutral CotY reads best as an atmospheric surface, not a vivid accent. */
  --seasonal: #f0eee9;        /* Cloud Dancer */
  --seasonal-line: #e7e3da;   /* warm edge for seasonal surfaces */

  /* Text — Apple neutral near-black + system grays (not pure black, not cool
     slate) for refined legibility and AA contrast. */
  --txt: #1d1d1f;
  --txt-soft: #424245;
  --muted: #6e6e73;
  --muted-2: #86868b;

  /* State — refined, slightly softer semantic colors (less neon). */
  --good: #1a8a4f;
  --bad: #d6394e;
  --warn: #b1700a;

  /* Effects — neutral, subtle shadows (Apple/Adobe restraint). */
  --radius: 16px;
  --radius-sm: 10px;
  --radius-lg: 24px;
  --radius-pill: 999px;
  --ring: 0 0 0 3px rgba(47, 84, 201, 0.20);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow: 0 6px 20px -8px rgba(0, 0, 0, 0.10);
  --shadow-lg: 0 30px 64px -28px rgba(29, 29, 31, 0.20);
  --grad-brand: linear-gradient(120deg, #5876e6 0%, #2f54c9 36%, #2745aa 60%, #16b3cf 112%);
  --grad-text: linear-gradient(120deg, #2f54c9 0%, #2745aa 44%, #0b8fb0 100%);
  /* Translucent sapphire→teal for the liquid-glass primary button (~0.9 alpha so a
     hint of background shows through behind the blur). Keep in sync with --grad-brand. */
  --grad-brand-glass: linear-gradient(120deg, rgba(88,118,230,0.90) 0%, rgba(47,84,201,0.92) 36%, rgba(39,69,170,0.92) 60%, rgba(22,179,207,0.90) 112%);

  /* Spacing scale */
  --sp-1: 4px;  --sp-2: 8px;  --sp-3: 12px; --sp-4: 16px;
  --sp-5: 24px; --sp-6: 32px; --sp-7: 48px; --sp-8: 64px; --sp-9: 96px;

  --maxw: 1120px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  color-scheme: light;
}

/* -------------------------------- Reset ---------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  color: var(--txt);
  background-color: var(--bg);
  background-image:
    radial-gradient(900px 480px at 86% -14%, rgba(47, 84, 201, 0.11), transparent 60%),
    radial-gradient(720px 460px at 0% 3%, rgba(11, 143, 176, 0.08), transparent 55%),
    radial-gradient(760px 520px at 50% 118%, rgba(47, 84, 201, 0.055), transparent 60%),
    linear-gradient(180deg, #ffffff 0%, var(--bg) 60%);
  background-attachment: fixed;
  font-family: 'Inter', system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  letter-spacing: -0.011em;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* Featherweight ambient background: a masked grid that frames the hero, plus a
   whisper of film grain for a tactile, premium feel. Both fixed, behind all
   content, un-animated — pure trace, effectively zero weight. (Fixed-positioned
   pseudo-elements are out of flow, so they don't become flex items of body.) */
body::before, body::after {
  content: ''; position: fixed; inset: 0; z-index: -1; pointer-events: none;
}
body::before {
  background-image:
    linear-gradient(to right, rgba(0, 0, 0, 0.028) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(0, 0, 0, 0.028) 1px, transparent 1px);
  background-size: 58px 58px;
  -webkit-mask-image: radial-gradient(125% 95% at 50% -8%, #000 26%, transparent 76%);
  mask-image: radial-gradient(125% 95% at 50% -8%, #000 26%, transparent 76%);
}
body::after {
  opacity: 0.038;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 160px 160px;
}

h1, h2, h3, h4 {
  font-family: 'Space Grotesk', 'Inter', system-ui, sans-serif;
  line-height: 1.12;
  letter-spacing: -0.025em;
  font-weight: 600;
  margin: 0 0 0.4em;
  color: #1d1d1f;
}
p { margin: 0 0 1em; }
a { color: var(--brand-600); text-decoration: none; transition: color 0.15s var(--ease); }
a:hover { color: var(--brand); }
img { max-width: 100%; display: block; }
::selection { background: rgba(47, 84, 201, 0.18); color: var(--brand-700); }
:focus-visible { outline: none; box-shadow: var(--ring); border-radius: 8px; }

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

/* -------------------------------- Header --------------------------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  gap: var(--sp-5);
  padding: 14px clamp(16px, 4vw, 32px);
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.78);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
}
.brand { display: flex; align-items: center; gap: 10px; color: var(--txt); font-weight: 700; }
.brand:hover { color: #000; }
.brand-mark {
  width: 36px; height: 36px; border-radius: 11px; overflow: hidden; flex-shrink: 0;
  box-shadow: 0 6px 16px -5px rgba(47, 84, 201, 0.5);
  transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease);
}
.brand-mark svg { display: block; width: 100%; height: 100%; }
.brand:hover .brand-mark { transform: translateY(-1px) rotate(-3deg); box-shadow: 0 10px 22px -6px rgba(47, 84, 201, 0.6); }
.brand-text { font-family: 'Space Grotesk', sans-serif; font-size: 20px; font-weight: 700; letter-spacing: -0.03em; }
.brand-text .accent {
  background: var(--grad-text);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.site-nav { display: flex; gap: 4px; margin-left: var(--sp-3); }
.site-nav a {
  color: var(--muted); font-weight: 500; font-size: 15px;
  padding: 8px 12px; border-radius: var(--radius-sm);
  transition: color 0.15s var(--ease), background 0.15s var(--ease);
}
.site-nav a:hover { color: var(--txt); background: rgba(0, 0, 0, 0.04); }
.site-nav a.active { color: var(--brand-700); background: rgba(47, 84, 201, 0.10); }
.header-actions { margin-left: auto; display: flex; gap: var(--sp-3); align-items: center; }

/* Header "Contact" button — present in every state (auth + unauth). */
.contact-btn {
  display: inline-flex; align-items: center; gap: 7px; height: 38px; padding: 0 15px;
  border-radius: var(--radius-pill); border: 1px solid var(--line); background: #fff;
  color: var(--txt-soft); font: inherit; font-size: 14px; font-weight: 600; cursor: pointer;
  transition: color 0.15s var(--ease), border-color 0.15s var(--ease), box-shadow 0.15s var(--ease), transform 0.15s var(--ease);
}
.contact-btn:hover { color: var(--brand-700); border-color: rgba(47, 84, 201, 0.32); box-shadow: 0 4px 14px -8px rgba(47, 84, 201, 0.5); transform: translateY(-1px); }
.contact-btn:focus-visible { outline: none; box-shadow: 0 0 0 3px rgba(47, 84, 201, 0.22); }
.contact-btn svg { width: 17px; height: 17px; }
@media (max-width: 620px) { .contact-btn { padding: 0 11px; } .contact-btn .contact-label { display: none; } }

/* Contact form fields + honeypot */
.contact-form input, .contact-form textarea {
  width: 100%; box-sizing: border-box; padding: 11px 13px; font: inherit; font-size: 15px;
  color: var(--txt); background: #fff; border: 1px solid var(--line); border-radius: var(--radius-sm);
  transition: border-color 0.15s var(--ease), box-shadow 0.15s var(--ease);
}
.contact-form input::placeholder, .contact-form textarea::placeholder { color: var(--muted); }
.contact-form input:focus, .contact-form textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(47, 84, 201, 0.16); }
.contact-form textarea { resize: vertical; min-height: 100px; line-height: 1.55; }
.contact-form .ct-count { text-align: right; margin-top: 6px; }
.contact-form .ct-hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; pointer-events: none; }

/* Gentle subscription-level badge in the header (signed-in customers). */
.plan-badge {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 12.5px; font-weight: 600; letter-spacing: -0.01em;
  color: var(--txt-soft);
  padding: 5px 12px 5px 10px; border-radius: var(--radius-pill);
  background: rgba(0, 0, 0, 0.035); border: 1px solid var(--line);
  transition: color 0.15s var(--ease), border-color 0.15s var(--ease), background 0.15s var(--ease);
}
.plan-badge:hover { color: var(--brand-700); border-color: rgba(47, 84, 201, 0.3); background: rgba(47, 84, 201, 0.06); }
.plan-badge .pb-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--grad-brand); box-shadow: 0 0 0 3px rgba(47, 84, 201, 0.10); }
/* Respect the hidden attribute — the display:inline-flex above would otherwise
   override the UA [hidden] rule and leak an empty pill when no plan is shown. */
.plan-badge[hidden] { display: none; }
@media (max-width: 460px) { .plan-badge:not([hidden]) { display: none; } }

/* Hamburger (mobile only) */
.nav-toggle {
  display: none; flex-shrink: 0; margin-left: 4px;
  width: 42px; height: 42px; padding: 0;
  flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  background: #fff; border: 1px solid var(--line-strong); border-radius: 10px; cursor: pointer;
}
.nav-toggle span { display: block; width: 18px; height: 2px; border-radius: 2px; background: var(--txt); transition: transform 0.2s var(--ease), opacity 0.2s var(--ease); }
.nav-toggle.is-open span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.nav-toggle.is-open span:nth-child(2) { opacity: 0; }
.nav-toggle.is-open span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

/* ----------------------------- Layout shell ------------------------------ */
main {
  flex: 1;
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: clamp(20px, 3vw, 40px) clamp(16px, 4vw, 32px) var(--sp-9);
}
.site-footer {
  border-top: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.6);
}
.footer-inner {
  max-width: var(--maxw); margin: 0 auto;
  display: flex; justify-content: space-between; align-items: center;
  gap: var(--sp-4); flex-wrap: wrap;
  padding: 22px clamp(16px, 4vw, 32px);
  color: var(--muted); font-size: 13px;
}

/* ------------------------------- Buttons --------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  color: #fff; border: 0;
  padding: 12px 20px;
  border-radius: var(--radius-sm);
  font: inherit; font-weight: 600; font-size: 15px; letter-spacing: -0.01em;
  cursor: pointer; white-space: nowrap;
  /* Liquid-glass primary: a glossy top sheen layered over a translucent sapphire→
     teal flow, with a real backdrop blur so a hint of the page refracts through —
     lighter and more dimensional, but never washed out. The sheen stays put while
     the brand gradient slides on hover (per-layer size/position). */
  background-image:
    linear-gradient(180deg, rgba(255,255,255,0.32) 0%, rgba(255,255,255,0.08) 40%, rgba(255,255,255,0) 62%),
    var(--grad-brand-glass);
  background-size: 100% 100%, 165% 100%;
  background-position: 0 0, 0% 50%;
  -webkit-backdrop-filter: blur(10px) saturate(1.25);
  backdrop-filter: blur(10px) saturate(1.25);
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.16);
  /* Glassy depth: bright top edge, faint inner rim, soft bottom thickness, dual glow */
  box-shadow:
    0 10px 26px -10px rgba(47, 84, 201, 0.55),
    0 4px 10px -4px rgba(11, 143, 176, 0.32),
    inset 0 1px 0 rgba(255, 255, 255, 0.62),
    inset 0 0 0 1px rgba(255, 255, 255, 0.12),
    inset 0 -9px 16px -12px rgba(0, 0, 0, 0.22);
  transition: background-position 0.6s var(--ease), transform 0.18s var(--ease), box-shadow 0.22s var(--ease), filter 0.18s var(--ease);
}
.btn:hover {
  background-position: 0 0, 100% 50%;
  transform: translateY(-1px);
  box-shadow:
    0 16px 36px -11px rgba(47, 84, 201, 0.6),
    0 8px 18px -6px rgba(11, 143, 176, 0.38),
    inset 0 1px 0 rgba(255, 255, 255, 0.72),
    inset 0 0 0 1px rgba(255, 255, 255, 0.16),
    inset 0 -9px 16px -12px rgba(0, 0, 0, 0.2);
}
.btn:hover { color: #fff; }
.btn:active { transform: translateY(0); filter: saturate(1.06) brightness(0.98); }
.btn.secondary {
  background-image: none;
  /* Frosted glass: translucent white + blur, a subtle gloss edge — lighter and
     glassy, but clearly defined so the primary still dominates. */
  background-color: rgba(255, 255, 255, 0.6);
  -webkit-backdrop-filter: blur(12px) saturate(1.4);
  backdrop-filter: blur(12px) saturate(1.4);
  border: 1px solid var(--line-strong);
  box-shadow: var(--shadow-sm), inset 0 1px 0 rgba(255, 255, 255, 0.8);
  color: var(--txt);
  text-shadow: none;
}
.btn.secondary:hover {
  background-color: rgba(255, 255, 255, 0.82);
  border-color: rgba(47, 84, 201, 0.45);
  color: var(--brand-700);
  box-shadow: 0 10px 22px -12px rgba(47, 84, 201, 0.32), inset 0 1px 0 rgba(255, 255, 255, 0.9);
}
.btn.ghost { background-image: none; background-color: transparent; box-shadow: none; color: var(--txt-soft);
  -webkit-backdrop-filter: none; backdrop-filter: none; text-shadow: none; }
.btn.ghost:hover { background-color: rgba(0, 0, 0, 0.04); box-shadow: none; }
.btn.lg { padding: 15px 28px; font-size: 16px; border-radius: 12px; }
.btn.block { width: 100%; }
.btn:disabled { opacity: 0.5; cursor: default; transform: none; box-shadow: none; }
.btn-row { display: flex; gap: var(--sp-3); flex-wrap: wrap; margin-top: var(--sp-4); }

/* -------------------------- Forms / inputs ------------------------------- */
input, select, textarea {
  width: 100%;
  background: #fff;
  border: 1px solid var(--line-strong);
  color: var(--txt);
  padding: 12px 15px;
  border-radius: var(--radius-sm);
  font: inherit; font-size: 15px;
  transition: border-color 0.15s var(--ease), box-shadow 0.15s var(--ease), background 0.15s;
}
input::placeholder, textarea::placeholder { color: var(--muted-2); }
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--brand);
  box-shadow: var(--ring);
}

/* ---------------------------- Timezone picker ---------------------------- */
.tz-field { position: relative; }
.tz-picker { position: relative; }
.tz-input { cursor: text; padding-right: 40px; text-overflow: ellipsis; }
.tz-caret {
  position: absolute; right: 13px; top: 50%; transform: translateY(-50%);
  width: 18px; height: 18px; color: var(--muted); cursor: pointer;
  transition: transform 0.18s var(--ease), color 0.15s var(--ease);
}
.tz-picker.open .tz-caret { transform: translateY(-50%) rotate(180deg); color: var(--brand); }
.tz-menu {
  position: absolute; top: calc(100% + 6px); left: 0; right: 0; z-index: 60;
  background: #fff; border: 1px solid var(--line-strong); border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg); max-height: 288px; overflow-y: auto; padding: 6px;
}
.tz-opt {
  display: flex; align-items: baseline; justify-content: space-between; gap: 14px;
  padding: 9px 11px; border-radius: 8px; cursor: pointer;
  transition: background 0.12s var(--ease);
}
.tz-opt .tz-city { font-size: 14px; font-weight: 600; color: var(--txt); }
.tz-opt .tz-meta { font-size: 12px; color: var(--muted); white-space: nowrap; flex-shrink: 0; }
.tz-opt.active, .tz-opt:hover { background: rgba(47, 84, 201, 0.08); }
.tz-opt.sel .tz-city { color: var(--brand); }
.tz-opt.sel .tz-city::after { content: '✓'; margin-left: 7px; font-size: 12px; color: var(--brand); }
.tz-empty { padding: 14px; text-align: center; color: var(--muted); font-size: 13px; }

/* ------------------------------ Surfaces --------------------------------- */
.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: clamp(18px, 3vw, 28px);
  box-shadow: var(--shadow);
}
.panel + .panel { margin-top: var(--sp-4); }
.card {
  position: relative;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s var(--ease), border-color 0.2s var(--ease), box-shadow 0.2s var(--ease);
}
.card:hover { transform: translateY(-3px); border-color: var(--line-strong); box-shadow: var(--shadow-lg); }
.card h3 { margin: 0 0 6px; font-size: 18px; }
.grid { display: grid; gap: var(--sp-4); grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.row { display: flex; gap: var(--sp-3); align-items: center; flex-wrap: wrap; }
.spread { justify-content: space-between; }

/* ------------------------------- Badges ---------------------------------- */
.tag {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; font-weight: 600; color: var(--txt-soft);
  border: 1px solid var(--line); background: var(--panel-2);
  padding: 4px 11px; border-radius: var(--radius-pill);
}
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 13px; font-weight: 600; letter-spacing: 0.02em;
  color: var(--brand-700);
  background: rgba(47, 84, 201, 0.08);
  border: 1px solid rgba(47, 84, 201, 0.22);
  padding: 6px 14px; border-radius: var(--radius-pill);
}
.eyebrow .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--cyan-bright); box-shadow: 0 0 0 4px rgba(11, 143, 176, 0.16); animation: pulse 2.4s var(--ease) infinite; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.4; } }
.pill { display: inline-flex; align-items: center; gap: 5px; padding: 3px 11px; border-radius: var(--radius-pill); font-size: 12px; font-weight: 700; }
.pill.yes { background: rgba(22, 163, 74, 0.10); color: var(--good); border: 1px solid rgba(22, 163, 74, 0.25); }
.pill.no { background: rgba(225, 29, 72, 0.09); color: var(--bad); border: 1px solid rgba(225, 29, 72, 0.22); }

/* ------------------------------- Tables ---------------------------------- */
.table-wrap { overflow-x: auto; border-radius: var(--radius-sm); border: 1px solid var(--line); background: #fff; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 13px 16px; font-size: 14px; border-bottom: 1px solid var(--line); }
thead th { color: var(--muted); font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: 0.05em; background: #f4f4f6; }
tbody tr { transition: background 0.12s; }
tbody tr:hover { background: #f4f4f6; }
tbody tr:last-child td { border-bottom: 0; }
/* Brief highlight on a freshly-created row so the admin can spot it (JS-applied). */
.row-flash > td { animation: rowFlash 2s ease-out; }
@keyframes rowFlash { from { background: rgba(47, 84, 201, 0.18); } to { background: transparent; } }
.big-number { font-family: 'Space Grotesk', sans-serif; font-size: clamp(34px, 6vw, 46px); font-weight: 700; line-height: 1; background: var(--grad-text); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* ------------------------------- Notices --------------------------------- */
.notice {
  display: flex; align-items: center; gap: 10px;
  padding: 13px 16px; border-radius: var(--radius-sm);
  background: #f4f4f6; border: 1px solid var(--line-strong);
  color: var(--txt-soft); margin: var(--sp-4) 0; font-size: 14px;
}
.notice.warn { border-color: rgba(217, 119, 6, 0.35); background: #fffbeb; color: #92400e; }
.notice code { background: rgba(0, 0, 0, 0.06); padding: 1px 6px; border-radius: 5px; font-size: 0.9em; }

/* ------------------------------ Spinner ---------------------------------- */
.spinner {
  display: inline-block; width: 16px; height: 16px;
  border: 2px solid rgba(0, 0, 0, 0.15); border-top-color: var(--brand);
  border-radius: 50%; animation: spin 0.7s linear infinite; vertical-align: middle;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ============================ Marketing home ============================== */
.hero { text-align: center; padding: clamp(20px, 5vw, 48px) 0 var(--sp-6); position: relative; }
.hero h1 {
  font-size: clamp(34px, 6.2vw, 62px);
  margin: 18px auto 18px; max-width: 16ch;
}
.hero h1 .grad { background: var(--grad-text); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero .lead { color: var(--txt-soft); font-size: clamp(16px, 2.2vw, 20px); max-width: 620px; margin: 0 auto var(--sp-6); }

.scan-box {
  display: flex; gap: 10px; max-width: 560px; margin: 0 auto;
  background: #fff; border: 1px solid var(--line-strong);
  padding: 8px; border-radius: 14px;
  box-shadow: var(--shadow-lg);
  transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease);
}
.scan-box:focus-within { border-color: var(--brand); box-shadow: var(--shadow-lg), var(--ring); }
.scan-box input { border: 0; background: transparent; box-shadow: none; padding: 11px 14px; }
.scan-box input:focus { box-shadow: none; background: transparent; }
.scan-box .btn { flex-shrink: 0; }
/* Demo-locked scan input: shows a fixed sample domain, not typeable. */
.scan-box.demo-locked { align-items: center; }
.scan-box .scan-lock { padding-left: 10px; font-size: 13px; color: var(--muted-2); line-height: 1; }
.scan-box.demo-locked input { cursor: default; color: var(--txt-soft); user-select: none; padding-left: 6px; }

/* Guided home demo: lifecycle pipeline that reveals stage by stage. */
.demo-run { margin-top: 28px; text-align: left; }
.demo-run-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.demo-stages { list-style: none; margin: 16px 0 0; padding: 0; }
.demo-stage { display: flex; gap: 14px; padding: 12px 8px; border-radius: 12px; opacity: 0.4; transition: opacity 0.35s var(--ease), background 0.35s var(--ease); }
.demo-stage.active { opacity: 1; background: rgba(47, 84, 201, 0.05); }
.demo-stage.done { opacity: 1; }
.ds-mark { position: relative; width: 26px; height: 26px; flex-shrink: 0; margin-top: 1px; border: 2px solid var(--line-strong); border-radius: 50%; display: grid; place-items: center; transition: border-color 0.3s var(--ease), background 0.3s var(--ease); }
.demo-stage.active .ds-mark { border-color: var(--brand); }
.demo-stage.done .ds-mark { border-color: var(--brand); background: var(--brand); }
.ds-spin { width: 12px; height: 12px; border-radius: 50%; border: 2px solid rgba(47, 84, 201, 0.25); border-top-color: var(--brand); opacity: 0; animation: spin 0.7s linear infinite; }
.demo-stage.active .ds-spin { opacity: 1; }
.demo-stage.done .ds-spin { display: none; }
.ds-check { position: absolute; color: #fff; font-size: 13px; font-weight: 800; opacity: 0; transform: scale(0.4); transition: opacity 0.25s var(--ease), transform 0.25s var(--ease); }
.demo-stage.done .ds-check { opacity: 1; transform: scale(1); }
.ds-body { flex: 1; min-width: 0; }
.ds-label { font-weight: 600; font-size: 15px; color: var(--txt); }
.ds-detail { max-height: 0; opacity: 0; overflow: hidden; margin-top: 0; transition: max-height 0.45s var(--ease), opacity 0.4s var(--ease), margin-top 0.4s var(--ease); }
.demo-stage.active .ds-detail, .demo-stage.done .ds-detail { max-height: 180px; opacity: 1; margin-top: 8px; }
.demo-chip { display: inline-block; padding: 4px 11px; margin: 0 6px 6px 0; border-radius: var(--radius-pill); background: var(--panel-2); border: 1px solid var(--line); font-size: 12.5px; font-weight: 600; color: var(--txt-soft); }
.demo-chip.you { background: rgba(47, 84, 201, 0.1); border-color: rgba(47, 84, 201, 0.28); color: var(--brand-700); }
.demo-eng { display: inline-flex; flex-wrap: wrap; gap: 8px; }
.demo-eng span[data-eng] { padding: 4px 11px; border-radius: var(--radius-pill); border: 1px solid var(--line); font-size: 12.5px; font-weight: 600; color: var(--muted); opacity: 0.45; transition: opacity 0.3s var(--ease), border-color 0.3s var(--ease), background 0.3s var(--ease), color 0.3s var(--ease); }
.demo-eng span[data-eng].lit { opacity: 1; color: var(--brand-700); border-color: rgba(47, 84, 201, 0.3); background: rgba(47, 84, 201, 0.07); }
.demo-score { display: flex; align-items: baseline; gap: 2px; }
.demo-score #demo-score-n { font-size: 40px; font-weight: 800; color: var(--brand); line-height: 1; }
.demo-score-suf { font-size: 16px; font-weight: 700; color: var(--muted-2); }
.demo-note { margin: 18px 0 0; padding-top: 14px; border-top: 1px solid var(--line); font-size: 12.5px; line-height: 1.5; color: var(--muted-2); }

/* Scan / demo report reveal. */
.scan-report { opacity: 0; transform: translateY(14px); transition: opacity 0.5s var(--ease), transform 0.5s var(--ease); }
.scan-report.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .demo-stage, .ds-detail, .ds-mark, .ds-check, .demo-eng span, .scan-report { transition: none; }
  .ds-spin { animation: none; }
  .scan-report { opacity: 1; transform: none; }
}

.trust-bar { margin: var(--sp-7) auto 0; max-width: 760px; }
.trust-bar .trust-label { font-size: 12px; text-transform: uppercase; letter-spacing: 0.12em; color: var(--muted-2); margin-bottom: var(--sp-4); }
.engine-logos { display: flex; flex-wrap: wrap; gap: var(--sp-5); justify-content: center; align-items: center; }
.engine-chip {
  display: inline-flex; align-items: center;
  padding: 7px 15px; border-radius: var(--radius-pill);
  background: var(--panel-2); border: 1px solid var(--line);
  color: var(--txt-soft); font-weight: 600; font-size: 14.5px;
  transition: color 0.2s var(--ease), border-color 0.2s var(--ease);
}
.engine-chip:hover { color: var(--txt); border-color: var(--line-strong); }

/* Section scaffolding */
.section { margin-top: var(--sp-9); }
.section-head { text-align: center; max-width: 640px; margin: 0 auto var(--sp-7); }
.section-head h2 { font-size: clamp(26px, 4vw, 38px); }
.section-head p { color: var(--muted); font-size: 17px; }

/* Feature grid */
.feature-grid { display: grid; gap: var(--sp-4); grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.feature {
  background: var(--panel);
  border: 1px solid var(--line); border-radius: var(--radius); padding: 24px;
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s var(--ease), border-color 0.2s var(--ease), box-shadow 0.2s var(--ease);
}
.feature:hover { transform: translateY(-3px); border-color: var(--line-strong); box-shadow: var(--shadow); }
.feature .ficon {
  width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center;
  font-size: 22px; margin-bottom: var(--sp-4);
  background: rgba(47, 84, 201, 0.09); border: 1px solid rgba(47, 84, 201, 0.18);
}
.feature h3 { font-size: 17px; margin-bottom: 6px; }
.feature p { color: var(--muted); font-size: 14.5px; margin: 0; }

/* How it works */
.steps { display: grid; gap: var(--sp-4); grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); counter-reset: step; }
.step { position: relative; padding: 24px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); box-shadow: var(--shadow-sm); }
.step .num {
  counter-increment: step; font-family: 'Space Grotesk', sans-serif; font-weight: 700;
  width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center;
  background: var(--grad-brand); color: #fff; margin-bottom: var(--sp-4);
  box-shadow: 0 6px 14px -6px rgba(47, 84, 201, 0.55);
}
.step .num::before { content: counter(step); }
.step h3 { font-size: 16px; margin-bottom: 5px; }
.step p { color: var(--muted); font-size: 14px; margin: 0; }

/* CTA band */
.cta-band {
  margin-top: var(--sp-9); text-align: center;
  padding: clamp(36px, 6vw, 64px) var(--sp-5);
  border-radius: var(--radius-lg);
  border: 1px solid rgba(47, 84, 201, 0.18);
  background:
    radial-gradient(600px 320px at 50% -30%, rgba(47, 84, 201, 0.12), transparent 70%),
    linear-gradient(180deg, #ffffff, var(--seasonal));   /* Cloud Dancer base */
  box-shadow: var(--shadow-lg);
}
.cta-band h2 { font-size: clamp(26px, 4vw, 40px); }
.cta-band p { color: var(--txt-soft); max-width: 520px; margin: 0 auto var(--sp-5); font-size: 17px; }

/* FAQ */
.faq { max-width: 760px; margin: 0 auto; display: grid; gap: var(--sp-3); }
.faq details {
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: var(--panel); padding: 4px 18px; transition: border-color 0.2s, box-shadow 0.2s;
  box-shadow: var(--shadow-sm);
}
.faq details[open] { border-color: var(--line-strong); }
.faq summary {
  list-style: none; cursor: pointer; font-weight: 600; color: var(--txt);
  padding: 14px 0; display: flex; justify-content: space-between; align-items: center; gap: 12px;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: '+'; font-size: 22px; color: var(--muted); transition: transform 0.2s var(--ease); line-height: 1; }
.faq details[open] summary::after { transform: rotate(45deg); color: var(--brand); }
.faq details p { color: var(--muted); font-size: 14.5px; padding-bottom: 16px; margin: 0; }

/* --------- Hero texture: whisper-soft dot grid (premium, product-led) ----- */
.hero::before {
  content: ''; position: absolute; z-index: -1;
  left: 50%; top: -40px; width: min(900px, 96vw); height: 360px; transform: translateX(-50%);
  background-image: radial-gradient(rgba(47, 84, 201, 0.12) 1px, transparent 1.4px);
  background-size: 24px 24px;
  -webkit-mask-image: radial-gradient(460px 260px at 50% 35%, #000, transparent 72%);
  mask-image: radial-gradient(460px 260px at 50% 35%, #000, transparent 72%);
  pointer-events: none;
}

/* ----- Product showcase: "see your brand inside the AI answer" (example) -- */
.showcase { max-width: 720px; margin: var(--sp-7) auto 0; }
.showcase-card {
  text-align: left;
  background: linear-gradient(180deg, #ffffff, var(--seasonal));   /* Cloud Dancer warmth */
  border: 1px solid var(--seasonal-line);
  border-radius: var(--radius); box-shadow: var(--shadow-lg); padding: 22px 24px;
}
.sc-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
.sc-tag { font-size: 11px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--brand-700); background: rgba(47, 84, 201, 0.09); border: 1px solid rgba(47, 84, 201, 0.2); padding: 3px 9px; border-radius: var(--radius-pill); }
.sc-engine { font-size: 12.5px; color: var(--muted); font-weight: 600; }
.sc-q { font-size: 15px; font-weight: 600; color: var(--txt); margin-bottom: 10px; }
.sc-a { font-size: 15px; color: var(--txt-soft); line-height: 1.75; margin: 0; }
.brand-chip { display: inline-block; padding: 1px 8px; border-radius: 6px; font-weight: 600; font-size: 14px; }
.brand-chip.rival { background: var(--panel-2); color: var(--muted); border: 1px solid var(--line); }
.brand-chip.you { background: linear-gradient(135deg, rgba(47, 84, 201, 0.14), rgba(11, 143, 176, 0.14)); color: var(--brand-700); border: 1px solid rgba(47, 84, 201, 0.3); }
.sc-foot { display: flex; align-items: center; gap: 12px; margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); flex-wrap: wrap; }

/* --------------------------- Bento feature grid -------------------------- */
.bento { display: grid; gap: var(--sp-4); grid-template-columns: repeat(3, 1fr); }
.bento .feature { box-shadow: var(--shadow-sm); margin: 0; }
.bento .t-hero {
  grid-column: 1 / 3; grid-row: 1 / 3; display: flex; flex-direction: column; justify-content: center;
  background: radial-gradient(440px 260px at 0% 0%, rgba(47, 84, 201, 0.07), transparent 70%), #fff;
}
.bento .t-hero p { margin-bottom: 0; }
.board { list-style: none; margin: 18px 0 0; padding: 0; display: grid; gap: 11px; }
.board li { display: grid; grid-template-columns: 92px 1fr 30px; align-items: center; gap: 12px; font-size: 13px; }
.board .who { color: var(--txt-soft); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.board li.you .who { color: var(--brand-700); }
.board .bar { height: 8px; border-radius: 999px; background: var(--panel-2); overflow: hidden; }
.board .bar i { display: block; height: 100%; border-radius: 999px; background: #d2d2d7; }
.board li.you .bar i { background: var(--grad-brand); }
.board .val { text-align: right; font-weight: 700; font-family: 'Space Grotesk', sans-serif; color: var(--txt); }
/* Tablet / landscape: 2-up bento with the hero tile and the last tile as
   full-width banners (avoids a cramped 3-col and a lone orphan tile). */
@media (min-width: 721px) and (max-width: 1024px) {
  .bento { grid-template-columns: repeat(2, 1fr); }
  .bento .t-hero { grid-column: 1 / -1; grid-row: auto; }
  .bento > .feature:last-child { grid-column: 1 / -1; }
}
@media (max-width: 720px) {
  .bento { grid-template-columns: 1fr; }
  .bento .t-hero { grid-column: auto; grid-row: auto; }
}

/* ------------------------------ Footer nav ------------------------------- */
.footer-nav { display: flex; gap: 18px; }
.footer-nav a { color: var(--muted); font-weight: 500; }
.footer-nav a:hover { color: var(--txt); }
.footer-legal {
  max-width: var(--maxw); margin: 0 auto;
  padding: 0 clamp(16px, 4vw, 32px) 22px;
  color: var(--muted-2); font-size: 11.5px; line-height: 1.5;
}

/* ----------------- Dashboard leaderboard (wider name column) ------------- */
.board-lg li { grid-template-columns: minmax(130px, 230px) 1fr 46px; font-size: 14px; }
.board-lg .bar { height: 10px; }

/* -------------------- Signed-out dashboard value gate -------------------- */
.gate { display: grid; gap: var(--sp-7); grid-template-columns: 1.05fr 0.95fr; align-items: center; }
.gate h1 { font-size: clamp(28px, 4.4vw, 40px); margin: 16px 0 12px; }
.gate-list { list-style: none; padding: 0; margin: 20px 0 26px; display: grid; gap: 13px; }
.gate-list li { display: flex; gap: 11px; align-items: flex-start; color: var(--txt-soft); font-size: 15px; }
.gate-list li .chk { color: var(--good); font-weight: 700; flex-shrink: 0; }
@media (max-width: 700px) { .gate { grid-template-columns: 1fr; } }

/* ------------------------------- Pricing --------------------------------- */
/* 3 plans: 3-up from tablet to desktop, 1-up on phones (no 2+1 orphan). */
.pricing-grid { display: grid; gap: var(--sp-4); grid-template-columns: repeat(3, 1fr); align-items: stretch; }
.price-card {
  display: flex; flex-direction: column;
  background: var(--panel);
  border: 1px solid var(--line); border-radius: var(--radius); padding: 26px 24px;
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s var(--ease), border-color 0.2s var(--ease), box-shadow 0.2s var(--ease);
}
.price-card:hover { transform: translateY(-4px); border-color: var(--line-strong); box-shadow: var(--shadow-lg); }
.price-card.featured {
  border-color: rgba(47, 84, 201, 0.4);
  box-shadow: 0 0 0 1px rgba(47, 84, 201, 0.18), var(--shadow-lg);
  background:
    radial-gradient(420px 220px at 50% -20%, rgba(47, 84, 201, 0.10), transparent 70%),
    linear-gradient(180deg, #ffffff, var(--seasonal));   /* Cloud Dancer base */
}
.price-card .plan-name { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.price-card h3 { font-size: 18px; margin: 0; text-transform: capitalize; }
.badge-popular { font-size: 11px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; color: #fff; background: var(--grad-brand); padding: 4px 10px; border-radius: var(--radius-pill); }
.price { font-family: 'Space Grotesk', sans-serif; font-size: 36px; font-weight: 700; margin: 14px 0 2px; color: #1d1d1f; }
.price .per { font-size: 15px; font-weight: 500; color: var(--muted); font-family: 'Inter', sans-serif; }
.price-card .blurb { color: var(--muted); font-size: 14px; min-height: 40px; }
.feature-list { list-style: none; padding: 0; margin: 18px 0 22px; display: grid; gap: 10px; }
.feature-list li { display: flex; align-items: center; gap: 10px; font-size: 14px; color: var(--txt-soft); }
.feature-list li .chk { color: var(--good); flex-shrink: 0; font-weight: 700; }
.price-card .btn, .price-card .btn.secondary { margin-top: auto; }
.price-note { margin: 2px 0 0; min-height: 18px; }

/* Monthly / Annual billing toggle. */
.bill-toggle {
  display: flex; width: fit-content; gap: 4px; margin: 22px auto 6px; padding: 4px;
  background: var(--panel-2); border: 1px solid var(--line); border-radius: var(--radius-pill);
}
.bill-toggle button {
  width: auto; border: 0; background: transparent; cursor: pointer;
  padding: 8px 18px; border-radius: var(--radius-pill); font: inherit; font-size: 14px; font-weight: 600;
  color: var(--muted); display: inline-flex; align-items: center; gap: 8px; transition: background 0.18s var(--ease), color 0.18s var(--ease);
}
.bill-toggle button.active { background: #fff; color: var(--txt); box-shadow: var(--shadow-sm); }
.bill-toggle .save { font-size: 11px; font-weight: 700; color: var(--brand-700); background: rgba(47, 84, 201, 0.1); padding: 2px 8px; border-radius: var(--radius-pill); }

/* Sign-up onboarding (unified account name + plan step). */
.onboard { max-width: 1040px; margin: 8px auto 0; }
.onboard-head { text-align: center; margin-bottom: 26px; }
.onboard-head h1 { font-size: clamp(26px, 4vw, 38px); margin: 14px 0 12px; }
.onboard-head .lead { margin: 0 auto; }
.onboard-name { max-width: 460px; margin: 0 auto 28px; }
.onboard-name .muted-small { display: block; margin-top: 8px; text-align: center; }
.onboard-grid { margin-top: 8px; }
.onb-card { width: 100%; cursor: pointer; text-align: left; font: inherit; appearance: none; -webkit-appearance: none; }
.onb-card .onb-left { display: inline-flex; align-items: center; gap: 10px; }
.onb-radio { width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--line-strong); flex-shrink: 0; position: relative; transition: border-color 0.2s var(--ease); }
.onb-card.selected { border-color: var(--brand); box-shadow: 0 0 0 2px rgba(47, 84, 201, 0.22), var(--shadow-lg); }
.onb-card.selected .onb-radio { border-color: var(--brand); }
.onb-card.selected .onb-radio::after { content: ''; position: absolute; inset: 3px; border-radius: 50%; background: var(--brand); }
.onboard-cta { text-align: center; margin-top: 28px; }
.onb-terms { display: flex; gap: 10px; align-items: flex-start; max-width: 640px; margin: 24px auto 0; font-size: 13.5px; color: var(--txt-soft); line-height: 1.55; text-align: left; }
.onb-terms input { width: 18px; height: 18px; flex-shrink: 0; margin-top: 1px; accent-color: var(--brand); cursor: pointer; }

/* Legal pages (Terms / Acceptable Use). */
.legal { max-width: 760px; margin: 0 auto; }
.legal-body { text-align: left; }
.legal-body h3 { font-size: 16px; margin: 24px 0 6px; }
.legal-body h3:first-child { margin-top: 0; }
.legal-body p { color: var(--txt-soft); line-height: 1.7; margin: 0 0 6px; }
.legal-list { margin: 6px 0 10px; padding-left: 20px; color: var(--txt-soft); line-height: 1.7; }
.legal-list li { margin: 4px 0; }

/* ------------------------------- Help / guide ---------------------------- */
.help-steps { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); }
.help-step { padding: 18px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: #fff; }
.help-step .n { display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px; border-radius: 50%; background: var(--grad-brand); color: #fff; font-weight: 700; font-size: 14px; margin-bottom: 11px; }
.help-step h4 { margin: 0 0 5px; font-size: 15px; }
.help-step p { margin: 0; color: var(--muted); font-size: 13.5px; line-height: 1.55; }
.help-defs { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); margin: 4px 0 0; }
.help-def { padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--panel-2); }
.help-def dt { font-weight: 600; font-size: 14px; margin-bottom: 4px; display: flex; align-items: center; gap: 9px; }
.help-def dt .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--grad-brand); flex: 0 0 auto; }
.help-def dd { margin: 0; color: var(--muted); font-size: 13.5px; line-height: 1.55; }

/* ----------------------------- Dashboard --------------------------------- */
.page-head { display: flex; justify-content: space-between; align-items: flex-start; gap: var(--sp-4); flex-wrap: wrap; margin-bottom: var(--sp-5); }
.page-head h1 { font-size: clamp(26px, 4vw, 34px); margin-bottom: 8px; }
.stat-row { display: grid; gap: var(--sp-4); grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); margin: var(--sp-4) 0; }
.stat { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 18px; box-shadow: var(--shadow-sm); }
.stat .label { font-size: 12px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); }
.stat .value { font-family: 'Space Grotesk', sans-serif; font-size: 28px; font-weight: 700; margin-top: 4px; }
.h-divider { margin-top: var(--sp-7); padding-top: var(--sp-6); border-top: 1px solid var(--line); }

/* ------------------------- Reveal-on-scroll ------------------------------ */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity 0.6s var(--ease), transform 0.6s var(--ease); }
.reveal.in { opacity: 1; transform: none; }

/* ============================ Motion (lightweight) ======================= */
/* Hero entrance: children cascade up on load. */
@keyframes fadeUp { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
.hero > * { animation: fadeUp 0.7s var(--ease) both; }
.hero > *:nth-child(1) { animation-delay: 0.04s; }
.hero > *:nth-child(2) { animation-delay: 0.12s; }
.hero > *:nth-child(3) { animation-delay: 0.20s; }
.hero > *:nth-child(4) { animation-delay: 0.28s; }
.hero > *:nth-child(5) { animation-delay: 0.36s; }
.hero > *:nth-child(6) { animation-delay: 0.44s; }

/* Slowly shimmering gradient on the headline accent. */
.hero h1 .grad { background-size: 220% 100%; animation: gradShift 7s ease-in-out infinite; }
@keyframes gradShift { 0%, 100% { background-position: 0% 50%; } 50% { background-position: 100% 50%; } }

/* Hero glow drifts gently. */
.hero::before { animation: floaty 18s ease-in-out infinite; }
@keyframes floaty {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  50% { transform: translateX(-50%) translateY(-14px); }
}

/* Leaderboard bars grow into place (data coming alive). */
@keyframes barGrow { from { width: 0; } to { width: var(--w, 0); } }
.board .bar i { width: var(--w, 0); animation: barGrow 1s var(--ease) 0.1s both; }
.reveal .board .bar i { width: 0; animation: none; }
.reveal.in .board .bar i { width: var(--w, 0); animation: barGrow 1s var(--ease) 0.12s both; }

/* Shine sweep across primary buttons on hover. */
.btn { position: relative; overflow: hidden; }
.btn:not(.secondary):not(.ghost)::after {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(105deg, transparent 32%, rgba(255, 255, 255, 0.38) 50%, transparent 68%);
  transform: translateX(-130%);
  transition: transform 0.7s var(--ease);
}
.btn:not(.secondary):not(.ghost):hover::after { transform: translateX(130%); }

/* Feature icon springs on card hover. */
.feature .ficon { transition: transform 0.28s var(--ease); }
.feature:hover .ficon { transform: scale(1.08) rotate(-4deg); }

/* ==================== Client portal — presentation brand view ============
   The commercial surface an agency's client signs into: a focused, animated
   report built for CONFIDENCE at a glance, not operation. Self-contained
   entrance animations (no scroll observer) so it animates on every render. */
.cp-view > * { animation: fadeUp 0.6s var(--ease) both; }
.cp-view > *:nth-child(1) { animation-delay: 0.03s; }
.cp-view > *:nth-child(2) { animation-delay: 0.11s; }
.cp-view > *:nth-child(3) { animation-delay: 0.19s; }
.cp-view > *:nth-child(4) { animation-delay: 0.27s; }
.cp-view > *:nth-child(5) { animation-delay: 0.35s; }
.cp-view > *:nth-child(6) { animation-delay: 0.43s; }
.cp-view > *:nth-child(7) { animation-delay: 0.51s; }
.cp-view > *:nth-child(n+8) { animation-delay: 0.58s; }

/* Hero — a premium jewel-blue panel with a drifting radial glow. */
.cp-hero {
  position: relative; overflow: hidden;
  border: 1px solid var(--seasonal-line);
  border-radius: 22px; padding: 34px 34px 30px;
  background:
    radial-gradient(120% 140% at 88% -10%, rgba(22,179,207,0.14), transparent 55%),
    radial-gradient(120% 130% at 6% 0%, rgba(47,84,201,0.13), transparent 52%),
    var(--seasonal);
  box-shadow: var(--shadow);
}
.cp-hero::before {
  content: ''; position: absolute; top: -40%; left: 50%; width: 60%; height: 120%;
  background: radial-gradient(closest-side, rgba(88,118,230,0.18), transparent 70%);
  transform: translateX(-50%); pointer-events: none;
  animation: floaty 16s ease-in-out infinite;
}
.cp-hero > * { position: relative; z-index: 1; }
.cp-hero-logo { height: 40px; max-width: 240px; object-fit: contain; display: block; margin-bottom: 20px; }
.cp-hero-grid { display: grid; grid-template-columns: 1fr auto; gap: 30px; align-items: center; }
.cp-eyebrow { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.12em; color: var(--muted); }
.cp-hero h1 { font-size: clamp(26px, 4vw, 38px); line-height: 1.05; margin: 10px 0 6px; letter-spacing: -0.02em; }
.cp-hero-meta { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }

/* The star: an oversized animated Share-of-Answer figure. */
.cp-score { text-align: center; min-width: 190px; }
.cp-score-num {
  font-family: 'Space Grotesk', sans-serif; font-weight: 700; letter-spacing: -0.03em;
  font-size: clamp(66px, 11vw, 104px); line-height: 0.92;
  background: var(--grad-brand); background-size: 200% 100%;
  -webkit-background-clip: text; background-clip: text;
  color: transparent; -webkit-text-fill-color: transparent;
  animation: gradShift 7s ease-in-out infinite;
}
.cp-score-suf { font-family: 'Space Grotesk', sans-serif; font-size: 22px; font-weight: 600; color: var(--muted-2); }
.cp-score-label { font-size: 12px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); margin-top: 6px; }
/* No-score-yet: a STATIC glyph that mirrors the TopTable LOGO MARK (rounded
   square + three ascending bars) in a soft brand tint — clearly an intentional
   design element (legible on the light hero, not "nothing"), unmistakably "your
   ranking appears here", and NOT a ring/spinner (no live-loading read). */
.cp-score-ghost { display: flex; align-items: center; justify-content: center; height: clamp(66px, 11vw, 104px); }
.cp-score-ghost svg { width: 58px; height: 58px; }
.cpg-bg { fill: rgba(47, 84, 201, 0.10); }
.cpg-bar { fill: rgba(47, 84, 201, 0.5); }
.cp-score-await { text-transform: none; letter-spacing: 0; color: var(--muted-2); font-size: 12.5px; }

/* Verdict chip — instant emotional read, color-coded. */
.cp-verdict { display: inline-flex; align-items: center; gap: 8px; margin-top: 16px;
  padding: 7px 14px; border-radius: 999px; font-size: 13.5px; font-weight: 600; }
.cp-verdict .vdot { width: 9px; height: 9px; border-radius: 50%; }
.cp-verdict.good { background: rgba(26,138,79,0.10); color: var(--good); border: 1px solid rgba(26,138,79,0.25); }
.cp-verdict.good .vdot { background: var(--good); }
.cp-verdict.mid { background: rgba(177,112,10,0.10); color: var(--warn); border: 1px solid rgba(177,112,10,0.25); }
.cp-verdict.mid .vdot { background: var(--warn); }
.cp-verdict.low { background: rgba(214,57,78,0.09); color: var(--bad); border: 1px solid rgba(214,57,78,0.22); }
.cp-verdict.low .vdot { background: var(--bad); }

/* Headline metric trio under the hero. */
.cp-kpis { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-top: 20px; }
.cp-kpi { background: rgba(255,255,255,0.6); border: 1px solid var(--seasonal-line); border-radius: 14px; padding: 16px 18px; }
.cp-kpi .k { font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); }
.cp-kpi .v { font-family: 'Space Grotesk', sans-serif; font-size: 30px; font-weight: 700; margin-top: 4px; color: var(--txt); }
.cp-hero-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 22px; }

/* Section titles inside the portal read a touch larger + calmer. */
.cp-view .panel h3 .cp-sub { font-weight: 400; color: var(--muted); font-size: 14px; }

@media (max-width: 640px) {
  .cp-hero { padding: 26px 20px 22px; }
  .cp-hero-grid { grid-template-columns: 1fr; gap: 14px; }
  .cp-score { min-width: 0; text-align: left; }
  .cp-kpis { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  .hero > *, .hero h1 .grad, .hero::before { animation: none !important; }
  .board .bar i, .reveal .board .bar i, .reveal.in .board .bar i { width: var(--w, 0) !important; animation: none !important; }
  .btn::after { display: none !important; }
  .cp-view > *, .cp-hero::before, .cp-score-num { animation: none !important; }
}

/* ------------------------------ Responsive ------------------------------- */
@media (max-width: 720px) {
  .site-header { gap: 12px; }
  .nav-toggle { display: inline-flex; }
  .site-nav {
    display: none; position: absolute; top: calc(100% + 1px); left: 0; right: 0; margin: 0;
    flex-direction: column; gap: 2px; padding: 8px 16px 14px;
    background: rgba(255, 255, 255, 0.97);
    backdrop-filter: saturate(180%) blur(14px); -webkit-backdrop-filter: saturate(180%) blur(14px);
    border-bottom: 1px solid var(--line); box-shadow: var(--shadow);
  }
  .site-nav.open { display: flex; }
  .site-nav a { padding: 12px 14px; font-size: 16px; }
  .scan-box { flex-direction: column; }
  .scan-box .btn { width: 100%; }
  .footer-inner { flex-direction: column; align-items: flex-start; gap: 10px; }
  .pricing-grid { grid-template-columns: 1fr; }
  /* 16px inputs prevent iOS Safari from auto-zooming on focus */
  input, select, textarea { font-size: 16px; }
}

/* Viewport-fit hero: on tablet/desktop with a tall-enough window, frame the
   hero as the first screen so the key block is fully visible without scrolling.
   min-height never clips — if content is taller than the space it just flows.
   Excluded on phones (<721px) and short windows (<760px): those stay as-is. */
@media (min-width: 721px) and (min-height: 760px) {
  .hero {
    min-height: calc(100svh - 120px);
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    padding-top: 0;
  }
  .hero > .muted-small { max-width: 600px; }
}

@media (max-width: 560px) {
  .section { margin-top: var(--sp-7); }
  .cta-band { margin-top: var(--sp-7); }
  /* Stacked, full-width inputs and CTAs for thumb-friendly forms */
  .row > input, .row > select { max-width: 100% !important; flex: 1 1 100%; }
  .cta-band .btn-row, .gate .btn-row { flex-direction: column; }
  .cta-band .btn, .gate .btn-row .btn { width: 100%; }
  .page-head { flex-direction: column; align-items: stretch; }
  .sc-head { flex-wrap: wrap; }
}

/* ----------------------- Clerk branding removal -------------------------- */
/* Clerk's .cl-footer holds both the "Sign up" action (.cl-footerAction) AND the
   "Secured by Clerk" badge. Hide only the badge, keep the sign-up link. */
.cl-footer > :not(.cl-footerAction) { display: none !important; }
/* "Secured by Clerk" in the user-button account popover (separate footer). */
.cl-userButtonPopoverFooter { display: none !important; }
/* The same badge also shows in the Manage-account (UserProfile) modal, outside the
   footers above. It links to clerk.com, so hide that link and its Clerk wrapper
   wherever they render (the app never links to clerk.com itself). */
[class*="cl-"] a[href*="clerk.com"],
[class*="cl-"]:has(> a[href*="clerk.com"]) { display: none !important; }
/* Remove Clerk's self-service "Delete account" danger zone (UserProfile → Security).
   Account/user deletion happens only through the app, where guards + cleanup run —
   and a Global Admin must never self-delete. Fallback for the appearance overrides
   in app.js (class names can vary across Clerk versions). */
.cl-profileSection__danger,
.cl-profileSectionItem__danger,
.cl-profileSectionPrimaryButton__danger { display: none !important; }
/* Account icon (top-right): the no-photo avatar is rebranded in JS (brandUserAvatar
   in app.js) by restyling the rendered element directly — CSS can't reliably reach
   Clerk's generated <img>. This just gives the trigger the app's brand focus ring. */
.cl-userButtonTrigger:focus { box-shadow: 0 0 0 3px rgba(47, 84, 201, 0.25) !important; }

/* ------------------ Clerk "Manage account" modal sizing ------------------- */
/* Clerk sizes the UserProfile modal for its FULL feature set (organizations,
   MFA device lists, connected accounts…). Ours shows only Profile + Security
   (the danger zone is removed above), so the default ~880x700 shell floats
   mostly empty. Fit the HEIGHT to what we actually show (viewport-capped —
   when a page does grow, e.g. many active devices under Security, Clerk's
   internal scroll area takes over at the cap). Width stays near Clerk's own:
   the two-pane layout (fixed nav + content) clips horizontally if squeezed.
   Scoped to the profile modal; the sign-in/up cards keep their own sizing.
   Fallback for the userProfileProps appearance override in app.js (class
   names can vary across Clerk versions). */
.cl-userProfile-root .cl-cardBox {
  width: min(800px, calc(100vw - 32px)) !important;
  height: auto !important;
  min-height: 0 !important;
  max-height: min(600px, calc(100vh - 48px)) !important;
}

/* ===================== Dashboard: workspace (brand) detail ================ */
.back-link { margin: 0 0 8px; }
.back-link a { font-size: 14px; font-weight: 600; color: var(--muted); }
.back-link a:hover { color: var(--brand-700); }

/* Inline add-rows (prompts, competitors, brands) */
.ws-add { display: flex; gap: var(--sp-3); flex-wrap: wrap; align-items: center; margin: 4px 0 16px; }
.ws-add > input { max-width: 340px; }
.select.sm { padding: 6px 10px; font-size: 13px; max-width: 150px; }

/* ===== Global-admin portal: tabs + statistics ===== */
.admin-tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin: 4px 0 24px; }
.admin-tab { padding: 10px 18px; font-weight: 600; font-size: 14px; color: var(--muted);
  border-bottom: 2px solid transparent; margin-bottom: -1px; transition: color .15s var(--ease), border-color .15s var(--ease); }
.admin-tab:hover { color: var(--txt); }
.admin-tab.active { color: var(--brand-700); border-bottom-color: var(--brand); }

/* KPI tiles */
.kpi-row { display: grid; gap: var(--sp-4); grid-template-columns: repeat(auto-fit, minmax(185px, 1fr)); margin: 0 0 var(--sp-5); }
.kpi { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow-sm); }
.kpi-label { font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 600; }
.kpi-value { font-family: 'Space Grotesk', sans-serif; font-size: 32px; font-weight: 700; line-height: 1.1; margin: 7px 0 4px; color: var(--txt); }
.kpi-sub { font-size: 12.5px; color: var(--muted); }
.kpi-hero { background: linear-gradient(135deg, rgba(47,84,201,.10), rgba(22,179,207,.08)); border-color: rgba(47,84,201,.22); }
.kpi-hero .kpi-value { background: var(--grad-text); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* Per-plan stat cards */
.plan-stats { display: grid; gap: var(--sp-4); grid-template-columns: repeat(auto-fit, minmax(215px, 1fr)); margin: 0 0 var(--sp-5); }
.plan-stat { position: relative; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 22px; box-shadow: var(--shadow-sm); overflow: hidden; }
.plan-stat::before { content: ''; position: absolute; inset: 0 0 auto 0; height: 3px; background: var(--line-strong); }
.plan-stat.plan-agency::before { background: var(--grad-brand); }
.plan-stat.plan-unlimited::before { background: linear-gradient(120deg, #2f54c9, #0b8fb0); }
.plan-stat h3 { font-size: 17px; text-transform: capitalize; }
.plan-price { font-weight: 700; color: var(--txt-soft); font-size: 15px; white-space: nowrap; }
.plan-price span { color: var(--muted); font-weight: 500; font-size: 12px; }
.plan-count { font-family: 'Space Grotesk', sans-serif; font-size: 30px; font-weight: 700; margin: 12px 0 14px; line-height: 1; }
.plan-count span { font-family: 'Inter', sans-serif; font-size: 13px; font-weight: 500; color: var(--muted); }
.plan-metrics { list-style: none; margin: 0; padding: 0; display: grid; gap: 0; }
.plan-metrics li { display: flex; justify-content: space-between; font-size: 13.5px; padding: 8px 0; border-top: 1px dashed var(--line); }
.plan-metrics li span { color: var(--muted); }
.plan-metrics li b { font-weight: 700; color: var(--txt); }

/* Labelled field (settings + branding) */
.field { display: block; }
.field-label { display: block; font-size: 12px; font-weight: 600; color: var(--muted); margin-bottom: 6px; text-transform: uppercase; letter-spacing: 0.04em; }
.settings-grid { display: grid; gap: var(--sp-4); grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }

/* Selectable chip (engine pickers, watchlist toggle, branding checkbox) */
.choice-row { display: flex; gap: 8px; flex-wrap: wrap; }
.choice {
  display: inline-flex; align-items: center; gap: 8px; cursor: pointer;
  font-size: 13.5px; font-weight: 600; color: var(--txt-soft); user-select: none;
  border: 1px solid var(--line-strong); background: #fff; padding: 8px 13px; border-radius: var(--radius-pill);
  transition: border-color 0.15s var(--ease), background 0.15s var(--ease), color 0.15s var(--ease);
}
.choice:hover { border-color: var(--brand); }
.choice input { width: auto; margin: 0; accent-color: var(--brand); }
.choice:has(input:checked) { border-color: var(--brand); background: rgba(47, 84, 201, 0.07); color: var(--brand-700); }
.choice:has(input:disabled) { opacity: 0.55; cursor: default; }

/* Small engine/meta tag */
.etag { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 600; color: var(--txt-soft); background: var(--panel-2); border: 1px solid var(--line); padding: 2px 9px; border-radius: var(--radius-pill); }
.etag.watch { color: var(--brand-700); background: rgba(47, 84, 201, 0.08); border-color: rgba(47, 84, 201, 0.22); }
/* Account created but its admin/client hasn't accepted the invite yet. */
.etag.pending { color: #92600a; background: rgba(217, 138, 12, 0.10); border-color: rgba(217, 138, 12, 0.28); }

/* Editable list rows (prompts, competitors, sources) */
.data-list { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 8px; }
.data-list li { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 11px 14px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: #fff; }
.data-list li.muted-small { border: 0; background: transparent; padding: 6px 0; }
.dl-main { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; min-width: 0; }
.dl-text { font-size: 14.5px; color: var(--txt); font-weight: 500; }
.dl-meta { display: inline-flex; gap: 6px; align-items: center; flex-wrap: wrap; }

/* Icon (delete) button + small + danger button variants */
.icon-btn {
  flex-shrink: 0; width: 30px; height: 30px; padding: 0; display: grid; place-items: center;
  border-radius: 8px; border: 1px solid var(--line); background: #fff; color: var(--muted); cursor: pointer; font-size: 13px;
  transition: color 0.15s var(--ease), border-color 0.15s var(--ease), background 0.15s var(--ease);
}
.icon-btn:hover { color: var(--bad); border-color: rgba(225, 29, 72, 0.4); background: rgba(225, 29, 72, 0.05); }
.btn.sm { padding: 7px 13px; font-size: 13px; }
.btn.danger { background-image: none; background-color: #fff; border: 1px solid rgba(225, 29, 72, 0.4); color: var(--bad); box-shadow: var(--shadow-sm);
  -webkit-backdrop-filter: none; backdrop-filter: none; text-shadow: none; }
.btn.danger:hover { background-color: rgba(225, 29, 72, 0.06); border-color: var(--bad); color: var(--bad); box-shadow: 0 8px 18px -10px rgba(225, 29, 72, 0.3); transform: translateY(-1px); }
.danger-row { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-4); flex-wrap: wrap; margin-top: var(--sp-5); padding-top: var(--sp-5); border-top: 1px solid var(--line); }

/* Modal (answer replay) */
.modal-backdrop {
  position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 20px;
  background: rgba(0, 0, 0, 0.42); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px);
  animation: fadeIn 0.18s var(--ease);
}
.modal { width: min(680px, 100%); max-height: 92vh; overflow: auto; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-lg); animation: popIn 0.2s var(--ease); }
.modal-head { position: sticky; top: 0; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 22px; border-bottom: 1px solid var(--line); background: rgba(255, 255, 255, 0.92); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.modal-head h3 { margin: 0; font-size: 18px; }
.modal-x { width: 32px; height: 32px; flex-shrink: 0; border-radius: 8px; border: 1px solid var(--line); background: #fff; color: var(--muted); cursor: pointer; font-size: 14px; }
.modal-x:hover { color: var(--txt); border-color: var(--line-strong); }
.modal-body { padding: 20px 22px 24px; }
.raw-q { font-weight: 600; font-size: 15px; color: var(--txt); padding: 12px 14px; background: var(--panel-2); border: 1px solid var(--line); border-radius: var(--radius-sm); }
.raw-answer { font-size: 14.5px; line-height: 1.75; color: var(--txt-soft); }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes popIn { from { opacity: 0; transform: translateY(8px) scale(0.99); } to { opacity: 1; transform: none; } }

/* In-app confirm dialog (compact modal) */
.modal.modal-sm { width: min(440px, 100%); animation: popIn 0.2s var(--ease); }
/* Contact form: keep the taller (unauthenticated) 5-field variant compact so it
   opens fully without scrolling on typical screens. */
.contact-modal .modal-body { padding: 16px 22px 20px; }
.confirm-msg { margin: 0; color: var(--txt-soft); line-height: 1.6; font-size: 15px; }

/* Toast notifications (replace native alert) — glassy, brand-consistent.
   Offsets honour the safe-area insets (viewport-fit=cover) so toasts never sit
   under a phone's home indicator / browser chrome, and the stack is height-capped
   to the dynamic viewport so it stays fully on-screen on every device. */
.toast-host {
  position: fixed; z-index: 1000;
  right: calc(18px + env(safe-area-inset-right, 0px));
  bottom: calc(18px + env(safe-area-inset-bottom, 0px));
  display: flex; flex-direction: column; gap: 10px;
  width: min(380px, calc(100vw - 28px));
  max-height: calc(100vh - 36px);
  max-height: calc(100dvh - 36px);
  pointer-events: none;
}
/* Phones: full-width band with side + bottom safe-area padding. */
@media (max-width: 560px) {
  .toast-host {
    left: calc(12px + env(safe-area-inset-left, 0px));
    right: calc(12px + env(safe-area-inset-right, 0px));
    bottom: calc(12px + env(safe-area-inset-bottom, 0px));
    width: auto;
  }
}
.toast {
  pointer-events: auto; display: flex; align-items: flex-start; gap: 11px;
  background: rgba(255, 255, 255, 0.86);
  -webkit-backdrop-filter: blur(16px) saturate(1.5); backdrop-filter: blur(16px) saturate(1.5);
  border: 1px solid var(--line-strong); border-left: 3px solid var(--muted-2);
  border-radius: var(--radius-sm); padding: 13px 14px; box-shadow: var(--shadow-lg);
  font-size: 14px; color: var(--txt); animation: toastIn 0.26s var(--ease);
}
.toast.out { animation: toastOut 0.2s var(--ease) forwards; }
.toast-ic {
  flex-shrink: 0; width: 20px; height: 20px; margin-top: 1px; border-radius: 50%;
  display: grid; place-items: center; font-size: 12px; font-weight: 700; font-style: normal;
  color: #fff; background: var(--muted-2);
}
.toast-msg { flex: 1; line-height: 1.5; word-break: break-word; }
.toast-x { flex-shrink: 0; background: none; border: 0; color: var(--muted-2); cursor: pointer; font-size: 12px; padding: 2px 5px; border-radius: 6px; line-height: 1; }
.toast-x:hover { color: var(--txt); background: rgba(0, 0, 0, 0.05); }
.toast-success { border-left-color: var(--good); } .toast-success .toast-ic { background: var(--good); }
.toast-error   { border-left-color: var(--bad);  } .toast-error   .toast-ic { background: var(--bad); }
.toast-warn    { border-left-color: var(--warn); } .toast-warn    .toast-ic { background: var(--warn); }
.toast-info    { border-left-color: var(--brand);} .toast-info    .toast-ic { background: var(--brand); }
@keyframes toastIn { from { opacity: 0; transform: translateY(10px) scale(0.98); } to { opacity: 1; transform: none; } }
@keyframes toastOut { to { opacity: 0; transform: translateY(6px) scale(0.98); } }

@media (max-width: 560px) {
  .ws-add > input { max-width: 100%; flex: 1 1 100%; }
  .danger-row { flex-direction: column; align-items: stretch; }
}

/* --------------------------- Reduced motion ------------------------------ */
@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; scroll-behavior: auto !important; }
  .reveal { opacity: 1; transform: none; }
}
