:root{
  /* GLASS variant tokens — mirrors src/styles/global.css of this tree:
     black & white with turquoise. Bright #2BD98F is non-text accents
     only; deep #0B7A5C carries text, links and accent marks (AA on
     white); the main CTA is a black pill with white text. */
  --brand:#2BD98F;
  --brand-dark:#0B7A5C;
  --brand-darker:#065F46;
  --ink:#161618;
  --muted:#52525b;
  --bg:#ffffff;
  --card:rgba(255,255,255,.72);
  --glass-strong:rgba(255,255,255,.85);
  --line:rgba(11,11,12,.1);
  --glass-border:rgba(15,23,24,.09);
  --shadow-card:inset 0 1px 0 rgba(255,255,255,.55),0 1px 2px rgba(15,23,22,.05),0 14px 34px rgba(15,23,22,.1);
  --shadow-btn:0 8px 20px rgba(15,23,22,.18);
  --warn-bg:rgba(255,255,255,.72);
  --warn-line:rgba(11,11,12,.14);
  --radius:24px;
}
*{box-sizing:border-box}
html{-webkit-text-size-adjust:100%}
body{
  margin:0;font-family:-apple-system,BlinkMacSystemFont,"SF Pro Text","SF Pro Display",Inter,"Segoe UI",Roboto,Helvetica,Arial,sans-serif;
  background:var(--bg);color:var(--ink);line-height:1.55;
  -webkit-font-smoothing:antialiased;
}
/* The same barely-there cold turquoise glow as the site backdrop. */
body::before{
  content:"";position:fixed;inset:0;z-index:-1;pointer-events:none;
  background:
    radial-gradient(1100px 620px at 10% -8%, rgba(43,217,143,.13), rgba(43,217,143,0) 60%),
    radial-gradient(900px 700px at 106% 10%, rgba(94,234,212,.1), rgba(94,234,212,0) 62%),
    radial-gradient(1000px 820px at 50% 116%, rgba(43,217,143,.07), rgba(43,217,143,0) 65%),
    #ffffff;
}
.wrap{max-width:680px;margin:0 auto;padding:20px 16px 48px}
header.site{display:flex;align-items:center;gap:10px;padding:6px 0 14px}
.logo{width:38px;height:38px;border-radius:12px;background:var(--ink);display:flex;align-items:center;justify-content:center;color:#fff;font-weight:700;font-size:18px;flex:0 0 auto}
header.site .name{font-weight:700;font-size:17px}
header.site .place{color:var(--muted);font-size:13px}
.topnav{display:flex;gap:18px;padding:0 0 10px}
.topnav a{color:var(--brand-dark);font-weight:600;font-size:15px;text-decoration:none}
.topnav a:active{text-decoration:underline}
h1{font-size:28px;line-height:1.12;margin:8px 0 10px;font-weight:800;letter-spacing:-.02em}
h2{font-size:21px;margin:0 0 8px;font-weight:800;letter-spacing:-.015em}
p{margin:0 0 12px}
.lede{color:var(--muted);font-size:17px}
.card{background:var(--card);border:1px solid var(--glass-border);border-radius:var(--radius);padding:20px 18px;margin:16px 0;box-shadow:var(--shadow-card);-webkit-backdrop-filter:blur(20px) saturate(140%);backdrop-filter:blur(20px) saturate(140%)}
.step-tag{display:inline-block;background:var(--brand);color:#0b0b0c;font-size:12px;font-weight:700;letter-spacing:.04em;text-transform:uppercase;border-radius:999px;padding:3px 10px;margin-bottom:10px}
.btn{
  display:block;width:100%;text-align:center;border:1px solid rgba(11,11,12,.12);border-radius:999px;cursor:pointer;
  background:var(--ink);color:#fff;font-size:17px;font-weight:700;padding:15px 18px;margin:12px 0;
  text-decoration:none;box-shadow:var(--shadow-btn);
  transition:background .15s ease,color .15s ease,border-color .15s ease;
}
.btn:hover{background:var(--brand-dark);border-color:transparent;color:#fff}
.btn:active{transform:translateY(1px)}
.btn.secondary{background:var(--glass-strong);color:var(--ink);border:1px solid var(--glass-border);box-shadow:var(--shadow-card)}
.btn.secondary:hover{background:var(--brand);color:#0b0b0c;border-color:transparent}
.btn:disabled{opacity:.55;cursor:not-allowed}
.btn.small{font-size:15px;padding:12px 14px}
.tips{background:var(--warn-bg);border:1px solid var(--warn-line);border-radius:18px;padding:12px 14px;font-size:14px}
.tips ul{margin:6px 0 0;padding-left:18px}
.tips li{margin:3px 0}
.tips.warn{margin-top:14px}
.privacy{display:flex;gap:8px;align-items:flex-start;background:rgba(43,217,143,.09);border:1px solid rgba(11,122,92,.28);border-radius:18px;padding:12px 14px;font-size:14px;color:var(--ink)}
.consent{display:flex;gap:10px;align-items:flex-start;margin:16px 0 4px;font-size:15px;cursor:pointer}
.consent input{width:22px;height:22px;flex:0 0 auto;margin-top:2px;accent-color:var(--brand-dark)}
.hint{color:var(--muted);font-size:14px}
.mode-tabs{display:flex;gap:8px;margin:16px 0 4px}
.tab{flex:1;display:inline-flex;align-items:center;justify-content:center;gap:7px;border:1px solid var(--glass-border);background:var(--glass-strong);color:var(--ink);border-radius:999px;padding:12px 8px;font-size:15px;font-weight:600;cursor:pointer;box-shadow:var(--shadow-card)}
.tab svg{flex:0 0 auto}
.tab.active{background:var(--ink);border-color:var(--ink);color:#fff}
/* HARD clothing warning (owner, 2026-11-05): a filled, high-
 * contrast amber block — deliberately NOT the glass palette, so
 * it reads as must-read at a glance. It sits directly above the
 * "Open the camera" button, again on the intro step, and (as
 * .cam-clothes-warning) inside the camera overlay above the
 * shutter. A loose-clothing run produced bad points tonight;
 * the old one-bullet-among-many line was being missed. */
.clothes-warning{background:#FBBF24;color:#161618;border:1.5px solid #92400E;border-radius:16px;padding:12px 14px;font-size:15.5px;font-weight:700;line-height:1.4;box-shadow:0 6px 18px rgba(146,64,14,.25);margin:14px 0 2px}
.cam-clothes-warning{position:absolute;left:50%;transform:translateX(-50%);bottom:calc(106px + env(safe-area-inset-bottom,0px));z-index:3;width:max-content;max-width:88%;text-align:center;background:#FBBF24;color:#161618;border:1.5px solid #92400E;border-radius:14px;padding:9px 12px;font-size:13.5px;font-weight:700;line-height:1.35;box-shadow:0 6px 18px rgba(0,0,0,.35)}
/* Fullscreen camera (owner spec 2026-11-05): the camera lives ONLY
 * in this fixed overlay — inset 0 at 100dvh, which on iPhone (no
 * element fullscreen in Safari) is the whole visible screen; the
 * Fullscreen API is layered on top where it exists. The stage fills
 * the overlay edge to edge. */
#camera-overlay{position:fixed;inset:0;height:100dvh;z-index:80;background:#000}
body.cam-open{overflow:hidden}
/* In-overlay camera failure card (P6): the message and the upload
 * escape live ON the stage, above the video — the failure can never
 * again hide behind the overlay as a silent black screen. */
.cam-error{position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);z-index:6;width:max-content;max-width:88%;background:rgba(14,16,15,.94);color:#fff;border:1px solid rgba(255,255,255,.28);border-radius:18px;padding:20px 18px;text-align:center;line-height:1.45;box-shadow:0 12px 34px rgba(0,0,0,.5)}
.cam-error p{margin:0 0 14px;font-size:15.5px}
.cam-error-actions{display:flex;flex-direction:column;gap:8px}
.cam-error .btn{width:100%}
.camera-stage{position:absolute;inset:0;overflow:hidden;background:#101012;line-height:0}
/* pointer-events:none — iOS eats scroll gestures that start on a
 * <video>; the stream needs no interaction, so let touches fall
 * through to the page and scroll normally. */
.camera-stage video{width:100%;height:100%;object-fit:cover;display:block;transform:scaleX(-1);pointer-events:none}
.camera-stage video.rear{transform:none}
.camera-stage .outline{position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);height:92%;opacity:.85;pointer-events:none;display:none}
.camera-stage[data-view="front"] .outline-front{display:block}
.camera-stage[data-view="side"] .outline-side{display:block}
.camera-stage[data-view="back"] .outline-back{display:block}
.camera-stage .outline ellipse,.camera-stage .outline path{stroke:#fff;stroke-width:2.2;stroke-dasharray:5 4;fill:none;stroke-linecap:round}
.countdown{position:absolute;inset:0;display:flex;align-items:center;justify-content:center;font-size:110px;font-weight:800;color:#fff;text-shadow:0 2px 18px rgba(0,0,0,.55);background:rgba(11,11,12,.25);line-height:1;z-index:4;pointer-events:none}
.countdown[hidden]{display:none}
/* iPhone-camera style controls: shutter = white ring + white disc;
 * flip = translucent dark circle with a white glyph. */
.shutter{position:absolute;left:50%;bottom:calc(18px + env(safe-area-inset-bottom,0px));transform:translateX(-50%);width:74px;height:74px;border-radius:50%;border:4px solid #fff;background:transparent;cursor:pointer;padding:0;line-height:1;z-index:3;display:flex;align-items:center;justify-content:center;-webkit-tap-highlight-color:transparent}
.shutter::after{content:"";position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);width:58px;height:58px;border-radius:50%;background:#fff;transition:transform .08s ease}
.shutter:active::after{transform:translate(-50%,-50%) scale(.9)}
.shutter.shooting::after{transform:translate(-50%,-50%) scale(.82);background:#e9e9e9}
.shutter:disabled{opacity:.55;cursor:not-allowed}
.shutter.timer-armed::after{content:"10s";display:flex;align-items:center;justify-content:center;font-size:16px;font-weight:800;color:#161618}
.shutter.counting{background:rgba(11,11,12,.55);color:#fff;font-size:30px;font-weight:800}
.shutter.counting::after{display:none}
.flipcam{position:absolute;right:18px;bottom:calc(31px + env(safe-area-inset-bottom,0px));width:48px;height:48px;border-radius:50%;border:none;background:rgba(30,30,30,.38);backdrop-filter:blur(6px);-webkit-backdrop-filter:blur(6px);display:flex;align-items:center;justify-content:center;cursor:pointer;padding:0;z-index:3;-webkit-tap-highlight-color:transparent}
.flipcam:active{background:rgba(30,30,30,.55)}
.flipcam:disabled{opacity:.5;cursor:not-allowed}
.cam-exit{position:absolute;left:16px;top:calc(14px + env(safe-area-inset-top,0px));width:48px;height:48px;border-radius:50%;border:none;background:rgba(30,30,30,.38);backdrop-filter:blur(6px);-webkit-backdrop-filter:blur(6px);display:flex;align-items:center;justify-content:center;cursor:pointer;padding:0;z-index:3;-webkit-tap-highlight-color:transparent}
.cam-exit:active{background:rgba(30,30,30,.55)}
.file-row{margin:14px 0}
input[type=file]{width:100%;font-size:15px;padding:12px;border:2px dashed var(--brand-dark);border-radius:18px;background:var(--glass-strong)}
.lead-row{display:flex;gap:10px;flex-wrap:wrap;margin:14px 0 6px}
.lead-row input[type=email]{flex:1 1 230px;font:inherit;font-size:16px;padding:14px 18px;border:1px solid var(--glass-border);border-radius:999px;background:var(--glass-strong);color:var(--ink)}
.lead-row .btn{flex:0 1 auto;width:auto;margin:0;padding:14px 22px}
.lead-success{background:#e9f9f1;border:1px solid #b5e6cd;color:#065f46;border-radius:18px;padding:14px;font-size:15px;margin:12px 0}
.loading{display:none;align-items:center;gap:12px;padding:14px 4px;color:var(--muted);font-size:15px}
.loading.on{display:flex}
.spinner{width:26px;height:26px;flex:0 0 auto;border-radius:50%;border:3px solid var(--line);border-top-color:var(--brand-dark);animation:spin 0.9s linear infinite}
@keyframes spin{to{transform:rotate(360deg)}}
/* The point-correction instruction must be unmissable (owner,
 * 2026-11-03): a tinted panel with a per-point placement list. */
.point-guide{background:rgba(43,217,143,.09);border:1px solid rgba(11,122,92,.32);border-radius:18px;padding:12px 14px;margin:12px 0}
.point-guide h3{margin:0 0 6px;font-size:17px}
.point-guide p{margin:0}
.point-guide ul{margin:8px 0 2px;padding-left:19px}
.point-guide li{margin:3px 0}
/* Immersive edit mode (owner idea, 2026-11-03): the review photo
 * expands to fill the whole screen (in-page — iOS has no element
 * fullscreen on iPhone), with the correction instruction ON the photo
 * and a Done button to come back. */
body.immersive{overflow:hidden}
/* ROOT-CAUSE FIX (2026-11-05, focus-zoom + Done bugs): a
 * backdrop-filter on an ancestor makes that ancestor the
 * containing block for fixed-position descendants. The glass
 * restyle put backdrop-filter on .card, so the "full-screen"
 * immersive wrap below was laid out over the CARD instead of the
 * screen — the level-check focus centred a full card-height away
 * from its landmark pair (it landed on the legs) and the Done bar
 * sat off-screen. While immersive, the overlay covers the cards
 * anyway, so their blur can go: with no filter on any ancestor,
 * fixed means the viewport again. */
body.immersive .card{-webkit-backdrop-filter:none;backdrop-filter:none}
.canvas-wrap.immersive{position:fixed;inset:0;z-index:60;margin:0;border-radius:0;background:#101310;display:flex;align-items:center;justify-content:center}
.canvas-wrap.immersive canvas{width:auto;height:auto;max-width:100vw;max-height:100dvh}
.canvas-wrap.immersive .legend{display:none}
/* The Done bar is position:fixed in its own right (2026-11-05):
 * pinned to the visual viewport's top with the safe-area inset,
 * floating above the photo at ANY zoom/pan — it can no longer be
 * scrolled, panned or zoomed away with the content. */
.immersive-bar{position:fixed;top:calc(env(safe-area-inset-top, 0px) + 10px);left:10px;right:10px;z-index:90;display:flex;gap:10px;align-items:center;justify-content:space-between;padding:12px 14px;border-radius:16px;background:rgba(16,19,16,.88);box-shadow:0 8px 24px rgba(0,0,0,.35);color:#fff;font-size:14.5px;line-height:1.35}
.immersive-bar[hidden]{display:none}
.immersive-done{flex:none;background:transparent;color:#fff;border:1.5px solid #fff;border-radius:999px;padding:7px 16px;font-size:14.5px;font-weight:700;cursor:pointer}
.canvas-wrap{display:none;position:relative;margin:14px 0;overflow:hidden;border-radius:20px}
/* Round full-screen button ON the photo (owner, 2026-11-03: the wide
 * button above the photo was too easy to miss; this mirrors the
 * camera-screen controls). Hidden while that photo is immersive. */
.expand-btn{position:absolute;right:14px;bottom:14px;z-index:4;width:50px;height:50px;border-radius:50%;border:none;background:rgba(25,28,25,.52);backdrop-filter:blur(6px);-webkit-backdrop-filter:blur(6px);display:flex;align-items:center;justify-content:center;cursor:pointer;padding:0}
.canvas-wrap.immersive .expand-btn{display:none}
.canvas-wrap.on{display:block}
.legend{position:relative;z-index:2;background:var(--card,#fff)}
canvas{width:100%;height:auto;border-radius:20px;display:block;background:#ddd;-webkit-user-select:none;user-select:none;-webkit-touch-callout:none;transform-origin:0 0}
/* While measuring, a long press must never trigger iOS text
 * selection / the system magnifier — the app has its own loupe. */
#screen-front,#screen-review,#screen-side{-webkit-user-select:none;user-select:none;-webkit-touch-callout:none}
canvas.draggable{touch-action:none;cursor:grab}
canvas.draggable:active{cursor:grabbing}
.legend{display:flex;flex-wrap:wrap;gap:6px 14px;font-size:13px;color:var(--muted);margin-top:8px}
.legend span::before{content:"";display:inline-block;width:14px;height:4px;border-radius:2px;margin-right:6px;vertical-align:middle;background:var(--c,#999)}
.error{display:none;background:#fdeeee;border:1px solid #f2c1c1;color:#7a2a2a;border-radius:18px;padding:14px;font-size:15px;margin:12px 0}
.error.on{display:block}
.guidance{background:#fdeeee;border:1px solid #f2c1c1;border-radius:18px;padding:14px;font-size:15px;margin:12px 0;color:#5f2323}
.guidance h3{margin:0 0 8px;font-size:16px}
.guidance ul{margin:0;padding-left:18px}
.guidance li{margin:5px 0}
.live-metrics{display:flex;flex-wrap:wrap;gap:8px;margin:10px 0}
.live-metrics .metric{background:var(--glass-strong);border:1px solid var(--line);border-radius:999px;padding:6px 12px;font-size:14px}
.findings{list-style:none;margin:0 0 6px;padding:0}
.findings li{padding:10px 12px;border:1px solid var(--line);border-radius:16px;margin:0 0 8px;background:var(--glass-strong);font-size:15px}
.findings li b{color:var(--brand-dark)}
.chip{display:inline-block;font-size:12px;font-weight:700;border-radius:999px;padding:2px 9px;margin-left:8px;vertical-align:middle}
.chip.high{background:rgba(43,217,143,.28);color:var(--brand-darker)}
.chip.moderate{background:#fdf0d3;color:#7a5b12}
.chip.low{background:#f6dede;color:#7a2a2a}
.disclaimer{font-size:13px;color:var(--muted);border-top:1px solid var(--line);padding-top:12px;margin-top:16px}
footer.site{color:var(--muted);font-size:13px;text-align:center;padding:18px 0 4px}
[hidden]{display:none !important}

/* Guided level-confirm checklist (build .23) */
.checklist{margin-top:16px;padding:14px 16px;border:1px solid rgba(11,122,92,.32);border-radius:18px;background:rgba(43,217,143,.08)}
.checklist h3{margin:0 0 6px;font-size:17px}
.checklist p{margin:0;font-size:14.5px;line-height:1.45}
.check-row{display:flex;align-items:center;gap:10px;margin-top:12px}
.check-name{font-weight:700;flex:1}
.check-status{font-size:13.5px;opacity:.7}
.check-status.done{color:var(--brand-dark);opacity:1;font-weight:700}
.checklist .hint{margin-top:10px}
.btn[disabled]{opacity:.45;pointer-events:none}
/* ===== GLASS variant restyle (2026-11-05) ===============================
 * The same client in this tree's glass language — the tokens and
 * surfaces above already carry it (frosted white cards over the white
 * glow backdrop, 18-24px radii, hairline edges, soft layered shadows,
 * black pill buttons, deep-turquoise text accents, system font stack).
 * What remains here is the type bump carried over from the previous
 * restyle. Functional geometry (camera stage, shutter, canvas) is
 * untouched; camera controls stay round by design. */
body{font-size:17px}
.step-tag{font-size:14px}
.tips,.privacy,.hint{font-size:15px}
.chip{font-size:13px}
header.site .place{font-size:14.5px}
.legend{font-size:14.5px}
.disclaimer{font-size:14.5px}
footer.site{font-size:14.5px}

/* Measurement progress bar (2026-11-05): the wait shows an honest,
 * stage-anchored bar + % under the stage caption — see setProgress
 * in app.js. The spinner stays as the secondary "still working"
 * cue. Deep-turquoise accent #0B7A5C. */
.loading-main{flex:1 1 auto;min-width:0;display:flex;flex-direction:column;gap:6px}
.pt-progress{height:6px;border-radius:3px;background:rgba(11,11,12,.08);overflow:hidden}
.pt-progress-fill{height:100%;width:0;background:var(--brand-dark);border-radius:3px;transition:width .45s ease}
.pt-progress-pct{flex:0 0 auto;min-width:38px;text-align:right;font-size:14px;color:var(--muted);font-variant-numeric:tabular-nums}

/* Immersive flex fix (2026-11-05): .canvas-wrap.on{display:block}
 * sits later in this file than .canvas-wrap.immersive{display:flex}
 * at equal specificity, so the wrap computed to block and the
 * canvas was never centred in the immersive screen — part of the
 * level-check focus bug. Restated last so it wins. */
.canvas-wrap.immersive{display:flex}

/* ===== GLASS APP SHELL (2026-11-06, variant A re-skin) ================
 * The flow becomes a full-screen app: phone-width column, a sticky
 * glass app bar with the step segments on top, and each screen's
 * primary action fixed to the bottom of the viewport (the mock's
 * action bar). Presentation only — every element id, class and DOM
 * position app.js relies on is unchanged.
 *
 * Two load-bearing details:
 * 1) .card loses its backdrop-filter here. A backdrop-filter on an
 *    ancestor makes that ancestor the containing block for fixed
 *    descendants (the same trap documented above for the immersive
 *    wrap): with the blur on, the "fixed" primary would anchor to
 *    its card instead of the viewport. The cards sit over a
 *    near-white glow, so the blur was barely visible anyway; the
 *    fill steps up to --glass-strong to compensate.
 * 2) The fixed primaries sit at z-index 45 — above the app bar,
 *    below the immersive wrap (60), the camera overlay (80) and
 *    the immersive Done bar (90), so full-screen modes cover them. */
.wrap{max-width:430px;padding:6px 16px calc(112px + env(safe-area-inset-bottom,0px))}
.card{-webkit-backdrop-filter:none;backdrop-filter:none;background:var(--glass-strong)}
h1{font-size:30px}
.apphead{position:sticky;top:0;z-index:40;margin:0 -16px;padding:calc(8px + env(safe-area-inset-top,0px)) 16px 0;background:rgba(255,255,255,.78);-webkit-backdrop-filter:blur(20px) saturate(150%);backdrop-filter:blur(20px) saturate(150%);border-bottom:1px solid var(--glass-border)}
.appbar{display:flex;align-items:center;gap:10px;padding:2px 0 8px}
.appbar-back{width:38px;height:38px;border-radius:50%;border:1px solid var(--glass-border);background:rgba(255,255,255,.88);color:var(--ink);display:grid;place-items:center;flex:0 0 auto;box-shadow:var(--shadow-card);text-decoration:none}
.appbar-back:active{background:var(--brand)}
.appbar-t{flex:1;min-width:0}
.appbar-t b{display:block;font-size:17px;letter-spacing:-.01em;line-height:1.2;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.appbar-t span{display:block;font-size:12.5px;color:var(--muted);line-height:1.25}
.brand-dot{width:38px;height:38px;border-radius:13px;background:var(--ink);color:#fff;display:grid;place-items:center;font-weight:800;font-size:19px;flex:0 0 auto}
.app-steps{display:flex;gap:5px;padding:0 0 10px}
.app-steps i{flex:1;height:4.5px;border-radius:99px;background:rgba(120,130,125,.25);position:relative;overflow:hidden}
.app-steps i.done::after,.app-steps i.now::after{content:"";position:absolute;inset:0;background:var(--brand-dark);border-radius:99px}
.app-steps i.now::after{opacity:.55}
/* The screens' primary actions, pinned to the viewport bottom.
 * The DOM (and therefore app.js behaviour) is untouched: these are
 * the same buttons, lifted out of the flow visually. Disabled
 * buttons already carry pointer-events:none (rule above), so a
 * not-yet-unlocked Continue never blocks the content under it.
 * Intro exception (owner, 2026-11-06): #btn-start is NOT pinned —
 * it stays in the card flow right after the consent checkbox,
 * where the removed "Book an assessment instead" link used to sit
 * (no booking CTA belongs on the Start screen: no test taken yet,
 * and the floating button detached from the card collided with
 * the browser toolbar on the owner's phone). */
#btn-to-side,#btn-side-results,#screen-results a.btn:not(.secondary){
  position:fixed;left:50%;transform:translateX(-50%);
  bottom:calc(12px + env(safe-area-inset-bottom,0px));
  width:min(398px,calc(100vw - 32px));margin:0;z-index:45;
}
#btn-to-side:active,#btn-side-results:active,#screen-results a.btn:not(.secondary):active{transform:translateX(-50%)}
/* Keep tap targets clear of the pinned action when the browser
 * scrolls them into view. */
.card button,.card a.btn,.card input,.card .check-row{scroll-margin-bottom:118px}
