/* ZETA — interface design system (shared by the desktop window and the browser version) */
:root {
  --bg: #0B0D12; --bg-2: #0E1117; --panel: #151922; --panel-2: #1A1F2A; --panel-3: #212735; --field: #10131A;
  --line: #272D38; --line-2: #333B49; --line-3: #465063;
  --ink: #F4F6FA; --ink-2: #C7CDD8; --mute: #8C95A6; --mute-2: #6A7385;
  --gold: #F5C542; --gold-2: #FFD970; --gold-ink: #1B1400; --gold-soft: rgba(245, 197, 66, .12); --gold-line: rgba(245, 197, 66, .45);
  --ok: #3DD68C; --ok-soft: rgba(61, 214, 140, .12); --warn: #F5B544; --warn-soft: rgba(245, 181, 68, .12);
  --bad: #F06A6A; --bad-soft: rgba(240, 106, 106, .12); --info: #6AA8FF; --info-soft: rgba(106, 168, 255, .12);
  --r-sm: 8px; --r-md: 12px; --r-lg: 16px; --r-xl: 20px;
  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 20px; --s6: 24px; --s7: 32px;
  --font: "Segoe UI Variable Text", "Segoe UI", "Inter", system-ui, Tahoma, sans-serif;
  --mono: "Cascadia Mono", "Consolas", ui-monospace, monospace;
  --t-fast: 120ms; --t-med: 220ms; --ease: cubic-bezier(.2, .8, .2, 1);
  --shadow: 0 1px 0 rgba(255, 255, 255, .03) inset, 0 10px 30px rgba(0, 0, 0, .35);
  --title-h: 44px; --rail-w: 76px; --rail-w-open: 232px;
  color-scheme: dark;
}
@media (prefers-reduced-motion: reduce) { :root { --t-fast: 0ms; --t-med: 0ms; } *, *::before, *::after { animation-duration: 0ms !important; transition-duration: 0ms !important; } }
html.reduce-motion { --t-fast: 0ms; --t-med: 0ms; }
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--ink); font: 400 14px/1.5 var(--font); -webkit-font-smoothing: antialiased; overflow: hidden; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--gold); text-decoration: none; } a:hover { text-decoration: underline; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; border-radius: 6px; }
::selection { background: rgba(245, 197, 66, .3); }
.ltr { direction: ltr; unicode-bidi: isolate; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.icon { width: 18px; height: 18px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.icon.sm { width: 15px; height: 15px; } .icon.lg { width: 22px; height: 22px; }
[dir="rtl"] .flip { transform: scaleX(-1); }

/* ── app frame */
.app { display: grid; grid-template-rows: var(--title-h) minmax(0, 1fr) auto; height: 100vh; }
.titlebar { display: flex; align-items: center; gap: var(--s3); padding-inline: 14px 0; background: linear-gradient(180deg, #0F1219, #0B0D12); border-bottom: 1px solid var(--line); app-region: drag; user-select: none; position: relative; z-index: 20; }
.titlebar .brand { display: flex; align-items: center; gap: 10px; font-weight: 700; letter-spacing: .02em; }
.brand-mark { width: 24px; height: 24px; border-radius: 7px; background: linear-gradient(145deg, #FFE08A, #F5C542 45%, #B8871A); color: var(--gold-ink); display: grid; place-items: center; font-weight: 800; font-size: 14px; box-shadow: 0 0 18px rgba(245, 197, 66, .25); }
.brand small { color: var(--mute); font-weight: 500; font-size: 12px; }
.titlebar .grow { flex: 1; }
.tb-status { display: flex; align-items: center; gap: 6px; app-region: no-drag; }
.pill { display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 10px; border-radius: 999px; background: var(--panel); border: 1px solid var(--line); color: var(--ink-2); font-size: 12px; white-space: nowrap; }
.pill .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--mute-2); flex: none; }
.dot.ok { background: var(--ok); box-shadow: 0 0 8px rgba(61, 214, 140, .6); } .dot.warn { background: var(--warn); } .dot.bad { background: var(--bad); } .dot.busy { background: var(--gold); animation: pulse 1.2s infinite; }
@keyframes pulse { 50% { opacity: .35; } }
.winbtns { display: flex; height: 100%; app-region: no-drag; }
.winbtns button { width: 46px; height: 100%; border: 0; background: transparent; color: var(--ink-2); display: grid; place-items: center; cursor: pointer; transition: background var(--t-fast); }
.winbtns button:hover { background: rgba(255, 255, 255, .07); color: var(--ink); } .winbtns button.close:hover { background: #C42B1C; color: #fff; }
.winbtns .icon { width: 14px; height: 14px; stroke-width: 1.5; }
.estop { app-region: no-drag; display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 12px; border-radius: 9px; border: 1px solid rgba(240, 106, 106, .5); background: var(--bad-soft); color: #FFB4B4; font-weight: 650; font-size: 12.5px; cursor: pointer; transition: background var(--t-fast), border-color var(--t-fast); }
.estop:hover { background: rgba(240, 106, 106, .22); border-color: var(--bad); color: #fff; }

.main { display: grid; grid-template-columns: var(--rail-w) minmax(0, 1fr); min-height: 0; transition: grid-template-columns var(--t-med) var(--ease); }
.app.rail-open .main { grid-template-columns: var(--rail-w-open) minmax(0, 1fr); }
.rail { display: flex; flex-direction: column; gap: 4px; padding: 12px 10px; border-inline-end: 1px solid var(--line); background: linear-gradient(180deg, #0D1016, #0B0D12); min-height: 0; overflow: hidden; }
.rail a { display: flex; align-items: center; gap: 12px; height: 46px; padding: 0 15px; border-radius: 12px; color: var(--mute); text-decoration: none; font-weight: 600; white-space: nowrap; position: relative; transition: background var(--t-fast), color var(--t-fast); }
.rail a:hover { background: rgba(255, 255, 255, .04); color: var(--ink); }
.rail a[aria-current="page"] { background: var(--gold-soft); color: var(--gold); }
.rail a[aria-current="page"]::before { content: ""; position: absolute; inset-inline-start: -10px; top: 12px; bottom: 12px; width: 3px; border-radius: 3px; background: var(--gold); }
.rail a .lbl { opacity: 0; transition: opacity var(--t-med); } .app.rail-open .rail a .lbl { opacity: 1; }
.rail .icon { width: 20px; height: 20px; }
.rail .spacer { flex: 1; }
.rail .toggle { border: 0; background: transparent; color: var(--mute); height: 40px; border-radius: 10px; cursor: pointer; display: flex; align-items: center; justify-content: center; }
.rail .toggle:hover { color: var(--ink); background: rgba(255, 255, 255, .04); }
.content { min-width: 0; min-height: 0; overflow: auto; scrollbar-width: thin; scrollbar-color: #2A3140 transparent; }
.page { padding: 26px 30px 48px; max-width: 1480px; margin-inline: auto; animation: page-in var(--t-med) var(--ease); }
@keyframes page-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.page-head h1 { margin: 0; font-size: 26px; line-height: 1.2; font-weight: 720; letter-spacing: -.01em; } [dir="rtl"] .page-head h1 { letter-spacing: 0; }
.page-head p { margin: 6px 0 0; color: var(--mute); max-width: 72ch; }

/* status footer */
.statusbar { display: flex; align-items: center; gap: 18px; height: 32px; padding: 0 16px; border-top: 1px solid var(--line); background: #0A0C10; color: var(--mute); font-size: 12px; overflow: hidden; white-space: nowrap; }
.statusbar span { display: inline-flex; align-items: center; gap: 6px; } .statusbar b { color: var(--ink-2); font-weight: 600; }
.statusbar .grow { flex: 1; }

/* ── building blocks */
.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)); }
.span2 { grid-column: span 2; }
.card { background: linear-gradient(180deg, rgba(255, 255, 255, .018), transparent 40%), var(--panel); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow); min-width: 0; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 18px 0; }
.card-head h2 { margin: 0; font-size: 15px; font-weight: 680; display: flex; align-items: center; gap: 8px; }
.card-head h2 .icon { color: var(--gold); }
.card-head .sub { color: var(--mute); font-size: 12.5px; margin-top: 2px; }
.card-body { padding: 16px 18px 18px; display: flex; flex-direction: column; gap: 14px; }
.row { display: flex; align-items: center; gap: 10px; } .row.wrap { flex-wrap: wrap; } .row.between { justify-content: space-between; } .row.end { justify-content: flex-end; }
.stack { display: flex; flex-direction: column; gap: 10px; }
.grow { flex: 1; min-width: 0; }
.muted { color: var(--mute); } .small { font-size: 12.5px; } .xs { font-size: 11.5px; }
.hr { height: 1px; background: var(--line); border: 0; margin: 2px 0; }
.kpi { display: flex; flex-direction: column; gap: 4px; padding: 16px 18px; }
.kpi .lbl { color: var(--mute); font-size: 12px; display: flex; align-items: center; gap: 6px; }
.kpi .val { font-size: 19px; font-weight: 700; display: flex; align-items: center; gap: 8px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kpi .hint { color: var(--mute); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 38px; padding: 0 16px; border-radius: 10px; border: 1px solid var(--line-2); background: var(--panel-2); color: var(--ink); font-weight: 600; cursor: pointer; white-space: nowrap; transition: background var(--t-fast), border-color var(--t-fast), transform var(--t-fast), opacity var(--t-fast); }
.btn:hover { border-color: var(--line-3); background: var(--panel-3); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none; }
.btn.primary { background: linear-gradient(180deg, #FFD761, #F5C542); border-color: #F5C542; color: var(--gold-ink); }
.btn.primary:hover { background: linear-gradient(180deg, #FFE08A, #F8CC50); }
.btn.danger { background: var(--bad-soft); border-color: rgba(240, 106, 106, .45); color: #FFC1C1; } .btn.danger:hover { background: rgba(240, 106, 106, .2); border-color: var(--bad); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--ink-2); } .btn.ghost:hover { background: rgba(255, 255, 255, .05); color: var(--ink); }
.btn.sm { height: 32px; padding: 0 12px; font-size: 13px; border-radius: 8px; } .btn.xs { height: 28px; padding: 0 10px; font-size: 12.5px; border-radius: 7px; }
.btn.icon-only { padding: 0; width: 38px; } .btn.sm.icon-only { width: 32px; } .btn.xs.icon-only { width: 28px; }
.btn.loading { pointer-events: none; opacity: .75; } .btn.loading::after { content: ""; width: 14px; height: 14px; border-radius: 50%; border: 2px solid currentColor; border-top-color: transparent; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > label { font-size: 13px; color: var(--ink-2); font-weight: 560; display: flex; justify-content: space-between; gap: 8px; }
.field .help { font-size: 12px; color: var(--mute); }
.input, .select, textarea.input { height: 38px; width: 100%; padding: 0 12px; border-radius: 10px; border: 1px solid var(--line-2); background: var(--field); color: var(--ink); outline: none; transition: border-color var(--t-fast), box-shadow var(--t-fast); }
textarea.input { height: auto; min-height: 90px; padding: 10px 12px; resize: vertical; font-family: var(--mono); font-size: 12.5px; }
.input:focus, .select:focus { border-color: var(--gold-line); box-shadow: 0 0 0 3px rgba(245, 197, 66, .12); }
.input[aria-invalid="true"] { border-color: var(--bad); }
.select { appearance: none; padding-inline-end: 34px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='none' stroke='%238C95A6' stroke-width='2'%3E%3Cpath d='m2 4 4 4 4-4'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; }
[dir="rtl"] .select { background-position: left 12px center; }

.switch { display: flex; align-items: center; gap: 12px; cursor: pointer; user-select: none; min-height: 34px; }
.switch input { position: absolute; opacity: 0; pointer-events: none; }
.switch .track { width: 40px; height: 22px; border-radius: 22px; background: #2B3242; position: relative; flex: none; transition: background var(--t-fast); }
.switch .track::after { content: ""; position: absolute; top: 3px; inset-inline-start: 3px; width: 16px; height: 16px; border-radius: 50%; background: #E8ECF3; transition: inset-inline-start var(--t-fast) var(--ease); box-shadow: 0 1px 3px rgba(0, 0, 0, .4); }
.switch input:checked + .track { background: var(--gold); } .switch input:checked + .track::after { inset-inline-start: 21px; background: #fff; }
.switch input:focus-visible + .track { outline: 2px solid var(--gold); outline-offset: 2px; }
.switch input:disabled + .track { opacity: .4; }
.switch .txt { display: flex; flex-direction: column; min-width: 0; } .switch .txt small { color: var(--mute); font-size: 12px; }

.seg { display: inline-flex; padding: 3px; gap: 2px; background: var(--field); border: 1px solid var(--line); border-radius: 11px; flex-wrap: wrap; }
.seg button { height: 32px; padding: 0 13px; border: 0; border-radius: 8px; background: transparent; color: var(--mute); font-weight: 600; font-size: 13px; cursor: pointer; display: inline-flex; align-items: center; gap: 7px; transition: background var(--t-fast), color var(--t-fast); }
.seg button:hover { color: var(--ink); } .seg button[aria-pressed="true"] { background: var(--panel-3); color: var(--ink); box-shadow: 0 1px 2px rgba(0, 0, 0, .3); }
.seg button[aria-pressed="true"] .icon { color: var(--gold); }

.slider { display: grid; grid-template-columns: minmax(0, 1fr) 76px auto; gap: 10px; align-items: center; }
.slider input[type=range] { width: 100%; height: 22px; background: transparent; appearance: none; cursor: pointer; }
.slider input[type=range]::-webkit-slider-runnable-track { height: 5px; border-radius: 5px; background: linear-gradient(90deg, var(--gold) var(--p, 50%), #2A3140 var(--p, 50%)); }
[dir="rtl"] .slider input[type=range]::-webkit-slider-runnable-track { background: linear-gradient(270deg, var(--gold) var(--p, 50%), #2A3140 var(--p, 50%)); }
.slider input[type=range]::-webkit-slider-thumb { appearance: none; width: 17px; height: 17px; margin-top: -6px; border-radius: 50%; background: #fff; border: 3px solid var(--gold); box-shadow: 0 1px 4px rgba(0, 0, 0, .4); }
.slider .num { height: 32px; padding: 0 8px; text-align: center; font-variant-numeric: tabular-nums; }
.slider .reset { border: 0; background: transparent; color: var(--mute-2); cursor: pointer; width: 26px; height: 26px; border-radius: 7px; display: grid; place-items: center; } .slider .reset:hover { color: var(--ink); background: rgba(255, 255, 255, .05); }

.badge { display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 9px; border-radius: 999px; font-size: 11.5px; font-weight: 650; background: var(--panel-3); color: var(--ink-2); white-space: nowrap; }
.badge.ok { background: var(--ok-soft); color: var(--ok); } .badge.warn { background: var(--warn-soft); color: var(--warn); } .badge.bad { background: var(--bad-soft); color: var(--bad); } .badge.gold { background: var(--gold-soft); color: var(--gold); } .badge.info { background: var(--info-soft); color: var(--info); }
.notice { display: flex; gap: 12px; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--panel-2); color: var(--ink-2); font-size: 13px; align-items: flex-start; }
.notice .icon { margin-top: 1px; }
.notice.info { border-color: rgba(106, 168, 255, .35); background: var(--info-soft); } .notice.info .icon { color: var(--info); }
.notice.warn { border-color: rgba(245, 181, 68, .35); background: var(--warn-soft); } .notice.warn .icon { color: var(--warn); }
.notice.bad { border-color: rgba(240, 106, 106, .4); background: var(--bad-soft); } .notice.bad .icon { color: var(--bad); }
.notice.ok { border-color: rgba(61, 214, 140, .35); background: var(--ok-soft); } .notice.ok .icon { color: var(--ok); }
.notice b { color: var(--ink); }
.empty { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 10px; padding: 34px 20px; color: var(--mute); }
.empty .ring { width: 58px; height: 58px; border-radius: 18px; display: grid; place-items: center; background: var(--panel-2); border: 1px solid var(--line); color: var(--gold); }
.empty b { color: var(--ink); font-size: 15px; }
.skel { background: linear-gradient(90deg, #171B24, #1F2430, #171B24); background-size: 300% 100%; animation: skel 1.4s infinite; border-radius: 10px; }
@keyframes skel { from { background-position: 100% 0; } to { background-position: -100% 0; } }

.list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.item { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--panel-2); cursor: pointer; transition: border-color var(--t-fast), background var(--t-fast); text-align: start; color: inherit; width: 100%; }
.item:hover { border-color: var(--line-3); }
.item.sel { border-color: var(--gold-line); background: linear-gradient(90deg, rgba(245, 197, 66, .08), transparent 70%), var(--panel-2); }
[dir="rtl"] .item.sel { background: linear-gradient(270deg, rgba(245, 197, 66, .08), transparent 70%), var(--panel-2); }
.item .ico { width: 40px; height: 40px; border-radius: 11px; display: grid; place-items: center; background: var(--panel-3); color: var(--ink-2); flex: none; }
.item.sel .ico { color: var(--gold); background: var(--gold-soft); }
.item .t { font-weight: 640; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .item .d { color: var(--mute); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 18px; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs button { position: relative; height: 42px; padding: 0 16px; border: 0; background: transparent; color: var(--mute); font-weight: 650; cursor: pointer; display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; }
.tabs button:hover { color: var(--ink); }
.tabs button[aria-selected="true"] { color: var(--ink); } .tabs button[aria-selected="true"]::after { content: ""; position: absolute; inset-inline: 12px; bottom: -1px; height: 2px; border-radius: 2px; background: var(--gold); }
.tabs button[aria-selected="true"] .icon { color: var(--gold); }

details.more { border-top: 1px solid var(--line); padding-top: 10px; }
details.more > summary { cursor: pointer; color: var(--ink-2); font-weight: 600; font-size: 13px; list-style: none; display: flex; align-items: center; gap: 8px; }
details.more > summary::-webkit-details-marker { display: none; }
details.more > summary .icon { transition: transform var(--t-fast); color: var(--mute); } details.more[open] > summary .icon { transform: rotate(180deg); }
details.more > .inner { padding-top: 14px; display: flex; flex-direction: column; gap: 14px; }

kbd, .kbd { display: inline-flex; align-items: center; justify-content: center; min-width: 26px; height: 24px; padding: 0 7px; border-radius: 6px; background: var(--panel-3); border: 1px solid var(--line-2); border-bottom-width: 2px; font: 600 11.5px var(--mono); color: var(--ink); direction: ltr; }

/* toast + modal */
.toasts { position: fixed; inset-block-end: 46px; inset-inline-end: 18px; display: flex; flex-direction: column; gap: 8px; z-index: 60; max-width: min(420px, calc(100vw - 36px)); }
.toast { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 12px; background: #1B202B; border: 1px solid var(--line-2); box-shadow: 0 16px 40px rgba(0, 0, 0, .5); font-size: 13px; animation: toast-in var(--t-med) var(--ease); }
.toast.ok .icon { color: var(--ok); } .toast.bad { border-color: rgba(240, 106, 106, .45); } .toast.bad .icon { color: var(--bad); } .toast.warn .icon { color: var(--warn); }
@keyframes toast-in { from { opacity: 0; transform: translateY(10px); } }
.overlay { position: fixed; inset: 0; background: rgba(5, 6, 9, .72); backdrop-filter: blur(4px); display: grid; place-items: center; z-index: 50; animation: fade var(--t-fast); padding: 20px; }
@keyframes fade { from { opacity: 0; } }
.modal { width: min(480px, 100%); background: var(--panel); border: 1px solid var(--line-2); border-radius: var(--r-xl); box-shadow: 0 30px 80px rgba(0, 0, 0, .6); padding: 22px; display: flex; flex-direction: column; gap: 14px; animation: pop var(--t-med) var(--ease); max-height: calc(100vh - 40px); overflow: auto; }
.modal.wide { width: min(760px, 100%); }
@keyframes pop { from { opacity: 0; transform: scale(.97); } }
.modal h3 { margin: 0; font-size: 18px; } .modal p { margin: 0; color: var(--ink-2); }

/* ── gamepad visualiser */
.pad-stage { position: relative; display: grid; place-items: center; padding: 10px 0 4px; }
.pad-svg { width: 100%; max-width: 560px; height: auto; }
.pad-svg .body { fill: #171B24; stroke: #2E3546; stroke-width: 2; }
.pad-svg .btn-shape { fill: #232937; stroke: #39414F; stroke-width: 1.5; transition: fill 60ms, stroke 60ms; }
.pad-svg .btn-shape.on { fill: var(--gold); stroke: #FFE7A3; }
.pad-svg .lbl { fill: #9AA3B3; font: 700 11px var(--font); text-anchor: middle; dominant-baseline: central; pointer-events: none; }
.pad-svg .on + .lbl { fill: var(--gold-ink); }
.pad-svg .stick-well { fill: #10131A; stroke: #2E3546; stroke-width: 1.5; }
.pad-svg .stick-cap { fill: #2A3141; stroke: #4A5366; stroke-width: 2; transition: fill 60ms; }
.pad-svg .stick-cap.on { fill: var(--gold); }
.pad-svg .trig-bg { fill: #10131A; stroke: #2E3546; } .pad-svg .trig-fill { fill: var(--gold); }
.pad-svg .clickable { cursor: pointer; } .pad-svg .clickable:hover .btn-shape { stroke: var(--gold-line); }
.pad-svg .sel .btn-shape, .pad-svg .btn-shape.sel { stroke: var(--gold); stroke-width: 2.5; }
.axes { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 10px; }
.axis { display: flex; flex-direction: column; gap: 5px; font-size: 11.5px; color: var(--mute); }
.axis .bar { height: 6px; border-radius: 6px; background: #1E2430; position: relative; overflow: hidden; direction: ltr; }
.axis .bar i { position: absolute; top: 0; bottom: 0; background: var(--gold); border-radius: 6px; }
.axis b { color: var(--ink); font: 600 12px var(--mono); direction: ltr; }
.stickplot { width: 150px; height: 150px; flex: none; }
.stickplot .well { fill: #10131A; stroke: #2E3546; } .stickplot .dz { fill: rgba(240, 106, 106, .12); stroke: rgba(240, 106, 106, .4); stroke-dasharray: 3 3; } .stickplot .gate { fill: none; stroke: #39414F; }
.stickplot .raw { fill: #8C95A6; } .stickplot .out { fill: var(--gold); }
.curve { width: 100%; height: 120px; } .curve path { fill: none; stroke: var(--gold); stroke-width: 2; } .curve .grid { stroke: #232937; stroke-width: 1; } .curve .lin { stroke: #39414F; stroke-dasharray: 4 4; }

/* keyboard / mouse live view */
.keys-live { display: flex; flex-wrap: wrap; gap: 6px; min-height: 30px; align-items: center; }
.mouse-viz { width: 120px; height: 170px; flex: none; }
.mouse-viz .shell { fill: #171B24; stroke: #2E3546; stroke-width: 2; }
.mouse-viz .mb { fill: #232937; stroke: #39414F; transition: fill 60ms; } .mouse-viz .mb.on { fill: var(--gold); }
.motion { width: 140px; height: 140px; flex: none; } .motion .well { fill: #10131A; stroke: #2E3546; } .motion .vec { stroke: var(--gold); stroke-width: 3; stroke-linecap: round; } .motion .tip { fill: var(--gold); }

/* listening indicator */
.listening { display: inline-flex; align-items: center; gap: 8px; height: 28px; padding: 0 12px; border-radius: 999px; font-size: 12px; font-weight: 650; }
.listening.on { background: var(--ok-soft); color: var(--ok); } .listening.on i { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); animation: pulse 1.4s infinite; }
.listening.off { background: var(--panel-3); color: var(--mute); }

/* macros */
.macro-layout { display: grid; grid-template-columns: 320px minmax(0, 1fr); gap: 16px; align-items: start; }
.steps { display: flex; flex-direction: column; gap: 6px; }
.step { display: grid; grid-template-columns: 26px 130px minmax(0, 1fr) 96px 96px auto; gap: 8px; align-items: center; padding: 8px 10px; border-radius: 10px; background: var(--panel-2); border: 1px solid var(--line); }
.step.cur { border-color: var(--gold); box-shadow: 0 0 0 1px var(--gold-line); }
.step .n { color: var(--mute); font: 600 12px var(--mono); text-align: center; }
.chips { display: flex; flex-wrap: wrap; gap: 5px; }
.chip { height: 26px; padding: 0 9px; border-radius: 7px; border: 1px solid var(--line-2); background: var(--field); color: var(--ink-2); font-size: 12px; font-weight: 600; cursor: pointer; transition: background var(--t-fast), border-color var(--t-fast), color var(--t-fast); }
.chip:hover { border-color: var(--line-3); } .chip[aria-pressed="true"] { background: var(--gold-soft); border-color: var(--gold-line); color: var(--gold); }
.chip.live { box-shadow: 0 0 0 2px var(--ok); }
.timeline { position: relative; height: 54px; border-radius: 10px; background: var(--field); border: 1px solid var(--line); overflow: hidden; direction: ltr; }
.timeline i { position: absolute; top: 10px; height: 14px; border-radius: 4px; background: var(--gold); opacity: .85; }
.timeline i.w { background: #39414F; } .timeline span { position: absolute; bottom: 4px; font-size: 10px; color: var(--mute-2); }

/* pairing code */
.code { display: flex; gap: 8px; justify-content: center; direction: ltr; }
.code b { width: 46px; height: 58px; border-radius: 12px; background: var(--field); border: 1px solid var(--gold-line); display: grid; place-items: center; font: 700 28px var(--mono); color: var(--gold); }
.code-input { font: 700 26px var(--mono); letter-spacing: .4em; text-align: center; height: 56px; direction: ltr; }

/* update gate */
.gate { position: fixed; inset: var(--title-h) 0 0 0; z-index: 40; background: radial-gradient(ellipse at 50% 0%, rgba(245, 197, 66, .08), transparent 60%), var(--bg); display: grid; place-items: center; padding: 24px; }
.gate .box { width: min(520px, 100%); text-align: center; display: flex; flex-direction: column; gap: 16px; align-items: center; }
.progress { width: 100%; height: 8px; border-radius: 8px; background: #1E2430; overflow: hidden; direction: ltr; }
.progress i { display: block; height: 100%; background: linear-gradient(90deg, #F5C542, #FFE08A); border-radius: 8px; transition: width var(--t-fast); }

/* responsive */
@media (max-width: 1200px) { .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .macro-layout { grid-template-columns: 1fr; } }
@media (max-width: 900px) { .g2, .g3 { grid-template-columns: 1fr; } .span2 { grid-column: auto; } .page { padding: 18px 16px 40px; } .axes { grid-template-columns: repeat(3, minmax(0, 1fr)); } .step { grid-template-columns: 22px 1fr 1fr; } .tb-status .pill.hide-sm { display: none; } }
@media (max-width: 640px) { .g4 { grid-template-columns: 1fr; } :root { --rail-w: 60px; } .rail a { padding: 0 11px; } .brand small { display: none; } }
