:root {
  color-scheme: dark;
  --background: #0b0e10;
  --sidebar: #0e1214;
  --surface: #131719;
  --surface-raised: #181d20;
  --surface-hover: #1c2326;
  --foreground: #edf2ef;
  --muted: #8f9b96;
  --border: #293136;
  --border-strong: #3a454a;
  --primary: #65d6a8;
  --primary-strong: #8be5be;
  --primary-ink: #07120d;
  --warning: #f2b866;
  --danger: #f08080;
  --info: #78b8e8;
  --radius-sm: 7px;
  --radius: 11px;
  --radius-lg: 16px;
  --shadow: 0 18px 50px rgba(0, 0, 0, .24);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans SC", sans-serif;
  font-synthesis: none;
}

[hidden] { display: none !important; }
* { box-sizing: border-box; }
html { min-width: 320px; background: var(--background); }
body { margin: 0; min-height: 100vh; color: var(--foreground); background: var(--background); font-size: 14px; line-height: 1.5; }
button, input, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; text-decoration: none; }
h1, h2, p { margin: 0; }
h1 { font-size: clamp(28px, 3vw, 40px); line-height: 1.12; letter-spacing: -.035em; }
h2 { font-size: 18px; line-height: 1.3; letter-spacing: -.015em; }
.muted { color: var(--muted); }
.mono { font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace; }
.tabular { font-variant-numeric: tabular-nums; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.eyebrow { color: var(--primary); font-family: "SFMono-Regular", Consolas, monospace; font-size: 10px; font-weight: 750; letter-spacing: .14em; }

.brand { display: inline-flex; align-items: center; gap: 11px; min-height: 44px; }
.brand > span:last-child { display: grid; }
.brand strong { font-size: 15px; letter-spacing: -.01em; }
.brand small { color: var(--muted); font-size: 10px; font-weight: 500; }
.brand-mark { display: grid; place-items: center; width: 36px; height: 36px; border: 1px solid rgba(101, 214, 168, .5); border-radius: 10px; color: var(--primary-strong); background: #0e1813; font-weight: 800; }

.button { display: inline-flex; align-items: center; justify-content: center; min-height: 40px; padding: 0 14px; border: 1px solid transparent; border-radius: var(--radius-sm); color: var(--foreground); background: transparent; font-weight: 680; cursor: pointer; transition: background-color 140ms ease, border-color 140ms ease, color 140ms ease, opacity 140ms ease; }
.button:hover { background: var(--surface-hover); }
.button:disabled { cursor: wait; opacity: .55; }
.button:focus-visible, input:focus-visible, select:focus-visible, .nav-item:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.button--primary { color: var(--primary-ink); background: var(--primary); }
.button--primary:hover { background: var(--primary-strong); }
.button--secondary { border-color: var(--border-strong); background: var(--surface); }
.button--destructive { color: #ffd6d6; border-color: rgba(240,128,128,.42); background: rgba(240,128,128,.09); }
.button--destructive:hover { color: #fff0f0; border-color: rgba(240,128,128,.7); background: rgba(240,128,128,.16); }
.button--quiet { color: var(--muted); }
.button--quiet:hover { color: var(--foreground); }
.button--wide { width: 100%; min-height: 44px; }
.button__pending { display: none; }
.button.is-pending .button__label { display: none; }
.button.is-pending .button__pending { display: inline; }

.field { display: grid; gap: 7px; }
.field > span, .mode-fieldset legend { color: #c9d1cd; font-size: 13px; font-weight: 680; }
.field small { color: var(--muted); font-size: 12px; }
.field input, .compact-field input, .compact-field select { width: 100%; min-height: 44px; padding: 0 12px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); color: var(--foreground); background: #0e1214; transition: border-color 140ms ease, background-color 140ms ease; }
.field input:hover, .compact-field input:hover, .compact-field select:hover { border-color: #546167; }
.field input::placeholder, .compact-field input::placeholder { color: #66736d; }
.compact-field select { appearance: none; min-width: 128px; padding-right: 30px; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 16px) 18px, calc(100% - 11px) 18px; background-size: 5px 5px; background-repeat: no-repeat; }
.form-stack { display: grid; gap: 18px; }
.form-error, .form-success { padding: 10px 12px; border-radius: var(--radius-sm); font-size: 13px; }
.form-error { color: #ffd3d3; border: 1px solid rgba(240, 128, 128, .35); background: rgba(240, 128, 128, .08); }
.form-success { color: #c7f7df; border: 1px solid rgba(101, 214, 168, .32); background: rgba(101, 214, 168, .08); }

.status-dot { display: inline-block; width: 7px; height: 7px; border-radius: 999px; background: var(--muted); }
.status-dot--ok, .status-pill--ok .status-dot, .status-line.is-ok .status-dot { background: var(--primary); box-shadow: 0 0 0 3px rgba(101, 214, 168, .12); }
.status-pill--warn .status-dot { background: var(--warning); }
.status-pill--error .status-dot, .status-line.is-error .status-dot { background: var(--danger); }
.status-pill { display: inline-flex; align-items: center; gap: 8px; min-height: 28px; padding: 0 10px; border: 1px solid var(--border); border-radius: 999px; color: #cad2ce; background: #111618; font-size: 12px; white-space: nowrap; }
.status-pill--ok { color: #c8f2df; border-color: rgba(101, 214, 168, .3); }
.status-pill--warn { color: #f9dba9; border-color: rgba(242, 184, 102, .3); }
.status-pill--error { color: #ffc8c8; border-color: rgba(240, 128, 128, .3); }

/* Login */
.login-page { background: #0a0d0e; }
.login-shell { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(360px, .8fr); min-height: 100vh; }
.login-brand { display: flex; flex-direction: column; justify-content: space-between; min-height: 100vh; padding: clamp(28px, 5vw, 72px); border-right: 1px solid var(--border); background: linear-gradient(rgba(101, 214, 168, .045) 1px, transparent 1px), linear-gradient(90deg, rgba(101, 214, 168, .045) 1px, transparent 1px), #0d1112; background-size: 48px 48px; }
.login-copy { max-width: 680px; display: grid; gap: 20px; }
.login-copy h1 { max-width: 600px; font-size: clamp(40px, 6vw, 74px); }
.login-copy > p:last-child { max-width: 540px; color: #a8b2ad; font-size: 17px; }
.trust-note { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 13px; }
.login-panel { align-self: center; width: min(100% - 48px, 440px); margin: 48px auto; }
.login-panel__header { display: grid; gap: 10px; margin-bottom: 34px; }
.login-panel__header h2 { font-size: 26px; }
.login-panel__header > p:last-child, .keyboard-hint { color: var(--muted); }
.keyboard-hint { margin-top: 22px; font-size: 12px; }

/* Console shell */
.console-shell { display: grid; grid-template-columns: 244px minmax(0, 1fr); min-height: 100vh; }
.sidebar { position: sticky; top: 0; display: flex; flex-direction: column; height: 100vh; padding: 20px 14px; border-right: 1px solid var(--border); background: var(--sidebar); }
.sidebar__brand { padding: 0 10px; }
.primary-nav { display: grid; gap: 6px; margin-top: 40px; }
.nav-label { padding: 0 12px 6px; color: #64706a; font-size: 10px; font-weight: 750; letter-spacing: .12em; text-transform: uppercase; }
.nav-item { display: grid; grid-template-columns: 32px minmax(0, 1fr); gap: 9px; align-items: center; min-height: 62px; padding: 8px 10px; border: 1px solid transparent; border-radius: var(--radius); color: #a8b2ad; }
.nav-item:hover { color: var(--foreground); background: rgba(255,255,255,.025); }
.nav-item[aria-current="page"] { color: var(--foreground); border-color: rgba(101, 214, 168, .24); background: rgba(101, 214, 168, .075); }
.nav-item > span:last-child { display: grid; min-width: 0; }
.nav-item strong { overflow: hidden; font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.nav-item small { overflow: hidden; color: var(--muted); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.nav-icon { display: grid; place-items: center; width: 30px; height: 30px; border: 1px solid var(--border); border-radius: 8px; color: var(--muted); font-size: 16px; }
.nav-item[aria-current="page"] .nav-icon { color: var(--primary-strong); border-color: rgba(101, 214, 168, .32); }
.sidebar__footer { display: grid; gap: 7px; margin-top: auto; padding: 14px 10px 4px; border-top: 1px solid var(--border); font-size: 11px; }
.status-line { display: flex; align-items: center; gap: 8px; }
.workspace { min-width: 0; }
.topbar { position: sticky; z-index: 10; top: 0; display: flex; align-items: center; justify-content: space-between; min-height: 64px; padding: 0 clamp(18px, 3vw, 40px); border-bottom: 1px solid var(--border); background: rgba(11, 14, 16, .96); backdrop-filter: blur(14px); }
.topbar > div:first-child { display: grid; gap: 2px; }
.topbar__status { display: flex; align-items: center; gap: 8px; }
.last-updated { color: var(--muted); font-size: 11px; white-space: nowrap; }
.content-shell { width: min(1600px, 100%); margin: 0 auto; padding: 36px clamp(18px, 3vw, 40px) 72px; }
.view { display: grid; gap: 20px; }
.page-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 4px; }
.page-heading > div { display: grid; gap: 8px; }
.page-heading > div > p:last-child { color: var(--muted); }
.notice { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 13px 15px; border-radius: var(--radius); }
.notice > div { display: grid; gap: 2px; }
.notice--error { color: #ffd3d3; border: 1px solid rgba(240,128,128,.35); background: rgba(240,128,128,.08); }

.kpi-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; background: var(--surface); }
.kpi-grid--six { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.kpi { display: grid; gap: 4px; min-width: 0; padding: 18px 20px; border-right: 1px solid var(--border); }
.kpi:last-child { border-right: 0; }
.kpi > span { color: var(--muted); font-size: 11px; }
.kpi strong { overflow: hidden; text-overflow: ellipsis; font-size: clamp(22px, 2.2vw, 30px); line-height: 1.18; letter-spacing: -.035em; white-space: nowrap; }
.kpi small { overflow: hidden; color: #a6b0ab; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }

.health-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.health-card { min-width: 0; padding: 16px 18px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.health-card__heading { display: flex; align-items: center; gap: 11px; margin-bottom: 13px; }
.health-card__heading > div { display: grid; }
.health-card__heading small { color: var(--muted); font-size: 11px; }
.health-indicator { width: 10px; height: 10px; border: 2px solid var(--border-strong); border-radius: 99px; background: var(--muted); }
.health-indicator.is-ok { border-color: rgba(101,214,168,.34); background: var(--primary); }
.health-indicator.is-error { border-color: rgba(240,128,128,.34); background: var(--danger); }
.health-indicator.is-warn { border-color: rgba(242,184,102,.34); background: var(--warning); }
.compact-facts { display: grid; gap: 6px; margin: 0; }
.compact-facts > div { display: grid; grid-template-columns: 88px minmax(0, 1fr); gap: 8px; }
.compact-facts dt { color: #738078; font-size: 11px; }
.compact-facts dd { margin: 0; overflow: hidden; color: #c7cfcb; font-size: 11px; text-align: right; text-overflow: ellipsis; white-space: nowrap; }

.panel { min-width: 0; border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--surface); box-shadow: var(--shadow); overflow: hidden; }
.panel__header { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 76px; padding: 15px 20px; border-bottom: 1px solid var(--border); }
.panel__header > div:first-child { display: grid; gap: 5px; }
.panel__header--wrap { flex-wrap: wrap; }
.count-badge { min-width: 28px; padding: 3px 8px; border-radius: 99px; color: var(--muted); background: #0d1113; text-align: center; font-variant-numeric: tabular-nums; }
.toolbar { display: flex; align-items: center; justify-content: flex-end; gap: 8px; }
.compact-field input { width: 190px; }

.session-head, .session-row { display: grid; grid-template-columns: minmax(170px, 1.35fr) minmax(130px, 1fr) 100px 70px 92px 92px; gap: 14px; align-items: center; }
.session-head, .stream-head, .node-head { padding: 10px 20px; color: #76827c; border-bottom: 1px solid var(--border); font-size: 10px; font-weight: 750; letter-spacing: .055em; text-transform: uppercase; }
.session-row { min-height: 68px; padding: 10px 20px; border-bottom: 1px solid var(--border); }
.session-row:last-child, .stream-row:last-child, .node-row:last-child { border-bottom: 0; }
.session-device, .stream-name, .node-name { min-width: 0; }
.session-device strong, .stream-name strong, .node-name strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.session-device small, .stream-name small, .node-name small { display: block; overflow: hidden; color: var(--muted); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.route-meta { color: #9eb9ac !important; }
.route-health { color: #84928b !important; }
.session-channel { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.session-meta { color: var(--muted); font-size: 11px; text-align: right; font-variant-numeric: tabular-nums; }
.playback-state, .health-state { display: inline-flex; align-items: center; gap: 7px; color: var(--muted); font-size: 11px; }
.playback-state::before, .health-state::before { content: ""; width: 7px; height: 7px; border-radius: 99px; background: currentColor; }
.playback-state--playing, .health-state--ok { color: var(--primary); }
.playback-state--buffering { color: var(--warning); }
.playback-state--error, .health-state--error { color: var(--danger); }

.stream-head, .stream-row { display: grid; grid-template-columns: minmax(180px, 1fr) 110px 160px minmax(180px, .9fr); gap: 16px; align-items: center; }
.stream-row { min-height: 60px; padding: 10px 20px; border-bottom: 1px solid var(--border); }
.stream-state { color: var(--muted); font-size: 11px; }
.stream-state--ready { color: var(--primary); }
.stream-state--resolving { color: var(--warning); }
.stream-state--error { color: var(--danger); }
.stream-detail { overflow: hidden; color: var(--muted); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }

.client-head, .client-row { display: grid; grid-template-columns: minmax(210px, 1.25fr) minmax(160px, .9fr) minmax(140px, .85fr) 96px 120px 176px; gap: 14px; align-items: center; }
.client-head { padding: 10px 20px; color: #76827c; border-bottom: 1px solid var(--border); font-size: 10px; font-weight: 750; letter-spacing: .055em; text-transform: uppercase; }
.client-row { min-height: 86px; padding: 12px 20px; border-bottom: 1px solid var(--border); }
.client-row:last-child { border-bottom: 0; }
.client-row.is-banned { background: rgba(240,128,128,.035); }
.client-primary, .client-network, .client-playback, .client-seen { display: grid; min-width: 0; gap: 2px; }
.client-primary strong, .client-network strong, .client-playback strong, .client-seen strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.client-primary small, .client-network small, .client-playback small, .client-seen small { overflow: hidden; color: var(--muted); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.access-state { display: inline-flex; align-items: center; gap: 7px; width: max-content; color: var(--muted); font-size: 11px; }
.access-state::before { content: ""; width: 7px; height: 7px; border-radius: 99px; background: currentColor; }
.access-state--active { color: var(--primary); }
.access-state--kicked { color: var(--warning); }
.access-state--banned { color: var(--danger); }
.client-actions { display: flex; justify-content: flex-end; gap: 6px; }
.client-actions .button { min-height: 34px; padding: 0 10px; font-size: 11px; }
.pagination { display: flex; align-items: center; justify-content: space-between; min-height: 62px; padding: 10px 20px; border-top: 1px solid var(--border); font-size: 12px; }
.pagination > div { display: flex; gap: 8px; }
.pagination .button { min-height: 34px; }

.confirm-dialog { width: min(480px, calc(100vw - 32px)); padding: 0; border: 1px solid var(--border-strong); border-radius: var(--radius-lg); color: var(--foreground); background: var(--surface-raised); box-shadow: 0 28px 90px rgba(0,0,0,.55); }
.confirm-dialog::backdrop { background: rgba(2,5,6,.76); backdrop-filter: blur(3px); }
.confirm-dialog__body { display: grid; gap: 20px; padding: 24px; }
.confirm-dialog__body > div:first-child { display: grid; gap: 6px; }
.confirm-dialog__actions { display: flex; justify-content: flex-end; gap: 8px; }

.proxy-layout { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(320px, .85fr); gap: 20px; align-items: start; }
.settings-form { padding: 20px; }
.mode-fieldset { min-width: 0; margin: 0; padding: 0; border: 0; }
.mode-fieldset legend { margin-bottom: 8px; }
.mode-picker { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 7px; }
.mode-picker label { min-width: 0; cursor: pointer; }
.mode-picker input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.mode-picker span { display: grid; gap: 1px; min-height: 58px; padding: 9px 8px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); color: #c8d0cc; text-align: center; transition: border-color 140ms ease, background-color 140ms ease; }
.mode-picker small { color: var(--muted); font-size: 10px; white-space: nowrap; }
.mode-picker input:checked + span { border-color: var(--primary); color: var(--primary-strong); background: rgba(101,214,168,.08); }
.mode-picker input:focus-visible + span { outline: 2px solid var(--primary); outline-offset: 2px; }
.selection-card { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 20px; border-bottom: 1px solid var(--border); }
.selection-card > div { display: grid; gap: 5px; }
.selection-card p { max-width: 520px; color: var(--muted); font-size: 12px; }
.selection-card.is-active { background: rgba(101,214,168,.055); }
.proxy-facts { margin: 0; padding: 8px 20px 14px; }
.proxy-facts > div { display: grid; grid-template-columns: 100px minmax(0, 1fr); gap: 14px; padding: 11px 0; border-bottom: 1px solid var(--border); }
.proxy-facts > div:last-child { border-bottom: 0; }
.proxy-facts dt { color: var(--muted); }
.proxy-facts dd { margin: 0; overflow: hidden; text-align: right; text-overflow: ellipsis; white-space: nowrap; }
.node-head, .node-row { display: grid; grid-template-columns: minmax(220px, 1fr) 90px 110px 90px 110px; gap: 16px; align-items: center; }
.node-row { min-height: 62px; padding: 9px 20px; border-bottom: 1px solid var(--border); }
.node-region, .node-delay { color: var(--muted); font-size: 11px; }
.node-row .button { min-height: 34px; justify-self: end; padding: 0 11px; font-size: 11px; }
.node-row.is-selected { background: rgba(101,214,168,.05); }

.empty-state { display: grid; place-items: center; gap: 6px; min-height: 150px; padding: 24px; color: var(--muted); text-align: center; }
.empty-state strong { color: #cbd3cf; }
.skeleton-row { height: 62px; margin: 0 20px; border-bottom: 1px solid var(--border); background: linear-gradient(90deg, transparent, rgba(255,255,255,.025), transparent); background-size: 220% 100%; animation: skeleton 1.4s linear infinite; }
.toast { position: fixed; z-index: 30; right: 20px; bottom: 20px; max-width: min(440px, calc(100vw - 40px)); padding: 12px 16px; border: 1px solid var(--border-strong); border-radius: var(--radius); color: #dbe3df; background: #171d20; box-shadow: var(--shadow); }

@keyframes skeleton { to { background-position: -220% 0; } }

@media (max-width: 1280px) {
  .kpi-grid--six { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .kpi-grid--six .kpi:nth-child(3) { border-right: 0; }
  .kpi-grid--six .kpi:nth-child(-n+3) { border-bottom: 1px solid var(--border); }
}

@media (max-width: 1040px) {
  .console-shell { grid-template-columns: 210px minmax(0, 1fr); }
  .sidebar { padding-left: 10px; padding-right: 10px; }
  .health-grid, .proxy-layout { grid-template-columns: 1fr; }
  .health-grid { gap: 8px; }
  .health-card { display: grid; grid-template-columns: minmax(170px, .7fr) minmax(0, 1fr); align-items: center; gap: 20px; }
  .health-card__heading { margin-bottom: 0; }
  .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kpi-grid .kpi:nth-child(2n) { border-right: 0; }
  .kpi-grid .kpi:nth-child(-n+2) { border-bottom: 1px solid var(--border); }
  .kpi-grid--six { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .kpi-grid--six .kpi:nth-child(2) { border-right: 1px solid var(--border); }
  .kpi-grid--six .kpi:nth-child(3), .kpi-grid--six .kpi:nth-child(6) { border-right: 0; }
  .kpi-grid--six .kpi:nth-child(-n+3) { border-bottom: 1px solid var(--border); }
  .session-head, .session-row { grid-template-columns: minmax(160px, 1.3fr) minmax(120px, 1fr) 90px 64px 82px 82px; gap: 10px; }
  .client-head, .client-row { grid-template-columns: minmax(190px, 1.2fr) minmax(145px, .9fr) minmax(120px, .8fr) 88px 105px 150px; gap: 10px; }
}

@media (max-width: 760px) {
  .login-shell { grid-template-columns: 1fr; }
  .login-brand { min-height: 310px; padding: 28px 24px; border-right: 0; border-bottom: 1px solid var(--border); }
  .login-copy { gap: 12px; }
  .login-copy h1 { font-size: 38px; }
  .login-copy > p:last-child { font-size: 15px; }
  .login-panel { width: min(100% - 36px, 440px); margin: 42px auto 64px; }
  .console-shell { display: block; }
  .sidebar { position: static; display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; height: auto; padding: 10px 14px; border-right: 0; border-bottom: 1px solid var(--border); }
  .sidebar__brand { padding: 0; }
  .primary-nav { display: flex; justify-content: flex-end; margin-top: 0; }
  .nav-label, .sidebar__footer, .nav-item small, .nav-icon { display: none; }
  .nav-item { display: block; min-height: 42px; padding: 10px 12px; }
  .nav-item strong { font-size: 12px; }
  .topbar { top: 0; min-height: 58px; }
  .topbar > div:first-child { display: none; }
  .topbar__status { width: 100%; justify-content: flex-end; }
  .content-shell { padding-top: 26px; }
  .page-heading { align-items: flex-start; flex-direction: column; }
  .health-card { display: block; }
  .health-card__heading { margin-bottom: 13px; }
  .session-head, .stream-head, .node-head, .client-head { display: none; }
  .session-row, .stream-row, .node-row { grid-template-columns: minmax(0, 1fr) auto; gap: 8px 14px; padding: 14px 16px; }
  .session-channel, .stream-detail, .node-region { grid-column: 1; }
  .session-row .playback-state, .stream-state, .health-state { grid-column: 2; grid-row: 1; justify-self: end; }
  .session-meta { text-align: left; }
  .session-meta:last-child { text-align: right; }
  .stream-row > :nth-child(3) { grid-column: 2; text-align: right; }
  .node-delay { grid-column: 1; }
  .node-row .button { grid-column: 2; grid-row: 2 / span 2; align-self: center; }
  .client-row { grid-template-columns: minmax(0, 1fr) auto; gap: 10px 16px; padding: 16px; }
  .client-primary { grid-column: 1; grid-row: 1; }
  .access-state { grid-column: 2; grid-row: 1; justify-self: end; }
  .client-network, .client-playback, .client-seen { grid-column: 1 / -1; }
  .client-actions { grid-column: 1 / -1; justify-content: flex-start; padding-top: 4px; }
  .panel__header--wrap { align-items: flex-start; }
  .toolbar { width: 100%; justify-content: stretch; flex-wrap: wrap; }
  .compact-field { flex: 1 1 140px; }
  .compact-field input { width: 100%; }
  .toolbar .button { flex: 1 1 auto; }
}

@media (max-width: 480px) {
  .brand > span:last-child { display: none; }
  .primary-nav { gap: 2px; }
  .nav-item { padding-left: 9px; padding-right: 9px; }
  .topbar { padding-left: 12px; padding-right: 12px; }
  .topbar__status .status-pill, .last-updated { display: none; }
  .content-shell { padding: 22px 12px 60px; }
  .page-heading > div > p:last-child { font-size: 12px; }
  .kpi, .kpi-grid--six .kpi { padding: 15px; }
  .kpi-grid--six { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kpi-grid--six .kpi:nth-child(2n) { border-right: 0; }
  .kpi-grid--six .kpi:nth-child(odd) { border-right: 1px solid var(--border); }
  .kpi-grid--six .kpi:nth-child(-n+4) { border-bottom: 1px solid var(--border); }
  .kpi strong { font-size: 23px; }
  .panel__header { align-items: flex-start; min-height: 70px; padding: 14px 16px; }
  .mode-picker { grid-template-columns: 1fr; }
  .mode-picker span { min-height: 50px; }
  .selection-card { align-items: flex-start; flex-direction: column; }
  .pagination { align-items: flex-start; flex-direction: column; gap: 10px; }
  .selection-card .button { width: 100%; }
  .notice { align-items: flex-start; flex-direction: column; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: 0s !important; animation-duration: 0s !important; }
}
