:root {
  --bg: #0b0d12; --panel: #141821; --line: #262c3a; --text: #e8ecf3; --muted: #94a0b8;
  --accent: #35c26d; --warn: #f0b429; --bad: #e5484d; --focus: #5aa9ff;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text); font: 16px/1.4 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; }
.screen { max-width: 720px; margin: 0 auto; padding: 16px; min-height: 100%; display: flex; flex-direction: column; gap: 14px; }
h1, .title { font-size: 20px; font-weight: 700; margin: 8px 0 0; letter-spacing: .2px; }
h1 span, .title span { color: var(--muted); font-weight: 500; }
.lede { color: var(--muted); margin: 0; }
form#join-form { display: flex; flex-direction: column; gap: 14px; background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 18px; }
label { display: flex; flex-direction: column; gap: 6px; color: var(--muted); font-size: 14px; }
input { background: #0f1218; color: var(--text); border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; font-size: 18px; outline: none; }
input:focus { border-color: var(--focus); }
#code { font-size: 44px; letter-spacing: .35em; text-align: center; font-variant-numeric: tabular-nums; padding: 10px; }
button { background: var(--accent); color: #06130b; border: 0; border-radius: 10px; padding: 13px 18px; font-size: 17px; font-weight: 700; cursor: pointer; }
button:disabled { opacity: .5; cursor: default; }
button.ghost { background: transparent; color: var(--text); border: 1px solid var(--line); font-weight: 600; padding: 9px 14px; font-size: 15px; }
button.ghost.danger { color: #ff8b8f; border-color: #4a2326; }
.error { color: #ff8b8f; min-height: 1.4em; margin: 0; font-size: 15px; }
.bar { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.room { color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
#stage-box { position: relative; width: 100%; background: #000; border-radius: 14px; overflow: hidden; border: 1px solid var(--line);
  aspect-ratio: 9 / 16; max-height: calc(100vh - 260px); margin: 0 auto; }
@media (min-aspect-ratio: 3/4) { #stage-box { aspect-ratio: auto; height: calc(100vh - 260px); min-height: 320px; } }
#stage, #stage > * { position: absolute; inset: 0; width: 100% !important; height: 100% !important; }
#stage video { object-fit: contain; }
#stage-box.live { cursor: crosshair; }
/* The helper's mark: a ring where they clicked, at the same spot the wearer sees it. */
.mark { position: absolute; width: 28px; height: 28px; margin: -14px 0 0 -14px; border: 3px solid var(--accent); border-radius: 50%;
  box-shadow: 0 0 0 2px rgba(0,0,0,.6); pointer-events: none; }
.mark::after { content: ""; position: absolute; left: 50%; top: 50%; width: 4px; height: 4px; margin: -2px 0 0 -2px; border-radius: 50%; background: var(--accent); }
.overlay { position: absolute; inset: 0; display: grid; place-items: center; color: var(--muted); background: rgba(11,13,18,.72); font-size: 18px; pointer-events: none; }
.overlay[hidden] { display: none; }
.strip { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 14px; font-variant-numeric: tabular-nums; flex-wrap: wrap; }
.spacer { flex: 1; }
.dot { width: 10px; height: 10px; border-radius: 50%; background: var(--muted); flex: none; }
.dot.good { background: var(--accent); } .dot.fair { background: var(--warn); } .dot.poor, .dot.off { background: var(--bad); }
.note-row { display: flex; gap: 10px; }
.note-row input { flex: 1; font-size: 16px; }
.notes { list-style: none; margin: 0; padding: 0; color: var(--muted); font-size: 14px; display: flex; flex-direction: column; gap: 4px; }
.notes li b { color: var(--text); font-weight: 600; }
[hidden] { display: none !important; }

/* ---- hub pages (devices, sessions, diagnostics) ---- */
.screen.wide { max-width: 1100px; }
.nav { display: flex; gap: 14px; align-items: center; font-size: 15px; }
.nav a { color: var(--muted); text-decoration: none; padding: 6px 10px; border-radius: 8px; }
.nav a:hover { color: var(--text); background: var(--panel); }
.nav a.current { color: var(--text); background: var(--panel); border: 1px solid var(--line); }
.live { color: var(--muted); font-size: 12px; } .live.live { color: var(--accent); } .live.reconnecting { color: var(--warn); }
.muted { color: var(--muted); }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.card { background: linear-gradient(170deg, #171c27, #11151d 70%); border: 1px solid var(--line); border-radius: 16px; padding: 18px; display: flex; flex-direction: column; gap: 8px; box-shadow: 0 8px 24px rgba(0,0,0,.3); }
.card.device:not(.offline) { border-color: #2a4a3a; box-shadow: 0 8px 24px rgba(0,0,0,.3), 0 0 0 1px rgba(53,194,109,.15), 0 0 40px -20px rgba(53,194,109,.6); }
.card.offline { opacity: .55; }
.card h2 { font-size: 18px; margin: 0; font-weight: 700; flex: 1; }
.row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.row.meta { color: var(--muted); font-size: 15px; } .row.meta.small { font-size: 13px; }
.row.actions { margin-top: 6px; gap: 14px; }
.state.rec { color: var(--bad); font-weight: 600; } .state.call { color: var(--focus); font-weight: 600; }
.badge { font-size: 12px; font-weight: 600; letter-spacing: .3px; text-transform: uppercase; color: var(--muted); border: 1px solid var(--line); border-radius: 6px; padding: 2px 7px; }
.badge.rayneo { color: #7fd1ff; border-color: #22465c; } .badge.rayban, .badge.iphone { color: #ffb86b; border-color: #5a3d1a; } .badge.phone { color: #c9b6ff; border-color: #3f3160; }
.pill { font-size: 12px; color: var(--text); background: #1c2230; border-radius: 999px; padding: 2px 9px; text-decoration: none; } .pill.warn { color: var(--warn); } .pill.rec { color: var(--bad); }
.ghost-link { color: var(--muted); font-size: 14px; } .ghost-link:hover { color: var(--text); }
table.diag { width: 100%; border-collapse: collapse; font-size: 13px; font-variant-numeric: tabular-nums; }
table.diag th, table.diag td { text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--line); white-space: nowrap; }
table.diag th { color: var(--muted); font-weight: 600; position: sticky; top: 0; background: var(--bg); }
.table-wrap { overflow: auto; max-height: 420px; border: 1px solid var(--line); border-radius: 10px; }
section.block { display: flex; flex-direction: column; gap: 10px; }
section.block h2 { font-size: 16px; margin: 6px 0 0; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .4px; }
.clips { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.clip { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; cursor: pointer; display: flex; flex-direction: column; }
.clip .thumb { aspect-ratio: 16 / 9; background: #000; display: grid; place-items: center; color: var(--muted); font-size: 13px; overflow: hidden; }
.clip .thumb img { width: 100%; height: 100%; object-fit: cover; }
.clip .cap { padding: 8px 10px; display: flex; gap: 8px; align-items: center; font-size: 13px; color: var(--muted); flex-wrap: wrap; }
.clip .cap b { color: var(--text); }
.player { background: #000; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.player video { width: 100%; max-height: 70vh; display: block; }
.list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.list li { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; display: flex; gap: 12px; align-items: center; }
.list li .big { font-size: 20px; font-weight: 700; letter-spacing: .04em; font-variant-numeric: tabular-nums; }
.list li img { width: 96px; height: 72px; object-fit: cover; border-radius: 8px; background: #000; }
.list li a.title { color: var(--text); text-decoration: none; font-weight: 600; font-size: 17px; }
.list li .grow { flex: 1; display: flex; flex-direction: column; gap: 4px; }
.chart-box { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 12px; height: 260px; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 4px 14px; font-size: 14px; } .kv dt { color: var(--muted); } .kv dd { margin: 0; font-variant-numeric: tabular-nums; }
.compare { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 14px; }
.hero { font-size: 34px; font-weight: 700; font-variant-numeric: tabular-nums; }
.name-row { margin: -4px 0 2px; } label.inline { flex-direction: row; align-items: center; gap: 10px; font-size: 14px; } label.inline input { font-size: 15px; padding: 6px 10px; width: 180px; }
/* ---- asset card and answers (compressor demo) ---- */
.asset { background: linear-gradient(160deg, #182033, #121722 60%); border: 1px solid #2b3550; border-radius: 16px; padding: 18px 20px; display: flex; flex-direction: column; gap: 8px; box-shadow: 0 10px 30px rgba(0,0,0,.35); }
.asset-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.asset-id { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 15px; font-weight: 700; letter-spacing: .08em; color: #7fd1ff; background: #11253a; border: 1px solid #22465c; border-radius: 8px; padding: 3px 9px; }
.asset-kind { color: var(--muted); font-size: 13px; text-transform: uppercase; letter-spacing: .4px; }
.asset-name { font-size: 26px; margin: 0; font-weight: 800; letter-spacing: -.2px; }
.asset-model { color: var(--muted); font-size: 15px; }
.asset-fault { display: flex; gap: 10px; align-items: center; background: #2a1719; border: 1px solid #5a2a2e; color: #ffb3b6; border-radius: 10px; padding: 8px 12px; font-size: 15px; }
.fault-label { font-size: 11px; font-weight: 700; letter-spacing: .5px; text-transform: uppercase; color: #ff8b8f; }
.asset-kv { margin: 4px 0 0; }
.asset-specs { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 4px; }
.asset-specs .spec { display: flex; flex-direction: column; background: #0f1218; border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px; min-width: 110px; }
.asset-specs .spec b { font-size: 15px; font-variant-numeric: tabular-nums; } .asset-specs .spec small { color: var(--muted); font-size: 12px; }
.answers { display: flex; flex-direction: column; gap: 14px; }
.answer { display: grid; grid-template-columns: minmax(220px, 380px) 1fr; gap: 16px; background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 14px; }
@media (max-width: 720px) { .answer { grid-template-columns: 1fr; } }
.answer .photo { position: relative; background: #000; border-radius: 10px; overflow: hidden; aspect-ratio: 16 / 9; }
.answer .photo img { width: 100%; height: 100%; object-fit: contain; display: block; }
.answer .arrow { position: absolute; transform: translate(-50%, -100%); pointer-events: none; display: flex; flex-direction: column; align-items: center; }
.answer .arrow .lbl { background: var(--accent); color: #06130b; font-weight: 700; font-size: 13px; padding: 3px 8px; border-radius: 6px; white-space: nowrap; box-shadow: 0 2px 8px rgba(0,0,0,.5); }
.answer .arrow .tip { width: 0; height: 0; border-left: 9px solid transparent; border-right: 9px solid transparent; border-top: 14px solid var(--accent); }
.answer .arrow .ring { position: absolute; bottom: -12px; width: 20px; height: 20px; border: 3px solid var(--accent); border-radius: 50%; box-shadow: 0 0 0 2px rgba(0,0,0,.6); }
.answer .body { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.answer .head { display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; }
.answer .head h3 { margin: 0; font-size: 20px; font-weight: 800; }
.answer .q { color: var(--muted); font-style: italic; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 8px; }
.cardlet { background: #0f1218; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; }
.cardlet.safety { border-color: #5a2a2e; background: #1c1214; }
.cardlet h4 { margin: 0 0 6px; font-size: 13px; color: var(--muted); text-transform: uppercase; letter-spacing: .4px; }
.cardlet.safety h4 { color: #ff8b8f; }
.cardlet p { margin: 0; font-size: 14px; line-height: 1.35; }
.cardlet p.red { color: #ffb3b6; } .cardlet p.yellow { color: #ffd37a; } .cardlet p.green { color: #9be5b5; }
.note { color: var(--warn); font-size: 14px; }
.card .note { margin-top: 2px; }

/* ---- TruVideo branding on every page ---- */
.bar { flex-wrap: wrap; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text); }
.brand img { height: 22px; width: auto; display: block; }
.brand-name { font-size: 20px; font-weight: 700; letter-spacing: .2px; padding-left: 10px; border-left: 1px solid #3a4356; line-height: 1; }
.page-name { color: var(--muted); font-size: 20px; font-weight: 500; margin-left: -2px; }
.page-name::before { content: "· "; }
.brand-row { display: flex; align-items: center; gap: 8px; }
.session-title { font-size: 26px; font-weight: 800; margin: 6px 0 0; letter-spacing: -.2px; }
.session-title span { color: var(--muted); font-weight: 500; }
@media (max-width: 600px) { .brand-name, .page-name { font-size: 17px; } .brand img { height: 18px; } }

/* ---- the lens mirror (what the RayNeo wearer sees) ---- */
.lens { background: linear-gradient(170deg, #171c27, #11151d 70%); border: 1px solid var(--line); border-radius: 16px; padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 10px; box-shadow: 0 8px 24px rgba(0,0,0,.3); }
.lens-head { display: flex; align-items: center; gap: 10px; } .lens-head h2 { margin: 0; font-size: 16px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .4px; flex: 1; }
.lens-frame { position: relative; background: #000; border-radius: 12px; overflow: hidden; aspect-ratio: 4 / 3; max-height: 420px; display: grid; place-items: center; border: 1px solid #000; box-shadow: inset 0 0 60px rgba(0,0,0,.8); }
.lens-frame img { width: 100%; height: 100%; object-fit: contain; display: block; }
.lens-empty { color: var(--muted); font-size: 15px; position: absolute; }
.views { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 14px; }
.lens-frame.wide { aspect-ratio: 16 / 9; }
.badge.mix { color: #35c26d; border-color: #1f4a30; }
/* ---- /debug ---- */
.debug-columns { display: grid; grid-template-columns: repeat(auto-fit, minmax(380px, 1fr)); gap: 14px; align-items: start; }
.debug-col { gap: 12px; }
.debug-head { display: flex; flex-direction: column; gap: 6px; padding-bottom: 8px; border-bottom: 1px solid var(--line); }
.debug-col section.block h2 { margin-top: 4px; }
table.metrics td { padding: 4px 6px; border-bottom: 1px solid #1c2230; }
td.mname { color: var(--muted); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; }
td.mval { font-variant-numeric: tabular-nums; font-weight: 600; text-align: right; white-space: nowrap; }
td.mspark { width: 130px; }
.spark { width: 120px; height: 28px; display: block; } .spark-empty { display: inline-block; width: 120px; height: 28px; }
.hint { margin: 0; color: var(--muted); font-size: 14px; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px; }
.hint b { color: var(--text); }
