/* ==========================================================================
   Level 1 Coach CRM — funnel design system (§56, §34, §57)

   Premium, calm, fast, slightly cinematic. Mobile is the design constraint,
   not the adaptation: everything below is written for 320px first and only
   gains density at larger sizes. Animation is used to show cause → effect,
   never as decoration, and every motion respects reduce-motion / low-data.
   ========================================================================== */

*, *::before, *::after { box-sizing: border-box; }
/* Component `display` rules would otherwise beat the hidden attribute. */
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body, h1, h2, h3, p, figure, ul, ol, dl, dd { margin: 0; }
ul, ol { padding: 0; list-style: none; }
button, input, select, textarea { font: inherit; color: inherit; }
img, svg, video { max-width: 100%; display: block; }

:root {
  --ink:      #07080A;
  --ink-2:    #0D0F13;
  --ink-3:    #14171D;
  --ink-4:    #1C2027;
  --line:     rgba(255,255,255,.09);
  --line-2:   rgba(255,255,255,.16);
  --text:     #F3F5F8;
  --text-2:   #C3C9D4;
  --muted:    #8A93A3;
  --faint:    #5C6474;

  --accent:   #E8B14C;   /* attention / at-risk / the thing you're missing */
  --accent-d: #A87A24;
  --good:     #3DD68C;   /* resolved / one system */
  --cool:     #7DD3FC;
  --warn:     #F87171;

  --radius:   14px;
  --radius-s: 10px;
  --radius-l: 20px;

  --pad:      20px;
  --maxw:     560px;
  --tap:      48px;

  --shadow:   0 1px 2px rgba(0,0,0,.4), 0 8px 24px rgba(0,0,0,.35);
  --glow:     0 0 0 1px rgba(232,177,76,.35), 0 8px 32px rgba(232,177,76,.14);

  --ease:     cubic-bezier(.22,.61,.36,1);
  --dur:      .38s;

  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
}

@media (prefers-reduced-motion: reduce) { :root { --dur: .001s; } }
.app[data-motion="off"] { --dur: .001s; }
.app[data-motion="off"] * { animation: none !important; transition: none !important; }

html, body { height: 100%; }
body {
  margin: 0;
  background: var(--ink);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior-y: none;
}

/* a single, very restrained cinematic ground — one radial, no gradients stacked */
body::before {
  content: ""; position: fixed; inset: 0; pointer-events: none; z-index: 0;
  background: radial-gradient(120% 80% at 50% -10%, rgba(232,177,76,.07), transparent 60%);
}
.app { position: relative; z-index: 1; min-height: 100%; display: flex; flex-direction: column; }

.skip {
  position: absolute; left: -9999px; top: 0; z-index: 100;
  background: var(--accent); color: #000; padding: 12px 16px; border-radius: 0 0 8px 0;
}
.skip:focus { left: 0; }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }

/* ------------------------------------------------------------------ topbar */
.topbar {
  position: sticky; top: 0; z-index: 30;
  background: rgba(7,8,10,.86);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
  padding-top: env(safe-area-inset-top);
}
.topbar__inner {
  display: flex; align-items: center; gap: 12px;
  padding: 10px var(--pad); max-width: var(--maxw); margin: 0 auto; width: 100%;
  min-width: 0;
}
.topbar__right { margin-left: auto; display: flex; align-items: center; gap: 8px; flex: none; }

/* compact on mobile (§25): dots + current chapter name only */
.rail {
  display: flex; align-items: center; gap: 10px;
  background: none; border: 0; padding: 6px 4px; cursor: pointer;
  min-height: 40px; color: var(--text-2); text-align: left;
  /* must be allowed to shrink, or the chapter label pushes the bar off a 320px screen */
  flex: 1 1 auto; min-width: 0; overflow: hidden;
}
.rail__dots { display: flex; gap: 5px; align-items: center; flex: none; }
.rail__dot {
  width: 7px; height: 7px; border-radius: 50%; background: var(--ink-4);
  transition: all var(--dur) var(--ease);
}
.rail__dot[data-state="done"]    { background: var(--good); }
.rail__dot[data-state="current"] { background: var(--accent); width: 22px; border-radius: 4px; }
.rail__label {
  font-size: 11px; letter-spacing: .14em; text-transform: uppercase;
  font-weight: 650; color: var(--text-2); white-space: nowrap;
  min-width: 0; overflow: hidden; text-overflow: ellipsis;
}
.railpanel {
  border-top: 1px solid var(--line); padding: 12px var(--pad) 16px;
  max-width: var(--maxw); margin: 0 auto;
}
.railpanel ol { display: grid; gap: 2px; }
.railpanel li {
  display: flex; align-items: center; gap: 12px; padding: 9px 0;
  font-size: 13px; letter-spacing: .1em; text-transform: uppercase; font-weight: 600;
  color: var(--faint);
}
.railpanel li[data-state="done"]    { color: var(--text-2); }
.railpanel li[data-state="current"] { color: var(--accent); }
.railpanel .mark { width: 16px; text-align: center; font-size: 12px; }

.progressbar { height: 2px; background: var(--ink-3); }
.progressbar span {
  display: block; height: 100%; width: 0;
  background: linear-gradient(90deg, var(--accent-d), var(--accent));
  transition: width .5s var(--ease);
}

.timer {
  font-family: var(--mono); font-size: 13px; font-variant-numeric: tabular-nums;
  letter-spacing: .04em; color: var(--text-2);
  background: var(--ink-3); border: 1px solid var(--line);
  padding: 5px 9px; border-radius: 8px; min-width: 62px; text-align: center;
}
.timer[data-urgent="1"] { color: var(--accent); border-color: rgba(232,177,76,.4); }
.timer[data-urgent="2"] { color: var(--warn); border-color: rgba(248,113,113,.45); animation: pulse 1s infinite; }
@keyframes pulse { 50% { opacity: .55; } }

.iconbtn {
  width: var(--tap); height: 40px; display: grid; place-items: center;
  background: none; border: 1px solid transparent; border-radius: 10px;
  color: var(--text-2); cursor: pointer;
}
.iconbtn:hover { background: var(--ink-3); }
.iconbtn__glyph { font-size: 18px; line-height: 1; }

/* ------------------------------------------------------------------- stage */
.stage {
  flex: 1; width: 100%; max-width: var(--maxw); margin: 0 auto;
  padding: 24px var(--pad) calc(40px + env(safe-area-inset-bottom));
  display: flex; flex-direction: column;
}
.step { animation: enter var(--dur) var(--ease) both; }
@keyframes enter { from { opacity: 0; transform: translateY(10px); } }

.kicker {
  font-size: 11px; letter-spacing: .18em; text-transform: uppercase;
  color: var(--accent); font-weight: 700; margin-bottom: 12px;
}
h1.title {
  font-size: clamp(26px, 7.2vw, 34px); line-height: 1.15; letter-spacing: -.02em;
  font-weight: 700; margin-bottom: 12px; text-wrap: balance;
}
h2.subtitle, .subtitle {
  font-size: 16px; color: var(--text-2); line-height: 1.5; font-weight: 400;
  margin-bottom: 24px; text-wrap: pretty;
}
.eyebrow {
  font-size: 12px; letter-spacing: .12em; text-transform: uppercase;
  color: var(--muted); font-weight: 650; margin-bottom: 8px;
}
.lead { font-size: 18px; line-height: 1.45; color: var(--text); margin-bottom: 16px; text-wrap: pretty; }
.small { font-size: 13px; color: var(--muted); line-height: 1.5; }
.disclaimer {
  font-size: 12px; color: var(--faint); line-height: 1.5;
  border-left: 2px solid var(--line-2); padding-left: 10px; margin-top: 16px;
}

/* ------------------------------------------------------------------ blocks */
.card {
  background: var(--ink-2); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 18px;
}
.card + .card { margin-top: 12px; }
.stack { display: grid; gap: 12px; }
.stack--tight { gap: 8px; }
.stack--loose { gap: 20px; }

.datablock { border-top: 1px solid var(--line); padding: 14px 0; }
.datablock:first-child { border-top: 0; }
.datablock__label {
  font-size: 11px; letter-spacing: .14em; text-transform: uppercase;
  color: var(--muted); font-weight: 650; margin-bottom: 5px;
}
.datablock__value { font-size: 19px; font-weight: 600; line-height: 1.3; }
.datablock--emphasis .datablock__value { font-size: 30px; color: var(--accent); letter-spacing: -.02em; }

/* --------------------------------------------------------------- questions */
.qhead { margin-bottom: 16px; }
.qcount {
  font-family: var(--mono); font-size: 12px; color: var(--muted);
  letter-spacing: .08em; margin-bottom: 10px;
}
.qprompt { font-size: 21px; font-weight: 650; line-height: 1.25; letter-spacing: -.01em; text-wrap: balance; }
.qhint { font-size: 13px; color: var(--muted); margin-top: 6px; }
.qbullets { margin-top: 12px; display: grid; gap: 6px; }
.qbullets li { font-size: 15px; color: var(--text-2); padding-left: 16px; position: relative; }
.qbullets li::before { content: "—"; position: absolute; left: 0; color: var(--faint); }

.options { display: grid; gap: 8px; margin-top: 4px; }
.option {
  display: flex; align-items: center; gap: 12px; width: 100%;
  min-height: var(--tap); padding: 14px 16px; text-align: left;
  background: var(--ink-2); border: 1px solid var(--line);
  border-radius: var(--radius-s); color: var(--text); cursor: pointer;
  font-size: 16px; font-weight: 500;
  transition: border-color .18s var(--ease), background .18s var(--ease), transform .12s var(--ease);
}
.option:hover { border-color: var(--line-2); background: var(--ink-3); }
.option:active { transform: scale(.985); }
.option[aria-pressed="true"], .option[data-selected="true"] {
  border-color: var(--accent); background: rgba(232,177,76,.09); color: #fff;
}
.option__tick {
  width: 20px; height: 20px; flex: none; border-radius: 6px;
  border: 1.5px solid var(--line-2); display: grid; place-items: center;
  font-size: 12px; color: var(--ink); transition: all .18s var(--ease);
}
.option[aria-pressed="true"] .option__tick, .option[data-selected="true"] .option__tick {
  background: var(--accent); border-color: var(--accent);
}
.option--radio .option__tick { border-radius: 50%; }
.option__label { flex: 1; }

/* ----------------------------------------------------------------- buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: var(--tap); padding: 14px 22px; border-radius: var(--radius-s);
  border: 1px solid transparent; cursor: pointer; font-weight: 650; font-size: 15px;
  letter-spacing: .02em; transition: transform .12s var(--ease), opacity .18s, background .18s;
  text-decoration: none;
}
.btn:active { transform: scale(.985); }
.btn:disabled { opacity: .38; cursor: not-allowed; }
.btn--primary { background: var(--accent); color: #14100A; }
.btn--primary:hover:not(:disabled) { background: #F0BE63; }
.btn--ghost { background: transparent; border-color: var(--line-2); color: var(--text-2); }
.btn--ghost:hover { background: var(--ink-3); color: var(--text); }
.btn--quiet { background: none; border: 0; color: var(--muted); text-decoration: underline; min-height: 40px; padding: 8px; }
.btn--full { width: 100%; }
.btn--lg { font-size: 16px; padding: 17px 24px; }

.actions { margin-top: 24px; display: grid; gap: 10px; }
.actions--sticky {
  position: sticky; bottom: 0; padding: 16px 0 calc(12px + env(safe-area-inset-bottom));
  background: linear-gradient(to top, var(--ink) 60%, transparent);
  margin-top: 20px; z-index: 10;
}

/* ------------------------------------------------------------------- media */
.media { border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--ink-2); }
.media__modes { display: flex; border-bottom: 1px solid var(--line); }
.media__mode {
  flex: 1; min-height: 44px; background: none; border: 0; cursor: pointer;
  font-size: 12px; letter-spacing: .1em; text-transform: uppercase; font-weight: 650;
  color: var(--muted); border-bottom: 2px solid transparent; padding: 12px 4px;
}
.media__mode[aria-selected="true"] { color: var(--accent); border-bottom-color: var(--accent); }
.media__mode:disabled { opacity: .3; cursor: not-allowed; }
.media__body { padding: 18px; }
.media__headline { font-size: 19px; font-weight: 600; line-height: 1.35; letter-spacing: -.01em; text-wrap: pretty; }
.media__meta { font-size: 12px; color: var(--faint); margin-top: 10px; display: flex; gap: 10px; flex-wrap: wrap; }
.media video { width: 100%; background: #000; aspect-ratio: 16/9; }
.media__transcript { display: grid; gap: 12px; margin-top: 14px; }
.media__transcript p { font-size: 16px; line-height: 1.55; color: var(--text-2); }
.media__transcript p:first-child { color: var(--text); }
.media__audio { display: flex; align-items: center; gap: 14px; padding: 6px 0 2px; }
.media__playbtn {
  width: 52px; height: 52px; flex: none; border-radius: 50%;
  background: var(--accent); color: #14100A; border: 0; cursor: pointer;
  display: grid; place-items: center; font-size: 18px;
}
.media__progress { flex: 1; height: 3px; background: var(--ink-4); border-radius: 2px; overflow: hidden; }
.media__progress span { display: block; height: 100%; width: 0; background: var(--accent); transition: width .2s linear; }
.media__note { font-size: 12px; color: var(--faint); margin-top: 12px; }

/* --------------------------------------------------------------- highlight */
.highlight {
  margin: 20px 0; padding: 24px 20px; border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(232,177,76,.10), rgba(232,177,76,.03));
  border: 1px solid rgba(232,177,76,.28);
  animation: reveal .6s var(--ease) both;
}
@keyframes reveal { from { opacity: 0; transform: translateY(8px) scale(.99); } }
.highlight__text {
  font-size: clamp(19px, 5.4vw, 23px); line-height: 1.3; font-weight: 650;
  letter-spacing: -.015em; text-wrap: balance;
}
.highlight__stack { display: grid; gap: 4px; margin-top: 14px; }
.highlight__stack li {
  font-size: 13px; letter-spacing: .16em; text-transform: uppercase;
  font-weight: 700; color: var(--accent);
}

/* ------------------------------------------------------------------- score */
.score { text-align: center; padding: 8px 0 4px; }
.score__ring { position: relative; width: 168px; height: 168px; margin: 0 auto 6px; }
.score__ring svg { transform: rotate(-90deg); }
.score__track { fill: none; stroke: var(--ink-4); stroke-width: 8; }
.score__arc {
  fill: none; stroke: var(--accent); stroke-width: 8; stroke-linecap: round;
  animation: sweep 1.1s var(--ease) both;
}
/* Animates from an empty ring to whatever offset the element already carries. */
@keyframes sweep { from { stroke-dashoffset: var(--circumference); } }
.score__num {
  position: absolute; inset: 0; display: grid; place-content: center; gap: 0;
}
.score__value { font-size: 52px; font-weight: 700; letter-spacing: -.03em; font-variant-numeric: tabular-nums; line-height: 1; }
.score__of { font-size: 13px; color: var(--muted); margin-top: 4px; }
.score__band {
  font-size: 12px; letter-spacing: .18em; text-transform: uppercase;
  font-weight: 700; color: var(--accent); margin-top: 10px;
}
.score__line { font-size: 15px; color: var(--text-2); margin-top: 8px; text-wrap: balance; }

/* ------------------------------------------------------------------- chart */
.chart { display: grid; gap: 14px; margin-top: 6px; }
.chartrow__top { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; margin-bottom: 6px; }
.chartrow__label { font-size: 11px; letter-spacing: .13em; text-transform: uppercase; font-weight: 650; color: var(--text-2); }
.chartrow__value { font-family: var(--mono); font-size: 15px; font-weight: 600; font-variant-numeric: tabular-nums; }
.chartrow__bar { height: 10px; background: var(--ink-3); border-radius: 5px; overflow: hidden; }
.chartrow__fill {
  display: block; height: 100%; width: var(--w, 0); border-radius: 5px;
  background: var(--text-2); transition: width .7s var(--ease);
  transform-origin: left center; animation: grow .7s var(--ease) both;
}
/* The width is correct the instant the bar exists; the animation only sweeps
   it in. A throttled or backgrounded tab therefore still shows real data. */
@keyframes grow { from { transform: scaleX(0); } to { transform: scaleX(1); } }
.chartrow[data-tone="warn"] .chartrow__fill { background: var(--warn); }
.chartrow[data-tone="warn"] .chartrow__value { color: var(--warn); }
.chartrow[data-tone="good"] .chartrow__fill { background: var(--good); }
.chartrow[data-tone="good"] .chartrow__value { color: var(--good); }
.chartrow__derive { font-size: 11px; color: var(--faint); margin-top: 5px; }

/* -------------------------------------------------------------- calculator */
.field { margin-bottom: 18px; }
.field__label { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 8px; }
.field__name { font-size: 14px; font-weight: 600; color: var(--text-2); }
.field__out {
  font-family: var(--mono); font-size: 17px; font-weight: 650; color: var(--accent);
  font-variant-numeric: tabular-nums;
}
input[type="range"] {
  width: 100%; -webkit-appearance: none; appearance: none; background: transparent; height: 32px; margin: 0;
}
input[type="range"]::-webkit-slider-runnable-track { height: 6px; background: var(--ink-4); border-radius: 3px; }
input[type="range"]::-moz-range-track { height: 6px; background: var(--ink-4); border-radius: 3px; }
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; width: 28px; height: 28px; border-radius: 50%;
  background: var(--accent); border: 3px solid var(--ink); margin-top: -11px; cursor: grab;
  box-shadow: 0 2px 8px rgba(0,0,0,.5);
}
input[type="range"]::-moz-range-thumb {
  width: 26px; height: 26px; border-radius: 50%; background: var(--accent);
  border: 3px solid var(--ink); cursor: grab;
}
input[type="range"]:active::-webkit-slider-thumb { cursor: grabbing; }
.field input[type="number"], .field input[type="text"] {
  width: 100%; min-height: var(--tap); padding: 13px 14px;
  background: var(--ink-2); border: 1px solid var(--line-2); border-radius: var(--radius-s);
  font-family: var(--mono); font-size: 17px; font-variant-numeric: tabular-nums;
}
.field input:focus { border-color: var(--accent); outline: none; }
.field__hint { font-size: 12px; color: var(--faint); margin-top: 6px; }

.working { border: 1px solid var(--line); border-radius: var(--radius-s); overflow: hidden; }
.working__row {
  display: flex; justify-content: space-between; gap: 4px 12px; align-items: baseline;
  padding: 11px 14px; border-top: 1px solid var(--line); font-size: 14px;
  /* the result is nowrap, so the row must be free to wrap under it on a 320px
     screen — otherwise the number it exists to show gets clipped */
  flex-wrap: wrap;
}
.working__line { flex: 1 1 55%; min-width: 0; }
.working__eq { margin-left: auto; }
.working__row:first-child { border-top: 0; }
.working__line { color: var(--text-2); }
.working__row .working__line { color: var(--text-2); }
.working__note { font-size: 11px; color: var(--faint); display: block; margin-top: 2px; }
.working__eq { font-family: var(--mono); font-weight: 600; white-space: nowrap; }
.working__row--total { background: rgba(232,177,76,.07); }
.working__row--total .working__eq { color: var(--accent); font-size: 16px; }

.bignum {
  text-align: center; padding: 22px 16px; border-radius: var(--radius);
  border: 1px solid rgba(232,177,76,.3); background: rgba(232,177,76,.06);
}
.bignum__label { font-size: 11px; letter-spacing: .16em; text-transform: uppercase; color: var(--accent); font-weight: 700; }
.bignum__value {
  font-size: clamp(34px, 10vw, 46px); font-weight: 700; letter-spacing: -.03em;
  margin: 8px 0 4px; font-variant-numeric: tabular-nums;
}
.bignum__sub { font-size: 12px; color: var(--muted); }

/* -------------------------------------------------------------------- flow */
.flow { display: grid; gap: 0; margin: 8px 0 4px; }
.flownode {
  display: flex; align-items: center; gap: 12px; padding: 13px 16px;
  background: var(--ink-2); border: 1px solid var(--line); border-radius: var(--radius-s);
  font-size: 15px; font-weight: 550;
  opacity: .35; transition: opacity .4s var(--ease), border-color .4s var(--ease), background .4s var(--ease);
}
.flownode[data-lit="1"] { opacity: 1; border-color: rgba(232,177,76,.4); background: rgba(232,177,76,.07); }
.flownode__n { font-family: var(--mono); font-size: 11px; color: var(--faint); width: 18px; }
.flowarrow { height: 18px; display: grid; place-items: center; color: var(--faint); font-size: 12px; opacity: .5; }

/* ------------------------------------------------------------- spreadsheet */
.sheetwrap { border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--ink-2); }
.sheettools { display: flex; gap: 8px; padding: 12px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.sheettools input[type="search"] {
  flex: 1 1 140px; min-height: 42px; padding: 10px 12px;
  background: var(--ink-3); border: 1px solid var(--line-2); border-radius: 8px; font-size: 15px;
}
.sheettools select {
  min-height: 42px; padding: 10px 12px; background: var(--ink-3);
  border: 1px solid var(--line-2); border-radius: 8px; font-size: 14px;
}
.sheetcount { font-size: 12px; color: var(--muted); padding: 8px 12px; border-bottom: 1px solid var(--line); }

/* mobile: cards, not a squeezed table (§16, §34) */
.rowcards { display: grid; gap: 1px; background: var(--line); max-height: 62vh; overflow-y: auto; -webkit-overflow-scrolling: touch; }
.rowcard {
  display: block; width: 100%; text-align: left; background: var(--ink-2); border: 0;
  border-left: 3px solid transparent; padding: 13px 14px; cursor: pointer; color: var(--text);
}
.rowcard[data-selected="true"] { background: rgba(232,177,76,.1); border-left-color: var(--accent); }
.rowcard__top { display: flex; justify-content: space-between; gap: 10px; align-items: baseline; }
.rowcard__name { font-weight: 650; font-size: 15px; }
.rowcard__value { font-family: var(--mono); font-size: 13px; color: var(--muted); }
.rowcard__meta { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 6px; font-size: 12px; color: var(--muted); }
.rowcard__notes { font-size: 13px; color: var(--text-2); margin-top: 6px; font-style: italic; }
.pill {
  display: inline-block; padding: 2px 8px; border-radius: 999px;
  background: var(--ink-4); font-size: 11px; letter-spacing: .04em; color: var(--text-2);
}
.pill--empty { color: var(--faint); }

.sheettable { display: none; }
@media (min-width: 720px) {
  .rowcards { display: none; }
  .sheettable { display: block; max-height: 60vh; overflow: auto; }
  .sheettable table { width: 100%; border-collapse: collapse; font-size: 13px; }
  .sheettable th {
    position: sticky; top: 0; background: var(--ink-3); text-align: left;
    padding: 10px 12px; font-size: 11px; letter-spacing: .1em; text-transform: uppercase;
    color: var(--muted); border-bottom: 1px solid var(--line); white-space: nowrap; cursor: pointer;
  }
  .sheettable td { padding: 10px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
  .sheettable tr { cursor: pointer; }
  .sheettable tr[data-selected="true"] td { background: rgba(232,177,76,.1); }
  .sheettable tr:hover td { background: var(--ink-3); }
}

.selectbar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px 14px; border-top: 1px solid var(--line); background: var(--ink-3);
}
.selectbar__count { font-size: 13px; color: var(--text-2); font-variant-numeric: tabular-nums; }

/* ------------------------------------------------------------ before/after */
.ba { display: grid; gap: 14px; }
@media (min-width: 620px) { .ba { grid-template-columns: 1fr auto 1fr; align-items: center; } }
.ba__col { padding: 18px; border-radius: var(--radius); border: 1px solid var(--line); background: var(--ink-2); }
.ba__col--after { border-color: rgba(61,214,140,.3); background: rgba(61,214,140,.05); }
.ba__label { font-size: 11px; letter-spacing: .16em; text-transform: uppercase; font-weight: 700; color: var(--muted); margin-bottom: 12px; }
.ba__col--after .ba__label { color: var(--good); }
.ba__items { display: grid; gap: 7px; }
.ba__items li { font-size: 15px; color: var(--text-2); }
.ba__col--after .ba__items li {
  font-size: 13px; letter-spacing: .12em; text-transform: uppercase;
  font-weight: 700; color: var(--text);
}
.ba__caption { font-size: 14px; color: var(--faint); font-style: italic; margin-top: 14px; }
.ba__arrow { text-align: center; color: var(--faint); font-size: 20px; padding: 4px; }

/* --------------------------------------------------------------- crm cards */
.contact { border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--ink-2); }
.contact__head { padding: 18px; border-bottom: 1px solid var(--line); }
.contact__name { font-size: 22px; font-weight: 700; letter-spacing: -.02em; }
.contact__source { font-size: 13px; color: var(--muted); margin-top: 3px; }
.contact__tags { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; align-items: center; }
.tag {
  padding: 5px 11px; border-radius: 999px; font-size: 11px; font-weight: 700;
  letter-spacing: .1em; text-transform: uppercase;
}
.tag--status { background: rgba(232,177,76,.16); color: var(--accent); }
.tag--value { background: var(--ink-4); color: var(--text-2); font-family: var(--mono); letter-spacing: .02em; }
.contact__next {
  display: flex; align-items: center; gap: 10px; padding: 13px 18px;
  background: rgba(61,214,140,.07); border-bottom: 1px solid var(--line); font-size: 14px;
}
.contact__next strong { color: var(--good); }
.contact__actions { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1px; background: var(--line); }
@media (min-width: 480px) { .contact__actions { grid-template-columns: repeat(4, 1fr); } }
.contact__action {
  background: var(--ink-2); border: 0; padding: 15px 8px; cursor: pointer;
  font-size: 11px; letter-spacing: .1em; text-transform: uppercase; font-weight: 650;
  color: var(--text-2); min-height: var(--tap);
}
.contact__action:hover { background: var(--ink-3); color: var(--text); }
.contact__action[data-done="1"] { color: var(--good); }

.timeline { display: grid; gap: 0; padding: 4px 0; }
.tl { display: flex; gap: 14px; padding: 11px 0; position: relative; }
.tl::before {
  content: ""; position: absolute; left: 5px; top: 20px; bottom: -11px; width: 1px; background: var(--line);
}
.tl:last-child::before { display: none; }
.tl__dot { width: 11px; height: 11px; border-radius: 50%; background: var(--ink-4); border: 2px solid var(--ink-2); flex: none; margin-top: 5px; z-index: 1; }
.tl--new .tl__dot { background: var(--good); }
.tl__when { font-size: 11px; color: var(--faint); letter-spacing: .06em; text-transform: uppercase; }
.tl__what { font-size: 15px; color: var(--text-2); margin-top: 2px; }
.tl--new .tl__what { color: var(--text); }

.consequence { margin-top: 16px; padding: 18px; border-radius: var(--radius); border: 1px solid var(--line); background: var(--ink-2); animation: reveal .5s var(--ease) both; }
.consequence[data-verdict="correct"] { border-color: rgba(61,214,140,.35); background: rgba(61,214,140,.05); }
.consequence[data-verdict="risk"]    { border-color: rgba(248,113,113,.32); background: rgba(248,113,113,.05); }
.consequence__title { font-size: 17px; font-weight: 650; margin-bottom: 12px; text-wrap: balance; }
.consequence__steps { display: grid; gap: 6px; margin-bottom: 14px; }
.consequence__steps li {
  font-family: var(--mono); font-size: 13px; color: var(--text-2);
  animation: slidein .35s var(--ease) both;
}
@keyframes slidein { from { opacity: 0; transform: translateX(-6px); } }
.consequence__line { font-size: 15px; color: var(--text); line-height: 1.5; text-wrap: pretty; }

/* ----------------------------------------------------------------- product */
.caps { display: grid; gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.cap { display: flex; gap: 14px; padding: 16px 18px; background: var(--ink-2); align-items: baseline; }
.cap__n { font-family: var(--mono); font-size: 12px; color: var(--accent); font-weight: 700; }
.cap__name { font-size: 14px; letter-spacing: .12em; text-transform: uppercase; font-weight: 700; }
.cap__line { font-size: 14px; color: var(--muted); margin-top: 3px; }

/* ------------------------------------------------------------------ import */
.drop {
  border: 1.5px dashed var(--line-2); border-radius: var(--radius);
  padding: 30px 20px; text-align: center; background: var(--ink-2);
  transition: border-color .2s, background .2s;
}
.drop[data-over="1"] { border-color: var(--accent); background: rgba(232,177,76,.06); }
.drop__icon { font-size: 30px; margin-bottom: 10px; opacity: .55; }
.drop__title { font-size: 16px; font-weight: 600; }
.drop__hint { font-size: 13px; color: var(--muted); margin-top: 6px; }
.drop input[type="file"] { position: absolute; width: 1px; height: 1px; opacity: 0; }

.importflow { display: grid; gap: 12px; }
@media (min-width: 620px) { .importflow { grid-template-columns: 1fr auto 1fr; align-items: stretch; } }
.importcol { padding: 18px; border-radius: var(--radius); border: 1px solid var(--line); background: var(--ink-2); }
.importcol--out { border-color: rgba(61,214,140,.3); }
.importstat { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-top: 1px solid var(--line); font-size: 14px; }
.importstat:first-of-type { border-top: 0; }
.importstat__v { font-family: var(--mono); font-weight: 650; font-variant-numeric: tabular-nums; }
.importstat--attention .importstat__v { color: var(--accent); }
.importstat--unknown .importstat__v { color: var(--faint); font-size: 12px; font-family: var(--font); }
.examples { margin-top: 12px; display: grid; gap: 5px; }
.examples li { font-size: 12px; color: var(--muted); font-family: var(--mono); }

/* --------------------------------------------------------------- micro-ux */
.stepdone {
  display: flex; align-items: center; gap: 10px; padding: 13px 16px;
  border-radius: var(--radius-s); background: rgba(61,214,140,.07);
  border: 1px solid rgba(61,214,140,.25); margin-bottom: 18px;
  animation: reveal .45s var(--ease) both;
}
.stepdone__tick { color: var(--good); font-size: 15px; }
.stepdone__text { font-size: 14px; color: var(--text-2); }
.stepdone__text strong { color: var(--text); }

.unlock {
  font-size: 11px; letter-spacing: .16em; text-transform: uppercase;
  color: var(--good); font-weight: 700; display: flex; align-items: center; gap: 8px;
  margin-bottom: 14px; animation: reveal .5s var(--ease) both;
}

/* --------------------------------------------------------------- overlays */
.sheet {
  position: fixed; inset: 0; z-index: 60; display: grid; align-items: end;
  background: rgba(0,0,0,.6); animation: fade .2s ease both;
}
@keyframes fade { from { opacity: 0; } }
@media (min-width: 620px) { .sheet { align-items: center; justify-items: center; } }
.sheet__panel {
  width: 100%; max-width: var(--maxw); background: var(--ink-2);
  border: 1px solid var(--line); border-radius: var(--radius-l) var(--radius-l) 0 0;
  padding: 20px var(--pad) calc(24px + env(safe-area-inset-bottom));
  max-height: 86vh; overflow-y: auto; animation: up .28s var(--ease) both;
}
@media (min-width: 620px) { .sheet__panel { border-radius: var(--radius-l); } }
@keyframes up { from { transform: translateY(16px); opacity: 0; } }
.sheet__head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.sheet__head h2 { font-size: 17px; font-weight: 650; }
.sheet__note { font-size: 12px; color: var(--faint); margin-top: 14px; }
.sheet hr { border: 0; border-top: 1px solid var(--line); margin: 18px 0; }

.switch { display: flex; align-items: center; gap: 14px; padding: 11px 0; cursor: pointer; }
.switch span:first-child { flex: 1; display: grid; gap: 2px; }
.switch strong { font-size: 15px; font-weight: 550; }
.switch small { font-size: 12px; color: var(--muted); }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch__track {
  width: 46px; height: 28px; border-radius: 999px; background: var(--ink-4);
  border: 1px solid var(--line-2); position: relative; flex: none; transition: background .2s;
}
.switch__track::after {
  content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px;
  border-radius: 50%; background: var(--muted); transition: transform .2s var(--ease), background .2s;
}
.switch input:checked ~ .switch__track { background: rgba(232,177,76,.28); border-color: var(--accent); }
.switch input:checked ~ .switch__track::after { transform: translateX(18px); background: var(--accent); }
.switch input:focus-visible ~ .switch__track { outline: 2px solid var(--accent); outline-offset: 2px; }

.slider { display: grid; gap: 6px; padding: 11px 0; }
.slider span { display: flex; justify-content: space-between; font-size: 14px; color: var(--text-2); }
.slider output { font-family: var(--mono); color: var(--accent); }
.slider input { width: 100%; }

.toast {
  position: fixed; left: 50%; bottom: calc(22px + env(safe-area-inset-bottom));
  transform: translateX(-50%); z-index: 80;
  background: var(--ink-4); border: 1px solid var(--line-2); color: var(--text);
  padding: 12px 18px; border-radius: 999px; font-size: 14px; max-width: calc(100vw - 32px);
  box-shadow: var(--shadow); animation: up .25s var(--ease) both; text-align: center;
}
.banner {
  position: fixed; top: 0; left: 0; right: 0; z-index: 70;
  padding: calc(10px + env(safe-area-inset-top)) var(--pad) 10px;
  text-align: center; font-size: 13px; font-weight: 550;
  background: var(--accent); color: #14100A;
}
.banner[data-tone="warn"] { background: var(--warn); color: #1A0808; }
.banner[data-tone="info"] { background: var(--ink-4); color: var(--text); border-bottom: 1px solid var(--line-2); }

.resume { text-align: center; padding: 40px 0; }
.resume__eyebrow { font-size: 11px; letter-spacing: .2em; text-transform: uppercase; color: var(--good); font-weight: 700; }
.resume__title { font-size: 27px; font-weight: 700; margin: 12px 0 8px; letter-spacing: -.02em; }
.resume__where { font-size: 15px; color: var(--muted); margin-bottom: 26px; }
.resume__step {
  display: inline-block; padding: 10px 18px; border-radius: 999px;
  border: 1px solid var(--line-2); background: var(--ink-2); font-size: 15px; font-weight: 600;
}

.spinner {
  width: 22px; height: 22px; border-radius: 50%; margin: 40px auto;
  border: 2px solid var(--line-2); border-top-color: var(--accent);
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.noscript { padding: 40px 20px; max-width: 520px; margin: 0 auto; }
.noscript h1 { font-size: 24px; margin-bottom: 12px; }
.noscript p { color: var(--text-2); }

.err { padding: 18px; border-radius: var(--radius); border: 1px solid rgba(248,113,113,.35); background: rgba(248,113,113,.06); font-size: 14px; color: var(--text-2); }
.err strong { display: block; color: var(--text); margin-bottom: 6px; font-size: 15px; }

.ctaladder { display: grid; gap: 10px; }
.ctaladder__note { font-size: 12px; color: var(--faint); text-align: center; margin-top: 4px; }
.transition {
  display: flex; align-items: center; justify-content: center; gap: 16px;
  padding: 22px; font-size: 15px; letter-spacing: .16em; text-transform: uppercase; font-weight: 700;
  flex-wrap: wrap;
}
.transition__from { color: var(--faint); text-decoration: line-through; }
.transition__to { color: var(--good); }
.ladder { display: flex; align-items: center; justify-content: center; gap: 8px; flex-wrap: wrap; font-size: 12px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.ladder span:nth-child(even) { color: var(--faint); }

/* very narrow phones: tighten the gutter rather than let anything overflow */
@media (max-width: 360px) {
  :root { --pad: 14px; }
  .rail__dots { gap: 4px; }
  .timer { min-width: 54px; padding: 5px 7px; }
}

/* desktop gains density, not a different app (§57) */
@media (min-width: 900px) {
  :root { --maxw: 640px; --pad: 28px; }
  .stage { padding-top: 40px; }
}
