:root {
  color-scheme: dark;
  --bg: #0b0d12; --panel: #12161f; --panel2: #181d29; --panel3: #1f2533; --line: #232a3a; --line2: #2f3850;
  --text: #e6e9f0; --muted: #8b93a7; --faint: #5f6880;
  --accent: #ffb020; --accent2: #ff7a1a; --ok: #3ccf8e; --warn: #ffb020; --bad: #ff5d5d; --info: #5aa9ff;
  --radius: 14px; --gutter: 24px;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.5 -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", Roboto, sans-serif; overflow-x: hidden; }
code { font: 12.5px ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; background: var(--panel2); padding: 1px 5px; border-radius: 5px; }
a { color: var(--info); }

/* ---------------------------------------------------------------- header */
.top { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 10px 18px; padding: 12px var(--gutter); background: rgba(11,13,18,.92); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.logo { font-weight: 800; letter-spacing: .14em; font-size: 19px; background: linear-gradient(90deg, var(--accent), var(--accent2)); -webkit-background-clip: text; background-clip: text; color: transparent; white-space: nowrap; }
.logo span { font-weight: 600; letter-spacing: .3em; font-size: 12px; margin-left: 4px; }
.tabs { display: flex; gap: 4px; flex-wrap: wrap; }
.tabs button { background: none; border: 0; color: var(--muted); font: inherit; font-weight: 600; font-size: 14px; padding: 7px 12px; border-radius: 9px; cursor: pointer; }
.tabs button:hover { color: var(--text); background: var(--panel2); }
.tabs button.on { color: var(--text); background: var(--panel3); }
.count { font-size: 11px; color: var(--muted); font-weight: 700; margin-left: 2px; }
.pills { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }
.pill { padding: 4px 11px; border-radius: 99px; font-size: 12px; font-weight: 700; letter-spacing: .04em; background: var(--panel2); color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.pill.on { background: rgba(255,93,93,.15); color: var(--bad); }
.pill.on::before { content: "● "; animation: blink 1s infinite; }
.pill.warn { background: rgba(255,176,32,.15); color: var(--warn); }
.pill.bad { background: rgba(255,93,93,.18); color: var(--bad); }
@keyframes blink { 50% { opacity: .3; } }

main { padding: 22px var(--gutter) 60px; max-width: 1400px; margin: 0 auto; }
.tab { display: grid; gap: 18px; }

/* ---------------------------------------------------------------- building blocks */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; min-width: 0; }
.card h2, .section-title { margin: 0 0 14px; font-size: 12px; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); font-weight: 600; }
.section-title { margin: 8px 2px -4px; }
.eyebrow { font-size: 11px; text-transform: uppercase; letter-spacing: .12em; color: var(--accent); font-weight: 700; }
h1 { margin: 2px 0 2px; font-size: 26px; line-height: 1.2; overflow-wrap: anywhere; }
h3 { margin: 0 0 10px; font-size: 13px; color: var(--text); font-weight: 700; }
.sub { color: var(--muted); font-size: 13px; overflow-wrap: anywhere; }
.hint { font-size: 13px; color: var(--muted); margin-top: 8px; }
.empty { color: var(--muted); font-size: 14px; padding: 6px 0; }
.err { color: var(--bad); font-size: 13px; margin-top: 8px; overflow-wrap: anywhere; }
.err:empty { display: none; }
.ok-text { color: var(--ok); } .warn-text { color: var(--warn); } .bad-text { color: var(--bad); }
.row { display: flex; gap: 10px 12px; flex-wrap: wrap; align-items: end; margin-top: 12px; }
label { display: grid; gap: 5px; font-size: 12px; color: var(--muted); min-width: 0; }
select, input[type=text], input[type=password], input:not([type]) { background: var(--panel2); color: var(--text); border: 1px solid var(--line2); border-radius: 9px; padding: 8px 11px; font: inherit; font-size: 14px; min-width: 0; max-width: 100%; }
select:focus, input:focus { outline: 2px solid rgba(255,176,32,.45); outline-offset: 1px; }
.btn { border: 0; border-radius: 9px; padding: 9px 18px; font: inherit; font-size: 14px; font-weight: 700; cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.btn.go { background: linear-gradient(90deg, var(--accent), var(--accent2)); color: #1a1205; }
.btn.stop { background: rgba(255,93,93,.14); color: var(--bad); }
.btn.ghost { background: var(--panel3); color: var(--text); }
.btn.ghost:hover { background: var(--line2); }
.btn.small { padding: 6px 12px; font-size: 13px; }
.btn:disabled, .btn.disabled { opacity: .4; cursor: default; pointer-events: none; }
.check { display: flex; gap: 8px; align-items: center; color: var(--text); font-size: 14px; padding-bottom: 8px; }
.chip { display: inline-block; font-size: 10.5px; font-weight: 800; letter-spacing: .05em; padding: 2px 8px; border-radius: 99px; background: var(--panel3); color: var(--muted); vertical-align: middle; white-space: nowrap; }
.chip.ok { background: rgba(60,207,142,.14); color: var(--ok); }
.chip.warn { background: rgba(255,176,32,.14); color: var(--warn); }
.chip.bad { background: rgba(255,93,93,.14); color: var(--bad); }
.chip.info { background: rgba(90,169,255,.14); color: var(--info); }
.dot { width: 9px; height: 9px; border-radius: 50%; background: var(--faint); display: inline-block; flex: none; }
.dot.on { background: var(--ok); box-shadow: 0 0 0 3px rgba(60,207,142,.18); }
.list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.item { padding: 12px 14px; background: var(--panel2); border-radius: 10px; border: 1px solid transparent; min-width: 0; }
.item.sel { border-color: var(--accent); }
.item .top-line { display: flex; align-items: center; gap: 10px; min-width: 0; }
.item .name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.item .sub { margin-top: 3px; font-variant-numeric: tabular-nums; }
.item button.x { background: none; border: 0; color: var(--muted); cursor: pointer; font-size: 15px; padding: 2px 6px; }
.item button.x:hover { color: var(--bad); }
pre { background: #080a0e; border: 1px solid var(--line); border-radius: 10px; padding: 11px 12px; font: 12.5px/1.5 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; white-space: pre-wrap; word-break: break-all; margin: 6px 0 0; }
.meter { height: 10px; background: var(--panel2); border-radius: 99px; overflow: hidden; }
.meter > div { height: 100%; width: 0; background: var(--ok); transition: width .3s, background .3s; }

/* ---------------------------------------------------------------- This computer */
.pc-top { display: flex; gap: 14px; align-items: start; justify-content: space-between; flex-wrap: wrap; }
.pc-title { min-width: 0; flex: 1 1 260px; }
.picker { flex: 0 1 260px; }
.facts { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(150px, 100%), 1fr)); gap: 10px; margin-top: 16px; }
.facts:empty { display: none; }
.fact { background: var(--panel2); border-radius: 10px; padding: 9px 12px; min-width: 0; }
.fact .l { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.fact .v { font-weight: 700; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.notice { margin-top: 14px; border-radius: 10px; padding: 10px 14px; font-size: 13.5px; background: var(--panel2); border-left: 3px solid var(--info); }
.notice.warn { border-left-color: var(--warn); }
.notice.bad { border-left-color: var(--bad); }
.notice ul { margin: 6px 0 0; padding-left: 18px; color: var(--muted); }
.devices { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(340px, 100%), 1fr)); gap: 16px; }
.device { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; display: grid; gap: 12px; align-content: start; min-width: 0; }
.device > header { display: flex; gap: 10px; justify-content: space-between; align-items: start; }
.device .dev-name { font-weight: 700; font-size: 15.5px; overflow-wrap: anywhere; }
.badges { display: flex; gap: 5px; flex-wrap: wrap; justify-content: end; }
.signal { font-size: 13.5px; font-weight: 600; display: flex; gap: 8px; align-items: center; }
.signal::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; flex: none; }
.signal.muted { color: var(--muted); font-weight: 500; }
.signal.ok { color: var(--ok); } .signal.warn { color: var(--warn); } .signal.bad { color: var(--bad); }
.thumb { position: relative; aspect-ratio: 16 / 9; background: #06070a; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; display: grid; place-items: center; }
.thumb canvas { width: 100%; height: 100%; object-fit: contain; display: block; }
.thumb .thumb-empty { position: absolute; color: var(--faint); font-size: 13px; }
.thumb .thumb-label { position: absolute; left: 8px; bottom: 6px; font: 700 10.5px ui-monospace, Menlo, monospace; color: #fff; text-shadow: 0 1px 2px #000; }
.job-form { border-top: 1px solid var(--line); padding-top: 12px; }
.job-form .grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(130px, 100%), 1fr)); gap: 10px; }
.job-form .grid .wide { grid-column: 1 / -1; }
.job-form .row { margin-top: 10px; align-items: center; }
.busy { font-size: 12.5px; color: var(--warn); }
.jobs { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(420px, 100%), 1fr)); gap: 16px; }
.job { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; min-width: 0; }
.job > header { display: flex; gap: 8px 10px; align-items: center; flex-wrap: wrap; }
.job .title { font-weight: 700; flex: 1 1 140px; min-width: 0; overflow-wrap: anywhere; }
.kind { font-size: 10.5px; font-weight: 800; letter-spacing: .08em; padding: 3px 8px; border-radius: 6px; }
.kind.send { background: rgba(255,176,32,.16); color: var(--accent); }
.kind.receive { background: rgba(90,169,255,.16); color: var(--info); }
.kv { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(105px, 100%), 1fr)); gap: 8px; margin-top: 12px; }
.kv > div { background: var(--panel2); border-radius: 9px; padding: 7px 10px; min-width: 0; }
.kv span { display: block; font-size: 10.5px; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.kv b { font-variant-numeric: tabular-nums; font-size: 15px; overflow-wrap: anywhere; }
.kv b small { font-weight: 500; color: var(--muted); font-size: 11px; }
.kv .wide { grid-column: 1 / -1; }
.install summary { cursor: pointer; font-weight: 700; }
.install[open] summary { margin-bottom: 8px; }
.steps { margin: 0; padding-left: 20px; display: grid; gap: 14px; }
.steps li { padding-left: 4px; }
.downloads { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.cmd { position: relative; margin-top: 10px; }
.cmd-label { font-size: 12px; color: var(--muted); }
.cmd pre { padding-right: 70px; }
.cmd .copy { position: absolute; right: 6px; top: 26px; }

/* ---------------------------------------------------------------- Computers / Streams */
.pc-row { display: flex; align-items: center; gap: 12px; padding: 12px 14px; background: var(--panel2); border-radius: 10px; cursor: pointer; border: 1px solid transparent; min-width: 0; }
.pc-row:hover { border-color: var(--line2); }
.pc-row.sel { border-color: var(--accent); }
.pc-row .grow { flex: 1; min-width: 0; }
.pc-row .stats { display: flex; gap: 16px; font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; flex-wrap: wrap; justify-content: end; }
.pc-row .stats b { color: var(--text); }
.stream { padding: 14px; background: var(--panel2); border-radius: 10px; min-width: 0; }
.stream.ended { opacity: .55; }
.stream .top-line { display: flex; gap: 8px 10px; align-items: center; flex-wrap: wrap; }
.stream .sid { font: 800 13px ui-monospace, Menlo, monospace; color: var(--accent); }
.stream .name { font-weight: 700; flex: 1 1 160px; min-width: 0; overflow-wrap: anywhere; }
.stream .rate { font-weight: 700; font-variant-numeric: tabular-nums; }
.receivers { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }

/* ---------------------------------------------------------------- Files */
.files { display: grid; grid-template-columns: 1.15fr 1fr; gap: 18px; }
.stack { display: grid; gap: 18px; align-content: start; min-width: 0; }
.drop { border: 2px dashed var(--line2); border-radius: var(--radius); padding: 24px; text-align: center; color: var(--muted); cursor: pointer; transition: .15s; }
.drop:hover, .drop.over, .drop:focus { border-color: var(--accent); color: var(--text); background: rgba(255,176,32,.05); outline: none; }
.drop strong { color: var(--text); }
.bar { height: 6px; background: var(--panel2); border-radius: 99px; overflow: hidden; margin-top: 8px; }
.bar > div { height: 100%; width: 0; background: linear-gradient(90deg, var(--accent), var(--accent2)); transition: width .2s; }
#etl:not(:empty), #assets { margin-top: 14px; }
.asset { cursor: pointer; }
.kpis { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.kpi { background: var(--panel2); border-radius: 10px; padding: 11px 13px; min-width: 0; }
.kpi .v { font-size: 21px; font-weight: 700; font-variant-numeric: tabular-nums; }
.kpi .l { font-size: 12px; color: var(--muted); }
.now { margin-bottom: 14px; color: var(--muted); overflow-wrap: anywhere; }
.now b { color: var(--text); }
.slider { display: flex; align-items: center; gap: 14px; }
.slider input { flex: 1; accent-color: var(--accent); min-width: 0; }
.slider .v { min-width: 48px; text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; font-variant-numeric: tabular-nums; }
th { text-align: left; color: var(--muted); font-weight: 500; padding: 6px 8px; border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: 8px; border-bottom: 1px solid var(--line); white-space: nowrap; }

/* ---------------------------------------------------------------- gate */
#gate { position: fixed; inset: 0; background: var(--bg); display: grid; place-items: center; z-index: 10; padding: 16px; }
#gate .card { width: min(420px, 100%); display: grid; gap: 14px; }
#gate input { width: 100%; }

@media (max-width: 900px) {
  :root { --gutter: 16px; }
  .top { position: static; }
  .files { grid-template-columns: 1fr; }
  main { padding-top: 16px; }
  .top { padding-top: 10px; padding-bottom: 10px; }
  .pills { margin-left: 0; }
}
@media (max-width: 520px) {
  h1 { font-size: 22px; }
  .facts { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .card { padding: 16px; }
  .tabs button { padding: 6px 9px; font-size: 13.5px; }
  .pc-row { flex-wrap: wrap; }
  .pc-row .stats { justify-content: start; width: 100%; padding-left: 21px; }
  .kpi .v { font-size: 18px; }
}
