/* Pure Display — owner panel. Light theme, dark via prefers-color-scheme. Dense, fast, no external assets. */

:root {
  color-scheme: light dark;
  --bg: #f4f5f8;
  --surface: #ffffff;
  --surface-2: #f0f2f6;
  --surface-3: #e8ebf1;
  --fg: #1a1d24;
  --fg-muted: #5f6673;
  --fg-faint: #8a919e;
  --line: #e1e4ea;
  --line-strong: #c9cfd9;
  --accent: #2f5bea;
  --accent-hover: #244cc9;
  --accent-ink: #ffffff;
  --accent-soft: rgba(47, 91, 234, 0.10);
  --ok: #1d8f4f;
  --ok-soft: rgba(29, 143, 79, 0.13);
  --warn: #a8690f;
  --warn-soft: rgba(217, 150, 40, 0.16);
  --danger: #cf3f3f;
  --danger-soft: rgba(207, 63, 63, 0.10);
  --info: #3b6fd6;
  --info-soft: rgba(59, 111, 214, 0.13);
  --purple: #6f47e6;
  --purple-soft: rgba(111, 71, 230, 0.13);
  --teal: #0f8f8f;
  --teal-soft: rgba(15, 143, 143, 0.13);
  --neutral-soft: rgba(90, 100, 120, 0.12);
  --thumb-bg: #0e1016;
  --radius: 8px;
  --shadow: 0 1px 2px rgba(16, 24, 40, 0.05), 0 1px 3px rgba(16, 24, 40, 0.08);
  --shadow-lg: 0 24px 60px rgba(16, 24, 40, 0.22);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1218;
    --surface: #171b23;
    --surface-2: #1d222c;
    --surface-3: #242a36;
    --fg: #e6e9ef;
    --fg-muted: #9aa3b2;
    --fg-faint: #6b7383;
    --line: #262c38;
    --line-strong: #353d4c;
    --accent: #7a9cff;
    --accent-hover: #93afff;
    --accent-ink: #0b0e14;
    --accent-soft: rgba(122, 156, 255, 0.16);
    --ok: #4cc784;
    --ok-soft: rgba(76, 199, 132, 0.15);
    --warn: #f0b34a;
    --warn-soft: rgba(240, 179, 74, 0.16);
    --danger: #ff7a70;
    --danger-soft: rgba(255, 122, 112, 0.14);
    --info: #7fa4ff;
    --info-soft: rgba(127, 164, 255, 0.16);
    --purple: #b39cff;
    --purple-soft: rgba(179, 156, 255, 0.16);
    --teal: #4fd1d1;
    --teal-soft: rgba(79, 209, 209, 0.16);
    --neutral-soft: rgba(150, 160, 180, 0.14);
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 1px 3px rgba(0, 0, 0, 0.35);
    --shadow-lg: 0 24px 60px rgba(0, 0, 0, 0.6);
  }
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font);
  font-size: 13.5px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

[hidden] { display: none !important; }

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

code, .mono { font-family: var(--mono); font-size: 12.5px; }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }

.muted { color: var(--fg-muted); }
.small { font-size: 12px; }
.spacer { flex: 1 1 auto; }
.center { text-align: center; }
.num { text-align: right; font-variant-numeric: tabular-nums; }
.nowrap { white-space: nowrap; }

/* ---------- Brand ---------- */

.brand-mark {
  display: inline-block;
  width: 20px;
  height: 20px;
  border-radius: 6px;
  background: var(--accent);
  position: relative;
  flex: none;
}
.brand-mark::after {
  content: "";
  position: absolute;
  left: 5px;
  top: 6px;
  width: 10px;
  height: 8px;
  border-radius: 2px;
  background: var(--accent-ink);
}

/* ---------- Login ---------- */

.login {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.login-card {
  width: 100%;
  max-width: 380px;
  padding: 28px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow);
}

.login-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 22px;
}
.login-brand .brand-mark { width: 34px; height: 34px; border-radius: 10px; }
.login-brand .brand-mark::after { left: 9px; top: 11px; width: 16px; height: 12px; border-radius: 3px; }

.login-title { margin: 0; font-size: 18px; font-weight: 650; letter-spacing: -0.01em; }
.login-sub { margin: 0; color: var(--fg-muted); font-size: 12.5px; }

/* ---------- Shell / top bar ---------- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 18px;
  height: 52px;
  padding: 0 20px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}

.brand {
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--fg);
  font-weight: 650;
  letter-spacing: -0.01em;
  white-space: nowrap;
}
.brand:hover { text-decoration: none; }
.brand-org { color: var(--fg-muted); font-weight: 500; }
.brand-org:not(:empty)::before { content: "·"; margin-right: 8px; color: var(--fg-faint); }

.nav { display: flex; gap: 4px; }
.nav a {
  display: inline-block;
  padding: 6px 11px;
  border-radius: 7px;
  color: var(--fg-muted);
  font-weight: 550;
}
.nav a:hover { color: var(--fg); background: var(--surface-2); text-decoration: none; }
.nav a.is-active { color: var(--accent); background: var(--accent-soft); }

.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.who { color: var(--fg-muted); font-size: 12.5px; max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.main { max-width: 1440px; margin: 0 auto; padding: 20px 20px 48px; }

.view-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 6px 0 14px;
  flex-wrap: wrap;
}
.view-head h2 { margin: 0; font-size: 19px; font-weight: 650; letter-spacing: -0.015em; }
.view-head h3 { margin: 0; font-size: 15px; font-weight: 650; }
.view-head + .view-head { margin-top: 26px; }

.count {
  display: inline-block;
  min-width: 20px;
  padding: 0 6px;
  margin-left: 6px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 12px;
  font-weight: 650;
  text-align: center;
  line-height: 20px;
  vertical-align: 2px;
}

.toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

.empty {
  padding: 28px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  color: var(--fg-muted);
  text-align: center;
}

/* ---------- Buttons ---------- */

.btn {
  appearance: none;
  -webkit-appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 32px;
  padding: 5px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  background: var(--surface);
  color: var(--fg);
  font: inherit;
  font-size: 13px;
  font-weight: 550;
  line-height: 1.2;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s, border-color 0.15s, color 0.15s, opacity 0.15s;
}
.btn:hover:not(:disabled) { background: var(--surface-2); }
.btn:disabled { opacity: 0.55; cursor: default; }
.btn-sm { min-height: 28px; padding: 3px 10px; font-size: 12.5px; }
.btn-xs { min-height: 24px; padding: 1px 8px; font-size: 12px; border-radius: 6px; }
.btn-block { width: 100%; min-height: 38px; }

.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn-primary:hover:not(:disabled) { background: var(--accent-hover); border-color: var(--accent-hover); }

.btn-danger { color: var(--danger); border-color: rgba(207, 63, 63, 0.35); }
.btn-danger:hover:not(:disabled) { background: var(--danger-soft); }

.btn-ghost { border-color: transparent; background: transparent; }
.btn-ghost:hover:not(:disabled) { background: var(--surface-2); }

.icon-btn {
  appearance: none;
  -webkit-appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: var(--fg-muted);
  cursor: pointer;
  vertical-align: middle;
}
.icon-btn:hover { background: var(--surface-2); color: var(--fg); }
.icon-btn svg { display: block; }

/* ---------- Inputs ---------- */

.input,
.field input:not([type="checkbox"]):not([type="radio"]),
.field select,
.field textarea {
  appearance: none;
  -webkit-appearance: none;
  width: 100%;
  min-height: 34px;
  padding: 6px 10px;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  background: var(--surface);
  color: var(--fg);
  font: inherit;
  font-size: 13.5px;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.field select,
select.input {
  padding-right: 28px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M2 4l4 4 4-4' fill='none' stroke='%238a919e' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 9px center;
}

.field textarea { resize: vertical; min-height: 60px; line-height: 1.4; }

.input:focus,
.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.field input[aria-invalid="true"],
.field select[aria-invalid="true"],
.field textarea[aria-invalid="true"] {
  border-color: var(--danger);
  box-shadow: 0 0 0 3px var(--danger-soft);
}

.input-sm { width: auto; min-height: 30px; padding: 4px 9px; font-size: 13px; }
select.input-sm { padding-right: 26px; }

.field { margin: 0 0 14px; }
.field > label {
  display: block;
  margin-bottom: 5px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--fg);
}
.hint { margin: 5px 0 0; color: var(--fg-muted); font-size: 12px; line-height: 1.4; }
.err { margin: 5px 0 0; color: var(--danger); font-size: 12px; min-height: 0; }
.err:empty { display: none; }

.check {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin: 0 0 10px;
  font-size: 13px;
  cursor: pointer;
  line-height: 1.4;
}
.check input { margin: 2px 0 0; flex: none; accent-color: var(--accent); width: 15px; height: 15px; }
.checks { margin: 4px 0 14px; }
.toolbar .check { margin: 0; align-items: center; }

.form-error {
  margin: 0 0 14px;
  padding: 9px 12px;
  border-radius: 7px;
  background: var(--danger-soft);
  color: var(--danger);
  font-size: 13px;
}

.row { display: grid; gap: 0 14px; }
.row-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.row-3 { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) minmax(0, 1fr); }

.group {
  margin: 0 0 8px;
  padding: 14px 16px 4px;
  border: 1px solid var(--line);
  border-radius: 10px;
}
.group legend {
  padding: 0 6px;
  font-size: 12px;
  font-weight: 650;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--fg-muted);
}

/* ---------- Cards ---------- */

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 12px;
  margin-bottom: 10px;
}

.card {
  padding: 14px 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: var(--shadow);
}

.card-title {
  margin: 0 0 8px;
  font-size: 12px;
  font-weight: 650;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--fg-muted);
}

.card-big {
  margin: 0 0 8px;
  display: flex;
  align-items: baseline;
  gap: 8px;
  font-size: 26px;
  font-weight: 650;
  letter-spacing: -0.02em;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}
.card-big-sub { font-size: 13px; font-weight: 500; color: var(--fg-muted); letter-spacing: 0; }
.card .muted { margin: 0; font-size: 12.5px; }

.stack {
  display: flex;
  height: 8px;
  margin: 6px 0 8px;
  border-radius: 4px;
  background: var(--surface-3);
  overflow: hidden;
}
.stack-active { background: var(--ok); width: 0; transition: width 0.4s ease; }
.stack-warm { background: var(--teal); width: 0; transition: width 0.4s ease; }

.legend {
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 4px 10px;
  color: var(--fg-muted);
  font-size: 12px;
}
.legend b { color: var(--fg); font-weight: 600; margin-right: 4px; }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 4px; vertical-align: 0; }
.dot-active { background: var(--ok); }
.dot-warm { background: var(--teal); }
.dot-free { background: var(--surface-3); border: 1px solid var(--line-strong); }

/* ---------- Pills ---------- */

.pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 1px 8px;
  border-radius: 999px;
  background: var(--neutral-soft);
  color: var(--fg-muted);
  font-size: 11.5px;
  font-weight: 650;
  letter-spacing: 0.02em;
  line-height: 18px;
  white-space: nowrap;
  vertical-align: middle;
}
.pill-starting { background: var(--info-soft); color: var(--info); }
.pill-warm { background: var(--teal-soft); color: var(--teal); }
.pill-ready { background: var(--purple-soft); color: var(--purple); }
.pill-active { background: var(--ok-soft); color: var(--ok); }
.pill-ended { background: var(--neutral-soft); color: var(--fg-muted); }
.pill-failed { background: var(--danger-soft); color: var(--danger); }
.pill-ok { background: var(--ok-soft); color: var(--ok); }
.pill-down { background: var(--danger-soft); color: var(--danger); }
.pill-webrtc { background: var(--purple-soft); color: var(--purple); }
.pill-websockets { background: var(--info-soft); color: var(--info); }
.pill-off { background: var(--neutral-soft); color: var(--fg-faint); }
.pill .port { font-family: var(--mono); font-weight: 500; opacity: 0.85; }

.kind-session { background: var(--info-soft); color: var(--info); }
.kind-demo { background: var(--purple-soft); color: var(--purple); }
.kind-owner { background: var(--teal-soft); color: var(--teal); }
.kind-watch { background: var(--warn-soft); color: var(--warn); }
.kind-code { background: var(--warn-soft); color: var(--warn); }
.kind-bad { background: var(--danger-soft); color: var(--danger); }
.kind-good { background: var(--ok-soft); color: var(--ok); }

/* ---------- Live grid ---------- */

.live-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 12px;
}

.live {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.live-thumb {
  position: relative;
  aspect-ratio: 16 / 9;
  background: var(--thumb-bg);
  overflow: hidden;
}
.live-thumb img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: opacity 0.3s;
}
.live-thumb .thumb-ph {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255, 255, 255, 0.45);
  font-size: 12px;
  letter-spacing: 0.04em;
}
.live-thumb .thumb-badges {
  position: absolute;
  left: 8px;
  top: 8px;
  display: flex;
  gap: 6px;
}

.live-body { padding: 10px 12px 8px; }

.live-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin: 0 0 8px;
}
.live-name {
  font-weight: 650;
  font-size: 14px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.live-meta {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px 12px;
  margin: 0;
}
.live-meta div { display: flex; flex-direction: column; min-width: 0; }
.live-meta dt { font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--fg-faint); font-weight: 600; }
.live-meta dd { margin: 0; font-size: 13px; font-variant-numeric: tabular-nums; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.live-meta dd.is-low { color: var(--warn); font-weight: 600; }

.live-foot {
  display: flex;
  gap: 8px;
  padding: 8px 12px 12px;
  border-top: 1px solid var(--line);
  margin-top: 6px;
}
.live-foot .spacer { flex: 1; }

/* ---------- Tables ---------- */

.table-wrap {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: var(--shadow);
  overflow: auto;
  -webkit-overflow-scrolling: touch;
}

.table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 13px;
}
.table th,
.table td {
  padding: 8px 10px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
  white-space: nowrap;
}
.table th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--surface-2);
  color: var(--fg-muted);
  font-size: 11.5px;
  font-weight: 650;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr:hover td { background: color-mix(in srgb, var(--surface-2) 60%, transparent); }
.table td.actions, .table th.actions { text-align: right; }
.table td .btn + .btn { margin-left: 6px; }
.table .cell-strong { font-weight: 600; }
.table .cell-muted { color: var(--fg-muted); }
.table .cell-mono { font-family: var(--mono); font-size: 12px; }
.table .cell-wrap { white-space: normal; max-width: 260px; }
.table .cell-trunc { max-width: 240px; overflow: hidden; text-overflow: ellipsis; }
.table .num { text-align: right; }
.table .center { text-align: center; }

.link-cell { display: inline-flex; align-items: center; gap: 4px; }
.link-cell .url { max-width: 260px; overflow: hidden; text-overflow: ellipsis; font-family: var(--mono); font-size: 12px; color: var(--fg-muted); }

.toggle { position: relative; display: inline-block; width: 34px; height: 20px; vertical-align: middle; }
.toggle input { position: absolute; opacity: 0; width: 0; height: 0; }
.toggle .track {
  position: absolute;
  inset: 0;
  border-radius: 999px;
  background: var(--line-strong);
  transition: background 0.2s;
  cursor: pointer;
}
.toggle .track::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
  transition: transform 0.2s;
}
.toggle input:checked + .track { background: var(--ok); }
.toggle input:checked + .track::after { transform: translateX(14px); }
.toggle input:focus-visible + .track { outline: 2px solid var(--accent); outline-offset: 2px; }
.toggle input:disabled + .track { opacity: 0.5; cursor: default; }

.audio-on { color: var(--ok); }
.audio-off { color: var(--fg-faint); }

/* Events */

.table-events td { white-space: normal; vertical-align: top; }
.table-events td.nowrap { white-space: nowrap; }
.table-events details summary {
  cursor: pointer;
  color: var(--fg-muted);
  font-size: 12.5px;
  list-style: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 100%;
}
.table-events details summary::-webkit-details-marker { display: none; }
.table-events details summary::before {
  content: "";
  width: 0;
  height: 0;
  border-left: 5px solid var(--fg-faint);
  border-top: 4px solid transparent;
  border-bottom: 4px solid transparent;
  transition: transform 0.15s;
  flex: none;
}
.table-events details[open] summary::before { transform: rotate(90deg); }
.table-events details summary .preview {
  font-family: var(--mono);
  font-size: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 520px;
}
.table-events pre {
  margin: 8px 0 0;
  padding: 10px 12px;
  border-radius: 7px;
  background: var(--surface-2);
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.45;
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 320px;
  overflow: auto;
}

/* ---------- Modal ---------- */

.modal {
  width: min(780px, 96vw);
  max-height: 92vh;
  margin: auto;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  color: var(--fg);
  box-shadow: var(--shadow-lg);
  font-family: var(--font);
}
.modal-sm { width: min(440px, 94vw); }
.modal::backdrop { background: rgba(10, 14, 22, 0.55); }

.modal-form { display: flex; flex-direction: column; max-height: 92vh; }

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
}
.modal-head h2 { margin: 0; font-size: 16px; font-weight: 650; }

.modal-body {
  padding: 16px 18px 6px;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
}

.modal-foot {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 18px;
  border-top: 1px solid var(--line);
  background: var(--surface);
}

.confirm-title { margin: 6px 0 6px; font-size: 16px; font-weight: 650; }

/* ---------- Toasts ---------- */

.toasts {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 100;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: min(420px, calc(100vw - 32px));
}

.toast {
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  border-radius: 8px;
  background: var(--surface);
  color: var(--fg);
  box-shadow: var(--shadow-lg);
  font-size: 13px;
  line-height: 1.4;
  animation: toast-in 0.25s ease-out both;
  transition: opacity 0.25s, transform 0.25s;
}
.toast.is-ok { border-left-color: var(--ok); }
.toast.is-error { border-left-color: var(--danger); }
.toast.is-warn { border-left-color: var(--warn); }
.toast.is-out { opacity: 0; transform: translateY(6px); }
.toast a { font-weight: 600; }

@keyframes toast-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ---------- Responsive ---------- */

@media (max-width: 900px) {
  .topbar { gap: 10px; padding: 0 12px; flex-wrap: wrap; height: auto; min-height: 52px; padding-bottom: 6px; }
  .brand-org { display: none; }
  .nav { order: 3; width: 100%; overflow-x: auto; padding-bottom: 2px; }
  .who { display: none; }
  .main { padding: 14px 12px 40px; }
  .row-2, .row-3 { grid-template-columns: 1fr; }
  .modal { width: 100vw; max-width: 100vw; max-height: 100vh; border-radius: 0; }
  .modal-form { max-height: 100vh; }
  .live-grid { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}
