/* Diagnosis — the whole stylesheet.
 *
 * Plain CSS, no framework, no build. The UI is four pages read once a week by
 * someone who is also running a shop; the money goes into legibility rather
 * than motion.
 *
 * Dark mode is SELECTED, not inverted: its own values against a dark surface,
 * validated with the chart palette rather than produced by flipping lightness.
 */

:root {
  color-scheme: light;
  --surface-0: #f6f5f2;
  --surface-1: #fcfcfb;
  --surface-2: #efeee9;
  --line: #dedcd4;
  --text-primary: #16161a;
  --text-secondary: #52514e;
  --text-muted: #77756e;
  --series-1: #2a78d6;
  --series-2: #eb6834;
  --down: #b3322f;
  --up: #1f6b45;
  --warn-bg: #fdf3e3;
  --warn-line: #e0b877;
  --radius: 10px;
  --shadow: 0 1px 2px rgb(20 20 20 / 6%), 0 4px 12px rgb(20 20 20 / 4%);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --surface-0: #121211;
    --surface-1: #1a1a19;
    --surface-2: #232321;
    --line: #35342f;
    --text-primary: #ffffff;
    --text-secondary: #c3c2b7;
    --text-muted: #96948a;
    --series-1: #3987e5;
    --series-2: #d95926;
    --down: #e66767;
    --up: #4fb286;
    --warn-bg: #2a2418;
    --warn-line: #6b5a33;
    --shadow: none;
  }
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --surface-0: #121211;
  --surface-1: #1a1a19;
  --surface-2: #232321;
  --line: #35342f;
  --text-primary: #ffffff;
  --text-secondary: #c3c2b7;
  --text-muted: #96948a;
  --series-1: #3987e5;
  --series-2: #d95926;
  --down: #e66767;
  --up: #4fb286;
  --warn-bg: #2a2418;
  --warn-line: #6b5a33;
  --shadow: none;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--surface-0);
  color: var(--text-primary);
  font: 16px/1.55 ui-sans-serif, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}

/* ONE width for the frame — top bar, store tabs, page and footer — on
   every page. It used to be 46rem on some pages and 64rem on others, so the
   navigation jumped sideways between pages. Reading width is kept inside
   the page instead (.prose, forms, --measure). */
:root { --frame: 64rem; }
main { max-width: var(--frame); margin: 0 auto; padding: 0 16px 64px; }

.top {
  display: flex; align-items: center; gap: 16px;
  max-width: var(--frame); margin: 0 auto; padding: 20px 16px;
}
.wordmark {
  font-weight: 650; letter-spacing: -0.01em; text-decoration: none;
  color: var(--text-primary);
}
.theme {
  margin-left: auto; background: none; border: 1px solid var(--line);
  color: var(--text-secondary); border-radius: 999px; width: 32px; height: 32px;
  cursor: pointer; font-size: 14px;
}

h1 { font-size: 1.7rem; line-height: 1.2; letter-spacing: -0.02em; margin: 8px 0 4px; }
h2 { font-size: 0.95rem; text-transform: uppercase; letter-spacing: 0.06em;
     color: var(--text-secondary); margin: 0 0 12px; font-weight: 600; }
p { margin: 0 0 12px; }
a { color: var(--series-1); }

.domain, .muted { color: var(--text-muted); }
.muted { font-size: 0.9rem; }
.lead { font-size: 1.05rem; color: var(--text-secondary); }
.crumbs { font-size: 0.9rem; color: var(--text-muted); margin-bottom: 8px; }

.panel {
  background: var(--surface-1); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 20px; margin: 16px 0;
  box-shadow: var(--shadow);
}
.panel.quiet { background: var(--surface-2); box-shadow: none; }
.panel.warn { background: var(--warn-bg); border-color: var(--warn-line); }
.panel.setup.blocked { border-color: var(--down); }

/* The hero number. One figure, large, with the two it came from beneath it. */
.hero { text-align: center; padding: 28px 20px; }
.hero-number {
  font-size: 2.6rem; font-weight: 640; letter-spacing: -0.03em;
  margin: 0; font-variant-numeric: tabular-nums;
}
.hero-sub { color: var(--text-muted); margin: 4px 0 0;
            font-variant-numeric: tabular-nums; }
.down { color: var(--down); }
.up { color: var(--up); }
/* No movement is not good news wearing green. A store that took nothing in
   both windows had a change of exactly zero, which used to render in the
   "up" colour because the test was `>= 0`. */
.flat { color: var(--ink-2, inherit); }

.prose p { max-width: 38rem; }

ol.history, ul.history { list-style: none; padding: 0; margin: 0; }
ol.history li, ul.history li {
  display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap;
  padding: 12px 0; border-bottom: 1px solid var(--line);
}
ol.history li:last-child, ul.history li:last-child { border-bottom: 0; }
ol.history a { display: flex; gap: 12px; align-items: baseline; flex: 1;
               text-decoration: none; color: inherit; flex-wrap: wrap; }
.dates { font-variant-numeric: tabular-nums; color: var(--text-muted);
         font-size: 0.9rem; min-width: 11rem; }
.delta { font-weight: 600; font-variant-numeric: tabular-nums; min-width: 6rem; }
.headline { color: var(--text-secondary); flex: 1 1 18rem; font-size: 0.95rem; }

.tag {
  font-size: 0.75rem; padding: 2px 8px; border-radius: 999px;
  border: 1px solid var(--line); color: var(--text-muted);
}
.tag.latest { color: var(--series-1); border-color: currentColor; }

/* ---- the Reports list: each report is one clickable card ------------- */

.report-list-hint { margin: -4px 0 14px; font-size: 0.9rem; max-width: none; }
ol.report-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
ol.report-list > li { max-width: none; }
.report-card {
  display: flex; align-items: center; gap: 16px 24px; flex-wrap: wrap;
  padding: 16px 18px; border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--surface-1); color: inherit; text-decoration: none;
  transition: border-color .15s, box-shadow .15s, transform .15s, background .15s;
}
.report-card:hover, .report-card:focus-visible {
  border-color: var(--series-1); background: var(--surface-0);
  box-shadow: 0 4px 14px rgba(0, 0, 0, .08); transform: translateY(-1px);
}
.report-card:focus-visible { outline: 2px solid var(--series-1); outline-offset: 2px; }
.report-when { display: flex; flex-direction: column; gap: 6px; flex: 1 1 14rem; }
.report-dates { font-weight: 600; color: var(--text-primary); font-variant-numeric: tabular-nums; }
.report-tags { display: flex; gap: 6px; flex-wrap: wrap; }
.report-tags:empty { display: none; }
.report-change { display: flex; flex-direction: column; gap: 2px; flex: 1 1 12rem; }
.report-delta { font-weight: 700; font-size: 1.1rem; font-variant-numeric: tabular-nums; }
.report-delta small { font-weight: 600; font-size: 0.85rem; }
.report-sales { color: var(--text-muted); font-size: 0.9rem; font-variant-numeric: tabular-nums; }
.report-open { padding: 8px 14px; white-space: nowrap; }
.report-open .arrow { display: inline-block; transition: transform .15s; }
.report-card:hover .report-open {
  background: var(--series-1); border-color: var(--series-1); color: #fff;
}
.report-card:hover .report-open .arrow { transform: translateX(3px); }
@media (max-width: 560px) { .report-open { width: 100%; } }
@media (prefers-reduced-motion: reduce) {
  .report-card, .report-open .arrow { transition: none; }
  .report-card:hover { transform: none; }
}
.tag.done { color: var(--up); border-color: currentColor; }
.tag.wrong { color: var(--down); border-color: currentColor; }
.tag.urgent { color: var(--series-2); border-color: currentColor; }

/* Confidence tiers are never colour alone — the word is always present. */
.tier {
  font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.05em;
  padding: 2px 8px; border-radius: 999px; border: 1px solid currentColor;
  font-weight: 600;
}
.tier.confirmed { color: var(--up); }
.tier.likely { color: var(--series-1); }
.tier.possible { color: var(--text-muted); }
.tier.unexplained { color: var(--text-muted); font-style: italic; }

ol.actions { list-style: none; counter-reset: a; padding: 0; margin: 0; }
ol.actions li {
  counter-increment: a; padding: 14px 0 14px 34px; position: relative;
  border-bottom: 1px solid var(--line);
}
ol.actions li:last-child { border-bottom: 0; padding-bottom: 0; }
ol.actions li::before {
  content: counter(a); position: absolute; left: 0; top: 14px;
  width: 22px; height: 22px; border-radius: 999px; background: var(--surface-2);
  color: var(--text-secondary); font-size: 0.78rem; font-weight: 600;
  display: grid; place-items: center;
}
.action-what { font-size: 1.05rem; margin: 0 0 6px; }
.action-meta { display: flex; gap: 10px; align-items: center; flex-wrap: wrap;
               color: var(--text-muted); font-size: 0.85rem; margin: 0; }
.action-worth { color: var(--text-secondary); font-size: 0.9rem; margin: 6px 0 0; }

/* A table inside a card must not push past it on a phone. Scroll the table,
   never the page. */
.table-wrap { overflow-x: auto; margin: 0 -4px; }
table { width: 100%; border-collapse: collapse; font-size: 0.95rem; }
th { text-align: left; font-weight: 600; color: var(--text-secondary); }
td, th { padding: 8px 6px; border-bottom: 1px solid var(--line); }
tbody tr:last-child td, tbody tr:last-child th { border-bottom: 0; }
.num { text-align: right; font-variant-numeric: tabular-nums;
       white-space: nowrap; }
table.compare tr.total th, table.compare tr.total td { font-weight: 650; }

ul.split { list-style: none; padding: 0; margin: 0; display: grid;
           grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr)); gap: 10px; }
ul.split li { background: var(--surface-2); border-radius: 8px; padding: 10px 12px; }
ul.split span { display: block; color: var(--text-muted); font-size: 0.82rem; }
ul.split strong { font-size: 1.15rem; font-variant-numeric: tabular-nums; }

ul.causes, ul.ruled-out, ul.blockers, ul.caveats, ul.given {
  list-style: none; padding: 0; margin: 0;
}
ul.causes li { padding: 10px 0; border-bottom: 1px solid var(--line);
               display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; }
ul.causes li:last-child { border-bottom: 0; }
.evidence-note { color: var(--text-muted); font-size: 0.88rem; }
ul.ruled-out li, ul.blockers li, ul.caveats li, ul.given li {
  padding: 6px 0; color: var(--text-secondary); font-size: 0.93rem;
}
ul.blockers li { color: var(--down); }

/* Charts. Single series each, so no legend — the caption names the metric. */
.chart { margin: 0 0 18px; position: relative; }
.chart figcaption {
  font-size: 0.85rem; color: var(--text-secondary); margin-bottom: 4px;
}
.chart svg { width: 100%; height: auto; display: block; overflow: visible; }
.chart .line { fill: none; stroke: var(--series-1); stroke-width: 2;
               stroke-linejoin: round; stroke-linecap: round; }
.chart .area { fill: var(--series-1); opacity: 0.09; stroke: none; }
.chart .end { fill: var(--series-1); stroke: var(--surface-1); stroke-width: 2; }
.chart .window { fill: var(--text-primary); opacity: 0.05; }
.chart .changepoint { stroke: var(--series-2); stroke-width: 2;
                      stroke-dasharray: 3 3; }
.chart .changepoint-dot { fill: var(--series-2); stroke: var(--surface-1);
                          stroke-width: 2; }
.chart .hit { fill: transparent; }
/* Hidden by default via CSS rather than the `hidden` attribute: SVG children
   do not honour it, which left a stray dot pinned at the origin. */
.chart .cursor, .chart .tooltip { display: none; }
.chart .cursor.on, .chart .tooltip.on { display: block; }
.chart .cursor-line { stroke: var(--text-muted); stroke-width: 1; opacity: 0.5; }
.chart .cursor-dot { fill: var(--series-1); stroke: var(--surface-1);
                     stroke-width: 2; }
.chart .ceiling { stroke: var(--line); stroke-width: 1; stroke-dasharray: 2 4; }
.chart .value-label {
  fill: var(--text-muted); font-size: 11px; font-variant-numeric: tabular-nums;
  paint-order: stroke; stroke: var(--surface-1); stroke-width: 3px;
}
.chart .axis {
  display: flex; justify-content: space-between; margin: 2px 0 0;
  font-size: 0.75rem; color: var(--text-muted);
}
.chart .tooltip {
  position: absolute; pointer-events: none; background: var(--text-primary);
  color: var(--surface-1); font-size: 0.8rem; padding: 4px 8px;
  border-radius: 6px; transform: translate(-50%, -140%); white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
/* The screen-reader fallback table behind every chart.
 *
 * `display: block` is load-bearing and was missing. A `display: table`
 * element treats `height` as a MINIMUM, so height:1px did nothing and a
 * ninety-row series added two and a half thousand pixels of blank page below
 * the footer. It was invisible in the sense that nothing was drawn there,
 * and completely visible in the sense that every page with a chart scrolled
 * into an empty void. Found by measuring the document, not by looking. */
/* The chart's numbers, behind a closed "Day by day": readable when opened,
   and never drawn as a wall of dates under the chart. */
.chart-data { margin-top: 8px; font-size: var(--t-sm); }
.chart-data summary { color: var(--text-muted); cursor: pointer; }
.sr-table { margin-top: 6px; border-collapse: collapse; }
.sr-table th, .sr-table td { padding: 2px 10px 2px 0; text-align: left; font-weight: 400;
  color: var(--text-secondary); font-variant-numeric: tabular-nums; }
.sr-table caption { text-align: left; color: var(--text-muted); padding-bottom: 4px; }

.bars { margin-top: 16px; }
.bars-label { font-size: 0.85rem; color: var(--text-secondary); margin-bottom: 8px; }
.bar-row { display: grid; grid-template-columns: 4rem 1fr 7rem;
           align-items: center; gap: 10px; margin-bottom: 6px; }
.bar-name { color: var(--text-muted); font-size: 0.85rem; }
.bar-track { background: var(--surface-2); border-radius: 4px; height: 20px; }
.bar { display: block; height: 100%; border-radius: 4px; }
.bar.prior { background: var(--text-muted); opacity: 0.5; }
.bar.current { background: var(--series-1); }
.bar-value { text-align: right; font-variant-numeric: tabular-nums;
             font-size: 0.9rem; }

.feedback .verdicts { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.feedback button {
  background: var(--surface-2); border: 1px solid var(--line);
  color: var(--text-primary); border-radius: 8px; padding: 8px 14px;
  font-size: 0.92rem; cursor: pointer;
}
.feedback button:hover { border-color: var(--series-1); }
.feedback button.danger:hover { border-color: var(--down); color: var(--down); }
.feedback label { display: block; color: var(--text-muted); font-size: 0.88rem; }
.feedback input {
  display: block; width: 100%; margin-top: 6px; padding: 8px 10px;
  border: 1px solid var(--line); border-radius: 8px;
  background: var(--surface-0); color: var(--text-primary); font: inherit;
}

.foot { max-width: var(--frame); margin: 0 auto; padding: 0 16px 48px;
        color: var(--text-muted); font-size: 0.85rem; }

@media (max-width: 480px) {
  .hero-number { font-size: 2rem; }
  /* The driver and the last verdict are secondary; the evidence page carries
     both. Dropping them keeps the table readable rather than scrollable. */
  .col-driver, .col-verdict { display: none; }
  .panel { padding: 16px 14px; }
  .dates { min-width: 0; }
  .bar-row { grid-template-columns: 3.5rem 1fr 5.5rem; }
}

/* ---- the portal ------------------------------------------------------- */

.hero-copy { padding: 24px 0 8px; }
.hero-copy h1 { font-size: 2.1rem; max-width: 18ch; }
.hero-copy .lead { max-width: 46ch; font-size: 1.1rem; }

.url-form { margin: 24px 0 8px; max-width: 34rem; }
.url-form label { display: block; font-size: 0.85rem; color: var(--text-secondary);
                  margin-bottom: 6px; }
.url-row { display: flex; gap: 8px; flex-wrap: wrap; }
.url-row input {
  flex: 1 1 16rem; padding: 12px 14px; font: inherit; border-radius: 10px;
  border: 1px solid var(--line); background: var(--surface-1);
  color: var(--text-primary);
}
.url-row button, .continue button, form.stack button, .upload-row button,
button.primary, a.button {
  padding: 12px 18px; font: inherit; font-weight: 600; cursor: pointer;
  border-radius: 10px; border: 1px solid transparent;
  background: var(--series-1); color: #fff;
}
/* The connect links are anchors rather than buttons — a GET that starts a
   redirect, not a form post — so they need the inline-block and the reset of
   the link underline that a <button> gets for free. */
a.button {
  display: inline-block; text-decoration: none;
}
/* The connect link sits on its own line. Trailing it with explanatory text
   looked fine at desk width and wrapped around the button at phone width,
   which is where most merchants will first see this page. */
.connect-row { margin: 14px 0 6px; }
.url-row button:hover, button.primary:hover, a.button:hover {
  filter: brightness(1.08);
}
.url-form .muted { margin-top: 10px; max-width: 52ch; }

.field-error { color: var(--down); font-size: 0.9rem; }
.signin-line { color: var(--text-muted); font-size: 0.92rem; }

ul.facts { list-style: none; padding: 0; margin: 0 0 12px; display: grid;
           grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr)); gap: 10px; }
ul.facts li { background: var(--surface-2); border-radius: 8px; padding: 10px 12px; }
ul.facts span { display: block; color: var(--text-muted); font-size: 0.8rem; }

ol.needs { list-style: none; counter-reset: n; padding: 0; margin: 0; }
ol.needs li { counter-increment: n; position: relative; padding: 14px 0 14px 34px;
              border-bottom: 1px solid var(--line); }
ol.needs li:last-child { border-bottom: 0; }
ol.needs li::before {
  content: counter(n); position: absolute; left: 0; top: 15px;
  width: 22px; height: 22px; border-radius: 999px; background: var(--surface-2);
  color: var(--text-secondary); font-size: 0.78rem; font-weight: 600;
  display: grid; place-items: center;
}
ol.needs li.blocking::before { background: var(--down); color: #fff; }
.need-title { font-weight: 600; margin: 0 0 2px; display: flex; gap: 8px;
              align-items: center; }
.need-why { margin: 0 0 4px; color: var(--text-secondary); }
.need-how { margin: 0; }

form.stack { display: grid; gap: 14px; max-width: 26rem; }
form.stack label { display: grid; gap: 6px; font-size: 0.9rem;
                   color: var(--text-secondary); }
form.stack input {
  padding: 11px 13px; font: inherit; border-radius: 9px;
  border: 1px solid var(--line); background: var(--surface-0);
  color: var(--text-primary);
}
.continue { margin: 20px 0 8px; }

.upload-row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap;
              margin-top: 12px; }
.upload-row input[type=file] { font-size: 0.9rem; color: var(--text-secondary); }
.done { color: var(--up); font-weight: 600; }
.done-note { border-color: var(--up); }

/* =======================================================================
 * THE SAAS LAYER: shell, marketing pages, pricing and the upgrade gate.
 *
 * Added when the product stopped being four screens read once a week and
 * became something a stranger arrives at, evaluates, and decides whether to
 * pay for. Those are different jobs. The screens above are for a merchant
 * who already trusts us and wants the numbers; the ones below are for
 * someone who does not yet, and has four seconds.
 *
 * The scales are here rather than in the block at the top because the
 * existing screens were built by eye and are correct; retrofitting them onto
 * a scale would be churn with a screenshot diff and no reader benefit. New
 * work uses the scale. Old work stays as it is until it is touched anyway.
 * ===================================================================== */

:root {
  /* A 1.25 ratio from 16px, rounded to something a browser can hint. */
  --t-xs: 0.78rem;
  --t-sm: 0.9rem;
  --t-md: 1rem;
  --t-lg: 1.15rem;
  --t-xl: 1.45rem;
  --t-2xl: 1.9rem;
  --t-3xl: 2.6rem;
  --t-4xl: 3.2rem;

  /* Multiples of 4. Every gap below is one of these, never a stray 13px. */
  --s-1: 4px;
  --s-2: 8px;
  --s-3: 12px;
  --s-4: 16px;
  --s-5: 24px;
  --s-6: 32px;
  --s-7: 48px;
  --s-8: 72px;

  --radius-sm: 8px;
  --radius-lg: 16px;
  --measure: 62ch;      /* the longest a line of body copy may get */
}

/* ---- containers ------------------------------------------------------ */

/* Marketing pages breathe wider than the reading pages. A pricing table at
   46rem forces three cards into a column on a laptop, which reads as "there
   is only one plan" until you scroll. */
main.wide, .top.wide, .foot.wide { max-width: var(--frame); }

.section { padding: var(--s-7) 0; border-top: 1px solid var(--line); }
.section:first-of-type { border-top: 0; }
.section > h2 { margin-bottom: var(--s-4); }
.section-lead { font-size: var(--t-lg); color: var(--text-secondary);
                max-width: var(--measure); margin: 0 0 var(--s-5); }

/* ---- navigation ------------------------------------------------------ */

.nav { display: flex; gap: var(--s-5); align-items: center;
       font-size: var(--t-sm); }
.nav a { color: var(--text-secondary); text-decoration: none; }
.nav a:hover { color: var(--text-primary); }
.nav a.current { color: var(--text-primary); font-weight: 600; }
.nav-right { margin-left: auto; display: flex; gap: var(--s-3);
             align-items: center; }
/* The theme toggle used to claim margin-left:auto. With a nav present that
   pushed the links apart instead of the toggle right. */
.top:has(.nav-right) .theme { margin-left: 0; }

.nav-form { display: inline; }
.nav-form button {
  background: none; border: 0; padding: 0; font: inherit;
  font-size: var(--t-sm); color: var(--text-secondary); cursor: pointer;
}
.nav-form button:hover { color: var(--text-primary); }

/* ---- buttons --------------------------------------------------------- */

.btn {
  display: inline-block; padding: 11px 18px; border-radius: var(--radius);
  font: inherit; font-weight: 600; cursor: pointer; text-decoration: none;
  border: 1px solid transparent; text-align: center; line-height: 1.3;
}
.btn-primary { background: var(--series-1); color: #fff; }
.btn-primary:hover { filter: brightness(1.08); }
.btn-secondary {
  background: var(--surface-1); border-color: var(--line);
  color: var(--text-primary);
}
.btn-secondary:hover { border-color: var(--text-muted); }
.btn-ghost { background: none; color: var(--series-1); padding-left: 0;
             padding-right: 0; }
.btn-lg { padding: 14px 24px; font-size: var(--t-lg); }
.btn-block { display: block; width: 100%; }
.btn[aria-disabled="true"] { opacity: 0.5; pointer-events: none; }
.btn-row { display: flex; gap: var(--s-3); flex-wrap: wrap;
           align-items: center; margin: var(--s-4) 0 0; }

/* ---- badges ---------------------------------------------------------- */

.badge {
  display: inline-block; font-size: var(--t-xs); font-weight: 600;
  padding: 2px 9px; border-radius: 999px; border: 1px solid var(--line);
  color: var(--text-muted); letter-spacing: 0.01em;
}
.badge-plan { border-color: var(--series-1); color: var(--series-1); }
.badge-free { border-color: var(--line); color: var(--text-muted); }
.badge-warn { border-color: var(--warn-line); color: var(--series-2); }

/* ---- the marketing hero ---------------------------------------------- */

.hero-wide { padding: var(--s-7) 0 var(--s-6); }
.hero-wide h1 {
  font-size: var(--t-4xl); line-height: 1.08; letter-spacing: -0.03em;
  max-width: 17ch; margin: 0 0 var(--s-4);
}
.hero-wide .lead { font-size: var(--t-lg); max-width: 54ch;
                   margin-bottom: var(--s-5); }
.hero-note { color: var(--text-muted); font-size: var(--t-sm);
             margin-top: var(--s-3); max-width: 48ch; }

/* The claim that does the selling, set as a quote rather than a bullet,
   because it is a specific true story and bullets flatten those. */
.proof {
  border-left: 3px solid var(--series-2); padding: var(--s-2) 0 var(--s-2) var(--s-4);
  margin: var(--s-6) 0; max-width: var(--measure);
}
.proof p { font-size: var(--t-lg); color: var(--text-primary); margin: 0 0 var(--s-2); }
.proof cite { font-style: normal; color: var(--text-muted); font-size: var(--t-sm); }

/* ---- feature and step grids ------------------------------------------ */

.grid-3, .grid-2 { display: grid; gap: var(--s-5) var(--s-6); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr)); }
/* Exactly two columns, not auto-fit. At 1240px auto-fit produced three, which
   left the fourth item alone on a row beside two empty cells — a layout that
   reads as "something failed to load". */
.grid-2 { grid-template-columns: 1fr; }
@media (min-width: 720px) { .grid-2 { grid-template-columns: 1fr 1fr; } }

.feature h3, .step h3 {
  font-size: var(--t-md); margin: 0 0 var(--s-2); letter-spacing: -0.01em;
}
.feature p, .step p { color: var(--text-secondary); margin: 0;
                      font-size: var(--t-sm); }

.step { position: relative; padding-top: var(--s-5); }
.step-n {
  position: absolute; top: 0; left: 0; width: 26px; height: 26px;
  border-radius: 999px; background: var(--surface-2); color: var(--text-secondary);
  display: grid; place-items: center; font-size: var(--t-xs); font-weight: 700;
}

/* ---- pricing --------------------------------------------------------- */

.pricing { display: grid; gap: var(--s-4);
           grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr));
           /* Stretch, not start: the cards carry different numbers of lines
              and ragged bottoms make the cheapest plan look unfinished. With
              `margin-top:auto` on the button they also line up. */
           align-items: stretch; }

.plan {
  background: var(--surface-1); border: 1px solid var(--line);
  border-radius: var(--radius-lg); padding: var(--s-5);
  display: flex; flex-direction: column; gap: var(--s-3);
}
/* One plan is marked, and it is Growth rather than the dearest one. Marking
   the most expensive tier is a tell that the page is written for the seller. */
.plan.featured { border-color: var(--series-1); box-shadow: var(--shadow); }
.plan-top { display: flex; align-items: baseline; gap: var(--s-2); }
.plan-name {
  /* An h2, so it inherits the small-caps section-heading style from above.
     Left alone, the Free card read "FREE" and then "Free" underneath it. */
  font-size: var(--t-lg); font-weight: 650; margin: 0;
  text-transform: none; letter-spacing: -0.01em; color: var(--text-primary);
}
.price { font-size: var(--t-3xl); font-weight: 650; letter-spacing: -0.03em;
         font-variant-numeric: tabular-nums; margin: 0; line-height: 1; }
.price small { font-size: var(--t-sm); font-weight: 500;
               color: var(--text-muted); letter-spacing: 0; }
.plan-headline { color: var(--text-secondary); margin: 0; font-size: var(--t-sm);
                 min-height: 2.8em; }
.includes { list-style: none; padding: 0; margin: var(--s-2) 0 0;
            display: grid; gap: var(--s-2); }
.includes li { position: relative; padding-left: 22px; font-size: var(--t-sm);
               color: var(--text-secondary); }
.includes li::before {
  content: "✓"; position: absolute; left: 0; top: 0; color: var(--up);
  font-weight: 700;
}
.plan .btn { margin-top: auto; }
.plan-current { text-align: center; font-size: var(--t-sm);
                color: var(--text-muted); padding: 11px 0; margin-top: auto; }

/* ---- the upgrade gate ------------------------------------------------ */

/* Shown when an allowance runs out. It says what they already have before it
   says what they cannot do, because the first thing a person feels on hitting
   a paywall is that something was taken away. */
.gate { text-align: center; padding: var(--s-6) var(--s-4) var(--s-5); }
.gate h1 { font-size: var(--t-2xl); }
.gate .lead { max-width: 48ch; margin-left: auto; margin-right: auto; }

.kept {
  background: var(--surface-2); border-radius: var(--radius);
  padding: var(--s-4); margin: var(--s-5) 0; text-align: left;
}
.kept h2 { margin-bottom: var(--s-2); }

/* ---- account and billing --------------------------------------------- */

.meta-row {
  display: flex; justify-content: space-between; gap: var(--s-4);
  padding: var(--s-3) 0; border-bottom: 1px solid var(--line);
  flex-wrap: wrap;
}
.meta-row:last-child { border-bottom: 0; }
.meta-row dt { color: var(--text-muted); font-size: var(--t-sm); margin: 0; }
.meta-row dd { margin: 0; font-weight: 600; }

/* ---- store cards on the app home ------------------------------------- */

.store-card {
  display: flex; align-items: center; gap: var(--s-4);
  padding: var(--s-4); border: 1px solid var(--line);
  border-radius: var(--radius); background: var(--surface-1);
  text-decoration: none; color: inherit; margin-bottom: var(--s-3);
}
.store-card:hover { border-color: var(--series-1); }
.store-card .name { font-weight: 600; }
.store-card .sub { color: var(--text-muted); font-size: var(--t-sm); }
.store-card .go { margin-left: auto; color: var(--text-muted); }

/* ---- empty states ---------------------------------------------------- */

.empty { text-align: center; padding: var(--s-7) var(--s-4);
         color: var(--text-secondary); }
.empty h2 { text-transform: none; letter-spacing: 0; font-size: var(--t-lg);
            color: var(--text-primary); }

@media (max-width: 640px) {
  .hero-wide h1 { font-size: var(--t-2xl); max-width: none; }
  .hero-wide { padding-top: var(--s-5); }
  .section { padding: var(--s-6) 0; }
  .nav { gap: var(--s-4); }
  /* Nav links wrap under the wordmark rather than shrinking the tap target. */
  .top { flex-wrap: wrap; row-gap: var(--s-3); }
}

/* =======================================================================
 * THE DASHBOARD: site health, drivers and connections.
 * ===================================================================== */

/* ---- site health ------------------------------------------------------ */

ul.issues { list-style: none; padding: 0; margin: 0 0 var(--s-4); }
.issue {
  padding: var(--s-4) 0; border-bottom: 1px solid var(--line);
  border-left: 3px solid transparent; padding-left: var(--s-4);
}
.issue:last-child { border-bottom: 0; }
.issue-block { border-left-color: var(--down); }
.issue-warn { border-left-color: var(--series-2); }
.issue-note { border-left-color: var(--line); }

.issue-title { margin: 0 0 4px; font-weight: 600; display: flex; gap: var(--s-2);
               align-items: center; flex-wrap: wrap; }
.issue-blocks { margin: 0 0 4px; color: var(--text-secondary);
                max-width: var(--measure); }
.issue-fix { margin: 0; color: var(--text-muted); font-size: var(--t-sm);
             max-width: var(--measure); }

/* ---- the driver bars -------------------------------------------------- */

/* Diverging, because the three contributions routinely point in opposite
   directions — that is the Simpson's-paradox case the product exists to
   catch. A single-colour bar chart would hide the sign, which is the one
   thing a merchant must see here. Direction is carried by the label's sign
   as well as the colour, never by colour alone. */
.drivers { margin: var(--s-5) 0 0; }
.drivers .bar-row { grid-template-columns: 12rem 1fr 8rem; }
.drivers .bar.up { background: var(--up); }
.drivers .bar.down { background: var(--down); }
.drivers .bar-value.up { color: var(--up); }
.drivers .bar-value.down { color: var(--down); }

.sub-h { font-size: var(--t-md); margin: var(--s-5) 0 var(--s-2); }

/* ---- connections ------------------------------------------------------ */

ul.sources { list-style: none; padding: 0; margin: 0; }
.source {
  display: grid; gap: 2px var(--s-4); padding: var(--s-3) 0;
  border-bottom: 1px solid var(--line);
  grid-template-columns: 12rem 1fr auto;
  grid-template-areas: "name state action" "unlocks unlocks unlocks";
  align-items: baseline;
}
.source:last-child { border-bottom: 0; }
.source-name { grid-area: name; font-weight: 600; }
.source-state { grid-area: state; font-size: var(--t-sm);
                color: var(--text-secondary); }
.source-action { grid-area: action; font-size: var(--t-sm); }
.source-unlocks { grid-area: unlocks; color: var(--text-muted);
                  font-size: var(--t-sm); }
.source-broken .source-state { color: var(--down); font-weight: 600; }
.source-connected .source-state { color: var(--up); }
.source-locked .source-name, .source-absent .source-name { color: var(--text-muted); }

@media (max-width: 640px) {
  .source {
    grid-template-columns: 1fr auto;
    grid-template-areas: "name action" "state state" "unlocks unlocks";
  }
  .drivers .bar-row { grid-template-columns: 1fr; gap: 2px; }
  .drivers .bar-value { text-align: left; }
}

/* ---- Insights ---------------------------------------------------------- */
.period-bar { display: flex; flex-wrap: wrap; gap: 8px 24px; align-items: baseline;
              justify-content: space-between; margin: 8px 0 20px; }
.period-text { margin: 0; }
.period-choices { margin: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.period-choices .tag { text-decoration: none; }
.tag-on { background: var(--text-primary); color: var(--surface-1);
          border-color: var(--text-primary); }

.tiles { display: grid; gap: 12px;
         grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr)); margin-bottom: 28px; }
.tile { background: var(--surface-1); border: 1px solid var(--line);
        border-radius: var(--radius); padding: 14px 16px; }
.tile p { margin: 0; }
.tile-label { color: var(--text-muted); font-size: 0.85rem; }
.tile-value { font-size: 1.6rem; font-weight: 650; font-variant-numeric: tabular-nums;
              margin: 4px 0 2px !important; }
.tile-change { font-size: 0.85rem; }
.tile .delta { min-width: 0; }
.mini-trend { display: block; width: 100%; height: 32px; margin-top: 8px; }
.mini-trend polyline { fill: none; stroke: var(--series-1); stroke-width: 1.6;
                       vector-effect: non-scaling-stroke; }

.chart .bar-day { fill: var(--series-1); opacity: 0.85; }
.chart .bar-day.prior { opacity: 0.35; }
.chart .line.avg { stroke: var(--series-2); stroke-width: 2; }

table.insights th[scope="row"] { font-weight: 500; text-transform: capitalize; }
table.insights .delta { min-width: 0; }

/* ---- the frame: skip link, menus, store tabs, page header, flash, footer --- */
.skip-link { position: absolute; left: -999px; top: 8px; z-index: 50;
             background: var(--surface-1); color: var(--text-primary);
             padding: 8px 12px; border-radius: var(--radius); border: 1px solid var(--line); }
.skip-link:focus { left: 16px; }
main:focus { outline: none; }
:focus-visible { outline: 2px solid var(--series-1); outline-offset: 2px; }

/* A <details> menu: opens without JavaScript, closes on a second click. */
.menu { position: relative; }
.menu > summary { list-style: none; cursor: pointer; font-size: var(--t-sm);
                  color: var(--text-primary); font-weight: 600; padding: 4px 8px;
                  border: 1px solid var(--line); border-radius: 999px;
                  max-width: 16rem; overflow: hidden; text-overflow: ellipsis;
                  white-space: nowrap; }
.menu > summary::-webkit-details-marker { display: none; }
.menu > summary::after { content: " ▾"; color: var(--text-muted); font-weight: 400; }
.menu[open] > summary { background: var(--surface-2); }
.menu-list { position: absolute; z-index: 40; top: calc(100% + 6px); left: 0;
             min-width: 14rem; list-style: none; margin: 0; padding: 6px;
             background: var(--surface-1); border: 1px solid var(--line);
             border-radius: var(--radius); box-shadow: var(--shadow); }
.menu-right .menu-list { left: auto; right: 0; }
.menu-list li a, .menu-list li button {
  display: block; width: 100%; text-align: left; padding: 7px 10px;
  border-radius: 6px; color: var(--text-primary); text-decoration: none;
  font-size: var(--t-sm); background: none; border: 0; font: inherit; cursor: pointer; }
.menu-list li a:hover, .menu-list li button:hover { background: var(--surface-2); }
.menu-list a[aria-current] { font-weight: 650; }
.menu-list a[aria-current]::before { content: "✓ "; color: var(--up); }
.menu-sep { border-top: 1px solid var(--line); margin-top: 6px; padding-top: 6px; }
.menu-right > summary { font-weight: 500; color: var(--text-secondary); }

.subnav { max-width: var(--frame); margin: 0 auto; padding: 0 16px; }
.store-tabs { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none;
              border-bottom: 1px solid var(--line); margin-bottom: 20px; }
.store-tabs::-webkit-scrollbar { display: none; }
.store-tabs a { flex: none; padding: 10px 12px; color: var(--text-secondary);
                text-decoration: none; font-size: var(--t-sm);
                border-bottom: 2px solid transparent; margin-bottom: -1px; }
.store-tabs a:hover { color: var(--text-primary); }
.store-tabs a.current { color: var(--text-primary); font-weight: 600;
                        border-bottom-color: var(--series-1); }

.page-header { display: flex; flex-wrap: wrap; gap: 12px 24px; align-items: flex-end;
               justify-content: space-between; margin: 4px 0 20px; }
.page-header h1 { margin: 0; }
.page-sub { margin: 4px 0 0; color: var(--text-muted); }
.page-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.page-actions form { display: inline; margin: 0; }

.crumbs ol { list-style: none; display: flex; flex-wrap: wrap; gap: 4px; padding: 0; margin: 0; }
.crumbs li + li::before { content: "›"; margin-right: 4px; color: var(--text-muted); }
.crumbs a { color: var(--text-muted); }

.flash { background: var(--surface-1); border: 1px solid var(--up);
         border-left-width: 4px; border-radius: var(--radius);
         padding: 12px 16px; margin: 0 0 20px; }

.foot { border-top: 1px solid var(--line); padding-top: 24px; }
.foot-note { margin-bottom: 20px; }
.foot-cols { display: grid; gap: 20px;
             grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr)); margin-bottom: 20px; }
.foot-cols nav { display: flex; flex-direction: column; gap: 6px; }
.foot-cols h3 { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.06em;
                color: var(--text-secondary); margin: 0 0 4px; font-weight: 600; }
.foot-cols a { color: var(--text-muted); text-decoration: none; }
.foot-cols a:hover { color: var(--text-primary); text-decoration: underline; }
.foot-copy { margin: 0; }

@media (max-width: 600px) {
  .top { flex-wrap: wrap; gap: 10px; }
  .menu > summary { max-width: 11rem; }
  .page-header { align-items: flex-start; }
}

/* ---- phase 2: store pages ------------------------------------------- */
/* Text for screen readers only: a label a sighted reader gets from the
   layout. Same clipping as .sr-table, for the same reason. */
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden;
           clip-path: inset(50%); white-space: nowrap; }

.panel details { margin-top: 12px; border-top: 1px solid var(--line); padding-top: 10px; }
.panel details > summary { cursor: pointer; color: var(--text-secondary);
                           font-weight: 500; }
.panel details[open] > summary { margin-bottom: 8px; }
.panel h2 .muted { font-weight: 400; font-size: 0.9em; }

/* What needs the merchant, at the top of the Overview: one line per
   problem and a link to where it is fixed, not the fix itself. */
.attention { border-left: 4px solid var(--warn-line); background: var(--warn-bg); }
.attention ul { margin: 8px 0 0; padding-left: 1.1rem; }
.attention li + li { margin-top: 4px; }

/* Settings: a danger zone looks like one. */
.danger { border-color: var(--down); }
.danger h2 { color: var(--down); }
.btn-danger { background: var(--down); color: #fff; border-color: var(--down); }
.btn-danger:hover { filter: brightness(1.08); }

.facts { display: grid; grid-template-columns: max-content 1fr; gap: 6px 20px; margin: 0; }
.facts dt { color: var(--text-muted); }
.facts dd { margin: 0; }

/* An in-page index for a long page (Account): jump links, not tabs. */
.page-index { display: flex; flex-wrap: wrap; gap: 6px 18px; margin: -8px 0 20px;
              font-size: var(--t-sm); }
.page-index a { color: var(--text-secondary); }
section[id] { scroll-margin-top: 16px; }

/* With every page at the frame width, keep running text at a readable
   length inside panels rather than letting it span the whole page. */
.panel > p, .panel li, .page-sub { max-width: 72ch; }

/* ---- the store report (diagnosis.html) ------------------------------- */
.report-head { display: flex; flex-wrap: wrap; gap: var(--s-3) var(--s-5);
               justify-content: space-between; align-items: flex-end;
               margin: var(--s-2) 0 var(--s-4); }
.report-head h1 { margin: 2px 0 4px; }
.report-store { margin: 0; font-size: var(--t-sm); text-transform: uppercase;
                letter-spacing: 0.06em; color: var(--text-muted); }

.report-verdict { margin-bottom: var(--s-5); }
.verdict-line { font-size: var(--t-xl); line-height: 1.35; max-width: 40ch;
                margin: 0 0 var(--s-3); font-weight: 600; }
.verdict-note { background: var(--warn-bg); border-left: 4px solid var(--warn-line);
                border-radius: var(--radius-sm); padding: var(--s-3) var(--s-4);
                max-width: var(--measure); margin: 0 0 var(--s-4); }

.kpis { display: grid; gap: var(--s-3);
        grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr)); }
.kpi { background: var(--surface-1); border: 1px solid var(--line);
       border-radius: var(--radius); padding: var(--s-3) var(--s-4); box-shadow: var(--shadow); }
.kpi p { margin: 0; }
.kpi-label { font-size: var(--t-sm); color: var(--text-muted); }
.kpi-value { font-size: var(--t-2xl); font-weight: 700; line-height: 1.2;
             font-variant-numeric: tabular-nums; margin: 2px 0 !important; }
.kpi-change { font-size: var(--t-sm); font-weight: 600; }
.kpi-change.up { color: var(--up); }
.kpi-change.down { color: var(--down); }
.kpi-change .muted { font-weight: 400; }

.report-section { margin-top: var(--s-5); }
.report-section > h2 { font-size: var(--t-xl); text-transform: none;
                       letter-spacing: 0; color: var(--text-primary); }

/* Charts: waterfall and gain/loss bars, as HTML rows so text stays
   page-sized at any width. */
.hbars { margin: var(--s-3) 0 0; display: grid; gap: 6px; }
.hbars figcaption { font-weight: 600; margin-bottom: var(--s-1); }
.hb-row { display: grid; grid-template-columns: minmax(7rem, 11rem) 1fr 6.5rem;
          gap: var(--s-3); align-items: center; font-size: var(--t-sm); }
.hb-label { color: var(--text-secondary); }
.hb-value { text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; }
.hb-track { position: relative; height: 1.5rem; }
.waterfall .hb-track { height: 1.9rem; }
.hb-bar { position: absolute; top: 0; bottom: 0; border-radius: 4px; }
.hb-zero { position: absolute; top: -3px; bottom: -3px; width: 1px; background: var(--line); }
.wf-total { background: var(--series-1); }
.wf-up, .cb-up { background: var(--up); }
.wf-down, .cb-down { background: var(--down); }
.wf-flat, .cb-flat { background: var(--line); }
.wf-special { opacity: 0.55; outline: 2px dashed var(--text-secondary); outline-offset: -2px; }
@media (max-width: 560px) {
  .hb-row { grid-template-columns: 6.5rem 1fr 5.5rem; gap: var(--s-2); font-size: var(--t-xs); }
}
@media print { .hb-bar, .hb-zero { -webkit-print-color-adjust: exact; print-color-adjust: exact; } }
.report-split { display: grid; gap: var(--s-5); margin-top: var(--s-5);
                grid-template-columns: repeat(auto-fit, minmax(24rem, 1fr)); }
/* In half a column the label and value must leave the bar most of the row;
   at the waterfall's widths a loss of Rs 5,290 drew as a stub. */
.change-bars .hb-row { grid-template-columns: minmax(5rem, 7.5rem) 1fr 5.5rem; }

.reports-callout { border: 1px solid var(--series-1); border-radius: var(--radius);
                   padding: var(--s-3) var(--s-4); margin: var(--s-3) 0; background: var(--surface-0); }
.reports-callout p { margin: 0 0 var(--s-2); max-width: none; }
.reports-callout p:last-child { margin-bottom: 0; }
.short-channels { margin: 0 0 var(--s-3); color: var(--text-secondary); max-width: none; }

/* "What you sold" inside the short version: between the story and what
   helped, ruled off like the lists below it. */
.short-mix { margin-top: var(--s-5); padding-top: var(--s-4); border-top: 1px solid var(--line); }
.short-mix h3 { margin: 0 0 var(--s-2); font-size: var(--t-md); }
.short-mix-lead { margin: 0; color: var(--text-secondary); max-width: none; }
.short-mix > .muted:last-child { font-size: var(--t-xs); margin-bottom: 0; }

/* What you sold: one column per product, online store at the bottom and
   other sales stacked on top. Scrolls sideways when there are many. */
.sb-web { background: var(--series-1); }
.sb-other { background: var(--series-2); }
.stacked-columns { margin: var(--s-4) 0 0; }
.swipe-hint { display: none; font-size: var(--t-xs); margin: var(--s-3) 0 0; }
.sc-scroll { overflow-x: auto; padding-bottom: var(--s-2); }
.sc-plot { display: flex; align-items: stretch; justify-content: space-around;
           min-width: min-content; }
.sc-col { flex: 1 0 5.5rem; max-width: 9rem; display: flex; flex-direction: column;
          align-items: center; }
.sc-value { margin: 0 -20%; font-weight: 600; font-size: var(--t-sm); font-variant-numeric: tabular-nums;
            white-space: nowrap; line-height: 1.6rem; flex: none; text-align: center; }
/* Bars grow from the bottom; the amount sits just above each bar and may rise
   into the padding above the tallest one. */
.sc-track { height: 16rem; padding: 1.6rem 20% 0; align-self: stretch;
            border-bottom: 1px solid var(--text-muted);
            display: flex; flex-direction: column-reverse; align-items: stretch; }
.sc-seg { display: block; width: 100%; flex: none; transition: filter .15s;
          -webkit-print-color-adjust: exact; print-color-adjust: exact; }
.sc-top { border-radius: 4px 4px 0 0; }
.sc-col:hover .sc-seg { filter: brightness(1.1); }
.sc-label { margin-top: var(--s-2); padding: 0 4px; font-size: var(--t-xs); color: var(--text-secondary);
            text-align: center; line-height: 1.3; word-break: break-word; }
.sc-label small { display: block; color: var(--text-muted); margin-top: 2px; }
.mix-legend { list-style: none; padding: 0; margin: var(--s-3) 0 0; display: flex;
              flex-wrap: wrap; gap: var(--s-2) var(--s-5); font-size: var(--t-sm);
              color: var(--text-secondary); }
.mix-legend li { display: flex; align-items: center; gap: 8px; max-width: none; }
.swatch { display: inline-block; width: 12px; height: 12px; border-radius: 3px;
          -webkit-print-color-adjust: exact; print-color-adjust: exact; }
@media (max-width: 560px) {
  .sc-track { height: 12rem; }
  .swipe-hint { display: block; }
  .mix-legend li { align-items: flex-start; }
  .mix-legend .swatch { margin-top: 4px; flex: none; }
}

/* What the research found: one card per leak, the evidence folded away. */
.research-h { margin-top: var(--s-5); }
.research-cards { list-style: none; padding: 0; margin: var(--s-3) 0 0; display: grid; gap: var(--s-3); }
ol.research-cards > li.research-card { max-width: none; }
.research-card { border: 1px solid var(--line); border-left: 4px solid var(--series-1);
                 border-radius: var(--radius); padding: var(--s-4); background: var(--surface-0); max-width: none; }
.research-size { margin: 0; font-size: var(--t-sm); color: var(--text-muted); }
.research-title { margin: var(--s-1) 0 var(--s-3); font-size: var(--t-lg); }
.research-steps { margin: 0; padding-left: 1.2rem; }
.research-steps li { max-width: none; margin-bottom: 4px; }
.sure { font-weight: 600; }
.sure-sure { color: var(--up); }
.sure-fairly-sure { color: var(--series-1); }
.sure-general-practice { color: var(--text-muted); }
.research-how { margin-top: var(--s-3); font-size: var(--t-sm); }
.research-how summary { cursor: pointer; color: var(--series-1); }
.research-how ul { list-style: none; padding: 0; margin: var(--s-2) 0 0; display: grid; gap: var(--s-2); }
.research-how li { max-width: none; padding-left: 1.4rem; position: relative; }
.research-how li::before { position: absolute; left: 0; font-weight: 700; }
.ev-supported::before { content: "✓"; color: var(--up); }
.ev-not_supported::before { content: "✗"; color: var(--text-muted); }
.ev-not_enough::before, .ev-could_not_check::before { content: "–"; color: var(--text-muted); }
.research-how strong { display: block; }
.ev-table { width: auto; margin-top: 4px; font-size: var(--t-xs); }
.ev-table th { font-weight: 400; color: var(--text-secondary); padding-right: var(--s-3); }

/* What the owner did with a research card, and how it turned out. */
.research-act { margin-top: var(--s-3); padding-top: var(--s-3); border-top: 1px dashed var(--line); }
.research-did { margin: 0 0 var(--s-2); color: var(--up); font-weight: 600; max-width: none; }
.research-buttons { display: flex; gap: var(--s-2); flex-wrap: wrap; }
.research-buttons .btn { padding: 8px 14px; }
.research-done { border-left-color: var(--up); }
.follow-ups { list-style: none; padding: 0; margin: var(--s-3) 0 0; display: grid; gap: var(--s-2); }
ul.follow-ups > li.follow-up { max-width: none; border: 1px solid var(--line); border-radius: var(--radius);
             padding: var(--s-3) var(--s-4); background: var(--surface-0); }
.follow-up strong { display: block; }
.follow-better { border-left: 4px solid var(--up); }
.follow-worse { border-left: 4px solid var(--down); }
.follow-no_change, .follow-too_early, .follow-too_few { border-left: 4px solid var(--line); }
.research-hidden { margin-top: var(--s-3); font-size: var(--t-sm); }
.research-hidden summary { cursor: pointer; color: var(--text-muted); }
.inline-form { display: inline; }

/* Essentials: one card per check, quick wins first. */
.ess-summary .lead { margin: 0; max-width: none; }
.ess-summary .lead .muted { display: block; font-size: var(--t-sm); margin-top: 4px; }
.ess-cards { list-style: none; padding: 0; margin: var(--s-3) 0 0; display: grid; gap: var(--s-3); }
ol.ess-cards > li.ess-card { max-width: none; }
.ess-card { border: 1px solid var(--line); border-left: 4px solid var(--line); border-radius: var(--radius);
            padding: var(--s-4); background: var(--surface-0); }
.ess-missing { border-left-color: var(--down); }
.ess-chance { border-left-color: var(--series-2); }
.ess-ok { border-left-color: var(--up); }
.ess-head { display: flex; gap: var(--s-3); align-items: flex-start; }
.ess-head > div { flex: 1; }
.ess-mark { width: 1.8rem; height: 1.8rem; border-radius: 50%; display: grid; place-items: center;
            font-weight: 700; background: var(--surface-2); flex: none; }
.ess-missing .ess-mark { background: var(--down); color: #fff; }
.ess-chance .ess-mark { background: var(--series-2); color: #fff; }
.ess-ok .ess-mark { background: var(--up); color: #fff; }
.ess-stage { margin: 0; font-size: var(--t-xs); color: var(--text-muted); text-transform: uppercase;
             letter-spacing: .04em; }
.ess-title { margin: 2px 0 0; font-size: var(--t-lg); }
.ess-tag { flex: none; }
.ess-found, .ess-worth { margin: var(--s-3) 0 0; max-width: none; }
.ess-items { margin: var(--s-2) 0 0; padding-left: 1.2rem; font-size: var(--t-sm); }
.ess-items li { max-width: none; }
.ess-action { margin-top: var(--s-3); padding-top: var(--s-3); border-top: 1px dashed var(--line); }
.ess-action ol { margin: 0 0 var(--s-3); padding-left: 1.2rem; font-size: var(--t-sm); }
.ess-action li { max-width: none; }
.ess-also { margin: var(--s-2) 0 0; font-size: var(--t-sm); }
/* The discount, filled in as the owner will type it into Shopify's form. */
.ess-offer { margin-top: var(--s-3); padding: var(--s-3); background: var(--surface-2);
             border-radius: 8px; }
.ess-offer-lead { margin: 0 0 var(--s-2); max-width: none; }
.ess-offer-form { margin: 0; display: grid;
                  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: var(--s-2); }
.ess-offer-form div { background: var(--surface-0); border: 1px solid var(--line);
                      border-radius: 6px; padding: var(--s-2) var(--s-3); }
.ess-offer-form dt { font-size: var(--t-xs); color: var(--text-muted); text-transform: uppercase;
                     letter-spacing: .02em; }
.ess-offer-form dd { margin: 2px 0 0; font-weight: 600; }
/* The popup list of what to add, product by product: a disclosure, so it
   works without script. */
.ess-pop { margin: var(--s-2) 0 0; }
.ess-pop > summary { cursor: pointer; color: var(--series-1); font-size: var(--t-sm);
                     font-weight: 600; }
.ess-pop-body { margin-top: var(--s-2); border: 1px solid var(--line); border-radius: 8px;
                padding: var(--s-3); background: var(--surface-0); }
.ess-pop-product + .ess-pop-product { margin-top: var(--s-3); padding-top: var(--s-3);
                                      border-top: 1px dashed var(--line); }
.ess-pop-title { margin: 0 0 var(--s-2); max-width: none; }
.ess-pop-table { width: auto; font-size: var(--t-sm); }

.table-scroll { overflow-x: auto; }
.ess-grid th { font-size: var(--t-xs); vertical-align: bottom; }
.ess-cell { text-align: center; font-weight: 700; }
.ess-cell.ess-missing { color: var(--down); }
.ess-cell.ess-chance { color: var(--series-2); }
.ess-cell.ess-ok { color: var(--up); }
.ess-cell.ess-unknown { color: var(--text-muted); }

/* Actions: numbered cards, the thing a merchant does tonight. */
.action-cards { list-style: none; padding: 0; margin: 0; counter-reset: act;
                display: grid; gap: var(--s-3); }
.action-card { counter-increment: act; position: relative;
               border: 1px solid var(--line); border-radius: var(--radius);
               padding: var(--s-4) var(--s-4) var(--s-4) 3.4rem; background: var(--surface-0, transparent); }
.action-card::before { content: counter(act); position: absolute; left: var(--s-4); top: var(--s-4);
                       width: 1.8rem; height: 1.8rem; border-radius: 50%;
                       background: var(--series-1); color: #fff; font-weight: 700;
                       display: grid; place-items: center; }
.action-title { font-size: var(--t-lg); font-weight: 600; margin: 0 0 var(--s-2); }
.action-facts { display: grid; grid-template-columns: max-content 1fr;
                gap: 4px var(--s-4); margin: 0; font-size: var(--t-sm); }
.action-facts dt { color: var(--text-muted); }
.action-facts dd { margin: 0; }
@media (max-width: 560px) {
  .action-facts { grid-template-columns: 1fr; }
  .action-facts dd { margin-bottom: 6px; }
}

/* What the store is missing: one row per check, problems first. */
.checks { list-style: none; padding: 0; margin: 0; display: grid; gap: var(--s-2); }
.check { display: grid; grid-template-columns: 1.8rem 1fr; gap: var(--s-3);
         padding: var(--s-3) var(--s-4); border-radius: var(--radius-sm);
         border: 1px solid var(--line); }
.check p { margin: 0 0 4px; max-width: none; }
.check-mark { width: 1.6rem; height: 1.6rem; border-radius: 50%; font-weight: 700;
              display: grid; place-items: center; font-size: 0.9rem; }
.check-warn { background: var(--warn-bg); border-color: var(--warn-line); }
.check-warn .check-mark { background: var(--warn-line); color: #3d2a00; }
.check-ok .check-mark { background: var(--up); color: #fff; }
.check-info .check-mark { background: var(--series-1); color: #fff; }
.check-title { font-weight: 600; }
.check-detail, .check-fix, .check-worth { font-size: var(--t-sm); }

.report-foot { color: var(--text-muted); font-size: var(--t-sm); margin-top: var(--s-6); }

/* Save as PDF: the report alone, in black on white, without the app around it. */
@media print {
  .top, .subnav, .foot, .no-print, .skip-link, .flash { display: none !important; }
  body { background: #fff; color: #111; }
  main { max-width: none; padding: 0; }
  .panel, .kpi { box-shadow: none; break-inside: avoid; }
  .action-card, .check, .chart { break-inside: avoid; }
  .report-section { break-before: auto; }
  a { color: inherit; text-decoration: none; }
}

.inline-h { display: inline; font-size: var(--t-lg); margin: 0; }
.report-section details > summary { cursor: pointer; }
@media print { .report-section details > *:not(summary) { display: block; } }

/* ---- the plain report ------------------------------------------------- */
.eyebrow { font-size: var(--t-sm); text-transform: uppercase; letter-spacing: 0.06em;
           color: var(--text-muted); margin: 0 0 var(--s-2); font-weight: 600; }
.short-version { border-radius: var(--radius-lg); padding: var(--s-5);
                 margin: 0 0 var(--s-5); border: 1px solid var(--line);
                 background: var(--surface-1); box-shadow: var(--shadow); }
.short-version.tone-up { border-left: 6px solid var(--up); }
.short-version.tone-down { border-left: 6px solid var(--down); }
.short-version.tone-flat { border-left: 6px solid var(--series-1); }
.short-headline { font-size: var(--t-2xl); font-weight: 700; line-height: 1.25;
                  margin: 0 0 var(--s-2); max-width: 32ch; }
.short-reason { font-size: var(--t-lg); margin: 0 0 var(--s-2); }
.short-note { background: var(--warn-bg); border-left: 4px solid var(--warn-line);
              border-radius: var(--radius-sm); padding: var(--s-2) var(--s-3);
              margin: var(--s-3) 0 0; }
.helped-hurt { display: grid; gap: var(--s-5); margin-top: var(--s-4);
               grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr)); }
.helped-hurt h3 { font-size: var(--t-md); margin: 0 0 var(--s-2); }
.helped-hurt ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; }
.helped-hurt li { display: flex; justify-content: space-between; gap: var(--s-3);
                  border-bottom: 1px dashed var(--line); padding-bottom: 4px; }
.helped-hurt .up { color: var(--up); }
.helped-hurt .down { color: var(--down); }
.kpi-hint { font-size: var(--t-xs); color: var(--text-muted); margin-top: 4px !important; }
.hb-hint { display: block; font-size: var(--t-xs); color: var(--text-muted); line-height: 1.3; }
.check-status { font-size: var(--t-xs); font-weight: 600; text-transform: uppercase;
                letter-spacing: 0.04em; color: var(--text-muted); margin-left: var(--s-2); }
.action-explain { margin: 0 0 var(--s-3); color: var(--text-secondary); }
.glossary { display: grid; grid-template-columns: max-content 1fr; gap: 6px var(--s-4);
            margin: var(--s-3) 0 0; font-size: var(--t-sm); }
.glossary dt { font-weight: 600; }
.glossary dd { margin: 0; }
@media (max-width: 560px) {
  .glossary { grid-template-columns: 1fr; }
  .short-headline { font-size: var(--t-xl); }
}
@media print { .report-section details > * { display: block; } }

/* The details: one card per group, a sentence each, no table. */
.groups { list-style: none; padding: 0; margin: var(--s-3) 0; display: grid; gap: var(--s-2); }
.group { border: 1px solid var(--line); border-radius: var(--radius-sm);
         padding: var(--s-3) var(--s-4); background: var(--surface-1); }
.group-head { display: flex; justify-content: space-between; gap: var(--s-3);
              align-items: baseline; margin-bottom: 4px; }
.group-who { font-weight: 600; }
.group-head .up { color: var(--up); }
.group-head .down { color: var(--down); }
.group-facts { display: grid; grid-template-columns: max-content 1fr;
               gap: 2px var(--s-4); margin: 0; font-size: var(--t-sm); }
.group-facts dt { color: var(--text-muted); }
.group-facts dd { margin: 0; }

/* Where customers drop off: one shrinking bar per step. */
.funnel-line { font-weight: 500; max-width: var(--measure); }
.funnels { display: grid; gap: var(--s-5); margin: var(--s-4) 0;
           grid-template-columns: repeat(auto-fit, minmax(22rem, 1fr)); }
.funnel { margin: 0; }
.funnel figcaption { font-weight: 600; margin-bottom: var(--s-2); }
.funnel-row { display: grid; grid-template-columns: 9rem 1fr 9.5rem; gap: var(--s-3);
              align-items: center; margin-bottom: 6px; font-size: var(--t-sm); }
.funnel-label { color: var(--text-secondary); }
.funnel-track { height: 1.6rem; background: var(--surface-2); border-radius: 4px; }
.funnel-bar { display: block; height: 100%; border-radius: 4px; background: var(--series-1); }
.funnel-end { background: var(--up); }
.funnel-num { font-weight: 600; font-variant-numeric: tabular-nums; }
.funnel-num small { display: block; font-weight: 400; color: var(--text-muted);
                    font-size: var(--t-xs); line-height: 1.25; }
@media (max-width: 560px) {
  .funnel-row { grid-template-columns: 6.5rem 1fr 7rem; gap: var(--s-2); }
}
@media print { .funnel-bar { -webkit-print-color-adjust: exact; print-color-adjust: exact; } }

/* ---- admin portal ------------------------------------------------------ */
.admin-nav { display: flex; flex-wrap: wrap; gap: 4px 14px; align-items: center; }
.admin-nav a { color: var(--text-secondary); text-decoration: none; font-size: var(--t-sm); }
.admin-nav a.current { color: var(--text-primary); font-weight: 600; text-decoration: underline;
                       text-underline-offset: 4px; }
.admin-who { font-size: var(--t-sm); }
.admin-table { width: 100%; border-collapse: collapse; font-size: var(--t-sm); }
.admin-table th, .admin-table td { padding: 8px 10px; border-bottom: 1px solid var(--line);
                                   text-align: left; vertical-align: top; }
.admin-table th { color: var(--text-muted); font-weight: 600; white-space: nowrap; }
.admin-table .num { text-align: right; font-variant-numeric: tabular-nums; }
.admin-table .up { color: var(--up); font-weight: 600; }
.admin-table .down { color: var(--down); font-weight: 600; }
.admin-table tr.row-bad td { background: var(--warn-bg); }
.admin-filters { display: flex; flex-wrap: wrap; gap: var(--s-2); margin-bottom: var(--s-4); }
.admin-filters input[type=search] { flex: 1 1 18rem; padding: 8px 10px; border: 1px solid var(--line);
                                    border-radius: var(--radius-sm); background: var(--surface-1);
                                    color: var(--text-primary); }
.admin-filters select { padding: 8px 10px; border: 1px solid var(--line); border-radius: var(--radius-sm);
                        background: var(--surface-1); color: var(--text-primary); }
main.admin .kpi-value { font-size: var(--t-xl); }

/* Admin feedback cards: the verdict first, the merchant's words next. */
.fb-list { list-style: none; padding: 0; margin: var(--s-3) 0; display: grid; gap: var(--s-3); }
.fb { border: 1px solid var(--line); border-left-width: 5px; border-radius: var(--radius-sm);
      padding: var(--s-3) var(--s-4); background: var(--surface-1); }
.fb-useful, .fb-acted_on { border-left-color: var(--up); }
.fb-wrong { border-left-color: var(--down); }
.fb-not_useful { border-left-color: var(--warn-line); }
.fb-head { display: flex; justify-content: space-between; gap: var(--s-3); flex-wrap: wrap;
           align-items: baseline; margin-bottom: 6px; font-size: var(--t-sm); }
.fb-verdict { font-weight: 700; font-size: var(--t-md); }
.fb-note { margin: 0 0 var(--s-2); padding: var(--s-2) var(--s-3); background: var(--surface-2);
           border-radius: var(--radius-sm); font-style: italic; }
.fb-nonote { margin: 0 0 var(--s-2); font-size: var(--t-sm); }
.kpi-link { text-decoration: none; color: inherit; }
.kpi-link:hover, .kpi-on { border-color: var(--series-1); }
.fb-count-wrong { color: var(--down); }
.fb-count-useful, .fb-count-acted_on { color: var(--up); }

/* Admin top bar: badge left, who and sign-out right, never wrapped. */
.admin-who { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 16rem; }
.admin-signout { display: inline; margin: 0; }
.admin-signout .btn { white-space: nowrap; }
@media (max-width: 600px) { .admin-who { display: none; } }

/* Admin issues: what failed, and the three things to do about it. */
.btn-small { padding: 4px 10px; font-size: var(--t-xs); }
.job-actions { display: flex; flex-wrap: wrap; gap: 6px; align-items: flex-start; }
.job-actions form { margin: 0; }
.job-resolve > summary { list-style: none; cursor: pointer; display: inline-block; }
.job-resolve > summary::-webkit-details-marker { display: none; }
.job-resolve[open] form { margin-top: 8px; max-width: 22rem; }
.issue-head { display: flex; justify-content: space-between; gap: var(--s-3); align-items: baseline; }
.issue-head h2 { margin: 0; }
.issue-error code { white-space: pre-wrap; word-break: break-word; font-size: var(--t-sm); }
.issue-resolution { background: var(--surface-2); border-radius: var(--radius-sm);
                    padding: var(--s-2) var(--s-3); }

.helped-detail { display: block; font-size: var(--t-xs); }

/* ---- Design system ------------------------------------------------------
 * Shared components (macros in templates/_ui.html). Tokens only: spacing
 * --s-*, type --t-*, colour from :root. Phone first: everything below is
 * laid out for 320px and widens from there.
 */
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; }

.ds-stats { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s-3);
  margin: var(--s-4) 0; }
@media (min-width: 720px) { .ds-stats { grid-template-columns: repeat(4, 1fr); } }
.ds-stat { background: var(--surface-1); border: 1px solid var(--line);
  border-radius: var(--radius); padding: var(--s-3) var(--s-4); box-shadow: var(--shadow); }
.ds-stat-label { font-size: var(--t-xs); color: var(--text-muted); margin: 0;
  text-transform: uppercase; letter-spacing: 0.04em; }
.ds-stat-value { font-size: var(--t-xl); font-weight: 600; margin: var(--s-1) 0 0;
  font-variant-numeric: tabular-nums; }
.ds-stat-sub { font-size: var(--t-sm); color: var(--text-secondary); margin: var(--s-1) 0 0; }

.ds-delta { font-size: var(--t-sm); font-weight: 600; white-space: nowrap; }
.ds-good { color: var(--up); }
.ds-bad { color: var(--down); }
.ds-same, .ds-unknown { color: var(--text-muted); }

.ds-compare { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.ds-compare th, .ds-compare td { padding: var(--s-2) var(--s-1); text-align: right;
  border-bottom: 1px solid var(--line); font-size: var(--t-sm); }
.ds-compare td { white-space: nowrap; }
.ds-compare th[scope=row], .ds-compare thead th:first-child { text-align: left;
  font-weight: 400; color: var(--text-secondary); }
.ds-compare thead th { font-size: var(--t-xs); color: var(--text-muted); font-weight: 600; }

.ds-note { font-size: var(--t-sm); color: var(--text-muted); }

/* Changes, newest first, each with what happened after. */
.ds-changes { list-style: none; padding: 0; margin: var(--s-4) 0; }
.ds-change { display: grid; grid-template-columns: 2rem 1fr; gap: var(--s-1) var(--s-3);
  padding: var(--s-3) 0; border-bottom: 1px solid var(--line); }
.ds-change-n { grid-row: span 4; width: 1.6rem; height: 1.6rem; border-radius: 50%;
  background: var(--surface-2); color: var(--text-secondary); font-size: var(--t-xs);
  font-weight: 600; display: flex; align-items: center; justify-content: center; }
.ds-change-title { margin: 0; font-weight: 600; }
.ds-change-meta { margin: 0; font-size: var(--t-xs); color: var(--text-muted); }
.ds-change-effect { margin: 0; font-size: var(--t-sm); color: var(--text-secondary); }
.ds-change-effect.ds-good { color: var(--up); }
.ds-change-effect.ds-bad { color: var(--down); }
.ds-change form { grid-column: 2; }
.ds-change .link-button { background: none; border: 0; padding: 0; color: var(--text-muted);
  text-decoration: underline; cursor: pointer; font-size: var(--t-xs); }

.ds-add-change { display: grid; gap: var(--s-2); margin-top: var(--s-3); }
@media (min-width: 640px) { .ds-add-change { grid-template-columns: 1fr auto auto; align-items: end; } }
.ds-add-change label { font-size: var(--t-sm); color: var(--text-secondary); display: grid; gap: var(--s-1); }
.ds-add-change input { font: inherit; padding: var(--s-2); border: 1px solid var(--line);
  border-radius: 6px; background: var(--surface-1); color: var(--text-primary); }

/* Weekly sales with change markers (charts.weekly_with_changes). */
.weekly-changes figcaption { font-size: var(--t-sm); color: var(--text-secondary); }
.wc-scale { font-size: var(--t-xs); color: var(--text-muted); margin: var(--s-1) 0; }
.wc-plot { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr);
  gap: 3px; height: 160px; align-items: end; }
.wc-col { display: grid; grid-template-rows: 1.4rem 1fr auto; height: 100%; min-width: 0; }
.wc-flags { display: flex; gap: 1px; justify-content: center; align-items: end; }
.wc-flag { font-size: 0.65rem; font-weight: 700; line-height: 1; padding: 2px 4px;
  border-radius: 8px; background: var(--series-2); color: #fff; }
.wc-track { display: flex; align-items: end; border-bottom: 1px solid var(--line); }
.wc-bar { display: block; width: 100%; background: var(--series-1); border-radius: 3px 3px 0 0;
  opacity: 0.85; }
.wc-marked .wc-bar { opacity: 1; }
.wc-label { font-size: 0.62rem; color: var(--text-muted); text-align: center; white-space: nowrap;
  overflow: hidden; padding-top: 2px; }
@media (max-width: 480px) { .wc-col:nth-child(odd) .wc-label { visibility: hidden; } }
.ess-told { margin: var(--s-2) 0 0; font-size: var(--t-sm); color: var(--text-secondary); background: var(--surface-2); padding: var(--s-2) var(--s-3); border-radius: 6px; }

/* Questions to the owner (questions.html). Big tap targets: asked on a phone. */
.questions .question { border: 1px solid var(--line); margin: 0 0 var(--s-3); }
.question-text { font-weight: 600; font-size: var(--t-md); padding: 0 var(--s-1); }
.question-why { margin: 0 0 var(--s-2); font-size: var(--t-sm); }
.question-options { display: grid; gap: var(--s-2); }
@media (min-width: 640px) { .question-options { grid-template-columns: 1fr 1fr; } }
.question-option { display: flex; gap: var(--s-2); align-items: center; padding: var(--s-2) var(--s-3);
  border: 1px solid var(--line); border-radius: 8px; cursor: pointer; min-height: 44px; }
.question-option:has(input:checked) { border-color: var(--series-1); background: var(--surface-2); }
.question-clear { color: var(--text-muted); font-size: var(--t-sm); }

/* Contact us */
.ct { display: grid; gap: var(--s-5); align-items: start; }
@media (min-width: 900px) { .ct { grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); } }
.contact-form { display: grid; gap: 22px; padding: 28px; }
.contact-form textarea, .contact-form select, .contact-form input[type=email] {
  width: 100%; font: inherit; padding: 10px 12px; }
.contact-form textarea { resize: vertical; min-height: 9rem; line-height: 1.5; }
.ct-field { display: grid; gap: 8px; margin: 0; padding: 0; border: 0; min-width: 0; }
.ct-label { display: flex; align-items: center; gap: 8px; font-weight: 600; color: var(--text-primary);
            font-size: var(--t-md); padding: 0; }
.ct-opt { font-weight: 500; font-size: var(--t-xs); color: var(--text-muted); background: var(--surface-2);
          padding: 2px 8px; border-radius: 999px; }
.ct-topics { display: grid; gap: 8px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 14rem), 1fr)); }
.ct-topic { position: relative; display: flex; align-items: center; gap: 10px; min-height: 48px;
            padding: 10px 14px; border: 1px solid var(--line-strong); border-radius: 10px;
            background: var(--surface-1); cursor: pointer; font-size: var(--t-sm); line-height: 1.35;
            transition: border-color .12s, background .12s; }
.ct-topic:hover { border-color: var(--text-muted); }
.ct-topic input { accent-color: var(--series-1); margin: 0; flex: none; }
.ct-topic:has(input:checked) { border-color: var(--series-1); background: var(--brand-soft);
                               color: var(--text-primary); font-weight: 600; }
.ct-topic:has(input:focus-visible) { box-shadow: 0 0 0 3px rgb(79 70 229 / 18%); }
.ct-row { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 14rem), 1fr)); }
.ct-file input[type=file] { width: 100%; padding: 14px; border: 1.5px dashed var(--line-strong);
                            border-radius: 10px; background: var(--surface-2); font: inherit;
                            font-size: var(--t-sm); color: var(--text-secondary); cursor: pointer; }
.ct-file input[type=file]:hover { border-color: var(--series-1); }
.ct-file input[type=file]::file-selector-button { font: inherit; font-weight: 600; margin-right: 12px;
  padding: 7px 14px; border: 1px solid var(--line-strong); border-radius: 8px;
  background: var(--surface-1); color: var(--text-primary); cursor: pointer; }
.ct-hint { font-size: var(--t-sm); color: var(--text-muted); }
.ct-send { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px;
           padding-top: 18px; border-top: 1px solid var(--line); }
.ct-send .btn { min-width: 11rem; }
.ct-reply { margin: 0; font-size: var(--t-sm); color: var(--text-secondary); overflow-wrap: anywhere; }
.ct-side { display: grid; gap: var(--s-4); }
.ct-side > .panel { margin: 0; }
.ct-card { padding: 22px; }
.ct-card h2 { margin: 0 0 12px; font-size: var(--t-md); }
.ct-steps { margin: 0; padding: 0; list-style: none; display: grid; gap: 12px; counter-reset: ct; }
.ct-steps li { position: relative; padding-left: 34px; font-size: var(--t-sm); color: var(--text-secondary);
               line-height: 1.45; counter-increment: ct; }
.ct-steps li::before { content: counter(ct); position: absolute; left: 0; top: 0; width: 22px; height: 22px;
  display: grid; place-items: center; border-radius: 50%; background: var(--up-soft); color: var(--up);
  font-size: var(--t-xs); font-weight: 700; }
.ct-steps b { color: var(--text-primary); }
.ct-links { margin: 0; padding: 0; list-style: none; display: grid; gap: 14px; }
.ct-links li { display: grid; gap: 2px; }
.ct-links a { font-weight: 600; }
.ct-links span { font-size: var(--t-sm); color: var(--text-muted); }
@media (max-width: 640px) { .contact-form { padding: 20px 16px; } .ct-send .btn { width: 100%; } }
.ref { font-family: ui-monospace, monospace; letter-spacing: 0.05em; }

/* Help articles (templates/help/). */
.help-list { list-style: none; padding: 0; margin: 0; display: grid; gap: var(--s-2); }
@media (min-width: 720px) { .help-list { grid-template-columns: 1fr 1fr; } }
.help-list a { display: grid; gap: var(--s-1); padding: var(--s-3) var(--s-4); border: 1px solid var(--line);
  border-radius: var(--radius); background: var(--surface-1); text-decoration: none; color: var(--text-primary); }
.help-list a:hover { border-color: var(--series-1); }
.help-list span { color: var(--text-secondary); font-size: var(--t-sm); }
.help-article h2 { font-size: var(--t-lg); margin-top: var(--s-5); }
.help-article ol > li { margin-bottom: var(--s-3); }
.help-article .help-note { background: var(--surface-2); border-radius: 6px; padding: var(--s-3); font-size: var(--t-sm); }
.help-shot { margin: var(--s-3) 0 var(--s-4); }
.help-shot img { max-width: 100%; border: 1px solid var(--line); border-radius: 8px; }
.help-shot-placeholder { aspect-ratio: 16 / 9; max-width: 560px; border: 1px dashed var(--line); border-radius: 8px;
  background: var(--surface-2); display: flex; align-items: center; justify-content: center;
  color: var(--text-muted); font-size: var(--t-sm); }
.help-shot figcaption { font-size: var(--t-xs); color: var(--text-muted); margin-top: var(--s-1); }
.help-stuck { margin-top: var(--s-5); }
.help-related ul { padding-left: var(--s-4); }
.help-inline { font-size: var(--t-sm); }

/* "Check it worked" for Google Analytics (data.html). */
.ga4-steps { list-style: none; padding: 0; margin: var(--s-2) 0 0; display: grid; gap: var(--s-2); }
.ga4-step { display: grid; grid-template-columns: 1.6rem 1fr; gap: var(--s-2); align-items: start; }
.ga4-mark { width: 1.4rem; height: 1.4rem; border-radius: 50%; display: flex; align-items: center;
  justify-content: center; font-size: var(--t-xs); font-weight: 700; background: var(--surface-2); }
.ga4-ok .ga4-mark { color: var(--up); }
.ga4-fail .ga4-mark { color: var(--down); }
.ga4-warn .ga4-mark { color: var(--warn-line); }
.ga4-label { margin: 0; font-weight: 600; }
.ga4-sentence { margin: 0; font-size: var(--t-sm); color: var(--text-secondary); }

/* Welcome tour (dashboard.html). Cards stack on a phone, 2×2 then 4 across. */
.tour h2 { margin-top: 0; }
.tour-cards { list-style: none; padding: 0; margin: var(--s-3) 0; display: grid; gap: var(--s-3); }
@media (min-width: 640px) { .tour-cards { grid-template-columns: 1fr 1fr; } }
@media (min-width: 1000px) { .tour-cards { grid-template-columns: repeat(4, 1fr); } }
.tour-card { border: 1px solid var(--line); border-radius: var(--radius); padding: var(--s-3) var(--s-4);
  background: var(--surface-0); }
.tour-card h3 { margin: var(--s-1) 0; font-size: var(--t-md); }
.tour-card p { margin: 0 0 var(--s-2); font-size: var(--t-sm); color: var(--text-secondary); }
.tour-n { display: inline-flex; width: 1.5rem; height: 1.5rem; border-radius: 50%; align-items: center;
  justify-content: center; background: var(--series-1); color: #fff; font-size: var(--t-xs); font-weight: 700; }
.tour-done { display: flex; flex-wrap: wrap; gap: var(--s-3); align-items: center; }

/* The period line under a headline figure (_ui.html `period`): the same
   words on every page, so two totals for "the last 4 weeks" can be told
   apart by the days they cover. */
.period { margin: 0 0 var(--s-3); color: var(--text-muted); font-size: var(--t-sm);
  font-variant-numeric: tabular-nums; }
.period-scope { font-weight: 600; color: var(--text-secondary); }

/* The impact dashboard in plain words (_impact.html, impact_words.py). */
.plain-headline { border-left: 4px solid var(--line); padding: var(--s-2) var(--s-4); margin: var(--s-3) 0; }
.plain-headline.tone-good { border-color: var(--up); }
.plain-headline.tone-bad { border-color: var(--down); }
.plain-title { font-size: var(--t-xl); font-weight: 600; margin: 0; line-height: 1.25; }
.plain-detail { font-size: var(--t-lg); color: var(--text-secondary); margin: var(--s-1) 0 0; }
.plain-total { color: var(--text-secondary); margin: var(--s-2) 0 var(--s-4); }
.plain-lines { list-style: none; padding: 0; margin: 0 0 var(--s-3); display: grid; gap: var(--s-3); }
@media (min-width: 720px) { .plain-lines { grid-template-columns: 1fr 1fr; } }
.plain-line { background: var(--surface-1); border: 1px solid var(--line); border-radius: var(--radius);
  padding: var(--s-3) var(--s-4); }
.plain-line-title { margin: 0; font-weight: 600; }
.plain-mark { display: inline-block; width: 1.2rem; text-align: center; }
.plain-good .plain-mark { color: var(--up); }
.plain-bad .plain-mark { color: var(--down); }
.plain-same .plain-mark { color: var(--text-muted); }
.plain-line-detail { margin: var(--s-1) 0 0; color: var(--text-secondary); font-size: var(--t-sm); }
.plain-bars { display: grid; grid-template-columns: auto 1fr auto; gap: var(--s-1) var(--s-2);
  align-items: center; margin-top: var(--s-2); font-size: var(--t-xs); color: var(--text-muted); }
.plain-bar-track { height: 10px; background: var(--surface-2); border-radius: 5px; overflow: hidden; }
.plain-bar { display: block; height: 100%; border-radius: 5px; }
.plain-bar-before { background: var(--text-muted); opacity: 0.55; }
.plain-bar-now { background: var(--series-1); }
.plain-good .plain-bar-now { background: var(--up); }
.plain-bad .plain-bar-now { background: var(--down); }
.plain-bar-value { font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }

/* =======================================================================
 * THE REFRESH: one brand colour, white cards on a cool grey page, a white
 * top bar, and a hover state on everything that can be clicked.
 *
 * Kept as one layer at the end so it can be read (and reverted) in one
 * place. It changes the tokens first — most of the product picks the new
 * look up from those alone — then the few components whose shape changes.
 * Hover changes colour, border and shadow only; nothing moves.
 * ===================================================================== */

:root {
  --surface-0: #f4f6fb;
  --surface-1: #ffffff;
  --surface-2: #eef1f7;
  --line: #e2e7f0;
  --line-strong: #cdd5e2;
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #64748b;
  --series-1: #4f46e5;          /* the brand: buttons, links, charts */
  --brand-hover: #4338ca;
  --brand-soft: #eef0ff;        /* tinted backgrounds behind brand text */
  --series-2: #ea580c;
  --down: #dc2626;
  --down-soft: #fef2f2;
  --up: #16a34a;
  --up-soft: #ecfdf3;
  --warn-bg: #fff8eb;
  --warn-line: #f5c46b;
  --warn-soft: #fff4e0;
  --radius: 12px;
  --shadow: 0 1px 2px rgb(15 23 42 / 5%), 0 1px 3px rgb(15 23 42 / 4%);
  --shadow-hover: 0 4px 16px rgb(15 23 42 / 8%), 0 1px 3px rgb(15 23 42 / 6%);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --surface-0: #0b1120;
    --surface-1: #131b2e;
    --surface-2: #1b2439;
    --line: #263149;
    --line-strong: #34405c;
    --text-primary: #f8fafc;
    --text-secondary: #cbd5e1;
    --text-muted: #94a3b8;
    --series-1: #818cf8;
    --brand-hover: #a5b4fc;
    --brand-soft: #232a52;
    --series-2: #fb923c;
    --down: #f87171;
    --down-soft: #3a1d24;
    --up: #4ade80;
    --up-soft: #15302a;
    --warn-bg: #2b2414;
    --warn-line: #7a5f2a;
    --warn-soft: #33290f;
    --shadow: none;
    --shadow-hover: 0 4px 16px rgb(0 0 0 / 35%);
  }
}

:root[data-theme="dark"] {
  --surface-0: #0b1120;
  --surface-1: #131b2e;
  --surface-2: #1b2439;
  --line: #263149;
  --line-strong: #34405c;
  --text-primary: #f8fafc;
  --text-secondary: #cbd5e1;
  --text-muted: #94a3b8;
  --series-1: #818cf8;
  --brand-hover: #a5b4fc;
  --brand-soft: #232a52;
  --series-2: #fb923c;
  --down: #f87171;
  --down-soft: #3a1d24;
  --up: #4ade80;
  --up-soft: #15302a;
  --warn-bg: #2b2414;
  --warn-line: #7a5f2a;
  --warn-soft: #33290f;
  --shadow: none;
  --shadow-hover: 0 4px 16px rgb(0 0 0 / 35%);
}

body {
  font-family: Inter, ui-sans-serif, -apple-system, "Segoe UI", Roboto, sans-serif;
  /* The header band below reaches the window's edges; it must not make the
     page scroll sideways when a vertical scrollbar takes some of the width. */
  overflow-x: clip;
}
a { color: var(--series-1); text-underline-offset: 2px; }
a:hover { color: var(--brand-hover); }

/* ---- the top bar and store tabs: one white band, edge to edge -------- */

.top, .subnav { position: relative; }
.top::before, .subnav::before {
  content: ""; position: absolute; z-index: -1; top: 0; bottom: 0;
  left: calc(50% - 50vw); right: calc(50% - 50vw);
  background: var(--surface-1); border-bottom: 1px solid var(--line);
}
.top:has(+ .subnav)::before { border-bottom: 0; }
.top { padding: 14px 16px; }
.top:has(+ .subnav) { padding-bottom: 6px; }
main { padding-top: 24px; }

.wordmark { font-size: 1.15rem; font-weight: 750; letter-spacing: -0.02em;
            display: inline-flex; align-items: center; gap: 8px; }
.wordmark::before {
  content: "V"; display: grid; place-items: center; width: 28px; height: 28px;
  border-radius: 8px; background: var(--series-1); color: #fff;
  font-size: 0.95rem; font-weight: 800;
}
.wordmark:hover { color: var(--text-primary); }

.theme { transition: background .12s, border-color .12s, color .12s; }
.theme:hover { background: var(--surface-2); border-color: var(--line-strong);
               color: var(--text-primary); }

.menu > summary { padding: 5px 12px; border-color: var(--line);
                  transition: background .12s, border-color .12s; }
.menu > summary:hover { background: var(--surface-2); border-color: var(--line-strong); }
.menu-list { border-radius: var(--radius); box-shadow: var(--shadow-hover); padding: 6px; }
.menu-list li a:hover, .menu-list li button:hover {
  background: var(--brand-soft); color: var(--series-1);
}

.nav a, .nav-form button { padding: 6px 10px; border-radius: 8px;
                           transition: background .12s, color .12s; }
.nav a:hover, .nav-form button:hover { background: var(--surface-2); color: var(--text-primary); }
.nav a.current { color: var(--series-1); background: var(--brand-soft); }

.store-tabs { border-bottom: 0; margin-bottom: 0; gap: 2px; }
.store-tabs a { padding: 10px 14px; border-radius: 8px 8px 0 0; font-weight: 500;
                transition: background .12s, color .12s; }
.store-tabs a:hover { background: var(--surface-2); color: var(--text-primary); }
.store-tabs a.current { color: var(--series-1); font-weight: 650;
                        border-bottom: 2px solid var(--series-1); }

/* ---- headings ------------------------------------------------------- */

h1 { font-size: 1.85rem; font-weight: 750; letter-spacing: -0.025em; }
/* Section headings were small grey capitals, which read as a label rather
   than a heading. On the product's own pages they are now real headings. */
main:not(.pub) h2 { font-size: 1.15rem; text-transform: none; letter-spacing: -0.01em;
                    color: var(--text-primary); font-weight: 700; }
.page-header { margin-bottom: 24px; }
.page-sub, .domain { color: var(--text-muted); }

/* ---- cards ---------------------------------------------------------- */

/* On the product's pages each section is a white card, so the page reads
   as a set of blocks rather than one long column of text. */
main:not(.pub):not(.admin) > .section,
main:not(.pub):not(.admin) > section.section {
  background: var(--surface-1); border: 1px solid var(--line);
  border-radius: var(--radius-lg); padding: 24px 28px; margin: 0 0 20px;
  box-shadow: var(--shadow);
}
main:not(.pub):not(.admin) > .section:first-of-type { border-top: 1px solid var(--line); }
@media (max-width: 640px) {
  main:not(.pub):not(.admin) > .section { padding: 20px 16px; }
}

.panel { border-radius: var(--radius-lg); box-shadow: var(--shadow); }
/* A panel inside a card is a box within it, not a second floating card. */
.section .panel { box-shadow: none; background: var(--surface-0); }
.panel.quiet { background: var(--brand-soft); border-color: transparent; }
.panel.warn, .attention { background: var(--warn-bg); border-color: var(--warn-line); }

/* Everything that is a link or button in the shape of a card answers the
   pointer the same way: the border takes the brand colour and the shadow
   lifts. No movement. */
.store-card, .report-card, .tile, .kpi, .plain-line, .plan, .ess-card,
.research-card, .action-card, .follow-up, .group, .check {
  transition: border-color .12s, box-shadow .12s, background .12s;
}
.store-card, .report-card { box-shadow: var(--shadow); }
.store-card:hover, .report-card:hover, .report-card:focus-visible,
.tile:hover, .kpi:hover, .plain-line:hover, .plan:hover,
.ess-card:hover, .research-card:hover, .action-card:hover {
  border-color: var(--line-strong); box-shadow: var(--shadow-hover);
}
.store-card:hover, .report-card:hover, .report-card:focus-visible {
  border-color: var(--series-1); background: var(--surface-1); transform: none;
}
.store-card:hover .go { color: var(--series-1); }
.report-card:hover .report-open .arrow { transform: none; }
.store-card { padding: 18px 20px; border-radius: var(--radius); }

.tile, .kpi, .plain-line { background: var(--surface-1); border-radius: var(--radius); }
.section .tile, .section .kpi, .section .plain-line { background: var(--surface-1); }
.tile-value, .kpi-value { color: var(--text-primary); }

/* ---- buttons -------------------------------------------------------- */

.btn, .url-row button, .continue button, form.stack button, .upload-row button,
button.primary, a.button, .feedback button {
  border-radius: 10px; font-weight: 600;
  transition: background .12s, border-color .12s, color .12s, box-shadow .12s;
}
.btn-primary, .url-row button, .continue button, form.stack button,
.upload-row button, button.primary, a.button {
  background: var(--series-1); color: #fff; border-color: var(--series-1);
  box-shadow: 0 1px 2px rgb(79 70 229 / 25%);
}
.btn-primary:hover, .url-row button:hover, .continue button:hover,
form.stack button:hover, .upload-row button:hover, button.primary:hover,
a.button:hover {
  background: var(--brand-hover); border-color: var(--brand-hover); color: #fff;
  filter: none; box-shadow: 0 4px 12px rgb(79 70 229 / 30%);
}
.btn-secondary { background: var(--surface-1); border-color: var(--line-strong);
                 color: var(--text-primary); }
.btn-secondary:hover { border-color: var(--series-1); color: var(--series-1);
                       background: var(--brand-soft); }
.btn-ghost:hover { color: var(--brand-hover); text-decoration: underline; }
.btn-danger { border-color: var(--down); }
.btn-danger:hover { filter: none; background: #b91c1c; border-color: #b91c1c; }
.feedback button:hover { background: var(--brand-soft); border-color: var(--series-1);
                         color: var(--series-1); }

/* ---- form fields ---------------------------------------------------- */

input:not([type=checkbox]):not([type=radio]):not([type=file]), select, textarea {
  background: var(--surface-1); border: 1px solid var(--line-strong);
  border-radius: 10px; color: var(--text-primary);
  transition: border-color .12s, box-shadow .12s;
}
input:not([type=checkbox]):not([type=radio]):not([type=file]):hover,
select:hover, textarea:hover { border-color: var(--text-muted); }
input:not([type=checkbox]):not([type=radio]):not([type=file]):focus,
select:focus, textarea:focus {
  outline: none; border-color: var(--series-1);
  box-shadow: 0 0 0 3px rgb(79 70 229 / 18%);
}

/* ---- tags and badges: tinted fills, not hairline outlines ----------- */

.tag, .badge, .tier {
  border-color: transparent; background: var(--surface-2); color: var(--text-secondary);
  font-weight: 600;
}
.tag.latest, .badge-plan, .tier.likely, .tag-on {
  background: var(--brand-soft); color: var(--series-1); border-color: transparent;
}
.tag.done, .tier.confirmed { background: var(--up-soft); color: var(--up); }
.tag.wrong { background: var(--down-soft); color: var(--down); }
.tag.urgent, .badge-warn { background: var(--warn-soft); color: var(--series-2); }
.period-choices .tag { padding: 4px 12px; }
.period-choices .tag:hover { background: var(--brand-soft); color: var(--series-1); }

/* ---- lists and tables ---------------------------------------------- */

tbody tr { transition: background .12s; }
tbody tr:hover { background: var(--surface-0); }
th { font-size: 0.85rem; color: var(--text-muted); }

.source { padding: 14px 0; }
ol.history li { border-radius: 8px; }

ol.actions li::before, ol.needs li::before, .step-n {
  background: var(--brand-soft); color: var(--series-1);
}

.flash { border-color: var(--up); background: var(--up-soft);
         display: flex; align-items: flex-start; gap: 12px; }
.flash > span { flex: 1; min-width: 0; }
.flash-close { flex: none; color: var(--text-secondary); text-decoration: none;
               font-size: 1.4rem; line-height: 1; padding: 0 4px; border-radius: 6px; }
.flash-close:hover, .flash-close:focus-visible { background: var(--surface-1); color: inherit; }

/* ---- the impact dashboard's headline ------------------------------- */

.plain-headline { border-radius: var(--radius); background: var(--surface-0); }
.plain-headline.tone-good { background: var(--up-soft); }
.plain-headline.tone-bad { background: var(--down-soft); }

/* ---- footer --------------------------------------------------------- */

.foot { border-top: 1px solid var(--line); margin-top: 16px; }
.foot-cols a:hover { color: var(--series-1); }

/* A card's first line sits at its padding, not padding plus a heading's
   own top margin (.sub-h carries one for use mid-page). */
.panel > :first-child, .section > :first-child { margin-top: 0; }
.helped-hurt li strong { white-space: nowrap; }

/* In dark mode the brand is a light indigo, which white text cannot sit on.
   Filled buttons keep a deeper indigo there. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) { --brand-solid: #6366f1; --brand-solid-hover: #4f46e5; }
}
:root[data-theme="dark"] { --brand-solid: #6366f1; --brand-solid-hover: #4f46e5; }
.btn-primary, .url-row button, .continue button, form.stack button,
.upload-row button, button.primary, a.button {
  background: var(--brand-solid, var(--series-1));
  border-color: var(--brand-solid, var(--series-1));
}
.btn-primary:hover, .url-row button:hover, .continue button:hover,
form.stack button:hover, .upload-row button:hover, button.primary:hover,
a.button:hover {
  background: var(--brand-solid-hover, var(--brand-hover));
  border-color: var(--brand-solid-hover, var(--brand-hover));
}
.wordmark::before { background: var(--brand-solid, var(--series-1)); }

/* ---- SEO (seo.html) ------------------------------------------------------ */
.btn-sm { padding: 6px 12px; font-size: var(--t-sm); }

.seo-stats { display: grid; gap: 12px; margin: 0 0 20px;
             grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr)); }
.seo-stat { background: var(--surface-1); border: 1px solid var(--line);
            border-radius: var(--radius); padding: 14px 18px; box-shadow: var(--shadow); }
.seo-stat p { margin: 0; color: var(--text-muted); font-size: var(--t-sm); }
.seo-stat .seo-stat-n { font-size: var(--t-2xl); font-weight: 750; color: var(--text-primary);
                        line-height: 1.2; font-variant-numeric: tabular-nums; }
.seo-stat-fix { border-left: 4px solid var(--down); }
.seo-stat-improve { border-left: 4px solid var(--series-2); }

.tag.seo-fix { background: var(--down-soft); color: var(--down); }
.tag.seo-improve { background: var(--warn-soft); color: var(--series-2); }
.tag.seo-ok { background: var(--up-soft); color: var(--up); }
.tag.seo-tip { background: var(--brand-soft); color: var(--series-1); }

.seo-todo { margin: 0; padding-left: 1.4rem; display: grid; gap: 8px; }
.seo-todo a { color: var(--text-primary); text-decoration: none; font-weight: 600; }
.seo-todo a:hover { color: var(--series-1); }
.seo-todo .tag { margin-right: 6px; }

.seo-findings { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; }
.seo-finding { border: 1px solid var(--line); border-left: 4px solid var(--line);
               border-radius: var(--radius); padding: 16px 18px; background: var(--surface-1);
               transition: border-color .12s, box-shadow .12s; scroll-margin-top: 16px; }
.seo-finding:hover { box-shadow: var(--shadow-hover); }
.seo-finding.seo-fix { border-left-color: var(--down); }
.seo-finding.seo-improve { border-left-color: var(--series-2); }
.seo-finding.seo-ok { border-left-color: var(--up); }
.seo-finding.seo-tip { border-left-color: var(--series-1); }
.seo-finding-head { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.seo-finding h3 { margin: 0; font-size: var(--t-md); }
.seo-found { margin: 8px 0 4px; max-width: none; }
.seo-why { margin: 0 0 8px; color: var(--text-secondary); font-size: var(--t-sm); max-width: none; }
.seo-items { margin: 8px 0 12px; font-size: var(--t-sm); }
.seo-items summary { cursor: pointer; color: var(--series-1); font-weight: 600; }
.seo-items ul { list-style: none; padding: 0; margin: 8px 0 0; display: grid; gap: 6px; }
.seo-items li { display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: baseline;
                padding: 6px 10px; border-radius: 8px; background: var(--surface-0); max-width: none; }
.seo-items li:hover { background: var(--surface-2); }
.seo-item-label { font-weight: 600; }
.seo-item-fix { margin-left: auto; font-weight: 600; }

.seo-table th[scope="row"] { font-weight: 600; color: var(--text-primary); min-width: 12rem; }
.seo-table td { white-space: nowrap; }
.seo-miss { color: var(--series-2); font-weight: 600; }

.seo-teaser-row { display: flex; gap: 16px 24px; align-items: center; justify-content: space-between;
                  flex-wrap: wrap; }
.seo-teaser .section-lead { margin: 0; }

/* Keywords for every product */
.kw-products { list-style: none; padding: 0; margin: 0; display: grid; gap: 14px; }
.kw-product { border: 1px solid var(--line); border-radius: var(--radius);
              background: var(--surface-1); padding: 12px 14px; }
.kw-product-title { margin: 0 0 8px; font-weight: 600; }
.kw-chips { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.kw-chip { display: inline-flex; align-items: baseline; gap: 6px; font-size: var(--t-sm);
           border: 1px solid var(--line); border-radius: 999px; padding: 3px 10px;
           background: var(--surface-2); }
.kw-chip .kw-n { color: var(--text-muted); font-size: var(--t-xs); }
.kw-chip .kw-intent { font-size: var(--t-xs); color: var(--text-muted); font-style: italic; }
.kw-chip .kw-status { font-size: var(--t-xs); font-weight: 600; opacity: 0.85; }
.kw-chip.kw-ranking { border-color: var(--up); color: var(--up); }
.kw-chip.kw-page2 { border-color: var(--series-1); color: var(--series-1); }
.kw-chip.kw-missing { border-color: var(--series-2); color: var(--series-2); }
.kw-chip.kw-candidate { color: var(--text-secondary); }

/* Funnel on the Insights tab */
.fn-headline { font-size: 16px; margin: 0 0 10px; }
.hfunnel { display: block; max-width: 640px; margin: 0 auto 6px; }
.hf-lab { fill: var(--text-secondary); font-size: 13px; }
.hf-num { font-size: 20px; font-weight: 600; }
.hf-drop { fill: var(--text-muted); font-size: 12px; }
.fn-legend { display: flex; flex-wrap: wrap; gap: 14px; font-size: var(--t-sm);
  color: var(--text-secondary); margin: 2px 0 6px; }
.fn-legend span { display: flex; align-items: center; gap: 6px; }
.sw { width: 12px; height: 12px; border-radius: 3px; display: inline-block; }
.sw-g { background: var(--up); }
.sw-a { background: var(--series-2); }
.sw-n { background: var(--surface-2); border: 1px solid var(--line); }
.fn-sub { font-size: var(--t-sm); color: var(--text-muted); margin: 0 0 10px; }
.fn-products { display: grid; gap: 8px; }
.fn-item { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface-1); }
.fn-item summary { display: flex; align-items: center; gap: 10px; padding: 10px 12px;
  cursor: pointer; list-style: none; }
.fn-item summary::-webkit-details-marker { display: none; }
.fn-item summary:hover { background: var(--surface-2); border-radius: var(--radius); }
.fn-pname { font-weight: 600; flex: 0 0 auto; min-width: 8rem; }
.fn-mini { flex: 1 1 60px; display: flex; gap: 2px; height: 14px; border-radius: 4px;
  overflow: hidden; min-width: 60px; }
.fn-mini .seg { display: block; }
.fn-mini .seg.g { background: var(--up); }
.fn-mini .seg.a { background: var(--series-2); }
.fn-mini .seg.n { background: var(--surface-2); }
.fn-caret { flex: 0 0 auto; width: 0; height: 0; border-left: 5px solid transparent;
  border-right: 5px solid transparent; border-top: 6px solid var(--text-muted); transition: transform .15s; }
.fn-item[open] .fn-caret { transform: rotate(180deg); }
.fn-open { padding: 2px 12px 14px; }
.fn-advice { font-size: var(--t-md); color: var(--text-secondary); margin: 6px 0 0; max-width: none; }
.fn-low { margin-top: 10px; }
.chip { font-size: var(--t-xs); padding: 2px 10px; border-radius: 999px; white-space: nowrap; }
.chip.fn-ok { background: var(--up-soft); color: var(--up); }
.chip.fn-warn { background: var(--warn-soft); color: var(--series-2); }
.chip.fn-bad { background: var(--down-soft); color: var(--down); }
.chip.fn-none { background: var(--surface-2); color: var(--text-muted); }

/* Apply a fix to Shopify (SEO tab) */
.modal-apply { border-top: 1px solid var(--line); margin-top: 14px; padding-top: 12px;
  display: grid; gap: 10px; }
.modal-apply-head { font-weight: 600; margin: 0; }
.apply-row { background: var(--surface-2); border-radius: var(--radius); padding: 10px 12px; }
.apply-field { font-weight: 600; margin: 0 0 4px; }
.apply-vals { margin: 0 0 4px; font-size: var(--t-sm); word-break: break-word; max-width: none; }
.apply-row form { margin-top: 6px; }
.applied-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.applied-row { display: flex; align-items: center; justify-content: space-between; gap: 10px;
  border: 1px solid var(--line); border-radius: var(--radius); padding: 8px 12px; font-size: var(--t-sm); }
.applied-all { margin: 12px 0 0; font-size: var(--t-sm); }

/* The dedicated change log: every applied fix, before and after, with filters. */
.back-link { margin: 0 0 16px; font-size: var(--t-sm); font-weight: 500;
  display: inline-flex; align-items: center; gap: 4px; }

/* Filter toolbar: a contained control bar, not loose controls on the page. */
.chg-filters { display: flex; flex-wrap: wrap; gap: 16px; align-items: flex-end;
  margin: 0 0 20px; padding: 16px 18px; background: var(--surface-1);
  border: 1px solid var(--line); border-radius: var(--radius-lg);
  box-shadow: var(--shadow); }
.chg-filters label { display: grid; gap: 7px; font-size: var(--t-xs);
  font-weight: 700; letter-spacing: .05em; text-transform: uppercase;
  color: var(--text-muted); }
.chg-filters select, .chg-filters input { height: 42px; padding: 0 13px;
  border: 1px solid var(--line); border-radius: 10px; background: var(--surface-0);
  font-size: var(--t-sm); font-weight: 500; color: var(--text-primary);
  transition: border-color .15s ease, box-shadow .15s ease, background .15s ease; }
.chg-filters select { appearance: none; -webkit-appearance: none;
  padding-right: 36px; cursor: pointer; min-width: 10rem;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%238a8a86' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 13px center; }
.chg-filters input { min-width: 14rem; }
.chg-filters input::placeholder { color: var(--text-muted); }
.chg-filters select:hover, .chg-filters input:hover {
  border-color: color-mix(in srgb, var(--series-1) 40%, var(--line));
  background: var(--surface-1); }
.chg-filters select:focus, .chg-filters input:focus { outline: none;
  border-color: var(--series-1); background: var(--surface-1);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--series-1) 20%, transparent); }
.chg-filters .btn { height: 42px; padding-inline: 20px; }
.chg-clear { align-self: center; font-size: var(--t-sm); font-weight: 500;
  color: var(--text-muted); }
.chg-clear:hover { color: var(--series-1); }

.chg-count { margin: 0 0 12px; font-size: var(--t-sm); font-weight: 500; }
.chg-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; }
.chg-item { border: 1px solid var(--line); border-radius: var(--radius-lg);
  padding: 16px 18px; display: grid; gap: 12px; background: var(--surface-1);
  box-shadow: var(--shadow);
  transition: box-shadow .16s ease, border-color .16s ease,
              transform .16s ease, background .16s ease; }
.chg-item:hover { border-color: var(--series-1);
  background: color-mix(in srgb, var(--series-1) 4%, var(--surface-1));
  box-shadow: 0 12px 30px rgb(20 20 20 / 16%); transform: translateY(-2px); }
.chg-item.chg-undone { opacity: 0.68; box-shadow: none; }
.chg-item.chg-undone:hover { border-color: var(--line); background: var(--surface-1);
  transform: none; box-shadow: var(--shadow); }
@media (prefers-reduced-motion: reduce) { .chg-item { transition: none; }
  .chg-item:hover { transform: none; } }
.chg-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.chg-name { margin: 0; font-weight: 600; font-size: var(--t-md);
  color: var(--text-primary); line-height: 1.3; }
.chg-kind { margin: 7px 0 0; display: inline-block; font-size: var(--t-xs);
  font-weight: 600; color: var(--text-secondary); background: var(--surface-2);
  border: 1px solid var(--line); border-radius: 999px; padding: 3px 11px; }
.chg-diff { display: grid; grid-template-columns: 1fr auto 1fr; gap: 12px;
  align-items: stretch; }
.chg-arrow { align-self: center; color: var(--text-muted); font-size: 1.15rem;
  line-height: 1; }
.chg-side { border: 1px solid var(--line); border-radius: 12px;
  padding: 11px 13px; background: var(--surface-2); font-size: var(--t-sm);
  display: grid; gap: 5px; min-width: 0; align-content: start; }
.chg-after { background: var(--up-soft);
  border-color: color-mix(in srgb, var(--up) 35%, transparent); }
.chg-after .chg-val { color: color-mix(in srgb, var(--up) 75%, var(--text-primary));
  font-weight: 500; }
.chg-tag { font-size: 10px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .07em; color: var(--text-muted); }
.chg-after .chg-tag { color: color-mix(in srgb, var(--up) 65%, var(--text-muted)); }
.chg-val { overflow-wrap: anywhere; line-height: 1.45; }
.chg-undone .chg-after { background: var(--surface-2); border-color: var(--line); }
.chg-undone .chg-after .chg-val { color: var(--text-muted); text-decoration: line-through; }
.chg-meta { margin: 2px 0 0; padding-top: 11px; border-top: 1px solid var(--line);
  font-size: var(--t-xs); color: var(--text-secondary); display: flex;
  flex-wrap: wrap; gap: 8px; align-items: center; }
@media (max-width: 40rem) { .chg-diff { grid-template-columns: 1fr; }
  .chg-arrow { transform: rotate(90deg); justify-self: center; } }

.geo-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 7px; }
.geo-row { display: grid; grid-template-columns: minmax(7rem, 11rem) 1fr; gap: 6px 12px;
  align-items: center; }
.geo-name { font-weight: 600; }
.geo-track { background: var(--surface-2); border-radius: 5px; height: 16px; overflow: hidden; }
.geo-bar { display: block; height: 100%; width: var(--w); min-width: 3px; border-radius: 5px; }
.geo-h0 { background: var(--surface-2); }
.geo-h1 { background: color-mix(in srgb, var(--series-1) 28%, transparent); }
.geo-h2 { background: color-mix(in srgb, var(--series-1) 50%, transparent); }
.geo-h3 { background: color-mix(in srgb, var(--series-1) 72%, transparent); }
.geo-h4 { background: var(--series-1); }
.geo-nums { grid-column: 2; color: var(--text-secondary); font-size: var(--t-sm); }

/* The popup: shown when its id is the URL's #target, so it opens without
   JavaScript. */
.modal { display: none; position: fixed; inset: 0; z-index: 100; padding: 24px 16px;
         overflow-y: auto; }
.modal:target { display: grid; place-items: start center; }
.modal-backdrop { position: fixed; inset: 0; background: rgb(15 23 42 / 55%); }
.modal-box { position: relative; width: min(40rem, 100%); margin-top: 4vh;
             background: var(--surface-1); border: 1px solid var(--line);
             border-radius: var(--radius-lg); padding: 22px 24px;
             box-shadow: 0 20px 50px rgb(15 23 42 / 25%); }
.modal-head { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.modal-head h3 { margin: 0; font-size: var(--t-lg); }
.modal-close { font-size: 1.6rem; line-height: 1; text-decoration: none; color: var(--text-muted);
               padding: 0 6px; border-radius: 6px; }
.modal-close:hover { background: var(--surface-2); color: var(--text-primary); }
.modal-where { font-size: var(--t-sm); margin: 6px 0 14px; }
.modal-examples { display: grid; gap: 10px; margin-bottom: 14px; }
.copy-block { border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 12px;
              background: var(--brand-soft); }
.copy-head { display: flex; gap: 10px; align-items: center; font-size: var(--t-sm); }
.copy-head button { margin-left: auto; }
.copy-text { margin: 6px 0 0; font-size: var(--t-md); max-width: none; }
.modal-steps { margin: 0 0 12px; padding-left: 1.3rem; display: grid; gap: 6px; }
.modal-steps li { max-width: none; }
.modal-tip { font-size: var(--t-sm); color: var(--text-secondary); background: var(--surface-0);
             border-radius: 8px; padding: 8px 12px; }
@media print { .modal { display: none !important; } }
/* Positioned, so the screen-reader-only labels inside a table (absolute)
   stay in its scroll box instead of widening the page on a phone. */
.table-wrap { position: relative; }
.seo-yes { color: var(--up); font-weight: 700; }
.seo-no { color: var(--down); font-weight: 700; }

/* SEO: the first check, and "last checked". */
.seo-start { background: var(--surface-1); border: 1px solid var(--line);
             border-top: 4px solid var(--series-1); border-radius: var(--radius-lg);
             padding: 28px; margin: 0 0 20px; box-shadow: var(--shadow); }
.seo-start h2 { margin-top: 0; }
.seo-start p { max-width: 62ch; }
.seo-checked { display: flex; gap: 12px 20px; align-items: center; justify-content: space-between;
               flex-wrap: wrap; background: var(--surface-1); border: 1px solid var(--line);
               border-radius: var(--radius); padding: 12px 18px; margin: 0 0 16px; }
.seo-checked p { margin: 0; color: var(--text-secondary); }
.seo-check-form { margin: 0; }

/* The SEO tab's search area (product/search.py): the Search Console strip. */
.gsc-strip { margin-bottom: var(--s-3); }
.gsc-strip .seo-stat p .seo-yes { color: var(--up); font-weight: 600; }
.gsc-strip .seo-stat p .seo-no { color: var(--down); font-weight: 600; }
.seo-table td .muted { font-size: var(--t-xs); }

/* =======================================================================
 * THE OVERVIEW DASHBOARD (dashboard.html, product/overview.py)
 * ===================================================================== */

/* Categorical slots for donut slices (validated palette, light and dark
   selected separately). Slices always carry a visible label and share,
   because three light-mode slots sit under 3:1 on white. */
:root { --cat-1: #2a78d6; --cat-2: #eb6834; --cat-3: #1baf7a; --cat-4: #eda100;
        --cat-5: #e87ba4; --cat-other: #a3a9b5; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) { --cat-1: #3987e5; --cat-2: #d95926; --cat-3: #199e70;
                                    --cat-4: #c98500; --cat-5: #d55181; --cat-other: #5b6578; }
}
:root[data-theme="dark"] { --cat-1: #3987e5; --cat-2: #d95926; --cat-3: #199e70;
                           --cat-4: #c98500; --cat-5: #d55181; --cat-other: #5b6578; }

.page-header .dash-periods { display: flex; gap: 6px; flex-wrap: wrap; }
.dash-periods .tag { text-decoration: none; padding: 5px 12px; }
.dash-periods .tag:hover { background: var(--brand-soft); color: var(--series-1); }

.dash-strip { display: flex; gap: 12px 24px; align-items: center; justify-content: space-between;
              flex-wrap: wrap; padding: 14px 20px; }
.dash-strip h2 { margin: 0 0 4px; }
.dash-strip ul, .dash-strip p { margin: 0; }

.dash-grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 16px;
             margin: 12px 0 20px; }
.dash-grid > .span-12 { grid-column: span 12; }
.dash-grid > .span-8 { grid-column: span 8; }
.dash-grid > .span-7 { grid-column: span 7; }
.dash-grid > .span-6 { grid-column: span 6; }
.dash-grid > .span-5 { grid-column: span 5; }
.dash-grid > .span-4 { grid-column: span 4; }
@media (max-width: 1020px) {
  .dash-grid > .span-4, .dash-grid > .span-5, .dash-grid > .span-7 { grid-column: span 6; }
  .dash-grid > .span-8 { grid-column: span 12; }
}
@media (max-width: 720px) {
  .dash-grid > [class*="span-"] { grid-column: span 12; }
}

/* A tile: the heading's link stretches over the whole card, so the card is
   one click; links, buttons and forms inside sit above the stretch. */
.dash-tile { position: relative; background: var(--surface-1); border: 1px solid var(--line);
             border-radius: var(--radius-lg); padding: 18px 20px; box-shadow: var(--shadow);
             min-width: 0; transition: border-color .12s, box-shadow .12s; }
.dash-tile:has(.dash-link):hover { border-color: var(--series-1); box-shadow: var(--shadow-hover); }
.dash-tile-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px;
                  margin-bottom: 12px; }
.dash-tile-head h2 { margin: 0; font-size: 1rem; }
.dash-link { color: var(--text-primary); text-decoration: none; }
.dash-link::after { content: ""; position: absolute; inset: 0; border-radius: inherit; }
.dash-link:focus-visible { outline: none; }
.dash-tile:has(.dash-link:focus-visible) { outline: 2px solid var(--series-1); outline-offset: 2px; }
.dash-more { color: var(--text-muted); }
.dash-tile:hover .dash-more { color: var(--series-1); }
.dash-tile a:not(.dash-link), .dash-tile button, .dash-tile form,
.dash-tile details, .dash-tile .chart { position: relative; z-index: 1; }
.dash-tile .chart { margin: 0; }
.dash-empty { color: var(--text-secondary); margin: 0 0 8px; max-width: none; }
.dash-sub { margin: 4px 0 8px; font-size: var(--t-sm); max-width: none; }
.dash-big { font-size: var(--t-2xl); font-weight: 750; margin: 0; line-height: 1.2;
            font-variant-numeric: tabular-nums; }
.dash-big small { font-size: var(--t-sm); font-weight: 600; }
.dash-summary { font-weight: 600; margin: 6px 0 8px; max-width: none; }
.dash-actions { margin-top: 10px; }
.dash-actions form { display: inline; }
.dash-waterfall .hb-row { grid-template-columns: minmax(8rem, 15rem) 1fr 6rem; font-size: var(--t-sm); }

/* The number cards. */
.dash-kpis { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(10.5rem, 1fr)); }
.dash-kpi { display: flex; flex-direction: column; gap: 2px; background: var(--surface-1);
            border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px;
            box-shadow: var(--shadow); text-decoration: none; color: inherit;
            transition: border-color .12s, box-shadow .12s; }
.dash-kpi:hover { border-color: var(--series-1); box-shadow: var(--shadow-hover); color: inherit; }
.dash-kpi-label { color: var(--text-muted); font-size: var(--t-sm); }
.dash-kpi-value { font-size: var(--t-xl); font-weight: 750; color: var(--text-primary);
                  font-variant-numeric: tabular-nums; }
.dash-kpi-change { font-size: var(--t-xs); font-weight: 600; }
.kpi-good .dash-kpi-change { color: var(--up); }
.kpi-bad .dash-kpi-change { color: var(--down); }
.kpi-same .dash-kpi-change { color: var(--text-secondary); }
.dash-kpi-change .muted { font-weight: 400; }
.dash-kpi .mini-trend { width: 100%; height: 28px; margin-top: 6px; }

/* Donut and its legend. */
.donut-body { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; }
.donut svg { width: 128px; height: 128px; flex: none; }
.donut-track { stroke: var(--surface-2); }
.donut-slice { transition: opacity .12s; }
.donut svg:hover .donut-slice { opacity: .55; }
.donut svg .donut-slice:hover { opacity: 1; }
.donut-center { text-anchor: middle; dominant-baseline: middle; font-size: 15px; font-weight: 700;
                fill: var(--text-primary); }
.donut-center-sub { text-anchor: middle; font-size: 8px; fill: var(--text-muted); }
.donut-legend { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; flex: 1 1 9rem;
                font-size: var(--t-sm); min-width: 0; }
.donut-legend li { display: grid; grid-template-columns: 10px 1fr auto; gap: 2px 8px;
                   align-items: center; max-width: none; }
.dl-swatch { width: 10px; height: 10px; border-radius: 3px; }
.dl-label { color: var(--text-primary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dl-share { font-weight: 700; font-variant-numeric: tabular-nums; }
.dl-text { grid-column: 2 / 4; color: var(--text-muted); font-size: var(--t-xs); }

/* Ranked bars (top products). */
.bar-list .hb-row { grid-template-columns: minmax(6rem, 13rem) 1fr 5.5rem; }
.bar-list .hb-track { height: 1.1rem; }
.bl-bar { background: var(--series-1); }
.bl-bar.bl-down { background: var(--series-1); opacity: .55; }

/* Stacked bars (SEO per area). */
.stacked-bars { display: grid; gap: 8px; }
.sb-row { display: grid; grid-template-columns: minmax(6rem, 9rem) 1fr auto; gap: 10px;
          align-items: center; font-size: var(--t-sm); }
.sb-label { color: var(--text-secondary); }
.sb-track { display: flex; gap: 2px; height: 12px; border-radius: 4px; overflow: hidden;
            background: var(--surface-2); }
.sb-seg { display: block; height: 100%; }
.sb-fix { background: var(--down); }
.sb-improve { background: var(--series-2); }
.sb-ok { background: var(--up); }
.sb-text { color: var(--text-muted); font-size: var(--t-xs); white-space: nowrap; }

/* The buying steps. */
.funnel-bars { display: grid; gap: 8px; }
.fn-row { display: grid; grid-template-columns: minmax(7rem, 10rem) 1fr 7.5rem;
          gap: 10px; align-items: center; font-size: var(--t-sm); }
.fn-label { color: var(--text-secondary); }
.fn-track { height: 1.1rem; background: var(--surface-2); border-radius: 4px; }
.fn-bar { display: block; height: 100%; border-radius: 4px; background: var(--series-1); }
.fn-row:last-child .fn-bar { background: var(--up); }
.fn-value { font-variant-numeric: tabular-nums; font-size: var(--t-xs); color: var(--text-secondary);
            text-align: right; white-space: nowrap; }

/* Lists and status dots inside tiles. */
.dash-list { margin: 12px 0 0; padding-left: 1.2rem; display: grid; gap: 4px; font-size: var(--t-sm); }
.dash-list li { max-width: none; }
.dash-list .muted { display: block; font-size: var(--t-xs); }
.dash-status { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; font-size: var(--t-sm); }
.dash-status li { display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; max-width: none; }
.dash-status .muted { font-size: var(--t-xs); }
.dot { width: 9px; height: 9px; border-radius: 50%; flex: none; background: var(--line-strong);
       align-self: center; }
.dot-on, .dot-connected { background: var(--up); }
.dot-degraded, .dot-waiting, .dot-unfinished { background: var(--series-2); }
.dot-broken { background: var(--down); }
.dot-locked, .dot-off, .dot-absent { background: var(--line-strong); }

.dash-before-now { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; }
.dash-bn-title { margin: 0 0 4px; font-weight: 600; font-size: var(--t-sm); }
.dash-before-now .plain-bars { margin-top: 2px; }
@media (max-width: 560px) {
  .dash-kpis { grid-template-columns: 1fr 1fr; gap: 10px; }
  .dash-kpi { padding: 12px; }
  .dash-kpi-value { font-size: var(--t-lg); }
  .donut-legend { flex-basis: 100%; }
  .donut-body { justify-content: center; }
  .page-header .dash-periods { order: 2; }
}
@media (max-width: 560px) {
  .dash-waterfall .hb-row { grid-template-columns: 1fr 5.5rem; }
  .dash-waterfall .hb-track { grid-column: 1 / -1; order: 3; }
}

/* The "?" on each tile and card: what it means, in plain words. Shown on
   hover and on keyboard focus or a tap; it sits above the tile's link. */
.dash-tip { position: relative; z-index: 2; display: inline-grid; place-items: center;
            width: 18px; height: 18px; margin-left: 4px; padding: 0; vertical-align: 2px;
            border-radius: 50%; border: 1px solid var(--line-strong); background: var(--surface-1);
            color: var(--text-muted); font: 700 11px/1 inherit; cursor: help; }
.dash-tip:hover, .dash-tip:focus-visible { border-color: var(--series-1); color: var(--series-1); }
.dash-tip::after { content: attr(data-tip); position: absolute; left: 50%; top: calc(100% + 8px);
                   transform: translateX(-50%); width: max-content; max-width: min(16rem, 80vw);
                   padding: 8px 10px; border-radius: 8px; background: var(--text-primary);
                   color: var(--surface-1); font-size: var(--t-xs); font-weight: 500; line-height: 1.45;
                   text-align: left; white-space: normal; box-shadow: var(--shadow-hover);
                   display: none; pointer-events: none; z-index: 30; }
/* display, not visibility: a hidden bubble near the edge still widened the page on a phone. */
.dash-tip:hover::after, .dash-tip:focus::after { display: block; }
.dash-kpi { position: relative; }
.dash-kpi .dash-link { color: inherit; }
.dash-kpi:has(.dash-link:focus-visible) { outline: 2px solid var(--series-1); outline-offset: 2px; }
.dash-kpis .dash-kpi:first-child .dash-tip::after { left: 0; transform: none; }
/* When app.js is running it positions a single floating bubble instead, so it
   can measure the text and clamp it inside the viewport — the CSS ::after
   above can't do that and spills past a card or screen edge near the right or
   bottom. The pseudo-bubble stays as the no-JS fallback; JS hides it. */
.has-tip-js .dash-tip::after,
.has-tip-js .dash-tip:hover::after,
.has-tip-js .dash-tip:focus::after { display: none; content: none; }
.dash-pop { position: fixed; left: 0; top: 0; z-index: 60; visibility: hidden; opacity: 0;
            max-width: min(16rem, 80vw); padding: 8px 10px; border-radius: 8px;
            background: var(--text-primary); color: var(--surface-1);
            font-size: var(--t-xs); font-weight: 500; line-height: 1.45; text-align: left;
            white-space: normal; box-shadow: var(--shadow-hover); pointer-events: none;
            transition: opacity .12s ease; }
.dash-pop.on { visibility: visible; opacity: 1; }
@media (prefers-reduced-motion: reduce) { .dash-pop { transition: none; } }
.dash-tile-head h2 { display: flex; align-items: center; flex-wrap: wrap; gap: 2px; }

/* Latest reports inside "What changed". */
.dash-subhead { font-size: var(--t-sm); margin: 18px 0 8px; color: var(--text-secondary); }
.dash-reports { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.dash-reports li { max-width: none; }
.dash-reports a { display: grid; grid-template-columns: 1fr auto auto; gap: 2px 16px; align-items: center;
                  padding: 10px 14px; border: 1px solid var(--line); border-radius: var(--radius);
                  background: var(--surface-0); color: inherit; text-decoration: none;
                  transition: border-color .12s, background .12s; position: relative; z-index: 1; }
.dash-reports a:hover { border-color: var(--series-1); background: var(--surface-1); }
.dr-dates { font-weight: 600; font-size: var(--t-sm); }
.dr-sales { grid-column: 1; font-size: var(--t-xs); }
.dr-change { grid-row: 1 / 3; grid-column: 2; font-weight: 700; font-variant-numeric: tabular-nums; }
.dr-change small { font-weight: 600; }
.dr-open { grid-row: 1 / 3; grid-column: 3; color: var(--text-muted); }
.dash-reports a:hover .dr-open { color: var(--series-1); }

/* "Do this week". */
.todo-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px;
             grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr)); }
.todo-item { display: grid; grid-template-columns: auto 1fr; gap: 6px 12px; align-items: start;
             padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--radius);
             background: var(--surface-0); max-width: none;
             transition: border-color .12s, background .12s; }
.todo-item:hover { border-color: var(--series-1); background: var(--surface-1); }
.todo-n { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center;
          background: var(--brand-soft); color: var(--series-1); font-weight: 700; font-size: var(--t-sm); }
.todo-body { display: flex; flex-direction: column; gap: 4px; align-items: flex-start; min-width: 0; }
.todo-title { font-weight: 600; color: var(--text-primary); text-decoration: none; }
.todo-title:hover { color: var(--series-1); text-decoration: underline; }
.todo-why { font-size: var(--t-xs); }
.todo-done { grid-column: 2; margin: 2px 0 0; }

/* Small bars in the order tiles. */
.bl-bar.bl-warn { background: var(--series-2); }
.bl-bar.bl-good { background: var(--up); }

/* When orders come in: one hue, darker for more orders. */
.heat-wrap { overflow-x: auto; position: relative; }
.heatmap { width: 100%; border-collapse: separate; border-spacing: 3px; table-layout: fixed;
           font-size: var(--t-xs); }
.heatmap th { color: var(--text-muted); font-weight: 500; padding: 2px; text-align: center; border: 0; }
.heatmap th[scope="row"] { text-align: left; width: 3rem; }
.heatmap td { height: 26px; border-radius: 4px; padding: 0; border: 0;
              background: color-mix(in srgb, var(--series-1) calc(var(--heat) * 100%), var(--surface-2)); }
.heatmap tbody tr:hover { background: none; }
.heatmap td:hover { outline: 2px solid var(--text-primary); outline-offset: -1px; }

/* Running low. */
.dash-stock { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; font-size: var(--t-sm); }
.dash-stock li { display: flex; flex-direction: column; gap: 1px; max-width: none; }
.dash-stock .down, .dash-stock .stock-warn { font-weight: 700; }
.stock-warn { color: var(--series-2); }
.dash-stock .muted { font-size: var(--t-xs); }

/* The dates a tile covers, under its heading. */
.tile-period, .tile-note { margin: -6px 0 10px; font-size: var(--t-xs); color: var(--text-muted); }

/* Stock of your best sellers. */
.dash-stock li { display: grid; grid-template-columns: 1fr; gap: 3px; justify-items: start; }
.stock-name { font-weight: 600; min-width: 0; }
.stock-pill { font-size: var(--t-xs); font-weight: 700; padding: 2px 8px; border-radius: 999px;
              white-space: nowrap; background: var(--surface-2); color: var(--text-secondary); }
.stock-out .stock-pill { background: var(--down-soft); color: var(--down); }
.stock-low .stock-pill { background: var(--warn-soft); color: var(--series-2); }
.stock-ok .stock-pill { background: var(--up-soft); color: var(--up); }
.stock-detail { grid-column: 1 / -1; }
.tile-tip { font-size: var(--t-xs); margin-top: 6px !important; }

/* ---- the "working on it" card for slow forms (static/app.js) --------- */

.busy { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center;
        padding: 16px; background: rgb(15 18 40 / 38%);
        backdrop-filter: blur(3px); animation: busy-in .18s ease-out; }
body.is-busy { overflow: hidden; }
.busy-card { width: min(26rem, 100%); background: var(--surface-1);
             border: 1px solid var(--line); border-radius: 16px;
             box-shadow: 0 20px 50px rgb(15 18 40 / 25%);
             padding: 28px 24px 22px; text-align: center; }
.busy-title { font-size: 1.2rem; margin: 14px 0 16px; text-transform: none;
              letter-spacing: normal; color: var(--text-primary); }

/* Two rings turning against each other round a breathing dot. */
.busy-orb { position: relative; width: 64px; height: 64px; margin: 0 auto; }
.busy-orb span { position: absolute; inset: 0; border-radius: 50%;
                 border: 3px solid transparent; }
.busy-orb span:first-child { border-top-color: var(--series-1);
                             border-right-color: var(--series-1);
                             animation: busy-spin 1.1s linear infinite; }
.busy-orb span:nth-child(2) { inset: 9px; border-bottom-color: var(--cat-3);
                              border-left-color: var(--cat-3);
                              animation: busy-spin .8s linear infinite reverse; }
.busy-orb i { position: absolute; inset: 24px; border-radius: 50%;
              background: var(--series-1); animation: busy-breathe 1.4s ease-in-out infinite; }

.busy-steps { list-style: none; margin: 0 0 16px; padding: 0; text-align: left;
              display: grid; gap: 10px; }
.busy-steps li { display: flex; align-items: center; gap: 10px;
                 color: var(--text-muted); transition: color .3s; }
.busy-steps li.is-active { color: var(--text-primary); font-weight: 600; }
.busy-steps li.is-done { color: var(--text-secondary); }
.busy-mark { flex: none; width: 18px; height: 18px; border-radius: 50%;
             border: 2px solid var(--line); position: relative; transition: all .3s; }
.is-active .busy-mark { border-color: var(--brand-soft); border-top-color: var(--series-1);
                        animation: busy-spin .7s linear infinite; }
.is-done .busy-mark { border-color: var(--up); background: var(--up); }
.is-done .busy-mark::after { content: ""; position: absolute; left: 4px; top: 1px;
                             width: 5px; height: 9px; border: solid #fff;
                             border-width: 0 2px 2px 0; transform: rotate(45deg); }

.busy-bar { height: 6px; border-radius: 99px; background: var(--brand-soft);
            overflow: hidden; }
.busy-bar span { display: block; height: 100%; width: 0; border-radius: inherit;
                 background: linear-gradient(90deg, var(--series-1), var(--cat-3),
                                             var(--series-1));
                 background-size: 200% 100%; animation: busy-flow 1.6s linear infinite; }
.busy-note { margin: 12px 0 0; font-size: var(--t-sm); color: var(--text-muted); }

/* The pressed button, while the card is up (and after Back). */
button.is-loading, .btn.is-loading { position: relative; color: transparent !important; }
button.is-loading::after, .btn.is-loading::after {
  content: ""; position: absolute; inset: 0; margin: auto; width: 16px; height: 16px;
  border-radius: 50%; border: 2px solid var(--series-1); border-left-color: transparent;
  animation: busy-spin .7s linear infinite; }
button.primary.is-loading::after, .btn-primary.is-loading::after {
  border-color: #fff; border-left-color: transparent; }

@keyframes busy-spin { to { transform: rotate(360deg); } }
@keyframes busy-breathe { 50% { transform: scale(.55); opacity: .55; } }
@keyframes busy-flow { to { background-position: -200% 0; } }
@keyframes busy-in { from { opacity: 0; } }

@media (prefers-reduced-motion: reduce) {
  .busy, .busy *, .busy *::after, .is-loading::after { animation: none !important; }
}

/* ---- Data & connections: what Meta told us -------------------------- */
.meta-proof { background: var(--brand-soft); border-radius: var(--radius);
              padding: 14px 16px; margin: 12px 0; max-width: 40rem; }
.meta-proof-head { font-weight: 600; margin: 0 0 8px; }
.meta-proof dl { display: grid; gap: 4px 16px; margin: 0 0 10px;
                 grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr)); }
.meta-proof dt { font-size: var(--t-xs); color: var(--text-muted); }
.meta-proof dd { margin: 0; font-weight: 600; }
.meta-proof > p:last-child { margin: 0; color: var(--text-secondary); }

/* ---- Best days and times: one fact a line --------------------------- */
.hours-facts { margin: 4px 0 14px; display: grid; gap: 6px; }
.hours-facts > div { display: grid; grid-template-columns: 8.5rem 1fr; gap: 12px;
                     align-items: baseline; }
.hours-facts dt { font-size: var(--t-sm); color: var(--text-muted); }
.hours-facts dd { margin: 0; }
@media (max-width: 480px) {
  .hours-facts > div { grid-template-columns: 1fr; gap: 0; }
}

/* ---- the Ad plan, version 2: three ready campaigns ------------------- */
.ap { display: grid; gap: 22px; }
.ap h2 { margin: 0; }
.ap-top { display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: center; justify-content: space-between; }
.ap-top p { margin: 0; max-width: 46rem; }
.ap-status { display: inline-flex; gap: 8px; align-items: center; font-weight: 600; font-size: var(--t-sm);
             padding: 7px 12px; border-radius: 999px; }
.ap-status::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.tone-good { background: var(--up-soft); color: var(--up); }
.tone-warn { background: var(--warn-soft); color: var(--text-primary); }
.tone-bad { background: var(--down-soft); color: var(--down); }
.ap-ready { margin: 0; display: grid; gap: 12px; }
.ap-checks { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px;
             grid-template-columns: repeat(auto-fit, minmax(min(16rem, 100%), 1fr)); }
.ap-check { display: grid; grid-template-columns: 24px minmax(0, 1fr); gap: 10px; font-size: var(--t-sm); }
.ap-check small { display: block; color: var(--text-secondary); margin-top: 2px; }
.ap-tick { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: 0.78rem; }
.state-ok .ap-tick { background: var(--up-soft); color: var(--up); }
.state-fix .ap-tick { background: var(--down-soft); color: var(--down); }
.state-tip .ap-tick { background: var(--brand-soft); color: var(--series-1); }
.ap-picker { display: grid; gap: 12px; }
.ap-picker-head p { margin: 4px 0 0; }
.ap-tabs { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(min(15rem, 100%), 1fr)); }
.ap-tab { display: grid; gap: 4px; padding: 12px 14px; border-radius: var(--radius); background: var(--surface-1);
          border: 1px solid var(--line); color: var(--text-primary); text-decoration: none; }
.ap-tab:hover, .ap-tab:focus-visible { border-color: var(--series-1); color: var(--text-primary); }
.ap-tab[aria-selected="true"] { border-color: var(--series-1); box-shadow: inset 0 0 0 1px var(--series-1); }
.ap-tab b { font-size: 1rem; }
.ap-tab-meta { font-size: var(--t-xs); color: var(--text-muted); }
.ap-kind { justify-self: start; font-size: var(--t-xs); font-weight: 600; letter-spacing: 0.04em;
           text-transform: uppercase; padding: 3px 7px; border-radius: 6px;
           background: var(--brand-soft); color: var(--series-1); }
.kind-grow, .kind-pack { background: var(--up-soft); color: var(--up); }
.kind-stock, .kind-winback { background: var(--warn-soft); color: var(--text-primary); }
.ap-campaign { margin: 0; padding: 0; overflow: hidden; }
.ap-campaign-head { padding: 16px 18px; border-bottom: 1px solid var(--line); display: grid; gap: 4px; }
.ap-campaign-head h3 { margin: 0; font-size: 1.2rem; }
.ap-campaign-head p { margin: 0; }
.ap-campaign-body { display: grid; grid-template-columns: minmax(0, 1fr) 280px; }
@media (max-width: 820px) { .ap-campaign-body { grid-template-columns: 1fr; } }
.ap-levels { min-width: 0; }
.ap-level { padding: 14px 18px; border-bottom: 1px solid var(--line); display: grid; gap: 8px; }
.ap-level-name { font-size: var(--t-xs); font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase;
                 color: var(--text-muted); }
.ap-fields { margin: 0; display: grid; gap: 6px; }
.ap-fields > div { display: grid; grid-template-columns: 8rem minmax(0, 1fr); gap: 10px; font-size: var(--t-sm); }
@media (max-width: 480px) { .ap-fields > div { grid-template-columns: 1fr; gap: 0; } }
.ap-fields dt { color: var(--text-muted); }
.ap-fields dd { margin: 0; font-weight: 500; overflow-wrap: anywhere; }
.ap-why { font-size: var(--t-sm); color: var(--text-secondary); }
.ap-why summary { cursor: pointer; color: var(--series-1); font-weight: 600; width: max-content; max-width: 100%; }
.ap-why p { margin: 6px 0 0; padding: 8px 10px; border-radius: var(--radius-sm, 8px); background: var(--surface-0); }
.ap-actions { padding: 14px 18px 0; }
.ap-points { position: relative; margin: 14px 18px 18px; padding: 12px 14px; border-radius: var(--radius); background: var(--surface-0);
             display: grid; gap: 8px; font-size: var(--t-sm); }
.ap-points p { margin: 0; }
.ap-ideas { font-size: var(--t-xs); }
.ap-point-inputs { display: grid; gap: 8px; grid-template-columns: repeat(3, minmax(0, 1fr)) auto; }
@media (max-width: 640px) { .ap-point-inputs { grid-template-columns: 1fr; } }
.ap-point-inputs input { min-width: 0; padding: 9px 10px; border-radius: 8px; font: inherit;
                         border: 1px solid var(--line); background: var(--surface-1);
                         color: var(--text-primary); }
.ap-preview { border-left: 1px solid var(--line); padding: 16px; display: grid; gap: 10px; align-content: start;
              justify-items: center; background: var(--surface-0); }
@media (max-width: 820px) { .ap-preview { border-left: 0; border-top: 1px solid var(--line); } }
.ap-preview-note { font-size: var(--t-xs); text-align: center; margin: 0; }
.ap-phone { width: 240px; max-width: 100%; border-radius: 26px; border: 7px solid var(--text-primary);
            background: var(--surface-1); overflow: hidden; }
.ap-ig-head { display: flex; gap: 8px; align-items: center; padding: 8px 10px; font-size: 0.72rem; }
.ap-ig-head b { display: block; color: var(--text-primary); }
.ap-ig-head span { color: var(--text-muted); }
.ap-av { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; flex: none;
         background: var(--brand-solid, var(--series-1)); color: #fff; font-weight: 700; font-size: 0.7rem; }
.ap-media { position: relative; background: var(--surface-2, var(--surface-0)); overflow: hidden; }
.ap-reel { aspect-ratio: 4 / 5; }
.ap-photo { aspect-ratio: 1 / 1; }
.ap-media > img, .ap-two img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ap-two { display: grid; grid-template-columns: 1fr 1fr; height: 100%; gap: 2px; }
.ap-noimg { width: 100%; height: 100%; min-height: 90px; display: grid; place-items: center; text-align: center;
            padding: 8px; font-size: 0.72rem; color: var(--text-muted);
            background: repeating-linear-gradient(45deg, var(--surface-0) 0 8px, var(--surface-1) 8px 16px); }
.ap-overlay { position: absolute; left: 8px; right: 8px; top: 10px; text-align: center; font-weight: 800;
              font-size: 0.82rem; line-height: 1.2; color: #fff; text-shadow: 0 1px 6px rgb(0 0 0 / 55%); }
.ap-price { position: absolute; right: 8px; bottom: 8px; background: #12142b; color: #fff; font-weight: 700;
            font-size: 0.74rem; padding: 4px 7px; border-radius: 6px; }
.ap-carousel { display: grid; grid-template-columns: 1fr 1fr 0.35fr; gap: 6px; padding-left: 10px; overflow: hidden; }
.ap-card { border: 1px solid var(--line); border-radius: 8px; overflow: hidden; display: grid;
           grid-template-rows: auto 1fr; font-size: 0.62rem; color: var(--text-secondary); min-width: 0; }
.ap-card img, .ap-card .ap-noimg { aspect-ratio: 1 / 1; width: 100%; object-fit: cover; min-height: 0; }
.ap-card > span:last-child { padding: 4px 6px; overflow-wrap: anywhere; }
.ap-peek { border-right: 0; border-radius: 8px 0 0 8px; }
.ap-peek > span:last-child { display: none; }
.ap-cta { display: flex; justify-content: space-between; padding: 8px 10px; font-size: 0.72rem; font-weight: 600;
          background: var(--brand-soft); color: var(--series-1); }
.ap-ig-text { margin: 0; padding: 8px 10px 12px; font-size: 0.72rem; line-height: 1.45; color: var(--text-secondary);
              overflow-wrap: anywhere; }
.ap-ig-text b { color: var(--text-primary); }
.ap-proved, .ap-after { display: grid; gap: 12px; }
.ap-findings { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(min(16rem, 100%), 1fr)); }
.ap-finding { margin: 0; display: grid; gap: 6px; align-content: start; }
.ap-finding p { margin: 0; font-size: var(--t-sm); color: var(--text-secondary); }
.ap-stat { font-weight: 800; font-size: 1.25rem; color: var(--series-1); }
.ap-small { font-size: var(--t-xs); margin: 0; }
.ap-empty { margin: 0; color: var(--text-secondary); }
.ap-tracker { margin: 0; display: grid; gap: 10px; }
.tracker-chart { width: 100%; height: auto; max-width: 100%; }
.tr-bar { fill: var(--brand-soft); }
.tr-line { fill: none; stroke: var(--series-1); stroke-width: 2.5; }
.tr-dot { fill: var(--series-1); }
.tr-zero { stroke: var(--line); }
.tr-text text { fill: var(--text-muted); font-size: 11px; }
.ap-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: var(--t-xs); color: var(--text-secondary); }
.ap-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 6px; vertical-align: -1px; }
.lg-bar { background: var(--brand-soft); }
.lg-line { background: var(--series-1); }
.ap-verdict { margin: 0; font-weight: 600; padding: 10px 12px; border-radius: var(--radius); }

.ap-tagged { width: 100%; border-collapse: collapse; font-size: var(--t-sm); }
.ap-tagged caption { text-align: left; font-weight: 600; padding-bottom: 6px; }
.ap-tagged th, .ap-tagged td { text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--line); }
.ap-tagged .num { font-variant-numeric: tabular-nums; }

/* ---- ways to sell more (Overview tiles, Insights section) ------------ */
.sm-note { margin: 8px 0 0; padding: 8px 10px; border-radius: var(--radius); font-size: var(--t-sm); }
.sm-pages { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 12px; }
.sm-item { display: flex; gap: 12px; align-items: flex-start; }
.sm-thumb { position: relative; flex: none; width: 44px; height: 44px; border-radius: 10px;
            overflow: hidden; background: var(--brand-soft); color: var(--series-1);
            display: grid; place-items: center; font-weight: 700; }
.sm-thumb img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.sm-body { flex: 1; min-width: 0; display: grid; gap: 4px; font-size: var(--t-sm); }
.sm-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sm-stat { color: var(--text-secondary); }
.sm-stat strong { color: var(--down); }
.sm-usual { color: var(--text-muted); }
.sm-meter { position: relative; height: 6px; border-radius: 99px; background: var(--surface-0);
            border: 1px solid var(--line); max-width: 22rem; }
.sm-meter i { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 99px; background: var(--down); }
.sm-meter em { position: absolute; top: -4px; bottom: -4px; width: 2px; margin-left: -1px;
               background: var(--text-primary); border-radius: 1px; }
.sm-reason { color: var(--text-primary); padding: 4px 8px; border-radius: 6px; background: var(--warn-soft);
             justify-self: start; }
.sm-pages-full > .sm-item { padding: 12px 0; border-bottom: 1px solid var(--line); }
.sm-pages-full > .sm-item:last-child { border-bottom: 0; }
.sm-pages-full .sm-name { white-space: normal; overflow-wrap: anywhere; }
.sm-reasons { margin: 2px 0; padding-left: 1.1rem; display: grid; gap: 2px; }
.sm-fix { color: var(--text-primary); }
.sm-edit { justify-self: start; }
.sell-more { display: grid; gap: 16px; }
.sm-block { margin: 0; display: grid; gap: 10px; }
.sm-block h3 { margin: 0; }
.sm-block p { margin: 0; }
.sm-headline { font-size: var(--t-md, 1rem); }
.sm-facts, .sm-steps { margin: 0; padding-left: 1.2rem; display: grid; gap: 6px; font-size: var(--t-sm); }
.sm-small { font-size: var(--t-xs); }
.sm-buckets { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 8px;
              align-items: end; height: 150px; padding-top: 4px; }
.sm-bucket { display: grid; grid-template-rows: 1fr auto auto; justify-items: center; height: 100%;
             gap: 2px; min-width: 0; }
.sm-bar { align-self: end; width: 70%; min-height: 2px; border-radius: 4px 4px 0 0; background: var(--brand-soft); }
.sm-bucket.near .sm-bar { background: var(--series-1); }
.sm-n { font-size: var(--t-xs); font-variant-numeric: tabular-nums; }
.sm-l { font-size: var(--t-xs); color: var(--text-muted); text-align: center; overflow-wrap: anywhere; }

/* How it works (/how-it-works) */
.hiw-hero { padding: var(--s-7) 0 var(--s-6); max-width: 46rem; }
.hiw-eyebrow { display: inline-block; font-size: var(--t-sm); font-weight: 600; color: var(--series-1);
               background: var(--brand-soft); padding: 4px 12px; border-radius: 999px; }
.hiw-hero h1 { font-size: var(--t-3xl); line-height: 1.1; letter-spacing: -0.02em; margin: 16px 0 14px; }
.hiw-hero .lead { font-size: var(--t-lg); max-width: 40rem; }
.hiw-cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 22px; }
.hiw-section { padding: var(--s-7) 0 0; }
.hiw-section > h2, .hiw-end h2 { font-size: var(--t-xl); margin: 0 0 6px; text-transform: none;
  letter-spacing: -0.01em; color: var(--text-primary); }
.hiw-lead { color: var(--text-secondary); margin: 0 0 20px; }
.hiw-steps { list-style: none; margin: 18px 0 0; padding: 0; display: grid; gap: 16px;
             grid-template-columns: repeat(auto-fit, minmax(min(100%, 16rem), 1fr)); }
.hiw-step { background: var(--surface-1); border: 1px solid var(--line); border-radius: var(--radius-lg);
            box-shadow: var(--shadow); padding: 24px; }
.hiw-step-n { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 10px;
              background: var(--series-1); color: #fff; font-weight: 700; margin-bottom: 14px; }
.hiw-step h3 { margin: 0 0 8px; font-size: var(--t-lg); }
.hiw-step p { margin: 0; color: var(--text-secondary); line-height: 1.55; }
.hiw-step p + p { margin-top: 10px; }
.hiw-small { font-size: var(--t-sm); color: var(--text-muted) !important; }
.hiw-tabs { display: grid; gap: 14px; }
@media (min-width: 760px) {
  .hiw-tabs { grid-template-columns: repeat(3, 1fr); }
  /* Seven tabs: the last one takes the whole row rather than sitting alone. */
  .hiw-tab:last-child:nth-child(3n+1) { grid-column: 1 / -1; }
}
.hiw-tab { background: var(--surface-1); border: 1px solid var(--line); border-radius: var(--radius-lg);
           padding: 20px; display: grid; align-content: start; gap: 6px; }
.hiw-tab-name { justify-self: start; font-size: var(--t-xs); font-weight: 700; letter-spacing: 0.03em;
                text-transform: uppercase; color: var(--series-1); }
.hiw-tab h3 { margin: 0; font-size: var(--t-md); }
.hiw-tab p { margin: 0; font-size: var(--t-sm); color: var(--text-secondary); line-height: 1.55; }
.hiw-promises { list-style: none; margin: 18px 0 0; padding: 0; display: grid; gap: 12px; }
@media (min-width: 720px) { .hiw-promises { grid-template-columns: 1fr 1fr; } }
.hiw-promises li { position: relative; padding: 18px 18px 18px 52px; border-radius: var(--radius-lg);
                   background: var(--up-soft); color: var(--text-secondary); line-height: 1.55; }
.hiw-promises li::before { content: "✓"; position: absolute; left: 18px; top: 17px; width: 22px; height: 22px;
  display: grid; place-items: center; border-radius: 50%; background: var(--up); color: #fff;
  font-size: 0.75rem; font-weight: 700; }
.hiw-promises b { color: var(--text-primary); }
.hiw-end { margin: var(--s-7) 0 var(--s-6); padding: 36px; border-radius: var(--radius-lg);
           background: var(--brand-soft); text-align: center; }
.hiw-end p { color: var(--text-secondary); margin: 0; }
.hiw-end .hiw-cta { justify-content: center; }
@media (max-width: 640px) {
  .hiw-hero { padding-top: var(--s-5); }
  .hiw-hero h1 { font-size: var(--t-2xl); }
  .hiw-end { padding: 28px 18px; }
}

/* Which option buyers pick (Overview tile and Insights) */
.op-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px;
           grid-template-columns: repeat(auto-fit, minmax(min(100%, 17rem), 1fr)); }
.op-list-full { grid-template-columns: 1fr; gap: 0; }
.op-item { display: grid; gap: 10px; align-content: start; min-width: 0; padding: 14px;
           border: 1px solid var(--line); border-radius: 12px; background: var(--surface-1); }
.op-list-full > .op-item { border: 0; border-bottom: 1px solid var(--line); border-radius: 0;
                           padding: 14px 0; background: none; }
.op-list-full > .op-item:last-child { border-bottom: 0; }
.op-list:not(.op-list-full) > .op-act { border-color: var(--series-1); }
.op-head { display: flex; gap: 12px; align-items: flex-start; min-width: 0; }
.op-bars { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.op-bars li { display: grid; grid-template-columns: minmax(0, 1fr) minmax(3rem, 1.2fr) 2.6rem;
              gap: 10px; align-items: center; font-size: var(--t-sm); }
.op-list-full .op-bars { max-width: 40rem; }
.op-name { min-width: 0; overflow-wrap: anywhere; color: var(--text-secondary); }
.op-top .op-name { color: var(--text-primary); font-weight: 600; }
.op-track { height: 8px; border-radius: 4px; background: var(--surface-2); overflow: hidden; }
.op-track i { display: block; height: 100%; border-radius: 4px; background: var(--line-strong); }
.op-top .op-track i { background: var(--series-1); }
.op-pct { text-align: right; font-variant-numeric: tabular-nums; color: var(--text-secondary); }
.op-top .op-pct { color: var(--text-primary); font-weight: 600; }
.op-tag { display: inline-block; font-style: normal; font-size: var(--t-xs); font-weight: 600;
          padding: 1px 6px; border-radius: 999px; background: var(--brand-soft); color: var(--series-1);
          white-space: nowrap; }
.op-tag.op-out { background: var(--warn-soft); color: var(--text-primary); }
.op-item .sm-fix { margin: 0; font-size: var(--t-sm); line-height: 1.5; }

/* ============================================================================
   Voice SEO assistant — a chat panel over the SEO tab (voice.js). Pure
   enhancement, shown only behind the voice_assist flag. All theme tokens.
   ============================================================================ */
.va-fab { position: fixed; right: 20px; bottom: 20px; z-index: 60; display: inline-flex;
  align-items: center; gap: 10px; padding: 11px 18px 11px 13px; border: none; border-radius: 999px;
  cursor: pointer; color: #fff; font-family: inherit; font-weight: 700; font-size: 14px;
  background: radial-gradient(130% 130% at 30% 25%, #6aa8ef, var(--series-1) 55%, #1f66bd);
  box-shadow: 0 10px 30px color-mix(in srgb, var(--series-1) 45%, transparent); }
.va-fab[hidden] { display: none; }
.va-fab svg { width: 20px; height: 20px; }
.va-fab::after { content: ""; position: absolute; inset: 0; border-radius: 999px;
  border: 2px solid var(--series-1); animation: va-ring 1.8s ease-out infinite; }

.va-root { position: fixed; inset: 0; z-index: 70; display: flex; justify-content: flex-end; }
.va-root[hidden] { display: none; }
.va-scrim { position: absolute; inset: 0; background: rgb(15 23 42 / 42%); animation: va-fade .25s ease both; }
.va-panel { position: relative; width: min(430px, 100%); height: 100%; display: flex;
  flex-direction: column; background: var(--surface-1); border-left: 1px solid var(--line);
  box-shadow: -20px 0 60px rgb(15 28 48 / 25%); animation: va-slide .32s cubic-bezier(.2,.8,.2,1) both; }
@keyframes va-slide { from { transform: translateX(26px); opacity: 0; } }
@keyframes va-fade { from { opacity: 0; } }
@keyframes va-ring { 0% { opacity: .7; transform: scale(.9); } 100% { opacity: 0; transform: scale(1.4); } }

.va-head { display: flex; align-items: center; gap: 12px; padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, color-mix(in srgb, var(--series-1) 7%, var(--surface-1)), var(--surface-1)); }
.va-orb { position: relative; width: 40px; height: 40px; border-radius: 50%; flex: none;
  background: radial-gradient(130% 130% at 30% 25%, #7fb4f2, var(--series-1) 55%, #1f66bd);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--series-1) 16%, transparent);
  display: grid; place-items: center; }
.va-orb::after { content: ""; position: absolute; inset: -5px; border-radius: 50%;
  border: 2px solid color-mix(in srgb, var(--series-1) 45%, transparent); opacity: 0; }
.va-orb.speaking::after { animation: va-ring 1.1s ease-out infinite; }
.va-eq { display: flex; gap: 2px; align-items: flex-end; height: 16px; }
.va-eq i { width: 3px; height: 5px; background: #fff; border-radius: 2px; opacity: .95; }
.va-orb.speaking .va-eq i { animation: va-eq .7s ease-in-out infinite; }
.va-eq i:nth-child(2) { animation-delay: .12s; } .va-eq i:nth-child(3) { animation-delay: .24s; }
.va-eq i:nth-child(4) { animation-delay: .36s; }
@keyframes va-eq { 0%, 100% { height: 5px; } 50% { height: 15px; } }
.va-who { flex: 1; min-width: 0; }
.va-who .va-name { font-weight: 700; font-size: 15px; line-height: 1.1; }
.va-who .va-sub { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.va-icon { border: 1px solid var(--line); background: var(--surface-1); color: var(--text-muted);
  width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; cursor: pointer;
  flex: none; transition: .15s; }
.va-icon:hover { color: var(--text-primary); border-color: color-mix(in srgb, var(--series-1) 40%, var(--line)); }
.va-icon svg { width: 17px; height: 17px; }
.va-icon.off { color: color-mix(in srgb, var(--text-muted) 70%, transparent); }

.va-msgs { flex: 1; overflow-y: auto; padding: 18px 16px; display: flex; flex-direction: column;
  gap: 12px; scroll-behavior: smooth; }
.va-row { display: flex; gap: 9px; align-items: flex-end; max-width: 92%; }
.va-row.bot { align-self: flex-start; } .va-row.me { align-self: flex-end; flex-direction: row-reverse; }
.va-mini { width: 26px; height: 26px; border-radius: 50%; flex: none; margin-bottom: 2px;
  background: radial-gradient(130% 130% at 30% 25%, #7fb4f2, var(--series-1) 60%, #1f66bd); }
.va-bubble { padding: 10px 13px; border-radius: 15px; font-size: 14.5px; line-height: 1.5;
  animation: va-bubble .34s cubic-bezier(.2,.8,.2,1) both; }
.va-row.bot .va-bubble { background: var(--surface-2); border: 1px solid var(--line);
  color: var(--text-primary); border-bottom-left-radius: 5px; }
.va-row.me .va-bubble { background: var(--series-1); color: #fff; border-bottom-right-radius: 5px;
  box-shadow: 0 4px 14px color-mix(in srgb, var(--series-1) 35%, transparent); }
.va-bubble a { color: inherit; text-decoration: underline; }
@keyframes va-bubble { from { opacity: 0; transform: translateY(9px); } }
.va-typing { display: inline-flex; gap: 4px; padding: 13px 14px; }
.va-typing i { width: 7px; height: 7px; border-radius: 50%;
  background: color-mix(in srgb, var(--text-muted) 70%, transparent); animation: va-blink 1.3s infinite both; }
.va-typing i:nth-child(2) { animation-delay: .18s; } .va-typing i:nth-child(3) { animation-delay: .36s; }
@keyframes va-blink { 0%, 60%, 100% { opacity: .25; transform: translateY(0); } 30% { opacity: 1; transform: translateY(-3px); } }

.va-chips { display: flex; flex-direction: column; gap: 8px; align-self: flex-start; width: 92%;
  animation: va-bubble .34s ease both; }
.va-chip { text-align: left; border: 1px solid var(--line); background: var(--surface-1);
  border-radius: 13px; padding: 11px 13px; cursor: pointer; display: flex; gap: 11px; align-items: center;
  transition: .16s; font-family: inherit; color: var(--text-primary); box-shadow: var(--shadow); }
.va-chip:hover:not(:disabled) { border-color: var(--series-1); transform: translateY(-2px);
  box-shadow: 0 10px 26px rgb(20 30 50 / 14%); }
.va-chip:disabled { opacity: .55; cursor: default; }
.va-num { width: 24px; height: 24px; border-radius: 7px; flex: none; display: grid; place-items: center;
  font-size: 12px; font-weight: 700; color: var(--series-1);
  background: color-mix(in srgb, var(--series-1) 12%, transparent); }
.va-ct { flex: 1; min-width: 0; }
.va-t { display: block; font-weight: 600; font-size: 14px; }
.va-k { display: block; font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.va-go { color: color-mix(in srgb, var(--text-muted) 70%, transparent); flex: none; }
.va-doneb { font-size: 11px; font-weight: 700; color: var(--up); flex: none; background: var(--up-soft);
  border: 1px solid color-mix(in srgb, var(--up) 30%, transparent); border-radius: 999px; padding: 2px 9px; }

.va-diff { align-self: flex-start; width: 92%; display: grid; grid-template-columns: 1fr auto 1fr;
  gap: 9px; align-items: stretch; animation: va-bubble .34s ease both; }
.va-side { border: 1px solid var(--line); border-radius: 12px; padding: 9px 11px; background: var(--surface-2);
  display: grid; gap: 4px; min-width: 0; align-content: start; }
.va-side.after { background: var(--up-soft); border-color: color-mix(in srgb, var(--up) 35%, transparent); }
.va-tag { font-size: 10px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--text-muted); }
.va-side.after .va-tag { color: color-mix(in srgb, var(--up) 72%, var(--text-muted)); }
.va-v { font-size: 13px; line-height: 1.4; overflow-wrap: anywhere; }
.va-side.after .va-v { color: color-mix(in srgb, var(--up) 78%, var(--text-primary)); font-weight: 500; }
.va-arrow { align-self: center; color: var(--text-muted); font-size: 18px; }

.va-acts { align-self: flex-start; display: flex; gap: 9px; flex-wrap: wrap; animation: va-bubble .3s ease both; }
.va-btn { font-family: inherit; font-size: 14px; font-weight: 600; cursor: pointer; border-radius: 11px;
  padding: 10px 18px; border: 1px solid var(--line); background: var(--surface-1); color: var(--text-primary); transition: .15s; }
.va-btn:hover { transform: translateY(-1px); }
.va-btn.yes { background: var(--series-1); color: #fff; border-color: transparent;
  box-shadow: 0 6px 18px color-mix(in srgb, var(--series-1) 35%, transparent); }
.va-btn.ghost { color: var(--text-muted); }
.va-btn.undo { font-size: 13px; padding: 7px 14px; }

.va-applying { align-self: flex-start; display: flex; align-items: center; gap: 10px; color: var(--text-muted);
  font-size: 13px; padding: 4px 2px; animation: va-bubble .3s ease both; }
.va-spin { width: 18px; height: 18px; border-radius: 50%; border: 2.5px solid var(--line);
  border-top-color: var(--series-1); animation: va-spin .8s linear infinite; }
@keyframes va-spin { to { transform: rotate(360deg); } }
.va-success { position: relative; align-self: flex-start; }
.va-check { width: 46px; height: 46px; }
.va-check circle { fill: none; stroke: var(--up); stroke-width: 2.5; opacity: .35; }
.va-check path { fill: none; stroke: var(--up); stroke-width: 3.2; stroke-linecap: round; stroke-linejoin: round;
  stroke-dasharray: 30; stroke-dashoffset: 30; animation: va-draw .5s .1s cubic-bezier(.6,.2,.2,1) forwards; }
.va-check.go { animation: va-pop .4s ease both; }
@keyframes va-draw { to { stroke-dashoffset: 0; } }
@keyframes va-pop { 0% { transform: scale(.4); opacity: 0; } 60% { transform: scale(1.12); } 100% { transform: scale(1); opacity: 1; } }
.va-confetti { position: absolute; inset: 0; pointer-events: none; }
.va-confetti i { position: absolute; left: 22px; top: 22px; width: 7px; height: 7px; border-radius: 2px;
  background: var(--c, var(--series-1)); opacity: 0; animation: va-burst .75s ease-out forwards; }
@keyframes va-burst { 0% { opacity: 1; transform: translate(0, 0) scale(1); }
  100% { opacity: 0; transform: translate(var(--dx), var(--dy)) rotate(260deg) scale(.4); } }

.va-foot { border-top: 1px solid var(--line); padding: 12px 14px; display: flex; flex-direction: column;
  gap: 9px; background: var(--surface-1); }
.va-composer { display: flex; align-items: center; gap: 10px; }
.va-mic { position: relative; width: 48px; height: 48px; border-radius: 50%; flex: none; border: none;
  cursor: pointer; color: #fff; display: grid; place-items: center;
  background: radial-gradient(130% 130% at 30% 25%, #6aa8ef, var(--series-1) 55%, #1f66bd);
  box-shadow: 0 8px 22px color-mix(in srgb, var(--series-1) 40%, transparent); transition: transform .15s; }
.va-mic:hover { transform: scale(1.05); }
.va-mic:disabled { filter: grayscale(.4) opacity(.55); cursor: default; }
.va-mic svg { width: 21px; height: 21px; }
.va-mic::before, .va-mic::after { content: ""; position: absolute; inset: 0; border-radius: 50%;
  border: 2px solid var(--series-1); opacity: 0; }
.va-mic.listening::before { animation: va-ring 1.4s ease-out infinite; }
.va-mic.listening::after { animation: va-ring 1.4s ease-out .5s infinite; }
.va-field { position: relative; flex: 1; min-width: 0; }
.va-cmd { width: 100%; height: 46px; border: 1px solid var(--line); border-radius: 13px;
  background: var(--surface-2); color: var(--text-primary); font-family: inherit; font-size: 14px;
  padding: 0 14px; transition: .15s; }
.va-cmd::placeholder { color: color-mix(in srgb, var(--text-muted) 85%, transparent); }
.va-cmd:focus { outline: none; border-color: var(--series-1); background: var(--surface-1);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--series-1) 18%, transparent); }
.va-wave { position: absolute; inset: 0; display: none; align-items: center; gap: 3px; padding: 0 15px; }
.va-wave i { width: 3px; height: 6px; border-radius: 3px; background: var(--series-1); animation: va-wv .8s ease-in-out infinite; }
.va-wave i:nth-child(odd) { background: color-mix(in srgb, var(--series-1) 70%, var(--text-primary)); }
.va-foot.listening .va-wave { display: flex; }
.va-foot.listening .va-cmd { color: transparent; }
@keyframes va-wv { 0%, 100% { height: 5px; } 50% { height: 20px; } }
.va-send { width: 46px; height: 46px; border-radius: 13px; flex: none; border: none; cursor: pointer;
  background: var(--series-1); color: #fff; display: grid; place-items: center; transition: .15s; }
.va-send:hover { transform: translateY(-1px); filter: brightness(1.04); }
.va-send svg { width: 18px; height: 18px; }
.va-hint { font-size: 12.5px; color: var(--text-muted); line-height: 1.35; padding-left: 2px; }
.va-hint b { color: var(--text-primary); }
.va-priv { font-size: 10.5px; line-height: 1.3; padding-left: 2px;
  color: color-mix(in srgb, var(--text-muted) 78%, transparent); }

@media (max-width: 480px) {
  .va-panel { width: 100%; border-left: none; }
  .va-diff { grid-template-columns: 1fr; }
  .va-arrow { transform: rotate(90deg); justify-self: center; }
}
@media (prefers-reduced-motion: reduce) {
  .va-fab::after, .va-panel, .va-scrim, .va-bubble, .va-chips, .va-diff, .va-acts, .va-applying,
  .va-orb.speaking::after, .va-orb.speaking .va-eq i, .va-typing i, .va-mic.listening::before,
  .va-mic.listening::after, .va-wave i, .va-spin, .va-check.go, .va-confetti i { animation: none !important; }
  .va-check path { stroke-dashoffset: 0; }
  .va-chip:hover:not(:disabled), .va-btn:hover, .va-send:hover, .va-mic:hover { transform: none; }
}
