* { box-sizing: border-box; }
:root {
  --bg: #070b17;
  --panel: rgba(17, 25, 45, 0.78);
  --panel-border: rgba(96, 135, 223, 0.28);
  --text: #eaf0ff;
  --muted: #9bb0df;
  --blue: #63b3ff;
  --cyan: #36e7ff;
  --orange: #ffb36a;
  --orange-strong: #ff8f3f;
}
body {
  margin: 0;
  font-family: Inter, system-ui, sans-serif;
  background: radial-gradient(1200px 500px at 10% -20%, #1d3260 0%, transparent 55%),
              radial-gradient(900px 500px at 90% -30%, #2a1b4f 0%, transparent 60%),
              var(--bg);
  color: var(--text);
  padding: 6px 12px;
  min-height: 100vh;
  overflow: hidden;
}
.bg-glow { position: fixed; width: 340px; height: 340px; border-radius: 999px; filter: blur(70px); opacity: 0.22; pointer-events: none; z-index: -1; }
.bg-glow-a { background: #47b6ff; right: -120px; top: 80px; }
.bg-glow-b { background: #ff8d4d; left: -130px; bottom: -70px; }

.topbar { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; margin-bottom: 8px; }
.compact-topbar { justify-content: flex-end; margin-bottom: 4px; }
.top-meta { display: flex; gap: 8px; flex-wrap: wrap; }
.chip { border: 1px solid #38508b; background: rgba(15, 23, 44, 0.9); color: #c9d7ff; padding: 6px 10px; border-radius: 999px; font-size: 0.82rem; }
.chip-warn { border-color: rgba(255, 152, 93, 0.65); color: #ffc49d; }
.hidden { display: none; }

.retro-clock-panel {
  margin-bottom: 8px;
  border: 1px solid rgba(255, 164, 102, 0.5);
  background: linear-gradient(180deg, rgba(24, 17, 18, 0.95), rgba(13, 10, 13, 0.95));
  box-shadow: inset 0 0 0 1px rgba(255, 162, 110, 0.18), 0 0 20px rgba(255, 133, 66, 0.10);
  border-radius: 12px;
  padding: 6px 10px;
  position: relative;
  overflow: hidden;
}
.top-row {
  display: flex;
  gap: 8px;
  align-items: stretch;
  margin-bottom: 6px;
}
.retro-clock-panel.mini {
  display: grid;
  grid-template-columns: auto auto;
  grid-template-areas: 'persona clock';
  align-items: center;
  gap: 10px 16px;
  flex-shrink: 0;
  margin-bottom: 0;
}
.plans-container {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
  min-width: 0;
}
.persona { grid-area: persona; display: grid; justify-items: center; gap: 2px; min-width: 68px; }
.persona-avatar {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 24px;
  border: 1px solid rgba(255, 172, 116, 0.6);
  background: radial-gradient(circle at 30% 30%, rgba(255,181,122,.28), rgba(40,25,28,.7));
  box-shadow: 0 0 10px rgba(255,149,79,.35);
  animation: breathe 2.6s ease-in-out infinite;
}
.persona-name { font-size: 0.68rem; color: #ffcfab; letter-spacing: .04em; }
.persona-avatar.jolt { animation: jolt .38s ease; }
@keyframes breathe {
  0%, 100% { transform: scale(1); box-shadow: 0 0 10px rgba(255,149,79,.35); }
  50% { transform: scale(1.06); box-shadow: 0 0 16px rgba(255,149,79,.55); }
}

.inline-plan-panel {
  border: 1px solid rgba(54, 231, 255, 0.35);
  background: linear-gradient(180deg, rgba(10, 22, 40, 0.88), rgba(7, 14, 28, 0.88));
  box-shadow: inset 0 0 0 1px rgba(54, 231, 255, 0.1), 0 0 14px rgba(54, 231, 255, 0.07);
  border-radius: 10px;
  padding: 6px 8px;
  display: flex;
  gap: 10px;
  align-items: stretch;
}
.inline-plan-panel.inline-codex {
  border-color: rgba(167, 139, 250, 0.38);
  background: linear-gradient(180deg, rgba(20, 14, 43, 0.88), rgba(12, 10, 28, 0.88));
  box-shadow: inset 0 0 0 1px rgba(167, 139, 250, 0.12), 0 0 14px rgba(167, 139, 250, 0.08);
}
.inline-plan-left {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 110px;
  padding-right: 8px;
  border-right: 1px solid rgba(54, 231, 255, 0.2);
}
.inline-codex .inline-plan-left {
  border-right-color: rgba(167, 139, 250, 0.25);
}
.inline-plan-right {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.inline-plan-badge {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  text-align: center;
}
.inline-plan-icon {
  font-size: 1.4rem;
  line-height: 1;
  filter: drop-shadow(0 0 6px rgba(54, 231, 255, 0.7));
}
.inline-codex .inline-plan-icon {
  filter: drop-shadow(0 0 6px rgba(167, 139, 250, 0.7));
}
.inline-plan-name {
  font-family: Orbitron, JetBrains Mono, monospace;
  font-size: 0.7rem;
  font-weight: 700;
  color: #36e7ff;
  letter-spacing: 0.06em;
  text-shadow: 0 0 6px rgba(54, 231, 255, 0.5);
  white-space: normal;
  text-align: center;
  line-height: 1.1;
}
.weekly-bar-row {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 6px;
}
.weekly-bar-label {
  font-size: 0.55rem;
  color: #9a8cc8;
  flex-shrink: 0;
}
.weekly-bar-track {
  width: 150px;
  height: 6px;
  border-radius: 999px;
  background: rgba(40, 30, 70, 0.9);
  border: 1px solid rgba(167, 139, 250, 0.25);
  overflow: hidden;
}
.weekly-bar-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #7c3aed 0%, #a78bfa 100%);
  opacity: 0.6;
  transition: width 0.5s ease, background 0.4s ease;
}
.weekly-bar-fill.warn {
  background: linear-gradient(90deg, #f59e0b 0%, #fcd34d 100%);
}
.weekly-bar-fill.danger {
  background: linear-gradient(90deg, #ef4444 0%, #f87171 100%);
}
.weekly-bar-pct {
  font-size: 0.55rem;
  color: #a78bfa;
  font-family: JetBrains Mono, monospace;
  min-width: 30px;
  text-align: right;
}
.weekly-bar-reset {
  font-size: 0.5rem;
  color: #7a6aaa;
  margin-left: 4px;
}
.inline-plan-progress-bottom.claude-weekly-bars {
  display: flex !important;
  flex-direction: row !important;
  gap: 20px;
  flex-wrap: nowrap;
}
.claude-bar {
  flex-shrink: 0;
}
.claude-bar .weekly-bar-label {
  color: #7ab8d4;
}
.claude-bar .weekly-bar-track {
  width: 150px;
  background: rgba(30, 50, 70, 0.9);
  border-color: rgba(54, 231, 255, 0.2);
}
.claude-bar .weekly-bar-fill {
  background: linear-gradient(90deg, #1e90ff 0%, #36e7ff 100%);
  opacity: 0.6;
}
.claude-bar .weekly-bar-pct {
  color: #36e7ff;
}
.claude-bar .weekly-bar-reset {
  color: #5a9ab8;
}
.inline-codex .inline-plan-name {
  color: #b8a5ff;
  text-shadow: 0 0 6px rgba(167, 139, 250, 0.5);
}
.inline-plan-header {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: nowrap;
}
.inline-plan-source {
  font-size: 0.52rem;
  color: rgba(100, 170, 220, 0.75);
  font-family: JetBrains Mono, monospace;
  letter-spacing: 0.04em;
  flex-shrink: 0;
}
.inline-plan-reset {
  font-size: 0.55rem;
  color: #7ab8d4;
  font-family: JetBrains Mono, monospace;
  white-space: nowrap;
  margin-left: auto;
}
.inline-plan-progress-wrap {
  display: grid;
  gap: 3px;
}
.inline-plan-progress-labels {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.6rem;
  color: #9ecfea;
}
.inline-codex .inline-plan-progress-labels { color: #c4b5fd; }
.inline-plan-progress-labels span:last-child {
  font-family: JetBrains Mono, monospace;
  font-weight: 700;
  color: #36e7ff;
  font-size: 0.68rem;
}
.inline-codex .inline-plan-progress-labels span:last-child { color: #a78bfa; }
.inline-plan-progress-track {
  height: 8px;
  border-radius: 999px;
  background: rgba(20, 40, 65, 0.9);
  border: 1px solid rgba(54, 231, 255, 0.2);
  overflow: hidden;
  position: relative;
}
.inline-codex .inline-plan-progress-track {
  border-color: rgba(167, 139, 250, 0.25);
}
.inline-plan-progress-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #1e90ff 0%, #36e7ff 60%, #63f0ff 100%);
  box-shadow: 0 0 8px rgba(54, 231, 255, 0.35);
  transition: width 0.5s ease, background 0.4s ease;
}
.inline-codex .inline-plan-progress-fill {
  background: linear-gradient(90deg, #7c3aed 0%, #a78bfa 60%, #c4b5fd 100%);
  box-shadow: 0 0 8px rgba(167, 139, 250, 0.4);
}
.inline-plan-progress-bottom {
  display: block;
  font-size: 0.55rem;
  color: #7aa8c8;
  font-family: JetBrains Mono, monospace;
}
.inline-codex .inline-plan-progress-bottom { color: #a78bfa; }
@keyframes jolt {
  0% { transform: translateX(0) scale(1.06); }
  20% { transform: translateX(-2px) rotate(-5deg) scale(1.12); }
  45% { transform: translateX(2px) rotate(5deg) scale(1.1); }
  65% { transform: translateX(-1px) rotate(-2deg) scale(1.08); }
  100% { transform: translateX(0) scale(1.06); }
}
.retro-clock-panel::after {
  content: '';
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(180deg, rgba(255, 255, 255, 0.02) 0 2px, transparent 2px 4px);
  pointer-events: none;
}
.retro-clock {
  font-family: Orbitron, JetBrains Mono, monospace;
  font-size: clamp(1.45rem, 3.4vw, 2rem);
  color: var(--orange);
  letter-spacing: 0.06em;
  text-shadow: 0 0 10px rgba(255, 152, 79, 0.55);
  letter-spacing: 0;
}
.clock-digit {
  display: inline-block;
  width: 0.9em;
  text-align: center;
}
.clock-sep {
  display: inline-block;
  width: 0.55em;
  text-align: center;
}
.clock-stack {
  grid-area: clock;
  display: grid;
  line-height: 1.05;
  width: max-content;
}
/* merged into .clock-stack above */
.retro-sub { font-family: JetBrains Mono, monospace; color: #ffbb8a; font-size: 0.62rem; letter-spacing: 0.03em; white-space: nowrap; margin-top: 2px; }
.ops-summary {
  grid-area: ops;
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  flex-wrap: nowrap;
  align-items: center;
  overflow-x: auto;
  padding-bottom: 2px;
  justify-self: end;
}
.ops-chip {
  border: 1px solid rgba(255,165,110,0.35);
  background: rgba(26,20,24,0.75);
  color: #ffd4b2;
  border-radius: 10px;
  padding: 6px 10px;
  min-height: 28px;
  display: inline-flex;
  align-items: center;
  font-size: 0.68rem;
  line-height: 1.25;
  max-width: 380px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ops-chip strong { color: #ffe5cf; font-weight: 700; margin-right: 4px; }

.grid { display: grid; gap: 6px; }
.cards { grid-template-columns: repeat(6, minmax(120px, 1fr)); margin-bottom: 6px; }
.card {
  background: linear-gradient(180deg, rgba(18, 28, 50, 0.86), rgba(14, 20, 37, 0.86));
  border: 1px solid var(--panel-border);
  border-radius: 10px;
  padding: 6px 8px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.28), inset 0 0 0 1px rgba(117, 175, 255, 0.12);
}
.card h3 { margin: 0 0 3px; font-size: 0.65rem; color: #9eb1e2; text-transform: uppercase; letter-spacing: 0.06em; }
.card .v { font-size: 0.9rem; font-weight: 700; }
.card .hint { margin-top: 2px; font-size: 0.55rem; color: #8ea5d8; line-height: 1.2; }

.panel {
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: 12px;
  padding: 6px 8px;
  margin-bottom: 6px;
  overflow-x: auto;
  backdrop-filter: blur(6px);
}
.live-panel {
  position: relative;
  overflow: hidden;
}
.panel-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 6px; }
.panel h2 { margin: 2px 0 4px; font-size: 0.9rem; display: flex; align-items: center; gap: 8px; }
.live-badge { color: #67f7c8; font-size: 0.62rem; letter-spacing: .08em; animation: livePulse 1.2s ease-in-out infinite; }
@keyframes livePulse { 0%,100%{ opacity:.45; } 50%{ opacity:1; text-shadow:0 0 8px #67f7c8aa; } }
.history-controls { color: var(--muted); font-size: 0.9rem; }
.history-controls select {
  background: #0f1730;
  color: var(--text);
  border: 1px solid #30406d;
  border-radius: 8px;
  padding: 4px 8px;
}
canvas { width: 100% !important; }
.chart-grid { display: grid; grid-template-columns: 1.5fr 0.8fr 1fr; gap: 10px; align-items: stretch; min-height: 210px; }
.chart-main { height: 100%; min-height: 210px; }
#tokensChart { height: 100% !important; max-width: 100%; }
#shareChart { height: 210px !important; max-height: 210px; margin-top: 0; }
.donut-wrap { display: flex; flex-direction: column; gap: 4px; align-items: center; height: 100%; }
.tasks-wrap {
  border: 1px solid rgba(99,179,255,0.25);
  border-radius: 10px;
  background: rgba(10,18,34,0.55);
  padding: 6px;
  overflow: auto;
}
.tasks-title { font-size: 0.7rem; color: #9db5ea; text-transform: uppercase; letter-spacing: .07em; margin-bottom: 6px; }
.tasks-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; font-size: 0.72rem; }
.tasks-list li { display: grid; grid-template-columns: auto 1fr auto; gap: 6px; align-items: center; padding: 3px 4px; border-bottom: 1px dashed rgba(120,150,220,0.18); }
.tasks-list li:last-child { border-bottom: none; }
.task-dot { width: 7px; height: 7px; border-radius: 999px; display: inline-block; }
.task-dot.active { background: #34d399; box-shadow: 0 0 8px #34d39999; }
.task-dot.warm { background: #fbbf24; box-shadow: 0 0 8px #fbbf2499; }
.task-dot.idle { background: #7c8db8; }
.task-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: #d7e6ff; }
.task-age { color: #93a8da; font-family: JetBrains Mono, monospace; }
.total-box {
  width: 100%;
  border: 1px solid rgba(99,179,255,0.25);
  border-radius: 10px;
  padding: 4px 8px;
  background: rgba(10,18,34,0.72);
  text-align: center;
  align-self: start;
  margin-top: 0;
  margin-bottom: 0;
}
#shareChart {
  margin-top: 2px !important;
}
.total-label { font-size: 0.58rem; letter-spacing: .08em; color: #92a8dc; }
.total-value { font-family: JetBrains Mono, monospace; font-size: 1rem; color: #dff3ff; font-weight: 700; }
.total-sub { font-size: 0.62rem; color: #9fc3ff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

table { width: 100%; border-collapse: collapse; font-size: 0.74rem; }
th, td { padding: 5px 6px; border-bottom: 1px solid #243252; text-align: left; }
th { color: #9eb1e2; text-transform: uppercase; letter-spacing: 0.05em; font-size: 0.62rem; }
tr:hover td { background: rgba(99, 179, 255, 0.04); }

.models-panel { max-height: none; overflow: hidden; }
.models-heat { display: grid; gap: 8px; }
.heat-row {
  border: 1px solid rgba(99,179,255,0.2);
  border-radius: 10px;
  padding: 6px 8px;
  background: rgba(8,16,32,0.45);
}
.heat-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 5px; }
.heat-model { color: #dce9ff; font-size: 0.74rem; }
.heat-total { color: #9ed4ff; font-size: 0.7rem; }
.heat-track {
  position: relative;
  height: 20px;
  border-radius: 999px;
  background: rgba(29,45,79,0.75);
  overflow: hidden;
  border: 1px solid rgba(120,160,235,0.2);
}
.heat-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #3f90ff 0%, #36e7ff 55%, #ffb36a 100%);
  box-shadow: 0 0 14px rgba(54, 231, 255, 0.28);
}
.heat-meta-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 10px;
  font-size: 0.6rem;
  color: #d8e8ff;
  text-shadow: 0 1px 2px rgba(0,0,0,0.7);
  white-space: nowrap;
}
.heat-meta-overlay strong { color: #ffffff; font-weight: 700; }
.heat-empty { color: #9bb2df; font-size: 0.78rem; padding: 8px; }

.error { color: #ff9696; min-height: 1.2em; }
.ok { color: #9df4b5; }
.warn { color: #ffd67f; }
.bad { color: #ff9696; }
.mono { font-family: JetBrains Mono, ui-monospace, monospace; }
.bottom-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; align-items: stretch; }
.compact-panel { max-height: 200px; overflow: auto; }
.compact-panel.models-panel {
  max-height: none;
  overflow: hidden;
  height: 300px;
  display: flex;
  flex-direction: column;
}
.compact-panel.memory-panel {
  max-height: none;
  overflow: hidden;
  height: 300px;
  display: flex;
  flex-direction: column;
}
.models-heat { flex: 1; overflow-y: auto; }
.memory-layout { display: grid; grid-template-columns: 1.5fr .9fr; gap: 8px; align-items: stretch; flex: 1; min-height: 0; }
.memory-embed-wrap {
  width: 100%;
  height: 100%;
  border: 1px solid rgba(99,179,255,0.22);
  border-radius: 10px;
  overflow: hidden;
  background: rgba(7, 13, 28, 0.75);
}
.memory-embed {
  width: 100%;
  height: 100%;
  border: 0;
  background: #071021;
}
.net-panel {
  border: 1px solid rgba(99,179,255,0.22);
  border-radius: 10px;
  background: rgba(7,13,28,0.6);
  padding: 6px;
  display: grid;
  gap: 5px;
  align-content: start;
}
.net-row { display:flex; justify-content:space-between; gap:8px; font-size:0.62rem; color:#9db5ea; }
.net-row strong { color:#e5f1ff; font-weight:700; text-align:right; max-width: 62%; word-break: break-word; }
.net-link { font-size:0.62rem; }

/* ─── Plan & Limits Panel ─────────────────────────────────────────── */
.plan-panel {
  display: none; /* Hidden - moved to clock panel */
}
.plan-panel.visible {
  display: grid;
}
.plan-panel {
  margin-bottom: 8px;
  border: 1px solid rgba(54, 231, 255, 0.35);
  background: linear-gradient(180deg, rgba(10, 22, 40, 0.92), rgba(7, 14, 28, 0.92));
  box-shadow: inset 0 0 0 1px rgba(54, 231, 255, 0.1), 0 0 18px rgba(54, 231, 255, 0.07);
  border-radius: 12px;
  padding: 8px 12px;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 6px 16px;
  align-items: center;
}
.plan-header {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 3px;
  min-width: 120px;
}
.plan-badge {
  display: flex;
  align-items: center;
  gap: 5px;
}
.plan-icon {
  font-size: 1rem;
  line-height: 1;
  filter: drop-shadow(0 0 6px rgba(54, 231, 255, 0.7));
}
.plan-name {
  font-family: Orbitron, JetBrains Mono, monospace;
  font-size: 0.78rem;
  font-weight: 700;
  color: #36e7ff;
  letter-spacing: 0.08em;
  text-shadow: 0 0 8px rgba(54, 231, 255, 0.5);
}
.plan-source-badge {
  font-size: 0.55rem;
  color: rgba(100, 170, 220, 0.75);
  letter-spacing: 0.04em;
  font-family: JetBrains Mono, monospace;
}
.plan-reset {
  font-size: 0.62rem;
  color: #7ab8d4;
  font-family: JetBrains Mono, monospace;
  white-space: nowrap;
}
.plan-progress-wrap {
  display: grid;
  gap: 4px;
}
.plan-progress-labels {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.68rem;
  color: #9ecfea;
}
.plan-progress-labels span:last-child {
  font-family: JetBrains Mono, monospace;
  font-weight: 700;
  color: #36e7ff;
  font-size: 0.75rem;
}
.plan-progress-track {
  height: 10px;
  border-radius: 999px;
  background: rgba(20, 40, 65, 0.9);
  border: 1px solid rgba(54, 231, 255, 0.2);
  overflow: hidden;
  position: relative;
}
.plan-progress-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #1e90ff 0%, #36e7ff 60%, #63f0ff 100%);
  box-shadow: 0 0 10px rgba(54, 231, 255, 0.4);
  transition: width 0.5s ease, background 0.4s ease;
}
.plan-progress-fill.warn {
  background: linear-gradient(90deg, #f59e0b 0%, #fcd34d 100%);
  box-shadow: 0 0 10px rgba(252, 211, 77, 0.4);
}
.plan-progress-fill.danger {
  background: linear-gradient(90deg, #ef4444 0%, #ff6b6b 100%);
  box-shadow: 0 0 10px rgba(239, 68, 68, 0.5);
}
.plan-progress-bottom {
  display: flex;
  justify-content: space-between;
  font-size: 0.62rem;
  color: #7aa8c8;
  font-family: JetBrains Mono, monospace;
}

.codex-panel {
  display: none; /* Hidden - moved to clock panel */
}
.codex-panel.visible {
  display: grid;
}
.codex-panel {
  border-color: rgba(167, 139, 250, 0.38);
  background: linear-gradient(180deg, rgba(20, 14, 43, 0.92), rgba(12, 10, 28, 0.92));
  box-shadow: inset 0 0 0 1px rgba(167, 139, 250, 0.12), 0 0 18px rgba(167, 139, 250, 0.08);
}
.codex-panel .plan-name {
  color: #b8a5ff;
  text-shadow: 0 0 8px rgba(167, 139, 250, 0.55);
}
.codex-panel .plan-progress-fill {
  background: linear-gradient(90deg, #7c3aed 0%, #a78bfa 60%, #c4b5fd 100%);
  box-shadow: 0 0 10px rgba(167, 139, 250, 0.45);
}

@media (max-width: 700px) {
  .plan-panel { grid-template-columns: 1fr; }
  .plan-header { flex-direction: row; align-items: center; gap: 10px; }
}

/* ─── Суб-агенты ──────────────────────────────────────────────────── */
.subagents-panel {
  max-height: none;
  overflow: visible;
}
.subagents-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding-top: 4px;
}
.subagents-empty {
  color: var(--muted);
  font-size: 0.78rem;
  padding: 4px 0;
}
.subagent-card {
  flex: 1 1 200px;
  min-width: 180px;
  max-width: 280px;
  border: 1px solid rgba(99,179,255,0.22);
  border-radius: 10px;
  padding: 5px 8px;
  background: rgba(8,16,32,0.55);
  display: grid;
  gap: 3px;
  transition: border-color 0.3s, box-shadow 0.3s;
}
.subagent-card.active {
  border-color: rgba(52,211,153,0.5);
  box-shadow: 0 0 12px rgba(52,211,153,0.12);
}
.subagent-card.warm {
  border-color: rgba(251,191,36,0.4);
  box-shadow: 0 0 8px rgba(251,191,36,0.08);
}
.subagent-card.idle {
  border-color: rgba(99,130,200,0.2);
}
.subagent-header {
  display: flex;
  align-items: center;
  gap: 6px;
}
.subagent-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  flex-shrink: 0;
}
.subagent-dot.active {
  background: #34d399;
  box-shadow: 0 0 8px #34d39999;
}
.subagent-dot.active.pulse {
  animation: subagentPulse 1.4s ease-in-out infinite;
}
.subagent-dot.warm {
  background: #fbbf24;
  box-shadow: 0 0 6px #fbbf2499;
}
.subagent-dot.idle {
  background: #7c8db8;
}
@keyframes subagentPulse {
  0%, 100% { transform: scale(1); opacity: 1; box-shadow: 0 0 8px #34d39999; }
  50% { transform: scale(1.45); opacity: 0.7; box-shadow: 0 0 14px #34d399cc; }
}
.subagent-name {
  flex: 1;
  font-size: 0.72rem;
  color: #d7e6ff;
  font-family: JetBrains Mono, monospace;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.subagent-age {
  font-size: 0.65rem;
  color: #7a98cc;
  font-family: JetBrains Mono, monospace;
  flex-shrink: 0;
}
.subagent-model {
  font-size: 0.65rem;
  color: #9eb8e8;
}
.subagent-tokens {
  display: flex;
  gap: 8px;
  font-size: 0.65rem;
  color: #9db5e8;
  flex-wrap: wrap;
}
.subagent-tokens strong {
  color: #dff3ff;
  font-weight: 700;
}

@media (max-width: 1100px) {
  .cards { grid-template-columns: repeat(3, minmax(120px, 1fr)); }
}

@media (max-width: 900px) {
  body { overflow: auto; }
  .chart-grid { grid-template-columns: 1fr; }
  .bottom-grid { grid-template-columns: 1fr; }
  .compact-panel { max-height: none; }
  .tasks-wrap { max-height: 180px; }
  .memory-layout { grid-template-columns: 1fr; }
}

@media (max-width: 700px) {
  .topbar { flex-direction: column; }
  .panel-head { flex-direction: column; align-items: flex-start; }
  .cards { grid-template-columns: repeat(2, minmax(120px, 1fr)); }
  .retro-clock-panel.mini {
    grid-template-columns: 1fr;
    grid-template-areas:
      'persona'
      'clock'
      'ops';
    align-items: flex-start;
  }
  .ops-summary { justify-content: flex-start; flex-wrap: wrap; overflow: visible; }
}
