/* Posture self-test — APP-LOOK mock. Shared layout for three themes:
   body.glass (site glass language) / body.hybrid (glass + dark device
   screens) / body.dark (Form Check-style dark). The shell state class
   .on-device is set by JS on capture/points screens for hybrid. */

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", Inter, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

/* ---------- themes ---------- */
body.glass, body.hybrid {
  --bg: #ffffff;
  --ink: #161618;
  --muted: #52525b;
  --accent: #2BD98F;
  --accent-deep: #0B7A5C;
  --accent-ink: #0b0b0c;
  --glass: rgba(255,255,255,.66);
  --glass-strong: rgba(255,255,255,.88);
  --glass-lite: rgba(255,255,255,.72);
  --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,.10);
  --shadow-pop: inset 0 1px 0 rgba(255,255,255,.6), 0 2px 6px rgba(15,23,22,.07), 0 22px 46px rgba(15,23,22,.15);
  --btn-bg: #0b0b0c; --btn-ink: #ffffff;
  --chip-bg: rgba(43,217,143,.16); --chip-ink: #065F46;
  --frame-bg: linear-gradient(180deg,#eef4f2 0%,#dde8e4 55%,#cfddd8 100%);
  --frame-line: rgba(11,11,12,.28);
  --warn-bg: rgba(255,159,10,.14); --warn-ink: #8a5a00; --warn-edge: rgba(255,159,10,.45);
  background: #fff; color: var(--ink);
}
body.glass::before, body.hybrid::before {
  content: ""; position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background:
    radial-gradient(700px 420px at 8% -6%, rgba(43,217,143,.14), rgba(43,217,143,0) 60%),
    radial-gradient(620px 480px at 108% 8%, rgba(94,234,212,.10), rgba(94,234,212,0) 62%),
    radial-gradient(760px 560px at 50% 118%, rgba(43,217,143,.07), rgba(43,217,143,0) 65%);
}
body.dark {
  --bg: #101014;
  --ink: #f2f2f7;
  --muted: #a1a1aa;
  --accent: #d9ff3d;
  --accent-deep: #d9ff3d;
  --accent-ink: #101014;
  --glass: rgba(28,28,30,.72);
  --glass-strong: rgba(28,28,30,.92);
  --glass-lite: rgba(28,28,30,.66);
  --border: rgba(255,255,255,.10);
  --shadow-card: inset 0 1px 0 rgba(255,255,255,.06), 0 14px 34px rgba(0,0,0,.45);
  --shadow-pop: inset 0 1px 0 rgba(255,255,255,.07), 0 22px 46px rgba(0,0,0,.55);
  --btn-bg: #d9ff3d; --btn-ink: #101014;
  --chip-bg: rgba(217,255,61,.14); --chip-ink: #d9ff3d;
  --frame-bg: linear-gradient(180deg,#26262b 0%,#1a1a1f 55%,#121216 100%);
  --frame-line: rgba(255,255,255,.35);
  --warn-bg: rgba(255,159,10,.16); --warn-ink: #ffb340; --warn-edge: rgba(255,159,10,.5);
  background: #101014; color: var(--ink);
}
/* Hybrid device mode: capture + points go near-black (native camera feel) */
body.hybrid .shell.on-device {
  --ink: #f2f2f7; --muted: #a1a1aa;
  --glass: rgba(28,28,30,.72); --glass-strong: rgba(20,20,24,.92); --glass-lite: rgba(28,28,30,.66);
  --border: rgba(255,255,255,.12);
  --shadow-card: inset 0 1px 0 rgba(255,255,255,.06), 0 14px 34px rgba(0,0,0,.5);
  --frame-bg: linear-gradient(180deg,#26262b 0%,#17171c 55%,#0c0c10 100%);
  --frame-line: rgba(255,255,255,.4);
  --chip-bg: rgba(43,217,143,.18); --chip-ink: #6EE7B7;
  background: #0b0b0e;
}
body.hybrid .shell { transition: background .35s ease; }

/* ---------- shell ---------- */
.shell {
  position: relative; z-index: 1;
  max-width: 430px; margin: 0 auto;
  height: 100dvh; display: flex; flex-direction: column;
  background: transparent;
}
@media (min-width: 500px) {
  .shell { height: calc(100dvh - 28px); margin-top: 14px; border-radius: 38px; overflow: hidden;
    box-shadow: 0 30px 80px rgba(10,20,18,.22), 0 0 0 1px rgba(15,23,24,.08); }
  body.dark .shell, body.hybrid .shell.on-device { box-shadow: 0 30px 80px rgba(0,0,0,.5), 0 0 0 1px rgba(255,255,255,.08); }
}

/* top bar: back, title, steps */
.topbar {
  padding: calc(10px + env(safe-area-inset-top)) 16px 8px;
  display: flex; align-items: center; gap: 10px;
}
.icon-btn {
  width: 38px; height: 38px; border-radius: 50%; border: 1px solid var(--border);
  background: var(--glass-strong); backdrop-filter: blur(18px) saturate(140%);
  color: var(--ink); display: grid; place-items: center; cursor: pointer; flex: 0 0 auto;
  box-shadow: var(--shadow-card);
}
.icon-btn[hidden] { visibility: hidden; display: grid; }
.topbar .t { flex: 1; min-width: 0; }
.topbar .t b { display: block; font-size: 17px; letter-spacing: -.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar .t span { display: block; font-size: 12.5px; color: var(--muted); }
.brand-dot { width: 38px; height: 38px; border-radius: 13px; background: #0b0b0c; color: #fff;
  display: grid; place-items: center; font-weight: 800; font-size: 19px; flex: 0 0 auto; }
body.dark .brand-dot { background: var(--accent); color: #101014; }
.steps { display: flex; gap: 5px; padding: 2px 16px 10px; }
.steps i { flex: 1; height: 4.5px; border-radius: 99px; background: rgba(120,130,125,.25); overflow: hidden; position: relative; }
.steps i.done::after, .steps i.now::after { content: ""; position: absolute; inset: 0; background: var(--accent-deep); border-radius: 99px; }
body.dark .steps i.done::after, body.dark .steps i.now::after { background: var(--accent); }
.steps i.now::after { opacity: .55; }

/* screens */
.viewport { flex: 1; overflow-y: auto; overscroll-behavior: contain; padding: 4px 16px 18px; scrollbar-width: none; }
.viewport::-webkit-scrollbar { display: none; }
.screen { display: none; animation: in .28s ease both; }
.screen.active { display: block; }
@keyframes in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

h1 { font-size: 30px; line-height: 1.05; letter-spacing: -.025em; margin: 8px 0 10px; font-weight: 800; }
h2 { font-size: 21px; letter-spacing: -.018em; margin: 4px 0 8px; font-weight: 800; }
h3 { font-size: 15.5px; margin: 14px 0 6px; font-weight: 700; }
p { font-size: 15.5px; line-height: 1.5; margin: 0 0 10px; }
.small { font-size: 13px; color: var(--muted); line-height: 1.45; }
.lede { font-size: 16.5px; color: var(--ink); opacity: .92; }

.card {
  background: var(--glass); backdrop-filter: blur(20px) saturate(140%);
  border: 1px solid var(--border); border-radius: 26px; box-shadow: var(--shadow-card);
  padding: 18px; margin: 0 0 14px;
}
.card.flat { background: var(--glass-lite); backdrop-filter: none; }

.kicker { text-transform: uppercase; letter-spacing: .28em; font-size: 11px; font-weight: 700; color: var(--accent-deep); margin: 0 0 8px; }
body.hybrid .shell.on-device .kicker { color: #6EE7B7; }

.warn { background: var(--warn-bg); border: 1px solid var(--warn-edge); color: var(--warn-ink);
  border-radius: 18px; padding: 12px 14px; font-size: 14px; font-weight: 600; line-height: 1.4; margin: 0 0 14px; }
.privacy { display: flex; gap: 10px; font-size: 13.5px; line-height: 1.45; color: var(--muted); }
.privacy b { color: var(--ink); }

.prep { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.prep li { display: flex; gap: 11px; align-items: flex-start; font-size: 15px; line-height: 1.4; }
.prep .n { width: 24px; height: 24px; border-radius: 50%; background: var(--chip-bg); color: var(--chip-ink);
  font-size: 13px; font-weight: 800; display: grid; place-items: center; flex: 0 0 auto; margin-top: 1px; }

.consent { display: flex; gap: 11px; align-items: flex-start; font-size: 13.5px; line-height: 1.45; color: var(--muted); cursor: pointer; }
.consent input { width: 22px; height: 22px; accent-color: var(--accent-deep); flex: 0 0 auto; margin: 1px 0 0; }
body.dark .consent input { accent-color: var(--accent); }

/* segmented tabs */
.seg { display: flex; background: rgba(120,130,125,.14); border-radius: 15px; padding: 3px; gap: 3px; margin: 0 0 14px; }
.seg button { flex: 1; border: 0; background: transparent; color: var(--muted); font: inherit; font-size: 14.5px; font-weight: 600;
  padding: 9px 4px; border-radius: 12px; cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 6px; }
.seg button.on { background: var(--glass-strong); color: var(--ink); box-shadow: 0 2px 8px rgba(10,20,18,.12); }
.seg button .dotst { width: 7px; height: 7px; border-radius: 50%; background: rgba(140,150,145,.5); }
.seg button .dotst.ok { background: #22c55e; }

/* photo frame */
.frame {
  position: relative; border-radius: 26px; overflow: hidden; background: var(--frame-bg);
  border: 1px solid var(--border); box-shadow: var(--shadow-card);
  aspect-ratio: 3 / 3.9; margin: 0 0 14px;
}
.frame .photo { position: absolute; inset: 0; display: grid; place-items: end center; }
.frame .photo svg { height: 92%; }
.frame .grid-lines { position: absolute; inset: 0; opacity: .5; }
.chip-float { position: absolute; top: 12px; left: 12px; display: flex; gap: 6px; }
.chip { background: rgba(11,11,12,.72); color: #fff; backdrop-filter: blur(8px);
  font-size: 12.5px; font-weight: 700; padding: 6px 11px; border-radius: 99px; display: inline-flex; align-items: center; gap: 5px; }
.chip.light { background: var(--chip-bg); color: var(--chip-ink); backdrop-filter: none; }
.chip-float.right { left: auto; right: 12px; }
.shutter-row { position: absolute; left: 0; right: 0; bottom: 14px; display: flex; align-items: center; justify-content: space-between; padding: 0 20px; }
.shutter { width: 66px; height: 66px; border-radius: 50%; border: 4px solid rgba(255,255,255,.92);
  background: rgba(255,255,255,.25); backdrop-filter: blur(6px); cursor: pointer; position: relative; }
.shutter::after { content: ""; position: absolute; inset: 5px; border-radius: 50%; background: #fff; }
.shutter small { position: absolute; inset: 0; display: grid; place-items: center; z-index: 1; font-size: 11px; font-weight: 800; color: #0b0b0c; }
.mini-btn { width: 44px; height: 44px; border-radius: 50%; border: 1px solid rgba(255,255,255,.25);
  background: rgba(11,11,12,.55); color: #fff; display: grid; place-items: center; cursor: pointer; backdrop-filter: blur(8px); font-size: 15px; }

/* points */
.dot { position: absolute; width: 26px; height: 26px; margin: -13px 0 0 -13px; border-radius: 50%;
  background: rgba(255,255,255,.92); border: 3px solid #e02424; box-shadow: 0 2px 8px rgba(0,0,0,.35);
  cursor: grab; touch-action: none; z-index: 3; }
.dot::after { content: ""; position: absolute; inset: 7px; border-radius: 50%; background: #e02424; }
.dot.y { border-color: #d9a400; } .dot.y::after { background: #d9a400; }
.frame svg.wires { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 2; pointer-events: none; }
.check-row { display: flex; align-items: center; gap: 10px; padding: 11px 0; border-top: 1px solid var(--border); }
.check-row:first-of-type { border-top: 0; }
.check-row .nm { flex: 1; font-weight: 600; font-size: 15px; }
.check-row .st { font-size: 13px; color: var(--muted); }
.check-row .st.ok { color: var(--accent-deep); font-weight: 700; }
body.hybrid .shell.on-device .check-row .st.ok { color: #6EE7B7; }
.pill-btn { border: 1.5px solid var(--accent-deep); color: var(--accent-deep); background: transparent; font: inherit;
  font-size: 14px; font-weight: 700; padding: 7px 16px; border-radius: 99px; cursor: pointer; }
body.dark .pill-btn, body.hybrid .shell.on-device .pill-btn { border-color: var(--accent); color: var(--accent); }
.pill-btn.done { background: var(--chip-bg); border-color: transparent; color: var(--chip-ink); }

/* processing */
.stage { display: flex; align-items: center; gap: 12px; padding: 12px 2px; font-size: 15.5px; color: var(--muted); }
.stage .ic { width: 30px; height: 30px; border-radius: 50%; border: 2px solid rgba(130,140,135,.35); display: grid; place-items: center; font-size: 14px; flex: 0 0 auto; }
.stage.run { color: var(--ink); font-weight: 600; }
.stage.run .ic { border-color: var(--accent-deep); border-top-color: transparent; animation: spin 0.9s linear infinite; }
body.dark .stage.run .ic { border-color: var(--accent); border-top-color: transparent; }
.stage.done { color: var(--ink); }
.stage.done .ic { background: #22c55e; border-color: #22c55e; color: #fff; animation: none; }
@keyframes spin { to { transform: rotate(360deg); } }
.bar { height: 9px; border-radius: 99px; background: rgba(120,130,125,.2); overflow: hidden; margin: 8px 0 4px; }
.bar i { display: block; height: 100%; width: 0%; border-radius: 99px; background: linear-gradient(90deg, var(--accent-deep), var(--accent)); transition: width .3s ease; }
body.dark .bar i { background: var(--accent); }
.pct { font-size: 13px; color: var(--muted); text-align: right; font-variant-numeric: tabular-nums; }

/* findings */
.finding { display: flex; gap: 12px; padding: 12px 0; border-top: 1px solid var(--border); align-items: flex-start; }
.finding:first-of-type { border-top: 0; }
.finding .val { font-size: 21px; font-weight: 800; letter-spacing: -.01em; min-width: 74px; font-variant-numeric: tabular-nums; }
.finding .tx { flex: 1; }
.finding .tx b { display: block; font-size: 15.5px; }
.finding .tx span { font-size: 13.5px; color: var(--muted); line-height: 1.4; display: block; }
.conf { font-size: 11.5px; font-weight: 800; letter-spacing: .04em; padding: 4px 9px; border-radius: 99px; background: var(--chip-bg); color: var(--chip-ink); white-space: nowrap; }
.conf.mod { background: rgba(255,159,10,.16); color: var(--warn-ink); }

input[type="email"], input[type="text"] {
  width: 100%; font: inherit; font-size: 16px; color: var(--ink);
  background: var(--glass-lite); border: 1.5px solid var(--border); border-radius: 16px; padding: 14px 16px; outline: none;
}
input[type="email"]:focus, input[type="text"]:focus { border-color: var(--accent-deep); }
body.dark input[type="email"]:focus, body.dark input[type="text"]:focus { border-color: var(--accent); }

/* bottom action bar */
.actionbar {
  padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
  background: var(--glass); backdrop-filter: blur(22px) saturate(150%);
  border-top: 1px solid var(--border);
  display: flex; flex-direction: column; gap: 9px;
}
.btn { appearance: none; border: 0; width: 100%; font: inherit; font-size: 17px; font-weight: 700;
  padding: 16px 20px; border-radius: 99px; background: var(--btn-bg); color: var(--btn-ink);
  cursor: pointer; box-shadow: 0 10px 24px rgba(10,20,18,.20); letter-spacing: -.01em; }
.btn:disabled { opacity: .35; box-shadow: none; cursor: default; }
.btn.ghost { background: transparent; color: var(--accent-deep); box-shadow: none; border: 1.5px solid var(--border); font-size: 15.5px; padding: 13px 20px; }
body.dark .btn.ghost { color: var(--accent); }
.btn-row { display: flex; gap: 9px; }
.btn-row .btn { flex: 1; }
.disclaimer { font-size: 12px; color: var(--muted); line-height: 1.45; text-align: center; margin: 2px 6px 0; }
.mock-tag { text-align: center; font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); padding: 0 0 2px; }
