@import url("/static/vendor/pretendard/pretendard.css");

/* ---------- tokens ---------- */
:root {
  color-scheme: light;
  --bg: #f6f6f4; --bg-2: #efefec; --surface: #ffffff; --surface-2: #f4f4f2; --surface-3: #ebebe8;
  --line: rgba(15, 17, 20, 0.08); --line-2: rgba(15, 17, 20, 0.14);
  --text: #111316; --text-2: #4b5058; --muted: #868b93;
  --inv: #111316; --inv-ink: #ffffff;
  --accent: #2a78d6; --accent-soft: rgba(42, 120, 214, 0.10);
  --ok: #0a8f3c; --warn: #b77400; --bad: #d03b3b; --rec: #e5484d;
  --series-1: #2a78d6; --series-2: #eb6834; --div-pos: #2a78d6; --div-neg: #e34948; --div-mid: #c9c8c2;
  --grid: #ebeae5; --axis: #cfcec8; --band: rgba(42, 120, 214, 0.06);
  --stage-1: #f3f4f7; --stage-2: #dfe2e8; --stage-line: #b9bec9; --stage-shadow: 0.22;
  --glass: rgba(255, 255, 255, 0.72); --glass-line: rgba(15, 17, 20, 0.08);
  --avatar: #9aa1ad;
  --shadow-1: 0 1px 2px rgba(16, 18, 22, 0.04), 0 1px 1px rgba(16, 18, 22, 0.03);
  --shadow-2: 0 10px 30px rgba(16, 18, 22, 0.10), 0 2px 6px rgba(16, 18, 22, 0.06);
  --r-lg: 16px; --r-md: 12px; --r-sm: 9px;
  --font: "Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont, system-ui, "Apple SD Gothic Neo", "Segoe UI", sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #0a0b0d; --bg-2: #0e1013; --surface: #121418; --surface-2: #171a1f; --surface-3: #1e2127;
    --line: rgba(255, 255, 255, 0.065); --line-2: rgba(255, 255, 255, 0.12);
    --text: #eceef1; --text-2: #a3a9b2; --muted: #6e747d;
    --inv: #eceef1; --inv-ink: #0a0b0d;
    --accent: #4a90ea; --accent-soft: rgba(74, 144, 234, 0.14);
    --ok: #2fbf71; --warn: #f2b13d; --bad: #f06a6a; --rec: #ff5b5f;
    --series-1: #3987e5; --series-2: #d95926; --div-pos: #3987e5; --div-neg: #e66767; --div-mid: #3c3f45;
    --grid: #1f2228; --axis: #30343b; --band: rgba(57, 135, 229, 0.08);
    --stage-1: #1a1d23; --stage-2: #08090b; --stage-line: #2b313b; --stage-shadow: 0.5;
    --glass: rgba(18, 20, 24, 0.66); --glass-line: rgba(255, 255, 255, 0.08);
    --avatar: #b9bfca;
    --shadow-1: none; --shadow-2: 0 16px 40px rgba(0, 0, 0, 0.45);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0a0b0d; --bg-2: #0e1013; --surface: #121418; --surface-2: #171a1f; --surface-3: #1e2127;
  --line: rgba(255, 255, 255, 0.065); --line-2: rgba(255, 255, 255, 0.12);
  --text: #eceef1; --text-2: #a3a9b2; --muted: #6e747d;
  --inv: #eceef1; --inv-ink: #0a0b0d;
  --accent: #4a90ea; --accent-soft: rgba(74, 144, 234, 0.14);
  --ok: #2fbf71; --warn: #f2b13d; --bad: #f06a6a; --rec: #ff5b5f;
  --series-1: #3987e5; --series-2: #d95926; --div-pos: #3987e5; --div-neg: #e66767; --div-mid: #3c3f45;
  --grid: #1f2228; --axis: #30343b; --band: rgba(57, 135, 229, 0.08);
  --stage-1: #1a1d23; --stage-2: #08090b; --stage-line: #2b313b; --stage-shadow: 0.5;
  --glass: rgba(18, 20, 24, 0.66); --glass-line: rgba(255, 255, 255, 0.08);
  --avatar: #b9bfca;
  --shadow-1: none; --shadow-2: 0 16px 40px rgba(0, 0, 0, 0.45);
}

/* ---------- base ---------- */
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); font-family: var(--font); font-size: 14.5px;
  line-height: 1.5; -webkit-font-smoothing: antialiased; font-feature-settings: "ss06"; letter-spacing: -0.005em; }
a { color: inherit; text-decoration: none; }
h1 { font-size: 26px; line-height: 1.25; margin: 0; font-weight: 700; letter-spacing: -0.025em; }
h2 { font-size: 15px; margin: 0; font-weight: 650; letter-spacing: -0.01em; }
h3 { font-size: 12.5px; margin: 0 0 10px; font-weight: 600; color: var(--muted); letter-spacing: 0.01em; }
p { margin: 0; }
svg.i { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.dim { color: var(--text-2); }
.num { font-variant-numeric: tabular-nums; }
.row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.spacer { flex: 1; }
.small { font-size: 12.5px; }
.eyebrow { font-size: 12px; font-weight: 600; color: var(--muted); letter-spacing: 0.02em; margin-bottom: 6px; }
::selection { background: var(--accent-soft); }

/* ---------- controls ---------- */
.btn, button { font: inherit; font-weight: 550; font-size: 13.5px; display: inline-flex; align-items: center; justify-content: center;
  gap: 7px; height: 36px; padding: 0 14px; border-radius: var(--r-sm); border: 1px solid var(--line-2); background: var(--surface);
  color: var(--text); cursor: pointer; white-space: nowrap; transition: background .15s, border-color .15s, opacity .15s, transform .05s; }
.btn:hover, button:hover { background: var(--surface-2); }
.btn:active, button:active { transform: translateY(0.5px); }
button:disabled, .btn[aria-disabled="true"] { opacity: .4; cursor: default; }
.btn-primary { background: var(--inv); color: var(--inv-ink); border-color: transparent; }
.btn-primary:hover { background: var(--inv); opacity: .9; }
.btn-accent { background: var(--accent); color: #fff; border-color: transparent; }
.btn-accent:hover { background: var(--accent); opacity: .92; }
.btn-ghost { background: transparent; border-color: transparent; color: var(--text-2); }
.btn-ghost:hover { background: var(--surface-2); color: var(--text); }
.btn-danger { color: var(--bad); }
.btn-sm { height: 30px; padding: 0 10px; font-size: 12.5px; border-radius: 8px; }
.btn-icon { width: 36px; padding: 0; }
.btn-sm.btn-icon { width: 30px; }
input, select, textarea { font: inherit; font-size: 14px; color: var(--text); background: var(--surface); border: 1px solid var(--line-2);
  border-radius: var(--r-sm); height: 38px; padding: 0 12px; max-width: 100%; transition: border-color .15s, box-shadow .15s; }
select { padding-right: 30px; appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23868b93' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
button:focus-visible, .btn:focus-visible, a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.field { display: flex; flex-direction: column; gap: 6px; font-size: 12.5px; font-weight: 550; color: var(--text-2); }
.segmented { display: inline-flex; padding: 3px; gap: 2px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; flex-wrap: wrap; }
.segmented button { height: 28px; border: none; background: transparent; color: var(--text-2); padding: 0 11px; font-size: 12.5px; border-radius: 7px; }
.segmented button.on { background: var(--surface); color: var(--text); box-shadow: var(--shadow-1), 0 0 0 1px var(--line); }
.switch { position: relative; width: 38px; height: 22px; flex: none; }
.switch input { opacity: 0; width: 0; height: 0; position: absolute; }
.switch i { position: absolute; inset: 0; border-radius: 99px; background: var(--surface-3); border: 1px solid var(--line-2); transition: .2s; cursor: pointer; }
.switch i::after { content: ""; position: absolute; width: 16px; height: 16px; left: 2px; top: 2px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.3); transition: .2s; }
.switch input:checked + i { background: var(--accent); border-color: var(--accent); }
.switch input:checked + i::after { transform: translateX(16px); }

/* ---------- shell ---------- */
.shell { display: grid; grid-template-columns: 236px minmax(0, 1fr); min-height: 100vh; }
.sidebar { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 4px; padding: 18px 12px;
  border-right: 1px solid var(--line); background: var(--bg-2); }
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 10px 18px; font-weight: 750; font-size: 16px; letter-spacing: -0.02em; }
.brand-mark { width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; background: var(--inv); color: var(--inv-ink); }
.brand-mark svg { width: 17px; height: 17px; }
.brand small { display: block; font-size: 11px; font-weight: 500; color: var(--muted); letter-spacing: 0; margin-top: -2px; }
.nav-item { display: flex; align-items: center; gap: 11px; height: 38px; padding: 0 10px; border-radius: 9px; color: var(--text-2); font-weight: 550; font-size: 14px; }
.nav-item:hover { background: var(--surface-2); color: var(--text); }
.nav-item.on { background: var(--surface); color: var(--text); box-shadow: var(--shadow-1), 0 0 0 1px var(--line); }
.nav-item .kbd { margin-left: auto; font-size: 11px; color: var(--muted); }
.nav-sep { height: 1px; background: var(--line); margin: 10px 6px; }
.sensor-card { margin-top: auto; padding: 12px; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface); display: flex; flex-direction: column; gap: 9px; }
.sensor-card .top { display: flex; align-items: center; gap: 8px; font-size: 12.5px; font-weight: 600; }
.sensor-card .top .muted { font-weight: 500; margin-left: auto; }
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--bad); box-shadow: 0 0 0 3px color-mix(in srgb, var(--bad) 18%, transparent); flex: none; }
.status-dot.ok { background: var(--ok); box-shadow: 0 0 0 3px color-mix(in srgb, var(--ok) 18%, transparent); }
.status-dot.part { background: var(--warn); box-shadow: 0 0 0 3px color-mix(in srgb, var(--warn) 18%, transparent); }
.sensor-bars { display: grid; grid-template-columns: repeat(6, 1fr); gap: 4px; }
.sensor-bars i { height: 4px; border-radius: 2px; background: var(--surface-3); }
.sensor-bars i.ok { background: var(--ok); }
.sensor-bars i.warn { background: var(--warn); }
.me { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: 10px; cursor: pointer; border: none; background: transparent; height: auto; justify-content: flex-start; width: 100%; text-align: left; }
.me:hover { background: var(--surface-2); }
.avatar-chip { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-3); color: var(--text); font-weight: 700; font-size: 12.5px; border: 1px solid var(--line-2); flex: none; }
.me .who { min-width: 0; }
.me .who b { display: block; font-size: 13px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.me .who span { font-size: 11.5px; color: var(--muted); }
.mobile-top, .tabbar { display: none; }
main { min-width: 0; }
.page { max-width: 1240px; margin: 0 auto; padding: 30px 36px 56px; }
.page-head { display: flex; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 24px; }
.page-head .sub { color: var(--text-2); margin-top: 6px; font-size: 14px; }
.page-head .actions { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

@media (max-width: 860px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .sidebar { display: none; }
  .mobile-top { display: flex; align-items: center; gap: 10px; position: sticky; top: 0; z-index: 30; height: 54px; padding: 0 16px;
    background: color-mix(in srgb, var(--bg) 82%, transparent); backdrop-filter: blur(14px); border-bottom: 1px solid var(--line); }
  .mobile-top .brand { padding: 0; }
  .mobile-top .me { width: auto; padding: 4px; }
  .tabbar { display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; height: calc(62px + env(safe-area-inset-bottom));
    padding-bottom: env(safe-area-inset-bottom); background: color-mix(in srgb, var(--surface) 90%, transparent); backdrop-filter: blur(14px); border-top: 1px solid var(--line); }
  .tabbar a { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; font-size: 11px; font-weight: 600; color: var(--muted); }
  .tabbar a.on { color: var(--text); }
  .tabbar svg.i { width: 21px; height: 21px; }
  main { padding-bottom: calc(70px + env(safe-area-inset-bottom)); }
  .page { padding: 20px 16px 32px; }
  h1 { font-size: 22px; }
}

/* ---------- surfaces ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 20px; box-shadow: var(--shadow-1); min-width: 0; }
.card-head { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; flex-wrap: wrap; }
.card-head .note { font-size: 12px; color: var(--muted); }
.card-foot { margin-top: 12px; font-size: 12px; color: var(--muted); }
.grid { display: grid; gap: 16px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.g-main { grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr); }
@media (max-width: 1080px) { .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .g3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .g-main { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 640px) { .g2, .g3 { grid-template-columns: minmax(0, 1fr); } }
.kpi { display: flex; flex-direction: column; gap: 4px; padding: 18px 20px; }
.kpi .label { font-size: 12.5px; font-weight: 550; color: var(--text-2); display: flex; align-items: center; gap: 6px; }
.kpi .value { font-size: 30px; font-weight: 700; letter-spacing: -0.035em; line-height: 1.15; font-variant-numeric: tabular-nums; }
.kpi .value small { font-size: 14px; font-weight: 600; color: var(--muted); margin-left: 3px; letter-spacing: 0; }
.kpi .foot { font-size: 12px; color: var(--muted); }
.delta-up { color: var(--ok); font-weight: 600; }
.delta-down { color: var(--bad); font-weight: 600; }
.badge { display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 8px; border-radius: 6px; font-size: 11.5px; font-weight: 600;
  background: var(--surface-2); color: var(--text-2); border: 1px solid var(--line); white-space: nowrap; }
.badge-best { color: var(--series-2); background: color-mix(in srgb, var(--series-2) 10%, transparent); border-color: color-mix(in srgb, var(--series-2) 25%, transparent); }
.badge-best svg.i { width: 12px; height: 12px; fill: currentColor; stroke: none; }
.badge-live { color: var(--rec); background: color-mix(in srgb, var(--rec) 10%, transparent); border-color: color-mix(in srgb, var(--rec) 25%, transparent); }
.empty { text-align: center; padding: 56px 20px; }
.empty .ico { width: 52px; height: 52px; margin: 0 auto 14px; border-radius: 14px; display: grid; place-items: center; background: var(--surface-2); border: 1px solid var(--line); color: var(--text-2); }
.empty h2 { font-size: 17px; margin-bottom: 6px; }
.empty p { color: var(--text-2); max-width: 460px; margin: 0 auto 18px; }

/* exercise cards */
.ex-card { display: flex; flex-direction: column; gap: 16px; transition: border-color .15s; }
.ex-card:hover { border-color: var(--line-2); }
.ex-card .top { display: flex; align-items: flex-start; gap: 10px; }
.ex-card .name { font-size: 17px; font-weight: 700; letter-spacing: -0.02em; }
.ex-card .meta { font-size: 12.5px; color: var(--muted); }
.ex-card .facts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; padding: 12px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.ex-card .facts div { font-size: 11.5px; color: var(--muted); font-weight: 550; }
.ex-card .facts b { display: block; font-size: 20px; color: var(--text); font-weight: 700; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.spark { height: 34px; }

/* tables */
.table-wrap { overflow-x: auto; margin: 0 -20px; padding: 0 20px; }
table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
th { text-align: left; font-weight: 600; font-size: 12px; color: var(--muted); padding: 0 10px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: 12px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
tbody tr:last-child td { border-bottom: none; }
tr.click { cursor: pointer; }
tr.click:hover td { background: var(--surface-2); }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
.cell-title { font-weight: 600; }
.cell-sub { font-size: 12px; color: var(--muted); margin-top: 1px; }
.row-actions { display: flex; gap: 2px; justify-content: flex-end; opacity: .55; transition: opacity .15s; }
tr:hover .row-actions { opacity: 1; }
.score-pill { display: inline-flex; align-items: center; justify-content: flex-end; gap: 8px; font-weight: 700; font-variant-numeric: tabular-nums; }
.score-pill i { width: 46px; height: 5px; border-radius: 3px; background: var(--surface-3); position: relative; overflow: hidden; display: inline-block; }
.score-pill i::after { content: ""; position: absolute; inset: 0 auto 0 0; width: var(--w, 0%); background: var(--series-1); border-radius: 3px; }

/* ---------- live ---------- */
.live { display: grid; grid-template-columns: minmax(0, 1fr) 372px; height: 100vh; }
.stage { position: relative; min-height: 320px; overflow: hidden; }
.stage3d { background: radial-gradient(120% 90% at 50% 18%, var(--stage-1) 0%, var(--stage-2) 75%); }
.stage .view { position: absolute; inset: 0; }
.glass { background: var(--glass); border: 1px solid var(--glass-line); backdrop-filter: blur(16px) saturate(140%); -webkit-backdrop-filter: blur(16px) saturate(140%);
  border-radius: 14px; box-shadow: var(--shadow-2); }
.hud-tl { position: absolute; top: 16px; left: 16px; padding: 10px 12px; display: flex; flex-direction: column; gap: 8px; min-width: 230px; }
.hud-tl .title { display: flex; align-items: center; gap: 8px; font-size: 12.5px; font-weight: 650; }
.hud-tl .title .muted { margin-left: auto; font-weight: 500; }
.sensor-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.sensor { display: flex; flex-direction: column; gap: 1px; padding: 6px 8px; border-radius: 8px; background: color-mix(in srgb, var(--surface-2) 70%, transparent); border: 1px solid var(--line); font-size: 11.5px; color: var(--text-2); }
.sensor b { font-size: 12.5px; color: var(--text); font-variant-numeric: tabular-nums; display: flex; align-items: center; gap: 5px; }
.sensor b::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--bad); }
.sensor.ok b::before { background: var(--ok); }
.sensor.warn b::before { background: var(--warn); }
.hud-score { position: absolute; top: 16px; right: 16px; padding: 14px 16px; display: flex; align-items: center; gap: 14px; }
.ring { width: 76px; height: 76px; position: relative; flex: none; }
.ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring .track { stroke: var(--surface-3); }
.ring .bar { stroke: var(--series-2); transition: stroke-dashoffset .3s ease; }
.ring .val { position: absolute; inset: 0; display: grid; place-items: center; font-size: 24px; font-weight: 750; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.hud-score .lbl { font-size: 12px; color: var(--text-2); font-weight: 600; }
.hud-score .hint { font-size: 14px; font-weight: 650; max-width: 200px; line-height: 1.35; margin-top: 3px; }
.hud-score .prog { height: 4px; border-radius: 2px; background: var(--surface-3); margin-top: 8px; overflow: hidden; width: 180px; }
.hud-score .prog i { display: block; height: 100%; width: 0; background: var(--series-2); transition: width .15s linear; }
.dock { position: absolute; left: 50%; bottom: 20px; transform: translateX(-50%); padding: 8px; display: flex; align-items: center; gap: 8px; }
.dock .sep { width: 1px; height: 28px; background: var(--line-2); margin: 0 2px; }
.rec-btn { height: 46px; padding: 0 20px 0 16px; border-radius: 12px; background: var(--rec); color: #fff; border: none; font-size: 14px; font-weight: 650; gap: 10px; }
.rec-btn:hover { background: var(--rec); opacity: .92; }
.rec-btn .dot { width: 12px; height: 12px; border-radius: 50%; background: #fff; }
.rec-btn.on .dot { border-radius: 3px; animation: pulse 1.2s infinite; }
@keyframes pulse { 50% { opacity: .35; } }
.dock .timer { font-variant-numeric: tabular-nums; font-weight: 700; font-size: 15px; min-width: 56px; text-align: center; }
.dock .btn { height: 46px; border-radius: 12px; background: transparent; }
.dock .btn:hover { background: var(--surface-2); }
.key, .legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.countdown { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
  background: color-mix(in srgb, var(--stage-2) 55%, transparent); backdrop-filter: blur(3px); font-size: 15px; font-weight: 600; pointer-events: none; }
.countdown .n { font-size: 110px; font-weight: 800; line-height: 1; letter-spacing: -0.05em; }
.inspector { border-left: 1px solid var(--line); background: var(--surface); overflow-y: auto; display: flex; flex-direction: column; }
.insp-sec { padding: 18px 20px; border-bottom: 1px solid var(--line); display: flex; flex-direction: column; gap: 12px; }
.insp-sec:last-child { border-bottom: none; }
.insp-sec .head { display: flex; align-items: center; gap: 8px; }
.insp-sec .head h2 { font-size: 14px; }
.insp-sec .head .step { width: 20px; height: 20px; border-radius: 6px; display: grid; place-items: center; font-size: 11px; font-weight: 700; background: var(--surface-3); color: var(--text-2); }
.insp-sec .head .step.done { background: color-mix(in srgb, var(--ok) 16%, transparent); color: var(--ok); }
.insp-sec .desc { font-size: 12.5px; color: var(--text-2); }
.angle-list { display: grid; grid-template-columns: 1fr auto auto; gap: 7px 12px; font-size: 13px; align-items: baseline; }
.angle-list .v { font-weight: 650; font-variant-numeric: tabular-nums; text-align: right; }
.angle-list .r { color: var(--muted); font-variant-numeric: tabular-nums; text-align: right; font-size: 12px; }
@media (max-width: 1000px) {
  .live { grid-template-columns: minmax(0, 1fr); height: auto; }
  .stage { height: 62vh; }
  .inspector { border-left: none; border-top: 1px solid var(--line); }
}
@media (max-width: 860px) {
  .stage { height: calc(64vh - 54px); }
  .hud-tl { top: 10px; left: 10px; min-width: 0; padding: 8px 10px; }
  .hud-tl .sensor-grid { display: none; }
  .hud-score { top: 10px; right: 10px; padding: 10px 12px; gap: 10px; }
  .hud-score .text { display: none; }
  .ring { width: 58px; height: 58px; }
  .ring .val { font-size: 19px; }
  .dock { bottom: 12px; }
}

/* ---------- motion detail ---------- */
.player { position: relative; height: 440px; border-radius: var(--r-md); overflow: hidden; border: 1px solid var(--line); }
.player .view { position: absolute; inset: 0; }
.player-bar { display: flex; gap: 10px; align-items: center; margin-top: 12px; }
.player-bar input[type=range] { flex: 1; height: auto; padding: 0; border: none; background: transparent; accent-color: var(--text); box-shadow: none; }
.timeline { position: relative; height: 8px; margin: 8px 46px 0 46px; }
.timeline i { position: absolute; top: 0; height: 8px; border-radius: 4px; background: color-mix(in srgb, var(--series-1) 22%, transparent); }
.score-hero { display: flex; align-items: center; gap: 18px; }
.score-hero .ring { width: 92px; height: 92px; }
.score-hero .ring .val { font-size: 30px; }
.score-hero .ring .bar { stroke: var(--series-1); }
.facts-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0; border: 1px solid var(--line); border-radius: var(--r-md); overflow: hidden; }
.facts-row div { padding: 12px 14px; border-right: 1px solid var(--line); font-size: 12px; color: var(--muted); font-weight: 550; }
.facts-row div:last-child { border-right: none; }
.facts-row b { display: block; font-size: 18px; color: var(--text); font-weight: 700; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.feedback { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; }
.feedback li { display: flex; gap: 10px; align-items: flex-start; padding: 11px 12px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--line); font-size: 13.5px; line-height: 1.45; }
.feedback li .n { width: 20px; height: 20px; border-radius: 6px; display: grid; place-items: center; flex: none; font-size: 11px; font-weight: 700; background: var(--surface-3); color: var(--text-2); }
.feedback li.top .n { background: var(--series-2); color: #fff; }
.moment { display: flex; align-items: center; gap: 10px; width: 100%; justify-content: flex-start; height: 40px; text-align: left; }
.moment .t { margin-left: auto; color: var(--muted); font-variant-numeric: tabular-nums; font-size: 12.5px; }
@media (max-width: 640px) { .player { height: 340px; } .timeline { margin: 8px 0 0; } }

/* ---------- auth ---------- */
.auth-wrap { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); }
.auth-art { position: relative; overflow: hidden; border-right: 1px solid var(--line); }
.auth-art .view { position: absolute; inset: 0; }
.auth-art .copy { position: absolute; left: 40px; bottom: 40px; right: 40px; }
.auth-art .copy h1 { font-size: 34px; letter-spacing: -0.035em; }
.auth-art .copy p { color: var(--text-2); margin-top: 10px; font-size: 15px; max-width: 420px; }
.auth-form { display: flex; align-items: center; justify-content: center; padding: 32px 20px; }
.auth-card { width: 100%; max-width: 380px; display: flex; flex-direction: column; gap: 16px; }
.auth-card .tabs-2 { display: grid; grid-template-columns: 1fr 1fr; }
.auth-card .tabs-2 button { width: 100%; }
.choice { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.choice button { height: 64px; flex-direction: column; gap: 2px; border-radius: 12px; }
.choice button.on { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.choice button span { font-size: 11.5px; color: var(--muted); font-weight: 500; }
.err { color: var(--bad); font-size: 12.5px; min-height: 18px; }
@media (max-width: 860px) { .auth-wrap { grid-template-columns: minmax(0, 1fr); } .auth-art { display: none; } }

/* ---------- toast / dialog ---------- */
.toast { position: fixed; right: 24px; bottom: 24px; z-index: 60; max-width: min(460px, calc(100vw - 32px)); padding: 14px 16px; border-radius: 14px;
  background: var(--inv); color: var(--inv-ink); box-shadow: var(--shadow-2); font-size: 13.5px; line-height: 1.5; display: flex; gap: 10px; align-items: flex-start; }
.toast a { text-decoration: underline; font-weight: 700; }
@media (max-width: 860px) { .toast { left: 16px; right: 16px; bottom: calc(76px + env(safe-area-inset-bottom)); } }
dialog { border: 1px solid var(--line); border-radius: 18px; background: var(--surface); color: var(--text); padding: 22px; width: min(420px, calc(100vw - 32px)); box-shadow: var(--shadow-2); }
dialog::backdrop { background: rgba(5, 6, 8, 0.5); backdrop-filter: blur(3px); }
dialog form { display: flex; flex-direction: column; gap: 14px; }
dialog h2 { font-size: 17px; }

/* ---------- charts ---------- */
.viz { width: 100%; height: auto; display: block; overflow: visible; font-family: var(--font); }
.viz-grid { stroke: var(--grid); stroke-width: 1; }
.viz-base { stroke: var(--axis); stroke-width: 1; }
.viz-tick { fill: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; }
.viz-label { fill: var(--text-2); font-size: 12px; font-weight: 500; }
.viz-value { fill: var(--text); font-size: 12px; font-weight: 600; font-variant-numeric: tabular-nums; }
.viz-line { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.viz-dot { stroke: var(--surface); stroke-width: 2; }
.viz-dot-hi { stroke: var(--text); }
.viz-bar.lift, .viz-bar-hi { filter: brightness(1.15); }
.viz-cross { stroke: var(--muted); stroke-width: 1; stroke-dasharray: 3 3; }
.viz-head { stroke: var(--text); stroke-width: 1.5; }
.viz-band { fill: var(--band); }
.viz-band-label { fill: var(--muted); font-size: 10px; font-weight: 600; }
.viz-tip { position: fixed; z-index: 70; display: none; pointer-events: none; background: var(--surface); color: var(--text); border: 1px solid var(--line-2);
  border-radius: 10px; padding: 9px 11px; font-size: 12px; box-shadow: var(--shadow-2); }
.viz-tip-title { color: var(--text-2); margin-bottom: 5px; font-weight: 550; }
.viz-tip-row { display: flex; align-items: center; gap: 7px; }
.viz-tip-row strong { font-size: 13px; font-variant-numeric: tabular-nums; }
.viz-tip-row span { color: var(--text-2); }
.viz-key-line { width: 12px; height: 3px; border-radius: 2px; display: inline-block; }
details.table-view summary { cursor: pointer; font-size: 12.5px; color: var(--text-2); margin-top: 10px; }

/* ---------- exercise chip on the stage + Android app (phone is the live screen) ---------- */
.ex-chip { height: 30px; padding: 0 10px; font-size: 12.5px; border-radius: 8px; justify-content: flex-start; gap: 6px; background: color-mix(in srgb, var(--surface-2) 70%, transparent); }
.ex-chip svg.i { width: 14px; height: 14px; }
@media (min-width: 861px) { .ex-chip { display: none; } }
.in-app body[data-page="live"] .mobile-top { display: none; }
@media (max-width: 860px) {
  .in-app body[data-page="live"] .stage { height: calc(100svh - 62px - env(safe-area-inset-bottom)); }
  .in-app .hud-tl { top: calc(10px + env(safe-area-inset-top)); }
  .in-app .hud-score { top: calc(10px + env(safe-area-inset-top)); }
  .rec-btn { height: 52px; padding: 0 22px 0 18px; font-size: 15px; }
  .dock .btn { height: 52px; }
}
@media (max-width: 560px) {
  .dock .btn span.lbl-long { display: none; }
  .dock .btn { width: 52px; padding: 0; }
  .dock { gap: 6px; padding: 6px; }
  .dock .timer { min-width: 46px; }
}

.stage-note { position: absolute; left: 50%; top: 42%; transform: translate(-50%, -50%); padding: 16px 20px; max-width: min(380px, calc(100% - 32px));
  display: flex; flex-direction: column; gap: 6px; text-align: center; }
.stage-note b { font-size: 16px; }
.stage-note span { font-size: 13px; color: var(--text-2); }

/* watching the phone's live stream: only the comparison and angles matter here */
.inspector.relay .insp-sec:nth-child(1), .inspector.relay .insp-sec:nth-child(2), .inspector.relay .switch { display: none; }
