:root {
  --bg: #071019;
  --card: rgba(16, 28, 43, .88);
  --line: rgba(255,255,255,.11);
  --text: #eef7ff;
  --muted: #93a7ba;
  --accent: #56d6ff;
  --accent2: #9dffcb;
  --warn: #ffd36e;
  --danger: #ff7f92;
  --ok: #9dffcb;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text);
  background: radial-gradient(circle at 10% 0%, rgba(86,214,255,.22), transparent 32%), radial-gradient(circle at 90% 10%, rgba(157,255,203,.14), transparent 30%), var(--bg);
}
.shell { width: min(1120px, calc(100% - 24px)); margin: 10px auto 24px; }
.card { background: linear-gradient(145deg, rgba(16,28,43,.94), rgba(9,18,29,.94)); border: 1px solid var(--line); border-radius: 24px; box-shadow: 0 22px 70px rgba(0,0,0,.30); }
.hero { display:flex; align-items:center; justify-content:space-between; gap:16px; padding:24px; }
.topbar { display:flex; align-items:center; justify-content:space-between; gap:12px; padding:10px 14px; margin-bottom:10px; border-radius:18px; }
.hidden-status { display:none; }
.patient-bar { display:flex; align-items:center; justify-content:space-between; gap:10px; padding:10px 14px; margin-bottom:10px; border-radius:18px; }
.patient-bar label { display:flex; align-items:center; gap:10px; color:var(--muted); font-weight:800; }
.patient-bar input { width:min(46vw, 260px); border:1px solid var(--line); border-radius:12px; padding:10px 12px; background:rgba(255,255,255,.06); color:var(--text); font-weight:800; }
.eyebrow { color: var(--accent2); text-transform: uppercase; letter-spacing: .15em; font-size: 12px; font-weight: 900; margin: 0 0 8px; }
h1 { margin:0; font-size: clamp(34px, 6vw, 62px); letter-spacing: -.06em; }
.topbar h1 { font-size: clamp(22px, 7vw, 34px); letter-spacing:-.04em; }
h2 { margin:0 0 14px; font-size: 22px; }
.subtitle, .muted { color: var(--muted); }
.subtitle { margin: 8px 0 0; font-size: 17px; }
.pill, .risk { border:1px solid var(--line); border-radius:999px; padding:10px 14px; background: rgba(255,255,255,.05); white-space:nowrap; }
.notice { padding:16px 18px; margin:16px 0; border-color: rgba(255,211,110,.3); color:#ffe9b2; }
.grid { display:grid; grid-template-columns: 1fr; gap:16px; }
.sr-only { position:absolute !important; width:1px !important; height:1px !important; padding:0 !important; margin:-1px !important; overflow:hidden !important; clip:rect(0,0,0,0) !important; white-space:nowrap !important; border:0 !important; }
.camera-card, .panel, .report-card, .method { padding:18px; }
.camera-wrap { position:relative; overflow:hidden; border-radius:20px; background:#02070d; aspect-ratio: 3/4; max-height: min(72vh, 720px); }
video, canvas { position:absolute; inset:0; width:100%; height:100%; object-fit:cover; }
canvas { pointer-events:none; }
.camera-start-overlay { position:absolute; inset:0; z-index:6; display:grid; place-items:center; width:100%; height:100%; margin:0; border-radius:0; background:radial-gradient(circle at 50% 35%, rgba(86,214,255,.14), transparent 28%), rgba(0,0,0,.82); color:var(--text); font-size:24px; letter-spacing:.01em; }
.camera-start-overlay.hidden { display:none; }
.camera-file-input { position:absolute; width:1px; height:1px; opacity:0; pointer-events:none; }
.guide-copy { position:absolute; left:14px; right:14px; bottom:14px; display:flex; justify-content:center; z-index:3; }
.guide-copy span { background:rgba(0,0,0,.62); border:1px solid rgba(255,255,255,.18); border-radius:999px; padding:10px 14px; font-weight:900; font-size:14px; text-align:center; }
.clock { position:absolute; top:14px; right:14px; z-index:3; width:92px; height:92px; display:grid; place-items:center; filter: drop-shadow(0 12px 30px rgba(0,0,0,.35)); }
.clock svg { position:absolute; inset:0; transform:rotate(-90deg); }
.clock-bg { fill:rgba(0,0,0,.58); stroke:rgba(255,255,255,.18); stroke-width:8; }
.clock-progress { fill:none; stroke:var(--accent2); stroke-width:8; stroke-linecap:round; stroke-dasharray:326.73; stroke-dashoffset:326.73; transition:stroke-dashoffset .18s linear, stroke .2s ease; }
.clock-face { position:relative; width:68px; height:68px; border-radius:50%; display:flex; flex-direction:column; align-items:center; justify-content:center; background:rgba(4,10,20,.72); border:1px solid rgba(255,255,255,.16); }
.clock-face strong { font-size:28px; line-height:26px; font-weight:950; color:var(--accent2); }
.clock-face span { font-size:10px; color:var(--muted); text-transform:uppercase; letter-spacing:.12em; }
.clock.waiting .clock-progress { stroke:var(--warn); stroke-dashoffset:82; }
.clock.running .clock-progress { stroke:var(--accent2); }
.clock.done .clock-progress { stroke:var(--ok); stroke-dashoffset:0; }
.controls { display:flex; flex-wrap:wrap; gap:10px; margin-top:14px; }
button, .button-like { border:0; border-radius:14px; padding:13px 16px; background:linear-gradient(135deg,var(--accent),var(--accent2)); color:#04111b; font-weight:900; cursor:pointer; text-align:center; display:inline-flex; align-items:center; justify-content:center; }
button.secondary, .button-like.secondary { background:rgba(255,255,255,.09); color:var(--text); border:1px solid var(--line); }
button.ghost, .button-like.ghost { background:transparent; color:var(--muted); border:1px solid var(--line); }
button:disabled, .button-like.disabled { opacity:.45; cursor:not-allowed; }
.readiness-debug { margin-top:10px; border:1px solid rgba(255,211,110,.30); background:rgba(255,211,110,.07); color:#ffe9b2; border-radius:14px; padding:10px 12px; font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace; font-size:12px; line-height:1.45; white-space:pre-wrap; }
.readiness-debug.ok { border-color:rgba(157,255,203,.34); background:rgba(157,255,203,.07); color:#d7ffe9; }
.readiness-debug.blocked { border-color:rgba(255,127,146,.34); background:rgba(255,127,146,.08); color:#ffd3da; }
.hint { color:var(--muted); font-size:14px; margin:12px 0 0; }
.phase-box { border:1px solid rgba(86,214,255,.28); background:rgba(86,214,255,.08); color:#dff7ff; border-radius:16px; padding:10px 12px; font-weight:800; margin-bottom:10px; min-height:42px; max-height:42px; overflow:hidden; display:flex; align-items:center; }
.metric { display:grid; grid-template-columns: 1fr auto; gap:4px 14px; border-bottom:1px solid var(--line); padding:13px 0; }
.metric span { color:var(--muted); }
.metric strong { font-size:20px; }
.metric em { grid-column:1 / -1; color:var(--muted); font-style:normal; font-size:12px; }
.timeline { height:80px; margin-top:16px; border-radius:14px; border:1px solid var(--line); background:linear-gradient(180deg, rgba(255,255,255,.04), rgba(255,255,255,.02)); overflow:hidden; position:relative; }
.bar { position:absolute; bottom:0; width:3px; background:var(--accent); opacity:.85; }
.report-card { margin-top:16px; }
.report-head { display:flex; align-items:center; justify-content:space-between; gap:16px; }
.risk.low { color:var(--ok); border-color:rgba(157,255,203,.4); }
.risk.medium { color:var(--warn); border-color:rgba(255,211,110,.4); }
.risk.high { color:var(--danger); border-color:rgba(255,127,146,.45); }
.report { line-height:1.55; }
.report ul { margin: 10px 0 0; padding-left: 20px; }
.report .checklist { list-style:none; padding-left:0; display:grid; gap:10px; margin:14px 0; }
.check-item { border:1px solid var(--line); border-radius:16px; padding:12px 14px; background:rgba(255,255,255,.045); }
.check-item strong { display:block; font-size:16px; }
.check-item small { display:block; margin-top:4px; color:var(--muted); font-size:12px; line-height:1.35; }
.check-item.detected { border-color:rgba(255,211,110,.46); background:rgba(255,211,110,.08); }
.check-item.detected strong { color:#ffe9b2; }
.check-item.not-detected strong { color:var(--text); }
.check-item.pending { border-color:rgba(86,214,255,.35); background:rgba(86,214,255,.07); }
.check-item.descriptive { border-color:rgba(157,255,203,.25); background:rgba(157,255,203,.045); }
.report-actions { display:flex; justify-content:flex-end; margin-top:14px; }
.method { margin-top:16px; color:var(--muted); }
.method strong { color:var(--text); }
.processing-overlay { position:fixed; inset:0; z-index:1000; display:grid; place-items:center; background:rgba(0,0,0,.78); backdrop-filter:blur(4px); }
.processing-overlay.hidden { display:none; }
.processing-card { min-width:min(82vw, 340px); border:1px solid rgba(255,255,255,.16); border-radius:24px; padding:26px 24px; display:flex; flex-direction:column; align-items:center; gap:10px; color:var(--text); background:linear-gradient(145deg, rgba(16,28,43,.96), rgba(4,10,20,.96)); box-shadow:0 30px 90px rgba(0,0,0,.55); text-align:center; }
.processing-card strong { font-size:20px; }
.processing-card span { color:var(--accent2); font-weight:900; letter-spacing:.02em; }
.spinner { width:46px; height:46px; border-radius:50%; border:4px solid rgba(255,255,255,.18); border-top-color:var(--accent2); animation:spin .85s linear infinite; }
@keyframes spin { to { transform:rotate(360deg); } }
@media (max-width: 860px) {
  .hero, .report-head { flex-direction:column; align-items:flex-start; }
  .patient-bar { align-items:stretch; flex-direction:column; }
  .patient-bar label { justify-content:space-between; }
  .topbar { position:sticky; top:0; z-index:10; }
  .grid { grid-template-columns:1fr; }
  .camera-wrap { max-height:none; }
  button { flex:1 1 auto; }
  .report-actions { justify-content:stretch; }
}
