/* Korb "See it on your floor", Direction A "Workbench" (Miles 31/10). Brand values from korb.au; semantic tokens below. */
:root {
  /* korb.au palette */
  --ink: #0f0f0d;
  --charcoal: #1c1c1a;
  --graphite: #2e2e2b;
  --mid: #5a5a55;
  --warm-grey: #9a9a92;
  --offwhite: #f2ede6;
  --paper: #faf8f4;
  --white: #ffffff;
  --orange: #B87333;
  --orange-deep: #9A5E28;
  --amber: #F5A623;            /* focus ring only */

  /* semantic tokens (light) */
  --bg: var(--paper);
  --surface: var(--white);
  --surface-2: #f4f1eb;
  --text: var(--ink);
  --text-2: var(--mid);
  --text-3: #85847c;
  --line: rgba(15,15,13,0.09);
  --line-strong: rgba(15,15,13,0.18);
  --ring: var(--ink);
  --copper: var(--orange);
  --copper-deep: var(--orange-deep);
  --likely: #2f6b48; --likely-bg: #dce9df;
  --close: #8a5a12; --close-bg: #f5ead6;      /* close to the requirement: amber, never red or green */
  --indic: #5a5a55; --indic-bg: #ece7df;      /* typical floor: an indicative range, a recommendation to test */
  --unlikely: #a3452f;
  --group-bg: #efe9df;                         /* the export's group row tint */
  /* one neutral surface behind every product and finish thumbnail (the thumbnails are transparent WebP) */
  --tile-surface-light: #ebe7e0;
  --tile-surface-dark: #2b2a26;
  --tile-surface: var(--tile-surface-light);
  --thumb: var(--tile-surface);
  --band: var(--ink); --band-text: #e9e6df;    /* korb chrome: nav, next step, footer */
  --stage: #26261f;
  --overlay: rgba(15,15,13,0.72); --overlay-text: #f2ede6;
  --shadow: 0 1px 2px rgba(40,30,15,0.05), 0 8px 24px -12px rgba(40,30,15,0.18);
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);

  --nav-h: 60px;
  --head-h: calc(var(--nav-h) + var(--banner-h, 0px));   /* korb.au: fixed telemetry bar (--banner-h) + island nav */
  --gutter: 16px;
  --col: 420px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #121210; --surface: #1b1b18; --surface-2: #232320; --text: #f2ede6; --text-2: #b4b1a8; --text-3: #8a887f;
    --line: rgba(242,237,230,0.09); --line-strong: rgba(242,237,230,0.2); --ring: #f2ede6; --copper: #c98447;
    --likely: #7fbf96; --likely-bg: rgba(127,191,150,0.16); --close: #e2b46c; --close-bg: rgba(226,180,108,0.14);
    --indic: #c9c5bb; --indic-bg: rgba(242,237,230,0.08); --unlikely: #e08b74; --group-bg: #26241f;
    --tile-surface: var(--tile-surface-dark); --band: #0b0b0a; --stage: #0b0b0a;
    --shadow: 0 1px 2px rgba(0,0,0,0.4), 0 8px 24px -12px rgba(0,0,0,0.6);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #121210; --surface: #1b1b18; --surface-2: #232320; --text: #f2ede6; --text-2: #b4b1a8; --text-3: #8a887f;
  --line: rgba(242,237,230,0.09); --line-strong: rgba(242,237,230,0.2); --ring: #f2ede6; --copper: #c98447;
  --likely: #7fbf96; --likely-bg: rgba(127,191,150,0.16); --close: #e2b46c; --close-bg: rgba(226,180,108,0.14);
  --indic: #c9c5bb; --indic-bg: rgba(242,237,230,0.08); --unlikely: #e08b74; --group-bg: #26241f;
  --tile-surface: var(--tile-surface-dark); --band: #0b0b0a; --stage: #0b0b0a;
  --shadow: 0 1px 2px rgba(0,0,0,0.4), 0 8px 24px -12px rgba(0,0,0,0.6);
  color-scheme: dark;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--head-h) + 16px); }
body { background: var(--bg); color: var(--text); font: 400 15px/1.55 'Poppins', sans-serif; overflow-x: hidden; -webkit-font-smoothing: antialiased; }
img { max-width: 100%; }
a { color: inherit; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--amber); outline-offset: 2px; }
.num { font-variant-numeric: tabular-nums; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -9999px; top: 8px; background: var(--amber); color: var(--ink); padding: 8px 12px; z-index: 999; }
.skip:focus { left: 8px; }
.muted { color: var(--text-3); }

/* nav (standalone stand-in for the korb.au header) */
.topnav { position: sticky; top: 0; z-index: 300; height: var(--nav-h); display: flex; align-items: center; justify-content: space-between; padding: 0 var(--gutter); background: var(--band); border-bottom: 1px solid rgba(255,255,255,0.07); }
.nav-logo img { height: 26px; width: auto; filter: invert(1); display: block; }
.nav-links { display: flex; gap: 14px; align-items: center; }
.nav-links a { color: rgba(255,255,255,0.72); text-decoration: none; font-size: 0.82rem; font-weight: 500; }
.nav-links a:hover { color: var(--white); }
.nav-links .nav-cta { background: var(--orange); color: var(--ink); padding: 8px 14px; font-weight: 600; }
.nav-links .nav-cta:hover { background: var(--amber); color: var(--ink); }

/* title bar */
.titlebar, .bench { max-width: 1440px; margin: 0 auto; padding-left: var(--gutter); padding-right: var(--gutter); }
.titlebar { padding-top: 20px; padding-bottom: 16px; }
h1 { font: 800 32px/1 'Barlow', sans-serif; letter-spacing: -0.03em; }
h1 em { font-style: italic; color: var(--copper); }
.lede { color: var(--text-2); font-size: 13.5px; max-width: 70ch; margin-top: 8px; text-wrap: pretty; }
.privacy-pill { display: inline-flex; align-items: center; gap: 8px; margin-top: 10px; font-size: 12.5px; color: var(--text-2); }
.privacy-pill svg { color: var(--copper); flex-shrink: 0; }

/* buttons */
.btn-solid, .btn-dark, .btn-outline { display: inline-flex; align-items: center; justify-content: center; gap: 8px; font-family: 'Poppins', sans-serif; font-weight: 600; font-size: 0.88rem; padding: 13px 22px; text-decoration: none; border: 0; cursor: pointer; min-height: 46px; transition: background 0.2s var(--ease), border-color 0.2s var(--ease); }
.btn-solid { background: var(--copper); color: var(--white); }
.btn-solid:hover { background: var(--copper-deep); }
.btn-dark { background: var(--text); color: var(--bg); }
.btn-dark:hover { background: var(--text-2); }
.btn-outline { border: 1px solid rgba(255,255,255,0.3); color: var(--white); background: transparent; }
.btn-outline:hover { border-color: var(--white); }
.btn-ghost { background: transparent; border: 1px solid var(--line-strong); color: var(--text); font: 500 0.8rem 'Poppins', sans-serif; padding: 8px 12px; min-height: 40px; cursor: pointer; }
.btn-ghost:hover { border-color: var(--text); }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 10px; height: 50px; padding: 0 22px; font: 600 14.5px 'Poppins', sans-serif; white-space: nowrap; cursor: pointer; border: 0; text-decoration: none; transition: background 0.2s var(--ease), transform 0.12s var(--ease); }
.btn:active { transform: translateY(1px); }
.btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.btn-line { border: 1px solid var(--line-strong); color: var(--text); background: var(--surface); }
.btn-line:hover { border-color: var(--text); }
.btn-copper { background: var(--copper); color: var(--white); }
.btn-copper:hover { background: var(--copper-deep); }
.calc-btn { width: 100%; background: var(--copper); color: var(--white); border: none; padding: 15px; font: 600 0.92rem 'Poppins', sans-serif; cursor: pointer; margin-top: 10px; min-height: 48px; }
.calc-btn:hover { background: var(--copper-deep); }
.calc-btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* ---------- the bench: sticky viewer + options that flow with the page (Apple buy-page pattern, no inner scroll) ---------- */
main { display: block; }
.bench { display: grid; grid-template-columns: minmax(0, 1fr); align-items: start; padding-bottom: 48px; }
.viewcol { min-width: 0; }

/* the stage: 4:3, height from the viewport, centred; the render keeps its 4:3 canvas so exports are unchanged */
.viewer { --stage-h: max(460px, calc(100vh - var(--head-h) - 172px)); --stage-h: max(460px, calc(100dvh - var(--head-h) - 172px));
  position: relative; width: min(100%, calc(var(--stage-h) * 4 / 3)); aspect-ratio: 4 / 3; margin: 0 auto; background: var(--stage); box-shadow: var(--shadow); overflow: hidden; }
.viewer > .panel { position: absolute; inset: 0; }
.panel { min-width: 0; }
.ov { position: absolute; z-index: 3; display: flex; gap: 6px; align-items: center; }
.ov-tl { top: 16px; left: 16px; } .ov-tr { top: 16px; right: 16px; } .ov-br { bottom: 16px; right: 16px; } .ov-bl { bottom: 16px; left: 16px; }

/* view tabs: a segmented control on the stage, still role=tab */
.tabs { gap: 0; padding: 4px; border-radius: 999px; background: var(--overlay); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.tabs [role="tab"] { font: 500 13px 'Poppins', sans-serif; color: rgba(242,237,230,0.72); background: none; border: 0; padding: 7px 16px; border-radius: 999px; cursor: pointer; white-space: nowrap; transition: background 0.2s var(--ease), color 0.2s var(--ease); }
.tabs [role="tab"]:hover { color: #f2ede6; }
.tabs [role="tab"][aria-selected="true"] { background: #f2ede6; color: #0f0f0d; }

/* overlay chips: contrast, PNG, zoom */
.chip-ov { display: inline-flex; align-items: center; gap: 8px; height: 38px; padding: 0 14px; border: 0; border-radius: 999px; background: var(--overlay); color: var(--overlay-text); font: 400 13px 'Poppins', sans-serif; text-decoration: none; cursor: pointer; backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.chip-ov b { font-weight: 600; }
.chip-ov svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.chip-ov i { width: 9px; height: 9px; border-radius: 50%; border: 1.5px solid #e2b46c; flex: none; }   /* calm: a hollow amber ring */
.chip-ov.is-likely i { border-color: #7fbf96; background: #7fbf96; }
.chip-ov.is-unlikely i { border-color: #e08b74; }
.zoom { display: flex; border-radius: 999px; background: var(--overlay); color: var(--overlay-text); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.zoom button { width: 40px; height: 38px; display: grid; place-items: center; background: none; border: 0; color: inherit; font: 500 13px 'Poppins', sans-serif; cursor: pointer; }
.zoom button + button { border-left: 1px solid rgba(242,237,230,0.14); }
.zoom #plan-fit { width: 52px; }

.caption { margin-top: 12px; font-size: 13px; color: var(--text-2); }
#view-caption { display: flex; justify-content: space-between; gap: 6px 20px; flex-wrap: wrap; }
#view-caption b { color: var(--text); font-weight: 500; }
.viewcol > div > .note { font-size: 12px; }

/* render surfaces */
.stage { position: relative; width: 100%; background: var(--stage); touch-action: pan-y; user-select: none; -webkit-user-select: none; line-height: 0; }
.stage canvas { width: 100%; height: auto; display: block; }
.stage #plan-three { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.stage svg { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; overflow: visible; }
.plan-stage { touch-action: none; cursor: grab; }
.st3-stage { touch-action: none; cursor: grab; aspect-ratio: 4 / 3; }
.handle { position: absolute; width: 44px; height: 44px; margin: -22px 0 0 -22px; border: 0; background: transparent; cursor: grab; touch-action: none; padding: 0; z-index: 2; }
.handle::before { content: ''; position: absolute; left: 12px; top: 12px; width: 20px; height: 20px; border-radius: 50%; background: var(--orange); border: 2px solid var(--white); box-shadow: 0 0 0 1px rgba(0,0,0,0.5), 0 2px 6px rgba(0,0,0,0.4); }
.handle span { position: absolute; left: 30px; top: -2px; font: 700 12px/1 'Poppins', sans-serif; color: var(--white); background: var(--ink); padding: 3px 5px; pointer-events: none; }
.handle:active { cursor: grabbing; }
.handle:focus-visible { outline: none; }
.handle:focus-visible::before { box-shadow: 0 0 0 4px var(--amber); }

/* plan photo: take / upload, then mark (below the stage; the viewer stops sticking while it is open) */
#plan-photo { margin: 14px 0; }
#plan-mark-work { margin-top: 14px; }
.dz-btns { display: grid; gap: 10px; max-width: 360px; }
.file-btn { position: relative; overflow: hidden; }
.file-btn input { position: absolute; inset: 0; opacity: 0; cursor: pointer; font-size: 0; }
.file-btn:focus-within { outline: 3px solid var(--amber); outline-offset: 2px; }

/* preset / ar */
.mv-wrap { position: relative; height: 100%; background: radial-gradient(#ffffff, #dcdad6); }
model-viewer { width: 100%; height: 100%; display: block; --poster-color: transparent; }
.ar-btn { position: absolute; bottom: 14px; left: 50%; transform: translateX(-50%); }
.ar-info { margin-top: 14px; }
.ar-steps { margin: 10px 0 0 18px; font-size: 0.88rem; display: grid; gap: 4px; }

/* ---------- options column ---------- */
.opts { margin-top: 18px; min-width: 0; }
.sec { padding: 20px var(--gutter); background: var(--surface); margin: 0 calc(-1 * var(--gutter)) 8px; }
.sec-h { display: flex; align-items: baseline; gap: 10px; margin-bottom: 14px; }
.sec-h .n { font: 600 12px/1 'Poppins', sans-serif; color: var(--text-3); font-variant-numeric: tabular-nums; width: 18px; flex: none; }
.sec-h h2 { font: 700 19px/1.1 'Barlow', sans-serif; letter-spacing: -0.01em; }
.sec-h .val { margin-left: auto; font-size: 13px; color: var(--text-2); }

.field-group { margin-bottom: 14px; border: 0; min-width: 0; }
.field-label { font-size: 12px; color: var(--text-2); display: block; margin-bottom: 5px; font-weight: 500; }
.field-input, .field-select { width: 100%; height: 42px; padding: 0 12px; border: 1px solid var(--line-strong); background: var(--surface); font: 400 15px 'Poppins', sans-serif; color: var(--text); outline: none; border-radius: 0; }
.field-input:focus, .field-select:focus { border-color: var(--text); }
.field { display: block; font-size: 12px; color: var(--text-2); }
.field input { display: block; width: 100%; margin-top: 5px; height: 42px; padding: 0 12px; border: 1px solid var(--line-strong); background: var(--surface); color: var(--text); font: 400 15px 'Poppins', sans-serif; border-radius: 0; }
.field input:focus { border-color: var(--text); outline: none; }
.pair { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.note { font-size: 12.5px; color: var(--text-3); line-height: 1.5; margin-top: 8px; }
.help { font-size: 13px; color: var(--text-2); margin-bottom: 12px; }
.warn { color: var(--unlikely); font-size: 13px; font-weight: 600; margin-top: 8px; }

/* 01 product: family tabs over a range list (the hidden #product select stays the source of truth) */
.fam { display: flex; gap: 4px; padding: 3px; background: var(--surface-2); margin-bottom: 10px; }
.fam button { flex: 1; min-height: 36px; border: 0; background: none; cursor: pointer; font: 500 12.5px 'Poppins', sans-serif; padding: 7px 6px; color: var(--text-2); white-space: nowrap; transition: background 0.2s var(--ease), color 0.2s var(--ease); }
.fam button:hover { color: var(--text); }
.fam button[aria-pressed="true"] { background: var(--surface); color: var(--text); box-shadow: 0 1px 2px rgba(15,15,13,0.08); }
.fam small { color: var(--text-3); font-weight: 400; font-size: 11.5px; margin-left: 4px; }
.ranges { list-style: none; display: grid; gap: 2px; }
.range { display: grid; grid-template-columns: 40px minmax(0, 1fr) auto; gap: 12px; align-items: center; width: 100%; min-height: 50px; text-align: left; padding: 5px 8px 5px 5px; border: 0; background: none; color: var(--text); font: inherit; cursor: pointer; transition: background 0.2s var(--ease); }
.range:hover { background: var(--surface-2); }
.range img { width: 40px; height: 40px; object-fit: contain; padding: 3px; background: var(--thumb); display: block; }
.range .nm { display: block; font-size: 13.5px; font-weight: 500; line-height: 1.2; }
.range .sub { display: block; font-size: 12px; color: var(--text-3); line-height: 1.3; }
.range .ct { font-size: 12px; color: var(--text-3); white-space: nowrap; }
.range[aria-pressed="true"] { background: var(--surface-2); box-shadow: inset 2px 0 0 var(--copper); }
.more { display: inline-flex; align-items: center; min-height: 40px; margin-top: 4px; padding: 4px 0; border: 0; background: none; color: var(--text); cursor: pointer; font: 500 13px 'Poppins', sans-serif; text-decoration: underline; text-decoration-color: var(--line-strong); text-underline-offset: 5px; }
.more:hover { text-decoration-color: var(--text); }

/* 02 finish: the per-finish transparent render, shown whole on the --thumb surface; name, LRV, contrast on this floor */
.fin-group { font-size: 12px; color: var(--text-2); font-weight: 500; margin: 14px 0 8px; }
.fin-group:first-child { margin-top: 0; }
.swatches { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px 8px; }
.swatch { display: block; background: none; border: 0; padding: 0; cursor: pointer; text-align: left; font: inherit; color: var(--text); min-width: 0; min-height: 44px; }
.swatch .sw { display: block; aspect-ratio: 1; background: var(--thumb); outline: 1px solid var(--line); outline-offset: -1px; transition: transform 0.18s var(--ease); }
.swatch .sw img { width: 100%; height: 100%; object-fit: contain; padding: 6%; display: block; }
.swatch:active .sw { transform: scale(0.97); }
.swatch[aria-pressed="true"] .sw { outline: 2px solid var(--ring); outline-offset: 3px; }
.swatch .sw-name { display: block; margin-top: 8px; font-size: 10.5px; font-weight: 500; line-height: 1.2; letter-spacing: -0.02em; min-height: 2.4em; overflow-wrap: break-word; hyphens: auto; -webkit-hyphens: auto; }
.swatch .sw-lrv { display: block; font-size: 11px; color: var(--text-3); overflow-wrap: anywhere; }
.swatch .sw-c { display: block; margin-top: 5px; padding-top: 5px; border-top: 1px solid var(--line); font-size: 11px; font-weight: 500; min-height: calc(1.55em + 6px); }
.sw-c:empty { border-top-color: transparent; }
.sw-c.ok, .rows .ok { color: var(--likely); } .sw-c.near, .rows .near { color: var(--close); } .sw-c.ind, .rows .ind { color: var(--indic); } .sw-c.no, .rows .no { color: var(--unlikely); }
.fins-note { font-size: 11.5px; color: var(--text-3); margin-top: 10px; }
.fins-note:empty { display: none; }
.spec { display: grid; grid-template-columns: repeat(3, 1fr); margin-top: 14px; border-top: 1px solid var(--line); }
.spec div { padding-top: 10px; min-width: 0; }
.spec dt { font-size: 11.5px; color: var(--text-3); }
.spec dd { font-size: 14px; font-weight: 500; margin-top: 1px; }

/* 03 floor pills: a texture square + the short name; same selected treatment as a finish */
.seg { display: flex; flex-wrap: wrap; gap: 6px; }
.seg button { border: 1px solid var(--line); background: var(--surface); color: var(--text-2); padding: 6px 12px; cursor: pointer; font: 400 12.5px 'Poppins', sans-serif; text-align: left; min-height: 44px; transition: border-color 0.2s var(--ease); }
.seg button:hover { border-color: var(--line-strong); }
.seg button small { display: block; color: var(--text-3); font-size: 11px; }
.seg button[aria-pressed="true"] { border-color: var(--ring); color: var(--text); box-shadow: inset 0 0 0 1px var(--ring); }
.seg .fl { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 12px 0 5px; }
.fl-sw { width: 30px; height: 30px; flex: none; overflow: hidden; display: grid; place-items: center; color: var(--text-2); }
.fl-sw img { width: 100%; height: 100%; object-fit: cover; display: block; }
.fl-sw svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linejoin: round; }
.seg .fl.photo { border-style: dashed; border-color: var(--line-strong); }
.seg .fl[aria-pressed="true"] { border-color: var(--line); box-shadow: none; outline: 2px solid var(--ring); outline-offset: 3px; }   /* as a picked finish */
.seg .fl[aria-pressed="true"]:focus-visible { outline-color: var(--amber); }
.preset-controls .field-group:last-child { margin-bottom: 0; }
.colour-pick { display: inline-flex; gap: 10px; align-items: center; margin-top: 10px; font-size: 13px; cursor: pointer; min-height: 44px; color: var(--text-2); }
.colour-pick input { width: 44px; height: 44px; border: 1px solid var(--line-strong); padding: 2px; background: var(--surface); cursor: pointer; }
.colour-pick.active span { font-weight: 600; color: var(--text); }

/* 05 contrast: floor LRV (the typical range as placeholder), figure, advice, meter, other finishes. Calm: never pass/fail colours for close or indicative */
.lrv-row { display: grid; grid-template-columns: minmax(0, 1fr) 96px; gap: 14px; align-items: center; }
.lrv-label { display: block; font-size: 13px; font-weight: 500; color: var(--text); }
#floor-lrv-note { font-size: 12.5px; color: var(--text-2); line-height: 1.4; margin-top: 2px; }
.lrv-row .field-input { text-align: right; font-size: 16px; }
.lrv-row .field-input::placeholder { color: var(--text-3); }
.result-val { font: 800 52px/0.9 'Barlow', sans-serif; letter-spacing: -0.03em; margin-top: 20px; }
.result-val sup { font-size: 24px; vertical-align: 18px; margin-left: 1px; }
.result-box { margin-top: 12px; padding: 12px 14px; border-left: 2px solid var(--close); background: var(--indic-bg); }
.result-box.pass { border-left-color: var(--likely); background: var(--likely-bg); }
.result-box.fail { border-left-color: var(--unlikely); background: var(--surface-2); }
.result-box.close { border-left-color: var(--close); }
.result-box.close[data-verdict="close"] { background: var(--close-bg); }
.result-label { font-size: 13.5px; font-weight: 500; color: var(--text); text-wrap: pretty; }
.result-box.pass .result-label { color: var(--likely); }
.result-box.fail .result-label { color: var(--unlikely); }
.result-box[data-verdict="close"] .result-label { color: var(--close); }
.result-note { font-size: 12.5px; color: var(--text-2); margin-top: 4px; text-wrap: pretty; }
.meter { position: relative; height: 34px; margin: 22px 0 4px; }
.meter i { position: absolute; top: 13px; height: 6px; }
.meter .track { left: 0; right: 0; background: var(--surface-2); }
.meter .zc { background: var(--close-bg); }
.meter .zl { background: var(--likely-bg); }
.meter .rb { background: var(--text); }
.meter .tick { top: 6px; width: 1px; height: 20px; background: var(--text); }
.meter .tl { position: absolute; top: -10px; font-size: 11px; color: var(--text-2); transform: translateX(-50%); white-space: nowrap; }
.scale { display: flex; justify-content: space-between; font-size: 11px; color: var(--text-3); }
.rows { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 6px 12px; font-size: 13px; color: var(--text-2); margin-top: 14px; }
.rows > b { color: var(--text); font-weight: 500; text-align: right; }
.rows .tag { font-size: 11.5px; align-self: center; min-width: 64px; }
.rows .alts-h { grid-column: 1 / -1; font: 500 12.5px 'Poppins', sans-serif; color: var(--text-2); border-top: 1px solid var(--line); padding-top: 12px; margin-top: 4px; }
.rows .alts-h:first-child { border-top: 0; padding-top: 0; margin-top: 0; }
.formula { font-size: 11.5px; color: var(--text-3); border-top: 1px solid var(--line); padding-top: 10px; margin-top: 10px; }
.privacy { margin-top: 16px; font-size: 12.5px; color: var(--text-2); border-left: 2px solid var(--copper); padding: 6px 10px; background: var(--surface); }
.chip-ov span { color: rgba(242,237,230,0.78); }

/* the action footer sticks to the viewport bottom while the options column is on screen, then settles at its end */
.act { position: sticky; bottom: 0; z-index: 5; display: grid; grid-template-columns: 1fr auto; gap: 8px; padding: 14px var(--gutter) 18px; margin: 0 calc(-1 * var(--gutter)); background: var(--surface); box-shadow: 0 -1px 0 var(--line), 0 -12px 24px -16px rgba(15,15,13,0.25); }
.act > * { grid-column: 2; }
.act > :first-child { grid-column: 1; }
.act-dl { width: 50px; padding: 0; }
.act-dl span { display: none; }
.act-dl:only-child { grid-column: 1 / -1; width: auto; }   /* standalone: no Add to schedule, so Download takes the row */
.act-dl:only-child span { display: inline; }
.act.is-empty { display: none; }   /* nothing to act on in this view (app.js syncLayout) */

/* ---------- next step + footer ---------- */
.cta-band { background: var(--band); color: var(--band-text); padding: 32px var(--gutter); display: grid; gap: 20px; }
.cta-h { font: 800 28px/1 'Barlow', sans-serif; letter-spacing: -0.02em; color: var(--white); }
.cta-h em { font-style: italic; color: var(--copper); }
.cta-band p { color: #b9b6ad; font-size: 14px; margin-top: 10px; max-width: 54ch; }
.cta-btns { display: grid; gap: 12px; align-content: center; }
.foot { background: var(--band); border-top: 1px solid rgba(255,255,255,0.07); padding: 20px var(--gutter) 28px; color: #8f8d85; font-size: 12px; line-height: 1.6; }
.foot p { max-width: 130ch; }
.foot-copy { margin-top: 10px; }

@media (min-width: 560px) {
  .dz-btns { grid-template-columns: 1fr 1fr; max-width: 440px; }
  .cta-btns { grid-template-columns: auto auto; justify-content: start; }
}
/* phone: the viewer full-bleed at 4:3 and not sticky (it would take half the screen) */
@media (max-width: 900px) {
  .viewer { width: auto; margin: 0 calc(-1 * var(--gutter)); box-shadow: none; }
  .ov-tl { top: 12px; left: 12px; } .ov-tr { top: 12px; right: 12px; } .ov-br { bottom: 12px; right: 12px; } .ov-bl { bottom: 12px; left: 12px; }
  .tabs [role="tab"] { padding: 7px 12px; font-size: 12.5px; }
  .chip-ov { height: 34px; padding: 0 12px; }
  .chip-ov span { display: none; }   /* phone: the figure and ring only; the full verdict is in its label and section 05 */
  .swatch .sw-name { font-size: 10px; }   /* "Champagne" fits a 5-across tile at 390 */
  .zoom button { height: 34px; }
}
@media (min-width: 901px) {
  :root { --nav-h: 72px; --gutter: 40px; }
  .nav-logo img { height: 32px; }
  .titlebar { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; padding-top: 26px; padding-bottom: 22px; }
  h1 { font-size: 36px; }
  .lede { font-size: 14px; }
  .privacy-pill { margin-top: 0; white-space: nowrap; }
  .bench { grid-template-columns: minmax(0, 1fr) var(--col); gap: 40px; }
  .viewcol { position: sticky; top: calc(var(--head-h) + 16px); }
  .viewcol.is-marking { position: static; }   /* photo marking runs below the stage (app.js syncLayout) */
  .opts { margin-top: 0; background: var(--surface); box-shadow: var(--shadow); }
  .sec { margin: 0; padding: 22px 24px 24px; border-bottom: 1px solid var(--line); }
  .act { margin: 0; padding: 14px 24px 18px; }
  .cta-band { grid-template-columns: 1fr auto; align-items: center; padding: 44px var(--gutter); }
  .cta-h { font-size: 32px; }
}
@media (max-width: 1240px) and (min-width: 901px) {
  :root { --col: 380px; }
}

/* Plan A visibility: holding line when nothing is signed off; preview flag (local/dev ?preview=1 only) */
.empty-state { padding: 64px var(--gutter); font-size: 1.05rem; color: var(--text-2); text-align: center; }
.preview-flag { margin: 0; padding: 8px var(--gutter); background: var(--amber); color: var(--ink); font-size: 0.8rem; font-weight: 700; letter-spacing: 0.08em; text-align: center; }
#plan-photo { margin: 4px 0 14px; }
#plan-mark-work { margin-top: 14px; }

/* Schedule (Plan F3): cards = the export's rows (text from /visualiser/schedule/rows), grouped under the
   PDF's group rows, with the PDF's column heads as an ink bar. Reuses .field-input/.btn-ghost/.warn/.note.
   Tokens are Direction A's (site.css after the F5 sync), with the r3 light values as fallbacks. */
.schedule-block { margin-top: 18px; padding: 18px var(--gutter) 32px; border-top: 1px solid var(--line); }   /* F5: full-width below .bench, so it takes the page gutter */
.schedule-title { font-size: 1.1rem; margin-bottom: 8px; }
.schedule-list { margin-top: 12px; container-type: inline-size; }   /* the cards stack by the list's width, not the viewport's */
.schedule-list ul { list-style: none; }
.schedule-item { padding: 10px 0; border-bottom: 1px solid var(--line); }
.schedule-item .schedule-code { padding: 6px 8px; min-height: 40px; width: 100%; font-weight: 700; }
.schedule-item .schedule-location { padding: 6px 8px; min-height: 40px; width: 100%; }
.schedule-flag { font-size: 0.78rem; }
/* before the server's rows arrive (or if it refused them): the plain row */
.schedule-item--plain { display: flex; flex-wrap: wrap; gap: 8px 10px; align-items: center; }
.schedule-item--plain .schedule-code { flex: 0 0 92px; width: auto; }
.schedule-item--plain .schedule-desc { flex: 1 1 160px; font-size: 0.85rem; font-weight: 600; }
.schedule-item--plain .schedule-location { flex: 1 1 220px; width: auto; }
.schedule-item--plain .schedule-flag { flex: 1 1 100%; }
/* the cards: one grid for the head bar and every row, so the columns line up as in the PDF */
.sc-head, .sc-card { display: grid; grid-template-columns: 92px minmax(90px, 0.8fr) minmax(140px, 1.2fr) minmax(180px, 1.7fr) minmax(160px, 1.4fr) 132px 72px; gap: 0 12px; }
.sc-head { background: var(--band, #0f0f0d); color: var(--band-text, #e9e6df); font-size: 0.66rem; font-weight: 700; letter-spacing: 0.06em; padding: 7px 10px; }
.sc-head span:last-child { grid-column: span 2; }   /* IMAGE heads the image + remove cells */
.sc-group-title { background: var(--group-bg, #efe9df); color: var(--text, #0f0f0d); font-size: 0.72rem; font-weight: 700; letter-spacing: 0.04em; padding: 6px 10px; margin: 0; }
.sc-card { padding: 10px; align-items: start; font-size: 0.8rem; line-height: 1.4; }
.sc-item { font-weight: 600; }
.sc-line { margin-top: 3px; }
.sc-loc .sc-line { color: var(--text-2, #5a5a55); }
.sc-k { color: var(--text-2, #5a5a55); }
.sc-b { font-weight: 700; }
.sc-img img { display: block; width: 100%; height: auto; background: var(--thumb, #ebe7e0); }
/* code + location read as text with a dashed underline; they become fields on hover / focus (r3) */
.sc-card .schedule-code, .sc-card .schedule-location { border: 0; border-bottom: 1px dashed var(--line-strong, rgba(15,15,13,0.25)); background: transparent; padding: 4px 2px; min-height: 36px; font: inherit; color: inherit; }
.sc-card .schedule-code { font-family: 'Barlow', sans-serif; font-weight: 800; font-size: 1.05rem; }
.sc-card .schedule-code:hover, .sc-card .schedule-code:focus, .sc-card .schedule-location:hover, .sc-card .schedule-location:focus { background: var(--surface, #fff); border-bottom-style: solid; }
.schedule-remove { min-height: 44px; min-width: 44px; padding: 6px 10px; font-size: 1.2rem; line-height: 1; justify-self: end; }
.schedule-item--plain .schedule-remove { font-size: 1.2rem; }
.sc-guide { grid-column: 2 / -1; margin-top: 8px; padding: 5px 8px; font-size: 0.76rem; border-left: 3px solid currentColor; }
.sc-guide .sc-k { color: inherit; font-weight: 700; }
.sc-likely { color: var(--likely, #2f6b48); background: var(--likely-bg, #dce9df); }
.sc-close { color: var(--close, #8a5a12); background: var(--close-bg, #f5ead6); }
.sc-indicative, .sc-none, .sc-unknown { color: var(--indic, #5a5a55); background: var(--indic-bg, #ece7df); }
.sc-unlikely { color: var(--unlikely, #a3452f); background: var(--indic-bg, #ece7df); }
@container (max-width: 940px) {   /* phone and narrow columns: code + item on one line, then location, selection, notes, a 120 px image */
  .sc-head { display: none; }
  .sc-card { grid-template-columns: 92px 1fr; gap: 8px 12px; }
  .sc-loc, .sc-sel, .sc-notes, .sc-guide { grid-column: 1 / -1; }
  .sc-img { grid-column: 1 / 2; width: 120px; }
  .sc-item { align-self: center; }
  .schedule-remove { min-height: 44px; justify-self: end; align-self: start; }
}
/* "Preview schedule": the real PDF in a dialog; the only element that scrolls inside a box */
.preview { width: min(1400px, calc(100vw - 32px)); height: calc(100dvh - 32px); max-width: none; max-height: none; margin: auto; padding: 0; border: 0; background: var(--surface, #fff); color: var(--text, #0f0f0d); }
.preview::backdrop { background: var(--overlay, rgba(15,15,13,0.72)); }
.preview[open] { display: flex; flex-direction: column; }
.preview-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; padding: 10px 14px; border-bottom: 1px solid var(--line); }
.preview-title { font-size: 1rem; margin: 0; margin-right: auto; }
.preview-bar .btn-ghost { min-height: 44px; padding: 8px 14px; text-decoration: none; display: inline-flex; align-items: center; }
#preview-close { font-size: 1.3rem; min-width: 44px; justify-content: center; }
.preview-frame { flex: 1 1 auto; width: 100%; border: 0; background: var(--stage, #26261f); }
.preview[data-mode="open"] { height: auto; }   /* no frame: just the bar and the note */
.preview-noinline { padding: 16px 14px 20px; }
.preview-bar .calc-btn { width: auto; margin-top: 0; min-height: 44px; padding: 8px 16px; text-decoration: none; display: inline-flex; align-items: center; }

/* Export (task-5): Download + Email it to me. Reuses .calc-btn/.btn-ghost/.field-*/.warn/.note/.privacy.
   .check is korb.au's own now (the source dropped it with the photo panel). */
.export-block { margin-top: 16px; }
.export-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: stretch; }
.export-actions .calc-btn { flex: 1 1 180px; width: auto; margin-top: 0; }
.export-actions .btn-ghost { flex: 1 1 180px; min-height: 48px; }
.export-form { margin-top: 14px; display: grid; gap: 10px; }
.export-fields { display: grid; gap: 4px 0; }
.export-fields .field-label { margin: 8px 0 4px; }
.export-form .calc-btn { margin-top: 4px; }
.export-details { margin: 0 0 14px; border: 0; padding: 0; }
.export-details .export-fields { grid-template-columns: 1fr 1fr; gap: 0 12px; }
/* F3: project details sit above the cards as one compact panel (6 across where the column is wide) */
#schedule-details { background: var(--surface, #fff); padding: 12px 14px; box-shadow: var(--shadow, 0 1px 2px rgba(40,30,15,0.05)); min-width: 0; }
#schedule-details .export-fields { grid-template-columns: repeat(auto-fit, minmax(min(100%, 150px), 1fr)); }
@media (max-width: 480px) { .export-details .export-fields { grid-template-columns: 1fr; } }
.check { display: inline-flex; gap: 8px; align-items: center; font-size: 0.85rem; min-height: 40px; cursor: pointer; }
.check input { width: 20px; height: 20px; accent-color: var(--orange); }

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
