/* HookOS portal — indigo/violet ops console.
   Dark-first navy, boxed cards, grid texture. Self-hosted type, no CDN.
   See docs/DESIGN_DIRECTION.md for the full system. */

/* -------------------------------------------------------------------------- */
/* Fonts (self-hosted variable)                                               */
/* -------------------------------------------------------------------------- */
/* Latin UI face — Jakarta has no Greek; unicode-range keeps it off Greek CPs */
@font-face {
  font-family: "Plus Jakarta Sans";
  src: url("fonts/PlusJakartaSans-Variable.woff2") format("woff2");
  font-weight: 200 800;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0100-024F, U+1E00-1EFF, U+2000-206F, U+2070-209F,
    U+20A0-20CF, U+2100-214F, U+2190-21FF, U+2200-22FF, U+FB00-FB4F;
}

.control-reason {
  display: block;
  margin: .35rem 0 0;
  color: var(--muted);
  font-size: .78rem;
  line-height: 1.35;
}
/* Greek data strings (business names, regions) — Noto Sans, matching weight */
@font-face {
  font-family: "Noto Sans Greek";
  src: url("fonts/NotoSans-Greek.woff2") format("woff2");
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0370-0377, U+037A-037F, U+0384-038A, U+038C, U+038E-03A1, U+03A3-03FF;
}
@font-face {
  font-family: "Noto Sans Greek";
  src: url("fonts/NotoSans-GreekExt.woff2") format("woff2");
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
  unicode-range: U+1F00-1FFF;
}
/* The hidden attribute must always win over component display rules. */
[hidden] { display: none !important; }

@font-face {
  font-family: "JetBrains Mono";
  src: url("fonts/JetBrainsMono-Variable.woff2") format("woff2");
  font-weight: 100 800;
  font-style: normal;
  font-display: swap;
}

/* -------------------------------------------------------------------------- */
/* Design tokens — dark-first                                                 */
/* -------------------------------------------------------------------------- */
:root {
  color-scheme: dark;

  --bg: #0B0E1A;
  --bg-raised: #0F1526;
  --bg-soft: #151B2E;
  --bg-hover: #1A2238;
  --ink: #F8FAFC;
  --muted: #94A3B8;
  /* #8B9BB0 ≥4.5:1 on --bg #0B0E1A (old #64748B failed contrast) */
  --faint: #8B9BB0;
  --line: rgba(148, 163, 184, .12);
  --line-strong: rgba(148, 163, 184, .22);
  --accent: #6366F1;
  --accent-hover: #818CF8;
  --accent-ink: #FFFFFF;
  --accent-dim: color-mix(in srgb, var(--accent) 16%, transparent);
  --accent-violet: #8B5CF6;
  --accent-blue: #3B82F6;
  --signal: #A78BFA;
  --signal-ink: #1E1035;
  --danger: #F87171;
  --danger-soft: color-mix(in srgb, #F87171 14%, transparent);
  --warn: #FBBF24;
  --warn-soft: color-mix(in srgb, #FBBF24 16%, transparent);
  --focus: #818CF8;
  --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 12px 32px rgba(0, 0, 0, .35);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .35), 0 6px 16px rgba(0, 0, 0, .28);
  --shadow-glow: 0 0 0 1px color-mix(in srgb, var(--accent) 35%, transparent),
                 0 12px 40px color-mix(in srgb, var(--accent-violet) 18%, transparent);
  --glow-violet: color-mix(in srgb, var(--accent-violet) 22%, transparent);
  --glow-indigo: color-mix(in srgb, var(--accent) 18%, transparent);
  --grid-line: rgba(148, 163, 184, .045);
  --grid-size: 48px;

  /* Jakarta for Latin; Noto Greek only paints Greek CPs via unicode-range */
  --font: "Plus Jakarta Sans", "Noto Sans Greek", ui-sans-serif, system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", Consolas, monospace;

  /* Radius — component classes only use these */
  --r-xs: .25rem;    /* 4px */
  --r-sm: .5rem;     /* 8px */
  --r-md: .875rem;   /* 14px — cards inner */
  --r-lg: 1rem;      /* 16px */
  --r-xl: 1.125rem;  /* 18px — primary surfaces */
  --r-pill: 999px;

  /* Motion — one timing system; no raw 0.3s ease */
  --ease: cubic-bezier(.22, 1, .36, 1);
  --ease-out: cubic-bezier(.16, 1, .3, 1);
  --ease-in: cubic-bezier(.4, 0, 1, 1);
  --dur-micro: 120ms;
  --dur: 220ms;
  --dur-slow: 320ms;
  --dur-reveal: 480ms;
  --dur-meter: 640ms;

  /* 4pt spacing scale (base 4px @ 16px root) */
  --s-1: .25rem;   /* 4 */
  --s-2: .5rem;    /* 8 */
  --s-3: .75rem;   /* 12 */
  --s-4: 1rem;     /* 16 */
  --s-5: 1.25rem;  /* 20 */
  --s-6: 1.5rem;   /* 24 */
  --s-7: 2rem;     /* 32 */
  --s-8: 2.5rem;   /* 40 */
  --s-9: 3rem;     /* 48 */
  --s-10: 4rem;    /* 64 */

  /* Type scale — one voice per role */
  --text-caption: .7rem;
  --text-label: .75rem;
  --text-sm: .82rem;
  --text-body: .96875rem; /* 15.5px */
  --text-md: 1rem;
  --text-h3: .9rem;
  --text-h2: clamp(1.2rem, 2.2vw, 1.55rem);
  --text-h1: clamp(1.75rem, 3.8vw, 2.45rem);
  --text-h1-app: clamp(1.5rem, 2.8vw, 1.85rem); /* app pageheads tighter */
  --text-display: clamp(2rem, 5vw, 3.25rem);

  --container: 72rem;
  --sidebar-w: 15.5rem;
  --nav-h: 3.5rem;          /* 56px — 4pt */
  --nav-h-scrolled: 3rem;   /* 48px */
  --mobile-nav-h: 3.75rem;  /* 60px */
  --touch: 2.75rem; /* 44px minimum touch target */
  --space-section: clamp(1.75rem, 4vw, 2.5rem);
  --space-card: var(--s-5);
  --space-card-lg: var(--s-6);
  --space-gap: var(--s-4);
  --space-gap-sm: var(--s-3);
  --body-measure: 65ch;
  --bp-phone: 767px;
  --bp-tablet: 1023px;
}

/* Settings — tokenized boxed cards (matches billing / pipeline) */
.settings-shell {
  max-width: var(--container);
  margin: 0 auto;
  padding: clamp(1.25rem, 3.5vw, 2.25rem) clamp(1rem, 4vw, 2rem) 2.5rem;
}
.settings-head {
  max-width: 42rem;
  margin-bottom: 1.5rem;
}
.settings-head .pipeline-kicker { margin: 0 0 .35rem; }
.settings-head h1 {
  font-size: clamp(1.75rem, 3.8vw, 2.45rem);
  margin: 0 0 .35rem;
}
.settings-head p,
.card-copy {
  color: var(--muted);
  margin: 0;
  font-size: .95rem;
  line-height: 1.5;
}
.settings-grid {
  display: grid;
  grid-template-columns: 1fr 1.1fr;
  gap: 1.1rem;
}
.settings-card {
  position: relative;
  background: var(--bg-raised);
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow);
  padding: clamp(1.1rem, 3vw, 1.5rem);
  min-width: 0;
}
.usage-card { grid-column: 1 / -1; }
.card-number {
  float: right;
  color: var(--faint);
  font: 700 .7rem var(--mono);
  letter-spacing: .06em;
}
.settings-card h2 {
  margin: 0 0 .35rem;
  font-size: 1.15rem;
}
.settings-card form {
  display: grid;
  gap: .65rem;
  padding-top: 1rem;
  margin-top: 1rem;
  border-top: 1px solid var(--line);
}
.settings-card .field { margin: 0; }
.settings-card .btn { justify-self: start; min-height: var(--touch); }
.connected-row,
.plan-state {
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--bg-soft);
  padding: .85rem 1rem;
  margin-top: 1rem;
}
.connected-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  flex-wrap: wrap;
}
.connected-row form {
  border: 0;
  padding: 0;
  margin: 0;
}
.connected-row .status-live {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  font-weight: 600;
  font-size: .9rem;
}
.connected-row .status-live i {
  display: inline-block;
  width: .5rem;
  height: .5rem;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-dim);
  flex: 0 0 auto;
}
.tos-warning {
  margin-top: 1rem;
  padding: .85rem 1rem;
  border-radius: var(--r-md);
  border: 1px solid color-mix(in srgb, var(--warn) 40%, var(--line));
  border-left: 3px solid var(--warn);
  background: var(--warn-soft);
  color: var(--ink);
  font-size: .82rem;
  line-height: 1.45;
}
.tos-warning strong {
  display: block;
  color: var(--warn);
  margin-bottom: .2rem;
  font-size: .78rem;
  font-family: var(--mono);
  letter-spacing: .04em;
  text-transform: uppercase;
}
.plan-state { display: grid; gap: .25rem; }
.pack-state { margin: 1rem 0; }
.plan-state span,
.plan-state small { color: var(--muted); }
.plan-state strong { color: var(--ink); font-size: 1.05rem; }
.usage-stat {
  display: flex;
  align-items: baseline;
  gap: .7rem;
  margin-top: .75rem;
}
.usage-stat strong {
  font: 700 clamp(2.2rem, 6vw, 3.5rem) / 1 var(--mono);
  color: var(--accent-hover);
  letter-spacing: -.03em;
}
.usage-stat > span { color: var(--muted); font-weight: 600; }
.usage-split {
  display: flex;
  flex-wrap: wrap;
  gap: .75rem 1.1rem;
  color: var(--muted);
  font: 600 .75rem var(--mono);
  margin-top: .65rem;
}
.settings-alert {
  max-width: 42rem;
  margin: 0 0 1.25rem;
  padding: .75rem 1rem;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  font-size: .9rem;
  font-weight: 500;
}
.settings-alert.ok {
  color: var(--ink);
  background: color-mix(in srgb, var(--accent) 12%, var(--bg-raised));
  border-color: color-mix(in srgb, var(--accent) 35%, var(--line));
}
.settings-alert.error {
  color: var(--ink);
  background: var(--danger-soft);
  border-color: color-mix(in srgb, var(--danger) 45%, transparent);
}
/* settings-grid stacks at ≤1023 (see global responsive block) */

/* Explicit light mode (toggle + system when user hasn't chosen) */
html[data-theme="light"] {
  color-scheme: light;
  --bg: #F1F5F9;
  --bg-raised: #FFFFFF;
  --bg-soft: #E8EEF7;
  --bg-hover: #DDE5F2;
  --ink: #0F172A;
  --muted: #64748B;
  --faint: #94A3B8;
  --line: rgba(15, 23, 42, .08);
  --line-strong: rgba(15, 23, 42, .14);
  --accent: #4F46E5;
  --accent-hover: #4338CA;
  --accent-ink: #FFFFFF;
  --accent-dim: color-mix(in srgb, var(--accent) 10%, transparent);
  --accent-violet: #7C3AED;
  --accent-blue: #2563EB;
  --signal: #8B5CF6;
  --signal-ink: #FFFFFF;
  --danger: #DC2626;
  --danger-soft: color-mix(in srgb, #DC2626 12%, transparent);
  --warn: #D97706;
  --warn-soft: color-mix(in srgb, #D97706 14%, transparent);
  --focus: #6366F1;
  --shadow: 0 1px 2px rgba(15, 23, 42, .06), 0 12px 28px rgba(15, 23, 42, .08);
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, .05), 0 6px 16px rgba(15, 23, 42, .06);
  --shadow-glow: 0 0 0 1px color-mix(in srgb, var(--accent) 22%, transparent),
                 0 10px 28px color-mix(in srgb, var(--accent-violet) 10%, transparent);
  --glow-violet: color-mix(in srgb, var(--accent-violet) 14%, transparent);
  --glow-indigo: color-mix(in srgb, var(--accent) 12%, transparent);
  --grid-line: rgba(15, 23, 42, .05);
}

/* System preference only when no explicit theme */
@media (prefers-color-scheme: light) {
  html:not([data-theme]) {
    color-scheme: light;
    --bg: #F1F5F9;
    --bg-raised: #FFFFFF;
    --bg-soft: #E8EEF7;
    --bg-hover: #DDE5F2;
    --ink: #0F172A;
    --muted: #64748B;
    --faint: #94A3B8;
    --line: rgba(15, 23, 42, .08);
    --line-strong: rgba(15, 23, 42, .14);
    --accent: #4F46E5;
    --accent-hover: #4338CA;
    --accent-ink: #FFFFFF;
    --accent-dim: color-mix(in srgb, var(--accent) 10%, transparent);
    --accent-violet: #7C3AED;
    --accent-blue: #2563EB;
    --signal: #8B5CF6;
    --signal-ink: #FFFFFF;
    --danger: #DC2626;
    --danger-soft: color-mix(in srgb, #DC2626 12%, transparent);
    --warn: #D97706;
    --warn-soft: color-mix(in srgb, #D97706 14%, transparent);
    --focus: #6366F1;
    --shadow: 0 1px 2px rgba(15, 23, 42, .06), 0 12px 28px rgba(15, 23, 42, .08);
    --shadow-sm: 0 1px 2px rgba(15, 23, 42, .05), 0 6px 16px rgba(15, 23, 42, .06);
    --shadow-glow: 0 0 0 1px color-mix(in srgb, var(--accent) 22%, transparent),
                   0 10px 28px color-mix(in srgb, var(--accent-violet) 10%, transparent);
    --glow-violet: color-mix(in srgb, var(--accent-violet) 14%, transparent);
    --glow-indigo: color-mix(in srgb, var(--accent) 12%, transparent);
    --grid-line: rgba(15, 23, 42, .05);
  }
}

/* Aliases used by older markup / inline styles */
:root, html[data-theme="light"], html:not([data-theme]) {
  --paper: var(--bg);
  --paper-raised: var(--bg-raised);
  --paper-soft: var(--bg-soft);
}

/* -------------------------------------------------------------------------- */
/* Base                                                                       */
/* -------------------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html {
  -webkit-text-size-adjust: 100%;
  overflow-x: clip;
  scroll-behavior: smooth;
}
body {
  margin: 0;
  min-width: 0;
  min-height: 100dvh;
  font-family: var(--font);
  font-size: var(--text-body);
  font-weight: 450;
  line-height: 1.55;
  color: var(--ink);
  font-feature-settings: "kern" 1, "liga" 1;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  background-color: var(--bg);
  background-image:
    radial-gradient(900px 480px at 12% -8%, var(--glow-indigo), transparent 58%),
    radial-gradient(720px 420px at 92% 4%, var(--glow-violet), transparent 55%),
    linear-gradient(var(--grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: auto, auto, var(--grid-size) var(--grid-size), var(--grid-size) var(--grid-size);
  background-attachment: fixed;
  font-feature-settings: "ss01", "cv11";
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: clip;
  text-rendering: optimizeLegibility;
}

/* Landing-page studio — tokenized workbench */
.site-builder {
  width: 100%;
  max-width: none;
  margin: 0 auto;
  padding: clamp(1rem, 3vw, 2rem) clamp(.85rem, 3vw, 1.5rem) 2rem;
  min-width: 0;
}
.site-mobile-tabs { display: none; }
.site-template-picks { display: grid; gap: .45rem; }
.site-template-picks label {
  position: relative;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: .15rem .5rem;
  padding: .7rem .75rem;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  cursor: pointer;
  font-size: .8rem;
}
.site-template-picks input { position: absolute; opacity: 0; }
.site-template-picks span { color: var(--muted); font-size: .72rem; }
.site-template-picks label:has(input:checked) { border-color: var(--accent); background: var(--accent-dim); }
.site-template-picks label:has(input:focus-visible) { outline: 2px solid var(--focus); outline-offset: 2px; }
.site-builder-head {
  display: flex;
  gap: 1.25rem 2rem;
  align-items: flex-end;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
}
.site-builder-head h1 {
  font-size: clamp(1.6rem, 3.5vw, 2.4rem);
  max-width: 18ch;
  margin: .2rem 0 .4rem;
}
.site-builder-head p { color: var(--muted); max-width: 42rem; margin: 0; }
.site-builder-kicker {
  color: var(--accent-hover);
  font: 700 .69rem/1 var(--mono);
  letter-spacing: .12em;
  text-transform: uppercase;
}
.site-publish-state {
  margin-left: auto;
  border: 1px solid var(--line);
  background: var(--bg-raised);
  box-shadow: var(--shadow-sm);
  border-radius: var(--r-md);
  padding: .65rem .85rem;
  display: flex;
  align-items: center;
  gap: .55rem;
  font: 600 .72rem var(--mono);
  color: var(--muted);
}
.site-state-dot {
  width: .5rem;
  height: .5rem;
  border-radius: 50%;
  background: var(--signal);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--signal) 13%, transparent);
}
.site-workbench {
  display: grid;
  grid-template-columns: minmax(18rem, 22rem) minmax(0, 1fr);
  min-height: 72vh;
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  background: var(--bg-raised);
  box-shadow: var(--shadow);
  overflow: hidden;
  min-width: 0;
}
.site-controls {
  padding: 1.1rem;
  max-height: calc(100vh - 7rem);
  overflow: auto;
  border-right: 1px solid var(--line);
  background: var(--bg-raised);
  min-width: 0;
}
.site-panel-title {
  display: flex;
  gap: .75rem;
  padding: .75rem 0;
  margin-top: .35rem;
  border-top: 1px solid var(--line);
}
.site-panel-title:first-child { border-top: 0; margin-top: 0; }
.site-panel-title > span {
  font: 700 .65rem var(--mono);
  color: var(--accent-hover);
  padding-top: .2rem;
}
.site-panel-title h2 { font-size: .9rem; margin: 0; }
.site-panel-title p { font-size: .75rem; color: var(--muted); margin: .15rem 0 0; }
.site-field {
  display: grid;
  gap: .35rem;
  margin: .75rem 0;
  color: var(--muted);
  font: 650 .68rem var(--mono);
  letter-spacing: .04em;
  text-transform: uppercase;
}
.site-field small {
  float: right;
  color: var(--faint);
  text-transform: none;
  letter-spacing: 0;
  font-weight: 500;
}
.site-field input,
.site-field textarea,
.site-field select {
  width: 100%;
  max-width: 100%;
  color: var(--ink);
  background: var(--bg);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-sm);
  padding: .72rem .78rem;
  /* ≥16px prevents iOS Safari focus-zoom */
  font: 500 1rem / 1.45 var(--font);
  resize: vertical;
  min-height: var(--touch);
  transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}
.site-field input:focus,
.site-field textarea:focus,
.site-field select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-dim);
  outline: none;
}
.site-choice-group { border: 0; padding: 0; margin: .5rem 0 1rem; }
.site-choice-group legend {
  color: var(--muted);
  font: 650 .68rem var(--mono);
  letter-spacing: .04em;
  text-transform: uppercase;
  margin-bottom: .5rem;
  padding: 0;
}
.site-swatches { display: grid; grid-template-columns: 1fr 1fr; gap: .45rem; }
.site-swatches label {
  position: relative;
  cursor: pointer;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  padding: .55rem;
  display: grid;
  gap: .35rem;
  color: var(--muted);
  font-size: .72rem;
  min-height: var(--touch);
  transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease), color var(--dur);
}
.site-swatches input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
  margin: 0;
}
.site-swatches label:hover { border-color: var(--line-strong); color: var(--ink); }
.site-swatches label:has(input:focus-visible) {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}
.site-swatches label:has(input:checked) {
  border-color: var(--accent);
  color: var(--ink);
  box-shadow: 0 0 0 2px var(--accent-dim);
}
.site-swatches i {
  height: 1.1rem;
  border-radius: 3px;
  background: var(--sw);
  border: 1px solid var(--line);
}
[data-swatch=nocturne] { --sw: linear-gradient(90deg, #0b1020 0 32%, #7c5cff 32% 58%, #eaf0ff 58%); }
[data-swatch=cobalt] { --sw: linear-gradient(90deg, #071a2b 0 32%, #32b7db 32% 58%, #f1f7f8 58%); }
[data-swatch=oxide] { --sw: linear-gradient(90deg, #21130f 0 32%, #e0633d 32% 58%, #f1dfc7 58%); }
[data-swatch=paper] { --sw: linear-gradient(90deg, #ece9e0 0 40%, #17191d 40% 70%, #bc3f31 70%); }
.site-toggles { display: grid; gap: .4rem; }
.site-toggles label {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  padding: .65rem .75rem;
  font-size: .8rem;
  cursor: pointer;
  min-height: var(--touch);
  transition: border-color var(--dur) var(--ease), background var(--dur);
}
.site-toggles label:hover { background: var(--bg-soft); }
.site-toggles input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
  margin: 0;
}
.site-toggles label:has(input:focus-visible) {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}
.site-toggles i {
  width: 2.1rem;
  height: 1.15rem;
  border-radius: var(--r-pill);
  background: var(--bg);
  border: 1px solid var(--line-strong);
  position: relative;
  flex: 0 0 auto;
  transition: background var(--dur) var(--ease), border-color var(--dur);
}
.site-toggles i::after {
  content: "";
  position: absolute;
  width: .75rem;
  height: .75rem;
  top: .12rem;
  left: .15rem;
  border-radius: 50%;
  background: var(--faint);
  transition: transform var(--dur) var(--ease), background var(--dur);
}
.site-toggles input:checked + i {
  background: var(--accent-dim);
  border-color: var(--accent);
}
.site-toggles input:checked + i::after {
  transform: translateX(.85rem);
  background: var(--accent);
}
.site-contact-grid { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; }
.site-publish {
  width: 100%;
  margin-top: 1rem;
  justify-content: space-between;
  min-height: 2.75rem;
}
.site-publish-note {
  font-size: .78rem;
  color: var(--muted);
  line-height: 1.5;
  margin: .7rem .15rem 0;
}
.site-publish-note a { color: var(--accent-hover); }
.site-canvas {
  min-width: 0;
  background: var(--bg);
  display: flex;
  flex-direction: column;
}
.site-canvas-bar {
  min-height: 2.75rem;
  display: flex;
  align-items: center;
  padding: 0 .9rem;
  gap: .75rem;
  color: var(--muted);
  border-bottom: 1px solid var(--line);
  font: 600 .68rem var(--mono);
}
.site-browser-dots { display: flex; gap: .3rem; }
.site-browser-dots i {
  width: .45rem;
  height: .45rem;
  border-radius: 50%;
  background: var(--bg-hover);
}
.site-browser-dots i:first-child { background: color-mix(in srgb, var(--danger) 55%, var(--bg-hover)); }
.site-viewport-switch {
  margin-left: auto;
  display: flex;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  overflow: hidden;
}
.site-viewport-switch button {
  border: 0;
  border-right: 1px solid var(--line);
  color: var(--muted);
  background: var(--bg-soft);
  min-width: var(--touch);
  min-height: var(--touch);
  padding: .35rem .55rem;
  font: 600 .68rem var(--mono);
  cursor: pointer;
  transition: background var(--dur) var(--ease), color var(--dur);
}
.site-viewport-switch button:last-child { border-right: 0; }
.site-viewport-switch button:hover { color: var(--ink); background: var(--bg-hover); }
.site-viewport-switch button.is-active {
  color: var(--accent-ink);
  background: var(--accent);
}
.site-frame-wrap {
  flex: 1;
  padding: clamp(.5rem, 2vw, 1.25rem);
  display: flex;
  justify-content: center;
  min-height: 36rem;
  overflow: auto;
  min-width: 0;
}
#sg-preview {
  width: 100%;
  height: 100%;
  min-height: 36rem;
  border: 0;
  border-radius: var(--r-sm);
  background: #fff;
  box-shadow: var(--shadow);
  transition: width var(--dur-slow) var(--ease);
}
/* site-workbench stacks at ≤1023 (see global responsive block) */
a { color: inherit; }
h1, h2, h3 {
  line-height: 1.12;
  letter-spacing: -.028em;
  margin: 0 0 .4em;
  font-weight: 650;
}
h1 { font-size: var(--text-h1); font-weight: 680; }
h2 { font-size: var(--text-h2); }
h3 { font-size: var(--text-h3); }
/* App shell pageheads share one h1 size (tighter than marketing/auth) */
.has-app-shell main h1,
.has-app-shell .pagehead h1,
.has-app-shell .settings-head h1,
.has-app-shell .site-builder-head h1 {
  font-size: var(--text-h1-app);
}
p { margin: 0 0 .75em; }
:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
  border-radius: var(--r-xs);
}
/* Tabular figures on every numeric surface */
.stat,
.stat-n,
.count,
.side-cap,
.notif-badge,
.mfo-stat-n,
.usage-stat strong,
.table td,
.table th,
.biz-chip,
.chip,
.trend,
.meter,
.price-card .stat,
.tier-option .stat,
.plan-state strong,
.live-pill-text,
.activity-row time,
code,
[data-cap],
.num,
.tabular {
  font-variant-numeric: tabular-nums;
}
::selection {
  background: color-mix(in srgb, var(--accent) 35%, transparent);
  color: var(--ink);
}
.wrap {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 clamp(1rem, 4vw, 2rem);
}

/* -------------------------------------------------------------------------- */
/* Sticky compressing nav                                                     */
/* -------------------------------------------------------------------------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  height: var(--nav-h);
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  -webkit-backdrop-filter: blur(14px) saturate(1.2);
  backdrop-filter: blur(14px) saturate(1.2);
  border-bottom: 1px solid transparent;
  transition:
    height var(--dur-slow) var(--ease),
    background var(--dur-slow) var(--ease),
    border-color var(--dur-slow) var(--ease),
    box-shadow var(--dur-slow) var(--ease);
}
.topbar.is-scrolled {
  height: var(--nav-h-scrolled);
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  border-bottom-color: var(--line);
  box-shadow: 0 8px 28px rgba(0, 0, 0, .18);
}
.topbar .row {
  display: flex;
  align-items: center;
  gap: .85rem;
  height: 100%;
  padding: 0 clamp(1rem, 4vw, 2rem);
  max-width: var(--container);
  margin: 0 auto;
  transition: gap var(--dur-slow) var(--ease);
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: .55rem;
  font-weight: 720;
  letter-spacing: -.035em;
  text-decoration: none;
  font-size: 1.05rem;
  transition: transform var(--dur) var(--ease), opacity var(--dur);
}
.brand:hover { opacity: .92; }
.brand .dot {
  width: 1.7rem;
  height: 1.7rem;
  border-radius: .45rem;
  background: linear-gradient(145deg, var(--accent), var(--accent-violet));
  color: var(--accent-ink);
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: .9rem;
  letter-spacing: 0;
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--accent) 30%, transparent),
              0 4px 14px color-mix(in srgb, var(--accent) 25%, transparent);
  transition: transform var(--dur) var(--ease), box-shadow var(--dur);
}
.brand:hover .dot {
  transform: scale(1.04);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--accent) 45%, transparent),
              0 6px 18px color-mix(in srgb, var(--accent) 35%, transparent);
}
.topbar.is-scrolled .brand { font-size: .98rem; }
.topbar.is-scrolled .brand .dot {
  width: 1.45rem;
  height: 1.45rem;
  font-size: .8rem;
}
.spacer { margin-left: auto; }
.who {
  color: var(--muted);
  font-size: .82rem;
  font-weight: 500;
}
.who b { color: var(--ink); font-weight: 620; }

/* Theme toggle */
.theme-toggle {
  display: inline-grid;
  place-items: center;
  width: var(--touch);
  height: var(--touch);
  min-width: var(--touch);
  min-height: var(--touch);
  border-radius: var(--r-sm);
  border: 1px solid var(--line);
  background: var(--bg-raised);
  color: var(--muted);
  cursor: pointer;
  padding: 0;
  flex: 0 0 auto;
  transition:
    color var(--dur) var(--ease),
    border-color var(--dur) var(--ease),
    background var(--dur) var(--ease),
    transform var(--dur) var(--ease);
}
.theme-toggle:hover {
  color: var(--ink);
  border-color: var(--line-strong);
  background: var(--bg-soft);
}
.theme-toggle:active { transform: scale(.96); }
.theme-toggle svg { width: 1.05rem; height: 1.05rem; display: block; }
.theme-toggle .icon-sun { display: none; }
.theme-toggle .icon-moon { display: block; }
html[data-theme="light"] .theme-toggle .icon-sun { display: block; }
html[data-theme="light"] .theme-toggle .icon-moon { display: none; }
@media (prefers-color-scheme: light) {
  html:not([data-theme]) .theme-toggle .icon-sun { display: block; }
  html:not([data-theme]) .theme-toggle .icon-moon { display: none; }
}

/* -------------------------------------------------------------------------- */
/* Buttons                                                                    */
/* -------------------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  cursor: pointer;
  font: 600 .9rem/1 var(--font);
  letter-spacing: -.01em;
  padding: .72rem 1.15rem;
  min-height: var(--touch);
  border-radius: var(--r-pill);
  border: 1px solid var(--line-strong);
  background: var(--bg-raised);
  color: var(--ink);
  text-decoration: none;
  transition:
    transform var(--dur) var(--ease),
    background var(--dur) var(--ease),
    border-color var(--dur) var(--ease),
    box-shadow var(--dur) var(--ease),
    color var(--dur) var(--ease);
}
.btn:hover {
  transform: translateY(-1px);
  border-color: color-mix(in srgb, var(--accent) 45%, var(--line-strong));
  box-shadow: var(--shadow-sm);
}
.btn:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}
.btn.primary {
  background: var(--accent);
  color: var(--accent-ink);
  border-color: color-mix(in srgb, var(--accent) 80%, transparent);
  box-shadow: 0 1px 0 color-mix(in srgb, #fff 18%, transparent) inset,
              0 6px 18px color-mix(in srgb, var(--accent) 22%, transparent);
}
.btn.primary:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
  box-shadow: 0 1px 0 color-mix(in srgb, #fff 22%, transparent) inset,
              0 10px 24px color-mix(in srgb, var(--accent) 28%, transparent);
}
.btn.primary:active {
  background: color-mix(in srgb, var(--accent) 88%, #000);
}
.btn.ghost {
  background: transparent;
  box-shadow: none;
}
.btn.ghost:hover {
  background: var(--bg-soft);
  box-shadow: none;
}
.btn.sm {
  padding: .55rem .9rem;
  font-size: .8rem;
  min-height: var(--touch); /* ≥44px tap target */
}
.btn:active { transform: translateY(1px) scale(.985); }
.btn:disabled,
.btn[aria-disabled="true"],
.btn.disabled,
.btn.loading {
  transform: none !important;
  box-shadow: none;
  pointer-events: none;
}
.btn.loading {
  cursor: wait;
  opacity: .68;
}
.btn:disabled:not(.loading),
.btn[aria-disabled="true"]:not(.loading),
.btn.disabled:not(.loading) {
  cursor: not-allowed;
  opacity: .5;
}
.btn.loading::before {
  content: "";
  width: .8rem;
  height: .8rem;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: spin .7s linear infinite;
  flex: 0 0 auto;
}
.btn.danger {
  color: var(--danger);
  border-color: color-mix(in srgb, var(--danger) 45%, var(--line));
}
.btn.danger:hover {
  background: var(--danger-soft);
  border-color: var(--danger);
  box-shadow: none;
}
.btn.danger:active {
  background: color-mix(in srgb, var(--danger) 18%, var(--bg-raised));
}

/* -------------------------------------------------------------------------- */
/* Auth                                                                       */
/* -------------------------------------------------------------------------- */
.auth {
  min-height: calc(100dvh - var(--nav-h) - 5rem);
  display: grid;
  place-items: center;
  padding: clamp(1.5rem, 5vw, 3rem) 1rem;
}
.card {
  background: var(--bg-raised);
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow);
  padding: clamp(1.5rem, 4vw, 2.4rem);
  position: relative;
  overflow: hidden;
}
/* Shared boxed-surface primitive (cards, tiles, pipeline steps) */
.surface {
  background: var(--bg-raised);
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow);
}
.card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--accent) 40%, transparent), transparent);
  pointer-events: none;
}
.auth .card { width: 100%; max-width: 26rem; }
.auth .card h1 { margin-bottom: .25rem; }
.field { display: block; margin: 0 0 1rem; }
.field span {
  display: block;
  font-size: .75rem;
  color: var(--muted);
  margin-bottom: .4rem;
  font-weight: 650;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.field input,
.field select,
.field textarea {
  width: 100%;
  max-width: 100%;
  padding: .78rem .9rem;
  border-radius: var(--r-sm);
  border: 1px solid var(--line-strong);
  background: var(--bg);
  color: var(--ink);
  /* ≥16px prevents iOS Safari focus-zoom */
  font: 500 1rem / 1.45 var(--font);
  min-height: var(--touch);
  transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease), background var(--dur);
}
.field input::placeholder { color: var(--faint); opacity: .85; }
.field input:hover { border-color: color-mix(in srgb, var(--accent) 30%, var(--line-strong)); }
.field input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-dim);
  background: var(--bg-raised);
}
.field input[aria-invalid="true"] {
  border-color: color-mix(in srgb, var(--danger) 55%, var(--line-strong));
}
.field input[aria-invalid="true"]:focus {
  box-shadow: 0 0 0 3px var(--danger-soft);
}
.muted { color: var(--muted); }
.small { font-size: .82rem; }
.lead {
  color: var(--muted);
  font-size: 1rem;
  margin: 0 0 .2rem;
  line-height: 1.5;
}
.err {
  background: var(--danger-soft);
  border: 1px solid color-mix(in srgb, var(--danger) 45%, transparent);
  color: var(--ink);
  padding: .7rem .85rem;
  border-radius: var(--r-sm);
  font-size: .85rem;
  margin-bottom: 1rem;
  font-weight: 500;
}
.notice {
  background: var(--bg-soft);
  border: 1px solid var(--line-strong);
  padding: .7rem .85rem;
  border-radius: var(--r-sm);
  font-size: .85rem;
  margin-bottom: 1rem;
}
.divider {
  display: flex;
  align-items: center;
  gap: .8rem;
  color: var(--faint);
  font-size: .78rem;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  margin: 1.25rem 0;
}
.divider::before,
.divider::after {
  content: "";
  height: 1px;
  background: var(--line);
  flex: 1;
}
.btn.oauth {
  width: 100%;
  justify-content: center;
  margin-top: .55rem;
  background: var(--bg);
}
.oauth-options { display:grid; gap:.65rem; margin-top:1.3rem; }
.oauth-options .btn.oauth { margin-top:0; }
.oauth-mark { width:1.2rem; height:1.2rem; flex:0 0 auto; }
.github-mark { color:var(--ink); }
.btn.oauth:hover {
  background: var(--bg-soft);
  border-color: var(--line-strong);
}
.auth-link {
  color: var(--accent);
  font-weight: 620;
  text-decoration: none;
  border-bottom: 1px solid color-mix(in srgb, var(--accent) 35%, transparent);
  transition: border-color var(--dur), color var(--dur);
}
.auth-link:hover {
  border-bottom-color: var(--accent);
  color: var(--accent-hover);
}

/* Tier picker on signup */
.tier-pick {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: .65rem;
}
.tier-option {
  position: relative;
  cursor: pointer;
  margin: 0;
  padding: .95rem .85rem;
  border-radius: var(--r-md);
  border: 1px solid var(--line);
  background: var(--bg);
  display: block;
  transition:
    border-color var(--dur) var(--ease),
    box-shadow var(--dur) var(--ease),
    background var(--dur) var(--ease),
    transform var(--dur) var(--ease);
}
.tier-option:hover {
  border-color: var(--line-strong);
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}
.tier-option:has(input:checked),
.tier-option.is-selected {
  border-color: color-mix(in srgb, var(--accent) 55%, var(--line));
  background: color-mix(in srgb, var(--accent) 8%, var(--bg-raised));
  box-shadow: var(--shadow-glow);
}
.tier-option input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.tier-option b {
  display: block;
  font-size: .88rem;
  margin-bottom: .25rem;
}
.tier-option .stat {
  font-size: 1.25rem;
  margin: .15rem 0;
}
.tier-option .small { line-height: 1.3; }

/* -------------------------------------------------------------------------- */
/* Dashboard layout                                                           */
/* -------------------------------------------------------------------------- */
.dashboard-answers {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: .85rem;
  margin: 0 0 1.5rem;
}
.answer-card { padding: 1.15rem; min-width: 0; }
.answer-kicker { margin: 0 0 .55rem; color: var(--muted); font-size: .76rem; font-weight: 750; text-transform: uppercase; letter-spacing: .06em; }
.answer-card h2 { margin: 0 0 .45rem; font-size: clamp(1.15rem, 2vw, 1.55rem); overflow-wrap: anywhere; }
.answer-card p:not(.answer-kicker) { color: var(--muted); font-size: .9rem; min-height: 2.7em; }
.answer-card a { font-weight: 700; font-size: .88rem; }
.progress-history { margin-top: 1.5rem; }
@media (max-width: 980px) { .dashboard-answers { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 540px) { .dashboard-answers { grid-template-columns: 1fr; } .answer-card p:not(.answer-kicker) { min-height: 0; } }
main {
  padding: clamp(1.35rem, 3.5vw, 2.1rem) 0 4.5rem;
  min-width: 0;
}
.pagehead {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: .55rem 1rem;
  margin-bottom: 1.5rem;
}
.pagehead h1 { overflow-wrap: anywhere; margin-bottom: .15rem; }
.pagehead .muted { font-size: .92rem; }

/* Getting started */
.gs-card {
  margin: 0 0 1.5rem;
  padding: clamp(1.15rem, 3vw, 1.55rem) clamp(1.15rem, 3.5vw, 1.65rem);
  background:
    linear-gradient(155deg, color-mix(in srgb, var(--accent) 9%, var(--bg-raised)), var(--bg-raised) 55%),
    var(--bg-raised);
  border: 1px solid color-mix(in srgb, var(--accent) 26%, var(--line));
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-sm);
  min-width: 0;
  position: relative;
  overflow: hidden;
}
.gs-card::after {
  content: "";
  position: absolute;
  top: -40%;
  right: -8%;
  width: 220px;
  height: 220px;
  border-radius: 50%;
  background: radial-gradient(circle, color-mix(in srgb, var(--signal) 12%, transparent), transparent 70%);
  pointer-events: none;
}
.gs-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: .55rem .85rem;
  margin-bottom: .55rem;
  position: relative;
}
.gs-kicker {
  margin: 0 0 .25rem;
  font-size: .7rem;
  font-weight: 750;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--accent);
}
.gs-head h2 {
  margin: 0;
  font-size: clamp(1.15rem, 2.4vw, 1.4rem);
  letter-spacing: -.02em;
}
.gs-note {
  margin: 0 0 1.1rem;
  color: var(--muted);
  font-size: .92rem;
  max-width: 44rem;
  overflow-wrap: anywhere;
  position: relative;
}
.gs-note b { color: var(--ink); font-weight: 650; }
.gs-steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: .7rem;
  position: relative;
}
.gs-step {
  display: flex;
  flex-direction: column;
  gap: .55rem;
  min-width: 0;
  padding: .9rem .95rem;
  border-radius: var(--r-md);
  background: color-mix(in srgb, var(--bg-soft) 70%, var(--bg-raised));
  border: 1px solid var(--line);
  position: relative;
  transition:
    border-color var(--dur) var(--ease),
    box-shadow var(--dur) var(--ease),
    background var(--dur),
    transform var(--dur) var(--ease);
}
.gs-step:hover { transform: translateY(-1px); }
.gs-step.is-done {
  opacity: .88;
  border-color: color-mix(in srgb, var(--accent) 22%, var(--line));
}
.gs-step.is-done .gs-num {
  background: color-mix(in srgb, var(--accent) 16%, var(--bg-raised));
  color: var(--accent);
  border-color: transparent;
}
.gs-step.is-current {
  background: var(--bg-raised);
  border-color: color-mix(in srgb, var(--accent) 50%, var(--line));
  box-shadow: var(--shadow-sm);
}
.gs-step.is-current::before {
  content: "";
  position: absolute;
  left: 0;
  top: .55rem;
  bottom: .55rem;
  width: 3px;
  border-radius: 0 2px 2px 0;
  background: var(--accent);
}
.gs-num {
  width: 1.7rem;
  height: 1.7rem;
  border-radius: var(--r-pill);
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  font-size: .78rem;
  font-weight: 750;
  letter-spacing: .01em;
  background: var(--bg);
  color: var(--muted);
  border: 1px solid var(--line);
}
.gs-step.is-current .gs-num {
  background: var(--accent);
  color: var(--accent-ink);
  border-color: var(--accent);
}
.gs-body { display: grid; gap: .2rem; min-width: 0; }
.gs-label {
  font-weight: 650;
  letter-spacing: -.01em;
  line-height: 1.25;
  overflow-wrap: anywhere;
}
.gs-step.is-current .gs-label { color: var(--ink); }
.gs-desc {
  font-size: .8rem;
  color: var(--muted);
  line-height: 1.35;
  overflow-wrap: anywhere;
}
.gs-now {
  align-self: flex-start;
  margin-top: auto;
  font-size: .65rem;
  font-weight: 750;
  letter-spacing: .04em;
  text-transform: uppercase;
  padding: .22rem .5rem;
  border-radius: var(--r-pill);
  background: var(--signal);
  color: var(--signal-ink);
  border: 1px solid color-mix(in srgb, var(--signal-ink) 10%, transparent);
}
.gs-step > .gs-num { margin-bottom: .05rem; }

/* Badges / chips */
.badge {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  font-size: .7rem;
  font-weight: 720;
  text-transform: uppercase;
  letter-spacing: .05em;
  padding: .32rem .62rem;
  border-radius: var(--r-pill);
  background: var(--bg-soft);
  color: var(--muted);
  border: 1px solid var(--line);
}
.badge.tier {
  background: var(--signal);
  color: var(--signal-ink);
  border-color: transparent;
}
.badge.ok {
  background: color-mix(in srgb, var(--accent) 16%, var(--bg-raised));
  color: var(--accent-hover); /* #818CF8 ≥4.5:1 on raised */
  border-color: transparent;
}
.badge.pend {
  background: color-mix(in srgb, var(--warn) 22%, var(--bg-raised));
  color: #FDE68A; /* amber-200 ≥4.5:1 on dark amber wash */
  border-color: color-mix(in srgb, var(--warn) 35%, transparent);
}
html[data-theme="light"] .badge.pend {
  color: #92400E;
  background: color-mix(in srgb, var(--warn) 18%, #fff);
}

/* Grids & tiles */
.grid { display: grid; gap: var(--space-gap); min-width: 0; align-items: stretch; }
.cols-3 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 15rem), 1fr)); }
.cols-demos { grid-template-columns: repeat(auto-fill, minmax(min(100%, 14.5rem), 1fr)); gap: var(--space-gap-sm); }
.stats-grid { gap: var(--space-gap-sm); align-items: stretch; }
.stats-grid > .tile,
.grid.cols-3 > .tile,
.billing-grid > .billing-card,
.settings-grid > .settings-card,
.tier-pick > .tier-option {
  height: 100%;
  display: flex;
  flex-direction: column;
}

.tile {
  background: var(--bg-raised);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: var(--s-5) var(--s-5) var(--s-5);
  box-shadow: var(--shadow-sm);
  min-width: 0;
  position: relative;
  overflow: hidden;
  transition:
    transform var(--dur-slow) var(--ease),
    box-shadow var(--dur-slow) var(--ease),
    border-color var(--dur-slow) var(--ease);
}
.tile::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 5%, transparent), transparent 42%);
  opacity: 0;
  transition: opacity var(--dur-slow) var(--ease);
  pointer-events: none;
}
.tile:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow);
  border-color: var(--line-strong);
}
.tile:hover::after { opacity: 1; }
.tile-accent {
  border-color: color-mix(in srgb, var(--accent) 48%, var(--line));
  background:
    linear-gradient(160deg, color-mix(in srgb, var(--accent) 8%, var(--bg-raised)), var(--bg-raised) 55%);
}
.tile-accent:hover {
  border-color: color-mix(in srgb, var(--accent) 65%, var(--line));
  box-shadow: var(--shadow-glow);
}
.tile h3 {
  font-size: .72rem;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--muted);
  font-weight: 720;
  margin: 0;
}
.tile-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .5rem;
  margin-bottom: .55rem;
  min-width: 0;
  position: relative;
  z-index: 1;
}
.stat-row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: .75rem;
  min-width: 0;
  position: relative;
  z-index: 1;
}
.stat {
  font-size: clamp(1.65rem, 4vw, 2.05rem);
  font-weight: 720;
  letter-spacing: -.035em;
  line-height: 1.05;
  min-width: 0;
  font-variant-numeric: tabular-nums;
}
.stat.accent,
.stat[style*="accent"] { color: var(--accent); }
.stat small {
  font-size: .92rem;
  color: var(--faint);
  font-weight: 520;
  letter-spacing: -.01em;
}
.tile-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .35rem .55rem;
  margin: .55rem 0 0;
  font-size: .82rem;
  color: var(--muted);
  position: relative;
  z-index: 1;
}
.chip {
  display: inline-flex;
  align-items: center;
  font-size: .68rem;
  font-weight: 720;
  letter-spacing: .02em;
  padding: .18rem .45rem;
  border-radius: var(--r-pill);
  background: var(--bg-soft);
  color: var(--muted);
  border: 1px solid var(--line);
  white-space: nowrap;
}
.chip.ok {
  background: color-mix(in srgb, var(--accent) 14%, var(--bg-raised));
  color: var(--accent);
  border-color: transparent;
}
.chip.subtle { color: var(--faint); }
.trend {
  font-size: .7rem;
  font-weight: 750;
  letter-spacing: .01em;
  font-variant-numeric: tabular-nums;
  padding: .15rem .4rem;
  border-radius: var(--r-pill);
  white-space: nowrap;
}
.trend.up {
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 14%, transparent);
}
.trend.down {
  color: var(--danger);
  background: var(--danger-soft);
}
.trend.flat {
  color: var(--faint);
  background: var(--bg-soft);
}

/* Sparklines */
.spark {
  display: inline-flex;
  align-items: flex-end;
  gap: 2px;
  height: 1.75rem;
  min-width: 3.2rem;
  flex: 0 0 auto;
  padding: .1rem 0;
}
.spark i {
  display: block;
  width: .28rem;
  min-height: 2px;
  height: var(--h, 40%);
  border-radius: 2px 2px 1px 1px;
  background: color-mix(in srgb, var(--accent) 55%, var(--line-strong));
  opacity: .85;
  transition: height var(--dur-slow) var(--ease);
}
.spark.accent i { background: var(--accent); }
.spark i:last-child {
  opacity: 1;
  background: var(--signal);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--signal-ink) 8%, transparent);
}

.meter {
  height: .42rem;
  border-radius: var(--r-pill);
  background: var(--bg-soft);
  overflow: hidden;
  margin-top: .8rem;
  border: 1px solid var(--line);
  position: relative;
  z-index: 1;
}
.meter > i {
  display: block;
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--accent), color-mix(in srgb, var(--accent) 65%, var(--signal)));
  border-radius: var(--r-pill);
  transition: width var(--dur-meter) var(--ease-out);
}

/* Sections */
.section {
  margin-top: var(--space-section);
  min-width: 0;
}
.section > h2 {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: .35rem .6rem;
  margin-bottom: .85rem;
}
.section > h2 .count {
  font-size: .82rem;
  color: var(--faint);
  font-weight: 520;
  letter-spacing: -.01em;
}

/* Demo gallery */
.demo-gallery { gap: .85rem; }
.demo {
  background: var(--bg-raised);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  min-width: 0;
  transition:
    transform var(--dur-slow) var(--ease),
    box-shadow var(--dur-slow) var(--ease),
    border-color var(--dur-slow) var(--ease);
}
.demo:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow);
  border-color: color-mix(in srgb, var(--accent) 32%, var(--line));
}
.demo:hover .thumb img { transform: scale(1.045); }
.demo:hover .thumb-veil { opacity: .14; }
.demo:hover .demo-link {
  border-color: var(--accent);
  color: var(--accent);
}
.demo .thumb {
  position: relative;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background:
    radial-gradient(120% 90% at 10% 0%, color-mix(in srgb, var(--accent) 12%, transparent), transparent 55%),
    linear-gradient(145deg, var(--bg-soft), var(--line));
  display: grid;
  place-items: center;
  color: var(--faint);
}
.demo .thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform var(--dur-slow) var(--ease-out);
}
.thumb-veil {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(180deg, transparent 40%, color-mix(in srgb, var(--ink) 22%, transparent));
  opacity: 0;
  transition: opacity var(--dur) var(--ease);
}
.thumb-fallback {
  font-size: .78rem;
  font-weight: 620;
  letter-spacing: .02em;
  text-align: center;
  padding: .75rem;
  color: var(--muted);
  max-width: 90%;
  overflow-wrap: anywhere;
}
.demo .body { padding: .9rem 1rem 1.05rem; }
.demo .name {
  font-weight: 640;
  letter-spacing: -.015em;
  overflow-wrap: anywhere;
  line-height: 1.25;
}
.demo .foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: .7rem;
  gap: .5rem;
}
.demo-link { flex: 0 0 auto; }
.demo.is-pending { opacity: .92; }
.demo.is-pending .thumb {
  background:
    repeating-linear-gradient(-45deg, var(--bg-soft), var(--bg-soft) 8px,
      color-mix(in srgb, var(--line) 70%, var(--bg-soft)) 8px,
      color-mix(in srgb, var(--line) 70%, var(--bg-soft)) 16px);
}

/* Replies */
.replies { display: grid; gap: .7rem; }
.reply {
  display: grid;
  gap: .25rem;
  padding: 1rem 1.15rem;
  background: var(--bg-raised);
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  border-radius: var(--r-md);
  transition:
    border-color var(--dur) var(--ease),
    box-shadow var(--dur) var(--ease),
    transform var(--dur) var(--ease);
  min-width: 0;
}
.reply:hover {
  box-shadow: var(--shadow-sm);
  border-color: var(--line-strong);
  transform: translateX(2px);
}
.reply .from {
  font-weight: 650;
  overflow-wrap: anywhere;
  letter-spacing: -.015em;
}
.reply .snip {
  color: var(--muted);
  font-size: .9rem;
  overflow-wrap: anywhere;
}
.reply .at {
  color: var(--faint);
  font-size: .76rem;
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
}

/* Empty states */
.empty {
  text-align: center;
  padding: clamp(2rem, 5vw, 2.75rem) 1.25rem;
  color: var(--muted);
  border: 1px dashed var(--line-strong);
  border-radius: var(--r-lg);
  background:
    radial-gradient(80% 70% at 50% 0%, color-mix(in srgb, var(--accent) 6%, transparent), transparent 60%),
    var(--bg-soft);
  overflow-wrap: anywhere;
  display: grid;
  justify-items: center;
  gap: .55rem;
}
.empty-icon {
  width: 3rem;
  height: 3rem;
  border-radius: var(--r-md);
  display: grid;
  place-items: center;
  background: var(--bg-raised);
  border: 1px solid var(--line);
  color: var(--accent);
  margin-bottom: .15rem;
}
.empty-icon svg {
  width: 1.35rem;
  height: 1.35rem;
  display: block;
}
.empty-title {
  margin: 0;
  font-size: 1rem;
  font-weight: 650;
  color: var(--ink);
  letter-spacing: -.02em;
}
.empty-body {
  margin: 0;
  max-width: 28rem;
  font-size: .9rem;
  line-height: 1.5;
  color: var(--muted);
}
.empty b { color: var(--ink); font-weight: 650; }

/* Footer */
.foot-site {
  border-top: 1px solid var(--line);
  margin-top: 3rem;
  padding: 1.5rem 0;
  color: var(--faint);
  font-size: .8rem;
  letter-spacing: .01em;
}

/* -------------------------------------------------------------------------- */
/* Controls                                                                   */
/* -------------------------------------------------------------------------- */
.section-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: .85rem;
}
.section-head h2 { margin-bottom: .25rem; }
.control-copy {
  margin: 0;
  max-width: 48rem;
  font-size: .9rem;
}
.control-card {
  padding: clamp(1rem, 3vw, 1.4rem);
  background: var(--bg-raised);
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-sm);
  min-width: 0;
}
.control-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: .75rem;
}
.action-form { min-width: 0; }
.control-btn {
  width: 100%;
  min-height: 4.7rem;
  justify-content: space-between;
  align-items: flex-start;
  text-align: left;
  border-radius: var(--r-md);
  padding: .9rem 1rem;
  gap: .65rem;
  position: relative;
  overflow: hidden;
}
.control-btn::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: transparent;
  transition: background var(--dur);
}
.control-label {
  display: grid;
  gap: .3rem;
  min-width: 0;
  flex: 1 1 auto;
}
.control-name {
  line-height: 1.25;
  font-weight: 650;
  overflow-wrap: break-word;
  word-break: normal;
  hyphens: none;
}
.control-hint {
  font-size: .72rem;
  font-weight: 550;
  letter-spacing: .01em;
  color: var(--muted);
  line-height: 1.3;
}

/* Job status chips — text ≥4.5:1 on chip surface */
.job-status {
  display: inline-flex;
  align-items: center;
  gap: .28rem;
  white-space: nowrap;
  font-size: .68rem;
  font-weight: 750;
  letter-spacing: .03em;
  text-transform: uppercase;
  padding: .28rem .5rem;
  border-radius: var(--r-pill);
  flex: 0 0 auto;
  color: var(--muted);
  background: color-mix(in srgb, var(--bg-soft) 80%, transparent);
  border: 1px solid var(--line);
}
.control-btn.primary .job-status.idle,
.control-btn.primary .job-status:not(.queued):not(.running):not(.done):not(.failed) {
  color: var(--accent-ink);
  background: color-mix(in srgb, var(--accent-ink) 12%, transparent);
  border-color: color-mix(in srgb, var(--accent-ink) 18%, transparent);
}
.job-status.idle { color: var(--muted); }
/* Amber pill: light ink on dark amber wash (dark theme) */
.job-status.queued,
.control-btn.primary .job-status.queued,
.control-btn.danger .job-status.queued,
.control-btn.ghost .job-status.queued {
  color: #FEF3C7; /* amber-100 — high contrast on dark amber wash */
  background: color-mix(in srgb, var(--warn) 28%, var(--bg-raised));
  border-color: color-mix(in srgb, var(--warn) 50%, transparent);
}
html[data-theme="light"] .job-status.queued,
html[data-theme="light"] .control-btn.primary .job-status.queued,
html[data-theme="light"] .control-btn.danger .job-status.queued,
html[data-theme="light"] .control-btn.ghost .job-status.queued {
  color: #78350F; /* amber-900 on light amber wash */
  background: color-mix(in srgb, var(--warn) 24%, #fff);
  border-color: color-mix(in srgb, var(--warn) 42%, transparent);
}
.job-status.running,
.control-btn.primary .job-status.running,
.control-btn.danger .job-status.running,
.control-btn.ghost .job-status.running {
  color: var(--signal-ink);
  background: var(--signal);
  border-color: color-mix(in srgb, var(--signal-ink) 12%, transparent);
}
.job-status.done,
.control-btn.primary .job-status.done,
.control-btn.danger .job-status.done,
.control-btn.ghost .job-status.done {
  color: var(--accent-hover);
  background: color-mix(in srgb, var(--accent) 14%, var(--bg-raised));
  border-color: color-mix(in srgb, var(--accent) 32%, transparent);
}
.job-status.failed,
.control-btn.primary .job-status.failed,
.control-btn.danger .job-status.failed,
.control-btn.ghost .job-status.failed {
  color: #fff;
  background: var(--danger);
  border-color: var(--danger);
}
.job-status.running i {
  display: inline-block;
  animation: spin 1s linear infinite;
}

.control-btn.state-queued::before { background: var(--warn); }
.control-btn.state-running::before {
  background: var(--signal);
  box-shadow: 0 0 12px color-mix(in srgb, var(--signal) 60%, transparent);
}
.control-btn.state-done::before { background: var(--accent); }
.control-btn.state-failed::before { background: var(--danger); }
.control-btn.primary.state-queued {
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--warn) 35%, transparent);
}
.control-btn.primary.state-running {
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--signal) 45%, transparent), var(--shadow-sm);
  animation: pulse-ring 1.8s var(--ease) infinite;
}
.control-btn.primary.state-done { filter: saturate(1.05); }
.control-btn.primary.state-failed {
  background: color-mix(in srgb, var(--danger) 12%, var(--accent));
  border-color: var(--danger);
}

.activity-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: .75rem;
  margin-top: 1.25rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
}
.activity-head h3 {
  font-size: .9rem;
  margin: 0;
  letter-spacing: -.015em;
}
.activity-list {
  list-style: none;
  padding: 0;
  margin: .45rem 0 0;
}
.activity-list li {
  display: block;
  padding: .72rem .4rem;
  border-bottom: 1px solid var(--line);
  font-size: .85rem;
  min-width: 0;
  border-radius: var(--r-xs);
  transition: background var(--dur) var(--ease);
}
.activity-list li:hover:not(.activity-empty) {
  background: var(--bg-soft);
}
.activity-list li:last-child { border: 0; }
.activity-list .activity-empty {
  display: flex;
  color: var(--muted);
  justify-content: center;
  padding: 1.15rem;
  text-align: center;
}
/* One row: label (truncate) + status (fixed) + time (fixed) */
.activity-row {
  display: flex;
  align-items: center;
  gap: .5rem .65rem;
  min-width: 0;
}
.activity-name {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 600;
  color: var(--ink);
}
.activity-row .job-status {
  flex: 0 0 auto;
}
.activity-row time {
  flex: 0 0 auto;
  font-family: var(--mono);
  font-size: .7rem;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
  color: var(--muted);
}
/* Progress is the valuable line — full width, never truncated mid-word */
.activity-progress {
  margin: .3rem 0 0;
  font-size: .8rem;
  line-height: 1.35;
  color: var(--muted);
  overflow-wrap: break-word;
  word-break: normal;
  hyphens: none;
}

/* Toast */
.toast {
  position: fixed;
  right: max(.75rem, calc((100vw - var(--container)) / 2));
  bottom: 1rem;
  z-index: 50;
  max-width: min(24rem, calc(100vw - 1.5rem));
  padding: .85rem 1.05rem;
  border-radius: var(--r-md);
  color: var(--signal-ink);
  background: var(--signal);
  border: 1px solid color-mix(in srgb, var(--signal-ink) 14%, transparent);
  box-shadow: var(--shadow);
  font-size: .88rem;
  font-weight: 650;
  animation: toast-in var(--dur-slow) var(--ease);
}
.toast[hidden] { display: none; }

/* -------------------------------------------------------------------------- */
/* Reveal animations (default visible without .js)                            */
/* -------------------------------------------------------------------------- */
.js .reveal {
  opacity: 0;
  transform: translateY(16px);
}
.js .reveal.revealed {
  opacity: 1;
  transform: none;
  transition: opacity var(--dur-reveal) var(--ease), transform var(--dur-reveal) var(--ease);
  transition-delay: calc(var(--reveal-i, 0) * 60ms);
}

/* -------------------------------------------------------------------------- */
/* Admin tables                                                               */
/* -------------------------------------------------------------------------- */
.table {
  width: 100%;
  border-collapse: collapse;
  font-size: .88rem;
}
.table th,
.table td {
  text-align: left;
  padding: .7rem .75rem;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}
.table th {
  color: var(--muted);
  font-weight: 650;
  font-size: .72rem;
  text-transform: uppercase;
  letter-spacing: .05em;
  background: color-mix(in srgb, var(--bg-soft) 55%, var(--bg-raised));
}
.table tbody tr {
  transition: background var(--dur) var(--ease);
}
.table tr:hover td { background: var(--bg-soft); }
.table code {
  font-family: var(--mono);
  font-size: .76rem;
  font-variant-numeric: tabular-nums;
  color: var(--muted);
}
.row-detail-link {
  color: inherit;
  font-weight: 620;
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: color var(--dur), border-color var(--dur);
}
.row-detail-link:hover {
  color: var(--accent);
  border-bottom-color: color-mix(in srgb, var(--accent) 45%, transparent);
}
.fleet-row:hover .row-detail-link {
  color: var(--accent);
}
.table-shell {
  max-width: 100%;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--bg-raised);
  -webkit-overflow-scrolling: touch;
  box-shadow: var(--shadow-sm);
  /* Visible scroll affordance — page never scrolls sideways */
  background-image:
    linear-gradient(to right, var(--bg-raised) 30%, transparent),
    linear-gradient(to left, var(--bg-raised) 30%, transparent),
    linear-gradient(to right, rgba(0, 0, 0, .22), transparent),
    linear-gradient(to left, rgba(0, 0, 0, .22), transparent);
  background-position: left center, right center, left center, right center;
  background-repeat: no-repeat;
  background-size: 2.5rem 100%, 2.5rem 100%, .75rem 100%, .75rem 100%;
  background-attachment: local, local, scroll, scroll;
}
.table-shell .table {
  width: 100%;
  min-width: 36rem;
  margin: 0;
}
.table-shell .table th:first-child,
.table-shell .table td:first-child { padding-left: 1.05rem; }
.table-shell .table th:last-child,
.table-shell .table td:last-child { padding-right: 1.05rem; }
.table-shell .table tr:last-child td { border-bottom: 0; }

/* Stacked definition cards for tables (phones) — enabled via .table-cards */
@media (max-width: 767px) {
  .table-shell.table-cards {
    overflow-x: visible;
    background-image: none;
    border: 0;
    box-shadow: none;
    border-radius: 0;
    background-color: transparent;
  }
  .table-shell.table-cards .table {
    min-width: 0;
    width: 100%;
    border-collapse: separate;
    border-spacing: 0 .75rem;
  }
  .table-shell.table-cards thead {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
  }
  .table-shell.table-cards tbody tr {
    display: block;
    background: var(--bg-raised);
    border: 1px solid var(--line);
    border-radius: var(--r-lg);
    box-shadow: var(--shadow-sm);
    padding: .35rem 0;
    margin: 0;
  }
  .table-shell.table-cards tbody tr:hover td {
    background: transparent;
  }
  .table-shell.table-cards tbody td {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    width: 100%;
    padding: .65rem 1rem;
    border-bottom: 1px solid var(--line);
    text-align: right;
    white-space: normal;
    overflow-wrap: anywhere;
    min-height: var(--touch);
  }
  .table-shell.table-cards tbody td:last-child {
    border-bottom: 0;
  }
  .table-shell.table-cards tbody td::before {
    content: attr(data-label);
    flex: 0 0 auto;
    max-width: 45%;
    text-align: left;
    font-family: var(--mono);
    font-size: .68rem;
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
    color: var(--muted);
    padding-top: .15rem;
  }
  .table-shell.table-cards tbody td:not([data-label])::before,
  .table-shell.table-cards tbody td[data-label=""]::before {
    content: none;
  }
  .table-shell.table-cards .table th:first-child,
  .table-shell.table-cards .table td:first-child,
  .table-shell.table-cards .table th:last-child,
  .table-shell.table-cards .table td:last-child {
    padding-left: 1rem;
    padding-right: 1rem;
  }
}
.job-error {
  max-width: 24rem;
  overflow-wrap: anywhere;
  color: var(--muted);
}

/* -------------------------------------------------------------------------- */
/* Keyframes                                                                  */
/* -------------------------------------------------------------------------- */
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes toast-in {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}
@keyframes pulse-ring {
  0%, 100% {
    box-shadow: 0 0 0 0 color-mix(in srgb, var(--signal) 0%, transparent), var(--shadow-sm);
  }
  50% {
    box-shadow: 0 0 0 4px color-mix(in srgb, var(--signal) 22%, transparent), var(--shadow-sm);
  }
}

/* -------------------------------------------------------------------------- */
/* Responsive — stack, never squeeze · 360 / 390 / 414 / 768 / 1024 / 1440   */
/* Cardinal rule: when space runs out, elements STACK at full size/padding.   */
/* -------------------------------------------------------------------------- */

/* Readable measure on wide screens */
.lead,
.landing-lede,
.section-lead,
.card-copy,
.empty-body,
.muted.control-copy,
.settings-head p {
  max-width: var(--body-measure);
}
h1, h2, .pagehead h1 {
  overflow-wrap: anywhere;
  hyphens: auto;
}

/* Tablet and below: multi-column product grids collapse */
@media (max-width: 1023px) {
  .gs-steps { grid-template-columns: minmax(0, 1fr); }
  .gs-step {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: .65rem .75rem;
  }
  .gs-step > .gs-num { margin: 0; }
  .gs-body { flex: 1 1 10rem; min-width: 0; }
  .gs-now { margin-top: 0; align-self: center; }
  .tier-pick { grid-template-columns: 1fr; }
  .settings-grid { grid-template-columns: 1fr; }
  .usage-card { grid-column: auto; }
  .billing-grid { grid-template-columns: 1fr; }
  .site-workbench { grid-template-columns: 1fr; }
  .site-controls {
    max-height: none;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
  .site-frame-wrap { min-height: 28rem; }
  #sg-preview { min-height: 28rem; }
  .site-builder-head { align-items: flex-start; flex-direction: column; }
  .site-publish-state { margin-left: 0; }
  .cols-3 { grid-template-columns: minmax(0, 1fr); }
  .stats-grid { grid-template-columns: minmax(0, 1fr); }
  .control-grid { grid-template-columns: minmax(0, 1fr); }
  .pagehead {
    flex-wrap: wrap;
    align-items: flex-start;
    gap: .75rem;
  }
  .pagehead .spacer { display: none; }
}

@media (max-width: 767px) {
  .site-mobile-tabs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    margin-bottom: .65rem;
    padding: .25rem;
    border: 1px solid var(--line);
    border-radius: var(--r-md);
    background: var(--bg-raised);
  }
  .site-mobile-tabs button {
    min-height: var(--touch);
    border: 0;
    border-radius: var(--r-sm);
    background: transparent;
    color: var(--muted);
    font: 650 .8rem var(--font);
  }
  .site-mobile-tabs button[aria-selected="true"] { color: var(--accent-ink); background: var(--accent); }
  .site-workbench[data-builder-view="edit"] .site-canvas,
  .site-workbench[data-builder-view="preview"] .site-controls { display: none; }
  .site-workbench[data-builder-view="preview"] .site-canvas { min-height: calc(100svh - 12rem); }
  .site-contact-grid { grid-template-columns: 1fr; }
}

@media (max-width: 767px) {
  body { font-size: 15.5px; }
  .who { display: none; }
  .cols-demos { grid-template-columns: minmax(0, 1fr); }
  .section-head {
    align-items: flex-start;
    flex-direction: column;
  }
  .activity-row {
    flex-wrap: wrap;
    row-gap: .35rem;
  }
  .activity-name {
    flex: 1 1 100%;
    max-width: 100%;
  }
  .demo .foot { flex-wrap: wrap; }
  .control-btn {
    min-height: 4.2rem;
    align-items: center;
  }
  .stat-row { align-items: center; }
  main { padding: 1.25rem 0 3rem; }
  .wrap {
    padding-left: max(1rem, env(safe-area-inset-left, 0px));
    padding-right: max(1rem, env(safe-area-inset-right, 0px));
  }
  .topbar .row {
    padding-left: max(1rem, env(safe-area-inset-left, 0px));
    padding-right: max(1rem, env(safe-area-inset-right, 0px));
    gap: .55rem;
  }
  .topbar {
    padding-top: env(safe-area-inset-top, 0px);
    height: calc(var(--nav-h) + env(safe-area-inset-top, 0px));
  }
  .topbar.is-scrolled {
    height: calc(var(--nav-h-scrolled) + env(safe-area-inset-top, 0px));
  }
  .toast {
    left: max(.75rem, env(safe-area-inset-left, 0px));
    right: max(.75rem, env(safe-area-inset-right, 0px));
    max-width: none;
  }
  .gs-card {
    margin-bottom: 1.2rem;
    padding: 1.1rem 1rem;
  }
  .gs-step.is-current::before {
    top: .4rem;
    bottom: .4rem;
  }
  /* Forms: full-width actions on phones — never shrink */
  .auth .btn,
  .settings-card .btn,
  .settings-card form .btn,
  .billing-actions .btn,
  .billing-actions form,
  .billing-actions form .btn,
  .gs-next .btn,
  .gs-step .btn,
  .gs-step form,
  .gs-step form .btn {
    width: 100%;
    max-width: 100%;
    justify-content: center;
  }
  .billing-actions {
    flex-direction: column;
    align-items: stretch;
  }
  .connected-row {
    flex-direction: column;
    align-items: stretch;
  }
  .connected-row .btn { width: 100%; justify-content: center; }
  .gs-step {
    grid-template-columns: auto 1fr;
  }
  .gs-step .btn,
  .gs-step form,
  .gs-step .chip {
    grid-column: 1 / -1;
    justify-self: stretch;
  }
  .settings-card .btn { justify-self: stretch; }
  .tile,
  .settings-card,
  .billing-card,
  .control-card,
  .section,
  .pipe-step {
    /* Full padding preserved — never compress cards on phones */
    padding-left: max(1rem, .95rem);
    padding-right: max(1rem, .95rem);
  }
}

/* Phone floor ~360–414 — still stack, never squeeze type/cards */
@media (max-width: 414px) {
  .tile { padding: 1.05rem 1rem; }
  .control-card { padding: 1rem; }
  .control-btn {
    flex-wrap: wrap;
    gap: .45rem;
  }
  .job-status { font-size: .64rem; }
  .pagehead { gap: .45rem; }
  .badge { font-size: .66rem; }
  .gs-head { flex-direction: column; }
  .gs-step { padding: .85rem .9rem; }
  .brand { font-size: .98rem; }
  .auth .card { padding: 1.35rem 1.15rem; }
  .site-contact-grid { grid-template-columns: 1fr; }
  .site-builder { padding: .85rem max(.75rem, env(safe-area-inset-left)) 1.5rem max(.75rem, env(safe-area-inset-right)); }
  .site-workbench { border-radius: var(--r-lg); }
}

@media (min-width: 1280px) {
  .wrap { padding-left: 2rem; padding-right: 2rem; }
  .stats-grid { gap: 1.05rem; }
  .section { margin-top: 2.75rem; }
}

@media (min-width: 1440px) {
  .wrap { padding-left: 2.25rem; padding-right: 2.25rem; }
}

/* -------------------------------------------------------------------------- */
/* Reduced motion                                                             */
/* -------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
  }
  .js .reveal,
  .js .reveal.revealed {
    opacity: 1;
    transform: none;
    transition: none !important;
    transition-delay: 0s !important;
  }
  .demo:hover .thumb img { transform: none; }
  .control-btn.primary.state-running { animation: none; }
  .tile:hover,
  .demo:hover,
  .reply:hover,
  .gs-step:hover,
  .tier-option:hover,
  .btn:hover {
    transform: none;
  }
  #sg-preview { transition: none !important; }
  .site-toggles i,
  .site-toggles i::after,
  .site-swatches label {
    transition: none !important;
  }
}

/* -------------------------------------------------------------------------- */
/* App shell — left sidebar + main column                                     */
/* -------------------------------------------------------------------------- */
.app-shell {
  display: flex;
  min-height: 100dvh;
  min-width: 0;
}
.app-sidebar {
  position: sticky;
  top: 0;
  align-self: flex-start;
  width: var(--sidebar-w);
  height: 100dvh;
  flex: 0 0 var(--sidebar-w);
  display: flex;
  flex-direction: column;
  gap: .35rem;
  padding: 1rem .85rem 1.1rem;
  background: color-mix(in srgb, var(--bg-raised) 92%, transparent);
  border-right: 1px solid var(--line);
  z-index: 45;
  overflow-y: auto;
}
.app-sidebar .brand {
  margin: .15rem .35rem 1rem;
  font-size: 1.02rem;
}
.side-nav {
  display: flex;
  flex-direction: column;
  gap: .2rem;
  flex: 1 1 auto;
}
.side-link {
  display: flex;
  align-items: center;
  gap: .65rem;
  padding: .7rem .75rem;
  min-height: var(--touch);
  border-radius: var(--r-md);
  color: var(--muted);
  text-decoration: none;
  font-weight: 600;
  font-size: .9rem;
  border: 1px solid transparent;
  transition:
    background var(--dur) var(--ease),
    color var(--dur) var(--ease),
    border-color var(--dur) var(--ease);
}
.side-link:hover {
  color: var(--ink);
  background: var(--bg-soft);
}
.side-link.is-active {
  color: var(--ink);
  background: color-mix(in srgb, var(--accent) 14%, var(--bg-raised));
  border-color: color-mix(in srgb, var(--accent) 28%, transparent);
  box-shadow: var(--shadow-sm);
}
.side-link.is-soon {
  opacity: .55;
  cursor: not-allowed;
  pointer-events: none;
}
.side-link .side-ico {
  width: 1.15rem;
  height: 1.15rem;
  flex: 0 0 auto;
  opacity: .9;
}
.side-link .side-soon {
  margin-left: auto;
  font-family: var(--mono);
  font-size: .62rem;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--faint);
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  padding: .15rem .4rem;
}
.side-foot {
  margin-top: auto;
  padding-top: .85rem;
  border-top: 1px solid var(--line);
  display: grid;
  gap: .55rem;
}
.side-who {
  font-size: .78rem;
  color: var(--muted);
  padding: 0 .35rem;
  overflow-wrap: anywhere;
}
.side-who b { color: var(--ink); font-weight: 650; }
.app-column {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.app-shell .topbar {
  max-width: none;
}
.app-shell .topbar .row {
  max-width: none;
}
.app-shell .app-column > .wrap.foot-wrap,
.app-shell .app-column > footer {
  margin-top: auto;
}
body.has-app-shell .foot-site {
  margin-top: 1.5rem;
}
body.has-app-shell {
  padding-bottom: 0;
}

/* Mobile: hamburger drawer + bottom nav (≤1023px) */
.sidebar-toggle {
  display: none;
  place-items: center;
  width: var(--touch);
  height: var(--touch);
  min-width: var(--touch);
  min-height: var(--touch);
  border-radius: var(--r-sm);
  border: 1px solid var(--line);
  background: var(--bg-raised);
  color: var(--muted);
  cursor: pointer;
  padding: 0;
  flex: 0 0 auto;
}
.sidebar-toggle svg { width: 1.15rem; height: 1.15rem; }
.sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .5);
  z-index: 44;
  border: 0;
  padding: 0;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.mobile-nav {
  display: none;
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 46;
  height: calc(var(--mobile-nav-h) + env(safe-area-inset-bottom, 0px));
  padding: .35rem .4rem calc(.35rem + env(safe-area-inset-bottom, 0px));
  padding-left: max(.4rem, env(safe-area-inset-left, 0px));
  padding-right: max(.4rem, env(safe-area-inset-right, 0px));
  background: color-mix(in srgb, var(--bg-raised) 94%, transparent);
  border-top: 1px solid var(--line);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  justify-content: space-around;
  align-items: stretch;
  gap: .2rem;
}
.mobile-nav a {
  flex: 1 1 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: .15rem;
  font-size: .65rem;
  font-weight: 650;
  color: var(--muted);
  text-decoration: none;
  border-radius: var(--r-sm);
  padding: .35rem .2rem;
  min-width: 0;
  min-height: var(--touch);
}
.mobile-nav a.is-active {
  color: var(--accent-hover);
  background: color-mix(in srgb, var(--accent) 12%, transparent);
}
.mobile-nav a svg {
  width: 1.2rem;
  height: 1.2rem;
}
.mobile-nav a.is-soon,
.mobile-nav span.is-soon {
  opacity: .45;
  pointer-events: none;
  flex: 1 1 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: .15rem;
  font-size: .65rem;
  font-weight: 650;
  color: var(--muted);
  min-width: 0;
  min-height: var(--touch);
}
.mobile-nav span.is-soon svg {
  width: 1.2rem;
  height: 1.2rem;
}

/* Scroll lock while drawer open (position fixed set by JS via class) */
body.is-scroll-locked {
  position: fixed;
  left: 0;
  right: 0;
  width: 100%;
  overflow: hidden;
  overscroll-behavior: none;
}

@media (max-width: 1023px) {
  .app-sidebar {
    position: fixed;
    left: 0;
    top: 0;
    width: min(var(--sidebar-w), calc(100vw - 3rem));
    max-width: 20rem;
    height: 100dvh;
    height: 100svh;
    padding-top: max(1rem, env(safe-area-inset-top, 0px));
    padding-bottom: max(1.1rem, env(safe-area-inset-bottom, 0px));
    transform: translateX(-105%);
    transition: transform var(--dur-slow) var(--ease);
    box-shadow: var(--shadow);
    z-index: 45;
  }
  body.sidebar-open .app-sidebar { transform: translateX(0); }
  body.sidebar-open .sidebar-backdrop { display: block; }
  .sidebar-toggle { display: grid; }
  .mobile-nav { display: flex; }
  body.has-app-shell {
    padding-bottom: calc(var(--mobile-nav-h) + env(safe-area-inset-bottom, 0px));
  }
  body.has-app-shell .toast {
    bottom: calc(var(--mobile-nav-h) + env(safe-area-inset-bottom, 0px) + 1rem);
  }
  body.has-app-shell .foot-wrap {
    padding-bottom: .5rem;
  }
}
@media (prefers-reduced-motion: reduce) {
  .app-sidebar { transition: none !important; }
}

/* -------------------------------------------------------------------------- */
/* Pipeline stepper (dashboard spine)                                         */
/* -------------------------------------------------------------------------- */
.pipeline {
  display: grid;
  gap: .75rem;
  margin: 0 0 1.5rem;
}
.pipeline-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: .75rem 1rem;
  margin-bottom: .15rem;
}
.pipeline-kicker {
  margin: 0 0 .2rem;
  font-family: var(--mono);
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--accent-hover);
}
.pipeline-head h2 {
  margin: 0;
  font-size: clamp(1.15rem, 2.4vw, 1.4rem);
}
/* Pause control: state label + one action (not a red multi-message box) */
.pipeline-stop {
  display: inline-flex;
  align-items: center;
  gap: .55rem;
  padding: .35rem .4rem .35rem .55rem;
  background: var(--bg-raised);
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  box-shadow: var(--shadow-sm);
}
.pipeline-stop .job-status {
  margin: 0;
}
.pipeline-stop .btn {
  flex: 0 0 auto;
  min-height: 2.25rem;
  padding: .4rem .85rem;
  border-radius: var(--r-pill);
}
.pipeline-stop .btn.danger {
  /* only warn when actively stopping is meaningful — keep quiet when idle */
  color: var(--ink);
  border-color: var(--line);
  background: transparent;
}
.pipeline-stop .btn.danger:hover {
  background: var(--danger-soft);
  color: var(--danger);
  border-color: color-mix(in srgb, var(--danger) 40%, var(--line));
}
.pipeline-stop[data-state="running"] .btn.danger,
.pipeline-stop[data-state="queued"] .btn.danger {
  color: var(--danger);
  border-color: color-mix(in srgb, var(--danger) 40%, var(--line));
}

/* Desktop: wrap cards at ~230px min — never squeeze 5 into narrow columns */
.pipeline-track {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(14.5rem, 1fr));
  gap: .85rem;
}
.pipe-step {
  display: flex;
  flex-direction: column;
  gap: .6rem;
  min-width: 0;
  padding: 1.15rem 1.15rem 1.2rem;
  background: var(--bg-raised);
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
  transition:
    border-color var(--dur) var(--ease),
    box-shadow var(--dur) var(--ease),
    transform var(--dur) var(--ease);
}
/* Horizontal accent bar (desktop / wide) */
.pipe-step::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 2px;
  background: transparent;
}
.pipe-step.is-done::before {
  background: linear-gradient(90deg, var(--accent), var(--accent-violet));
}
.pipe-step.is-current {
  border-color: color-mix(in srgb, var(--accent) 45%, var(--line));
  box-shadow: var(--shadow-glow);
}
.pipe-step.is-current::before {
  background: linear-gradient(90deg, var(--accent), var(--accent-blue));
}
/* Locked: readable, not dim-on-dim */
.pipe-step.is-locked {
  opacity: 1;
  background: var(--bg-soft);
  border-color: var(--line);
}
.pipe-step.is-locked .pipe-title {
  color: var(--ink);
}
.pipe-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .4rem;
}
.pipe-num {
  width: 1.65rem;
  height: 1.65rem;
  border-radius: var(--r-pill);
  display: grid;
  place-items: center;
  font-family: var(--mono);
  font-size: .72rem;
  font-weight: 750;
  background: color-mix(in srgb, var(--accent) 14%, var(--bg-soft));
  color: var(--accent-hover);
  border: 1px solid color-mix(in srgb, var(--accent) 28%, transparent);
  flex: 0 0 auto;
}
.pipe-step.is-done .pipe-num {
  background: color-mix(in srgb, var(--accent) 22%, var(--bg-raised));
  color: var(--accent-hover);
}
.pipe-step.is-current .pipe-num {
  background: var(--accent);
  color: var(--accent-ink);
  border-color: transparent;
}
.pipe-step.is-locked .pipe-num {
  background: color-mix(in srgb, var(--bg-hover) 80%, var(--bg-soft));
  color: var(--muted);
  border-color: var(--line-strong);
}
.pipe-status {
  font-family: var(--mono);
  font-size: .62rem;
  font-weight: 750;
  letter-spacing: .04em;
  text-transform: uppercase;
  padding: .18rem .42rem;
  border-radius: var(--r-pill);
  background: var(--bg-soft);
  color: var(--muted);
  border: 1px solid var(--line);
  white-space: nowrap;
}
.pipe-step.is-done .pipe-status {
  color: var(--accent-hover);
  background: color-mix(in srgb, var(--accent) 12%, transparent);
  border-color: transparent;
}
.pipe-step.is-current .pipe-status {
  color: var(--signal-ink);
  background: var(--signal);
  border-color: transparent;
}
.pipe-step.is-locked .pipe-status {
  color: var(--muted);
  background: color-mix(in srgb, var(--bg-hover) 70%, transparent);
  border-color: var(--line);
}
.pipe-title {
  margin: 0;
  font-size: 1rem;
  font-weight: 650;
  letter-spacing: -.015em;
  line-height: 1.25;
}
.pipe-copy {
  margin: 0;
  font-size: .84rem;
  color: var(--muted);
  line-height: 1.45;
  flex: 1 1 auto;
  overflow-wrap: break-word;
  word-break: normal;
  hyphens: none;
}
.pipe-lock-reason {
  margin: 0;
  font-size: .84rem;
  font-weight: 550;
  color: var(--ink);
  font-style: normal;
  line-height: 1.4;
  overflow-wrap: break-word;
  word-break: normal;
  hyphens: none;
}
.pipe-action {
  margin-top: .2rem;
}
.pipe-action .btn,
.pipe-action .action-form .btn {
  width: 100%;
  justify-content: center;
}
.pipe-action .btn:disabled,
.pipe-action .action-form .btn:disabled {
  opacity: .65;
  cursor: not-allowed;
}
.pipe-action .control-btn {
  min-height: 2.6rem;
  padding: .55rem .75rem;
  align-items: center;
}
.pipe-action .control-label { gap: .1rem; }
.pipe-action .control-hint { display: none; }
.pipe-action .job-status { display: none; }

.pipeline-activity {
  margin-top: .25rem;
}
.pipeline-activity .control-card {
  /* reuse control-card chrome */
}
.pipeline-activity .activity-head {
  margin-top: 0;
  padding-top: 0;
  border-top: 0;
}

.dash-layout {
  display: grid;
  gap: 1.25rem;
}
@media (min-width: 1100px) {
  .dash-layout.has-side {
    grid-template-columns: minmax(0, 1fr) minmax(16rem, 20rem);
    align-items: start;
  }
  .dash-layout.has-side .pipeline-activity {
    position: sticky;
    top: calc(var(--nav-h) + .75rem);
  }
}

/* Hero glow behind page heads / landing cards */
.glow-card {
  position: relative;
  isolation: isolate;
}
.glow-card::after {
  content: "";
  position: absolute;
  z-index: -1;
  inset: -20% -10% auto;
  height: 70%;
  background: radial-gradient(ellipse at 50% 0%, var(--glow-violet), transparent 70%);
  pointer-events: none;
}

/* -------------------------------------------------------------------------- */
/* Marketing landing (anonymous /)                                            */
/* -------------------------------------------------------------------------- */
.landing {
  padding-bottom: 3rem;
}
.landing-hero {
  position: relative;
  padding: clamp(2.5rem, 8vw, 5.5rem) 0 clamp(2rem, 5vw, 3.5rem);
  overflow: hidden;
}
.landing-hero::before {
  content: "";
  position: absolute;
  width: min(28rem, 70vw);
  height: min(28rem, 70vw);
  left: 50%;
  top: -10%;
  transform: translateX(-50%);
  background: radial-gradient(circle, var(--glow-violet), transparent 68%);
  pointer-events: none;
  z-index: 0;
}
.landing-hero .wrap { position: relative; z-index: 1; }
.landing-hero h1 {
  max-width: 16ch;
  font-size: clamp(2.2rem, 6vw, 3.6rem);
  letter-spacing: -.04em;
  margin-bottom: .75rem;
}
.landing-lede {
  max-width: 38rem;
  color: var(--muted);
  font-size: clamp(1.02rem, 2vw, 1.2rem);
  line-height: 1.55;
  margin: 0 0 1.5rem;
}
.landing-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .65rem;
  align-items: center;
  margin-bottom: 1rem;
}
.landing-note {
  color: var(--faint);
  font-size: .82rem;
  margin: 0;
}
.landing-section {
  padding: clamp(2.5rem, 6vw, 4rem) 0;
}
.landing-section h2 {
  font-size: clamp(1.5rem, 3vw, 2rem);
  margin-bottom: .35rem;
}
.landing-section .section-lead {
  color: var(--muted);
  max-width: 36rem;
  margin: 0 0 1.5rem;
}
.how-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: .9rem;
}
.how-card {
  padding: 1.25rem 1.2rem 1.4rem;
  background: var(--bg-raised);
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow);
  min-width: 0;
}
.how-num {
  display: inline-grid;
  place-items: center;
  width: 1.85rem;
  height: 1.85rem;
  border-radius: var(--r-pill);
  font-family: var(--mono);
  font-size: .78rem;
  font-weight: 750;
  margin-bottom: .85rem;
  background: linear-gradient(145deg, var(--accent), var(--accent-violet));
  color: #fff;
  box-shadow: 0 6px 16px color-mix(in srgb, var(--accent) 30%, transparent);
}
.how-card h3 {
  font-size: 1.05rem;
  margin: 0 0 .4rem;
  letter-spacing: -.02em;
}
.how-card p {
  margin: 0;
  color: var(--muted);
  font-size: .9rem;
  line-height: 1.5;
}
.pricing-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: .9rem;
  align-items: stretch;
}
.price-card {
  display: flex;
  flex-direction: column;
  gap: .55rem;
  padding: 1.35rem 1.25rem 1.45rem;
  background: var(--bg-raised);
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-sm);
  min-width: 0;
  transition: transform var(--dur) var(--ease), box-shadow var(--dur), border-color var(--dur);
}
.price-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
  border-color: var(--line-strong);
}
.price-card.is-featured {
  border-color: color-mix(in srgb, var(--accent) 45%, var(--line));
  box-shadow: var(--shadow-glow);
  background:
    linear-gradient(165deg, color-mix(in srgb, var(--accent) 10%, var(--bg-raised)), var(--bg-raised) 55%);
}
.price-tier {
  font-family: var(--mono);
  font-size: .72rem;
  font-weight: 750;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--accent-hover);
}
.price-amt {
  font-size: clamp(1.8rem, 3vw, 2.4rem);
  font-weight: 720;
  letter-spacing: -.03em;
  line-height: 1.05;
}
.price-amt small {
  font-size: .85rem;
  font-weight: 520;
  color: var(--muted);
  letter-spacing: 0;
}
.price-feats {
  list-style: none;
  margin: .35rem 0 1rem;
  padding: 0;
  flex: 1 1 auto;
}
.price-feats li {
  padding: .4rem 0;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: .88rem;
}
.price-card .btn { width: 100%; justify-content: center; margin-top: auto; }
.landing-cta {
  text-align: center;
  padding: clamp(2rem, 5vw, 3rem) 1.5rem;
  background: var(--bg-raised);
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
}
.landing-cta::before {
  content: "";
  position: absolute;
  inset: -40% 20% auto;
  height: 80%;
  background: radial-gradient(ellipse, var(--glow-indigo), transparent 70%);
  pointer-events: none;
}
.landing-cta h2 { position: relative; margin-bottom: .4rem; }
.landing-cta p { position: relative; color: var(--muted); margin: 0 0 1.1rem; }
.landing-cta .landing-actions { position: relative; justify-content: center; }

/* Pipeline: single column + left connector below 1024 — never squeeze 5→2 */
@media (max-width: 1023px) {
  .pipeline-track {
    grid-template-columns: minmax(0, 1fr);
    gap: 0;
    padding-left: 1.15rem;
    margin-left: .35rem;
    border-left: 2px solid color-mix(in srgb, var(--accent) 28%, var(--line));
  }
  .pipe-step {
    margin: 0 0 .85rem;
    overflow: visible;
  }
  .pipe-step:last-child {
    margin-bottom: 0;
    grid-column: auto;
  }
  /* Dot on the vertical connector */
  .pipe-step::after {
    content: "";
    position: absolute;
    left: calc(-1.15rem - 5px);
    top: 1.15rem;
    width: .55rem;
    height: .55rem;
    border-radius: 50%;
    background: var(--bg-soft);
    border: 2px solid color-mix(in srgb, var(--accent) 45%, var(--line));
    box-shadow: 0 0 0 3px var(--bg);
    z-index: 1;
  }
  .pipe-step.is-done::after {
    background: var(--accent);
    border-color: var(--accent);
  }
  .pipe-step.is-current::after {
    background: var(--accent-violet);
    border-color: var(--accent-violet);
    box-shadow: 0 0 0 3px var(--bg), 0 0 0 6px color-mix(in srgb, var(--accent) 25%, transparent);
  }
  .pipe-step.is-locked::after {
    background: var(--bg-soft);
    border-color: var(--line-strong);
  }
  /* Keep top accent strip subtle on mobile cards */
  .pipe-step::before { border-radius: var(--r-xl) var(--r-xl) 0 0; }
  .how-grid,
  .pricing-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 767px) {
  .landing-actions { flex-direction: column; align-items: stretch; }
  .landing-actions .btn,
  .landing-cta .landing-actions .btn,
  .price-card .btn {
    width: 100%;
    justify-content: center;
    min-height: var(--touch);
  }
  .landing-hero h1 {
    max-width: none;
    font-size: clamp(1.85rem, 9vw, 2.6rem);
  }
  .landing-section { padding: clamp(2rem, 8vw, 3rem) 0; }
  .how-card,
  .price-card {
    padding: 1.25rem 1.15rem 1.4rem;
  }
  /* Marketing topbar CTAs don't cram — secondary can hide if tight */
  .topbar .btn.sm { min-height: var(--touch); }
}
@media (max-width: 414px) {
  .topbar .row > .btn.ghost.sm { display: none; }
}

/* -------------------------------------------------------------------------- */
/* Territory map picker — full-viewport app screen (no page scroll)           */
/* -------------------------------------------------------------------------- */

/* Lock the app shell: no page scrollbar on /territory */
body.territory-full {
  overflow: hidden;
  height: 100dvh;
  max-height: 100dvh;
}
body.territory-full .app-shell {
  height: 100dvh;
  max-height: 100dvh;
  min-height: 0;
  overflow: hidden;
}
body.territory-full .app-column {
  height: 100dvh;
  max-height: 100dvh;
  min-height: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
body.territory-full .app-column > .topbar {
  flex: 0 0 auto;
}
body.territory-full .app-column > .wrap.foot-wrap,
body.territory-full .app-column > footer,
body.territory-full .foot-wrap {
  display: none !important;
}

.territory-page {
  flex: 1 1 auto;
  min-height: 0;
  height: 100%;
  display: flex;
  flex-direction: column;
  padding: 0;
  overflow: hidden;
}
.territory-shell {
  width: 100%;
  max-width: none;
  margin: 0;
  padding: .45rem .75rem .55rem;
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: .4rem;
  overflow: hidden;
}

/* Compact single-row toolbar */
.territory-toolbar {
  flex: 0 0 auto;
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: .5rem .65rem;
  padding: .35rem .55rem;
  background: var(--bg-raised);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-sm);
  min-width: 0;
}
.territory-brand {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .3rem;
  position: relative;
  flex: 0 0 auto;
  min-width: 0;
  max-width: 12rem;
}
.territory-brand h1 {
  margin: 0;
  font-size: .98rem;
  letter-spacing: -.02em;
  font-weight: 700;
  white-space: nowrap;
}
.territory-info-btn {
  display: inline-grid;
  place-items: center;
  width: 1.7rem;
  height: 1.7rem;
  min-width: 1.7rem;
  min-height: 1.7rem;
  padding: 0;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--bg-soft);
  color: var(--muted);
  cursor: pointer;
}
.territory-info-btn:hover {
  color: var(--ink);
  background: var(--bg-hover);
  border-color: var(--line-strong);
}
.territory-info-btn[aria-expanded="true"] {
  color: var(--accent-ink);
  background: var(--accent);
  border-color: transparent;
}
.territory-info-pop {
  position: absolute;
  top: calc(100% + .4rem);
  left: 0;
  z-index: 20;
  width: min(18rem, 70vw);
  padding: .65rem .75rem;
  background: var(--bg-raised);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  box-shadow: var(--shadow);
  font-size: .82rem;
  line-height: 1.4;
  color: var(--muted);
}
.territory-cap {
  display: inline-block;
  margin-left: .25rem;
  padding: .08rem .4rem;
  border-radius: var(--r-pill);
  background: var(--bg-soft);
  border: 1px solid var(--line);
  font-size: .7rem;
  color: var(--muted);
  font-family: var(--mono);
  white-space: nowrap;
}

/* Segmented Draw / Cities control */
.territory-modes {
  display: inline-flex;
  gap: 0;
  padding: .15rem;
  border-radius: var(--r-pill);
  background: var(--bg-soft);
  border: 1px solid var(--line);
  flex: 0 1 auto;
  min-width: 0;
}
.mode-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .35rem;
  border: 1px solid transparent;
  border-radius: var(--r-pill);
  background: transparent;
  color: var(--muted);
  font-weight: 600;
  font-size: .82rem;
  min-height: 2.1rem;
  min-width: 0;
  padding: .25rem .7rem;
  cursor: pointer;
  line-height: 1;
}
.mode-btn .mode-ico {
  width: 1rem;
  height: 1rem;
  flex: 0 0 auto;
  opacity: .9;
}
.mode-btn.is-active {
  background: var(--accent);
  color: var(--accent-ink);
  border-color: transparent;
  box-shadow: var(--shadow-glow, 0 0 0 1px color-mix(in srgb, var(--accent) 40%, transparent),
    0 4px 16px color-mix(in srgb, var(--accent-violet) 28%, transparent));
  font-weight: 700;
}
.mode-btn:not(.is-active):hover {
  background: var(--bg-hover);
  color: var(--ink);
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* City name search combobox (toolbar) */
.territory-search {
  position: relative;
  flex: 1 1 9rem;
  min-width: 7.5rem;
  max-width: 16rem;
}
.territory-search-input {
  width: 100%;
  min-height: 2.1rem;
  padding: .3rem .65rem;
  border-radius: var(--r-pill);
  border: 1px solid var(--line);
  background: var(--bg-soft);
  color: var(--ink);
  font-family: var(--mono);
  font-size: .78rem;
  letter-spacing: -.01em;
  line-height: 1.2;
  outline: none;
}
.territory-search-input::placeholder {
  color: var(--faint);
  font-family: var(--mono);
}
.territory-search-input:hover {
  border-color: var(--line-strong);
  background: var(--bg-hover);
}
.territory-search-input:focus {
  border-color: color-mix(in srgb, var(--accent) 55%, var(--line));
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 28%, transparent);
  background: var(--bg-raised);
}
.territory-search-list {
  position: absolute;
  top: calc(100% + .3rem);
  left: 0;
  right: 0;
  z-index: 40;
  margin: 0;
  padding: .3rem;
  list-style: none;
  max-height: min(14rem, 40vh);
  overflow-y: auto;
  background: var(--bg-raised);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  box-shadow: var(--shadow);
}
.territory-search-list[hidden] { display: none !important; }
.territory-search-option {
  display: flex;
  flex-direction: column;
  gap: .1rem;
  padding: .45rem .55rem;
  border-radius: var(--r-sm);
  cursor: pointer;
  color: var(--ink);
  min-width: 0;
}
.territory-search-option:hover,
.territory-search-option.is-active {
  background: var(--bg-hover);
}
.territory-search-option.is-active {
  outline: 1px solid color-mix(in srgb, var(--accent) 40%, transparent);
}
.territory-search-option-name {
  font-size: .82rem;
  font-weight: 600;
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.territory-search-option-meta {
  font-family: var(--mono);
  font-size: .68rem;
  color: var(--muted);
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.territory-search-empty {
  padding: .5rem .55rem;
  font-size: .78rem;
  color: var(--muted);
  font-family: var(--mono);
}

.territory-actions {
  display: flex;
  flex-wrap: nowrap;
  gap: .35rem;
  margin-left: auto;
  align-items: center;
  flex: 0 0 auto;
  min-width: 0;
}
.territory-draw-actions {
  display: inline-flex;
  flex-wrap: nowrap;
  gap: .3rem;
  align-items: center;
}
.territory-draw-actions[hidden] { display: none !important; }

/* Slim status strip */
.territory-status {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: .45rem;
  padding: .28rem .6rem;
  border-radius: var(--r-sm);
  background: var(--bg-soft);
  border: 1px solid var(--line);
  font-size: .8rem;
  color: var(--muted);
  min-width: 0;
  min-height: 1.85rem;
}
.territory-status #terr-status-text {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.territory-status .status-dot {
  width: .45rem;
  height: .45rem;
  border-radius: 50%;
  background: var(--faint);
  flex-shrink: 0;
}
.territory-status.is-ok .status-dot { background: var(--accent); }
.territory-status.is-warn .status-dot { background: var(--warn); }
.territory-status.is-err .status-dot { background: var(--danger); }
.territory-status .status-meta {
  margin-left: auto;
  font-family: var(--mono);
  font-size: .72rem;
  color: var(--ink);
  flex: 0 0 auto;
  white-space: nowrap;
}
.territory-status .status-meta.is-over { color: var(--danger); }

/* Map fills ALL remaining height — no fixed rem height */
.territory-map-frame {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  width: 100%;
  height: auto;
  border-radius: var(--r-md);
  overflow: hidden;
  border: 1px solid var(--line-strong);
  background: #0B0E1A;
  box-shadow: var(--shadow);
  touch-action: pan-x pan-y;
}
.territory-map {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  touch-action: pan-x pan-y;
}
.territory-map .maplibregl-canvas-container,
.territory-map .maplibregl-canvas {
  touch-action: pan-x pan-y;
}
.territory-overlay {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 1.25rem;
  background: color-mix(in srgb, var(--bg) 72%, transparent);
  backdrop-filter: blur(4px);
  z-index: 2;
  touch-action: manipulation;
}
.territory-overlay .empty {
  background: var(--bg-raised);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 1.25rem 1.4rem;
  box-shadow: var(--shadow);
  max-width: 22rem;
  width: 100%;
}
.territory-overlay .btn { margin-top: .75rem; min-height: var(--touch); }

/* Floating dismissible instruction card — not layout flow */
.territory-howto {
  position: absolute;
  top: .65rem;
  left: .65rem;
  z-index: 3;
  max-width: min(16.5rem, calc(100% - 5rem));
  padding: .55rem .65rem .6rem;
  background: color-mix(in srgb, var(--bg-raised) 94%, transparent);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  box-shadow: var(--shadow);
  pointer-events: auto;
  touch-action: manipulation;
  backdrop-filter: blur(8px);
}
.territory-howto-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .5rem;
  margin-bottom: .15rem;
}
.territory-howto-kicker {
  font-family: var(--mono);
  font-size: .68rem;
  letter-spacing: .02em;
  text-transform: uppercase;
  color: var(--accent-violet, #8B5CF6);
  font-weight: 600;
}
.territory-howto-dismiss {
  min-width: 1.75rem;
  min-height: 1.75rem;
  padding: 0 .3rem;
  line-height: 1;
  font-size: 1.05rem;
  color: var(--muted);
}
.territory-howto-body {
  margin: 0;
  font-size: .8rem;
  line-height: 1.35;
  color: var(--ink);
}

/* City chips + hover label float over the map */
.territory-chips-float {
  position: absolute;
  left: .65rem;
  right: .65rem;
  bottom: .65rem;
  z-index: 3;
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: .35rem;
  max-height: 30%;
  overflow: auto;
  pointer-events: none;
}
.territory-chips-float[hidden] { display: none !important; }
.territory-chips-float .territory-chip,
.territory-chips-float li {
  pointer-events: auto;
}
.territory-selected li,
.territory-chip {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: .35rem;
  padding: .25rem .35rem .25rem .6rem;
  border-radius: var(--r-pill);
  background: color-mix(in srgb, var(--accent) 22%, var(--bg-raised));
  border: 1px solid color-mix(in srgb, var(--accent) 45%, var(--line));
  font-size: .78rem;
  color: var(--ink);
  min-height: 2rem;
  box-shadow: var(--shadow-sm);
  backdrop-filter: blur(6px);
}
.territory-chip-name {
  font-weight: 550;
  max-width: 11rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.territory-chip-remove {
  min-height: 1.65rem;
  min-width: 1.65rem;
  padding: 0;
  font-size: 1rem;
  line-height: 1;
  color: var(--muted);
}
.territory-hover-pill {
  position: absolute;
  top: .65rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 3;
  margin: 0;
  padding: .28rem .65rem;
  border-radius: var(--r-pill);
  background: color-mix(in srgb, var(--bg-raised) 92%, transparent);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
  font-size: .78rem;
  font-weight: 600;
  color: var(--ink);
  max-width: min(20rem, calc(100% - 7rem));
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  pointer-events: none;
  backdrop-filter: blur(6px);
}
.territory-hover-pill[hidden] { display: none !important; }
.territory-hover-pill.is-pending::after {
  content: "";
  display: inline-block;
  width: .38rem;
  height: .38rem;
  margin-left: .45rem;
  border-radius: 50%;
  background: var(--accent);
  opacity: .65;
  animation: terr-hover-pulse 1s ease-in-out infinite alternate;
}
@keyframes terr-hover-pulse {
  to { opacity: .2; }
}
@media (prefers-reduced-motion: reduce) {
  .territory-hover-pill.is-pending::after { animation: none; }
}

/* Pre-commit territory estimate — what the area holds before search */
.territory-estimate,
.territory-estimate-compare {
  margin: 0 .75rem .55rem;
  padding: .7rem .85rem .75rem;
  border-radius: var(--r-md);
  background: var(--bg-raised);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
  color: var(--ink);
  max-width: 100%;
}
.territory-estimate[hidden],
.territory-estimate-compare[hidden] { display: none !important; }
.territory-estimate.is-loading { opacity: .72; }
.territory-estimate-kicker {
  margin: 0 0 .25rem;
  font: 600 .68rem/1.2 var(--font-sans, system-ui, sans-serif);
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--muted);
}
.territory-estimate-headline {
  margin: 0 0 .45rem;
  font: 650 .95rem/1.3 var(--font-sans, system-ui, sans-serif);
  color: var(--ink);
}
.territory-estimate-list,
.territory-estimate-compare-list {
  list-style: none;
  margin: 0 0 .5rem;
  padding: 0;
  display: grid;
  gap: .28rem;
}
.territory-estimate-list li,
.territory-estimate-compare-list li {
  margin: 0;
  padding: .2rem 0;
  font: 500 .82rem/1.35 var(--font-sans, system-ui, sans-serif);
  color: var(--ink-2, var(--ink));
  border-bottom: 1px solid color-mix(in srgb, var(--line) 70%, transparent);
}
.territory-estimate-list li:last-child,
.territory-estimate-compare-list li:last-child { border-bottom: 0; }
.territory-estimate-list li.is-key,
.territory-estimate-compare-list li.is-key {
  font-weight: 650;
  color: var(--ink);
  font-size: .88rem;
}
.territory-estimate-source,
.territory-estimate-confidence,
.territory-estimate-next,
.territory-estimate-compare-summary {
  margin: 0 0 .3rem;
  font: 400 .72rem/1.4 var(--font-sans, system-ui, sans-serif);
  color: var(--muted);
}
.territory-estimate-next {
  margin-bottom: 0;
  color: var(--ink-2, var(--ink));
  font-weight: 550;
}
.territory-estimate-compare-list li {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: .5rem .75rem;
  align-items: baseline;
}
.territory-estimate-compare-list .cmp-label { font-weight: 550; color: var(--ink); }
.territory-estimate-compare-list .cmp-est { color: var(--muted); white-space: nowrap; }
.territory-estimate-compare-list .cmp-act { color: var(--ink); font-weight: 600; white-space: nowrap; }
@media (max-width: 767px) {
  .territory-estimate,
  .territory-estimate-compare {
    margin: 0 .45rem .45rem;
    padding: .55rem .7rem .6rem;
  }
  .territory-estimate-compare-list li {
    grid-template-columns: 1fr 1fr;
    grid-template-rows: auto auto;
  }
  .territory-estimate-compare-list .cmp-label { grid-column: 1 / -1; }
  .territory-estimate-headline { font-size: .9rem; }
}

/* Opportunity heat legend — plain language, theme-aware amber ramp */
.territory-heat-legend {
  position: absolute;
  left: .75rem;
  bottom: 2.1rem;
  z-index: 4;
  max-width: min(20rem, calc(100% - 1.5rem));
  padding: .65rem .8rem .7rem;
  border-radius: var(--r-md);
  background: color-mix(in srgb, var(--bg-raised) 92%, transparent);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
  backdrop-filter: blur(8px);
  pointer-events: none;
  color: var(--ink);
}
.territory-heat-legend[hidden] { display: none !important; }
.territory-heat-title {
  margin: 0 0 .4rem;
  font: 600 .78rem/1.25 var(--font-sans, system-ui, sans-serif);
  letter-spacing: .01em;
}
.territory-heat-ramp {
  display: flex;
  align-items: center;
  gap: .45rem;
  margin: 0 0 .45rem;
  font: 500 .68rem/1 var(--font-sans, system-ui, sans-serif);
  color: var(--muted);
}
.territory-heat-bar {
  flex: 1 1 auto;
  height: .45rem;
  border-radius: 999px;
  /* Sequential amber — matches heat fill; works on dark and light chrome */
  background: linear-gradient(
    90deg,
    rgba(251, 191, 36, 0.12),
    rgba(245, 158, 11, 0.45),
    rgba(180, 83, 9, 0.75)
  );
  border: 1px solid color-mix(in srgb, var(--line) 70%, transparent);
}
.territory-heat-body {
  margin: 0 0 .35rem;
  font: 400 .72rem/1.35 var(--font-sans, system-ui, sans-serif);
  color: var(--ink-2, var(--ink));
}
.territory-heat-source {
  margin: 0;
  font: 500 .68rem/1.3 var(--font-sans, system-ui, sans-serif);
  color: var(--muted);
}
@media (max-width: 767px) {
  .territory-heat-legend {
    left: .45rem;
    right: .45rem;
    bottom: 1.6rem;
    max-width: none;
    padding: .5rem .65rem .55rem;
  }
  .territory-heat-body { display: none; } /* source line is enough on phones */
}

/* MapLibre controls */
.territory-map-frame .maplibregl-ctrl-group {
  background: var(--bg-raised);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
}
.territory-map-frame .maplibregl-ctrl-group button {
  background: transparent;
  border-color: var(--line);
  min-width: var(--touch);
  min-height: var(--touch);
  color: var(--ink);
}
.territory-map-frame .maplibregl-ctrl-group button:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 1px;
}
.territory-actions .btn {
  min-height: 2.1rem;
  padding-left: .65rem;
  padding-right: .65rem;
  font-size: .82rem;
}
.territory-map-frame .maplibregl-ctrl-attrib {
  background: color-mix(in srgb, var(--bg-raised) 90%, transparent);
  color: var(--muted);
  font-size: 10px;
}
.territory-map-frame .maplibregl-ctrl-attrib a { color: var(--accent); }

/* Tablet / narrow: two compact rows max for chrome, map still fills rest */
@media (max-width: 1023px) {
  /* body.has-app-shell already pads for mobile-nav (border-box) — fill that box */
  body.territory-full .app-shell,
  body.territory-full .app-column {
    height: 100%;
    max-height: 100%;
  }
  .territory-shell {
    padding: .4rem .55rem .45rem;
    gap: .35rem;
  }
  .territory-toolbar {
    flex-wrap: wrap;
    row-gap: .35rem;
    padding: .4rem .5rem;
  }
  .territory-modes {
    order: 3;
    flex: 1 1 auto;
  }
  .territory-modes .mode-btn {
    flex: 1 1 0;
  }
  .territory-search {
    order: 4;
    flex: 1 1 100%;
    max-width: none;
    min-width: 0;
  }
  .territory-actions {
    margin-left: auto;
  }
  .territory-map-frame {
    border-radius: var(--r-sm);
  }
}

/* Phones: edge-to-edge map, chrome ≤2 rows, no page scroll */
@media (max-width: 767px) {
  .territory-shell {
    padding: .35rem 0 0;
    gap: .3rem;
  }
  .territory-toolbar,
  .territory-status {
    margin-left: max(.55rem, env(safe-area-inset-left, 0px));
    margin-right: max(.55rem, env(safe-area-inset-right, 0px));
  }
  .territory-brand h1 { font-size: .92rem; }
  .territory-draw-actions .btn { padding-left: .45rem; padding-right: .45rem; }
  .territory-map-frame {
    width: 100%;
    border-radius: 0;
    border-left: 0;
    border-right: 0;
    border-bottom: 0;
  }
  .territory-howto {
    top: auto;
    left: .55rem;
    right: .55rem;
    bottom: .55rem;
    max-width: none;
    width: auto;
  }
  .territory-chips-float {
    left: .55rem;
    right: .55rem;
    bottom: .55rem;
  }
  /* When howto is visible, chips sit above it */
  .territory-howto:not([hidden]) ~ .territory-chips-float {
    bottom: 4.75rem;
  }
  .territory-map-frame .maplibregl-ctrl-top-right {
    top: .45rem;
    right: .45rem;
  }
  .territory-chip-name { max-width: 9rem; }
  .mode-btn span { font-size: .8rem; }
}


/* -------------------------------------------------------------------------- */
/* Getting started (first-run onboarding)                                     */
/* -------------------------------------------------------------------------- */
.gs-card {
  margin: 0 0 1.25rem;
  padding: 1.25rem 1.35rem 1.35rem;
}
.gs-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}
.gs-head h2 {
  margin: 0;
  font-size: clamp(1.15rem, 2.4vw, 1.4rem);
}
.gs-steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: .65rem;
}
.gs-step {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: .85rem;
  padding: .85rem 1rem;
  border-radius: var(--r-lg);
  background: var(--bg-soft);
  border: 1px solid var(--line);
  transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}
.gs-step.is-current {
  border-color: color-mix(in srgb, var(--accent) 45%, var(--line));
  box-shadow: var(--shadow-glow);
  background: color-mix(in srgb, var(--accent) 8%, var(--bg-raised));
}
.gs-step.is-done {
  opacity: .92;
}
.gs-num {
  width: 1.75rem;
  height: 1.75rem;
  border-radius: var(--r-pill);
  display: grid;
  place-items: center;
  font-family: var(--mono);
  font-size: .75rem;
  font-weight: 750;
  background: color-mix(in srgb, var(--accent) 14%, var(--bg-soft));
  color: var(--accent-hover);
  border: 1px solid color-mix(in srgb, var(--accent) 28%, transparent);
  flex: 0 0 auto;
}
.gs-step.is-done .gs-num {
  background: color-mix(in srgb, var(--accent) 22%, var(--bg-raised));
  color: var(--accent-hover);
}
.gs-step.is-current .gs-num {
  background: var(--accent);
  color: var(--accent-ink);
  border-color: transparent;
}
.gs-step-title {
  margin: 0;
  font-size: .95rem;
  font-weight: 650;
  letter-spacing: -.015em;
}
.gs-step-copy {
  margin: .15rem 0 0;
  font-size: .8rem;
  color: var(--muted);
  line-height: 1.4;
}
.gs-next {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: .75rem;
  margin-top: 1rem;
  padding-top: .9rem;
  border-top: 1px solid var(--line);
}
.gs-explainer {
  margin: 0 0 1.25rem;
  padding: 1.2rem 1.35rem 1.3rem;
}
.gs-explainer-head h2 {
  margin: 0;
  font-size: clamp(1.1rem, 2.2vw, 1.3rem);
}
.gs-timeline {
  margin: 1rem 0 0;
  padding: 0 0 0 1.15rem;
  display: grid;
  gap: .55rem;
  color: var(--muted);
  font-size: .88rem;
  line-height: 1.45;
}
.gs-timeline li.is-active {
  color: var(--ink);
}
.gs-timeline li.is-active b {
  color: var(--accent-hover);
}
.toast.is-warn {
  background: var(--warn-soft);
  color: var(--ink);
  border: 1px solid color-mix(in srgb, var(--warn) 35%, transparent);
}

/* Billing */
.billing-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}
.billing-card {
  padding: 1.25rem 1.35rem 1.4rem;
}
.billing-card h2 {
  margin: .35rem 0 .25rem;
  font-size: 1.15rem;
}
.billing-card .card-copy {
  margin: 0 0 1rem;
  color: var(--muted);
  font-size: .9rem;
}
.billing-plan {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: .85rem;
}
.billing-plan-name {
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -.02em;
}
.billing-plan-price {
  font-family: var(--mono);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--accent-hover);
}
.billing-plan-price small,
.billing-tier-price small {
  font-size: .75rem;
  color: var(--muted);
  font-weight: 500;
}
.billing-caps {
  margin: 0 0 1rem;
  padding: 0 0 0 1.1rem;
  color: var(--muted);
  font-size: .9rem;
  line-height: 1.55;
}
.billing-caps b { color: var(--ink); }
.billing-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
}
.billing-tiers {
  display: grid;
  gap: .65rem;
}
.billing-tier {
  padding: .75rem .9rem;
  border-radius: var(--r-md);
  border: 1px solid var(--line);
  background: var(--bg-soft);
}
.billing-tier.is-current {
  border-color: color-mix(in srgb, var(--accent) 40%, var(--line));
  box-shadow: var(--shadow-glow);
}
.billing-tier-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .5rem;
}
.billing-tier-price {
  font-family: var(--mono);
  font-weight: 700;
  margin: .2rem 0;
  color: var(--ink);
}
/* billing + gs-step stack rules live in the global responsive block */

/* Utility — screen-reader only + mono emphasis */
.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.mono {
  font-family: var(--mono);
}

/* Live businesses + demo QC + pipeline live */
.live-page {
  padding-top: 2rem;
  padding-bottom: 3rem;
}
.live-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: .75rem 1rem;
  margin-bottom: 1.25rem;
}
.live-head > div:first-child {
  flex: 1 1 12rem;
  min-width: 0;
}
.live-head h1 {
  margin: .15rem 0;
  font-size: clamp(1.8rem, 4vw, 2.6rem);
}
/* Live scrape/progress badge — never collide with title on narrow widths */
.live-head #scrape-live,
.live-head > .badge {
  flex: 0 1 auto;
  max-width: min(100%, 22rem);
  min-width: 0;
  white-space: normal;
  overflow-wrap: anywhere;
  text-transform: none;
  letter-spacing: .02em;
  line-height: 1.35;
  align-self: flex-start;
}
.summary-chips {
  display: flex;
  flex-wrap: wrap;
  gap: .6rem;
  margin-bottom: 1rem;
}
.live-controls {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 1rem;
  padding: 1rem;
  margin-bottom: 1rem;
}
.business-table { overflow: auto; }
.business-table a { color: var(--accent-hover); }
.btn.disabled {
  pointer-events: none;
  opacity: .4;
}

/* -------------------------------------------------------------------------- */
/* Pipeline live: working cards, ticker, paused banner                        */
/* -------------------------------------------------------------------------- */
.pipeline-paused {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: .9rem 1.1rem;
  margin: 0 0 1rem;
  border: 1px solid color-mix(in srgb, var(--warn) 35%, var(--line));
  background:
    linear-gradient(90deg,
      color-mix(in srgb, var(--warn) 10%, var(--bg-raised)),
      var(--bg-raised));
  box-shadow: var(--shadow-sm);
}
.pipeline-paused[hidden] { display: none !important; }
.pipeline-paused-dot {
  width: .7rem;
  height: .7rem;
  border-radius: 50%;
  background: var(--warn);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--warn) 18%, transparent);
  flex: 0 0 auto;
}
.pipeline-paused-copy {
  flex: 1 1 auto;
  min-width: 0;
}
.pipeline-paused-copy strong {
  display: block;
  color: var(--ink);
  font-size: .95rem;
}
.pipeline-paused-copy p {
  margin: .15rem 0 0;
  font-size: .85rem;
}
.pipeline-paused-actions {
  flex: 0 0 auto;
  display: flex;
  gap: .5rem;
  align-items: center;
}
.pipeline-paused-actions .btn.primary {
  background: var(--warn);
  color: #1a1200;
  border-color: transparent;
  box-shadow: 0 1px 2px rgba(0,0,0,.25);
}
.pipeline-paused-actions .btn.primary:hover {
  filter: brightness(1.06);
}

.pipe-status-wrap {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
}
.pipe-signal-dot {
  width: .55rem;
  height: .55rem;
  border-radius: 50%;
  background: var(--signal);
  box-shadow: 0 0 0 0 color-mix(in srgb, var(--signal) 40%, transparent);
  animation: signal-pulse 1.4s var(--ease) infinite;
  flex: 0 0 auto;
}
.pipe-signal-dot[hidden] { display: none !important; }

.pipe-live-line {
  margin: 0;
  font-family: var(--mono);
  font-size: .78rem;
  line-height: 1.4;
  color: var(--signal);
  letter-spacing: -.01em;
  min-height: 1.2em;
}
.pipe-live-line[hidden] { display: none !important; }

.pipe-shimmer {
  display: none;
  pointer-events: none;
}
.pipe-step.is-working {
  border-color: color-mix(in srgb, var(--signal) 50%, var(--line));
  box-shadow: var(--shadow-glow);
}
.pipe-step.is-working .pipe-shimmer {
  display: block;
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 3px;
  overflow: hidden;
  border-radius: 0 0 var(--r-xl) var(--r-xl);
  background: color-mix(in srgb, var(--signal) 12%, transparent);
}
.pipe-step.is-working .pipe-shimmer::after {
  content: "";
  position: absolute;
  inset: 0;
  width: 40%;
  background: linear-gradient(
    90deg,
    transparent,
    color-mix(in srgb, var(--signal) 70%, transparent),
    transparent
  );
  transform: translateX(-120%);
  animation: pipe-shimmer 1.6s var(--ease) infinite;
}
.pipe-step.is-just-done {
  border-color: color-mix(in srgb, var(--accent) 45%, var(--line));
}

/* Activity ticker */
.activity-ticker .activity-event,
.activity-ticker li {
  transition: opacity var(--dur) var(--ease), transform var(--dur) var(--ease);
}
.activity-ticker .activity-event.is-enter {
  opacity: 0;
  transform: translateY(-8px);
}
.activity-progress {
  font-family: var(--mono);
  font-size: .78rem;
  color: var(--ink);
  opacity: .92;
}
.activity-live-label {
  font-family: var(--mono);
  font-size: .65rem;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--signal);
}

@keyframes signal-pulse {
  0%, 100% {
    opacity: 1;
    transform: scale(1);
    box-shadow: 0 0 0 0 color-mix(in srgb, var(--signal) 35%, transparent);
  }
  50% {
    opacity: .85;
    transform: scale(1.15);
    box-shadow: 0 0 0 6px color-mix(in srgb, var(--signal) 0%, transparent);
  }
}
@keyframes pipe-shimmer {
  0% { transform: translateX(-120%); opacity: .4; }
  50% { opacity: 1; }
  100% { transform: translateX(280%); opacity: .4; }
}

/* -------------------------------------------------------------------------- */
/* Businesses — dense list + filters                                          */
/* -------------------------------------------------------------------------- */
/* Wider than the shared 72rem container so 6k+ rows use the screen. */
.biz-page {
  max-width: min(90rem, 100%);
}
/* Tighter page chrome — list density is the product. */
.biz-page .live-head {
  margin-bottom: .65rem;
  gap: .5rem;
}
.biz-page .live-head h1 {
  font-size: clamp(1.35rem, 2.4vw, 1.65rem);
  margin-bottom: .15rem;
}
.biz-page .live-head .muted,
.biz-page .live-head .wassup {
  font-size: .85rem;
  margin: .1rem 0 0;
}
.biz-page .biz-chips {
  margin-bottom: .55rem;
  gap: .35rem;
}
.biz-page .biz-chip {
  padding: .2rem .5rem;
  font-size: .78rem;
}
/* Delete stays available but compact; full touch target on mobile. */
@media (hover: hover) and (pointer: fine) {
  .biz-delete-one {
    opacity: .55;
  }
  .biz-row:hover .biz-delete-one,
  .biz-delete-one:focus-visible {
    opacity: 1;
  }
}
.biz-chips .biz-chip.is-money {
  border-color: color-mix(in srgb, var(--accent) 40%, var(--line));
  background: color-mix(in srgb, var(--accent) 12%, var(--bg-raised));
  color: var(--ink);
}
.biz-chips .biz-chip.is-weak {
  border-color: color-mix(in srgb, var(--signal) 35%, var(--line));
  background: color-mix(in srgb, var(--signal) 10%, var(--bg-raised));
}
.biz-filters {
  padding: .45rem .75rem;
  margin-bottom: .45rem;
  position: sticky;
  top: calc(var(--nav-h) + .2rem);
  z-index: 8;
  backdrop-filter: blur(10px);
  background: color-mix(in srgb, var(--bg-raised) 92%, transparent);
}
.biz-filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: .35rem .5rem;
  align-items: center;
}
.biz-result-count {
  margin: 0;
  font-size: .82rem;
  color: var(--muted);
  white-space: nowrap;
}
.biz-result-count b {
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}
.biz-group-mode { display: flex; gap: .25rem; align-items: center; }
.biz-bulk { display: flex; align-items: center; gap: .55rem; padding: .4rem .75rem; margin-bottom: .45rem; }
.biz-bulk b { margin-right: auto; }
.biz-search-field,
.biz-site-field,
.biz-contact-field,
.biz-cat-field {
  margin: 0;
  min-width: 0;
  display: inline-flex;
  align-items: center;
}
.biz-search-field {
  flex: 1 1 12rem;
  min-width: 10rem;
  max-width: 20rem;
}
.biz-site-field,
.biz-contact-field,
.biz-cat-field {
  flex: 0 1 10.5rem;
}
.biz-search-field input,
.biz-site-field select,
.biz-contact-field select,
.biz-cat-field select {
  width: 100%;
  min-height: 1.9rem;
  padding: .25rem .5rem;
  font-size: .8rem;
}
/* Legacy class kept for any residual markup */
.biz-search-bar {
  display: grid;
  grid-template-columns: minmax(12rem, 1fr) minmax(10rem, 14rem) auto;
  gap: .75rem;
  padding: .85rem 1rem;
  margin-bottom: 1rem;
}

.biz-groups {
  display: grid;
  gap: 1rem;
}
/*
 * Sticky group heads must NOT sit inside an overflow:hidden ancestor — that
 * makes the group the sticky scrollport, so the header can pin mid-section
 * while its first rows paint above the bar (the /businesses visual bug).
 * Clip radius on the body only; head stays a viewport-sticky sibling above.
 */
.biz-group {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  background: var(--bg-raised);
  box-shadow: var(--shadow-sm);
  overflow: visible;
  isolation: isolate;
}
.biz-group.is-money {
  border-color: color-mix(in srgb, var(--accent) 40%, var(--line));
  box-shadow: var(--shadow-glow);
}
.biz-group.is-money .biz-group-head {
  background: linear-gradient(
    90deg,
    color-mix(in srgb, var(--accent) 14%, var(--bg-raised)),
    var(--bg-raised) 55%
  );
}
.biz-group.is-weak .biz-group-head {
  background: color-mix(in srgb, var(--signal) 6%, var(--bg-raised));
}
.biz-group.is-has {
  opacity: .92;
}
.biz-group.is-has .biz-group-head {
  background: var(--bg-soft);
}
.biz-group.is-filter-empty { display: none; }

.biz-group-head-wrap {
  order: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  position: sticky;
  top: calc(var(--nav-h) + 3.4rem);
  z-index: 6;
  border-bottom: 1px solid var(--line);
  border-radius: var(--r-xl) var(--r-xl) 0 0;
  background: var(--bg-raised);
  box-shadow: 0 1px 0 color-mix(in srgb, var(--line) 80%, transparent);
}
.biz-group-head {
  /* flex item 0 — always paints/flows before .biz-group-body */
  order: 0;
  flex: 0 0 auto;
  width: 100%;
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: center;
  gap: .35rem .65rem;
  padding: .45rem .85rem;
  border: 0;
  /* Opaque base so rows never show through while stuck */
  background: var(--bg-raised);
  color: var(--ink);
  cursor: pointer;
  text-align: left;
  font: inherit;
  position: static;
  border-radius: var(--r-xl) 0 0 0;
  min-height: 2.25rem;
}
.biz-select-group { padding: .35rem .75rem; color: var(--muted); font-size: .75rem; white-space: nowrap; cursor: pointer; }
.biz-select-group input, .biz-select input { width: .9rem; height: .9rem; accent-color: var(--accent); }
.biz-group-head:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: -2px;
}
.biz-group-title {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  font-weight: 650;
  font-size: .88rem;
  letter-spacing: -.015em;
}
.biz-group-mark {
  width: .45rem;
  height: .45rem;
  border-radius: 50%;
  background: var(--muted);
  flex: 0 0 auto;
}
.biz-group.is-money .biz-group-mark { background: var(--accent); }
.biz-group.is-weak .biz-group-mark { background: var(--signal); }
.biz-group.is-has .biz-group-mark { background: var(--faint); }
.biz-group-count {
  font-family: var(--mono);
  font-size: .68rem;
  font-weight: 700;
  padding: .08rem .35rem;
  border-radius: var(--r-pill);
  background: var(--bg-soft);
  border: 1px solid var(--line);
  color: var(--muted);
}
.biz-group.is-money .biz-group-count {
  color: var(--accent-hover);
  border-color: transparent;
  background: color-mix(in srgb, var(--accent) 16%, transparent);
}
.biz-group-hint {
  font-size: .72rem;
  justify-self: end;
}
.biz-group-chev {
  width: .45rem;
  height: .45rem;
  border-right: 2px solid var(--muted);
  border-bottom: 2px solid var(--muted);
  transform: rotate(45deg);
  transition: transform var(--dur) var(--ease);
  margin-top: -.15rem;
}
.biz-group.is-open .biz-group-chev {
  transform: rotate(225deg);
  margin-top: .1rem;
}
.biz-group-body {
  order: 1;
  flex: 1 1 auto;
  min-width: 0;
  padding: 0;
  position: relative;
  z-index: 1; /* below sticky head (z-index 6) */
  /* Clip list to bottom radius without trapping the sticky head */
  border-radius: 0 0 var(--r-xl) var(--r-xl);
  overflow: hidden;
  background: var(--bg-raised);
}
.biz-group-empty {
  margin: 0;
  padding: .7rem .85rem .85rem;
  font-size: .85rem;
}

.biz-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
/* Dense single-line row at desktop widths — aim ~3× vs old tall cards */
.biz-row {
  padding: .12rem .65rem;
  border-top: 1px solid var(--line);
  transition: background var(--dur) var(--ease);
  position: relative;
  z-index: 0;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) 3.6rem;
  align-items: center;
  gap: .3rem .45rem;
  min-height: 0;
  height: 2rem; /* hard cap — one decision line */
  line-height: 1.15;
  box-sizing: border-box;
}
.biz-select {
  display: flex;
  align-items: center;
  cursor: pointer;
  padding: 0;
}
.biz-select input {
  width: .85rem;
  height: .85rem;
}
.biz-row-body {
  display: grid;
  grid-template-columns:
    minmax(7rem, 1.7fr)
    minmax(4rem, 6.5rem)
    minmax(5rem, 7.5rem)
    minmax(5.5rem, 8rem);
  align-items: center;
  gap: .25rem .45rem;
  min-width: 0;
  height: 100%;
}
.biz-delete-one {
  align-self: center;
  justify-self: end;
  padding: .1rem .35rem !important;
  font-size: .68rem !important;
  min-height: 0 !important;
  height: 1.45rem;
  line-height: 1.1 !important;
}
/* A 23px row action is a fine density choice for a mouse and a bad one for a
   thumb. The phone rule below fires at 767px, which left a 768px tablet — a
   touch device — with the dense version. Key off the pointer, not the width. */
@media (hover: none), (pointer: coarse) {
  .biz-delete-one {
    min-height: var(--touch) !important;
    height: auto;
    padding: .35rem .6rem !important;
    font-size: .75rem !important;
  }
}
.biz-row:first-child { border-top: 0; }
.biz-row:hover { background: var(--bg-soft); }
.biz-name {
  font-size: .84rem;
  font-weight: 650;
  color: var(--ink);
  letter-spacing: -.01em;
  line-height: 1.2;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.biz-cat {
  font-family: var(--mono);
  font-size: .62rem;
  font-weight: 650;
  letter-spacing: .02em;
  text-transform: lowercase;
  padding: .05rem .35rem;
  border-radius: var(--r-pill);
  background: var(--bg-soft);
  border: 1px solid var(--line);
  color: var(--muted);
  justify-self: start;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.biz-need {
  font-size: .68rem;
  font-weight: 650;
  padding: .05rem .38rem;
  border-radius: var(--r-pill);
  border: 1px solid var(--line);
  background: var(--bg-soft);
  color: var(--muted);
  justify-self: start;
  white-space: nowrap;
}
.biz-need.is-none {
  border-color: color-mix(in srgb, var(--accent) 40%, var(--line));
  background: color-mix(in srgb, var(--accent) 12%, var(--bg-raised));
  color: var(--ink);
}
.biz-need.is-weak {
  border-color: color-mix(in srgb, var(--signal) 35%, var(--line));
  background: color-mix(in srgb, var(--signal) 10%, var(--bg-raised));
  color: var(--ink);
}
.biz-need.is-good {
  opacity: .85;
}
.biz-reach {
  display: inline-flex;
  gap: .22rem;
  align-items: center;
  min-width: 0;
}
.biz-reach-pill {
  font-size: .62rem;
  font-weight: 650;
  letter-spacing: .02em;
  padding: .05rem .32rem;
  border-radius: var(--r-pill);
  border: 1px solid var(--line);
  white-space: nowrap;
}
.biz-reach-pill.is-on {
  background: color-mix(in srgb, var(--accent) 14%, var(--bg-raised));
  border-color: color-mix(in srgb, var(--accent) 35%, var(--line));
  color: var(--ink);
}
.biz-reach-pill.is-off {
  color: var(--faint);
  opacity: .7;
  background: transparent;
}
/* Address lives in the row title on desktop; shown on narrow screens only */
.biz-address {
  display: none;
  margin: 0;
  font-size: .75rem;
  line-height: 1.25;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
/* Legacy contact-block classes no longer rendered; keep inert if cached HTML */
.biz-contacts,
.biz-contact,
.biz-contact-label,
.biz-contact-val,
.biz-site-link { display: none; }

/* -------------------------------------------------------------------------- */
/* Demos review — preview hero                                                */
/* -------------------------------------------------------------------------- */
.demo-page {
  /* Fill viewport under app chrome */
  min-height: calc(100vh - var(--nav-h) - 1rem);
  display: flex;
  flex-direction: column;
  padding: 0;
  margin: 0;
}
.demo-page--empty {
  padding: 0 0 2rem;
}
body.has-app-shell .app-main:has(.demo-page:not(.demo-page--empty)) {
  padding-bottom: 0;
}
.demo-review {
  display: grid;
  grid-template-columns: minmax(15rem, 30%) minmax(0, 70%);
  flex: 1 1 auto;
  min-height: calc(100vh - var(--nav-h) - .5rem);
  max-height: calc(100vh - var(--nav-h) - .5rem);
  overflow: hidden;
  border-top: 1px solid var(--line);
  background: var(--bg-raised);
}
.demo-rail {
  display: flex;
  flex-direction: column;
  min-width: 0;
  border-right: 1px solid var(--line);
  background: var(--bg-soft);
  overflow: hidden;
}
.demo-rail-head {
  padding: 1rem 1rem .55rem;
  flex: 0 0 auto;
}
.demo-rail-title {
  margin: .1rem 0 0;
  font-size: 1.25rem;
  letter-spacing: -.02em;
}
.demo-filters {
  display: flex;
  flex-wrap: wrap;
  gap: .35rem;
  padding: .35rem 1rem .75rem;
  flex: 0 0 auto;
}
.demo-filter {
  font-family: var(--mono);
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .02em;
  padding: .35rem .55rem;
  border-radius: var(--r-pill);
  border: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: .3rem;
}
.demo-filter .mono {
  font-size: .65rem;
  opacity: .85;
}
.demo-filter:hover {
  background: var(--bg-hover);
  color: var(--ink);
}
.demo-filter.is-active {
  background: color-mix(in srgb, var(--accent) 16%, transparent);
  border-color: transparent;
  color: var(--accent-hover);
}
.demo-filter:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}
.demo-select {
  display: none;
  padding: 0 1rem .75rem;
}
.demo-list {
  display: flex;
  flex-direction: column;
  gap: .3rem;
  padding: 0 .65rem 1rem;
  overflow-y: auto;
  flex: 1 1 auto;
  min-height: 0;
}
.demo-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .5rem;
  padding: .65rem .7rem;
  border: 1px solid transparent;
  border-radius: var(--r-md);
  color: var(--ink);
  text-decoration: none;
  background: transparent;
}
.demo-item:hover {
  background: var(--bg-hover);
  border-color: var(--line);
}
.demo-item.is-active {
  background: color-mix(in srgb, var(--accent) 12%, var(--bg-hover));
  border-color: color-mix(in srgb, var(--accent) 35%, var(--line));
  box-shadow: var(--shadow-sm);
}
.demo-item:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 1px;
}
.demo-item-text {
  min-width: 0;
  display: grid;
  gap: .12rem;
}
.demo-item-biz {
  font-size: .88rem;
  font-weight: 650;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.demo-item-slug {
  display: block;
  color: var(--faint);
  font-size: .68rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.demo-item .badge {
  flex: 0 0 auto;
  font-size: .62rem;
}

.demo-stage {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  background: var(--bg);
}
.demo-preview-wrap {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
}
.demo-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  padding: .7rem 1rem;
  border-bottom: 1px solid var(--line);
  background: var(--bg-raised);
  flex: 0 0 auto;
}
.demo-toolbar-meta {
  display: flex;
  align-items: center;
  gap: .55rem;
  min-width: 0;
  flex-wrap: wrap;
}
.demo-current-name {
  font-size: .95rem;
  color: var(--ink);
}
.demo-current-slug {
  font-size: .72rem;
}
.demo-open-full {
  color: var(--accent-hover);
  font-size: .85rem;
  white-space: nowrap;
  text-decoration: none;
}
.demo-open-full:hover { text-decoration: underline; }
.demo-frame {
  width: 100%;
  flex: 1 1 auto;
  min-height: 0;
  border: 0;
  background: #fff;
}
.demo-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  padding: .75rem 1rem;
  border-top: 1px solid var(--line);
  background: color-mix(in srgb, var(--bg-raised) 96%, transparent);
  backdrop-filter: blur(8px);
  flex: 0 0 auto;
  position: sticky;
  bottom: 0;
  z-index: 6;
}
.qc-actions {
  display: flex;
  gap: .5rem;
  align-items: center;
}
.demo-nav-btn { min-width: 7rem; justify-content: center; }

@media (max-width: 767px) {
  .live-head {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    align-items: start;
  }
  .live-head > div:first-child { min-width: 0; }
  .live-head #scrape-live,
  .live-head > .badge {
    max-width: 100%;
    width: fit-content;
    justify-self: start;
  }
  .live-controls { grid-template-columns: 1fr; }
  .biz-filters {
    top: calc(var(--nav-h) + .15rem);
    padding: .5rem .6rem;
  }
  .biz-filter-row {
    flex-direction: column;
    align-items: stretch;
    gap: .4rem;
  }
  .biz-search-field,
  .biz-site-field,
  .biz-contact-field,
  .biz-cat-field {
    max-width: none;
    flex: 1 1 auto;
  }
  .biz-result-count { white-space: normal; }
  .biz-group-mode { width: 100%; }
  .biz-group-mode .btn { flex: 1; }
  .biz-group-head-wrap { top: calc(var(--nav-h) + 11rem); grid-template-columns: minmax(0, 1fr); }
  .biz-select-group { border-top: 1px solid var(--line); padding: .45rem .75rem; }
  .biz-group-head {
    grid-template-columns: 1fr auto;
    top: calc(var(--nav-h) + 5.75rem);
    z-index: 6;
  }
  .biz-group-hint { display: none; }
  .biz-row {
    padding: .4rem .6rem;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: start;
    gap: .35rem .45rem;
    min-height: 0;
    height: auto; /* stacked content on phone */
  }
  .biz-delete-one {
    grid-column: 2;
    justify-self: start;
    min-height: var(--touch) !important;
    height: auto;
  }
  .biz-row-body {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
      "name name"
      "cat need"
      "reach reach"
      "addr addr";
    gap: .2rem .4rem;
  }
  .biz-name { grid-area: name; white-space: normal; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; }
  .biz-cat { grid-area: cat; }
  .biz-need { grid-area: need; justify-self: end; }
  .biz-reach { grid-area: reach; }
  .biz-address { display: block; grid-area: addr; white-space: normal; }
  .pipeline-paused {
    flex-wrap: wrap;
  }

  .demo-review {
    display: flex;
    flex-direction: column;
    max-height: none;
    min-height: 0;
  }
  .demo-rail {
    border-right: 0;
    border-bottom: 1px solid var(--line);
    flex: 0 0 auto;
    max-height: none;
  }
  .demo-list { display: none; }
  .demo-select {
    display: grid;
    padding-bottom: .9rem;
  }
  .demo-stage {
    flex: 1 1 auto;
    min-height: 70vh;
  }
  .demo-preview-wrap {
    flex: 1 1 auto;
    min-height: 55vh;
  }
  .demo-frame {
    min-height: 55vh;
    flex: 1 1 auto;
  }
  .demo-actions {
    position: sticky;
    bottom: var(--mobile-nav-h, 3.75rem);
    flex-wrap: wrap;
    padding-bottom: calc(.75rem + env(safe-area-inset-bottom, 0px));
  }
  .qc-actions {
    order: 3;
    width: 100%;
    justify-content: stretch;
  }
  .qc-actions form,
  .qc-actions .btn {
    flex: 1 1 auto;
    width: 100%;
  }
  .demo-nav-btn { flex: 1 1 auto; min-width: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .pipe-signal-dot { animation: none; }
  .pipe-step.is-working .pipe-shimmer::after {
    animation: none;
    transform: none;
    width: 100%;
    opacity: .45;
  }
  .activity-ticker .activity-event.is-enter {
    opacity: 1;
    transform: none;
  }
}

/* Hallmark · macrostructure: Manifesto · tone: declarative-direct · anchor hue: indigo (locked palette + grid)
 * theme: system palette · NEW type: Fraunces display (roman+italic) + Instrument Sans body + JetBrains Mono data
 * enrichment: none — typography only · components: contract block · ledger pricing · thesis stack
 * differs from last (Map-Diagram): display style serif-italic vs sans · divider bleed-bands vs single composition · no boxed cards
 * Hallmark · pre-emit critique: P5 H4 E4 S5 R4 V5
 */
@font-face {
  font-family: "Fraunces";
  src: url("fonts/Fraunces-Variable.woff2") format("woff2");
  font-weight: 300 900; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Fraunces";
  src: url("fonts/Fraunces-Variable-Italic.woff2") format("woff2");
  font-weight: 300 900; font-style: italic; font-display: swap;
}
@font-face {
  font-family: "Instrument Sans";
  src: url("fonts/InstrumentSans-Variable.woff2") format("woff2");
  font-weight: 400 700; font-style: normal; font-display: swap;
}
:root {
  --font-display: "Fraunces", Georgia, serif;
  --font-copy: "Instrument Sans", var(--font), sans-serif;
  --rule-heavy: 3px solid var(--accent);
}

.mfo { font-family: var(--font-copy); }

/* opening declaration */
.mfo-open { padding: clamp(4rem, 12vh, 8rem) 0 clamp(3rem, 8vh, 5rem); position: relative; min-height: min(780px, calc(100svh - var(--nav-h))); overflow: hidden; display: grid; align-items: center; }
.mfo-open .wrap { position: relative; z-index: 2; pointer-events: none; }
.mfo-open .wrap a, .mfo-open .wrap .landing-picker-status { pointer-events: auto; }
.landing-map-wrap { position: absolute; inset: 0; z-index: 0; background: var(--bg); }
.landing-map { width: 100%; height: 100%; opacity: .43; filter: grayscale(1); }
/* The 98% copy-side scrim is intentional: even the weakest headline colour
 * remains above 4.5:1 if a line passes directly beneath it. */
.landing-map-wrap::after { content: ""; position: absolute; inset: 0; pointer-events: none; background: linear-gradient(90deg, color-mix(in srgb, var(--bg) 98%, transparent) 0 62%, color-mix(in srgb, var(--bg) 82%, transparent) 78%, color-mix(in srgb, var(--bg) 55%, transparent) 100%); }
.landing-map-wrap .maplibregl-control-container { opacity: .35; }
.landing-map-fallback { position: absolute; inset: auto 1rem 1rem; text-align: center; color: var(--faint); font-size: .78rem; }
.landing-picker-status { display: inline-flex; flex-direction: column; gap: .2rem; margin: 0 0 1rem; padding: .6rem .8rem; border: 1px solid color-mix(in srgb, var(--accent) 35%, var(--line)); border-radius: var(--r-md); background: color-mix(in srgb, var(--bg) 82%, transparent); backdrop-filter: blur(8px); }
#landing-city-count { color: var(--ink); font-weight: 700; }
.landing-picker-hint { color: var(--muted); font-size: .76rem; }
.landing-create { display: table; margin-bottom: 1.4rem; }
.landing-hover { z-index: 4; top: 1rem; bottom: auto; left: 50%; transform: translateX(-50%); }
@media (max-width: 600px) { .mfo-open { min-height: 700px; } .landing-map { opacity: .32; } .landing-picker-status { display: flex; max-width: 100%; } .landing-create { max-width: 100%; overflow-wrap: anywhere; } }
.mfo-kicker {
  font-family: var(--mono); font-size: .7rem; letter-spacing: .16em;
  text-transform: uppercase; color: var(--faint); margin: 0 0 2rem;
}
.mfo-decl {
  font-family: var(--font-display); font-weight: 560; color: var(--ink);
  font-size: clamp(2.8rem, 8.5vw, 6.2rem); line-height: 1.02; letter-spacing: -.015em;
  margin: 0 0 1.6rem; transform: rotate(-1.2deg); transform-origin: left bottom;
  overflow-wrap: anywhere; min-width: 0; max-width: 12ch;
}
.mfo-decl span { display: block; }
.mfo-decl-b { color: var(--muted); }
.mfo-decl-b em { font-style: italic; color: var(--accent-violet); }
html[data-theme="light"] .mfo-decl-b { color: #475569; }
html[data-theme="light"] .mfo-decl-b em { color: #6d28d9; }
.mfo-claim { font-size: 1.15rem; line-height: 1.7; color: var(--muted); max-width: 54ch; margin: 0 0 2rem; }
.mfo-scroll {
  font-family: var(--mono); font-size: .82rem; color: var(--ink); text-decoration: none;
  border-bottom: 2px solid var(--accent); padding-bottom: 3px;
  transition: color var(--dur) var(--ease), border-color var(--dur) var(--ease);
}
.mfo-scroll:hover { color: var(--accent-hover); border-color: var(--accent-hover); }

/* the argument — thesis stack with bleed rhythm */
.mfo-arg { padding: clamp(2rem, 6vh, 4rem) 0; }
.mfo-thesis { border-top: var(--rule-heavy); padding: 2.2rem 0 2.6rem; max-width: 62ch; }
.mfo-thesis.is-shift { margin-left: clamp(0px, 12vw, 220px); border-top-color: var(--accent-violet); }
.mfo-num { font-family: var(--mono); font-size: .85rem; color: var(--signal); letter-spacing: .1em; }
.mfo-thesis h2 {
  font-family: var(--font-display); font-weight: 540; font-size: clamp(1.7rem, 4.2vw, 2.9rem);
  line-height: 1.12; letter-spacing: -.012em; color: var(--ink); margin: .5rem 0 .9rem;
  overflow-wrap: anywhere; min-width: 0;
}
.mfo-thesis p { font-size: 1.02rem; line-height: 1.7; color: var(--muted); margin: 0; }
.mfo-thesis strong { color: var(--ink); font-weight: 600; }

/* the contract */
.mfo-contract-band { padding: clamp(2.5rem, 8vh, 5rem) 0; background: color-mix(in oklab, var(--bg-raised) 55%, var(--bg)); }
.mfo-contract { max-width: 680px; }
.mfo-contract-head {
  font-family: var(--mono); font-size: .72rem; letter-spacing: .22em; text-transform: uppercase;
  color: var(--ink); border-bottom: 1px solid var(--line-strong); padding-bottom: .8rem; margin: 0 0 1.4rem;
}
.mfo-sign { display: flex; align-items: flex-end; gap: 1.6rem; flex-wrap: wrap; }
.mfo-sign-line { flex: 1 1 180px; border-bottom: 1px dashed var(--line-strong); height: 2.2rem; min-width: 0; }
.mfo-cta {
  font-family: var(--font-copy); font-weight: 700; font-size: 1.05rem; text-decoration: none;
  background: var(--accent); color: var(--accent-ink);
  padding: 1.05rem 2.4rem; border-radius: 10px; display: inline-block;
  transition: background var(--dur) var(--ease), transform var(--dur-micro, 120ms) var(--ease-out);
}
.mfo-cta:hover { background: var(--accent-hover); transform: translateY(-1px); }
.mfo-cta:active { transform: translateY(0); }
.mfo-cta:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; }

/* the ledger */
.mfo-ledger-band { padding: clamp(2.5rem, 8vh, 5rem) 0 2rem; }
.mfo-ledger-title {
  font-family: var(--font-display); font-style: italic; font-weight: 520;
  font-size: clamp(1.5rem, 3.2vw, 2.1rem); color: var(--ink); margin: 0 0 1.6rem;
}
.mfo-fineprint { font-size: .88rem; color: var(--faint); margin: 1.2rem 0 0; }

/* close */
.mfo-close { padding: clamp(3rem, 10vh, 6rem) 0 clamp(4rem, 10vh, 6rem); }
.mfo-close-line {
  font-family: var(--font-display); font-style: italic; font-weight: 540;
  font-size: clamp(2rem, 5.5vw, 3.6rem); line-height: 1.08; color: var(--ink);
  margin: 0 0 1.6rem; max-width: 16ch; overflow-wrap: anywhere; min-width: 0;
}
.mfo-close-row { display: flex; align-items: center; gap: 1.4rem; flex-wrap: wrap; }
.mfo-quiet { color: var(--muted); text-decoration: none; border-bottom: 1px solid var(--line-strong); padding-bottom: 2px; }
.mfo-quiet:hover { color: var(--ink); }

/* manifesto reveal: horizontal sweep */
.mfo .reveal { opacity: 0; transform: translateX(-16px); transition: opacity var(--dur-slow) var(--ease-out), transform var(--dur-slow) var(--ease-out); transition-delay: calc(var(--reveal-i, 0) * 80ms); }
.mfo .reveal.revealed { opacity: 1; transform: none; }

@media (max-width: 700px) {
  .mfo-thesis.is-shift { margin-left: 0; }
  .mfo-row { flex-wrap: wrap; gap: .4rem .9rem; }
  .mfo-terms { flex-basis: 100%; order: 4; }
  .mfo-fill { display: none; }
  .mfo-act { margin-left: auto; }
  .mfo-cta { width: 100%; text-align: center; }
  .mfo-sign-line { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .mfo .reveal { transition: opacity 150ms linear; transform: none; }
  .mfo-decl { transform: none; }
}

/* nav anchors (landing) */
.mfo-anchors { display: flex; gap: 1.1rem; margin-left: 1.4rem; }
.mfo-anchors a {
  font-family: var(--mono); font-size: .78rem; letter-spacing: .04em;
  color: var(--muted); text-decoration: none; padding: .3rem .1rem;
  border-bottom: 1px solid transparent;
  transition: color var(--dur) var(--ease), border-color var(--dur) var(--ease);
}
.mfo-anchors a:hover { color: var(--ink); border-color: var(--accent); }
.mfo-anchors a:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
@media (max-width: 860px) { .mfo-anchors { display: none; } }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

/* the record — live counters */
.mfo-record { padding: clamp(2rem, 6vh, 3.5rem) 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.mfo-record-label { font-family: var(--mono); font-size: .7rem; letter-spacing: .2em; text-transform: uppercase; color: var(--faint); margin: 0 0 1.4rem; }
.mfo-record-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.5rem; }
.mfo-stat-n {
  display: block; font-family: var(--mono); font-variant-numeric: tabular-nums;
  font-size: clamp(1.8rem, 4.5vw, 3.2rem); font-weight: 700; color: var(--ink);
  letter-spacing: -.02em;
}
.mfo-stat-l { font-size: .88rem; color: var(--muted); }
@media (max-width: 700px) { .mfo-record-row { grid-template-columns: minmax(0, 1fr); gap: 1.1rem; } }

/* plan boxes — interactive */
.mfo-plans-band { padding: clamp(2.5rem, 8vh, 5rem) 0 2rem; }
.mfo-plans { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 1.1rem; }
.mfo-plan {
  display: flex; flex-direction: column; gap: .9rem; text-decoration: none;
  background: var(--bg-raised); border: 1px solid var(--line); border-radius: var(--r-lg);
  padding: 1.4rem 1.4rem 1.2rem; box-shadow: var(--shadow-sm);
  transition: transform var(--dur) var(--ease-out), border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}
.mfo-plan:hover { transform: translateY(-4px); border-color: var(--accent); box-shadow: var(--shadow); }
.mfo-plan:active { transform: translateY(-1px); }
.mfo-plan:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; }
.mfo-plan.is-featured { border-color: var(--accent); box-shadow: var(--shadow-glow, var(--shadow)); }
.mfo-plan-top { display: flex; align-items: baseline; justify-content: space-between; gap: .6rem; }
.mfo-plan-name { font-weight: 700; font-size: 1.1rem; color: var(--ink); }
.mfo-plan-tag { font-family: var(--mono); font-size: .64rem; letter-spacing: .1em; text-transform: uppercase; color: var(--signal); }
.mfo-plan-price { font-family: var(--mono); font-variant-numeric: tabular-nums; font-size: 1.7rem; color: var(--ink); }
.mfo-plan-price small { color: var(--faint); font-size: .78rem; }
.mfo-plan-caps { list-style: none; margin: 0; padding: 0; display: grid; gap: .45rem; }
.mfo-plan-caps li { font-size: .92rem; color: var(--muted); }
.mfo-plan-caps li span { font-family: var(--mono); color: var(--ink); font-variant-numeric: tabular-nums; margin-right: .35rem; }
.mfo-plan-go { margin-top: auto; font-weight: 600; font-size: .95rem; color: var(--accent-hover); }
.mfo-plan:hover .mfo-plan-go { text-decoration: underline; }

/* terms of the line — surveyor flow */
.mfo-contract { max-width: 780px; }
.mfo-flow { position: relative; margin: 0 0 2.2rem; }
.mfo-flow-svg { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.mfo-flow-path {
  fill: none; stroke: var(--accent); stroke-width: 2; vector-effect: non-scaling-stroke;
  stroke-linejoin: round; stroke-dasharray: 1200; stroke-dashoffset: 1200;
  transition: stroke-dashoffset 2.6s var(--ease-out) .2s;
}
.mfo-contract.revealed .mfo-flow-path { stroke-dashoffset: 0; }
.mfo-flow-list { list-style: none; margin: 0; padding: 0; display: grid; grid-auto-rows: 104px; }
.mfo-clause { position: relative; display: flex; align-items: center; min-width: 0; }
.mfo-vertex {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%) scale(0);
  width: 13px; height: 13px; border-radius: 50%;
  background: var(--bg); border: 2px solid var(--accent);
  transition: transform var(--dur-slow) var(--ease-out);
  transition-delay: calc(var(--dur-slow) + var(--i, 0) * 420ms);
  z-index: 1;
}
.mfo-contract.revealed .mfo-vertex { transform: translate(-50%, -50%) scale(1); }
.mfo-clause-card {
  font-family: var(--mono); font-size: .88rem; line-height: 1.55; color: var(--muted);
  background: var(--bg-raised); border: 1px solid var(--line); border-radius: var(--r-md);
  padding: .8rem 1rem; width: calc(50% - 2.6rem); box-shadow: var(--shadow-sm);
  opacity: 0; transform: translateY(6px);
  transition: opacity var(--dur-slow) var(--ease-out), transform var(--dur-slow) var(--ease-out), border-color var(--dur) var(--ease);
  transition-delay: calc(.45s + var(--i, 0) * .42s);
}
.mfo-contract.revealed .mfo-clause-card { opacity: 1; transform: none; }
.mfo-clause-card:hover { border-color: var(--accent-violet); }
.mfo-clause-card span { color: var(--accent); margin-right: .6rem; }
.mfo-clause.is-right { justify-content: flex-end; }
.mfo-sign { max-width: 780px; }
@media (max-width: 640px) {
  .mfo-flow-svg { display: none; }
  .mfo-flow-list { grid-auto-rows: auto; gap: .7rem; }
  .mfo-clause { padding-left: 1.6rem; }
  .mfo-vertex { left: .35rem; top: 1.1rem; transform: scale(0); }
  .mfo-contract.revealed .mfo-vertex { transform: scale(1); }
  .mfo-clause::before {
    content: ""; position: absolute; left: calc(.35rem + 5px); top: 1.6rem; bottom: -1rem;
    border-left: 2px dashed var(--line-strong);
  }
  .mfo-clause:last-child::before { display: none; }
  .mfo-clause-card, .mfo-clause.is-right .mfo-clause-card { width: 100%; }
  .mfo-clause.is-right { justify-content: flex-start; }
}
@media (prefers-reduced-motion: reduce) {
  .mfo-flow-path { stroke-dashoffset: 0; transition: none; }
  .mfo-vertex { transform: translate(-50%, -50%) scale(1) !important; transition: none; }
  .mfo-clause-card { opacity: 1; transform: none; transition: none; }
}

/* ── creative pass: bar air, alignment, line motifs ───────────────── */
/* landing topbar: brand left · anchors center · auth right, breathing room */
.topbar:has(.mfo-anchors) { padding-inline: clamp(1.2rem, 4vw, 3rem); gap: .9rem; }
.topbar:has(.mfo-anchors) .mfo-anchors { margin-left: clamp(1rem, 3vw, 2.6rem); margin-right: auto; gap: 1.5rem; }
.topbar:has(.mfo-anchors) .spacer { flex: 0 0 clamp(.5rem, 2vw, 1.5rem); }
.topbar:has(.mfo-anchors) .btn.ghost.sm { margin-right: .65rem; }
.topbar:has(.mfo-anchors) .btn.primary.sm { margin-right: .9rem; }
.mfo-anchors a.is-here { color: var(--ink); border-color: var(--accent); }

/* shared measure so every section starts on the same rhythm */
.mfo { --measure: 62ch; }
.mfo-claim, .mfo-thesis, .mfo-sub, .mfo-fineprint { max-width: var(--measure); }
.mfo-kicker,
.mfo-decl,
.mfo-claim,
.mfo-scroll,
.mfo-thesis,
.mfo-record-label,
.mfo-close-line,
.mfo-close-row { margin-inline: auto; }
.mfo-kicker,
.mfo-scroll,
.mfo-record-label,
.mfo-close-row { max-width: var(--measure); }
.mfo-scroll { display: block; }
.mfo-thesis.is-shift { margin-left: auto; margin-right: auto; }
.mfo .mfo-thesis.reveal { transform: translateY(10px); }
.mfo .mfo-thesis.reveal.revealed { transform: none; }
.mfo-contract, .mfo-sign { margin-inline: auto; }

/* hero spotlight (HP3) — pointer-following soft radial, transform-only */
.mfo-open { position: relative; overflow: clip; }
.mfo-spot {
  position: absolute; width: 640px; height: 640px; left: -320px; top: -320px;
  border-radius: 50%; pointer-events: none;
  background: radial-gradient(circle, color-mix(in oklab, var(--accent-violet) 13%, transparent) 0%, transparent 62%);
  transform: translate(30vw, 10vh); will-change: transform;
}
@media (pointer: coarse), (prefers-reduced-motion: reduce) { .mfo-spot { display: none; } }

/* drawn underline under “build” */
.mfo-build { position: relative; display: inline-block; }
.mfo-underline { position: absolute; left: -2%; bottom: -.08em; width: 104%; height: .14em; overflow: visible; }
.mfo-underline path {
  fill: none; stroke: var(--accent-violet); stroke-width: 5; stroke-linecap: round;
  vector-effect: non-scaling-stroke; stroke-dasharray: 130; stroke-dashoffset: 130;
  animation: mfo-underline-draw .9s var(--ease-out) 1.1s forwards;
}
@keyframes mfo-underline-draw { to { stroke-dashoffset: 0; } }

/* surveyor coordinates marginalia */
.mfo-coords {
  position: absolute; top: 1.4rem; right: clamp(1rem, 4vw, 3rem);
  font-family: var(--mono); font-size: .62rem; letter-spacing: .18em;
  color: var(--faint); writing-mode: vertical-rl; text-orientation: mixed;
  opacity: .7; user-select: none;
}
@media (max-width: 900px) { .mfo-coords { display: none; } }

/* record: live pulse + increment flash */
.mfo-live {
  display: inline-block; width: 7px; height: 7px; border-radius: 50%;
  background: var(--signal); margin-right: .6rem; vertical-align: 1px;
  animation: mfo-live 3s ease-in-out infinite;
}
@keyframes mfo-live { 0%, 100% { opacity: .35; } 50% { opacity: 1; } }
.mfo-stat-n { transition: color var(--dur) var(--ease); }
.mfo-stat-n.is-bump { color: var(--signal); }

/* plan cards ride the shared reveal */
.mfo-plans .reveal { transform: translateY(10px); }
.mfo-plans .reveal.revealed { transform: none; }

/* closing polygon mark — draws when revealed into view */
.mfo-close-mark { width: 44px; height: 44px; margin-bottom: 1rem; display: block; }
.mfo-close-poly {
  fill: color-mix(in oklab, var(--accent) 10%, transparent); stroke: var(--accent);
  stroke-width: 2; stroke-linejoin: round; vector-effect: non-scaling-stroke;
  stroke-dasharray: 160; stroke-dashoffset: 160; animation: mfo-underline-draw 1.4s var(--ease-out) .2s forwards;
}
.mfo-close-mark circle { fill: var(--bg); stroke: var(--accent); stroke-width: 1.6; }
@media (prefers-reduced-motion: reduce) {
  .mfo-underline path, .mfo-close-poly { animation: none; stroke-dashoffset: 0; }
  .mfo-live { animation: none; opacity: .8; }
}

/* -------------------------------------------------------------------------- */
/* Live chrome — sidebar capsules, topbar pill, bell, wassup, notif drawer    */
/* -------------------------------------------------------------------------- */
.side-link .side-label {
  flex: 1 1 auto;
  min-width: 0;
}
.side-cap {
  margin-left: auto;
  flex: 0 0 auto;
  font-family: var(--mono);
  font-size: .62rem;
  font-weight: 700;
  letter-spacing: .02em;
  line-height: 1;
  padding: .22rem .42rem;
  border-radius: var(--r-pill);
  background: var(--bg-soft);
  color: var(--faint);
  border: 1px solid var(--line);
  min-width: 1.4rem;
  text-align: center;
}
.side-cap.is-accent,
.side-cap.side-cap--accent:not([hidden]) {
  background: color-mix(in srgb, var(--accent) 18%, var(--bg-raised));
  color: var(--accent-hover);
  border-color: color-mix(in srgb, var(--accent) 30%, transparent);
}
.side-link.is-active .side-cap:not(.is-accent) {
  color: var(--muted);
  border-color: color-mix(in srgb, var(--accent) 18%, var(--line));
}

/* Topbar live pill */
.credit-meter {
  min-height: 36px; display: inline-flex; align-items: center; padding: 0 .75rem;
  border: 1px solid var(--line); border-radius: 999px; color: var(--text);
  background: var(--panel); font-size: .78rem; font-weight: 750; text-decoration: none;
}
.credit-meter.is-low { border-color: var(--warn); color: var(--warn); }
.credit-meter.is-empty { border-color: var(--danger); color: var(--danger); }
.live-pill {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  max-width: min(42vw, 16rem);
  min-height: 2rem;
  padding: .28rem .7rem .28rem .55rem;
  border-radius: var(--r-pill);
  border: 1px solid color-mix(in srgb, var(--accent) 28%, var(--line));
  background: color-mix(in srgb, var(--accent) 12%, var(--bg-raised));
  color: var(--ink);
  text-decoration: none;
  font-size: .75rem;
  font-weight: 620;
  letter-spacing: -.01em;
  transition: background var(--dur) var(--ease), border-color var(--dur) var(--ease);
  flex: 0 1 auto;
  min-width: 0;
}
.live-pill:hover {
  background: color-mix(in srgb, var(--accent) 18%, var(--bg-raised));
  border-color: color-mix(in srgb, var(--accent) 40%, var(--line));
}
.live-pill.is-paused {
  border-color: color-mix(in srgb, var(--warn) 40%, var(--line));
  background: color-mix(in srgb, var(--warn) 14%, var(--bg-raised));
  color: #FDE68A;
}
html[data-theme="light"] .live-pill.is-paused {
  color: #92400E;
}
.live-pill-dot {
  width: .55rem;
  height: .55rem;
  border-radius: 50%;
  flex: 0 0 auto;
  background: var(--accent-hover);
  box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 45%, transparent);
}
.live-pill.is-running .live-pill-dot {
  animation: live-pill-pulse 1.4s var(--ease) infinite;
}
.live-pill.is-paused .live-pill-dot {
  background: var(--warn);
  animation: none;
  box-shadow: none;
}
.live-pill-text {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-family: var(--mono);
  font-size: .68rem;
  font-weight: 600;
}
@keyframes live-pill-pulse {
  0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 50%, transparent); }
  70% { box-shadow: 0 0 0 .45rem transparent; }
  100% { box-shadow: 0 0 0 0 transparent; }
}
@media (prefers-reduced-motion: reduce) {
  .live-pill.is-running .live-pill-dot { animation: none; }
}

/* Notification bell */
.notif-bell {
  position: relative;
  display: inline-grid;
  place-items: center;
  width: var(--touch);
  height: var(--touch);
  min-width: var(--touch);
  min-height: var(--touch);
  border-radius: var(--r-sm);
  border: 1px solid var(--line);
  background: var(--bg-raised);
  color: var(--muted);
  cursor: pointer;
  padding: 0;
  flex: 0 0 auto;
  transition:
    color var(--dur) var(--ease),
    border-color var(--dur) var(--ease),
    background var(--dur) var(--ease);
}
.notif-bell:hover {
  color: var(--ink);
  border-color: var(--line-strong);
  background: var(--bg-soft);
}
.notif-bell svg { width: 1.05rem; height: 1.05rem; display: block; }
.activity-gear.is-working svg { animation: activity-gear-spin 1.35s linear infinite; }
.activity-working-dot { display: none; }
@keyframes activity-gear-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) {
  .activity-gear.is-working {
    color: var(--accent);
    border-color: var(--accent);
    background: var(--accent-soft);
  }
  .activity-gear.is-working svg { animation: none; }
  .activity-gear.is-working .activity-working-dot {
    display: block;
    position: absolute;
    top: .3rem;
    right: .3rem;
    width: .38rem;
    height: .38rem;
    border-radius: 50%;
    background: var(--accent);
  }
}
.notif-badge {
  position: absolute;
  top: .2rem;
  right: .15rem;
  min-width: 1.05rem;
  height: 1.05rem;
  padding: 0 .28rem;
  border-radius: var(--r-pill);
  background: var(--accent);
  color: var(--accent-ink);
  font-family: var(--mono);
  font-size: .58rem;
  font-weight: 700;
  line-height: 1.05rem;
  text-align: center;
  border: 1.5px solid var(--bg-raised);
  pointer-events: none;
}

/* Per-page one-line status */
.wassup {
  margin: .2rem 0 0;
  font-family: var(--mono);
  font-size: .78rem;
  font-weight: 550;
  color: var(--signal);
  letter-spacing: -.01em;
  min-height: 1.1em;
}
.wassup:empty { display: none; }
.territory-brand .wassup {
  width: 100%;
  order: 3;
  margin: .15rem 0 0;
  font-size: .72rem;
}
.demo-rail-head .wassup {
  margin-top: .25rem;
  font-size: .72rem;
}

/* Notification drawer */
.notif-backdrop {
  position: fixed;
  inset: 0;
  z-index: 70;
  border: 0;
  padding: 0;
  margin: 0;
  background: rgba(0, 0, 0, .5);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.notif-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 71;
  width: min(22.5rem, 100vw);
  max-width: 100vw;
  display: flex;
  flex-direction: column;
  background: var(--bg-raised);
  border-left: 1px solid var(--line);
  box-shadow: var(--shadow);
  transform: translateX(0);
}
.notif-drawer[hidden],
.notif-backdrop[hidden] {
  display: none !important;
}
.notif-drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  padding: 1rem 1rem .85rem;
  padding-top: max(1rem, env(safe-area-inset-top, 0px));
  border-bottom: 1px solid var(--line);
  flex: 0 0 auto;
}
.notif-drawer-head h2 {
  margin: 0;
  font-size: 1.05rem;
  letter-spacing: -.02em;
}
.notif-drawer-actions {
  display: flex;
  align-items: center;
  gap: .35rem;
}
.notif-drawer-x {
  display: inline-grid;
  place-items: center;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: var(--r-sm);
  border: 1px solid var(--line);
  background: var(--bg-soft);
  color: var(--muted);
  cursor: pointer;
  padding: 0;
}
.notif-drawer-x:hover { color: var(--ink); }
.notif-drawer-x svg { width: 1rem; height: 1rem; }
.notif-drawer-body {
  flex: 1 1 auto;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: .5rem 0 max(1rem, env(safe-area-inset-bottom, 0px));
}
.notif-list {
  display: flex;
  flex-direction: column;
}
.notif-section { border-bottom: 1px solid var(--line); }
.notif-section-title {
  margin: 0;
  padding: .75rem 1rem .5rem;
  color: var(--muted);
  font-size: .76rem;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
}
[data-notif-new-count],
[data-notif-read-count] {
  display: inline-grid;
  place-items: center;
  min-width: 1.4rem;
  margin-left: .25rem;
  padding: .05rem .35rem;
  border-radius: 999px;
  background: var(--bg-soft);
  color: var(--ink);
}
.notif-read-section > summary { cursor: pointer; list-style-position: inside; }
.notif-read-section > summary:hover { color: var(--ink); }
.notif-section-empty { padding: 1.35rem 1rem 1.6rem; }
.notif-section-empty .empty-body { font-size: .82rem; }
.notif-item {
  display: flex;
  gap: .75rem;
  padding: .85rem 1rem;
  border-bottom: 1px solid var(--line);
}
.notif-item:last-child { border-bottom: 0; }
.notif-item-mark {
  align-self: center;
  flex: 0 0 auto;
  white-space: nowrap;
}
.notif-item.is-read {
  opacity: .62;
}
.notif-dot {
  width: .55rem;
  height: .55rem;
  border-radius: 50%;
  flex: 0 0 auto;
  margin-top: .4rem;
  background: var(--faint);
}
.notif-dot.is-ok {
  background: #34D399;
  box-shadow: 0 0 0 3px color-mix(in srgb, #34D399 22%, transparent);
}
.notif-dot.is-fail {
  background: var(--danger);
  box-shadow: 0 0 0 3px var(--danger-soft);
}
.notif-dot.is-demo {
  background: var(--accent-violet);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent-violet) 22%, transparent);
}
.notif-dot.is-state {
  background: var(--warn);
  box-shadow: 0 0 0 3px var(--warn-soft);
}
.notif-item-main { min-width: 0; flex: 1 1 auto; }
.notif-item-title {
  font-weight: 650;
  font-size: .9rem;
  color: var(--ink);
  letter-spacing: -.015em;
}
.notif-item-line {
  margin-top: .15rem;
  font-size: .82rem;
  color: var(--muted);
  line-height: 1.4;
}
.notif-item-meta {
  margin-top: .3rem;
  font-family: var(--mono);
  font-size: .68rem;
  color: var(--faint);
}
.notif-empty {
  padding: 2.5rem 1.25rem;
  text-align: center;
}
.notif-empty .empty-icon {
  width: 2.75rem;
  height: 2.75rem;
  margin: 0 auto .85rem;
  display: grid;
  place-items: center;
  border-radius: var(--r-md);
  background: var(--bg-soft);
  border: 1px solid var(--line);
  color: var(--muted);
}
.notif-empty .empty-icon svg { width: 1.25rem; height: 1.25rem; }
.notif-empty .empty-title {
  margin: 0;
  font-size: .95rem;
  color: var(--muted);
  font-weight: 600;
}
.notif-empty .empty-body { margin: .35rem 0 0; color: var(--muted); }
.activity-drawer-list { margin: 0; padding: .25rem .65rem; }
.activity-drawer-list li { padding: .85rem .35rem; }
.activity-drawer-list .activity-progress { margin: .35rem 0 0; }
.activity-more { display: flex; justify-content: center; padding: .5rem 1rem 1rem; }

@media (max-width: 767px) {
  .live-pill {
    max-width: min(38vw, 11rem);
  }
  .live-pill-text { font-size: .62rem; }
  .notif-drawer {
    width: 100vw;
    left: 0;
    right: 0;
  }
}

/* -------------------------------------------------------------------------- */
/* Operator services cockpit                                                  */
/* -------------------------------------------------------------------------- */
.services-cockpit {
  padding: 1.1rem 1.15rem 1.15rem;
  margin-bottom: 1.5rem;
}
.services-cockpit .section-head {
  display: flex;
  align-items: baseline;
  gap: .65rem;
  margin-bottom: .85rem;
}
.services-cockpit h2 { margin: 0; }
.services-list {
  display: flex;
  flex-direction: column;
  gap: .65rem;
}
.svc-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: .75rem 1rem;
  padding: .8rem .9rem;
  border-radius: var(--r-md);
  border: 1px solid var(--line);
  background: var(--bg-soft);
}
.svc-meta {
  display: flex;
  align-items: flex-start;
  gap: .7rem;
  min-width: 0;
  flex: 1 1 12rem;
}
.svc-dot {
  width: .6rem;
  height: .6rem;
  border-radius: 50%;
  margin-top: .4rem;
  flex: 0 0 auto;
  background: var(--faint);
}
.svc-dot.is-on {
  background: #34D399;
  box-shadow: 0 0 0 3px color-mix(in srgb, #34D399 22%, transparent);
}
.svc-dot.is-off {
  background: var(--danger);
  box-shadow: 0 0 0 3px var(--danger-soft);
}
.svc-name {
  font-family: var(--mono);
  font-size: .82rem;
  font-weight: 650;
  color: var(--ink);
}
.svc-desc {
  margin-top: .12rem;
  font-size: .8rem;
  color: var(--muted);
}
.svc-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
  flex: 0 0 auto;
}
.svc-btn.is-armed {
  border-color: color-mix(in srgb, var(--warn) 50%, var(--line));
  color: #FDE68A;
  background: color-mix(in srgb, var(--warn) 14%, var(--bg-raised));
}
html[data-theme="light"] .svc-btn.is-armed {
  color: #92400E;
}
.services-loading { margin: 0; }

/* -------------------------------------------------------------------------- */
/* Skeleton loading (perceived speed) — shimmer; reduced-motion → static     */
/* -------------------------------------------------------------------------- */
.sk {
  display: block;
  position: relative;
  overflow: hidden;
  border-radius: var(--r-sm);
  background: color-mix(in srgb, var(--bg-soft) 88%, var(--line));
  color: transparent !important;
  pointer-events: none;
  user-select: none;
}
.sk::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    90deg,
    transparent 0%,
    color-mix(in srgb, var(--ink) 7%, transparent) 45%,
    color-mix(in srgb, var(--ink) 10%, transparent) 50%,
    color-mix(in srgb, var(--ink) 7%, transparent) 55%,
    transparent 100%
  );
  transform: translateX(-100%);
  animation: sk-shimmer 1.35s var(--ease) infinite;
}
.sk-line {
  height: .7rem;
  width: 100%;
  margin: .35rem 0;
}
.sk-line.w-40 { width: 40%; }
.sk-line.w-55 { width: 55%; }
.sk-line.w-70 { width: 70%; }
.sk-line.w-85 { width: 85%; }
.sk-line.w-30 { width: 30%; }
.sk-block {
  min-height: 4.5rem;
  border-radius: var(--r-md);
}
.sk-block.lg { min-height: 7rem; }
.sk-block.xl { min-height: 12rem; }
.sk-row {
  display: flex;
  flex-direction: column;
  gap: .45rem;
  padding: .75rem 0;
  border-bottom: 1px solid var(--line);
}
.sk-row:last-child { border-bottom: 0; }
.sk-card {
  padding: 1rem 1.1rem;
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  background: var(--bg-raised);
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: .55rem;
  min-height: 8.5rem;
}

/* Hide real content while hydrating; show skeleton shell */
[data-sk-host].is-sk-loading > [data-sk-real] { display: none !important; }
[data-sk-host]:not(.is-sk-loading) > [data-sk-shell] { display: none !important; }
[data-sk-host].is-sk-loading > [data-sk-shell] { display: block; }

/* Pipeline / activity hydrate */
.sk-pipeline-track {
  display: none;
  grid-template-columns: repeat(auto-fit, minmax(14.5rem, 1fr));
  gap: .85rem;
  margin: 0;
  padding: 0;
  min-width: 0;
}
.sk-activity {
  display: none;
  padding: .25rem 0;
}
.pipeline.is-sk-loading .dash-layout > .pipeline-track,
.pipeline.is-sk-loading .pipeline-activity .activity-list {
  display: none !important;
}
.pipeline.is-sk-loading .sk-pipeline-track {
  display: grid;
}
.pipeline.is-sk-loading .sk-activity {
  display: block;
}
.pipeline:not(.is-sk-loading) .sk-pipeline-track,
.pipeline:not(.is-sk-loading) .sk-activity {
  display: none !important;
}

/* Notif drawer skeleton */
.notif-sk { padding: 0 .25rem; }
.notif-sk .sk-row {
  padding: .85rem 1rem;
  flex-direction: row;
  align-items: flex-start;
  gap: .75rem;
}
.notif-sk .sk-dot {
  width: .55rem;
  height: .55rem;
  border-radius: 50%;
  flex: 0 0 auto;
  margin-top: .35rem;
}
.notif-sk .sk-main { flex: 1 1 auto; min-width: 0; }
body.notif-open .notif-drawer:not(.is-sk-ready) [data-notif-list]:empty + [data-notif-empty],
.notif-drawer.is-sk-loading [data-notif-empty] { display: none !important; }
.notif-drawer.is-sk-loading [data-notif-sk] { display: block; }
.notif-drawer:not(.is-sk-loading) [data-notif-sk] { display: none !important; }
.activity-drawer.is-sk-loading [data-activity-empty] { display: none !important; }
.activity-drawer.is-sk-loading [data-activity-sk] { display: block; }
.activity-drawer:not(.is-sk-loading) [data-activity-sk] { display: none !important; }

/* Businesses skeleton */
.biz-sk-list {
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: .25rem 1rem 1rem;
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  background: var(--bg-raised);
  box-shadow: var(--shadow-sm);
}
.biz-page.is-sk-loading .biz-groups,
.biz-page.is-sk-loading .biz-filters,
.biz-page.is-sk-loading .biz-search-bar,
.biz-page.is-sk-loading .empty.surface:not(.biz-sk-list) {
  display: none !important;
}
.biz-page:not(.is-sk-loading) .biz-sk-list { display: none !important; }

/* Demos preview skeleton */
.demo-preview-sk {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  flex-direction: column;
  gap: .75rem;
  padding: 1.25rem;
  background: var(--bg-soft);
}
.demo-preview-wrap { position: relative; }
.demo-preview-wrap.is-frame-ready .demo-preview-sk { display: none !important; }
.demo-rail-sk {
  display: flex;
  flex-direction: column;
  gap: .35rem;
  padding: 0 .65rem 1rem;
}
.demo-review.is-sk-loading .demo-list { display: none !important; }
.demo-review:not(.is-sk-loading) .demo-rail-sk { display: none !important; }
.demo-review.is-sk-loading .demo-rail-sk { display: flex; }

/* Reports skeleton */
.reports-sk {
  display: flex;
  flex-direction: column;
  gap: .65rem;
}
.reports-page.is-sk-loading .table-shell,
.reports-page.is-sk-loading .empty {
  display: none !important;
}
.reports-page:not(.is-sk-loading) .reports-sk { display: none !important; }

/* Territory map skeleton until style loads */
.territory-map-sk {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-end;
  gap: .75rem;
  padding: 1.25rem;
  background:
    radial-gradient(ellipse 80% 50% at 30% 40%, color-mix(in srgb, var(--accent) 12%, transparent), transparent 60%),
    radial-gradient(ellipse 60% 40% at 70% 60%, color-mix(in srgb, var(--accent-violet) 10%, transparent), transparent 55%),
    #0B0E1A;
  pointer-events: none;
}
.territory-map-sk .sk-map-bar {
  height: .55rem;
  border-radius: var(--r-pill);
  max-width: 12rem;
}
.territory-map-frame.is-map-ready .territory-map-sk { display: none !important; }
.territory-map-frame:not(.is-map-ready) .territory-map {
  opacity: 0;
}

@keyframes sk-shimmer {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

@media (prefers-reduced-motion: reduce) {
  .sk::after {
    animation: none !important;
    transform: none !important;
    background: color-mix(in srgb, var(--ink) 5%, transparent);
  }
}

/* Responsive polish — names wrap on narrow screens (see mobile .biz-name) */
.demo-item-biz {
  white-space: normal;
  overflow: hidden;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
}
.demo-current-name {
  overflow: hidden;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  min-width: 0;
}
.mode-btn {
  min-height: var(--touch);
  padding: .35rem .85rem;
}
.demo-filter {
  min-height: var(--touch);
  padding: .45rem .7rem;
}
.biz-group-head {
  min-height: var(--touch);
}
.table-cards .btn.sm {
  min-height: var(--touch);
}
.notif-drawer-x {
  width: var(--touch);
  height: var(--touch);
  min-width: var(--touch);
  min-height: var(--touch);
}
.territory-info-btn {
  min-width: var(--touch);
  min-height: var(--touch);
}

/* Prevent sticky bottom demos actions overlapping mobile nav */
@media (max-width: 1023px) {
  .demo-actions {
    bottom: calc(var(--mobile-nav-h) + env(safe-area-inset-bottom, 0px));
  }
  .biz-filters {
    top: calc(var(--nav-h) + env(safe-area-inset-top, 0px) + .15rem);
  }
}
@media (max-width: 390px) {
  .live-pill { max-width: min(42vw, 9.5rem); }
  .pipeline-head { gap: .5rem; }
  .stats-grid .stat { font-size: clamp(1.45rem, 8vw, 1.85rem); }
  .biz-chips { gap: .4rem; }
  .biz-chip { font-size: .78rem; }
}
@media (max-width: 360px) {
  .wrap { padding-left: .75rem; padding-right: .75rem; }
  .side-link { font-size: .85rem; }
  .mobile-nav a { font-size: .6rem; }
}

/* Overflow guard — zero horizontal scroll on app pages.
 * `.wrap` owns page width (`--container`); do not override it here. Shrinking
 * flex/grid children with min-width:0 is the overflow protection. Settings is
 * a separately tuned full-width shell, so its width remains explicit. */
html, body { overflow-x: clip; max-width: 100%; }
.app-shell, .app-column, main, .settings-shell {
  max-width: 100%;
}
.app-shell, .app-column, main, .wrap, .live-page, .settings-shell {
  min-width: 0;
}
.table-shell { max-width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }

/* ========================================================================== */
/* Pixel mastery — rhythm, states, motion, density, details (2026-07-28)      */
/* ========================================================================== */

/* Labels / captions — one size system */
.field span,
.tile h3,
.pipeline-kicker,
.gs-kicker,
.mfo-kicker,
.section-head .count,
.card-number {
  font-size: var(--text-label);
  letter-spacing: .04em;
}
.tile-meta,
.wassup,
.small,
.foot-site {
  font-size: var(--text-sm);
}
.muted.control-copy,
.card-copy,
.empty-body {
  font-size: var(--text-sm);
  line-height: 1.5;
}

/* Brand mark radius on 4pt */
.brand .dot { border-radius: var(--r-sm); }

/* Theme / icon chrome — full state set */
.theme-toggle:focus-visible,
.notif-bell:focus-visible,
.sidebar-toggle:focus-visible,
.territory-info-btn:focus-visible,
.notif-drawer-x:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}
.theme-toggle:disabled,
.notif-bell:disabled {
  opacity: .5;
  cursor: not-allowed;
  pointer-events: none;
}
.side-link:active { transform: translateX(1px); }
.side-link:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: -2px;
}
.mobile-nav a:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}
.mobile-nav a:active { opacity: .85; }

/* Inputs — disabled + focus-visible parity */
.field input:disabled,
.field select:disabled,
.field textarea:disabled,
.site-field input:disabled,
.site-field textarea:disabled {
  opacity: .55;
  cursor: not-allowed;
  background: var(--bg-soft);
}
.field select:focus,
.field textarea:focus,
.site-field input:focus,
.site-field textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-dim);
}

/* Async error surface with retry (shared) */
.async-error {
  display: grid;
  gap: var(--s-3);
  place-items: center;
  text-align: center;
  padding: var(--s-6) var(--s-5);
  border: 1px dashed color-mix(in srgb, var(--danger) 40%, var(--line));
  border-radius: var(--r-lg);
  background: var(--danger-soft);
  color: var(--ink);
}
.async-error .empty-title { color: var(--danger); margin: 0; }
.async-error .empty-body { margin: 0; max-width: 36ch; }
.async-error .btn { margin-top: var(--s-1); }

/* Equal baselines in stat rows */
.stats-grid .stat,
.tile .stat {
  margin-top: auto;
  font-variant-numeric: tabular-nums;
}
.tile .tile-meta { margin-top: var(--s-2); }

/* Pipeline / demo / biz interactive press */
.pipe-step .btn:active:not(:disabled),
.demo-item:active,
.biz-row:active,
.control-btn:active:not(:disabled) {
  transform: scale(.985);
}
.demo-filter:active,
.mode-btn:active,
.svc-btn:active:not(:disabled) {
  transform: scale(.97);
}

/* Services cockpit armed + loading feedback */
.svc-btn.is-armed {
  border-color: var(--warn);
  color: var(--warn);
  background: var(--warn-soft);
}
.svc-btn.loading { min-width: 5.5rem; }

/* Form submit working — opt-in via data-work-form or .js-work-form */
form.is-submitting .btn[type="submit"],
form.is-submitting button[type="submit"] {
  pointer-events: none;
}

/* Motion: mfo reduced-motion uses token, not 150ms raw */
@media (prefers-reduced-motion: reduce) {
  .mfo .reveal {
    transition: opacity var(--dur-micro) linear !important;
    transform: none !important;
  }
  .btn.loading::before,
  .pipe-step.is-working .pipe-shimmer::after,
  .live-pill.is-running .live-pill-dot,
  .sk::after {
    animation: none !important;
  }
}

/* Page rhythm — consistent main padding on app surfaces */
.has-app-shell main > .wrap,
.has-app-shell .settings-shell,
.has-app-shell .site-builder {
  padding-top: var(--s-5);
  padding-bottom: calc(var(--s-8) + env(safe-area-inset-bottom, 0px));
}
.has-app-shell .pagehead {
  margin-bottom: var(--s-5);
  align-items: flex-start;
  gap: var(--s-3);
}
.has-app-shell .section { margin-top: var(--space-section); }
.has-app-shell .section > h2,
.has-app-shell .section-head {
  margin-bottom: var(--s-3);
  gap: var(--s-2) var(--s-3);
}

/* Auth card rhythm */
.auth .card {
  padding: var(--s-6) var(--s-6);
}
.auth .field { margin-bottom: var(--s-4); }
.auth .btn.primary { margin-top: var(--s-1); }

/* Footer stays quiet */
.foot-wrap {
  padding-top: var(--s-4);
  padding-bottom: calc(var(--s-4) + env(safe-area-inset-bottom, 0px));
}
.has-app-shell .foot-wrap {
  padding-bottom: calc(var(--mobile-nav-h) + var(--s-4) + env(safe-area-inset-bottom, 0px));
}
@media (min-width: 1024px) {
  .has-app-shell .foot-wrap { padding-bottom: var(--s-5); }
}

/* -------------------------------------------------------------------------- */
/* Print — reports clean B/W                                                  */
/* -------------------------------------------------------------------------- */
@media print {
  :root {
    --bg: #fff;
    --bg-raised: #fff;
    --bg-soft: #f5f5f5;
    --ink: #111;
    --muted: #444;
    --faint: #666;
    --line: #ccc;
    --line-strong: #999;
    --accent: #222;
    --accent-hover: #000;
    --shadow: none;
    --shadow-sm: none;
    --shadow-glow: none;
    --glow-violet: transparent;
    --glow-indigo: transparent;
    --grid-line: transparent;
  }
  html, body {
    background: #fff !important;
    color: #111 !important;
    font-size: 11pt;
    -webkit-print-color-adjust: economy;
    print-color-adjust: economy;
  }
  body {
    background-image: none !important;
  }
  .topbar,
  .app-sidebar,
  .sidebar-backdrop,
  .mobile-nav,
  .theme-toggle,
  .notif-bell,
  .notif-drawer,
  .notif-backdrop,
  .live-pill,
  .foot-wrap,
  .side-cap,
  .wassup,
  .btn,
  .pipeline-stop,
  .toast,
  [data-live-pill],
  .sidebar-toggle {
    display: none !important;
  }
  .app-shell,
  .app-column,
  main,
  .wrap {
    display: block !important;
    width: 100% !important;
    max-width: none !important;
    margin: 0 !important;
    padding: 0 !important;
    box-shadow: none !important;
  }
  .tile,
  .surface,
  .section,
  .card,
  .table-shell {
    break-inside: avoid;
    box-shadow: none !important;
    border: 1px solid #bbb !important;
    background: #fff !important;
  }
  .stats-grid {
    display: grid !important;
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 8pt !important;
  }
  .stat,
  .table td,
  .table th {
    font-variant-numeric: tabular-nums;
    color: #111 !important;
  }
  a { color: #111 !important; text-decoration: none !important; }
  .pagehead h1 { font-size: 16pt; margin-bottom: 8pt; }
  .reports-page .badge { border: 1px solid #999; color: #111; background: #fff; }
  .trend { color: #111 !important; }
}

/* High-contrast focus for keyboard users on dark navy */
@media (prefers-reduced-transparency: reduce) {
  .topbar {
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    background: var(--bg-raised);
  }
}

/* Inbox */
.inbox-page { padding-top: 30px; padding-bottom: 50px; }
.inbox-head { margin-bottom: 20px; }
.inbox-disabled { max-width: 720px; margin: 7vh auto; padding: 48px; text-align: center; }
.inbox-disabled-icon { width: 54px; height: 54px; margin: 0 auto 18px; display: grid; place-items: center; border-radius: 50%; background: var(--accent-soft); color: var(--accent); font-size: 24px; }
.inbox-disabled h2 { margin: 0 0 12px; }
.inbox-disabled p { max-width: 570px; margin: 10px auto; color: var(--text-muted); line-height: 1.65; }
.inbox-layout { display: grid; grid-template-columns: minmax(280px, 360px) minmax(0, 1fr); gap: 18px; min-height: 680px; }
.inbox-list { padding: 0; overflow: hidden; }
.inbox-list > h2 { padding: 20px 22px 14px; margin: 0; font-size: 16px; }
.inbox-row { display: block; position: relative; padding: 15px 20px; border-top: 1px solid var(--border); color: inherit; text-decoration: none; }
.inbox-row:hover, .inbox-row.is-active { background: var(--surface-hover); }
.inbox-row.is-unread::before { content: ''; position: absolute; left: 8px; top: 22px; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }
.inbox-row-top { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.inbox-row-top b, .inbox-subject, .inbox-business { display: block; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.inbox-row-top time { flex: none; color: var(--text-muted); font-size: 11px; }
.inbox-business { margin-top: 4px; color: var(--text-muted); font-size: 12px; }
.inbox-subject { margin-top: 5px; font-size: 13px; }
.inbox-row.is-unread .inbox-subject { font-weight: 700; }
.inbox-thread { padding: 0; overflow: hidden; }
.inbox-thread-head { display: flex; justify-content: space-between; gap: 24px; align-items: center; padding: 22px 26px; border-bottom: 1px solid var(--border); }
.inbox-thread-head h2, .inbox-thread-head p { margin: 2px 0; }
.inbox-thread-head > div > p:last-child { color: var(--text-muted); font-size: 13px; }
.inbox-context { text-align: right; color: var(--text-muted); font-size: 12px; }
.inbox-context span { display: block; margin-bottom: 8px; }
.inbox-messages { padding: 24px; display: flex; flex-direction: column; gap: 14px; max-height: 440px; overflow: auto; }
.inbox-message { max-width: 82%; padding: 16px 18px; border: 1px solid var(--border); border-radius: 14px; background: var(--bg-raised); }
.inbox-message--out { align-self: flex-end; background: var(--accent-soft); }
.inbox-message header { display: flex; justify-content: space-between; gap: 20px; font-size: 12px; }
.inbox-message time, .inbox-message-subject { color: var(--text-muted); }
.inbox-message-subject { margin: 7px 0; font-size: 12px; }
.inbox-message-body { white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.55; }
.inbox-compose { border-top: 1px solid var(--border); padding: 20px 24px 24px; }
.inbox-compose label { display: block; margin-bottom: 8px; font-weight: 700; }
.inbox-compose textarea { width: 100%; min-height: 110px; resize: vertical; margin-bottom: 12px; }
.inbox-compose-help { margin-left: 10px; color: var(--text-muted); font-size: 12px; }
.inbox-success, .inbox-error { margin: 14px 24px 0; padding: 10px 12px; border-radius: 8px; }
.inbox-success { background: color-mix(in srgb, #22c55e 12%, transparent); }
.inbox-error { background: color-mix(in srgb, #ef4444 12%, transparent); }
@media (max-width: 760px) {
  .inbox-page { padding: 18px 12px 90px; }
  .inbox-layout { display: block; }
  .inbox-list { margin-bottom: 14px; max-height: 280px; overflow: auto; }
  .inbox-thread-head { align-items: flex-start; padding: 18px; }
  .inbox-context { display: none; }
  .inbox-messages { padding: 16px; max-height: none; }
  .inbox-message { max-width: 94%; }
  .inbox-compose { padding: 16px; }
  .inbox-disabled { margin: 30px 0; padding: 34px 22px; }
}

/* Domains — approved demo → business-owned address (lane 120) */
.domains-page { padding-top: 30px; padding-bottom: 60px; }
.domains-head { margin-bottom: 22px; }
.domains-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 18px; }
.domain-card,.domain-managed,.domain-empty { padding: 26px; }
.domain-card h2,.domain-managed h2,.domain-managed h3,.domain-empty h2 { margin: 8px 0; }
.domain-step { color: var(--accent); font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; }
.domain-form label { display:block; margin: 20px 0 7px; font-weight: 700; }
.domain-form select { width:100%; }
.domain-input-row { display:flex; gap:9px; }
.domain-input-row input { min-width:0; flex:1; }
.domain-message,.domain-search-result,[data-action-message] { color:var(--text-muted); line-height:1.5; }
.domain-list { display:grid; gap:16px; margin-top:20px; }
.domain-managed-head,.domain-managed-head>div,.domain-actions { display:flex; align-items:center; gap:10px; }
.domain-managed-head { justify-content:space-between; }
.status-dot { width:9px; height:9px; border-radius:50%; background:#eab308; display:inline-block; flex-shrink:0; }
.status-dot.status-connected,.status-connected { background:#22c55e; }
.status-dot.status-waiting,.status-waiting,.status-dot.status-live,.status-dot.status-published { background:#eab308; }
.status-dot.status-connected { background:#22c55e; }
.status-dot.status-failed,.status-failed { background:#ef4444; }
.domain-demo-line { margin:0 0 8px; color:var(--text-muted); }
.domain-next { margin:8px 0 18px; color:var(--text-muted); }
.domain-howto { margin:12px 0 16px; padding-left:1.2em; line-height:1.55; color:var(--text-muted); }
.domain-howto li { margin:6px 0; }
.dns-records { border:1px solid var(--border); border-radius:12px; overflow:hidden; }
.dns-record { display:grid; grid-template-columns:90px 90px minmax(180px,1fr) auto; align-items:center; gap:14px; padding:13px 15px; border-top:1px solid var(--border); }
.dns-record:first-child { border-top:0; }
.dns-record span { min-width:0; }
.dns-record small,.dns-record code { display:block; }
.dns-record small { color:var(--text-muted); margin-bottom:3px; }
.dns-record code { overflow-wrap:anywhere; }
.dns-plain { margin:0 0 12px; font-size:14px; line-height:1.45; }
.domain-actions { margin-top:16px; flex-wrap:wrap; }
.domain-error { color:#ef4444; }
.demo-ship { margin:18px 16px 24px; padding:22px 24px; }
.demo-ship-head h2 { margin:6px 0 8px; }
.demo-ship-head p { color:var(--text-muted); max-width:52ch; }
.demo-ship-form { max-width:520px; }
.demo-ship-list { margin-top:16px; }
.demo-ship-foot { margin-top:16px; }
@media (max-width:760px) {
  .domains-page { padding:18px 12px 90px; }
  .domains-grid { grid-template-columns:1fr; }
  .domain-input-row { flex-direction:column; }
  .dns-record { grid-template-columns:60px 70px minmax(0,1fr); gap:9px; }
  .dns-record button { grid-column:1/-1; }
  .domain-managed-head { align-items:flex-start; }
  .domain-actions { align-items:flex-start; flex-direction:column; }
  .demo-ship { margin:12px 8px 80px; }
}

/* ========================================================================== */
/* Hallmark · macrostructure: Manifesto (preserved) + vertical-tab walkthrough
 * tone: editorial · anchor hue: indigo/violet (system) · enrichment: real
 * product screenshots · pre-emit critique: P4 H5 E4 S5 R4 V4
 * ------------------------------------------------------------------------- */
/* Landing v3 — one column · a map you can see · a walkthrough (2026-08-05)   */
/* --------------------------------------------------------------------------
 * Fixes four reported faults and adds the product tour:
 *  1. The hero map was `position:absolute; inset:0` at opacity .43 under a
 *     98%-background scrim — invisible, and it swallowed every wheel event so
 *     the page could not be scrolled at all (see territory.js demo-mode gate).
 *     It is now a bounded, fully opaque panel beside the copy.
 *  2. The page had four different content widths. `.wrap`'s container
 *     max-width had been clobbered by the later `max-width:100%` overflow
 *     guard, so most bands ran full-bleed. Scoped back here.
 *  3. `The record` is centred, as asked.
 *  4. The nav had no room and its CTA wrapped to two lines on a phone.
 * -------------------------------------------------------------------------- */

/* --- one column, one left edge ------------------------------------------- */
.mfo { --mfo-col: 72rem; }
.mfo .wrap {
  max-width: min(var(--mfo-col), 100%);
  margin-inline: auto;
}
/* the old sheet centred each prose block on its own axis; align them instead */
.mfo-kicker,
.mfo-decl,
.mfo-claim,
.mfo-scroll,
.mfo-thesis,
.mfo-thesis.is-shift { margin-inline: 0; }
.mfo-kicker,
.mfo-scroll { max-width: none; }

/* --- hero: copy beside a map that is actually a map ----------------------- */
.mfo-open {
  min-height: 0;
  padding: clamp(2rem, 6vh, 4rem) 0 clamp(2.5rem, 7vh, 4.5rem);
  display: block;
  overflow: clip;
}
.mfo-open .wrap { pointer-events: auto; }
.mfo-open-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.02fr);
  gap: clamp(1.75rem, 4vw, 3.5rem);
  align-items: center;
}
.mfo-open-copy { min-width: 0; }
/* the display face was sized for a full-width hero; in a two-column hero the
 * old clamp broke "We don't pitch." across three ragged lines. */
.mfo-open-copy .mfo-decl {
  /* sized so "We don't pitch." holds one line in the narrower copy column
   * the enlarged map leaves behind */
  font-size: clamp(2.1rem, 4vw, 3.55rem);
  max-width: none;
}
.mfo-open-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem clamp(1rem, 3vw, 2rem);
  margin-top: 2rem;
}
.mfo-open-actions .mfo-scroll { margin: 0; }
.landing-create { display: inline-flex; margin-bottom: 0; }

.mfo-open-map {
  margin: 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: .7rem;
}
/* was absolute/inset-0 behind the copy — now a sized parent, per the
 * MapLibre container rule: the canvas fills a box that has a real height. */
.landing-map-wrap {
  position: relative;
  inset: auto;
  z-index: 0;
  aspect-ratio: 4 / 3;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-xl);
  overflow: hidden;
  background: var(--bg-raised);
  box-shadow: var(--shadow);
}
.landing-map { width: 100%; height: 100%; opacity: 1; filter: none; }
/* the copy no longer sits on the map, so the contrast scrim it needed is gone;
 * all that is left is an inner hairline so the panel reads as a surface. */
.landing-map-wrap::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  border-radius: inherit;
  background: none;
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--ink) 6%, transparent);
}
.landing-map-wrap .maplibregl-control-container { opacity: .55; }
.landing-map-fallback {
  position: absolute;
  inset: auto 1rem 1rem;
  text-align: center;
  color: var(--faint);
  font-size: .78rem;
}
.landing-picker-status {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  align-items: baseline;
  gap: .2rem .6rem;
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  backdrop-filter: none;
}
.landing-picker-hint { color: var(--faint); font-size: .76rem; }
.landing-hover { z-index: 4; top: .75rem; bottom: auto; left: 50%; transform: translateX(-50%); }

/* --- nav: room to breathe ------------------------------------------------ */
.topbar:has(.mfo-anchors) {
  min-height: 4.5rem;
  padding-block: .6rem;
  padding-inline: clamp(1rem, 4vw, 3rem);
  gap: clamp(.6rem, 2vw, 1.1rem);
}
.topbar:has(.mfo-anchors) .row { gap: clamp(.6rem, 2vw, 1.1rem); }
.topbar:has(.mfo-anchors) .mfo-anchors {
  margin-left: clamp(1rem, 4vw, 3rem);
  margin-right: auto;
  gap: clamp(1rem, 2.5vw, 2rem);
}
.topbar:has(.mfo-anchors) .btn.ghost.sm,
.topbar:has(.mfo-anchors) .btn.primary.sm { margin-right: 0; white-space: nowrap; }
.mfo-nav-cta .mfo-cta-short { display: none; }

/* --- the record: centred, as asked --------------------------------------- */
.mfo-record .wrap { text-align: center; }
.mfo-record-label { margin-inline: auto; max-width: none; }
.mfo-record-row { justify-items: center; }
.mfo-stat { text-align: center; min-width: 0; }

/* --- the walkthrough: vertical tabs over real captures -------------------- */
.mfo-tour { padding: clamp(2.5rem, 8vh, 5rem) 0; border-top: 1px solid var(--line); }
.mfo-tour-title {
  font-family: var(--font-display);
  font-weight: 560;
  font-size: clamp(1.9rem, 4.5vw, 3rem);
  line-height: 1.06;
  letter-spacing: -.015em;
  color: var(--ink);
  margin: 0 0 .4rem;
  overflow-wrap: anywhere;
  min-width: 0;
}
.mfo-tour-lede { color: var(--muted); margin: 0 0 clamp(1.5rem, 4vw, 2.5rem); max-width: var(--measure); }

.mfo-tour-grid {
  display: grid;
  grid-template-columns: minmax(0, 19rem) minmax(0, 1fr);
  gap: clamp(1.25rem, 3vw, 2.5rem);
  align-items: start;
}
.mfo-tour-rail { display: flex; flex-direction: column; gap: .5rem; min-width: 0; }

.mfo-tour-tab {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: .85rem;
  width: 100%;
  padding: .85rem 1rem;
  text-align: left;
  font: inherit;
  color: var(--muted);
  background: none;
  border: 1px solid transparent;
  border-radius: var(--r-md);
  cursor: pointer;
  transition: color var(--dur-micro) var(--ease-out),
              background-color var(--dur-micro) var(--ease-out),
              border-color var(--dur-micro) var(--ease-out);
}
.mfo-tour-tab:hover { color: var(--ink); background: var(--bg-hover); }
.mfo-tour-tab:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.mfo-tour-tab:active { background: var(--bg-soft); }
.mfo-tour-tab[aria-selected="true"] {
  color: var(--ink);
  background: var(--bg-soft);
  border-color: color-mix(in srgb, var(--accent) 45%, var(--line));
}
.mfo-tour-step {
  display: grid;
  place-items: center;
  width: 1.85rem;
  height: 1.85rem;
  border-radius: 50%;
  font-family: var(--mono);
  font-size: .78rem;
  color: var(--faint);
  border: 1px solid var(--line-strong);
  transition: color var(--dur-micro) var(--ease-out),
              background-color var(--dur-micro) var(--ease-out);
}
.mfo-tour-tab[aria-selected="true"] .mfo-tour-step {
  color: var(--accent-ink);
  background: var(--accent);
  border-color: var(--accent);
}
.mfo-tour-tab-text { display: flex; flex-direction: column; gap: .1rem; min-width: 0; }
.mfo-tour-tab-title { font-weight: 650; overflow-wrap: anywhere; }
.mfo-tour-tab-sub {
  font-family: var(--mono);
  font-size: .68rem;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--faint);
}

.mfo-tour-stage { min-width: 0; }
.mfo-tour-panel:focus-visible { outline: 2px solid var(--focus); outline-offset: 4px; border-radius: var(--r-lg); }
.mfo-tour-figure {
  margin: 0;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-lg);
  overflow: hidden;
  background: var(--bg-raised);
  box-shadow: var(--shadow);
}
.mfo-tour-figure img { display: block; width: 100%; height: auto; }
.mfo-tour-body { color: var(--muted); margin: 1rem 0 0; max-width: var(--measure); }
.js .mfo-tour-panel:not([hidden]) { animation: mfo-tour-in var(--dur-slow) var(--ease-out) both; }
@keyframes mfo-tour-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* --- mobile ------------------------------------------------------------- */
@media (max-width: 900px) {
  .mfo-open-grid { grid-template-columns: minmax(0, 1fr); gap: 1.75rem; }
  .mfo-open-map { order: 2; }
  .landing-map-wrap { aspect-ratio: 3 / 2; }
  .mfo-tour-grid { grid-template-columns: minmax(0, 1fr); }
  .mfo-tour-tab { padding: .7rem .85rem; }
}
@media (max-width: 640px) {
  .topbar:has(.mfo-anchors) { min-height: 4rem; padding-inline: 1rem; }
  .mfo-decl { max-width: none; }
  .landing-map-wrap { aspect-ratio: 4 / 3; }
  .mfo-open-actions { gap: .85rem 1.25rem; }
  .mfo-tour-tab-sub { display: none; }
}
@media (max-width: 460px) {
  /* the CTA used to wrap onto two lines — never acceptable on a control */
  .mfo-nav-cta .mfo-cta-long { display: none; }
  .mfo-nav-cta .mfo-cta-short { display: inline; }
  .topbar:has(.mfo-anchors) .btn.sm { padding-inline: .7rem; font-size: .82rem; }
  .mfo-open-actions .landing-create { width: 100%; justify-content: center; }
}
@media (prefers-reduced-motion: reduce) {
  .js .mfo-tour-panel:not([hidden]) { animation: none; }
}

/* five tiers should read as one row, not four-plus-an-orphan */
@media (min-width: 1000px) {
  .mfo-plans { grid-template-columns: repeat(5, minmax(0, 1fr)); }
}
/* the closing mark sat hard-left while its own statement was centred */
.mfo-close .wrap { text-align: center; }
.mfo-close-mark { display: block; margin-inline: auto; }
.mfo-close-line { margin-inline: auto; }
.mfo-close-row { justify-content: center; }

/* ========================================================================== */
/* Landing hero map — larger, edges feathered, interaction on request         */
/* --------------------------------------------------------------------------
 * The map is a picture until you click it. That is what keeps the page
 * scrollable: with its navigation handlers live, MapLibre swallows every wheel
 * and touch gesture over the hero and nothing below the fold can be reached.
 * The veil sits on top and takes that first click, so nothing can reach the
 * canvas until the visitor asks for it. Escape hands it back.
 * -------------------------------------------------------------------------- */

@media (min-width: 901px) {
  /* the map earns more of the row than the copy now */
  .mfo-open-grid { grid-template-columns: minmax(0, .92fr) minmax(0, 1.28fr); }
}

.landing-map-wrap {
  aspect-ratio: 5 / 4;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  background: transparent;
  /* feather all four edges into the page instead of framing the map. Two
   * gradients intersected — one per axis — so the corners fall off too. */
  -webkit-mask-image:
    linear-gradient(to right, transparent 0, #000 13%, #000 87%, transparent 100%),
    linear-gradient(to bottom, transparent 0, #000 11%, #000 89%, transparent 100%);
  mask-image:
    linear-gradient(to right, transparent 0, #000 13%, #000 87%, transparent 100%),
    linear-gradient(to bottom, transparent 0, #000 11%, #000 89%, transparent 100%);
  -webkit-mask-composite: source-in;
  mask-composite: intersect;
}
/* the framing ring and inner hairline fought the feathered edge */
.landing-map-wrap::after { content: none; }

.landing-map-veil {
  position: absolute;
  inset: 0;
  z-index: 5;
  display: grid;
  place-items: center;
  width: 100%;
  padding: 0;
  border: 0;
  background: none;
  font: inherit;
  color: inherit;
  cursor: pointer;
}
.landing-map-veil-pill {
  padding: .5rem .9rem;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--accent) 40%, var(--line-strong));
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  backdrop-filter: blur(8px);
  color: var(--ink);
  font-size: .82rem;
  font-weight: 600;
  box-shadow: var(--shadow-sm);
  transition: transform var(--dur-micro) var(--ease-out),
              background-color var(--dur-micro) var(--ease-out);
}
.landing-map-veil:hover .landing-map-veil-pill { transform: translateY(-1px); background: var(--bg); }
.landing-map-veil:focus-visible { outline: 2px solid var(--focus); outline-offset: -4px; }
.landing-map-wrap.is-live .landing-map-veil { display: none; }

/* a quiet frame appears only while the map is actually taking input, so it is
 * obvious the page has handed the gesture over */
.landing-map-wrap.is-live {
  -webkit-mask-image: none;
  mask-image: none;
  border-radius: var(--r-lg);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--accent) 45%, transparent), var(--shadow);
}
.landing-map-release {
  position: absolute;
  z-index: 6;
  right: .6rem;
  top: .6rem;
  padding: .3rem .6rem;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: color-mix(in srgb, var(--bg) 85%, transparent);
  backdrop-filter: blur(6px);
  color: var(--muted);
  font-family: var(--mono);
  font-size: .68rem;
  cursor: pointer;
}
.landing-map-release:hover { color: var(--ink); }
.landing-map-wrap:not(.is-live) .landing-map-release { display: none; }

.landing-map-credit { color: var(--faint); font-size: .7rem; }

@media (max-width: 900px) {
  .landing-map-wrap { aspect-ratio: 4 / 3; }
}
@media (prefers-reduced-motion: reduce) {
  .landing-map-veil-pill { transition: none; }
}

/* ========================================================================== */
/* Phone usability pass (2026-08-08)                                         */
/* ========================================================================== */

/* Names, slugs and domains are live data. Keep every containing track able to
   shrink, then wrap the value instead of widening the page. */
.pagehead,
.pagehead > *,
.gs-body,
.billing-card,
.domain-card,
.domain-managed,
.domain-managed-head,
.inbox-thread-head,
.demo-toolbar-meta {
  min-width: 0;
}
.pagehead h1,
.pagehead p,
.gs-step-title,
.gs-step-copy,
.billing-card,
.domain-card,
.domain-managed,
.domain-managed h2,
.domain-managed h3,
.domain-message,
.demo-current-name,
.inbox-thread-head h2 {
  overflow-wrap: anywhere;
}

/* Decorative glow must never count as content overflow. */
.glow-card { overflow: clip; }
.glow-card::after { inset: 0 0 auto; }

/* Text links are controls too. Give the recurring customer-facing link styles
   a real finger target without shrinking or wrapping their labels. */
.brand,
.auth-link,
.answer-card a,
.flowbar-back,
.flowbar-step > a,
.demo-open-full,
.demo-ship-foot a,
.domain-empty a {
  min-height: var(--touch);
  align-items: center;
}
.auth-link,
.answer-card a,
.demo-open-full,
.demo-ship-foot a,
.domain-empty a {
  display: inline-flex;
  white-space: nowrap;
}
.has-app-shell .flowbar-back,
.has-app-shell .flowbar-step > a {
  min-width: var(--touch);
  min-height: var(--touch);
}
@media (max-width: 1023px) {
  .has-app-shell .flowbar .flowbar-steps { gap: 0; }
  .has-app-shell .mobile-nav {
    gap: 0;
    padding-right: max(0px, env(safe-area-inset-right, 0px));
    padding-left: max(0px, env(safe-area-inset-left, 0px));
  }
  body.territory-full .territory-howto-dismiss {
    min-width: var(--touch);
    min-height: var(--touch);
  }
  body.territory-full .territory-map-frame .maplibregl-ctrl-attrib a {
    display: inline-flex;
    align-items: center;
    min-height: var(--touch);
  }
  body.territory-full .territory-map-frame .maplibregl-ctrl-attrib {
    background: color-mix(in srgb, var(--bg-raised) 94%, transparent);
    color: var(--muted);
  }
}
.credit-meter,
.btn.sm,
.notice a {
  min-height: var(--touch);
}
.notice a { display: inline-flex; align-items: center; white-space: nowrap; }
input:not([type="hidden"]):not([type="radio"]):not([type="checkbox"]),
select,
textarea {
  min-height: var(--touch);
  max-width: 100%;
}

@media (max-width: 767px) {
  /* The later dashboard rules use a three-column row. On phones the action
     gets its own row, leaving the number and copy a stable minmax track. */
  .gs-step {
    grid-template-columns: auto minmax(0, 1fr);
    align-items: start;
    gap: .55rem .7rem;
  }
  .gs-body { width: 100%; }
  .gs-step > .btn,
  .gs-step > form,
  .gs-step > .chip,
  .gs-step > .control-reason {
    grid-column: 1 / -1;
    width: 100%;
    max-width: 100%;
    justify-content: center;
  }
  .gs-step > .control-reason { min-width: 0; overflow-wrap: anywhere; }

  /* flow.css intentionally hides four labels. The remaining dot links still
     need to be 44px targets and must share the available line evenly. */
  .flowbar-steps { gap: 0; }
  .flowbar-step { flex: 1 1 0; min-width: var(--touch); }
  .flowbar-step.is-current { flex: 0 0 auto; min-width: max-content; }
  .flowbar-step > a {
    width: 100%;
    justify-content: center;
    padding: var(--s-1);
    flex-shrink: 0;
  }
  .flowbar-step.is-current > a { width: auto; }
  .flowbar-step + .flowbar-step::before { display: none; }

  /* territory.css supplies a 100% toolbar and portal.css supplies side
     margins. Width:auto prevents that sum from adding 18px to the viewport. */
  .territory-toolbar,
  .territory-status {
    width: auto;
    max-width: calc(100% - 1.1rem);
  }
  .territory-toolbar { align-items: stretch; }
  .territory-brand,
  .territory-modes,
  .territory-search,
  .territory-actions,
  .territory-draw-actions { min-width: 0; }
  .territory-actions,
  .territory-draw-actions {
    width: 100%;
  }
  .territory-actions > .btn,
  .territory-draw-actions > .btn {
    flex: 1 0 var(--touch);
    min-width: var(--touch);
    min-height: var(--touch);
    white-space: nowrap;
  }
  .territory-howto-dismiss {
    min-width: var(--touch);
    min-height: var(--touch);
  }
  body.territory-full .territory-map-frame .maplibregl-ctrl-attrib a {
    display: inline-flex;
    align-items: center;
    min-height: var(--touch);
  }

  .billing-plan,
  .billing-tier-head,
  .domain-managed-head,
  .inbox-thread-head {
    flex-wrap: wrap;
  }
  .billing-card,
  .domain-card,
  .domain-managed,
  .domain-empty { max-width: 100%; }

  .domain-actions .btn,
  .domain-actions form,
  .domain-actions form .btn,
  .dns-record button {
    width: 100%;
    max-width: 100%;
    justify-content: center;
  }
}

@media (max-width: 390px) {
  .territory-brand { flex: 1 1 100%; }
  .territory-modes { flex: 1 1 100%; }
  .territory-info-btn { margin-left: auto; }

  .domain-card,
  .domain-managed,
  .domain-empty,
  .billing-card,
  .inbox-disabled {
    padding-right: 1rem;
    padding-left: 1rem;
  }
}

@media (max-width: 360px) {
  /* At the 320px floor, five 44px targets plus "Your area" do not fit in the
     rail. Keep the numbered targets and let the headline name the step. */
  .has-app-shell .flowbar .flowbar-name { display: none; }
}
