:root {
  color-scheme: light dark;
  --page: #f7f8f7;
  --surface: #ffffff;
  --surface-subtle: #f1f4f2;
  --text: #17201b;
  --muted: #58645d;
  --border: #cbd5ce;
  --accent: #126a45;
  --accent-strong: #0b4f33;
  --accent-soft: #dff3e8;
  --focus: #155eef;
  --danger: #a33b24;
  --warning: #855b12;
  --shadow: 0 12px 32px rgb(23 32 27 / 8%);
  --radius: 14px;
  --sans: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --mono: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
}

@media (prefers-color-scheme: dark) {
  :root {
    --page: #101512;
    --surface: #17201b;
    --surface-subtle: #202b24;
    --text: #eef4ef;
    --muted: #b1bcb4;
    --border: #405147;
    --accent: #6fdaa6;
    --accent-strong: #a3edc4;
    --accent-soft: #173f2b;
    --focus: #8ab4ff;
    --danger: #ffae98;
    --warning: #edcc7a;
    --shadow: 0 12px 32px rgb(0 0 0 / 24%);
  }
}

* { box-sizing: border-box; }
.visually-hidden {
  position: absolute !important; width: 1px !important; height: 1px !important;
  padding: 0 !important; margin: -1px !important; overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important; white-space: nowrap !important; border: 0 !important;
}
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--page);
  color: var(--text);
  font: 400 16px/1.55 var(--sans);
}
button, input, textarea { font: inherit; }
button, input, textarea, summary { accent-color: var(--accent); }
button { cursor: pointer; }
button:focus-visible, input:focus-visible, textarea:focus-visible, a:focus-visible, summary:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}
a { color: var(--accent-strong); }
@media (prefers-color-scheme: dark) { a { color: var(--accent-strong); } }

.site-shell { width: min(1180px, calc(100% - 32px)); margin: 0 auto; }
.site-header {
  display: flex; align-items: center; justify-content: space-between; gap: 18px;
  padding: 20px 0; border-bottom: 1px solid var(--border);
}
.brand { display: inline-flex; gap: 10px; align-items: center; color: var(--text); text-decoration: none; font-weight: 800; }
.brand-mark {
  display: block; width: 34px; height: 34px; border-radius: 9px;
  flex: 0 0 34px; object-fit: contain;
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--accent) 35%, transparent);
}
/* Fallback if image path is missing (subpages use CSS letter mark) */
span.brand-mark {
  display: grid; place-items: center; background: var(--accent-strong);
  color: white; font-size: 12px; font-weight: 800; letter-spacing: -0.02em;
}
.site-nav { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 14px; font-size: .9rem; }
.site-nav a { text-decoration: none; color: var(--muted); }
.site-nav a:hover { color: var(--accent-strong); text-decoration: underline; }

.mode-toggle, .button, .button-secondary, .button-ghost, .method-button {
  min-height: 44px; border-radius: 9px; border: 1px solid transparent; padding: 9px 14px; font-weight: 700;
}
.mode-toggle, .button-secondary, .method-button { background: var(--surface); color: var(--text); border-color: var(--border); }
.mode-toggle[aria-pressed="true"] { background: var(--accent-soft); color: var(--accent-strong); border-color: var(--accent); }
.button { background: var(--accent); color: white; }
.button:hover { background: var(--accent-strong); }
.button-secondary:hover, .method-button:hover, .method-button.is-active { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-strong); }
.button-ghost { background: transparent; color: var(--accent-strong); border-color: transparent; }
.button-ghost:hover { text-decoration: underline; }
.button[disabled], .button-secondary[disabled] { opacity: .55; cursor: not-allowed; }

.hero {
  max-width: 780px;
  padding: clamp(42px, 8vw, 82px) 0 30px;
}
.home-page .hero {
  display: grid; grid-template-columns: minmax(0, .88fr) minmax(460px, 1.12fr);
  gap: clamp(30px, 5vw, 64px); align-items: center;
  padding: clamp(34px, 6vw, 72px) 0 34px;
  max-width: none;
}
.home-page .hero .hero-message { min-width: 0; }
.eyebrow { color: var(--accent-strong); font-weight: 800; font-size: .84rem; letter-spacing: .035em; text-transform: uppercase; }
h1, h2, h3, h4, p { margin-top: 0; }
h1 { margin: 10px 0 14px; max-width: 760px; font-size: clamp(2.25rem, 5vw, 4.15rem); line-height: 1.04; letter-spacing: -.045em; }
h2 { line-height: 1.15; letter-spacing: -.025em; }
.hero-copy { color: var(--muted); max-width: 700px; font-size: clamp(1.05rem, 2vw, 1.23rem); }
.hero-actions, .trust-chips, .input-actions, .share-actions, .method-tabs, .result-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.trust-chips { margin: 22px 0 6px; }
.chip { display: inline-flex; align-items: center; min-height: 32px; border: 1px solid var(--border); border-radius: 999px; padding: 3px 11px; color: var(--muted); font-size: .86rem; }
.always-visible { margin: 18px 0 0; color: var(--muted); font-size: .93rem; }

.home-page .hero .hero-demo {
  min-width: 0; overflow: hidden; border: 1px solid var(--border); border-radius: 20px;
  background: var(--surface); box-shadow: 0 24px 60px rgb(23 32 27 / 14%);
}
.home-page .hero .hero-demo-header {
  display: flex; justify-content: space-between; align-items: center; gap: 14px;
  min-height: 52px; padding: 11px 16px; border-bottom: 1px solid var(--border);
  background: color-mix(in srgb, var(--surface-subtle) 86%, var(--accent-soft));
  color: var(--muted); font-size: .75rem;
}
.home-page .hero .hero-demo-brand { color: var(--text); font-weight: 850; font-size: .9rem; }
.home-page .hero .hero-demo-local { margin-left: 9px; color: var(--accent-strong); font-weight: 750; }
.home-page .hero .hero-demo-rule { white-space: nowrap; }
.home-page .hero .hero-demo-screen { display: grid; grid-template-columns: minmax(0, 1.08fr) minmax(180px, .92fr); min-height: 286px; }
.home-page .hero .hero-demo-prompt { min-width: 0; padding: 18px; background: #111814; color: #eef4ef; }
.home-page .hero .hero-demo-section-head { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; }
.home-page .hero .hero-demo-section-head h2 { margin: 0 0 12px; color: #eef4ef; font-size: .8rem; letter-spacing: .04em; text-transform: uppercase; }
.home-page .hero .hero-demo-section-head span { color: #a8edbf; font-size: .7rem; font-weight: 750; }
.home-page .hero .hero-demo-prompt pre {
  margin: 0; min-height: 172px; max-height: 172px; overflow: hidden; white-space: pre-wrap;
  color: #b8c7bd; font: .72rem/1.5 var(--mono); outline-offset: 4px;
}
.home-page .hero .hero-demo-addition {
  margin: 12px 0 0; padding: 7px 9px; border-radius: 7px; background: rgb(111 218 166 / 13%);
  color: #a8edbf; font-size: .74rem; line-height: 1.35;
}
.home-page .hero .hero-demo-addition span { font-weight: 900; }
.home-page .hero .hero-demo-addition code { color: inherit; font-family: var(--mono); }
.home-page .hero .hero-demo-result { display: grid; align-content: center; min-width: 0; padding: 22px; background: linear-gradient(145deg, var(--surface), var(--accent-soft)); }
.home-page .hero .hero-demo-kicker { margin: 0; color: var(--muted); font-size: .76rem; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; }
.home-page .hero .hero-demo-score { display: flex; align-items: baseline; gap: 6px; margin: 8px 0 18px; font-variant-numeric: tabular-nums; }
.home-page .hero .hero-demo-score strong:first-child { color: var(--accent-strong); font-size: clamp(2.7rem, 5vw, 4.2rem); line-height: 1; }
.home-page .hero .hero-demo-score strong:last-child { font-size: 1.7rem; }
.home-page .hero .hero-demo-score span { color: var(--muted); font-size: .9rem; font-weight: 750; }
.home-page .hero .hero-demo-gap { margin: 0; padding-top: 14px; border-top: 1px solid var(--border); }
.home-page .hero .hero-demo-gap span { display: block; color: var(--warning); font-size: .68rem; font-weight: 850; letter-spacing: .06em; text-transform: uppercase; }
.home-page .hero .hero-demo-gap strong { display: block; margin-top: 4px; font-size: .94rem; line-height: 1.3; }
.home-page .hero .hero-demo-comparison {
  display: flex; align-items: center; justify-content: center; gap: 14px; padding: 10px 16px;
  border-top: 1px solid var(--border); background: var(--surface-subtle); color: var(--muted); font-size: .79rem;
}
.home-page .hero .hero-demo-comparison strong { color: var(--text); font-variant-numeric: tabular-nums; }
.home-page .hero .hero-demo-delta {
  display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px; margin: 0; padding: 9px 16px;
  border-top: 1px solid var(--border); background: rgb(111 218 166 / 12%);
  color: var(--text); font-size: .8rem; line-height: 1.35;
}
.home-page .hero .hero-demo-delta[hidden] { display: none; }
.home-page .hero .hero-demo-delta strong { color: var(--accent-strong); font-size: 1.05rem; font-variant-numeric: tabular-nums; }
.home-page .hero .hero-demo-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 12px 16px 6px; }
.home-page .hero .hero-demo-controls button { min-height: 36px; padding: 6px 11px; font-size: .78rem; }
.home-page .hero .hero-demo-controls span { margin-left: auto; color: var(--muted); font-size: .72rem; }
.home-page .hero .hero-demo-summary { margin: 0; padding: 5px 16px 14px; color: var(--muted); font-size: .75rem; line-height: 1.4; }
.home-page .hero .hero-demo[data-step="3"] .hero-demo-result { background: linear-gradient(145deg, var(--surface), color-mix(in srgb, var(--accent-soft) 82%, var(--surface))); }

.workspace { margin: 28px 0 70px; }
.workspace-grid { display: grid; grid-template-columns: minmax(0, 1.04fr) minmax(360px, .96fr); align-items: start; gap: 22px; }
.panel { border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); padding: clamp(20px, 3vw, 32px); }
.panel-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 15px; margin-bottom: 18px; }
.panel-heading h2 { margin: 0; font-size: 1.35rem; }
.quiet { color: var(--muted); font-size: .92rem; }
label { display: block; font-weight: 700; margin: 18px 0 7px; }
.help { color: var(--muted); font-size: .9rem; margin: 0 0 8px; }
textarea, input[type="url"], input[type="text"] { width: 100%; color: var(--text); background: var(--surface); border: 1px solid var(--border); border-radius: 9px; padding: 11px 12px; }
textarea { min-height: 278px; resize: vertical; font-family: var(--mono); font-size: .9rem; line-height: 1.5; }
.url-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 9px; margin-top: 10px; }
.drop-zone { display: grid; place-items: center; min-height: 88px; padding: 16px; border: 1px dashed var(--border); border-radius: 10px; background: var(--surface-subtle); color: var(--muted); text-align: center; }
.drop-zone.is-dragging { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-strong); }
.drop-zone button { text-decoration: underline; color: var(--accent-strong); background: none; border: 0; font-weight: 700; padding: 0; }
.status-message { min-height: 1.55em; margin: 10px 0 0; color: var(--danger); }
.profile-picker { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 18px; }
.profile-picker label { margin: 0; padding: 10px; border: 1px solid var(--border); border-radius: 9px; font-size: .9rem; }
.profile-picker input { margin-right: 7px; }

.shock-strip {
  display: grid; gap: 4px; margin: 0 0 28px; padding: 16px 18px;
  border: 1px solid var(--border); border-radius: var(--radius);
  background: linear-gradient(135deg, var(--accent-soft), var(--surface));
}
.shock-stat { margin: 0; font-size: clamp(1.05rem, 2.4vw, 1.25rem); line-height: 1.35; }
.shock-stat strong { color: var(--accent-strong); font-variant-numeric: tabular-nums; }
.shock-note { margin: 0; color: var(--muted); font-size: .88rem; }
.shock-note a { font-weight: 700; }

.product-paths {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
  margin: 0 0 12px; padding: 12px; border-radius: 12px;
  background: var(--surface-subtle); border: 1px solid var(--border);
}
.paths-label { color: var(--muted); font-weight: 700; font-size: .9rem; margin-right: 4px; }
.path-chip {
  min-height: 40px; border-radius: 999px; border: 1px solid var(--border);
  background: var(--surface); color: var(--text); padding: 6px 14px; font-weight: 700; font-size: .9rem;
}
.path-chip:hover, .path-chip.is-active {
  border-color: var(--accent); background: var(--accent-soft); color: var(--accent-strong);
}
.path-hint { margin-top: 0; }

.placeholder { color: var(--muted); border: 1px dashed var(--border); border-radius: 10px; padding: 24px; }
.result-kicker { color: var(--muted); font-size: .9rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
.result-number { margin: 6px 0; font-size: clamp(1.7rem, 4vw, 2.6rem); line-height: 1.08; }
.result-summary { color: var(--muted); }
.coverage-disclosure { margin: 20px 0; border-left: 4px solid var(--accent); padding: 9px 12px; background: var(--surface-subtle); color: var(--text); font-size: .92rem; }

/* Viral result moment: N/23 + hero gap first */
.result-moment {
  margin: 0 0 18px; padding: 18px; border-radius: 14px;
  border: 1px solid var(--border);
  background: linear-gradient(160deg, var(--surface) 0%, var(--accent-soft) 120%);
}
.result-moment.is-fresh {
  animation: result-pop .45s ease-out;
}
@keyframes result-pop {
  from { opacity: .4; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}
.result-fraction {
  display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap;
  font-weight: 800; letter-spacing: -.04em; line-height: 1;
}
.result-fraction .found { font-size: clamp(2.8rem, 8vw, 4rem); color: var(--accent-strong); font-variant-numeric: tabular-nums; }
.result-fraction .of { font-size: clamp(1.2rem, 3vw, 1.5rem); color: var(--muted); font-weight: 700; }
.result-fraction .total { font-size: clamp(1.6rem, 4vw, 2.2rem); color: var(--text); font-variant-numeric: tabular-nums; }
.result-fraction-label { margin: 8px 0 0; color: var(--muted); font-size: .95rem; font-weight: 600; }
.coverage-meter {
  margin: 16px 0 4px; height: 12px; border-radius: 999px;
  background: color-mix(in srgb, var(--border) 70%, transparent); overflow: hidden;
}
.coverage-meter > span {
  display: block; height: 100%; border-radius: 999px;
  background: linear-gradient(90deg, var(--accent), var(--accent-strong));
  min-width: 0; transition: width .5s ease;
}
.hero-gap-card {
  margin: 18px 0 0; padding: 14px 16px; border-radius: 12px;
  border: 1px solid color-mix(in srgb, var(--warning) 45%, var(--border));
  background: color-mix(in srgb, var(--warning) 12%, var(--surface));
}
.hero-gap-card .gap-eyebrow {
  display: inline-block; margin: 0 0 6px; font-size: .75rem; font-weight: 800;
  letter-spacing: .06em; text-transform: uppercase; color: var(--warning);
}
.hero-gap-card strong { display: block; font-size: 1.15rem; line-height: 1.25; }
.hero-gap-card p { margin: 6px 0 0; color: var(--muted); font-size: .92rem; }
.hero-gap-card.is-clear {
  border-color: color-mix(in srgb, var(--accent) 45%, var(--border));
  background: color-mix(in srgb, var(--accent) 12%, var(--surface));
}
.hero-gap-card.is-clear .gap-eyebrow { color: var(--accent-strong); }
.viral-share {
  display: flex; flex-wrap: wrap; gap: 10px; align-items: center;
  margin: 16px 0 8px; padding: 12px; border-radius: 12px;
  background: var(--surface-subtle); border: 1px solid var(--border);
}
.viral-share .share-lead { flex: 1 1 160px; margin: 0; color: var(--muted); font-size: .9rem; font-weight: 600; }
.share-more summary { cursor: pointer; color: var(--accent-strong); font-weight: 700; margin-top: 8px; }
.share-more .share-actions { margin-top: 10px; }

.gap-list, .suggestion-list { display: grid; gap: 10px; margin: 15px 0; }
.gap, .suggestion { border: 1px solid var(--border); border-radius: 10px; padding: 13px; }
.gap strong, .suggestion-title { display: block; }
.gap p { margin: 4px 0 0; color: var(--muted); font-size: .92rem; }
.technical { margin-top: 17px; border-top: 1px solid var(--border); padding-top: 15px; }
.technical summary { cursor: pointer; color: var(--accent-strong); font-weight: 700; }
.technical pre { max-height: 260px; overflow: auto; white-space: pre-wrap; font-family: var(--mono); font-size: .78rem; }
.config-note { border-left-color: var(--warning); }

.fix-review { grid-column: 1 / -1; }
.fix-review[hidden] { display: none; }
.suggestion { display: grid; grid-template-columns: auto 1fr; gap: 10px; }
.suggestion textarea { min-height: 94px; margin-top: 9px; font-size: .86rem; }
.suggestion small { color: var(--muted); }
.warning { margin: 12px 0; border: 1px solid color-mix(in srgb, var(--warning) 55%, var(--border)); border-radius: 9px; padding: 10px; color: var(--warning); }
.diff { max-height: 400px; overflow: auto; margin: 14px 0; padding: 14px; border-radius: 9px; background: #111814; color: #e9f3eb; font: .78rem/1.5 var(--mono); white-space: pre-wrap; }
.diff .addition { color: #a8edbf; }
.diff .header { color: #b8c7bd; }
.cost { color: var(--muted); font-size: .9rem; }

.info-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; padding: 0 0 38px; }
.info-grid section { border-top: 1px solid var(--border); padding-top: 18px; }
.info-grid h2 { font-size: 1.15rem; }
.faq { max-width: 780px; padding: 0 0 64px; }
.faq details { border-top: 1px solid var(--border); padding: 14px 0; }
.faq details:last-child { border-bottom: 1px solid var(--border); }
.faq summary { cursor: pointer; color: var(--text); font-weight: 750; }
.faq p { color: var(--muted); margin: 9px 0 0; }
.longform { max-width: 860px; }
.longform section { border-top: 1px solid var(--border); margin: 28px 0 0; padding-top: 20px; }
.longform li { margin: 8px 0; }
.longform code { font-family: var(--mono); font-size: .9em; }
.footer { border-top: 1px solid var(--border); padding: 25px 0 80px; color: var(--muted); font-size: .88rem; }
.footer p { margin-bottom: 8px; }

dialog { width: min(570px, calc(100% - 32px)); color: var(--text); background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 24px; }
dialog::backdrop { background: rgb(0 0 0 / 45%); }
.dialog-head { display: flex; justify-content: space-between; gap: 12px; align-items: start; }

.mobile-action { display: none; }
/* pointer-events: none because this is an announcement, not a control. It is
   fixed over the bottom-right corner for three seconds and holds nothing you
   can click, so without this it silently swallows clicks on the content it
   happens to cover. */
.toast { position: fixed; right: 18px; bottom: 18px; z-index: 20; pointer-events: none; max-width: min(420px, calc(100% - 36px)); border: 1px solid var(--border); border-radius: 9px; background: var(--surface); box-shadow: var(--shadow); padding: 11px 14px; color: var(--text); }
body[data-mode="simple"] .developer-only { display: none !important; }

@media (max-width: 840px) {
  .site-header { align-items: flex-start; flex-direction: column; }
  .site-nav { justify-content: flex-start; }
  .home-page .hero { grid-template-columns: minmax(0, 1fr); gap: 28px; padding-top: 34px; }
  .home-page .hero .hero-message { max-width: 700px; }
  .workspace-grid { grid-template-columns: minmax(0, 1fr); }
  .workspace-grid > *, .info-grid > * { min-width: 0; }
  .info-grid { grid-template-columns: minmax(0, 1fr); }
  .fix-review { grid-column: auto; }
}
@media (max-width: 620px) {
  .site-shell { width: min(100% - 24px, 1180px); }
  .home-page .site-header { flex-direction: row; align-items: center; gap: 8px; padding: 10px 0; }
  .home-page .site-nav { flex-wrap: nowrap; gap: 8px; margin-left: auto; }
  .home-page .site-nav a:nth-child(-n+6) { display: none; }
  .url-row { grid-template-columns: 1fr; }
  .profile-picker { grid-template-columns: 1fr; }
  .home-page .hero { gap: 14px; padding: 20px 0 28px; }
  .home-page .hero h1 { font-size: clamp(2.05rem, 9vw, 2.5rem); }
  .hero-copy { font-size: 1rem; }
  .trust-chips { margin-top: 12px; gap: 6px; }
  .chip { min-height: 28px; padding: 2px 9px; font-size: .78rem; }
  .home-page .hero .always-visible { margin-top: 10px; font-size: .8rem; line-height: 1.35; }
  .home-page .hero .hero-demo-screen { grid-template-columns: minmax(0, 1fr) minmax(132px, .72fr); min-height: 230px; }
  .home-page .hero .hero-demo-prompt { padding: 14px; }
  .home-page .hero .hero-demo-prompt pre { min-height: 130px; max-height: 130px; font-size: .62rem; line-height: 1.4; }
  .home-page .hero .hero-demo-result { padding: 14px 12px; }
  .home-page .hero .hero-demo-score { margin-bottom: 13px; }
  .home-page .hero .hero-demo-score strong:first-child { font-size: 2.4rem; }
  .home-page .hero .hero-demo-score strong:last-child { font-size: 1.35rem; }
  .home-page .hero .hero-demo-gap strong { font-size: .79rem; }
  .home-page .hero .hero-demo-controls span { flex: 1 0 100%; margin-left: 0; }
  .mobile-action { display: block; position: sticky; bottom: 0; z-index: 5; padding: 10px 12px max(10px, env(safe-area-inset-bottom)); background: color-mix(in srgb, var(--page) 90%, transparent); backdrop-filter: blur(10px); }
  .toast { bottom: 74px; }
  .mobile-action .button { width: 100%; }
}
@media (max-width: 340px) {
  .home-page .site-header { flex-direction: column; align-items: flex-start; gap: 6px; padding: 8px 0; }
  .home-page .site-nav { width: 100%; margin-left: 0; justify-content: flex-start; }
  .home-page .site-nav .nav-optional { display: none; }
  .home-page .brand { gap: 7px; }
  .home-page .brand-mark { width: 30px; height: 30px; flex-basis: 30px; }
  .home-page .mode-toggle { padding-inline: 10px; }
  .home-page .hero { gap: 10px; padding-top: 14px; }
  .home-page .hero h1 { margin: 8px 0 10px; font-size: 1.85rem; line-height: 1.02; }
  .home-page .hero .trust-chips { margin-top: 8px; }
  .home-page .hero .always-visible { margin-top: 8px; }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } * { transition: none !important; animation: none !important; } }
