:root {
  color-scheme: light;
  --page: #f9f9f7;
  --surface: #fcfcfb;
  --surface-2: #f3f2ee;
  --surface-3: #ebeae5;
  --ink: #0b0b0b;
  --ink-2: #52514e;
  --muted: #898781;
  --border: rgba(11, 11, 11, 0.10);
  --border-strong: rgba(11, 11, 11, 0.16);
  --accent: #2a78d6;
  --accent-strong: #1c5cab;
  --accent-soft: rgba(42, 120, 214, 0.12);
  --info-text: #1c5cab;
  --good: #0ca30c;
  --good-text: #006300;
  --good-soft: rgba(12, 163, 12, 0.12);
  --warning: #fab219;
  --warning-text: #7a4c00;
  --warning-soft: rgba(250, 178, 25, 0.18);
  --critical: #d03b3b;
  --critical-text: #a12626;
  --critical-soft: rgba(208, 59, 59, 0.12);
  --shadow: 0 1px 2px rgba(11, 11, 11, 0.04), 0 8px 24px rgba(11, 11, 11, 0.04);
  --radius: 12px;
  --radius-sm: 8px;
  --sidebar: 232px;
  --font: system-ui, -apple-system, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

html[data-theme="dark"] {
  color-scheme: dark;
  --page: #0d0d0d;
  --surface: #1a1a19;
  --surface-2: #232322;
  --surface-3: #2c2c2a;
  --ink: #f0efec;
  --ink-2: #c3c2b7;
  --muted: #898781;
  --border: rgba(255, 255, 255, 0.10);
  --border-strong: rgba(255, 255, 255, 0.16);
  --accent: #3987e5;
  --accent-strong: #256abf;
  --accent-soft: rgba(57, 135, 229, 0.18);
  --info-text: #86b6ef;
  --good: #0ca30c;
  --good-text: #0ca30c;
  --good-soft: rgba(12, 163, 12, 0.18);
  --warning: #fab219;
  --warning-text: #fab219;
  --warning-soft: rgba(250, 178, 25, 0.16);
  --critical: #d03b3b;
  --critical-text: #e66767;
  --critical-soft: rgba(208, 59, 59, 0.20);
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.30), 0 8px 24px rgba(0, 0, 0, 0.25);
}

* { box-sizing: border-box; }

html, body { min-height: 100%; }

body {
  margin: 0;
  background: var(--page);
  color: var(--ink);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

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

button, input, select, textarea { font: inherit; color: inherit; }

button { -webkit-tap-highlight-color: transparent; }

[hidden] { display: none !important; }

.muted { color: var(--muted); }
.mono { font-family: var(--mono); }
.row { display: flex; align-items: center; gap: 8px; }
.grow { flex: 1; }
.right { margin-left: auto; }
.stack { display: flex; flex-direction: column; gap: 12px; }

.icon { display: block; flex: none; }

/* ---------------------------------------------------------------- shell */

.app-shell {
  display: grid;
  grid-template-columns: var(--sidebar) minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding: 20px 14px 16px;
  background: var(--surface);
  border-right: 1px solid var(--border);
}

.brand { display: flex; align-items: center; gap: 10px; padding: 2px 8px 8px; }

.brand-logo {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  flex: none;
  display: block;
}

.brand-name { font-size: 15px; font-weight: 700; letter-spacing: 0.02em; }
.brand-sub { font-size: 11px; color: var(--muted); }

.nav { display: flex; flex-direction: column; gap: 2px; }

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border-radius: var(--radius-sm);
  color: var(--ink-2);
  font-size: 13.5px;
  font-weight: 500;
}

.nav-item:hover { background: var(--surface-2); color: var(--ink); }
.nav-item.active { background: var(--accent-soft); color: var(--info-text); font-weight: 600; }

.sidebar-foot { margin-top: auto; border-top: 1px solid var(--border); padding-top: 12px; }

.user-chip { display: flex; align-items: center; gap: 9px; padding: 6px; }

.avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--surface-3);
  color: var(--ink-2);
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 600;
  flex: none;
}

.user-meta { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.user-name { font-size: 12.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-role { font-size: 11px; color: var(--muted); }

.main { min-width: 0; display: flex; flex-direction: column; }

.topbar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  padding: 22px 28px 0;
}

.page-heading h1 { margin: 0; font-size: 22px; letter-spacing: -0.01em; }
.page-heading p { margin: 3px 0 0; font-size: 12.5px; color: var(--muted); }

.topbar-actions { display: flex; align-items: center; gap: 10px; }

.live-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--good);
  box-shadow: 0 0 0 3px var(--good-soft);
}

.live-text { font-size: 11.5px; color: var(--muted); margin-right: 4px; }

.content { width: 100%; max-width: 1480px; padding: 20px 28px 40px; }

.icon-btn {
  width: 32px;
  height: 32px;
  display: inline-grid;
  place-items: center;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--ink-2);
  cursor: pointer;
}

.icon-btn:hover { background: var(--surface-2); color: var(--ink); }

/* ---------------------------------------------------------------- cards */

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.kpi { padding: 16px 18px 15px; }

.kpi-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.kpi-label { font-size: 12px; color: var(--ink-2); font-weight: 550; }

.kpi-icon {
  width: 30px;
  height: 30px;
  border-radius: var(--radius-sm);
  display: grid;
  place-items: center;
}

.kpi-value {
  margin-top: 8px;
  font-size: 34px;
  font-weight: 650;
  letter-spacing: -0.03em;
  line-height: 1.05;
}

.kpi-meta { margin-top: 5px; font-size: 11.5px; color: var(--muted); }

.kpi-info { background: var(--accent-soft); color: var(--info-text); }
.kpi-good { background: var(--good-soft); color: var(--good-text); }
.kpi-warning { background: var(--warning-soft); color: var(--warning-text); }
.kpi-critical { background: var(--critical-soft); color: var(--critical-text); }

.section { margin-bottom: 18px; overflow: hidden; }

.section-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 15px 18px;
  border-bottom: 1px solid var(--border);
}

.section-head.compact { padding: 12px 14px; }
.section-head h2 { margin: 0; font-size: 14.5px; font-weight: 650; }
.section-head p { margin: 3px 0 0; font-size: 11.5px; color: var(--muted); }
.section-actions { display: flex; align-items: center; gap: 8px; }

.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.grid-2 > .section { margin-bottom: 0; }

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

.toolbar .spacer { flex: 1; }
.toolbar select { width: auto; min-width: 150px; }

/* ---------------------------------------------------------------- forms */

input[type="text"],
input[type="search"],
input[type="password"],
select,
textarea {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  font-size: 13px;
  outline: none;
}

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

textarea { resize: vertical; min-height: 72px; line-height: 1.5; }
select { cursor: pointer; }

.field { display: flex; flex-direction: column; gap: 6px; }
.field > span { font-size: 12px; font-weight: 550; color: var(--ink-2); }

.field-group { display: flex; flex-direction: column; gap: 12px; margin-top: 12px; }

.checkbox {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 14px;
  font-size: 12.5px;
  color: var(--ink-2);
}

.checkbox input { width: 16px; height: 16px; accent-color: var(--accent); }

.form { display: flex; flex-direction: column; gap: 12px; }

.form-error {
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  background: var(--critical-soft);
  color: var(--critical-text);
  font-size: 12.5px;
}

.hint { margin: 0; font-size: 11.5px; color: var(--muted); line-height: 1.55; }

/* ---------------------------------------------------------------- buttons */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 34px;
  padding: 0 14px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--ink);
  font-size: 13px;
  font-weight: 550;
  white-space: nowrap;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.btn:hover { background: var(--surface-2); }
.btn.primary { background: var(--accent-strong); border-color: var(--accent-strong); color: #fff; }
.btn.primary:hover { filter: brightness(0.95); }
.btn.ghost { background: transparent; }
.btn.danger { background: var(--critical); border-color: var(--critical); color: #fff; }
.btn.danger-ghost { background: transparent; color: var(--critical-text); }
.btn.danger-ghost:hover { background: var(--critical-soft); }
.btn.small { height: 28px; padding: 0 10px; font-size: 12px; }
.btn.block { width: 100%; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.btn:focus-visible,
.icon-btn:focus-visible,
a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* ---------------------------------------------------------------- badges */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 22px;
  padding: 0 8px;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--ink-2);
  font-size: 11.5px;
  font-weight: 600;
  white-space: nowrap;
}

.badge-good { background: var(--good-soft); color: var(--good-text); }
.badge-warning { background: var(--warning-soft); color: var(--warning-text); }
.badge-critical { background: var(--critical-soft); color: var(--critical-text); }
.badge-info { background: var(--accent-soft); color: var(--info-text); }
.badge-neutral { background: var(--surface-2); color: var(--ink-2); }

/* ---------------------------------------------------------------- tables */

.table-wrap { overflow-x: auto; }

table { width: 100%; border-collapse: collapse; font-size: 12.8px; }

th {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-align: left;
  white-space: nowrap;
}

td { padding: 11px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover td { background: var(--surface-2); }

.num { font-variant-numeric: tabular-nums; }
.cell-title { font-size: 13px; font-weight: 600; }
.cell-sub { margin-top: 2px; font-size: 11px; color: var(--muted); }
.cell-actions { display: flex; justify-content: flex-end; gap: 6px; }

/* ---------------------------------------------------------------- lists */

.list { display: flex; flex-direction: column; }

.list-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 11px 18px;
  border-bottom: 1px solid var(--border);
}

.list-row:last-child { border-bottom: none; }

.row-main { min-width: 0; }
.row-title { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row-sub { margin-top: 2px; font-size: 11.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row-meta { display: flex; align-items: center; gap: 10px; flex: none; font-size: 11.5px; color: var(--muted); }

.row-wrap { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.cap-list { display: flex; flex-wrap: wrap; gap: 4px; }

/* ---------------------------------------------------------------- states */

.empty-state { padding: 42px 20px; text-align: center; color: var(--muted); }

.empty-icon {
  width: 46px;
  height: 46px;
  margin: 0 auto 12px;
  border-radius: 50%;
  background: var(--surface-2);
  display: grid;
  place-items: center;
  color: var(--muted);
}

.empty-state h3 { margin: 0 0 5px; font-size: 14px; font-weight: 600; color: var(--ink); }
.empty-state p { max-width: 400px; margin: 0 auto; font-size: 12.5px; line-height: 1.55; }
.empty-state .btn, .empty-state a.btn { margin-top: 14px; }

.loading { display: flex; align-items: center; gap: 10px; padding: 28px 4px; color: var(--muted); font-size: 12.5px; }

.spinner {
  width: 16px;
  height: 16px;
  border: 2px solid var(--border-strong);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  flex: none;
}

@keyframes spin { to { transform: rotate(360deg); } }

.error-box {
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  background: var(--critical-soft);
  color: var(--critical-text);
  font-size: 12.5px;
}

/* ---------------------------------------------------------------- login */

.login-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(1100px 520px at 50% -10%, var(--accent-soft), transparent 62%),
    var(--page);
}

.login-card { width: min(380px, 100%); padding: 28px; }
.login-brand { display: flex; align-items: center; gap: 11px; margin-bottom: 22px; }
.login-brand .brand-logo { width: 42px; height: 42px; border-radius: 12px; }
.login-card h1 { margin: 0 0 4px; font-size: 20px; }
.login-card > p { margin: 0 0 18px; font-size: 12.5px; color: var(--muted); }
.login-card .btn.block { margin-top: 4px; }

/* ---------------------------------------------------------------- conversations */

.conversation-layout {
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  gap: 14px;
  height: calc(100vh - 150px);
  min-height: 520px;
}

.conversation-list-card,
.conv-panel { display: flex; flex-direction: column; min-height: 0; overflow: hidden; }

.conv-filters {
  display: flex;
  gap: 8px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
}

.conv-filters input { flex: 1; min-width: 0; }
.conv-filters select { width: 128px; flex: none; }

.conv-list { flex: 1; overflow-y: auto; }

.conv-item {
  display: block;
  width: 100%;
  padding: 11px 14px;
  border: 0;
  border-bottom: 1px solid var(--border);
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.conv-item:hover { background: var(--surface-2); }
.conv-item.active { background: var(--accent-soft); }

.conv-item-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.conv-name { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.conv-time { flex: none; font-size: 10.5px; color: var(--muted); }
.conv-item-sub { display: flex; align-items: center; gap: 6px; margin-top: 5px; font-size: 11px; color: var(--muted); }

.conv-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 58px;
  padding: 13px 16px;
  border-bottom: 1px solid var(--border);
}

.conv-panel-title { font-size: 14px; font-weight: 650; }
.conv-panel-sub { margin-top: 2px; font-size: 11.5px; color: var(--muted); }

.messages {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 10px;
  overflow-y: auto;
  padding: 16px;
  background: var(--page);
}

.message { display: flex; flex-direction: column; max-width: 72%; }
.message.in { align-self: flex-start; align-items: flex-start; }
.message.out { align-self: flex-end; align-items: flex-end; }

.bubble {
  padding: 8px 11px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  font-size: 13px;
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-word;
}

.message.out .bubble { background: var(--accent-soft); border-color: transparent; }
.message-meta { margin-top: 3px; font-size: 10.5px; color: var(--muted); }

.composer {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  padding: 11px 12px;
  border-top: 1px solid var(--border);
  background: var(--surface);
}

.composer textarea { flex: 1; min-height: 42px; max-height: 120px; }
.composer .btn { flex: none; }

.composer-note {
  padding: 8px 14px;
  border-top: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--muted);
  font-size: 11.5px;
}

/* ---------------------------------------------------------------- modal */

.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(11, 11, 11, 0.42);
  backdrop-filter: blur(2px);
}

.modal {
  width: min(560px, 100%);
  max-height: 86vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.25);
}

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
}

.modal-head h2 { margin: 0; font-size: 15px; font-weight: 650; }
.modal-body { padding: 18px; overflow-y: auto; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 13px 18px; border-top: 1px solid var(--border); }
.modal-foot:empty { display: none; }

.modal-body h3 { margin: 16px 0 6px; color: var(--ink-2); font-size: 12px; font-weight: 650; }
.modal-body h3:first-child { margin-top: 0; }

.pairing-code {
  margin: 14px 0;
  padding: 16px;
  border-radius: 10px;
  background: var(--surface-2);
  font-family: var(--mono);
  font-size: 28px;
  letter-spacing: 0.18em;
  text-align: center;
  user-select: all;
}

.code-block {
  max-height: 260px;
  margin: 0;
  padding: 12px;
  overflow: auto;
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  font-family: var(--mono);
  font-size: 11.5px;
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-word;
}

.detail-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 18px; margin-bottom: 16px; }
.detail-item .label { display: block; margin-bottom: 2px; color: var(--muted); font-size: 10.5px; }
.detail-item code { font-size: 12px; }

/* ---------------------------------------------------------------- toast */

.toast-host {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 100;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: 380px;
  padding: 10px 13px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  box-shadow: var(--shadow);
  font-size: 12.5px;
  pointer-events: auto;
  animation: toast-in 0.18s ease-out;
}

.toast-icon { display: flex; flex: none; }
.toast-good .toast-icon { color: var(--good); }
.toast-warning .toast-icon { color: var(--warning-text); }
.toast-critical .toast-icon { color: var(--critical); }
.toast-info .toast-icon { color: var(--accent); }
.toast-out { opacity: 0; transform: translateY(4px); transition: opacity 0.2s ease, transform 0.2s ease; }

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

/* ---------------------------------------------------------------- tabs & progress */

.tabs {
  display: inline-flex;
  gap: 3px;
  padding: 3px;
  border-radius: var(--radius-sm);
  background: var(--surface-2);
}

.tab {
  height: 28px;
  padding: 0 11px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--ink-2);
  font-size: 12px;
  font-weight: 550;
  cursor: pointer;
}

.tab.active { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08); }

.progress-wrap { display: flex; align-items: center; gap: 8px; }

.progress {
  min-width: 80px;
  height: 6px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--surface-3);
}

.progress span { display: block; height: 100%; border-radius: 999px; background: var(--accent); transition: width 0.2s ease; }
.progress-value { min-width: 30px; color: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; text-align: right; }

/* ---------------------------------------------------------------- approvals */

.approval-list { display: flex; flex-direction: column; gap: 12px; }
.approval-card { padding: 15px 17px; }
.approval-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.approval-peer { font-size: 13.5px; font-weight: 650; }

.approval-content {
  margin: 10px 0;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  font-size: 13px;
  line-height: 1.55;
  white-space: pre-wrap;
  word-break: break-word;
}

.approval-meta { display: flex; flex-wrap: wrap; gap: 8px 14px; color: var(--muted); font-size: 11.5px; }
.approval-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 12px; }

/* ---------------------------------------------------------------- responsive */

@media (max-width: 1100px) {
  .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-2 { grid-template-columns: 1fr; }
  .conversation-layout { grid-template-columns: 280px minmax(0, 1fr); }
}

@media (max-width: 860px) {
  .app-shell { grid-template-columns: 1fr; }

  .sidebar {
    position: static;
    height: auto;
    flex-direction: row;
    align-items: center;
    gap: 12px;
    overflow-x: auto;
    padding: 10px 14px;
    border-right: 0;
    border-bottom: 1px solid var(--border);
  }

  .brand { padding: 0; flex: none; }
  .brand-sub { display: none; }
  .nav { flex-direction: row; gap: 2px; }
  .nav-item { padding: 8px 10px; white-space: nowrap; }
  .sidebar-foot { margin: 0 0 0 auto; padding: 0; border: 0; }
  .user-meta { display: none; }

  .topbar { padding: 16px 18px 0; }
  .content { padding: 16px 18px 32px; }

  .conversation-layout { grid-template-columns: 1fr; height: auto; min-height: 0; }
  .conversation-list-card { max-height: 280px; }
  .conv-panel { min-height: 520px; }
}

@media (max-width: 600px) {
  .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .kpi-value { font-size: 28px; }
  .topbar { flex-direction: column; align-items: flex-start; gap: 10px; }
  .topbar-actions { align-self: flex-end; }
  .page-heading h1 { font-size: 20px; }
  .detail-grid { grid-template-columns: 1fr; }
  .toolbar .btn { flex: 1; }
  .live-text { display: none; }

  .sidebar { flex-wrap: wrap; gap: 8px 12px; }
  .brand { order: 1; }
  .sidebar-foot { order: 2; margin-left: auto; }
  .nav { order: 3; flex-basis: 100%; overflow-x: auto; padding-bottom: 2px; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}
