/* =====================================================================
   Yard planner · foundation styles (direction 1 · The Model, with Blue Hour's
   evening tally and The Running Plan's Now / Later / Leave out).
   Brand roles arrive as custom properties from config (index.html head script):
   --primary, --accent, --ink-brand, --surface-brand, --sans, --tint.
   Material: layered tinted shadow. page = surface 6% toward primary; card = surface;
   raised = white + 2-layer neutral shadow; inset = page −3% L. Dark: page = ink 12%
   toward primary, +4% L per level. Radii 10 / 16 / 24, nested.
   Colour means "in your plan": primary on included rows; accent only on the consult
   button and the price flash. Keys, the count chip and the phase control are ink.
   ===================================================================== */
:root {
  --primary: #2F4A3A; --accent: #C46A3C; --ink-brand: #1F2421; --surface-brand: #F4F0E6;
  --sans: "Avenir Next", "Segoe UI", Roboto, sans-serif;
  --tint: 47 74 58;

  --page: color-mix(in oklab, var(--surface-brand) 94%, var(--primary));
  --card: var(--surface-brand);
  --raised: #fff;
  --inset: oklch(from var(--page) calc(l - 0.03) c h);
  --sweep-hi: color-mix(in oklab, var(--surface-brand) 60%, #fff);
  --text: var(--ink-brand);
  --text-2: color-mix(in oklab, var(--ink-brand) 74%, var(--page));
  --text-3: color-mix(in oklab, var(--ink-brand) 58%, var(--page));
  --rule: color-mix(in oklab, var(--ink-brand) 12%, transparent);
  --rule-2: color-mix(in oklab, var(--ink-brand) 24%, transparent);
  --switch: var(--ink-brand);
  --on-switch: #fff;
  --plan: var(--primary);
  --plan-tint: color-mix(in oklab, var(--primary) 9%, var(--card));
  --key: color-mix(in oklab, var(--ink-brand) 94%, #fff);
  --on-key: #fff;
  --consult: color-mix(in oklab, var(--accent) 90%, var(--ink-brand));
  --consult-hover: color-mix(in oklab, var(--accent) 76%, var(--ink-brand));
  --on-consult: #fff;
  --flash: var(--consult);
  --error: #A8321F;
  --ok: var(--primary);
  /* evening: basswood under blue light, amber pools */
  --dusk-hi: #4c5f80; --dusk-lo: #1c2333; --amber: #f2b45c; --amber-ink: #ffd79a;
  --sh-1: 0 1px 1px rgb(31 36 33 / .06), 0 2px 6px -2px rgb(31 36 33 / .14);
  --sh-2: 0 1px 2px rgb(31 36 33 / .07), 0 10px 26px -10px rgb(31 36 33 / .26);
  --sh-3: 0 2px 4px rgb(31 36 33 / .08), 0 26px 52px -18px rgb(var(--tint) / .38);
  --sh-in: inset 0 1px 2px rgb(31 36 33 / .10), inset 0 0 0 1px rgb(31 36 33 / .05);
  --hi: inset 0 1px 0 rgb(255 255 255 / .7);
  --focus: 0 0 0 2px var(--page), 0 0 0 4px color-mix(in oklab, var(--primary) 75%, #fff);
  --r-c: 10px; --r-p: 16px; --r-m: 24px;
  --ease-rise: cubic-bezier(.16, 1, .3, 1); --ease-cam: cubic-bezier(.65, 0, .35, 1);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --page: color-mix(in oklab, var(--ink-brand) 88%, var(--primary));
    --card: oklch(from var(--page) calc(l + 0.04) c h);
    --raised: oklch(from var(--page) calc(l + 0.08) c h);
    --inset: oklch(from var(--page) calc(l - 0.03) c h);
    --sweep-hi: oklch(from var(--page) calc(l + 0.05) c h);
    --text: color-mix(in oklab, var(--surface-brand) 94%, #fff);
    --text-2: color-mix(in oklab, var(--surface-brand) 72%, var(--page));
    --text-3: color-mix(in oklab, var(--surface-brand) 56%, var(--page));
    --rule: rgb(255 255 255 / .09); --rule-2: rgb(255 255 255 / .18);
    --switch: var(--surface-brand); --on-switch: var(--ink-brand);
    --plan: color-mix(in oklab, var(--primary) 45%, #b9d0c1);
    --plan-tint: color-mix(in oklab, var(--primary) 30%, var(--card));
    --key: color-mix(in oklab, var(--surface-brand) 88%, var(--page));
    --on-key: var(--ink-brand);
    --consult: color-mix(in oklab, var(--accent) 92%, #fff);
    --consult-hover: color-mix(in oklab, var(--accent) 80%, #fff);
    --on-consult: var(--ink-brand);
    --error: #E8806B;
    --sh-1: 0 1px 1px rgb(0 0 0 / .30), 0 2px 6px -2px rgb(0 0 0 / .40);
    --sh-2: 0 1px 2px rgb(0 0 0 / .35), 0 12px 28px -10px rgb(0 0 0 / .55);
    --sh-3: 0 2px 4px rgb(0 0 0 / .40), 0 28px 56px -18px rgb(0 0 0 / .70);
    --sh-in: inset 0 1px 2px rgb(0 0 0 / .40), inset 0 0 0 1px rgb(255 255 255 / .04);
    --hi: inset 0 1px 0 rgb(255 255 255 / .06);
    --focus: 0 0 0 2px var(--page), 0 0 0 4px color-mix(in oklab, var(--primary) 40%, #cfe0d4);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --page: color-mix(in oklab, var(--ink-brand) 88%, var(--primary));
  --card: oklch(from var(--page) calc(l + 0.04) c h);
  --raised: oklch(from var(--page) calc(l + 0.08) c h);
  --inset: oklch(from var(--page) calc(l - 0.03) c h);
  --sweep-hi: oklch(from var(--page) calc(l + 0.05) c h);
  --text: color-mix(in oklab, var(--surface-brand) 94%, #fff);
  --text-2: color-mix(in oklab, var(--surface-brand) 72%, var(--page));
  --text-3: color-mix(in oklab, var(--surface-brand) 56%, var(--page));
  --rule: rgb(255 255 255 / .09); --rule-2: rgb(255 255 255 / .18);
  --switch: var(--surface-brand); --on-switch: var(--ink-brand);
  --plan: color-mix(in oklab, var(--primary) 45%, #b9d0c1);
  --plan-tint: color-mix(in oklab, var(--primary) 30%, var(--card));
  --key: color-mix(in oklab, var(--surface-brand) 88%, var(--page));
  --on-key: var(--ink-brand);
  --consult: color-mix(in oklab, var(--accent) 92%, #fff);
  --consult-hover: color-mix(in oklab, var(--accent) 80%, #fff);
  --on-consult: var(--ink-brand);
  --error: #E8806B;
  --sh-1: 0 1px 1px rgb(0 0 0 / .30), 0 2px 6px -2px rgb(0 0 0 / .40);
  --sh-2: 0 1px 2px rgb(0 0 0 / .35), 0 12px 28px -10px rgb(0 0 0 / .55);
  --sh-3: 0 2px 4px rgb(0 0 0 / .40), 0 28px 56px -18px rgb(0 0 0 / .70);
  --sh-in: inset 0 1px 2px rgb(0 0 0 / .40), inset 0 0 0 1px rgb(255 255 255 / .04);
  --hi: inset 0 1px 0 rgb(255 255 255 / .06);
  --focus: 0 0 0 2px var(--page), 0 0 0 4px color-mix(in oklab, var(--primary) 40%, #cfe0d4);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
html, body { margin: 0; }
body { background: var(--page); color: var(--text); font: 500 15px/1.45 var(--sans); -webkit-font-smoothing: antialiased; overflow-x: clip; }
.num { font-variant-numeric: tabular-nums lining-nums; }
button, input, select, textarea { font: inherit; color: inherit; }
button { -webkit-tap-highlight-color: transparent; }
a { color: inherit; }
:focus-visible { outline: none; box-shadow: var(--focus); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.cap { font-size: 12px; font-weight: 500; letter-spacing: .01em; color: var(--text-3); }
[hidden] { display: none !important; }

/* ---------- mark: the scale-bar glyph + wordmark ---------- */
.mark { display: inline-flex; align-items: center; gap: 10px; font-weight: 600; font-size: 15px; letter-spacing: .005em; text-decoration: none; white-space: nowrap; }
.mark svg, .mark img { flex: none; }
.mark img { height: 28px; width: auto; }
.topbar { height: 56px; display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 0 32px 0 40px; }
.topbar .right { display: flex; align-items: center; gap: 20px; font-size: 13px; color: var(--text-2); min-width: 0; }
.topbar .usp { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar .phone { text-decoration: none; color: var(--text); font-weight: 600; white-space: nowrap; }
@media (hover: hover) { .topbar .phone:hover { text-decoration: underline; text-underline-offset: 3px; } }

/* ---------- hero: object plus rail ---------- */
.hero { --railw: 424px; position: relative; display: grid; grid-template-columns: minmax(0, 1fr) var(--railw);
  grid-template-areas: "head rail" "stage rail" "stage rail" "stage rail";
  grid-template-rows: auto auto minmax(0, 1fr) auto; height: max(720px, calc(100svh - 56px)); padding: 0 16px 16px 0; }
.head { grid-column: 1; grid-row: 1; padding: 6px 40px 0; position: relative; z-index: 2; pointer-events: none; }
.head > * { pointer-events: auto; }
h1 { margin: 0; font-weight: 500; font-size: 44px; line-height: 1.04; letter-spacing: -0.8px; max-width: 15em; text-wrap: balance; }
.lede { margin: 10px 0 0; font-size: 15px; font-weight: 400; color: var(--text-2); max-width: 46em; }

.stage { grid-column: 1; grid-row: 2 / 5; position: relative; min-height: 0; margin-top: -40px; }
.canvas-wrap-outer { position: absolute; inset: 0; }
.stage-field { position: absolute; inset: 0; background: radial-gradient(70% 62% at 50% 56%, var(--sweep-hi), transparent 72%), var(--page); }
.stage-field::after { content: ""; position: absolute; inset: 0; background: radial-gradient(80% 70% at 50% 58%, var(--dusk-hi), var(--dusk-lo)); opacity: 0; transition: opacity 1.2s var(--ease-cam);
  -webkit-mask-image: radial-gradient(72% 68% at 50% 56%, #000 55%, transparent 100%); mask-image: radial-gradient(72% 68% at 50% 56%, #000 55%, transparent 100%); }
.stage[data-time="dusk"] .stage-field::after { opacity: 1; }
.canvas-wrap { position: absolute; inset: 0; }
#yard { position: absolute; inset: 0; }
#yard canvas { display: block; }
.poster { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; pointer-events: none; transition: opacity .5s ease; }
.poster.off { opacity: 0; }
.stage.inspect .canvas-wrap { cursor: grab; }

/* base-plate label: the signature, clear of the board's front-left corner */
.plate { position: absolute; left: 40px; bottom: 40px; z-index: 3; display: grid; gap: 7px; min-width: 248px; padding: 10px 14px 10px 12px; border-radius: 4px;
  background: var(--card); box-shadow: inset 0 0 0 1px var(--rule-2), inset 0 1px 0 rgb(255 255 255 / .5); transition: opacity .3s ease; }
.plate .meta { display: flex; justify-content: space-between; gap: 16px; font-size: 12px; font-weight: 500; letter-spacing: .01em; color: var(--text-2); padding-top: 7px; border-top: 1px solid var(--rule); }
.plate .meta b { color: var(--text); font-weight: 600; }

.stage-tools { position: absolute; right: 24px; bottom: 24px; z-index: 3; display: grid; justify-items: end; gap: 12px; }
.scalebar { display: grid; gap: 4px; color: var(--text); }
.scalebar .bar { display: flex; height: 6px; width: var(--sbw, 180px); box-shadow: 0 0 0 1px currentColor inset; }
.scalebar .bar i { flex: 1; } .scalebar .bar i:nth-child(odd) { background: currentColor; }
.scalebar .ticks { display: flex; justify-content: space-between; width: calc(var(--sbw, 180px) + 12px); margin-left: -6px; font-size: 11px; color: var(--text-2); position: relative; }
.scalebar .ticks span { width: 12px; text-align: center; }
.scalebar .ticks em { position: absolute; right: -14px; font-style: normal; }
.stage[data-view]:not([data-view="yard"]) .scalebar, .stage.planning .scalebar { opacity: 0; }
.stage .scalebar { transition: opacity .3s ease; }
.stage[data-time="dusk"] .scalebar { color: #eef0f4; }
.stage[data-time="dusk"] .scalebar .ticks { color: rgb(238 240 244 / .75); }
.toolrow { display: flex; gap: 8px; align-items: center; }
.mini-scale { display: none; }

.tabs { display: flex; gap: 2px; padding: 3px; border-radius: var(--r-c); background: var(--card); box-shadow: var(--sh-1), var(--hi); }
.tabs button { border: 0; background: none; min-height: 36px; padding: 0 12px; border-radius: 7px; font-size: 13px; font-weight: 500; color: var(--text-2); cursor: pointer; white-space: nowrap; transition: background-color .14s ease, color .14s ease; }
.tabs button[aria-pressed="true"] { background: var(--raised); color: var(--text); box-shadow: var(--sh-1); }
@media (hover: hover) { .tabs button:hover:not([aria-pressed="true"]) { color: var(--text); } }
.tool { display: inline-flex; align-items: center; gap: 8px; height: 42px; padding: 0 12px; border: 0; border-radius: var(--r-c); background: var(--card); color: var(--text); box-shadow: var(--sh-1), var(--hi); font-size: 13px; font-weight: 500; cursor: pointer; white-space: nowrap; }
.tool svg { flex: none; }
.tool[aria-pressed="true"] { background: var(--switch); color: var(--on-switch); box-shadow: var(--sh-1); }
.tool:active, .tabs button:active { transform: scale(.97); }
.tool:disabled { opacity: .5; cursor: default; }
.tool .ev { display: grid; text-align: left; line-height: 1.1; }
.tool .ev small { font-size: 11px; font-weight: 500; letter-spacing: .01em; opacity: .72; }
.stage .float { position: absolute; top: 56px; right: 24px; z-index: 3; display: flex; gap: 8px; }

/* the evening tally, on the model */
.tally { position: absolute; left: 50%; top: 64px; z-index: 4; transform: translate(-50%, -6px); display: inline-flex; align-items: center; gap: 10px; height: 36px; padding: 0 14px 0 10px; border-radius: 999px;
  background: rgb(20 26 40 / .72); color: #f3f1ec; font-size: 13px; font-weight: 500; white-space: nowrap; box-shadow: 0 8px 24px -10px rgb(0 0 0 / .6), inset 0 0 0 1px rgb(255 255 255 / .08);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); opacity: 0; transition: opacity .3s ease, transform .4s var(--ease-rise); pointer-events: none; }
.tally.on { opacity: 1; transform: translate(-50%, 0); }
.tally b { font-weight: 600; color: var(--amber-ink); }
.tally .lamp { width: 10px; height: 10px; border-radius: 50%; background: var(--amber); box-shadow: 0 0 0 3px rgb(242 180 92 / .22), 0 0 12px 2px rgb(242 180 92 / .55); flex: none; }

/* ---------- rail ---------- */
.rail-bg { grid-column: 2; grid-row: 1 / 5; margin-top: 4px; border-radius: var(--r-p); background: var(--card); box-shadow: var(--sh-3), var(--hi); }
.band-block { grid-column: 2; grid-row: 1 / 3; padding: 24px 24px 14px; position: relative; z-index: 1; margin-top: 4px; }
.plate-head { display: none; }
.band-top { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; font-size: 13px; color: var(--text-2); }
.band { margin-top: 6px; font-size: 40px; font-weight: 600; line-height: 1.05; letter-spacing: -0.01em; white-space: nowrap; transition: color .6s ease; }
.band.flash { color: var(--flash); transition: none; }
.band-then { margin-top: 6px; font-size: 13px; font-weight: 500; color: var(--text-2); }
.band-then b { color: var(--text); font-weight: 600; }
.band-note { margin-top: 4px; font-size: 12px; font-weight: 500; letter-spacing: .01em; color: var(--text-3); }
.band-actions { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 14px; }
.legend { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-3); white-space: nowrap; }

/* the Itemised-plan button with its count */
.chip { white-space: nowrap; display: inline-flex; align-items: center; gap: 9px; height: 40px; padding: 0 14px 0 8px; border-radius: var(--r-c); border: 0; background: var(--raised); color: var(--text); font-size: 14px; font-weight: 600; cursor: pointer; box-shadow: inset 0 0 0 1.5px var(--text), var(--sh-1); transition: box-shadow .14s ease, background-color .14s ease; }
.chip svg { flex: none; }
.chip[aria-expanded="true"] { background: var(--key); color: var(--on-key); }
.chip .count { min-width: 24px; height: 24px; padding: 0 6px; border-radius: 999px; background: var(--key); color: var(--on-key); font-size: 12px; display: grid; place-items: center; }
.chip[aria-expanded="true"] .count { background: var(--on-key); color: var(--key); }
@media (hover: hover) { .chip:hover { box-shadow: inset 0 0 0 1.5px var(--text), var(--sh-2); } }
.chip:active { transform: scale(.97); }

.presets { margin-top: 16px; }
.presets h2, .rows-h { margin: 0 0 8px; font-size: 12px; font-weight: 500; letter-spacing: .01em; color: var(--text-3); }
.preset-row { display: grid; grid-template-columns: repeat(var(--n, 3), minmax(0, 1fr)); padding: 3px; gap: 2px; border-radius: var(--r-c); background: var(--inset); box-shadow: var(--sh-in); }
.preset-row button { border: 0; background: none; border-radius: 7px; padding: 7px 8px 6px; text-align: left; cursor: pointer; min-height: 44px; display: grid; gap: 1px; color: var(--text-2); }
.preset-row button b { font-size: 13px; font-weight: 600; color: inherit; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.preset-row button span { font-size: 12px; color: var(--text-3); }
.preset-row button[aria-checked="true"] { background: var(--raised); color: var(--text); box-shadow: var(--sh-1); }
.presets-m { display: none; }

.list { grid-column: 2; grid-row: 3; min-height: 0; overflow: auto; padding: 4px 12px 8px; position: relative; z-index: 1; overscroll-behavior: contain; scrollbar-width: thin; align-self: start; }
.rows-h { padding: 6px 12px 0; display: flex; justify-content: space-between; }

/* feature rows: two lines, key spanning both. line 1 name · band; line 2 detail · when */
.row { border-radius: 12px; transition: background-color .14s ease, box-shadow .14s ease; }
.row-head { display: grid; grid-template-columns: 24px minmax(0, 1fr) auto auto; grid-template-rows: auto auto; column-gap: 10px; row-gap: 1px; align-items: center; min-height: 58px; padding: 7px 8px 7px 12px; }
.row .kbox { grid-row: 1 / 3; }
.row .open { all: unset; display: contents; cursor: pointer; }
.row .open:focus-visible .name { box-shadow: var(--focus); border-radius: 4px; }
.row .name { grid-column: 2; grid-row: 1; align-self: end; }
.row .sub { grid-column: 2; grid-row: 2; align-self: start; }
.row .amt { grid-column: 3; grid-row: 1 / 3; }
.row .when { grid-column: 4; grid-row: 1 / 3; }
.name { font-size: 15px; font-weight: 500; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sub { display: block; font-size: 12px; color: var(--text-3); font-weight: 500; letter-spacing: .01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.amt { font-size: 15px; font-weight: 500; color: var(--plan); text-align: right; white-space: nowrap; }
.row.later .amt { color: var(--text-2); }
.row.out .amt { color: var(--text-3); font-size: 12px; }
.row.out .name { color: var(--text-2); }
@media (hover: hover) { .row:hover { background: var(--raised); box-shadow: var(--sh-1); } }
.row.open-row { background: var(--raised); box-shadow: var(--sh-2), inset 0 0 0 1px var(--rule); }
.row .more { display: none; padding: 0 12px 14px 48px; gap: 14px; }
.row.open-row .more { display: grid; animation: rise .35s var(--ease-rise); }
.row.flash .amt { color: var(--flash); transition: none; }
.row .amt { transition: color .6s ease; }
@keyframes rise { from { opacity: 0; transform: translateY(-4px); } }
.blurb { margin: 0; font-size: 13px; color: var(--text-2); font-weight: 400; }
.fact { margin: 0; font-size: 12px; color: var(--text-2); padding-top: 10px; border-top: 1px solid var(--rule); }

/* key discs: filled = now, dashed = later, hollow = left out (keys never renumber) */
.kbox, .kd { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; font-weight: 600; flex: none; }
.kd-now, .row.now .kbox { background: var(--key); color: var(--on-key); }
.kd-later, .row.later .kbox { background: var(--card); color: var(--text); outline: 1.5px dashed var(--text); outline-offset: -1.5px; }
.kd-out, .row.out .kbox { background: none; color: var(--text-3); box-shadow: inset 0 0 0 1.5px var(--rule-2); }

/* Now / Later / Leave out: 28 px, 13/500; the checked option carries its word */
.tri { display: inline-flex; gap: 2px; padding: 2px; border-radius: 999px; box-shadow: inset 0 0 0 1px var(--rule-2); background: var(--card); }
.tri button { position: relative; height: 28px; min-width: 28px; padding: 0 8px; border: 0; border-radius: 999px; background: none; color: var(--text-2); font-size: 13px; font-weight: 500; display: inline-flex; align-items: center; justify-content: center; gap: 6px; white-space: nowrap; cursor: pointer; transition: background-color .12s, color .12s; }
.tri button::before { content: ""; position: absolute; inset: -8px -1px; }
.tri i { width: 12px; height: 12px; border-radius: 999px; flex: none; }
.tri .now i { background: currentColor; }
.tri .later i { outline: 1.5px dashed currentColor; outline-offset: -1.5px; }
.tri .out i { box-shadow: inset 0 0 0 1.25px currentColor; }
.tri.compact button span { display: none; }
.tri.compact button { padding: 0; width: 28px; }
.tri.compact button[aria-checked="true"] { width: auto; padding: 0 9px 0 8px; }
.tri.compact button[aria-checked="true"] span { display: inline; }
.tri button[aria-checked="true"] { background: var(--key); color: var(--on-key); }
.tri button[aria-checked="true"].later { background: var(--raised); color: var(--text); box-shadow: inset 0 0 0 1.5px var(--text); }
.tri button[aria-checked="true"].out { background: var(--inset); color: var(--text); box-shadow: inset 0 0 0 1px var(--rule-2); }
@media (hover: hover) { .tri button:not([aria-checked="true"]):hover { color: var(--text); background: var(--inset); } }
.tri button:disabled { opacity: .45; cursor: default; }

/* S / M / L */
.seg { display: grid; grid-template-columns: repeat(var(--n, 3), minmax(0, 1fr)); padding: 3px; border-radius: var(--r-c); background: var(--inset); box-shadow: var(--sh-in); }
.seg button { min-height: 34px; border: 0; border-radius: 7px; background: none; font-size: 13px; font-weight: 500; color: var(--text-2); cursor: pointer; white-space: nowrap; display: grid; line-height: 1.15; padding: 4px 4px; }
.seg button small { font-size: 11px; color: var(--text-3); }
.seg button[aria-checked="true"] { background: var(--raised); color: var(--text); box-shadow: var(--sh-1); }
@media (hover: hover) { .seg button:not([aria-checked="true"]):hover { color: var(--text); } }

/* scale-bar slider: 6 px end ticks, live footprint at the thumb */
.range { position: relative; height: 56px; --k: .5; margin-top: 2px; }
.range input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: ew-resize; }
.range .trk { position: absolute; left: 0; right: 0; top: 25px; height: 6px; display: flex; box-shadow: inset 0 0 0 1px var(--text-2); pointer-events: none; }
.range .trk i { flex: 1; } .range .trk i:nth-child(odd) { background: color-mix(in oklab, var(--text) 18%, transparent); }
.range .fill { position: absolute; left: 0; top: 25px; height: 6px; width: calc(var(--k) * 100%); overflow: hidden; pointer-events: none; }
.range .fill span { position: absolute; left: 0; top: 0; bottom: 0; width: var(--tw, 300px); display: flex; }
.range .fill span i { flex: 1; background: color-mix(in oklab, var(--plan) 40%, var(--card)); } .range .fill span i:nth-child(odd) { background: var(--plan); }
.range .knob { position: absolute; top: 18px; left: calc(var(--k) * 100%); width: 20px; height: 20px; margin-left: -10px; border-radius: 50%; background: var(--raised); box-shadow: var(--sh-2), inset 0 0 0 1.5px var(--plan); pointer-events: none; }
.range input:focus-visible ~ .knob { box-shadow: var(--focus), var(--sh-2); }
.range .lab { position: absolute; top: 38px; left: 0; right: 0; display: flex; justify-content: space-between; font-size: 12px; color: var(--text-3); pointer-events: none; }
.range .ends::before, .range .ends::after { content: ""; position: absolute; top: 19px; width: 1.5px; height: 18px; background: var(--text-2); pointer-events: none; }
.range .ends::before { left: -0.75px; } .range .ends::after { right: -0.75px; }
.range .foot { position: absolute; top: 0; left: calc(var(--k) * 100%); transform: translateX(clamp(-100%, calc(-50% + (0.5 - var(--k)) * 60%), 0%)); font-size: 12px; font-weight: 600; color: var(--text); white-space: nowrap; pointer-events: none; }
.range.disabled { opacity: .45; pointer-events: none; }

/* real-texture sample tiles */
.samples { display: grid; grid-template-columns: repeat(auto-fill, minmax(64px, 1fr)); gap: 10px 8px; }
.sample { border: 0; padding: 0; background: none; text-align: left; cursor: pointer; display: grid; gap: 5px; align-content: start; }
.sample .t { aspect-ratio: 4 / 3; border-radius: 8px; background-size: cover; background-position: center; box-shadow: var(--sh-1), inset 0 0 0 1px rgb(0 0 0 / .06); position: relative; }
.sample .t i { position: absolute; left: 5px; top: 5px; height: 18px; min-width: 18px; padding: 0 5px; border-radius: 5px; background: rgb(255 255 255 / .86); color: #1f2421; font-size: 11px; font-style: normal; font-weight: 600; display: grid; place-items: center; }
.sample[aria-checked="true"] .t { box-shadow: 0 0 0 2px var(--raised), 0 0 0 3.5px var(--plan), var(--sh-2); }
.sample:focus-visible { box-shadow: none; } .sample:focus-visible .t { box-shadow: var(--focus); }
@media (hover: hover) { .sample:not([aria-checked="true"]):hover .t { box-shadow: var(--sh-2), inset 0 0 0 1px rgb(0 0 0 / .1); } }
.sample b { font-size: 12px; font-weight: 600; line-height: 1.25; }
.sample span { font-size: 11px; color: var(--text-3); line-height: 1.3; }

.permit { display: flex; justify-content: space-between; gap: 12px; padding: 10px 12px 4px 48px; font-size: 12px; color: var(--text-3); }

.cta-block { grid-column: 2; grid-row: 4; padding: 14px 24px 22px; position: relative; z-index: 1; border-top: 1px solid var(--rule); display: grid; gap: 8px; }
.cta-block .btn { width: 100%; }
.cta-block .cap { text-align: center; }
.phone-cta { display: none !important; }

/* ---------- buttons ---------- */
.btn { position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 48px; padding: 0 18px; border-radius: var(--r-c); border: 0; font-size: 15px; font-weight: 600; letter-spacing: .005em; cursor: pointer; white-space: nowrap; text-decoration: none; transition: background-color .14s ease, box-shadow .14s ease, color .14s ease; }
.btn:active { transform: scale(.97); }
.btn-consult { background: var(--consult); color: var(--on-consult); box-shadow: 0 1px 2px rgb(0 0 0 / .10), 0 8px 18px -10px rgb(0 0 0 / .30), inset 0 1px 0 rgb(255 255 255 / .18); }
.btn-consult:focus-visible { box-shadow: var(--focus); }
@media (hover: hover) { .btn-consult:hover:not(:disabled) { background: var(--consult-hover); } }
.btn-second { background: var(--raised); color: var(--text); box-shadow: var(--sh-1), inset 0 0 0 1px var(--rule-2); }
@media (hover: hover) { .btn-second:hover:not(:disabled) { box-shadow: var(--sh-2), inset 0 0 0 1px var(--rule-2); } }
.btn-second:focus-visible { box-shadow: var(--focus); }
.btn:disabled { cursor: default; transform: none; }
.btn-consult:disabled { background: color-mix(in oklab, var(--consult) 40%, var(--inset)); color: color-mix(in oklab, var(--on-consult) 70%, transparent); box-shadow: none; }
.btn-second:disabled { color: var(--text-3); box-shadow: inset 0 0 0 1px var(--rule); }
.btn.loading { color: transparent !important; pointer-events: none; }
.btn.loading::after { content: ""; position: absolute; left: 50%; top: 50%; width: 18px; height: 18px; margin: -9px 0 0 -9px; border-radius: 50%; border: 2px solid var(--on-consult); border-right-color: transparent; animation: spin .8s linear infinite; }
.btn-second.loading::after { border-color: var(--text); border-right-color: transparent; }
.btn-sm { height: 40px; padding: 0 14px; font-size: 14px; }
@keyframes spin { to { transform: rotate(360deg); } }
.x { width: 40px; height: 40px; border-radius: var(--r-c); border: 0; background: var(--inset); color: var(--text); cursor: pointer; display: grid; place-items: center; flex: none; }

/* ---------- chips (filters, facts) ---------- */
.pill { display: inline-flex; align-items: center; gap: 8px; height: 32px; padding: 0 12px; border-radius: 999px; border: 0; background: var(--card); color: var(--text); box-shadow: inset 0 0 0 1px var(--rule-2); font-size: 13px; font-weight: 500; white-space: nowrap; }
button.pill { cursor: pointer; }
.pill[aria-pressed="true"] { background: var(--plan-tint); box-shadow: inset 0 0 0 1.5px var(--plan); }
.pill-badge { background: var(--plan-tint); color: var(--plan); box-shadow: none; font-weight: 600; }

/* ---------- inputs ---------- */
.field { display: grid; gap: 5px; }
.field label { font-size: 13px; color: var(--text-2); }
.input { height: 44px; border: 0; border-radius: var(--r-c); padding: 0 12px; background: var(--page); box-shadow: var(--sh-in); font-size: 15px; width: 100%; }
.input:focus { outline: none; box-shadow: var(--focus); }
.msg { font-size: 12px; color: var(--text-2); min-height: 1.2em; display: flex; align-items: center; gap: 6px; }
.field.err .input { box-shadow: inset 0 0 0 1.5px var(--error); }
.field.err .msg { color: var(--error); }
.field.ok .msg { color: var(--ok); font-weight: 600; }
.field.ok .msg::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.field.maybe .msg::before { content: ""; width: 8px; height: 8px; border-radius: 50%; box-shadow: inset 0 0 0 1.5px currentColor; }

/* ---------- plan + consult mount points (filled by assets/js/app/plan-sheet.js, consult.js) ---------- */
.plan-sheet { grid-column: 2; grid-row: 1 / 5; margin-top: 4px; z-index: 6; position: relative; display: flex; flex-direction: column; border-radius: var(--r-p); background: var(--raised); box-shadow: var(--sh-3), inset 0 0 0 1px var(--rule-2); overflow: hidden;
  visibility: hidden; opacity: 0; transform: translateY(16px); transition: opacity .35s ease, transform .5s var(--ease-rise), visibility 0s linear .5s; }
.plan-sheet.on { visibility: visible; opacity: 1; transform: none; transition: opacity .35s ease, transform .5s var(--ease-rise); }
.plan-sheet:empty { display: none; }

/* toast and inline save confirmation */
.toasts { position: fixed; left: 50%; bottom: 24px; z-index: 60; transform: translateX(-50%); display: grid; gap: 8px; justify-items: center; pointer-events: none; }
.toast { display: inline-flex; align-items: center; gap: 10px; min-height: 44px; padding: 10px 16px 10px 12px; border-radius: 12px; background: var(--key); color: var(--on-key); font-size: 14px; font-weight: 500; box-shadow: var(--sh-3); pointer-events: auto; animation: toast-in .35s var(--ease-rise); max-width: calc(100vw - 32px); }
.toast .tick { width: 20px; height: 20px; border-radius: 50%; background: var(--on-key); color: var(--key); display: grid; place-items: center; flex: none; }
.toast b { font-weight: 600; }
.toast.out { opacity: 0; transform: translateY(6px); transition: opacity .25s ease, transform .25s ease; }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }
.saved { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; color: var(--plan); }
.saved::before { content: ""; width: 14px; height: 14px; border-radius: 50%; background: currentColor; -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 14 14'%3E%3Ccircle cx='7' cy='7' r='7'/%3E%3Cpath d='M4 7.2 6.1 9.2 10 5' stroke='%23000' stroke-width='1.6' fill='none'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 14 14'%3E%3Cmask id='m'%3E%3Ccircle cx='7' cy='7' r='7' fill='%23fff'/%3E%3Cpath d='M4 7.2 6.1 9.2 10 5' stroke='%23000' stroke-width='1.6' fill='none'/%3E%3C/mask%3E%3Crect width='14' height='14' mask='url(%23m)'/%3E%3C/svg%3E") center / contain no-repeat; }

/* empty state */
.empty { display: grid; justify-items: center; gap: 10px; padding: 28px 20px; text-align: center; border-radius: var(--r-p); background: var(--inset); box-shadow: var(--sh-in); }
.empty .glyph { color: var(--text-3); }
.empty h3 { margin: 0; font-size: 15px; font-weight: 600; }
.empty p { margin: 0; font-size: 13px; color: var(--text-2); max-width: 26em; }

/* ---------- below the fold ---------- */
.below { padding: 96px 40px 0; display: grid; gap: 96px; }
.below > section { max-width: 1360px; }
.below h2.sec { margin: 0; font-size: 36px; line-height: 1.1; font-weight: 400; letter-spacing: -.01em; text-wrap: balance; }

/* design visit: a time scale in weeks on the scale-bar motif; compact (24 px gaps, under 360 px) */
.visit { display: grid; grid-template-columns: minmax(0, 4fr) minmax(0, 8fr); gap: 24px 48px; align-items: start; }
.visit .intro { margin: 12px 0 0; color: var(--text-2); font-weight: 400; max-width: 30em; }
.visit .steps { margin: 16px 0 0; padding: 0; list-style: none; display: grid; gap: 8px; font-size: 14px; color: var(--text-2); font-weight: 400; max-width: 32em; }
.visit .steps li { display: grid; grid-template-columns: 24px 1fr; gap: 10px; align-items: start; }
.visit .steps li span { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; box-shadow: inset 0 0 0 1.5px var(--rule-2); font-size: 11px; font-weight: 600; color: var(--text); }
.tl { display: grid; gap: 24px; }
.tl-row { display: grid; grid-template-columns: 132px minmax(0, 1fr); gap: 4px 24px; align-items: end; }
.tl-name h3 { margin: 0; font-size: 17px; font-weight: 600; line-height: 1.2; }
.tl-name span { display: block; margin-top: 2px; font-size: 12px; letter-spacing: .01em; color: var(--text-3); }
.axis { position: relative; padding-top: 30px; }
.axis .bar { display: flex; height: 6px; box-shadow: inset 0 0 0 1px var(--text); }
.axis .bar i { flex: 1; } .axis .bar i:nth-child(odd) { background: var(--text); }
.axis .nums { position: relative; height: 16px; margin-top: 4px; font-size: 11px; color: var(--text-3); }
.axis .nums span { position: absolute; transform: translateX(-50%); }
.axis .nums span:last-child { transform: translateX(-100%); }
.axis .nums span:first-child { transform: none; }
.mk { position: absolute; top: 0; bottom: 26px; left: calc(var(--a) * 100%); width: calc((var(--b) - var(--a)) * 100%); }
.mk::before { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 12px; border: 1.5px solid var(--text); border-bottom: 0; }
.mk.pt { width: 0; } .mk.pt::before { right: auto; width: 0; border-width: 0 0 0 1.5px; }
.mk b { position: absolute; left: 0; bottom: 16px; font-size: 13px; font-weight: 600; white-space: nowrap; }
.mk.end b { left: auto; right: 0; }
.tl-notes { grid-column: 2; margin: 0; font-size: 13px; color: var(--text-2); font-weight: 400; }
.insp { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.insp span { display: inline-flex; align-items: center; gap: 8px; height: 30px; padding: 0 12px; border-radius: var(--r-c); background: var(--card); box-shadow: inset 0 0 0 1px var(--rule-2); font-size: 13px; font-weight: 600; }
.insp span::before { content: ""; width: 1.5px; height: 12px; background: var(--text); }
.facts { grid-column: 2; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 24px; padding-top: 14px; border-top: 1px solid var(--rule); font-size: 13px; color: var(--text-2); }
.facts p { margin: 0 0 6px; }
.facts b { color: var(--text); font-weight: 600; }

.photos .ph-head { display: flex; justify-content: space-between; align-items: end; gap: 24px; margin-bottom: 24px; }
.strip { display: grid; grid-template-columns: 5fr 4fr 4fr; gap: 16px; }
.strip.n2 { grid-template-columns: 1fr 1fr; } .strip.n1 { grid-template-columns: minmax(0, 720px); }
.strip figure { margin: 0; }
.strip img, .strip .ph { display: block; width: 100%; aspect-ratio: 3 / 2; object-fit: cover; border-radius: var(--r-p); background: var(--inset); box-shadow: var(--sh-2); }
.strip figcaption { margin-top: 10px; font-size: 12px; letter-spacing: .01em; color: var(--text-3); display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.strip figcaption b { color: var(--text); font-weight: 600; font-size: 13px; }
.strip .kd { width: 22px; height: 22px; font-size: 11px; }

.closing { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 24px; padding: 32px; border-radius: var(--r-m); background: var(--card); box-shadow: var(--sh-2), var(--hi); }
.closing h2 { margin: 0; font-size: 28px; font-weight: 400; letter-spacing: -.01em; line-height: 1.15; }
.closing p { margin: 6px 0 0; color: var(--text-2); font-weight: 400; }
.closing .acts { display: flex; gap: 12px; align-items: center; }

footer { margin-top: 72px; padding: 24px 40px 32px; border-top: 1px solid var(--rule); display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px 32px; font-size: 13px; color: var(--text-2); }
footer .concept { color: var(--text-3); }

/* ---------- layout variant: rail-left (the mirrored hero) ---------- */
.hero[data-variant="rail-left"] { grid-template-columns: var(--railw) minmax(0, 1fr); padding: 0 0 16px 16px; }
.hero[data-variant="rail-left"] .head, .hero[data-variant="rail-left"] .stage { grid-column: 2; }
.hero[data-variant="rail-left"] .rail-bg, .hero[data-variant="rail-left"] .band-block, .hero[data-variant="rail-left"] .list, .hero[data-variant="rail-left"] .cta-block, .hero[data-variant="rail-left"] .plan-sheet { grid-column: 1; }

/* ---------- reduced motion: cuts ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0s !important; animation-duration: 0s !important; }
}

/* ---------- desktop widths between ---------- */
@media (max-width: 1180px) { .hero { --railw: 384px; } h1 { font-size: 36px; } .lede { display: none; } }

/* ---------- phone: model ≤300 px, band pinned under the view tabs, then the sheet ---------- */
@media (max-width: 760px) {
  .topbar { height: 52px; padding: 0 16px; }
  .topbar .right .usp { display: none; }
  .hero, .hero[data-variant="rail-left"] { display: grid; grid-template-columns: minmax(0, 1fr); grid-template-rows: none; grid-template-areas: "head" "stage" "band" "list" "cta"; height: auto; padding: 0; }
  .head, .hero[data-variant="rail-left"] .head { grid-area: head; grid-column: auto; grid-row: auto; padding: 2px 16px 10px; }
  h1 { font-size: 26px; line-height: 1.12; letter-spacing: -0.4px; }
  .lede { display: none; }
  .stage, .hero[data-variant="rail-left"] .stage { grid-area: stage; grid-column: auto; grid-row: auto; margin: 0 16px; display: flex; flex-direction: column; }
  .canvas-wrap-outer { position: relative; height: min(300px, 38svh); border-radius: var(--r-p); overflow: hidden; }
  .plate { display: none; }
  .stage-tools { position: static; display: flex; justify-content: space-between; align-items: center; padding: 8px 0 6px; gap: 8px; }
  .stage-tools .scalebar { display: none; }
  .stage .float { top: 8px; left: 8px; right: 8px; justify-content: space-between; }
  .stage .float .tool { height: 40px; }
  .stage .float #inspect { width: 40px; padding: 0; justify-content: center; }
  .stage .float #inspect span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .tally { top: auto; bottom: 36px; font-size: 12px; height: 32px; max-width: calc(100% - 24px); }
  .toolrow { flex: 1; min-width: 0; }
  .tabs { flex: 1; min-width: 0; }
  .tabs button { flex: 1; padding: 0 6px; }
  .rail-bg { display: none; }
  .band-block, .hero[data-variant="rail-left"] .band-block { grid-area: band; grid-column: auto; grid-row: auto; position: sticky; top: 0; z-index: 8; margin: 0 16px; padding: 12px 16px 14px; border-radius: var(--r-p); background: var(--card); box-shadow: var(--sh-2), var(--hi); }
  .plate-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding-bottom: 8px; margin-bottom: 8px; border-bottom: 1px solid var(--rule); font-size: 12px; color: var(--text-2); }
  .plate-head .mark { font-size: 12px; gap: 8px; font-weight: 500; }
  .band-top { display: none; }
  .band { margin-top: 0; font-size: 32px; }
  .band-then { font-size: 12px; }
  .band-actions { margin-top: 10px; }
  .legend { display: none; }
  .presets { display: none; }
  .list, .hero[data-variant="rail-left"] .list { grid-area: list; grid-column: auto; grid-row: auto; overflow: visible; margin: 12px 0 0; padding: 18px 8px 8px; border-radius: 24px 24px 0 0; background: var(--card); box-shadow: 0 -1px 0 var(--rule), 0 -12px 28px -16px rgb(var(--tint) / .35); }
  .list .presets-m { display: block; padding: 0 8px 14px; }
  .row-head { padding: 7px 6px 7px 8px; column-gap: 8px; }
  .row .more { padding: 0 8px 14px 8px; }
  .permit { padding-left: 42px; }
  .cta-block, .hero[data-variant="rail-left"] .cta-block { grid-area: cta; grid-column: auto; grid-row: auto; background: var(--card); padding: 12px 16px 28px; border-top: 0; }
  .plan-sheet, .hero[data-variant="rail-left"] .plan-sheet { position: fixed; left: 0; right: 0; bottom: 0; top: var(--sheet-top, 40svh); margin: 0; border-radius: 20px 20px 0 0; transform: translateY(32px); z-index: 30; }
  .below { padding: 64px 16px 0; gap: 64px; }
  .visit { grid-template-columns: 1fr; gap: 20px; }
  .below h2.sec { font-size: 28px; }
  .tl-row { grid-template-columns: 1fr; gap: 6px; }
  .tl-notes, .facts { grid-column: 1; }
  .mk b { font-size: 12px; }
  .facts { grid-template-columns: 1fr; }
  .strip, .strip.n2 { grid-template-columns: 1fr; }
  .photos .ph-head { flex-direction: column; align-items: start; gap: 8px; }
  .closing { grid-template-columns: 1fr; padding: 22px 18px; }
  .closing .acts { flex-direction: column; align-items: stretch; }
  footer { padding: 24px 16px 40px; }
  .mini-scale { display: grid; position: absolute; left: 12px; bottom: 10px; z-index: 3; gap: 3px; pointer-events: none; }
}
