:root {
  --bg: #0a0d13;
  --surface: #121722;
  --surface-2: #1a2130;
  --line: #263044;
  --text: #e8edf6;
  --muted: #8d9ab3;
  --accent: #fde725;       /* top of the signal ramp */
  --accent-ink: #1b1d00;
  --danger: #ff6b6b;
  --radius: 14px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
  color-scheme: dark;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text); font: 15px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; overscroll-behavior: none; }
body { overflow: hidden; }
button, select, input { font: inherit; color: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }

#app { height: 100dvh; display: flex; flex-direction: column; padding-top: var(--safe-t); }
.bar { display: flex; align-items: center; gap: 8px; padding: 8px 12px; min-height: 52px; border-bottom: 1px solid var(--line); background: var(--bg); z-index: 5; }
.bar h1 { margin: 0; font-size: 18px; font-weight: 650; letter-spacing: .1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.spacer { flex: 1; }
main { flex: 1; min-height: 0; position: relative; }
.view { position: absolute; inset: 0; display: flex; flex-direction: column; }
.view.scroll { overflow-y: auto; padding: 16px 16px calc(24px + var(--safe-b)); gap: 14px; display: block; }
.view.scroll > * + * { margin-top: 14px; }

.icon-btn { width: 40px; height: 40px; border-radius: 10px; border: 0; background: transparent; display: grid; place-items: center; }
.icon-btn:active { background: var(--surface-2); }
.chip-btn { border: 1px solid var(--line); background: var(--surface); border-radius: 999px; padding: 6px 12px; font-size: 13px; }
.chip-btn:active { background: var(--surface-2); }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.hero h2 { margin: 0 0 6px; font-size: 22px; letter-spacing: -.2px; }
.hero p { margin: 0 0 12px; color: var(--muted); }
.caps { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.chip { font-size: 12px; padding: 4px 10px; border-radius: 999px; background: var(--surface-2); color: var(--muted); border: 1px solid var(--line); }
.chip.ok { color: #9be3a8; border-color: #2c5a3a; background: #14261b; }
.chip.warn { color: #ffd38a; border-color: #6a5223; background: #2a2212; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; }
.btn { border: 1px solid var(--line); background: var(--surface-2); border-radius: 12px; padding: 12px 16px; font-weight: 600; min-height: 46px; }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: transparent; }
.btn.danger { background: #3a1a1f; border-color: #6b2a33; color: #ffb4b4; }
.btn:disabled { opacity: .45; }
.hint { color: var(--muted); font-size: 13px; margin: 8px 0 0; }

.row-head { display: flex; align-items: center; gap: 8px; margin-top: 22px; }
.row-head h3 { margin: 0; font-size: 15px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .06em; }

.maplist { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 10px; }
.maplist li { display: flex; align-items: center; gap: 12px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; cursor: pointer; }
.maplist li:active { background: var(--surface-2); }
.maplist .thumb { width: 44px; height: 44px; border-radius: 10px; flex: none; background: linear-gradient(135deg, #440154, #3b528b, #21918c, #5ec962, #fde725); opacity: .9; }
.maplist .meta { min-width: 0; }
.maplist .name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.maplist .sub { color: var(--muted); font-size: 12.5px; }

.settings summary { cursor: pointer; font-weight: 600; }
.settings label { display: block; margin-top: 14px; color: var(--muted); font-size: 13.5px; }
.settings select, .settings input[type=range] { width: 100%; margin-top: 6px; }
.settings select { background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; padding: 10px; }

/* ---- viewer ---- */
.stage { position: relative; flex: 1; min-height: 0; background: #0a0d13; touch-action: none; }
.stage canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; }
.stage-top { position: absolute; top: 10px; left: 10px; right: 10px; display: flex; justify-content: space-between; gap: 8px; align-items: flex-start; pointer-events: none; }
.stage-top > * { pointer-events: auto; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chips button { border: 1px solid var(--line); background: rgba(18,23,34,.82); backdrop-filter: blur(6px); border-radius: 999px; padding: 6px 12px; font-size: 13px; }
.chips button.on { background: var(--accent); color: var(--accent-ink); border-color: transparent; font-weight: 650; }
.seg { display: flex; border: 1px solid var(--line); border-radius: 999px; overflow: hidden; background: rgba(18,23,34,.82); backdrop-filter: blur(6px); }
.seg button { border: 0; background: transparent; padding: 6px 14px; font-size: 13px; }
.seg button.on { background: var(--surface-2); font-weight: 650; }
.seg button:disabled { opacity: .35; }
.legend { position: absolute; left: 12px; bottom: 12px; width: min(260px, 62%); pointer-events: none; }
.legend-n { font-size: 10.5px; color: #aab6cc; margin-top: 2px; text-shadow: 0 1px 2px #000; }
.bar-grad { height: 8px; border-radius: 4px; border: 1px solid rgba(255,255,255,.25); }
.legend-l { display: flex; justify-content: space-between; font-size: 11px; color: #cdd6e6; margin-top: 3px; text-shadow: 0 1px 2px #000; }
.busy { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: 10px; background: rgba(10,13,19,.72); font-size: 14px; color: var(--muted); }
.spin { width: 30px; height: 30px; border-radius: 50%; border: 3px solid var(--line); border-top-color: var(--accent); animation: sp .8s linear infinite; }
@keyframes sp { to { transform: rotate(360deg); } }
.prog { width: 180px; height: 4px; background: var(--line); border-radius: 2px; overflow: hidden; }
.prog i { display: block; height: 100%; width: 0; background: var(--accent); transition: width .15s; }
.gpu-msg { position: absolute; left: 16px; right: 16px; top: 64px; padding: 12px 14px; border-radius: 12px; background: #2a2212; border: 1px solid #6a5223; color: #ffd38a; font-size: 13px; }

.sheet { background: var(--surface); border-top: 1px solid var(--line); border-radius: 18px 18px 0 0; max-height: 46dvh; display: flex; flex-direction: column; padding-bottom: var(--safe-b); }
.sheet.collapsed .sheet-body { display: none; }
.grab { align-self: center; width: 100%; height: 26px; border: 0; background: transparent; position: relative; }
.grab::after { content: ""; position: absolute; left: 50%; top: 10px; width: 40px; height: 4px; margin-left: -20px; border-radius: 2px; background: var(--line); }
.sheet-body { overflow-y: auto; padding: 0 16px 16px; }
.sheet-body label { display: block; margin-top: 12px; font-size: 13px; color: var(--muted); }
.sheet-body input[type=range] { width: 100%; margin-top: 4px; accent-color: var(--accent); }
.sheet-body .chk { display: flex; align-items: center; gap: 8px; margin: 0; color: var(--text); }
.grid2 { display: flex; flex-wrap: wrap; gap: 6px 18px; margin-top: 4px; }
.dual { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.stats { margin: 0; font-size: 12.5px; color: var(--muted); }
.settings input[type=range] { accent-color: var(--accent); }

/* ---- lite capture ---- */
.hud .big-score { display: flex; align-items: baseline; gap: 10px; }
.hud .big-score span { font-size: 64px; font-weight: 700; line-height: 1; font-variant-numeric: tabular-nums; }
.hud small, .xr-top small { display: block; color: var(--muted); font-size: 11px; }
.stat-row { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; margin: 12px 0; text-align: center; }
.stat-row b { font-size: 15px; font-variant-numeric: tabular-nums; }
#liteMini { width: 100%; aspect-ratio: 640 / 420; border-radius: 12px; border: 1px solid var(--line); display: block; }
.floor-ctl { display: flex; align-items: center; justify-content: center; gap: 18px; margin: 14px 0; }
.floor-ctl .btn { width: 52px; font-size: 22px; padding: 6px; }

/* ---- misc ---- */
.menu { position: fixed; top: calc(54px + var(--safe-t)); right: 10px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px; display: grid; min-width: 170px; z-index: 30; overflow: hidden; box-shadow: 0 10px 30px rgba(0,0,0,.5); }
.menu button { background: transparent; border: 0; text-align: left; padding: 13px 16px; }
.menu button + button { border-top: 1px solid var(--line); }
.danger-text { color: var(--danger); }
.toast { position: fixed; left: 50%; bottom: calc(24px + var(--safe-b)); transform: translateX(-50%); background: #e8edf6; color: #0a0d13; padding: 10px 16px; border-radius: 12px; font-size: 14px; max-width: 88vw; z-index: 60; box-shadow: 0 8px 24px rgba(0,0,0,.5); }

@media (min-width: 860px) {
  .view.scroll { max-width: 760px; margin: 0 auto; }
  #viewViewer { flex-direction: row; }
  .sheet { width: 340px; max-height: none; border-radius: 0; border-top: 0; border-left: 1px solid var(--line); }
  .sheet.collapsed .sheet-body { display: block; }
  .grab { display: none; }
  .sheet-body { padding-top: 14px; }
}

/* ---- Wi-Fi guard ---- */
.net-pill { font-size: 12.5px; padding: 6px 12px; border-radius: 999px; margin-bottom: 10px; display: inline-block; border: 1px solid var(--line); background: var(--surface-2); color: var(--muted); }
.net-pill.ok { color: #9be3a8; border-color: #2c5a3a; background: #14261b; }
.net-pill.bad { color: #ffb4b4; border-color: #6b2a33; background: #3a1a1f; font-weight: 600; }
.net-chip { cursor: pointer; }
.chk-row { display: flex !important; gap: 10px; align-items: flex-start; }
.chk-row input { margin-top: 3px; }

/* ---- room builder ---- */
.cam-view { background: #000; overflow: hidden; }
.cam-view video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; background: #111; }
.cam-shade { position: absolute; inset: 0; background: linear-gradient(to bottom, rgba(0,0,0,.55), rgba(0,0,0,0) 28%, rgba(0,0,0,0) 45%, rgba(0,0,0,.7)); pointer-events: none; }
.cross { position: absolute; left: 50%; top: 42%; width: 54px; height: 54px; margin: -27px 0 0 -27px; pointer-events: none; }
.cross::before, .cross::after { content: ""; position: absolute; background: #fff; box-shadow: 0 0 0 1px rgba(0,0,0,.55); }
.cross::before { left: 50%; top: 0; bottom: 0; width: 2px; margin-left: -1px; }
.cross::after { top: 50%; left: 0; right: 0; height: 2px; margin-top: -1px; }
.cross i { position: absolute; inset: 14px; border: 2px solid var(--accent); border-radius: 50%; box-shadow: 0 0 0 1px rgba(0,0,0,.5); }
.cross.off { opacity: .45; }
.cross.off i { border-color: #ff8a8a; }
.cam-top { position: absolute; top: 8px; left: 10px; right: 10px; color: #fff; display: flex; flex-direction: column; align-items: flex-start; pointer-events: none; }
.b-row { display: flex; gap: 14px; align-items: center; background: rgba(8,10,14,.6); backdrop-filter: blur(6px); border-radius: 14px; padding: 8px 12px; align-self: stretch; }
.b-score span { font-size: 38px; font-weight: 700; line-height: 1; font-variant-numeric: tabular-nums; }
.b-score small, .b-stats small { display: block; color: #aeb9cf; font-size: 10.5px; }
.b-stats { display: grid; grid-template-columns: repeat(5, auto); gap: 2px 12px; flex: 1; justify-content: end; text-align: center; }
.b-stats b { font-size: 13px; font-variant-numeric: tabular-nums; }
.b-map { position: absolute; right: 10px; top: 120px; width: 34vw; max-width: 170px; aspect-ratio: 1; border-radius: 12px; overflow: hidden; border: 1px solid rgba(255,255,255,.28); transition: all .2s; }
.b-map canvas { width: 100%; height: 100%; display: block; }
.b-map.big { width: calc(100vw - 20px); max-width: 520px; right: 10px; top: 120px; z-index: 4; }
.b-aim { position: absolute; left: 50%; top: calc(42% + 38px); transform: translateX(-50%); background: rgba(8,10,14,.7); color: #fff; padding: 4px 12px; border-radius: 999px; font-size: 14px; font-weight: 600; white-space: nowrap; pointer-events: none; }
.b-bottom { position: absolute; left: 0; right: 0; bottom: 0; padding: 10px 12px calc(12px + var(--safe-b)); color: #fff; }
.b-hint { margin: 0 0 8px; font-size: 13.5px; text-shadow: 0 1px 3px #000; min-height: 2.6em; }
.b-tools { display: flex; gap: 6px; margin-bottom: 8px; }
.b-tools button { flex: 1; border: 1px solid rgba(255,255,255,.25); background: rgba(8,10,14,.6); backdrop-filter: blur(6px); color: #fff; border-radius: 10px; padding: 9px 0; font-weight: 600; }
.b-tools button.on { background: var(--accent); color: var(--accent-ink); border-color: transparent; }
.b-actions { display: grid; grid-template-columns: 2fr 1fr 1.2fr; gap: 8px; margin-bottom: 8px; }
.b-actions .btn { padding: 14px 8px; min-height: 52px; }
.b-sub { display: flex; align-items: center; gap: 8px; }
.b-sub .chip-btn { background: rgba(8,10,14,.6); color: #fff; backdrop-filter: blur(6px); }
.b-sub .btn { min-height: 38px; padding: 6px 14px; }
.b-intro { position: absolute; inset: 0; background: rgba(8,10,14,.86); display: grid; place-items: center; padding: 16px; overflow-y: auto; }
.b-intro .card { max-width: 480px; }
.b-intro h2 { margin: 0 0 10px; font-size: 20px; }
.steps { padding-left: 20px; margin: 0 0 14px; color: var(--muted); }
.steps li { margin-bottom: 8px; }
.steps b { color: var(--text); }
.field { display: block; color: var(--muted); font-size: 13.5px; }
.field input { width: 100%; margin-top: 6px; accent-color: var(--accent); }
.btn.wide { width: 100%; margin-top: 8px; }
.warn-text { color: #ffd38a; }
.b-sub { flex-wrap: nowrap; margin-bottom: 8px; }
.b-sub .chip-btn { white-space: nowrap; flex: none; }
.b-sub b { white-space: nowrap; font-size: 13px; }
.b-end .btn { flex: 1; min-height: 44px; }
.b-end { margin-bottom: 0; }

/* ---- space backdrop for the whole app ---- */
html, body {
  background:
    radial-gradient(1100px 700px at 88% -8%, rgba(91, 58, 158, .30), transparent 62%),
    radial-gradient(900px 650px at -8% 108%, rgba(33, 145, 140, .22), transparent 62%),
    radial-gradient(700px 500px at 50% 50%, rgba(20, 30, 60, .35), transparent 70%),
    var(--bg);
  background-attachment: fixed;
}
#app { position: relative; }
#app::before {
  content: ""; position: fixed; inset: 0; z-index: 0; pointer-events: none; opacity: .75;
  background-image:
    radial-gradient(1.2px 1.2px at 8% 14%, #fff, transparent), radial-gradient(1px 1px at 17% 62%, #cfe0ff, transparent),
    radial-gradient(1.4px 1.4px at 26% 33%, #fff, transparent), radial-gradient(1px 1px at 34% 82%, #ffe9c9, transparent),
    radial-gradient(1.2px 1.2px at 43% 9%, #cfe0ff, transparent), radial-gradient(1px 1px at 51% 47%, #fff, transparent),
    radial-gradient(1.5px 1.5px at 59% 73%, #fff, transparent), radial-gradient(1px 1px at 67% 21%, #ffe9c9, transparent),
    radial-gradient(1.2px 1.2px at 74% 58%, #cfe0ff, transparent), radial-gradient(1px 1px at 82% 88%, #fff, transparent),
    radial-gradient(1.4px 1.4px at 90% 36%, #fff, transparent), radial-gradient(1px 1px at 95% 11%, #cfe0ff, transparent),
    radial-gradient(1px 1px at 4% 91%, #fff, transparent), radial-gradient(1.2px 1.2px at 38% 55%, #ffe9c9, transparent),
    radial-gradient(1px 1px at 70% 6%, #fff, transparent), radial-gradient(1px 1px at 12% 40%, #cfe0ff, transparent);
}
.bar, main { position: relative; z-index: 1; }
.bar { background: rgba(10, 13, 19, .72); backdrop-filter: blur(8px); }
.card, .maplist li { background: rgba(18, 23, 34, .88); backdrop-filter: blur(6px); }
.seg-wide { display: flex; margin-top: 12px; }
.seg-wide button { flex: 1; font-size: 12.5px; padding: 8px 6px; }

/* ---- hands-free room scan ---- */
.ring { position: absolute; left: 50%; top: 42%; width: 220px; height: 220px; margin: -110px 0 0 -110px; pointer-events: none; }
.depth-thumb { position: absolute; left: 10px; top: 120px; width: 72px; border-radius: 8px; border: 1px solid rgba(255,255,255,.3); background: #000; opacity: .9; }
.b-model { margin-bottom: 8px; font-size: 12.5px; color: #cdd6e6; }
.b-model-bar { height: 4px; border-radius: 2px; background: rgba(255,255,255,.2); overflow: hidden; margin-bottom: 4px; }
.b-model-bar i { display: block; height: 100%; width: 0; background: var(--accent); transition: width .2s; }
.b-two { grid-template-columns: 2fr 1fr; }

/* ================= simplified UX: one-button home, side menu, dialog, guided scan ================= */
.home { display: flex !important; flex-direction: column; }
.home > * + * { margin-top: 0; }
.home-hero { text-align: center; padding: 6vh 8px 4vh; max-width: 460px; margin: 0 auto; width: 100%; }
.home-hero .logo { border-radius: 22px; box-shadow: 0 10px 40px rgba(91, 58, 158, .45); margin-bottom: 18px; }
.home-hero h2 { margin: 0 0 8px; font-size: 28px; letter-spacing: -.4px; }
.home-hero p { margin: 0 auto 26px; color: var(--muted); max-width: 340px; }
.start-btn { width: min(320px, 86%); border: 0; border-radius: 999px; padding: 20px 26px; font-size: 20px; font-weight: 700; color: var(--accent-ink);
  background: linear-gradient(135deg, #fde725, #7ad151 60%, #22a884); box-shadow: 0 12px 36px rgba(253, 231, 37, .22), 0 0 0 0 rgba(253, 231, 37, .4); animation: pulse 2.6s ease-out infinite; }
.start-btn:active { transform: scale(.98); }
@keyframes pulse { 0% { box-shadow: 0 12px 36px rgba(253,231,37,.22), 0 0 0 0 rgba(253,231,37,.35); } 70%, 100% { box-shadow: 0 12px 36px rgba(253,231,37,.22), 0 0 0 22px rgba(253,231,37,0); } }
@media (prefers-reduced-motion: reduce) { .start-btn { animation: none; } }
.start-status { margin: 14px 0 0 !important; font-size: 13.5px; color: var(--muted); }
.start-status.ok { color: #9be3a8; }
.start-status.bad { color: #ffd38a; }
.ai-home { margin: 10px auto 0; max-width: 260px; font-size: 12.5px; color: var(--muted); }
.ai-home b { display: block; height: 4px; margin-top: 6px; border-radius: 3px; background: rgba(255,255,255,.12); overflow: hidden; }
.ai-home i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #6ee7ff, #a78bfa); transition: width .3s; }
#mapsBlock { max-width: 560px; margin: 8px auto 0; width: 100%; }

/* side menu */
.scrim { position: fixed; inset: 0; background: rgba(0,0,0,.55); z-index: 40; }
.drawer { position: fixed; top: 0; bottom: 0; left: 0; width: min(340px, 88vw); background: var(--surface); border-right: 1px solid var(--line); z-index: 41; display: flex; flex-direction: column; padding-top: var(--safe-t); box-shadow: 10px 0 40px rgba(0,0,0,.5); }
.drawer-head { display: flex; align-items: center; justify-content: space-between; padding: 10px 12px 10px 18px; border-bottom: 1px solid var(--line); font-size: 17px; }
.drawer-body { overflow-y: auto; padding: 6px 18px calc(24px + var(--safe-b)); }
.drawer-body section { padding: 14px 0; border-bottom: 1px solid var(--line); }
.drawer-body section:last-of-type { border-bottom: 0; }
.drawer-body h4 { margin: 0 0 10px; font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; font-weight: 600; }
.menu-item { display: block; width: 100%; text-align: left; background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px; padding: 13px 14px; margin-bottom: 8px; font-weight: 600; }
.menu-item:active { background: #232c3f; }
.radio { display: flex; align-items: center; gap: 10px; padding: 7px 0; font-size: 14.5px; }
.radio input { accent-color: var(--accent); }
.drawer summary { cursor: pointer; font-weight: 600; }
.drawer .settings label { display: block; margin-top: 14px; color: var(--muted); font-size: 13.5px; }
.drawer .settings select, .drawer .settings input[type=range] { width: 100%; margin-top: 6px; }
.drawer .settings select { background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; padding: 10px; }
.hint.small { font-size: 12px; }
.drawer a { color: #9ac7ff; }

/* dialog */
.dlg { position: fixed; inset: 0; background: rgba(0,0,0,.6); display: grid; place-items: center; padding: 20px; z-index: 70; }
.dlg-card { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 22px; max-width: 380px; width: 100%; box-shadow: 0 20px 60px rgba(0,0,0,.6); }
.dlg-card h3 { margin: 0 0 8px; font-size: 19px; }
.dlg-card p { margin: 0 0 18px; color: var(--muted); }
.dlg-card .actions .btn { flex: 1; }

/* guided scan */
.stepper { display: flex; gap: 6px; margin-bottom: 8px; }
.stepper span { flex: 1; text-align: center; font-size: 11.5px; padding: 5px 4px; border-radius: 999px; background: rgba(8,10,14,.55); color: #aeb9cf; border: 1px solid rgba(255,255,255,.14); backdrop-filter: blur(6px); }
.stepper span.on { background: var(--accent); color: var(--accent-ink); border-color: transparent; font-weight: 700; }
.stepper span.done { color: #9be3a8; border-color: #2c5a3a; }
.b-main { width: 100%; min-height: 58px; font-size: 17px; margin-bottom: 8px; }
.b-finish { width: 100%; min-height: 50px; margin-bottom: 8px; background: rgba(8,10,14,.6); border-color: var(--accent); color: var(--accent); backdrop-filter: blur(6px); }
.b-links { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.link-btn { background: transparent; border: 0; color: #cdd6e6; text-decoration: underline; padding: 8px 4px; font-size: 13.5px; text-shadow: 0 1px 3px #000; }
.b-more summary { cursor: pointer; color: #cdd6e6; font-size: 13.5px; padding: 8px 4px; text-align: right; text-decoration: underline; text-shadow: 0 1px 3px #000; list-style: none; }
.b-more summary::-webkit-details-marker { display: none; }
.b-more[open] .b-sub { background: rgba(8,10,14,.7); border-radius: 12px; padding: 8px 10px; margin-top: 4px; backdrop-filter: blur(6px); }

/* room scan: show only what a regular user needs (quality + samples); the rest stays in the DOM for the code */
#viewLite .b-stats > div:not(:nth-child(3)) { display: none; }
#viewLite .b-stats { grid-template-columns: auto; }
.legend-l { gap: 10px; }
.legend-l span { white-space: nowrap; }

/* ---- the guide (coach card) ---- */
.coach { background: rgba(10,13,20,.78); border: 1px solid rgba(255,255,255,.16); border-radius: 18px; padding: 10px 12px 12px; margin-bottom: 8px; backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.coach-top { display: flex; align-items: center; justify-content: space-between; font-size: 11.5px; letter-spacing: .04em; text-transform: uppercase; color: #aeb9cf; }
.coach-voice { background: none; border: 0; font-size: 18px; line-height: 1; padding: 2px 4px; color: #fff; cursor: pointer; }
.coach-main { display: flex; gap: 12px; align-items: center; margin-top: 6px; }
.coach-icon { flex: 0 0 56px; height: 56px; display: grid; place-items: center; border-radius: 16px; background: rgba(255,255,255,.08); color: var(--accent); }
.coach-icon svg { transition: transform .15s linear; }
.coach-icon .spin { transform-origin: 24px 24px; animation: coach-spin 1s linear infinite; }
@keyframes coach-spin { to { transform: rotate(360deg); } }
.coach-count { font-size: 34px; font-weight: 800; color: #fff; }
.coach-body { min-width: 0; }
.coach-body h3 { margin: 0; font-size: 19px; line-height: 1.2; color: #fff; }
.coach-body p { margin: 3px 0 0; font-size: 14px; line-height: 1.35; color: #d5deef; }
.coach-bar { height: 5px; border-radius: 3px; background: rgba(255,255,255,.16); overflow: hidden; margin-top: 10px; }
.coach-bar i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #6ee7ff, #fde725); transition: width .2s; }
.coach-note { margin: 9px 0 0; padding: 7px 10px; border-radius: 10px; background: rgba(255,184,107,.18); color: #ffd9a8; font-size: 13.5px; }
.coach[data-stage="spin"] .coach-icon { color: #fde725; }
.coach[data-stage="countdown"] .coach-icon { background: rgba(253,231,37,.18); }
.coach[data-stage="next"] .coach-icon, .coach[data-stage="arriving"] .coach-icon { color: #9be3a8; }
.coach[data-stage="warmup"] .coach-icon { color: #9fb3d9; }
@media (prefers-reduced-motion: reduce) { .coach-icon .spin { animation: none; } }

/* ---- recording screen: only video, the circle, one instruction ---- */
.rec-net { position: absolute; top: 10px; left: 12px; margin: 0; background: rgba(58,26,31,.85); }
.rec-net.ok, .rec-net.pend { display: none; }
.rec-voice { position: absolute; top: 8px; right: 10px; width: 40px; height: 40px; border-radius: 50%; border: 0; background: rgba(8,10,14,.55); color: #fff; font-size: 18px; backdrop-filter: blur(6px); }
.rec-bottom { position: absolute; left: 0; right: 0; bottom: 0; padding: 10px 12px calc(14px + var(--safe-b)); color: #fff; }
.rec-links { display: flex; align-items: center; justify-content: center; gap: 14px; flex-wrap: wrap; min-height: 34px; }
.rec-links .link-btn[hidden], .rec-links [hidden] { display: none; }
.rec-floor { display: inline-flex; align-items: center; gap: 8px; }
.rec-floor .chip-btn { background: rgba(8,10,14,.6); color: #fff; padding: 4px 11px; }
.rec-floor b { font-size: 13px; color: #cdd6e6; }
.rec-bottom .coach { margin-bottom: 8px; }

/* ---- processing card on the home screen ---- */
.proc-card { margin: 14px 12px 4px; padding: 12px 14px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line); }
.proc-top { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.proc-top span { font-variant-numeric: tabular-nums; color: var(--accent); font-weight: 700; }
.proc-bar { height: 6px; border-radius: 3px; background: rgba(255,255,255,.1); overflow: hidden; margin: 8px 0 6px; }
.proc-bar i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #6ee7ff, #fde725); transition: width .4s; }
.proc-text { margin: 0 0 8px; font-size: 13px; color: var(--muted); }
.proc-actions { display: flex; gap: 8px; }
.proc-actions .btn { flex: 1; min-height: 40px; padding: 8px 10px; }
.maplist li .chip-state { display: inline-block; font-size: 11px; padding: 2px 8px; border-radius: 999px; margin-left: 6px; border: 1px solid var(--line); color: var(--muted); }
.maplist li .chip-state.work { color: var(--accent); border-color: var(--accent); }
.maplist li .row-x { margin-left: auto; background: transparent; border: 0; color: var(--muted); font-size: 20px; padding: 6px 10px; }

/* ---- analysis screen ---- */
.analyze { display: grid; place-items: start center; padding: 18px 14px 30px; }
.an-card { width: 100%; max-width: 460px; text-align: center; }
.an-ring { position: relative; width: 150px; height: 150px; margin: 6px auto 10px; }
.an-ring svg { transform: rotate(-90deg); }
.an-bg { fill: none; stroke: rgba(255,255,255,.1); stroke-width: 9; }
.an-arc { fill: none; stroke: var(--accent); stroke-width: 9; stroke-linecap: round; stroke-dasharray: 326.7; stroke-dashoffset: 326.7; transition: stroke-dashoffset .5s; }
.an-ring b { position: absolute; inset: 0; display: grid; place-items: center; font-size: 30px; font-variant-numeric: tabular-nums; }
.an-card h2 { margin: 6px 0 4px; font-size: 21px; }
.an-text { margin: 0 0 12px; color: var(--muted); font-size: 14px; min-height: 2.6em; }
.an-rooms { list-style: none; margin: 0 0 10px; padding: 0; text-align: left; }
.an-rooms li { display: flex; justify-content: space-between; padding: 9px 12px; border-radius: 10px; background: var(--surface); margin-bottom: 6px; font-size: 14px; }
.an-rooms li.done b { color: #9be3a8; }
.an-rooms li.failed b { color: #ffb4b4; }
.an-rooms li span { color: var(--muted); }
.an-actions { display: grid; gap: 8px; margin: 12px 0 10px; }
.home[hidden] { display: none !important; }
.analyze { background: var(--bg, #0a0d13); }
