:root {
  --bg: #0d0d0d;
  --surface: #1a1a1a;
  --border: #2e2e2e;
  --text: #e0e0e0;
  --muted: #888;
  --green: #4caf50;
  --yellow: #ffc107;
  --red: #f44336;
  --accent: #7c9cf5;
  --font: 'JetBrains Mono', 'Fira Code', monospace;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
}

/* iOS Safari 100vh fix */
@supports (height: 100dvh) {
  body { height: 100dvh; }
}
@supports not (height: 100dvh) {
  body { height: 100vh; height: -webkit-fill-available; }
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 13px;
  line-height: 1.5;
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
}

/* ── Header ──────────────────────────────────── */
header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 20px;
  padding-top: max(12px, var(--safe-top));
  padding-left: max(20px, var(--safe-left));
  padding-right: max(20px, var(--safe-right));
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  flex-shrink: 0;
}

header h1 { font-size: 15px; letter-spacing: 0.05em; color: var(--accent); margin-right: 12px; }

/* Header date filters */
.header-filters {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 12px;
  flex-shrink: 0;
}
.header-filters .hf-label {
  font-size: 13px;
  color: var(--muted);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.header-filters .hf-date-group {
  display: flex;
  align-items: center;
  gap: 4px;
  position: relative;
}
.header-filters .hf-input {
  width: 110px;
  padding: 5px 8px;
  background: rgba(15,23,42,0.85);
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--text);
  font-size: 13px;
  font-family: var(--font);
  outline: none;
}
.header-filters .hf-input:focus {
  border-color: var(--accent);
}
/* Native date picker — layered on top of the 📅 button so clicks hit it directly */
.header-filters .hf-native {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
  /* Modern date input minimum width needed for click area */
  min-width: 32px;
  min-height: 32px;
}
/* Keep text input visible, native picker overlays the calendar button only */
.header-filters .hf-cal {
  font-size: 13px;
  padding: 4px 7px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: rgba(15,23,42,0.85);
  color: var(--muted);
  cursor: pointer;
  line-height: 1.4;
  transition: background 0.15s, color 0.15s;
}
.header-filters .hf-cal:hover {
  background: rgba(124,156,245,0.2);
  color: var(--accent);
}
.header-filters .hf-sync {
  font-size: 13px;
  padding: 4px 9px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  line-height: 1.4;
  transition: background 0.15s, color 0.15s;
}
.header-filters .hf-sync:hover {
  background: rgba(124,156,245,0.15);
  color: var(--accent);
}
.header-filters .hf-sync:disabled {
  opacity: 0.6;
  cursor: wait;
}

#last-updated { color: var(--muted); font-size: 11px; margin-left: auto; }

.version-badge {
  font-size: 11px;
  color: var(--muted);
  background: rgba(255,255,255,0.06);
  padding: 2px 8px;
  border-radius: 4px;
  margin-left: 10px;
  font-family: var(--mono);
}

.badge {
  font-size: 18px;
  line-height: 1;
  color: var(--yellow);
}
.badge.ok { color: var(--green); }
.badge.err { color: var(--red); }

/* ── Grid layout ─────────────────────────────── */
.grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  padding: 16px;
}

.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 12px;
  overflow: hidden;
}

.panel.wide {
  grid-column: 1 / -1 !important;
  width: 100vw;
  margin-left: -16px;
  padding-left: 16px;
  padding-right: 16px;
  border-radius: 0;
}
html:has(.panel.wide) {
  overflow-x: hidden;
}

.panel h2 {
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 10px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 6px;
}

.content.loading { color: var(--muted); font-style: italic; }
.content.error { color: var(--red); }

/* ── Empty states ────────────────────────────── */
.empty-state {
  color: var(--muted);
  font-style: italic;
  padding: 18px 0;
  text-align: center;
  line-height: 2;
}
.empty-hint {
  font-size: 10px;
  opacity: 0.7;
}
.empty-hint code {
  background: #252525;
  padding: 1px 5px;
  border-radius: 3px;
  font-style: normal;
}

/* ── Agent grid ──────────────────────────────── */
.agent-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 10px;
}

.agent-card {
  background: #111;
  border: 1px solid var(--border);
  border-left: 3px solid var(--border);
  border-radius: 6px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 7px;
}
.agent-running { border-left-color: var(--green); }
.agent-waiting { border-left-color: var(--yellow); }
.agent-stalled { border-left-color: var(--red); }
.agent-unknown { border-left-color: var(--muted); }

.agent-header {
  display: flex;
  align-items: center;
  gap: 6px;
}

.agent-pulse {
  font-size: 10px;
  flex-shrink: 0;
}
.agent-pulse-running { color: var(--green); animation: blink 2.2s ease-in-out infinite; }
.agent-pulse-waiting { color: var(--yellow); }
.agent-pulse-stalled { color: var(--red); animation: blink 0.9s ease-in-out infinite; }
.agent-pulse-unknown { color: var(--muted); }

@keyframes blink {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.3; }
}

.agent-title {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.agent-name {
  font-size: 12px;
  color: var(--text);
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.agent-role {
  font-size: 10px;
  color: var(--muted);
}

.agent-badge {
  font-size: 9px;
  padding: 1px 5px;
  border-radius: 3px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  flex-shrink: 0;
}
.agent-badge-running { background: #1a3a1a; color: var(--green); }
.agent-badge-waiting { background: #3a3a1a; color: var(--yellow); }
.agent-badge-stalled { background: #3a1a1a; color: var(--red); }
.agent-badge-unknown { background: #222; color: var(--muted); }

.agent-task {
  font-size: 11px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.agent-progress-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
}
.agent-progress-bar {
  flex: 1;
  height: 3px;
  background: var(--border);
  border-radius: 2px;
  overflow: hidden;
}
.agent-progress-fill {
  height: 100%;
  border-radius: 2px;
  transition: width 0.5s ease;
}
.agent-progress-running { background: var(--green); }
.agent-progress-waiting { background: var(--yellow); }
.agent-progress-stalled { background: var(--red); }
.agent-progress-unknown { background: var(--muted); }

.agent-progress-pct {
  font-size: 10px;
  color: var(--muted);
  width: 28px;
  text-align: right;
  flex-shrink: 0;
}

.agent-footer {
  display: flex;
  gap: 8px;
  font-size: 10px;
  color: var(--muted);
  flex-wrap: wrap;
}
.agent-lastseen { margin-left: auto; }
.agent-metrics.has-errors { color: var(--yellow); }

/* ── Activity proof evidence row ─────────────── */
.agent-proof {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  padding-top: 4px;
  border-top: 1px solid var(--border);
  font-size: 9px;
}
.proof-signals {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  flex: 1;
}
.proof-signal {
  background: #1a1a1a;
  border: 1px solid #333;
  border-radius: 3px;
  padding: 1px 4px;
  color: #888;
  white-space: nowrap;
}
.proof-confidence {
  flex-shrink: 0;
  padding: 1px 5px;
  border-radius: 3px;
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.conf-high  { background: #0d2010; color: #4caf7a; }
.conf-med   { background: #2a2510; color: #c8a84b; }
.conf-low   { background: #1e1a1a; color: #777; }

/* ── Event feed ──────────────────────────────── */
#panel-events {
  height: 100%;
  overflow-y: auto;
}

.event-feed {
  display: flex;
  flex-direction: column;
  gap: 2px;
  width: 100%;
  min-width: 0;
}

.event-row {
  display: grid;
  grid-template-columns: 90px 90px 70px minmax(0, 1fr);
  gap: 10px;
  padding: 6px 10px;
  border-radius: 4px;
  font-size: 11px;
  align-items: start;
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
}
.event-row:nth-child(odd) { background: #111; }

.event-time  { color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.event-agent { color: var(--accent); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.event-level { font-size: 9px; text-transform: uppercase; letter-spacing: 0.05em; font-weight: 600; white-space: nowrap; }
.event-msg   { color: var(--text); line-height: 1.35; min-width: 0; }

.event-info    .event-level { color: var(--muted); }
.event-success .event-level { color: var(--green); }
.event-warn    .event-level { color: var(--yellow); }
.event-error   .event-level { color: var(--red); }

.event-error { background: rgba(244, 67, 54, 0.07) !important; }
.event-warn  { background: rgba(255, 193, 7, 0.05) !important; }

/* ── Tasks ───────────────────────────────────── */
.task { display: flex; gap: 8px; align-items: baseline; padding: 3px 0; }
.task .status { font-size: 10px; padding: 1px 5px; border-radius: 3px; flex-shrink: 0; }
.status-active  { background: #1a3a1a; color: var(--green); }
.status-blocked { background: #3a1a1a; color: var(--red); }
.status-done    { background: #222; color: var(--muted); text-decoration: line-through; }
.status-failed  { background: #2a1010; color: var(--red); }
.status-paused  { background: #1a1a2e; color: #8888cc; }

/* ── Tables (cron, sessions, heartbeat) ──────── */
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 4px 8px; border-bottom: 1px solid var(--border); }
th { color: var(--muted); font-size: 11px; }

/* ── Log tail ────────────────────────────────── */
#panel-logs .content {
  max-height: 300px;
  overflow-y: auto;
  white-space: pre-wrap;
  font-size: 11px;
  color: var(--muted);
}

/* ── State inspector ─────────────────────────── */
.state-file { margin-bottom: 10px; }
.state-file summary { cursor: pointer; color: var(--accent); }
.state-file pre { font-size: 11px; color: var(--muted); padding: 8px 0 0 12px; }

/* ── Responsive ──────────────────────────────── */
@media (max-width: 700px) {
  .grid { grid-template-columns: 1fr; }
  .panel.wide { grid-column: 1; }
  .event-row { grid-template-columns: 82px minmax(0, 1fr); }
  .event-agent, .event-level { display: none; }

  header { padding: 10px 14px; padding-top: max(10px, var(--safe-top)); gap: 8px; }
  header h1 { font-size: 13px; }

  /* Increase touch targets */
  button, .filter-reset { min-height: 44px; min-width: 44px; }
  .filter-date, .hf-input { min-height: 44px; font-size: 16px; /* prevents iOS zoom */ }

  /* Drawer: full width on mobile */
  #agent-drawer { width: 100vw; max-width: 100vw; }

  /* Bottom panel shorter on mobile */
  #bottom-panel { height: 200px; }
}

/* Touch targets for interactive elements */
@media (pointer: coarse) {
  .graph-node { cursor: pointer; }
  .graph-edge-hit { stroke-width: 24 !important; }
  .sortable, .filter-reset, button { min-height: 44px; }
  .event-row { padding: 8px 10px; }
}

/* ═══════════════════════════════════════════════
   GRAPH-FIRST LAYOUT
   ═══════════════════════════════════════════════ */

/* ── Graph wrap fills remaining viewport height ── */
#graph-wrap {
  flex: 1;
  min-height: 0;
  position: relative;
  overflow: hidden;
}

.graph-content {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}
.graph-content.loading { color: var(--muted); font-style: italic; }
.graph-content.error   { color: var(--red); padding: 20px; }

.graph-empty {
  text-align: center;
  color: var(--muted);
  font-style: italic;
  line-height: 2;
}

/* ── SVG graph ───────────────────────────────── */
.agent-graph {
  width: 100%;
  height: 100%;
  display: block;
}

/* Node groups */
.graph-node { transition: opacity 0.2s ease; }
.node-dim    { opacity: 0.2; }
.node-selected .progress-arc { stroke-opacity: 1 !important; }

/* Node labels */
.node-label {
  font: 600 11px 'JetBrains Mono', 'Fira Code', monospace;
  fill: #d0d0d0;
  pointer-events: none;
}
.node-role-label {
  font: 9px 'JetBrains Mono', 'Fira Code', monospace;
  fill: #666;
  pointer-events: none;
}
.node-run-label {
  font: 8px 'JetBrains Mono', 'Fira Code', monospace;
  fill: var(--accent);
  opacity: 0.6;
  pointer-events: none;
}
.node-cost-label {
  font: 9px 'JetBrains Mono', 'Fira Code', monospace;
  fill: #888;
  pointer-events: none;
}
.da-cost { color: #f0c040; font-size: 0.82em; }

/* Node halo (running agents) */
.node-halo {
  animation: halo-pulse 3s ease-in-out infinite;
}
@keyframes halo-pulse {
  0%, 100% { opacity: 0.07; }
  50%       { opacity: 0.18; }
}

/* Status dots on nodes */
.dot-pulse {
  animation: dot-blink 2.2s ease-in-out infinite;
}
.dot-stall {
  animation: dot-blink 0.8s ease-in-out infinite;
}
@keyframes dot-blink {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.2; }
}

/* Edge lines */
.graph-edge {
  transition: stroke-opacity 0.2s ease, stroke-width 0.2s ease;
  pointer-events: none;
}
.graph-edge.edge-dim { stroke-opacity: 0.04 !important; }

/* Handoff label on active edges */
.edge-handoff-label {
  font: 600 9px 'JetBrains Mono', 'Fira Code', monospace;
  pointer-events: none;
  text-shadow: 0 0 6px rgba(0,0,0,0.8);
}

/* ── System details (collapsible) ────────────── */
#system-details {
  flex-shrink: 0;
  border-top: 1px solid var(--border);
  background: var(--surface);
}

#system-details > summary {
  padding: 8px 20px;
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  cursor: pointer;
  list-style: none;
  user-select: none;
  display: flex;
  align-items: center;
  gap: 6px;
}
#system-details > summary::-webkit-details-marker { display: none; }
#system-details > summary::marker { display: none; }
#system-details:not([open]) > summary::before { content: '▶'; font-size: 8px; }
#system-details[open]        > summary::before { content: '▼'; font-size: 8px; }
#system-details > summary:hover { color: var(--text); }

.details-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  padding: 10px 16px 14px;
  max-height: 38vh;
  overflow-y: auto;
}
.details-grid .panel.wide { grid-column: 1 / -1; }

/* ── Drawer overlay ──────────────────────────── */
#drawer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  z-index: 100;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s ease;
}
#drawer-overlay.active {
  opacity: 1;
  pointer-events: all;
}

/* ── Agent detail drawer ─────────────────────── */
#agent-drawer {
  position: fixed;
  top: 0;
  right: 0;
  width: 360px;
  max-width: 92vw;
  height: 100vh;
  background: #111;
  border-left: 1px solid var(--border);
  z-index: 101;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.22s ease;
  overflow: hidden;
}
#agent-drawer.open { transform: translateX(0); }

.drawer-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 13px 16px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  background: #141414;
}
.drawer-title {
  flex: 1;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
#drawer-close {
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  font-size: 13px;
  padding: 3px 7px;
  border-radius: 4px;
  line-height: 1;
  font-family: var(--font);
}
#drawer-close:hover { color: var(--text); background: #222; }

#drawer-content {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

/* ── Drawer internals ────────────────────────── */
.da-status-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
}
.da-dot { font-size: 15px; line-height: 1; }
.da-dot.st-running { color: var(--green); animation: blink 2.2s ease-in-out infinite; }
.da-dot.st-waiting { color: var(--yellow); }
.da-dot.st-stalled { color: var(--red); animation: blink 0.8s ease-in-out infinite; }
.da-dot.st-unknown { color: var(--muted); }

.da-badge {
  font-size: 9px;
  padding: 2px 6px;
  border-radius: 3px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 600;
}
.da-badge.st-badge-running { background: #1a3a1a; color: var(--green); }
.da-badge.st-badge-waiting { background: #3a3a1a; color: var(--yellow); }
.da-badge.st-badge-stalled { background: #3a1a1a; color: var(--red); }
.da-badge.st-badge-unknown { background: #222;   color: var(--muted); }

.da-meta { color: var(--muted); font-size: 10px; }
.da-lastseen { margin-left: auto; }

/* Run label: displayed below status row and in sessions list */
.da-run-label {
  font-size: 10px;
  color: var(--accent);
  opacity: 0.8;
  letter-spacing: 0.04em;
  margin-top: -8px;
}
.ss-run-label {
  font-size: 10px;
  color: var(--accent);
  opacity: 0.85;
  letter-spacing: 0.03em;
}
.muted { color: var(--muted); }

.da-section { display: flex; flex-direction: column; gap: 7px; }

.da-label {
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: #555;
}

.da-task {
  font-size: 12px;
  color: var(--text);
  line-height: 1.6;
}

.da-progress-row { display: flex; align-items: center; gap: 8px; }
.da-bar {
  flex: 1;
  height: 4px;
  background: var(--border);
  border-radius: 2px;
  overflow: hidden;
}
.da-fill {
  height: 100%;
  border-radius: 2px;
  transition: width 0.5s ease;
}
.da-fill.st-fill-running { background: var(--green); }
.da-fill.st-fill-waiting { background: var(--yellow); }
.da-fill.st-fill-stalled { background: var(--red); }
.da-fill.st-fill-unknown { background: var(--muted); }
.da-pct {
  font-size: 10px;
  color: var(--muted);
  width: 30px;
  text-align: right;
  flex-shrink: 0;
}

.da-metrics {
  flex-direction: row;
  flex-wrap: wrap;
  gap: 14px;
  font-size: 11px;
  color: var(--muted);
}
.da-metrics .has-errors { color: var(--yellow); }

.da-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  font-size: 10px;
  padding: 2px 9px;
  border-radius: 10px;
  border: 1px solid var(--border);
  color: var(--muted);
}
.chip.chip-running { border-color: #4caf5040; color: var(--green); }
.chip.chip-waiting { border-color: #ffc10740; color: var(--yellow); }
.chip.chip-stalled { border-color: #f4433640; color: var(--red); }

/* Events in drawer */
.da-events { display: flex; flex-direction: column; }
.da-event {
  display: grid;
  grid-template-columns: 58px 46px 1fr;
  gap: 6px;
  padding: 4px 0;
  font-size: 10px;
  border-bottom: 1px solid #1d1d1d;
  align-items: baseline;
}
/* Edge events have an extra agent column */
.da-event.has-agent {
  grid-template-columns: 58px 72px 46px 1fr;
}
/* Handoff events: replace the level column with the handoff badge */
.da-event.handoff-event {
  grid-template-columns: 58px 72px 68px 1fr;
  background: rgba(100, 181, 246, 0.04);
  border-left: 2px solid var(--accent);
  padding-left: 4px;
}
.da-event.lv-info    .ev-lv { color: #555; }
.da-event.lv-success .ev-lv { color: var(--green); }
.da-event.lv-warn    .ev-lv { color: var(--yellow); }
.da-event.lv-error   .ev-lv { color: var(--red); }
.ev-time  { color: var(--muted); font-variant-numeric: tabular-nums; }
.ev-lv    { text-transform: uppercase; letter-spacing: 0.05em; font-size: 9px; font-weight: 600; }
.ev-agent { color: var(--accent); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ev-msg   { color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ev-handoff-badge {
  font-size: 9px;
  font-weight: 700;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  white-space: nowrap;
}

/* Sessions in drawer */
.da-sessions { display: flex; flex-direction: column; }
.da-session {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 10px;
  padding: 4px 0;
  border-bottom: 1px solid #1d1d1d;
  color: var(--muted);
}
.ss-status { font-size: 8px; }
.ss-status.st-running { color: var(--green); }
.ss-ch  { color: var(--accent); }
.ss-key { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ss-time { margin-left: auto; flex-shrink: 0; }

/* Edge drawer */
.da-edge-agents {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.edge-arrow { color: var(--muted); font-size: 16px; }
.da-empty {
  color: var(--muted);
  font-style: italic;
  font-size: 11px;
}

/* ── Project context labels ──────────────────── */

/* SVG node project label (appears below the node circle as a caption) */
.node-project-label {
  font: 8px 'JetBrains Mono', 'Fira Code', monospace;
  fill: var(--accent);
  opacity: 0.55;
  pointer-events: none;
  letter-spacing: 0.04em;
}

/* Project tag in agent detail drawer */
.da-project-tag {
  font-size: 10px;
  color: var(--accent);
  font-family: var(--font);
  opacity: 0.85;
  margin-top: -8px;
  letter-spacing: 0.02em;
}

/* ── Bottom activity panel ───────────────────── */
#bottom-resizer {
  height: 6px;
  cursor: row-resize;
  background: #0f1320;
  border-top: 1px solid #1e2235;
  border-bottom: 1px solid #1e2235;
}
#bottom-resizer:hover,
#bottom-resizer.active { background: #1a2238; }

#bottom-panel {
  background: var(--bg-panel);
  border-top: 1px solid #1e2235;
  height: 240px;
  min-height: 120px;
  max-height: 60vh;
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding-bottom: var(--safe-bottom);
}

#panel-events.content {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 10px 16px 12px;
}

.bottom-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px 8px;
  border-bottom: 1px solid #1e2235;
}

.bottom-panel-title,
.feed-title {
  color: #888;
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  margin: 0 0 8px;
  text-transform: uppercase;
}

/* ── Cost table ──────────────────────────────── */
.cost-table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.cost-table th { text-align: left; padding: 6px 10px; border-bottom: 1px solid #2d3148; color: #888; font-weight: 500; }
.cost-table td { padding: 6px 10px; border-bottom: 1px solid #1a1d2e; }
.cost-table tr.total-row td { border-top: 2px solid #3d4268; color: #a78bfa; font-weight: 600; }
.cost-table .cost-val { color: #f0c040; }
.cost-table .token-val { color: #7dd3fc; }

/* ── Responsive (graph layout) ───────────────── */
@media (max-width: 700px) {
  #agent-drawer { width: 100vw; max-width: 100vw; }
  #main-area { flex-direction: column; height: auto; }
  #graph-wrap { height: 45vh; min-height: 250px; }
  #models-sidebar { width: 100%; border-left: none; border-top: 1px solid rgba(148, 163, 184, 0.14); max-height: 40vh; }
  #sidebar-resizer { display: none; }

  /* Smaller graph labels on mobile */
  .node-label { font-size: 9px; }
  .node-role-label { font-size: 8px; }
  .node-cost-label { font-size: 8px; }
  .node-run-label { font-size: 7px; }
  .node-time-label { font-size: 7px; }
  .node-project-label { font-size: 7px; }
  .edge-handoff-label { font-size: 7px; }
}

/* ── Models panel ────────────────────────────── */
.models-header {
  display: flex;
  gap: 1.5rem;
  align-items: center;
  margin-bottom: 1rem;
  padding: 0.75rem 1rem;
  background: rgba(15, 23, 42, 0.5);
  border-radius: 0.75rem;
  border: 1px solid rgba(148, 163, 184, 0.14);
}
.models-donut {
  flex-shrink: 0;
  width: 120px;
  height: 120px;
}
.donut-svg {
  width: 100%;
  height: 100%;
}
.donut-center-label {
  font-size: 9px;
  fill: #94a3b8;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.donut-center-value {
  font-size: 13px;
  fill: #f8fafc;
  font-weight: 700;
}
.models-summary {
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
}
.summary-stat {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}
.summary-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #94a3b8;
}
.summary-value {
  font-size: 1.1rem;
  font-weight: 700;
  color: #f8fafc;
}
.models-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}
.models-table th {
  text-align: left;
  padding: 0.4rem 0.6rem;
  color: #94a3b8;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  border-bottom: 1px solid rgba(148, 163, 184, 0.14);
}
.models-table td {
  padding: 0.5rem 0.6rem;
  border-bottom: 1px solid rgba(148, 163, 184, 0.08);
}
.model-name {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 600;
  white-space: nowrap;
}
.model-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}
.model-bar-cell {
  width: 30%;
  min-width: 80px;
}
.model-bar {
  height: 8px;
  border-radius: 4px;
  opacity: 0.8;
  transition: width 0.3s ease;
}
.cost-val { color: #fbbf24; font-weight: 600; }
.pct-val { color: #94a3b8; font-weight: 500; }
.num-val { color: #cbd5e1; }
.date-range { color: #64748b; font-size: 0.78rem; white-space: nowrap; }

/* ── Main area: graph + models sidebar ────────── */
#main-area {
  display: flex;
  gap: 0;
  height: calc(100vh - 160px);
  min-height: 400px;
}
#graph-wrap {
  flex: 1;
  min-width: 0;
  overflow: hidden;
}
#models-sidebar {
  width: 380px;
  flex-shrink: 0;
  background: rgba(15, 23, 42, 0.6);
  border-left: 1px solid rgba(148, 163, 184, 0.14);
  overflow-y: auto;
  padding: 0.75rem;
}
.sidebar-title {
  margin: 0 0 0.75rem;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #94a3b8;
  font-weight: 700;
}

/* Sidebar-adapted models panel */
#panel-models .models-header {
  flex-direction: column;
  align-items: flex-start;
  padding: 0.5rem;
}
#panel-models .models-donut {
  width: 100px;
  height: 100px;
  margin: 0 auto;
}
#panel-models .models-summary {
  width: 100%;
  justify-content: space-between;
}
#panel-models .models-table {
  font-size: 0.78rem;
}
#panel-models .models-table th,
#panel-models .models-table td {
  padding: 0.35rem 0.4rem;
}
#panel-models .model-bar-cell {
  width: 25%;
  min-width: 50px;
}

/* Responsive: stack on narrow screens */
@media (max-width: 900px) {
  #main-area {
    flex-direction: column;
    height: auto;
  }
  #graph-wrap {
    height: 50vh;
    min-height: 300px;
  }
  #models-sidebar {
    width: 100%;
    border-left: none;
    border-top: 1px solid rgba(148, 163, 184, 0.14);
    max-height: 40vh;
  }
}

/* ── Resizable sidebar ────────────────────────── */
#sidebar-resizer {
  width: 10px;
  cursor: col-resize;
  background: rgba(148, 163, 184, 0.15);
  flex-shrink: 0;
  transition: background 0.15s;
  position: relative;
  border-left: 1px solid rgba(148, 163, 184, 0.08);
  border-right: 1px solid rgba(148, 163, 184, 0.08);
}
#sidebar-resizer:hover,
#sidebar-resizer.active {
  background: rgba(59, 130, 246, 0.5);
  border-color: rgba(59, 130, 246, 0.3);
}
#sidebar-resizer::after {
  content: '⠿';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: rgba(148, 163, 184, 0.4);
  font-size: 16px;
}
#sidebar-resizer:hover::after,
#sidebar-resizer.active::after {
  color: rgba(59, 130, 246, 0.8);
}

/* ── Models filters ───────────────────────────── */
.models-filters { margin-bottom: 0.75rem; }
.filter-row {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
}
.filter-label {
  font-size: 0.72rem;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 600;
}
.date-input-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
}
.filter-date {
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid rgba(148, 163, 184, 0.2);
  color: #f8fafc;
  font-size: 0.78rem;
  padding: 0.25rem 2.15rem 0.25rem 0.45rem;
  border-radius: 0.4rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  width: 9.9em;
}
.filter-date::placeholder {
  color: #64748b;
}
.filter-date-native {
  position: absolute;
  right: 0.18rem;
  top: 50%;
  transform: translateY(-50%);
  width: 1.55rem;
  height: 1.55rem;
  opacity: 0.01;
  cursor: pointer;
  border: 0;
}
.cg-budget-input:focus { outline: none; border-color: var(--accent); }
.cg-select:focus { outline: none; border-color: var(--accent); }
.cg-select option { background: var(--panel); color: var(--text); }

/* Budget thresholds grid layout */
.cg-grid {
  max-height: 200px;
  overflow-y: auto;
}
.cg-row {
  display: grid;
  grid-template-columns: 1fr 70px 80px 75px 30px;
  gap: 4px;
  align-items: center;
  padding: 3px 4px;
  font-size: 11px;
}
.cg-row:nth-child(even) {
  background: rgba(255,255,255,0.02);
}
.cg-cell {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.cg-scope {
  color: var(--muted);
}
.cg-period,
.cg-action {
  text-align: left;
}
.cg-enabled {
  cursor: pointer;
  text-align: center;
}

/* Help icon */
.cg-help {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--border);
  color: var(--muted);
  font-size: 9px;
  font-weight: 700;
  cursor: help;
  vertical-align: middle;
  margin-left: 3px;
  line-height: 1;
  transition: background 0.15s, color 0.15s;
}
.cg-help:hover {
  background: var(--accent);
  color: #fff;
}
.cg-help::after {
  content: attr(data-tip);
  visibility: hidden;
  opacity: 0;
  position: fixed;
  bottom: auto;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: #0f172a;
  color: #e2e8f0;
  padding: 14px 18px;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 400;
  line-height: 1.5;
  white-space: normal;
  max-width: 380px;
  width: max-content;
  border: 1px solid #334155;
  box-shadow: 0 8px 32px rgba(0,0,0,0.5);
  pointer-events: none;
  z-index: 999999;
  text-align: left;
  transition: opacity 0.15s, visibility 0.15s;
}
.cg-help:hover::after {
  visibility: visible;
  opacity: 1;
}
.cg-budgets { font-family: var(--font-mono, monospace); }
.cg-period, .cg-action { font-size: 10px; }
.cg-limit span:hover { text-decoration: underline; }

.date-input-wrap::after {
  content: '📅';
  position: absolute;
  right: 0.42rem;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.9rem;
  pointer-events: none;
}
.filter-reset {
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(148, 163, 184, 0.2);
  color: #94a3b8;
  font-size: 1rem;
  padding: 0.15rem 0.5rem;
  border-radius: 0.4rem;
  cursor: pointer;
  line-height: 1;
}
.filter-reset:hover {
  color: #f8fafc;
  border-color: rgba(59, 130, 246, 0.4);
}
.sync-btn {
  margin-left: 8px;
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(148, 163, 184, 0.2);
  color: #94a3b8;
  font-size: 0.8rem;
  padding: 0.2rem 0.55rem;
  border-radius: 0.4rem;
  cursor: pointer;
  line-height: 1;
}
.sync-btn:hover {
  color: #f8fafc;
  border-color: rgba(59, 130, 246, 0.4);
  background: rgba(59, 130, 246, 0.15);
}
.sync-btn.syncing {
  opacity: 0.6;
  pointer-events: none;
}
.models-table-wrap {
  overflow-x: auto;
}
.model-row:hover {
  background: rgba(59, 130, 246, 0.08);
}
.model-row:active {
  background: rgba(59, 130, 246, 0.15);
}
.sortable {
  cursor: pointer;
  user-select: none;
}
.sortable:hover {
  color: #e2e8f0;
}
.node-time-label { font-size: 8px; fill: #64748b; }

/* ── Model Health Panel ─────────────────────────────────────────── */
.model-health-panel { padding: 8px 0; }
.health-summary {
  display: flex; align-items: center; gap: 16px;
  padding: 12px 16px; border-radius: 10px; margin-bottom: 12px;
}
.health-good { background: rgba(76,175,80,0.1); border: 1px solid rgba(76,175,80,0.3); }
.health-warning { background: rgba(255,193,7,0.1); border: 1px solid rgba(255,193,7,0.3); }
.health-critical { background: rgba(244,67,54,0.1); border: 1px solid rgba(244,67,54,0.3); }
.health-score { display: flex; flex-direction: column; align-items: center; }
.health-pct { font-size: 1.6rem; font-weight: 700; }
.health-label { font-size: 0.7rem; color: var(--muted); text-transform: uppercase; }
.health-counts { display: flex; gap: 12px; font-size: 0.85rem; }
.health-timestamp { font-size: 0.7rem; color: var(--muted); margin-left: auto; }
.health-toggle { font-size: 0.9rem; color: var(--muted); cursor: pointer; margin-left: auto; padding: 2px 6px; }
.health-body { transition: max-height 0.3s ease, opacity 0.2s ease; max-height: 2000px; opacity: 1; overflow: hidden; }
.health-body.collapsed { max-height: 0; opacity: 0; }
.health-models-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 8px; margin-bottom: 16px;
}
.health-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: 8px;
  padding: 10px 12px; transition: border-color 0.2s;
}
.health-card:hover { border-color: var(--accent); }
.health-card.status-ok { border-left: 3px solid var(--green); }
.health-card.status-rate_limited { border-left: 3px solid var(--yellow); }
.health-card.status-error, .health-card.status-down { border-left: 3px solid var(--red); }
.health-card.status-unknown { border-left: 3px solid var(--muted); }
.health-card.primary { background: rgba(124,156,245,0.05); }
.health-card-header { display: flex; align-items: center; gap: 6px; margin-bottom: 4px; cursor: pointer; }
.health-icon { font-size: 0.9rem; }
.health-name { font-weight: 600; font-size: 0.85rem; flex: 1; }
.health-tier { font-size: 0.75rem; }
.collapse-chevron { font-size: 0.7rem; color: var(--muted); margin-left: auto; }
.health-card-details { transition: max-height 0.2s ease, opacity 0.2s ease; max-height: 200px; opacity: 1; overflow: hidden; }
.health-card-details.collapsed { max-height: 0; opacity: 0; margin: 0; }
.health-model-id { font-size: 0.7rem; color: var(--muted); font-family: monospace; }
.health-role { font-size: 0.7rem; color: var(--accent); margin: 2px 0; }
.health-detail { font-size: 0.75rem; color: #aaa; margin-top: 4px; }
.health-note { font-size: 0.7rem; color: var(--yellow); margin-top: 4px; }
.health-chains { border-top: 1px solid var(--border); padding-top: 12px; }
.chains-title { font-size: 0.8rem; color: var(--muted); margin-bottom: 8px; text-transform: uppercase; letter-spacing: 0.5px; }
.chain-row {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 8px; border-radius: 6px; margin-bottom: 4px;
  background: rgba(255,255,255,0.02);
}
.chain-broken { background: rgba(244,67,54,0.05); }
.chain-label { font-size: 0.75rem; color: var(--muted); min-width: 120px; font-weight: 600; }
.chain-models { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.chain-model {
  font-size: 0.7rem; padding: 2px 6px; border-radius: 4px;
  background: rgba(255,255,255,0.05);
}
.chain-model.primary { font-weight: 600; }
.chain-model.status-ok { color: var(--green); }
.chain-model.status-rate_limited { color: var(--yellow); }
.chain-model.status-error, .chain-model.status-down { color: var(--red); text-decoration: line-through; }
.chain-model.status-unknown { color: var(--muted); }
.chain-arrow { color: var(--muted); font-size: 0.7rem; }

/* ── Chain drag-and-drop ─────────────────────────── */

/* Grip handle */
.chain-grip {
  cursor: grab;
  opacity: 0;
  margin-right: 2px;
  font-size: 0.6rem;
  transition: opacity 0.15s;
  user-select: none;
}
.chain-model:hover .chain-grip {
  opacity: 0.5;
}

/* Draggable cursor */
.chain-model[draggable="true"] {
  cursor: grab;
  user-select: none;
}

/* While dragging */
.chain-model.chain-dragging {
  cursor: grabbing;
  opacity: 0.5;
  transform: scale(1.05);
  z-index: 10;
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
  background: rgba(124, 156, 245, 0.2);
  border: 1px solid var(--accent);
  border-radius: 4px;
}

/* Drop target highlight */
.chain-model.chain-drop-target {
  background: rgba(124, 156, 245, 0.15);
  border: 1px solid rgba(124, 156, 245, 0.3);
}

/* Drop zone indicators */
.chain-model.chain-drop-before {
  box-shadow: -2px 0 0 0 var(--accent);
}
.chain-model.chain-drop-after {
  box-shadow: 2px 0 0 0 var(--accent);
}

/* Chain status indicator (saving/saved/error) */
.chain-status-indicator {
  font-size: 0.65rem;
  margin-left: 8px;
  padding: 1px 6px;
  border-radius: 3px;
  transition: opacity 0.3s;
}
.chain-status-ok {
  color: var(--green);
  background: rgba(76, 175, 80, 0.1);
}
.chain-status-error {
  color: var(--red);
  background: rgba(244, 67, 54, 0.1);
}

.health-check-btn {
  font-size: 0.7rem;
  padding: 2px 8px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  margin-left: 8px;
  transition: background 0.2s;
}
.health-check-btn:hover { background: var(--hover); }
.health-check-btn:disabled { opacity: 0.5; cursor: wait; }

/* ── Token Meters Panel ──────────────────────────── */
.tm-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 8px;
  min-height: 80px;
}

.tm-card {
  background: #111;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  transition: border-color 0.2s, opacity 0.2s;
  min-width: 0;
}
.tm-card:hover {
  border-color: rgba(124, 156, 245, 0.4);
}
.tm-card.tm-inactive {
  opacity: 0.45;
}

.tm-header {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}
.tm-provider-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.tm-model-name {
  font-size: 11px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}
.tm-badge {
  font-size: 9px;
  padding: 1px 5px;
  border-radius: 3px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  flex-shrink: 0;
  margin-left: auto;
}
.tm-badge-inactive {
  background: #222;
  color: var(--muted);
}

.tm-meters {
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.tm-meter-row {
  display: flex;
  align-items: center;
  gap: 6px;
}
.tm-meter-label {
  font-size: 9px;
  color: var(--muted);
  width: 24px;
  flex-shrink: 0;
  text-align: right;
  font-weight: 500;
}
.tm-bar-track {
  flex: 1;
  min-width: 40px;
  height: 6px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 3px;
  overflow: hidden;
}
.tm-bar-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.5s ease;
  min-width: 2px;
}
.tm-bar-in {
  background: #3b82f6;
}
.tm-bar-out {
  background: #10b981;
}
.tm-rate {
  font-size: 10px;
  color: var(--text);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  width: 85px;
  text-align: right;
  flex-shrink: 0;
  font-weight: 500;
}

.tm-footer {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 10px;
  color: var(--muted);
  flex-wrap: wrap;
  border-top: 1px solid var(--border);
  padding-top: 5px;
  margin-top: 2px;
}
.tm-stat {
  white-space: nowrap;
}
.tm-stat-sep {
  color: #333;
}
.tm-stat-time {
  margin-left: auto;
  font-size: 9px;
  color: #555;
}

/* ── Bottom panel split layout ────────────────────────────── */
.bottom-panel-hbox {
  display: flex;
  flex: 1;
  min-height: 0;
  height: 100%;
}

.bottom-panel-left,
.bottom-panel-right {
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow: hidden;
}

.bottom-panel-left {
  flex: 0.4;
  border-right: 1px solid #1e2235;
}

.bottom-panel-right {
  flex: 0.3;
}

#bp-usage-wrap {
  flex: 0.3 !important;
}

#panel-events.content,
#panel-token-meters.content,
#panel-app-usage.content {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 10px 16px 12px;
}

/* App Usage panel in bottom bar */
#panel-app-usage .au-apps { max-height: none; }
#panel-app-usage .au-hourly { display: none; } /* hide hourly chart in bottom bar to save space */
#panel-app-usage .au-models { display: none; } /* hide models chart */

/* App usage summary row — compact for bottom bar */
#panel-app-usage .au-summary { margin-bottom: 4px; }
#panel-app-usage .au-chip { font-size: 0.6rem; padding: 1px 6px; }

/* Column resizer between bottom-panel halves */
.bp-col-resizer {
  width: 4px;
  cursor: col-resize;
  background: transparent;
  flex-shrink: 0;
  transition: background 0.15s;
}
.bp-col-resizer:hover,
.bp-col-resizer.active {
  background: rgba(124, 156, 245, 0.3);
}

/* Maximized bottom-panel children fill the whole screen */
#bp-events-wrap.mw-maximized,
#bp-meters-wrap.mw-maximized,
#bp-usage-wrap.mw-maximized {
  position: fixed !important;
  inset: 0 !important;
  z-index: 9999 !important;
  width: 100% !important;
  height: 100% !important;
  background: var(--bg) !important;
  display: flex !important;
  flex-direction: column !important;
}

/* ── Panel Maximize (Eclipse-like double-click) ─────────────── */
/* Desktop only — hidden on touch/mobile by the JS check */
#mw-overlay { transition: opacity 0.2s ease; }

.mw-maximized {
  position: fixed !important;
  inset: 0 !important;
  z-index: 9999 !important;
  width: 100% !important;
  height: 100% !important;
  max-width: 100% !important;
  max-height: 100% !important;
  background: var(--bg) !important;
  overflow: auto !important;
  margin: 0 !important;
  border: none !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  transition: none !important;
}

/* Prevent other panels from showing through */
.mw-maximized ~ #sidebar-resizer,
.mw-maximized ~ #bottom-resizer,
.mw-maximized ~ #bottom-panel,
.mw-maximized ~ #drawer-overlay,
.mw-maximized ~ #agent-drawer {
  z-index: 0 !important;
  pointer-events: none !important;
}

/* Re-enable pointer events on the maximized panel's interactive children */
.mw-maximized button,
.mw-maximized a,
.mw-maximized select,
.mw-maximized input,
.mw-maximized .chain-model,
.mw-maximized .health-card,
.mw-maximized .model-row {
  pointer-events: auto !important;
}

/* Graph panel inside maximized layout */
#graph-wrap.mw-maximized #panel-graph {
  width: 100%;
  height: 100%;
}

/* Bottom panel maximized */
#bottom-panel.mw-maximized {
  resize: none;
}

/* Sidebar maximized — show full content width */
#models-sidebar.mw-maximized {
  padding: 16px;
}
#models-sidebar.mw-maximized .content {
  max-width: 800px;
  margin: 0 auto;
}
