/* Hyletic Platform app (capture node). An operations tool: dark by default (light available), dense panels,
   title bar + navigation + status bar. Brand: Inter / JetBrains Mono, one signal orange, steel blue. */
:root, :root[data-theme="dark"] {
  --bg: #0c0d0f; --bg1: #111316; --bg2: #16181c; --bg3: #1c1f24; --hover: #20242a;
  --line: #23272d; --line2: #30353d;
  --fg: #e6e7e9; --fg2: #a4a9b1; --fg3: #6c727c;
  --acc: #f08a2c; --acc2: #f5a35a; --acc-bg: rgba(240,138,44,.12);
  --steel: #6fa3c4; --steel-bg: rgba(111,163,196,.12);
  --ok: #3fb27f; --ok-bg: rgba(63,178,127,.12);
  --bad: #e5534b; --bad-bg: rgba(229,83,75,.12);
  --warn: #e0a43a; --warn-bg: rgba(224,164,58,.12);
  --shadow: 0 16px 48px -12px rgba(0,0,0,.6), 0 0 0 1px rgba(255,255,255,.04);
  --cam: #08090a;
  color-scheme: dark;
}
:root[data-theme="light"] {
  --bg: #f4f4f2; --bg1: #fbfbfa; --bg2: #ffffff; --bg3: #f1f1ee; --hover: #ecebe7;
  --line: #e3e2de; --line2: #cfcec8;
  --fg: #141518; --fg2: #4a4d53; --fg3: #8a8e96;
  --acc: #e2730f; --acc2: #b85a06; --acc-bg: rgba(226,115,15,.1);
  --steel: #3b6d8c; --steel-bg: rgba(59,109,140,.1);
  --ok: #24855a; --ok-bg: rgba(36,133,90,.1);
  --bad: #c0362f; --bad-bg: rgba(192,54,47,.08);
  --warn: #a8700f; --warn-bg: rgba(168,112,15,.1);
  --shadow: 0 16px 48px -12px rgba(17,18,20,.28), 0 0 0 1px rgba(17,18,20,.05);
  --cam: #e6e5e1;
  color-scheme: light;
}
:root {
  --f: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --m: "JetBrains Mono", ui-monospace, Menlo, Consolas, monospace;
  --tb: 44px; --nav: 212px; --sb: 26px; --r: 6px;
  --ease: cubic-bezier(.2,.8,.2,1);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { height: 100%; }
body { margin: 0; background: var(--bg); color: var(--fg); font: 13px/1.45 var(--f); -webkit-font-smoothing: antialiased; overflow: hidden; }
.mono { font-family: var(--m); }
.muted { color: var(--fg3); }
.xs { font-size: 11px; }
a { color: inherit; }
h1, h2, h3 { margin: 0; font-weight: 600; letter-spacing: -.01em; }
kbd { font: 500 10px var(--m); color: var(--fg2); border: 1px solid var(--line2); border-radius: 3px; padding: 0 4px; background: var(--bg3); }
i[data-icon] { display: inline-flex; width: 15px; height: 15px; flex: none; }
i[data-icon] svg { width: 100%; height: 100%; }
::selection { background: var(--acc-bg); }
* { scrollbar-width: thin; scrollbar-color: var(--line2) transparent; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--line2); border-radius: 6px; border: 2px solid var(--bg); }
::-webkit-scrollbar-track { background: transparent; }

/* ------------------------------------------------------------------ controls */
.btn { display: inline-flex; align-items: center; gap: 7px; height: 30px; padding: 0 12px; border-radius: var(--r); border: 1px solid var(--line2);
  background: var(--bg3); color: var(--fg); font: 500 12.5px var(--f); text-decoration: none; cursor: pointer; white-space: nowrap; transition: background .12s, border-color .12s, color .12s; }
.btn:hover:not(:disabled) { background: var(--hover); border-color: var(--fg3); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.primary:disabled { background: var(--bg3); color: var(--fg3); border-color: var(--line2); opacity: 1; }
.btn.primary { background: var(--acc); border-color: var(--acc); color: #111; }
.btn.primary:hover:not(:disabled) { background: var(--acc2); border-color: var(--acc2); }
.btn.danger { color: var(--bad); }
.btn.danger.solid { background: var(--bad); border-color: var(--bad); color: #fff; }
.btn.ok.solid { background: var(--ok); border-color: var(--ok); color: #fff; }
.btn.ghost { background: transparent; border-color: transparent; color: var(--fg2); }
.btn.ghost:hover:not(:disabled) { background: var(--hover); color: var(--fg); border-color: transparent; }
.btn.sm { height: 28px; padding: 0 10px; font-size: 12px; }
.btn.lg { height: 38px; padding: 0 16px; font-size: 13.5px; }
.btn.block { width: 100%; justify-content: center; }
.btn.icon { width: 28px; padding: 0; justify-content: center; }
input, select, textarea { font: 12.5px var(--f); color: var(--fg); background: var(--bg1); border: 1px solid var(--line2); border-radius: var(--r); padding: 5px 8px; min-width: 0; height: 28px; }
textarea { height: auto; resize: vertical; line-height: 1.5; }
input[type=checkbox] { height: auto; accent-color: var(--acc); }
input[type=range] { accent-color: var(--acc); height: auto; padding: 0; border: 0; background: transparent; }
input[type=range]::-moz-range-track { background: var(--line2); height: 3px; border-radius: 2px; }
input[type=range]::-moz-range-progress { background: var(--acc); height: 3px; border-radius: 2px; }
input[type=range]::-moz-range-thumb { background: var(--acc); border: 0; width: 12px; height: 12px; border-radius: 50%; }
input[type=range]::-webkit-slider-runnable-track { background: var(--line2); height: 3px; border-radius: 2px; }
input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; background: var(--acc); width: 12px; height: 12px; border-radius: 50%; margin-top: -4.5px; }
input.mono { font-family: var(--m); font-size: 12px; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--steel); box-shadow: 0 0 0 2px var(--steel-bg); }
.btn:focus-visible, button:focus-visible, a:focus-visible { outline: 2px solid var(--steel); outline-offset: 1px; }
.search { width: 260px; }
label.inline { display: inline-flex; align-items: center; gap: 6px; color: var(--fg3); }
label.inline input { width: 120px; }
.row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.chip { display: inline-flex; align-items: center; gap: 5px; height: 20px; padding: 0 7px; border-radius: 4px; font: 500 10.5px var(--m); letter-spacing: .02em;
  background: var(--bg3); color: var(--fg2); border: 1px solid var(--line); white-space: nowrap; margin: 0; }
.chip.ok { color: var(--ok); background: var(--ok-bg); border-color: transparent; }
.chip.bad { color: var(--bad); background: var(--bad-bg); border-color: transparent; }
.chip.warn { color: var(--warn); background: var(--warn-bg); border-color: transparent; }
.chip.acc { color: var(--acc); background: var(--acc-bg); border-color: transparent; }
.chip.info { color: var(--steel); background: var(--steel-bg); border-color: transparent; }
.led { width: 7px; height: 7px; border-radius: 50%; background: var(--fg3); flex: none; display: inline-block; }
.led.ok { background: var(--ok); } .led.warn { background: var(--warn); } .led.bad { background: var(--bad); }
.led.rec { background: var(--bad); box-shadow: 0 0 0 3px var(--bad-bg); animation: blink 1s infinite; }
@keyframes blink { 50% { opacity: .35; } }
.spin { display: inline-block; width: 12px; height: 12px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .8s linear infinite; vertical-align: -2px; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ------------------------------------------------------------------ frame: title bar, nav, content, status bar */
.titlebar { position: fixed; inset: 0 0 auto 0; height: var(--tb); display: flex; align-items: center; gap: 12px; padding: 0 12px 0 14px;
  background: var(--bg1); border-bottom: 1px solid var(--line); z-index: 30; }
.brand { display: inline-flex; align-items: center; gap: 9px; text-decoration: none; width: calc(var(--nav) - 26px); }
.brand img { width: 20px; height: 20px; }
.wordmark { font: 600 13px/1 "Cormorant Garamond", Garamond, serif; letter-spacing: .32em; text-transform: uppercase; }
.product { font: 500 11.5px var(--f); color: var(--fg3); }
.tb-sep { width: 1px; height: 20px; background: var(--line); }
.tb-node { color: var(--fg3); font-size: 11.5px; }
.tb-session { display: inline-flex; align-items: center; gap: 8px; height: 28px; padding: 0 10px; border-radius: var(--r); background: var(--bg3); border: 1px solid var(--line); margin-left: 6px; }
.tb-session .tb-state { font: 600 11px var(--m); letter-spacing: .06em; text-transform: uppercase; color: var(--fg2); }
.tb-session .tb-meta { color: var(--fg2); font-size: 11.5px; }
.tb-session.rec { border-color: rgba(229,83,75,.45); background: var(--bad-bg); }
.tb-session.rec .tb-state { color: var(--bad); }
.tb-session.live .tb-state { color: var(--acc); }
.tb-actions { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.palette-btn { width: 230px; justify-content: flex-start; border: 1px solid var(--line) !important; background: var(--bg) !important; color: var(--fg3) !important; }
.palette-btn kbd { margin-left: auto; }

.nav { position: fixed; top: var(--tb); bottom: var(--sb); left: 0; width: var(--nav); background: var(--bg1); border-right: 1px solid var(--line); padding: 6px 8px; display: flex; flex-direction: column; gap: 1px; overflow-y: auto; z-index: 20; }
.nav-grp { margin: 14px 8px 4px; font: 600 10px var(--m); letter-spacing: .1em; text-transform: uppercase; color: var(--fg3); }
.nav a, .nav-item { display: flex; align-items: center; gap: 10px; height: 30px; padding: 0 8px; border-radius: var(--r); color: var(--fg2); text-decoration: none; font: 500 12.5px var(--f); border: 0; background: none; cursor: pointer; width: 100%; text-align: left; position: relative; }
.nav a:hover, .nav-item:hover { background: var(--hover); color: var(--fg); }
.nav a.on { background: var(--bg3); color: var(--fg); }
.nav a.on::before { content: ""; position: absolute; left: -8px; top: 7px; bottom: 7px; width: 2px; border-radius: 2px; background: var(--acc); }
.nav a.on i[data-icon] { color: var(--acc); }
.nav i[data-icon] { color: var(--fg3); }
.nav-badge { margin-left: auto; font: 500 10.5px var(--m); color: var(--fg3); }
.nav-badge.rec { color: #fff; background: var(--bad); border-radius: 3px; padding: 0 5px; animation: blink 1.2s infinite; }
.nav-dot { margin-left: auto; width: 6px; height: 6px; border-radius: 50%; background: var(--ok); }
.nav-foot { margin-top: auto; border-top: 1px solid var(--line); padding-top: 6px; }

.content { position: fixed; top: var(--tb); bottom: var(--sb); left: var(--nav); right: 0; overflow: auto; padding: 18px 22px 22px; }
.statusbar { position: fixed; inset: auto 0 0 0; height: var(--sb); display: flex; align-items: center; background: var(--bg1); border-top: 1px solid var(--line); font-size: 11px; color: var(--fg3); z-index: 30; padding: 0 6px; }
.sb { display: inline-flex; align-items: center; gap: 6px; padding: 0 9px; height: 100%; white-space: nowrap; border: 0; background: none; color: inherit; font: inherit; }
.sb b { color: var(--fg2); font-weight: 500; }
.sb-fill { flex: 1; }
.sb-btn { cursor: pointer; }
.sb-btn:hover { background: var(--hover); color: var(--fg); }
.sb i[data-icon] { width: 12px; height: 12px; }

/* ------------------------------------------------------------------ views */
.view { display: none; }
.view.on { display: block; animation: vin .18s ease-out; }
.view { max-width: 1680px; }
.view.fill.on { display: flex; flex-direction: column; min-height: 100%; }
@keyframes vin { from { opacity: 0; } }
.vh { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 14px; flex-wrap: wrap; }
.vh h1 { font-size: 17px; }
.vh .sub { margin: 2px 0 0; color: var(--fg3); font-size: 12px; }
.panel { background: var(--bg2); border: 1px solid var(--line); border-radius: 8px; padding: 12px 14px; min-width: 0; }
.panel.flush { padding: 0; }
.ph { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 10px; min-height: 22px; }
.ph h2 { font-size: 11px; font-weight: 600; letter-spacing: .07em; text-transform: uppercase; color: var(--fg2); font-family: var(--m); }
.ph-link:hover { text-decoration: underline; color: var(--fg); }
.ph-link { color: var(--fg2); font: 500 12px var(--f); text-decoration: none; background: none; border: 0; cursor: pointer; padding: 0; }
.ph-link:hover { text-decoration: underline; }
.sub-ph { margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--line); }
.empty { color: var(--fg3); padding: 14px 4px; font-size: 12.5px; }

/* tables */
.tw { overflow: auto; }
.tbl { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.tbl th { text-align: left; font: 500 10.5px var(--m); color: var(--fg3); text-transform: uppercase; letter-spacing: .05em; padding: 7px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; position: sticky; top: 0; background: var(--bg2); }
.tbl td { padding: 7px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl .num { text-align: right; font-variant-numeric: tabular-nums; }
.tbl.hover tbody tr, .tbl.sel tbody tr { cursor: pointer; }
.tbl.hover tbody tr:hover, .tbl.sel tbody tr:hover { background: var(--hover); }
.tbl.sel tbody tr.on { background: var(--bg3); box-shadow: inset 2px 0 0 var(--acc); }
.tbl tr.fresh { animation: fresh 1.4s ease-out; }
@keyframes fresh { from { background: var(--acc-bg); } }
.id { font-family: var(--m); font-size: 12px; color: var(--fg); }

/* ------------------------------------------------------------------ dashboard */
.tiles { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; margin-bottom: 10px; }
.tile { background: var(--bg2); border: 1px solid var(--line); border-radius: 8px; padding: 11px 13px; display: grid; gap: 3px; min-width: 0; }
.tile .tl { display: flex; align-items: center; gap: 7px; font: 500 10.5px var(--m); color: var(--fg3); text-transform: uppercase; letter-spacing: .06em; }
.tile .tv { font-size: 20px; font-weight: 600; letter-spacing: -.02em; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tile .ts { font-size: 11.5px; color: var(--fg3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dash { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.span2 { grid-column: span 2; }
.dash { align-items: start; }
.cam-empty.start { justify-items: start; text-align: left; padding: 18px 20px; border-style: solid; background: var(--bg2); }
.cam-empty.start .t { color: var(--fg); font-weight: 500; }
.gs { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.gs li { display: flex; align-items: center; gap: 10px; color: var(--fg2); }
.gs .num { width: 20px; height: 20px; border-radius: 50%; border: 1px solid var(--line2); display: grid; place-items: center; font: 500 11px var(--m); color: var(--fg3); }
.gs li.done .num { background: var(--ok-bg); color: var(--ok); border-color: transparent; }
.gs li.done a, .gs li.done .ph-link { color: var(--fg3); text-decoration: line-through; }
.gs a { color: var(--fg); text-decoration: none; } .gs a:hover { text-decoration: underline; }
.gs .num i svg { width: 12px; height: 12px; }
.mosaic { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 8px; }
.actions { display: grid; gap: 6px; }
.actions .btn { justify-content: flex-start; height: 34px; }
.actions .btn .k { margin-left: auto; }
.stages { list-style: none; margin: 0; padding: 0; display: grid; }
.stages li { display: flex; align-items: center; gap: 10px; padding: 8px 2px; border-bottom: 1px solid var(--line); }
.stages li:last-child { border-bottom: 0; }
.stages .n { font-weight: 500; }
.stages .d { color: var(--fg3); font-size: 11.5px; }
.stages .chip { margin-left: auto; }
.stages a { text-decoration: none; display: contents; }

/* ------------------------------------------------------------------ cameras */
.cam { position: relative; aspect-ratio: 16 / 9; background: var(--cam); border-radius: 6px; overflow: hidden; border: 1px solid var(--line); }
.cam img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; display: block; }
.cam .ov { position: absolute; left: 0; right: 0; top: 0; display: flex; gap: 6px; align-items: center; padding: 6px 8px; font: 500 10.5px var(--m); color: #e6e7e9;
  background: linear-gradient(rgba(0,0,0,.6), transparent); }
.cam .ov .r { margin-left: auto; color: #b9bec6; }
.cam .recb { position: absolute; right: 8px; bottom: 8px; display: inline-flex; align-items: center; gap: 5px; background: rgba(0,0,0,.6); color: #fff; border-radius: 3px; padding: 2px 6px; font: 600 10px var(--m); letter-spacing: .08em; }
.cam .recb::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--bad); animation: blink 1s infinite; }
.cam.wait::after { content: "no signal"; position: absolute; inset: 0; display: grid; place-items: center; font: 11px var(--m); color: var(--fg3); }
.cam-empty { grid-column: 1 / -1; border: 1px dashed var(--line2); border-radius: 8px; padding: 26px; text-align: center; color: var(--fg3); display: grid; gap: 10px; justify-items: center; }

/* ------------------------------------------------------------------ session (studio) */
.studio { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 10px; flex: 1; min-height: 0; margin-bottom: 10px; }
.monitor { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.cams { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 8px; align-content: start; }
.cams.n1 { grid-template-columns: 1fr; }
.cams.n2, .cams.n3, .cams.n4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.streams { display: flex; flex-wrap: wrap; gap: 6px; }
.stream { display: inline-flex; align-items: center; gap: 7px; height: 24px; padding: 0 8px; border-radius: 4px; background: var(--bg2); border: 1px solid var(--line); font: 11px var(--m); color: var(--fg2); }
.stream .bar { width: 36px; height: 3px; border-radius: 2px; background: var(--line2); overflow: hidden; }
.stream .bar i { display: block; height: 100%; background: var(--ok); }
.stream.bad { border-color: rgba(224,164,58,.4); }
.stream.bad .bar i { background: var(--warn); }
.inspector { display: flex; flex-direction: column; gap: 10px; min-width: 0; overflow: auto; }
.state { font: 600 10.5px var(--m); letter-spacing: .08em; text-transform: uppercase; padding: 2px 7px; border-radius: 4px; background: var(--bg3); color: var(--fg2); }
.state.rec { background: var(--bad); color: #fff; }
.state.slate { background: var(--steel-bg); color: var(--steel); }
.state.ready { background: var(--acc-bg); color: var(--acc); }
.state.done { background: var(--ok-bg); color: var(--ok); }
.ep.recording { border-color: rgba(229,83,75,.55); box-shadow: 0 0 0 1px rgba(229,83,75,.25) inset; }
.ep-task { font-size: 11px; color: var(--acc); text-transform: uppercase; letter-spacing: .05em; }
.ep-instr { font-size: 17px; font-weight: 600; line-height: 1.3; margin: 4px 0 8px; letter-spacing: -.01em; }
.ep-clock { font-size: 30px; font-weight: 500; letter-spacing: -.01em; color: var(--fg3); font-variant-numeric: tabular-nums; margin-bottom: 10px; }
.ep.recording .ep-clock { color: var(--bad); }
.ep-actions { display: grid; gap: 6px; grid-template-columns: 1fr; }
.ep-actions.three { grid-template-columns: repeat(3, 1fr); }
.ep-actions .btn { height: 40px; justify-content: center; font-size: 13.5px; }
.ep-actions .wait { display: flex; align-items: center; gap: 8px; color: var(--fg3); font-size: 12px; height: 40px; }
.hint { margin: 10px 0 0; color: var(--fg3); font-size: 11px; }
.slate { position: relative; display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; margin-bottom: 10px; padding-bottom: 6px; }
.sstep { font: 500 10.5px var(--m); text-align: center; padding: 5px 0; border-radius: 4px; background: var(--bg3); color: var(--fg3); }
.sstep.on { background: var(--steel-bg); color: var(--steel); }
.sstep.past { color: var(--ok); }
.sbar { position: absolute; left: 0; bottom: 0; height: 2px; background: var(--steel); width: 0; transition: width .15s linear; border-radius: 1px; }
.queue { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; max-height: 190px; overflow: auto; counter-reset: q; }
.queue li { display: flex; align-items: center; gap: 8px; padding: 5px 6px; border-radius: 4px; font-size: 12px; color: var(--fg2); counter-increment: q; }
.queue li::before { content: counter(q, decimal-leading-zero); font: 10.5px var(--m); color: var(--fg3); width: 18px; }
.queue li.done { color: var(--fg3); text-decoration: line-through; text-decoration-color: var(--line2); }
.queue li.done::after { content: "✓"; margin-left: auto; color: var(--ok); text-decoration: none; }
.queue li.cur { background: var(--acc-bg); color: var(--fg); }
.queue li.cur::before { color: var(--acc); }
.kv { display: grid; grid-template-columns: 90px 1fr; gap: 5px 10px; margin: 0; font-size: 12.5px; }
.kv dt { color: var(--fg3); font-size: 11.5px; }
.kv dd { margin: 0; font-family: var(--m); font-size: 12px; overflow-wrap: anywhere; }
.tablet-row { display: flex; gap: 10px; align-items: center; font-size: 12px; color: var(--fg2); }
.tablet-row img { width: 96px; height: 96px; border-radius: 4px; background: #fff; padding: 4px; cursor: zoom-in; flex: none; }
.tabs-panel { padding: 0; }
.tabs { display: flex; align-items: center; gap: 2px; border-bottom: 1px solid var(--line); padding: 0 8px; }
.tabs button { border: 0; background: none; color: var(--fg3); font: 500 12px var(--f); padding: 9px 10px; cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs button[aria-selected="true"] { color: var(--fg); border-bottom-color: var(--acc); }
.tabs button b { font: 500 10.5px var(--m); color: var(--fg3); margin-left: 4px; }
.tabs-right { margin-left: auto; padding-right: 6px; }
.tab-body { max-height: 260px; overflow: auto; }
.log { list-style: none; margin: 0; padding: 6px 10px; font-size: 11.5px; display: grid; }
.log li { padding: 3px 0; color: var(--fg2); overflow-wrap: anywhere; border-bottom: 1px solid var(--line); }
.log li:last-child { border: 0; }
.log li.warn { color: var(--warn); }
.log li .t { color: var(--fg3); margin-right: 10px; }
.badge { display: inline-flex; align-items: center; font: 500 10.5px var(--m); padding: 1px 6px; border-radius: 3px; background: var(--bg3); color: var(--fg2); white-space: nowrap; }
.badge.success { color: var(--ok); background: var(--ok-bg); }
.badge.failure, .badge.aborted { color: var(--bad); background: var(--bad-bg); }
.badge.redo { color: var(--steel); background: var(--steel-bg); }

/* ------------------------------------------------------------------ list + inspector (rig, calibration) */
.split { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 10px; flex: 1; min-height: 0; }
.split.bottom { grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); flex: none; }
.list-panel { overflow: auto; }
.inspector-panel { overflow: auto; display: flex; flex-direction: column; gap: 12px; }
.dirty { font: 500 11px var(--m); color: var(--warn); }
.detected { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 4px; }
.detected li { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border: 1px solid var(--line); border-radius: 5px; font-size: 12px; }
.detected li .btn, .detected li .chip { margin-left: auto; }
.detected-name { min-width: 0; overflow-wrap: anywhere; }
.detected-name > span { display: block; margin-top: 3px; }
.form { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 10px; }
.form label { display: grid; gap: 4px; font: 500 10.5px var(--m); color: var(--fg3); text-transform: uppercase; letter-spacing: .05em; }
.form .full { grid-column: 1 / -1; }
.task-list { display: grid; gap: 16px; max-width: 1000px; }
.task-card { padding: 18px; }
.task-card .ph { padding: 0 0 16px; }
.task-card .form { grid-template-columns: minmax(0, 1fr) 140px; }
.task-card textarea { min-height: 76px; }
.task-card .field-help { font: 11px var(--f); text-transform: none; letter-spacing: 0; color: var(--fg3); }
.task-error { color: var(--acc); }
.form .chk { display: flex; align-items: center; gap: 8px; text-transform: none; letter-spacing: 0; font: 12px var(--f); color: var(--fg2); }
.insp-head { display: flex; align-items: center; gap: 10px; }
.insp-head h3 { font-size: 15px; overflow-wrap: anywhere; min-width: 0; }
.insp-head .btn { margin-left: auto; }
.insp-note { font-size: 11.5px; color: var(--fg3); margin: 0; }
.devicon { width: 26px; height: 26px; border-radius: 5px; display: grid; place-items: center; background: var(--bg3); color: var(--fg2); }
.devicon i[data-icon] { width: 14px; height: 14px; }
.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.steps li { display: flex; align-items: center; gap: 12px; padding: 10px; border-radius: 6px; cursor: pointer; border: 1px solid transparent; }
.steps li:hover { background: var(--hover); }
.steps li.on { background: var(--bg3); border-color: var(--line2); }
.steps .num { width: 24px; height: 24px; border-radius: 50%; border: 1px solid var(--line2); display: grid; place-items: center; font: 500 11px var(--m); color: var(--fg3); flex: none; }
.steps .t { font-weight: 500; }
.steps .d { color: var(--fg3); font-size: 11.5px; }
.steps .chip { margin-left: auto; }
.illus { width: 100%; height: 180px; border-radius: 6px; background: var(--bg); border: 1px solid var(--line); }

/* ------------------------------------------------------------------ viewer, retarget, datasets */
.seg { display: inline-flex; background: var(--bg1); border: 1px solid var(--line2); border-radius: var(--r); padding: 2px; gap: 2px; }
.seg button { border: 0; background: transparent; font: 500 12px var(--f); padding: 0 10px; height: 24px; border-radius: 4px; cursor: pointer; color: var(--fg3); }
.seg button:hover { color: var(--fg); }
.seg button[aria-pressed="true"] { background: var(--bg3); color: var(--fg); box-shadow: 0 0 0 1px var(--line2); }
.viewer-box { flex: 1; min-height: 480px; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: var(--bg1); position: relative; }
.viewer-box iframe { width: 100%; height: 100%; border: 0; display: block; position: absolute; inset: 0; }
.viewer-off { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; padding: 24px; }
.viewer-off > div { max-width: 460px; display: grid; gap: 10px; justify-items: center; }
.viewer-off h2 { font-size: 16px; }
.viewer-off code { font: 11.5px var(--m); background: var(--bg3); border: 1px solid var(--line); padding: 6px 10px; border-radius: 5px; overflow-wrap: anywhere; }
.rt { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; flex: 1; min-height: 340px; margin-bottom: 10px; }
.viewport { position: relative; background: var(--bg1); border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.viewport canvas { position: absolute; inset: 28px 0 0; width: 100%; height: calc(100% - 28px); }
.vp-label { position: absolute; top: 8px; left: 10px; font-size: 10.5px; letter-spacing: .06em; text-transform: uppercase; color: var(--fg3); }
.vp-label b { color: var(--fg); font-weight: 500; }
.transport { display: flex; align-items: center; gap: 12px; padding: 8px 12px; margin-bottom: 10px; }
.transport input[type=range] { flex: 1; }
.transport #rtTime { width: 64px; color: var(--fg2); }
.limitbar { position: relative; width: 140px; height: 4px; border-radius: 2px; background: var(--line2); }
.limitbar .rng { position: absolute; top: 0; bottom: 0; background: var(--steel); opacity: .45; border-radius: 2px; }
.limitbar .val { position: absolute; top: -4px; width: 2px; height: 12px; background: var(--fg); }
.limitbar .val.clamp { background: var(--acc); }
.jst.clamp { color: var(--acc); } .jst.ok { color: var(--fg3); }
.exports { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.exports li { display: flex; align-items: center; gap: 10px; }
.empty-state { display: grid; justify-items: center; text-align: center; gap: 10px; padding: 56px 24px; }
.empty-state .es-icon { width: 34px; height: 34px; color: var(--fg3); }
.empty-state .es-icon svg, .cam-empty > i svg, .insp-empty i svg { width: 30px; height: 30px; }
.empty-state p { max-width: 560px; margin: 0; }

/* ------------------------------------------------------------------ overlays: modal, drawer, palette, toasts */
.backdrop { position: fixed; inset: 0; background: rgba(0,0,0,.5); z-index: 90; display: grid; place-items: center; padding: 20px; animation: fade .15s ease-out; }
.backdrop.out { animation: fadeOut .12s ease-in forwards; }
@keyframes fade { from { opacity: 0; } } @keyframes fadeOut { to { opacity: 0; } }
.modal { background: var(--bg2); border: 1px solid var(--line2); border-radius: 10px; box-shadow: var(--shadow); width: min(560px, 100%); max-height: calc(100vh - 40px); display: flex; flex-direction: column; animation: pop .18s var(--ease); }
.modal.wide { width: min(860px, 100%); }
@keyframes pop { from { opacity: 0; transform: translateY(6px) scale(.985); } }
.mh { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.mh h2 { font-size: 14.5px; }
.mb { padding: 14px 16px; overflow: auto; }
.mf { display: flex; justify-content: flex-end; align-items: center; gap: 8px; padding: 12px 16px; border-top: 1px solid var(--line); }
.mf .grow { margin-right: auto; color: var(--fg3); font-size: 12px; }
.x { border: 0; background: transparent; cursor: pointer; width: 26px; height: 26px; border-radius: 5px; color: var(--fg3); display: grid; place-items: center; }
.x:hover { background: var(--hover); color: var(--fg); }
.fields { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.field { display: grid; gap: 5px; font-size: 11.5px; color: var(--fg2); font-weight: 500; }
.sect { margin: 16px 0 6px; font: 600 10.5px var(--m); letter-spacing: .07em; text-transform: uppercase; color: var(--fg3); }
.checks { list-style: none; margin: 0; padding: 0; border: 1px solid var(--line); border-radius: 6px; }
.checks li { display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-bottom: 1px solid var(--line); font-size: 12.5px; }
.checks li:last-child { border: 0; }
.checks .ic { width: 16px; height: 16px; border-radius: 50%; display: grid; place-items: center; flex: none; font-size: 10px; font-weight: 700; color: var(--bg); background: var(--fg3); }
.checks li.ok .ic { background: var(--ok); }
.checks li.bad .ic { background: var(--warn); }
.checks .why { margin-left: auto; font: 11px var(--m); color: var(--fg3); }
.tasklist { list-style: none; margin: 0; padding: 0; border: 1px solid var(--line); border-radius: 6px; max-height: 150px; overflow: auto; }
.tasklist li { display: flex; gap: 10px; align-items: baseline; padding: 6px 10px; border-bottom: 1px solid var(--line); font-size: 12.5px; }
.tasklist li:last-child { border: 0; }
.tasklist .mono { font-size: 11px; color: var(--fg3); min-width: 120px; }
.tasklist .rep { margin-left: auto; font: 11px var(--m); color: var(--fg3); }
.qr-big { display: grid; grid-template-columns: 240px 1fr; gap: 20px; align-items: start; }
.qr-big img { width: 240px; height: 240px; background: #fff; border-radius: 6px; padding: 8px; }
.ol { margin: 0; padding-left: 18px; display: grid; gap: 6px; color: var(--fg2); }
.urlbox { font: 11.5px var(--m); background: var(--bg1); border: 1px solid var(--line); padding: 7px 9px; border-radius: 5px; overflow-wrap: anywhere; margin-top: 12px; color: var(--fg2); }
.choice { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.choice button { text-align: left; display: grid; grid-template-columns: 28px 1fr; gap: 2px 10px; padding: 12px; border: 1px solid var(--line2); border-radius: 7px; background: var(--bg1); cursor: pointer; font: inherit; color: var(--fg); }
.choice button:hover { border-color: var(--acc); background: var(--hover); }
.choice i[data-icon] { grid-row: span 2; width: 20px; height: 20px; color: var(--acc); margin-top: 2px; }
.choice b { font-size: 13px; font-weight: 600; } .choice span { font-size: 11.5px; color: var(--fg3); }
.stats4 { display: grid; grid-template-columns: repeat(4, 1fr); border: 1px solid var(--line); border-radius: 6px; }
.stats4 div { padding: 10px 12px; border-left: 1px solid var(--line); }
.stats4 div:first-child { border-left: 0; }
.stats4 b { display: block; font-size: 18px; font-weight: 600; font-variant-numeric: tabular-nums; }
.stats4 span { font: 500 10px var(--m); text-transform: uppercase; color: var(--fg3); letter-spacing: .05em; }

.drawer-root .backdrop { place-items: stretch end; padding: 0; background: rgba(0,0,0,.35); }
.drawer { width: min(720px, 92vw); height: 100%; background: var(--bg2); border-left: 1px solid var(--line2); box-shadow: var(--shadow); display: flex; flex-direction: column; animation: slide .22s var(--ease); }
.backdrop.out .drawer { animation: slideOut .15s ease-in forwards; }
@keyframes slide { from { transform: translateX(40px); opacity: 0; } }
@keyframes slideOut { to { transform: translateX(40px); opacity: 0; } }

.palette-root .backdrop { place-items: start center; padding-top: 12vh; background: rgba(0,0,0,.4); }
.palette { width: min(560px, 100%); background: var(--bg2); border: 1px solid var(--line2); border-radius: 10px; box-shadow: var(--shadow); overflow: hidden; animation: pop .15s var(--ease); }
.palette input { width: 100%; height: 44px; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; background: transparent; font-size: 14px; padding: 0 14px; box-shadow: none !important; }
.palette ul { list-style: none; margin: 0; padding: 6px; max-height: 340px; overflow: auto; }
.palette li { display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: 6px; cursor: pointer; color: var(--fg2); }
.palette li.on { background: var(--bg3); color: var(--fg); }
.palette li .g { margin-left: auto; font: 10.5px var(--m); color: var(--fg3); }
.palette li.off { opacity: .45; cursor: default; }

.toasts { position: fixed; right: 14px; bottom: calc(var(--sb) + 14px); z-index: 95; display: grid; gap: 8px; width: min(360px, calc(100vw - 28px)); }
.toast { display: flex; gap: 10px; align-items: flex-start; background: var(--bg3); border: 1px solid var(--line2); color: var(--fg); padding: 10px 12px; border-radius: 8px; box-shadow: var(--shadow); font-size: 12.5px; animation: tin .22s var(--ease); }
.toast .led { margin-top: 5px; }
.toast.out { animation: tout .2s ease-in forwards; }
@keyframes tin { from { opacity: 0; transform: translateY(8px); } }
@keyframes tout { to { opacity: 0; transform: translateX(16px); } }

.closed { position: fixed; inset: 0; display: grid; place-items: center; background: var(--bg); z-index: 100; text-align: center; }
.closed img { width: 40px; height: 40px; }

/* demo mode */
.switch { gap: 8px; }
.sw { position: relative; width: 26px; height: 15px; border-radius: 8px; background: var(--line2); transition: background .15s; flex: none; }
.sw::after { content: ""; position: absolute; top: 2px; left: 2px; width: 11px; height: 11px; border-radius: 50%; background: var(--fg2); transition: transform .15s var(--ease), background .15s; }
.switch[aria-checked="true"] { border-color: rgba(224,164,58,.55); color: var(--warn); }
.switch[aria-checked="true"] .sw { background: var(--warn-bg); box-shadow: inset 0 0 0 1px var(--warn); }
.switch[aria-checked="true"] .sw::after { transform: translateX(11px); background: var(--warn); }
.sb-demo { color: #111; background: var(--warn); font-weight: 600; letter-spacing: .06em; }
.demo-note { margin: 0 0 10px; padding: 7px 10px; border-radius: 5px; background: var(--warn-bg); color: var(--warn); font-size: 12px; }
body.demo .titlebar { box-shadow: inset 0 -2px 0 var(--warn); }

/* ------------------------------------------------------------------ responsive + motion */
@media (max-width: 1280px) { .tiles { grid-template-columns: repeat(3, 1fr); } .studio { grid-template-columns: minmax(0, 1fr) 300px; } }
@media (max-width: 1050px) {
  :root { --nav: 52px; }
  .nav a span, .nav-item span, .nav-grp, .nav-badge, .product, .tb-node, .palette-btn span, .palette-btn kbd { display: none; }
  .palette-btn { width: auto; }
  .brand { width: auto; }
  .studio, .split, .split.bottom, .dash, .rt, .qr-big { grid-template-columns: 1fr; }
  .span2 { grid-column: auto; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; } }
.tbl tr.demo-row td { color: var(--fg3); } .tbl tr.demo-row { cursor: default; }
.palette li.gh { padding: 8px 10px 3px; font: 500 10px var(--m); text-transform: uppercase; letter-spacing: .08em; color: var(--fg3); cursor: default; }
.palette li i svg { width: 14px; height: 14px; color: var(--fg3); }
.palette li kbd { margin-left: auto; }
.palette mark { background: none; color: var(--acc); font-weight: 600; }
.drawer-actions { margin-bottom: 14px; gap: 6px; }
.gs .ph-link { font: inherit; color: var(--fg); } .gs .ph-link:hover { text-decoration: underline; }
