/* ────────── LLM Allocator Dashboard · pixel-game aesthetic ────────── */
:root {
  --bg: #0f0a1a;
  --bg-card: #1a1432;
  --bg-card-hi: #251c44;
  --border: #4a3f7a;
  --border-hi: #6d5ab0;
  --text: #e8e3ff;
  --text-dim: #998fcc;
  --green: #4ade80;
  --yellow: #facc15;
  --red: #f87171;
  --gray: #6b7280;
  --accent: #a78bfa;
  --shadow: 0 4px 0 #000, 0 0 0 2px var(--border);
  --shadow-hi: 0 6px 0 #000, 0 0 0 2px var(--border-hi);
}

* { box-sizing: border-box; image-rendering: pixelated; }

@font-face {
  font-family: "Pixel";
  /* Use system mono — looks crisp on retina; real pixel font is a follow-up */
  src: local("Courier New"), local("monospace");
}

body {
  margin: 0;
  font-family: "VT323", "Press Start 2P", "Courier New", monospace;
  font-size: 16px;
  background:
    /* faint grid like a game tilemap */
    linear-gradient(rgba(108, 95, 184, 0.04) 1px, transparent 1px) 0 0 / 32px 32px,
    linear-gradient(90deg, rgba(108, 95, 184, 0.04) 1px, transparent 1px) 0 0 / 32px 32px,
    radial-gradient(ellipse at top, #1a1432 0%, var(--bg) 70%);
  color: var(--text);
  min-height: 100vh;
}

/* ────────── header ────────── */
header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 24px;
  border-bottom: 2px solid var(--border);
  background: var(--bg-card);
  position: sticky;
  top: 0;
  z-index: 10;
  flex-wrap: wrap;
  gap: 12px;
}
.brand { display: flex; align-items: center; gap: 14px; }
.brand-emoji { font-size: 36px; line-height: 1; }
h1 { margin: 0; font-size: 22px; letter-spacing: 1px; color: var(--accent); }
.subtitle { font-size: 12px; color: var(--text-dim); }
.meta { display: flex; align-items: center; gap: 24px; font-size: 13px; flex-wrap: wrap; }
.legend { display: flex; gap: 14px; align-items: center; font-size: 12px; color: var(--text-dim); }
.muted { color: var(--text-dim); }

.badge { display: inline-block; width: 12px; }
.badge.green   { color: var(--green); }
.badge.yellow  { color: var(--yellow); }
.badge.red     { color: var(--red); }
.badge.gray, .badge.quiet { color: var(--gray); }

/* ────────── building ────────── */
main#building {
  padding: 24px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 18px;
  max-width: 1600px;
  margin: 0 auto;
}
.loading { grid-column: 1 / -1; text-align: center; padding: 80px 0; color: var(--text-dim); font-size: 20px; }

/* a room "tile" — like a building cross-section cell */
.room {
  position: relative;
  background: var(--bg-card);
  border: 2px solid var(--border);
  border-radius: 6px;
  padding: 18px 16px 14px;
  cursor: pointer;
  transition: transform 0.08s ease, border-color 0.15s ease, box-shadow 0.15s ease;
  box-shadow: var(--shadow);
  overflow: hidden;
}
.room:hover {
  transform: translateY(-2px);
  border-color: var(--border-hi);
  box-shadow: var(--shadow-hi);
  background: var(--bg-card-hi);
}
.room:active { transform: translateY(0); box-shadow: 0 2px 0 #000, 0 0 0 2px var(--border-hi); }

.room-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 8px;
}
.room-title { font-size: 16px; margin: 0; line-height: 1.2; }
.room-subtitle { font-size: 11px; color: var(--text-dim); margin-top: 4px; line-height: 1.3; }

.status-light {
  width: 14px; height: 14px;
  border-radius: 50%;
  flex-shrink: 0;
  border: 2px solid #000;
  box-shadow: 0 0 8px currentColor;
}
.status-light.green   { background: var(--green); color: var(--green); }
.status-light.yellow  { background: var(--yellow); color: var(--yellow); animation: pulse 0.9s ease-in-out infinite; }
.status-light.red     { background: var(--red); color: var(--red); animation: pulse 0.6s ease-in-out infinite; }
.status-light.gray, .status-light.quiet { background: var(--gray); color: var(--gray); border-color: #2a2a2a; }

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.45; transform: scale(1.15); }
}

.room-body { font-size: 12px; }
.room-agents {
  display: flex; flex-wrap: wrap; gap: 4px; margin-top: 10px;
}
.agent-chip {
  font-size: 11px;
  padding: 3px 8px;
  background: rgba(167, 139, 250, 0.15);
  border: 1px solid rgba(167, 139, 250, 0.35);
  border-radius: 3px;
  color: var(--text);
}
.room-stats { font-size: 11px; color: var(--text-dim); margin-top: 10px; line-height: 1.6; }
.room-stats .ok { color: var(--green); }
.room-stats .err { color: var(--red); }
.room-stats .stale { color: var(--yellow); }

/* room "color stripe" — left edge tinted by department family */
.room::before {
  content: "";
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 4px;
  background: var(--room-color, var(--accent));
}

/* ────────── Office hero (AI-generated pixel art building) ────────── */
#office-hero {
  padding: 20px 16px 12px;
  max-width: 1600px;
  margin: 0 auto;
  text-align: center;
}
.hero-frame {
  position: relative;
  display: inline-block;
  max-width: 100%;
  border: 3px solid var(--border-hi);
  border-radius: 4px;
  box-shadow: 0 6px 0 #000, 0 0 32px rgba(167, 139, 250, 0.15);
  overflow: hidden;
  background: #1a1432;
}
#office-img {
  display: block;
  max-width: 100%;
  height: auto;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}
#hotspots, #hero-labels {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.hotspot {
  position: absolute;
  cursor: pointer;
  pointer-events: auto;
  border: 2px solid transparent;
  border-radius: 4px;
  transition: all 0.12s ease;
  background: rgba(255, 255, 255, 0.0);
}
.hotspot:hover {
  border-color: rgba(250, 204, 21, 0.9);
  background: rgba(250, 204, 21, 0.15);
  box-shadow: 0 0 16px rgba(250, 204, 21, 0.5);
}
.hotspot.working {
  border-color: rgba(250, 204, 21, 0.95);
  background: rgba(250, 204, 21, 0.18);
  animation: hotspot-pulse 0.9s ease-in-out infinite;
}
@keyframes hotspot-pulse {
  0%, 100% { box-shadow: 0 0 8px rgba(250, 204, 21, 0.4); }
  50%      { box-shadow: 0 0 24px rgba(250, 204, 21, 0.9); }
}
.hotspot.status-red    { box-shadow: 0 0 12px rgba(248, 113, 113, 0.55); }
.hotspot.status-green  { box-shadow: 0 0 8px  rgba(74, 222, 128, 0.4); }
.hotspot.status-yellow { box-shadow: 0 0 10px rgba(250, 204, 21, 0.5); }

/* Live widget panels — overlay tiny screens on each monitor location in the image */
.live-widget {
  position: absolute;
  transform: translate(-50%, -50%);
  background: rgba(10, 14, 30, 0.88);
  border: 1px solid rgba(74, 222, 128, 0.6);
  border-radius: 3px;
  padding: 4px 8px;
  font-size: 10px;
  color: #e8e3ff;
  font-family: "VT323", monospace;
  min-width: 80px;
  text-align: center;
  box-shadow: 0 0 8px rgba(74, 222, 128, 0.3);
  pointer-events: none;
  z-index: 5;
  animation: widget-scan 4s linear infinite;
}
@keyframes widget-scan {
  0%, 100% { box-shadow: 0 0 8px rgba(74, 222, 128, 0.3); }
  50%      { box-shadow: 0 0 14px rgba(74, 222, 128, 0.6); }
}
.live-widget .widget-title {
  font-size: 9px;
  color: rgba(167, 139, 250, 0.9);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 2px;
}
.live-widget .widget-body { line-height: 1.2; }
.live-widget .big { font-size: 14px; font-weight: bold; color: #4ade80; }
.live-widget .red { color: #f87171; }
.live-widget .dim { font-size: 9px; color: rgba(232, 227, 255, 0.6); }
.live-widget .ticker {
  font-size: 9px;
  max-width: 140px;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.hero-label {
  position: absolute;
  font-size: 10px;
  font-weight: bold;
  color: #fff;
  background: rgba(0, 0, 0, 0.7);
  padding: 2px 6px;
  border-radius: 2px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  pointer-events: none;
  white-space: nowrap;
  transform: translate(-50%, 0);
}
.hero-caption {
  font-size: 12px;
  color: var(--text-dim);
  margin: 12px auto 0;
  max-width: 600px;
}
#building {
  border-top: 1px dashed var(--border);
  padding-top: 18px;
  margin-top: 12px;
}
#building::before {
  content: "↓ Status cards (data-driven) ↓";
  display: block;
  text-align: center;
  font-size: 11px;
  color: var(--text-dim);
  margin: 0 auto 16px;
  max-width: 280px;
  letter-spacing: 1px;
  text-transform: uppercase;
  grid-column: 1 / -1;
}

/* ────────── Kenney 1-Bit pixel-art tiles ──────────
   Sprite sheet: 49 cols × 22 rows of 16×16 tiles (784×352 px).
   Tile #N → col=(N%49), row=(N//49). Background-position uses NEGATIVE
   pixel offsets, scaled by --tile-scale for retina-crisp upscaling.
   CC0 by Kenney.nl — /static/sprites/kenney_1bit_packed.png */
:root {
  --tile-scale: 3;                          /* render 16px tile at 48px */
  --tile-px: calc(16px * var(--tile-scale));
  --sheet-w: calc(784px * var(--tile-scale));
  --sheet-h: calc(352px * var(--tile-scale));
}
.tile {
  display: inline-block;
  width: var(--tile-px);
  height: var(--tile-px);
  background-image: url(/static/sprites/kenney_1bit_packed.png);
  background-size: var(--sheet-w) var(--sheet-h);
  background-repeat: no-repeat;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  /* Default color filter: cream-on-dark — overridden per room via --room-tint */
  filter: var(--room-tint, none);
}

/* Tile index → position helpers (49 cols).  Sprite indices are picked
   from the Kenney 1-Bit Pack interior sample inventory. */
.t-floor       { background-position: 0 0; }
.t-table-end-L { background-position: calc(-1 * var(--tile-px) * 16) calc(-1 * var(--tile-px) * 5); } /* idx 261 - mid */
.t-table-mid   { background-position: calc(-1 * var(--tile-px) * 15) calc(-1 * var(--tile-px) * 5); } /* idx 260 */
.t-table-end-R { background-position: calc(-1 * var(--tile-px) * 17) calc(-1 * var(--tile-px) * 5); } /* idx 262 */
.t-bench       { background-position: calc(-1 * var(--tile-px) * 13) calc(-1 * var(--tile-px) * 5); } /* idx 258 */
.t-tv          { background-position: calc(-1 * var(--tile-px) * 13) calc(-1 * var(--tile-px) * 9); } /* idx 456 */
.t-plant       { background-position: calc(-1 * var(--tile-px) * 20) calc(-1 * var(--tile-px) * 5); } /* idx 265 */
.t-chest       { background-position: calc(-1 * var(--tile-px) * 11) calc(-1 * var(--tile-px) * 6); } /* idx 305 */
.t-flame       { background-position: calc(-1 * var(--tile-px) * 17) calc(-1 * var(--tile-px) * 6); } /* idx 337 */
.t-shield      { background-position: calc(-1 * var(--tile-px) * 40) calc(-1 * var(--tile-px) * 4); } /* idx 236 */
.t-rocket      { background-position: calc(-1 * var(--tile-px) * 26) calc(-1 * var(--tile-px) * 6); } /* idx 320 */
.t-book        { background-position: calc(-1 * var(--tile-px) * 42) calc(-1 * var(--tile-px) * 8); } /* idx 434 ish */
.t-coin        { background-position: calc(-1 * var(--tile-px) * 22) calc(-1 * var(--tile-px) * 4); } /* idx 218 */
.t-key         { background-position: calc(-1 * var(--tile-px) * 30) calc(-1 * var(--tile-px) * 4); } /* idx 226 */
.t-sword       { background-position: calc(-1 * var(--tile-px) * 32) calc(-1 * var(--tile-px) * 4); } /* idx 228 */
.t-stairs      { background-position: calc(-1 * var(--tile-px) * 20) calc(-1 * var(--tile-px) * 7); } /* idx 363 */
/* Character sprites (humanoid figures from the RPG character row) */
.t-person-1    { background-position: calc(-1 * var(--tile-px) * 22) calc(-1 * var(--tile-px) * 8); } /* idx 414 */
.t-person-2    { background-position: calc(-1 * var(--tile-px) * 23) calc(-1 * var(--tile-px) * 8); } /* idx 415 */
.t-person-3    { background-position: calc(-1 * var(--tile-px) * 24) calc(-1 * var(--tile-px) * 8); } /* idx 416 */
.t-person-4    { background-position: calc(-1 * var(--tile-px) * 25) calc(-1 * var(--tile-px) * 8); } /* idx 417 */
.t-person-5    { background-position: calc(-1 * var(--tile-px) * 27) calc(-1 * var(--tile-px) * 8); } /* idx 419 - smiling */
.t-monster     { background-position: calc(-1 * var(--tile-px) * 16) calc(-1 * var(--tile-px) * 6); } /* idx 310 */

/* Per-room tinting (using CSS filter on the cream sprite to colorize) */
.room.dept-board  { --room-tint: hue-rotate(280deg) saturate(1.4) brightness(1.05); }
.room.dept-csuite { --room-tint: hue-rotate(180deg) saturate(1.2); }
.room.dept-vote   { --room-tint: hue-rotate(80deg) saturate(1.3) brightness(1.05); }
.room.dept-adv    { --room-tint: hue-rotate(40deg) saturate(1.4); }
.room.dept-red    { --room-tint: hue-rotate(0deg) saturate(2) brightness(1.1); }
.room.dept-analyst { --room-tint: hue-rotate(180deg) saturate(1.2); }
.room.dept-knowledge { --room-tint: hue-rotate(280deg) saturate(1.5); }
.room.dept-intake { --room-tint: hue-rotate(40deg) saturate(1.4); }
.room.dept-delivery { --room-tint: hue-rotate(80deg) saturate(1.3); }
.room.dept-infra  { --room-tint: hue-rotate(20deg) saturate(1.6); }
.room.dept-meeting { --room-tint: saturate(1.8) brightness(1.1); }

/* ────────── 2D pixel-art room scene ──────────
   Each room has a small side-view "stage" — sky/window strip on top,
   floor below, desk + characters layered. Characters animate via CSS
   keyframes. */

.scene {
  position: relative;
  margin: 10px -16px 8px;
  height: 96px;       /* fits one row of 48px Kenney tiles + padding */
  background: linear-gradient(
    180deg,
    #1a1232 0%,        /* dark sky/wall */
    #2a1f4a 50%,
    #3a2d5e 65%,       /* floor band */
    #1a1432 100%
  );
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  overflow: hidden;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 4px 8px 6px;
}
/* Scene row: holds all the tile elements horizontally */
.scene-row {
  display: flex;
  align-items: flex-end;
  gap: 0;       /* tiles touch edge-to-edge for furniture continuity */
  height: 100%;
  position: relative;
}

/* Character tiles bob gently when idle, and shake when their PM is dispatched */
.character {
  position: relative;
  transform-origin: center bottom;
  animation: char-idle 1.6s ease-in-out infinite;
  animation-delay: var(--bob-delay, 0s);
  /* Slight shadow under the character so it sits on the floor */
  filter: drop-shadow(0 2px 0 rgba(0,0,0,0.6)) var(--room-tint, none);
}
.decor {
  position: relative;
  margin: 0 2px;
  filter: drop-shadow(0 1px 0 rgba(0,0,0,0.5)) var(--room-tint, none);
}

@keyframes char-idle {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-2px); }
}

/* "Thinking" — character types harder, an active state set by JS when their PM is in flight */
.character.thinking {
  animation: char-think 0.35s steps(2, end) infinite;
}
@keyframes char-think {
  0%   { transform: translate(0, 0) rotate(0deg); }
  50%  { transform: translate(-1px, -1px) rotate(-2deg); }
  100% { transform: translate(1px, -1px) rotate(2deg); }
}

/* Thinking sparkles — drawn as ::after on each thinking character */
.character.thinking::after {
  content: "💭";
  position: absolute;
  font-size: 12px;
  transform: translate(8px, -16px);
  animation: think-bubble 1.2s ease-in-out infinite;
}
@keyframes think-bubble {
  0%, 100% { opacity: 0.4; transform: translate(8px, -16px) scale(1); }
  50%      { opacity: 1.0; transform: translate(8px, -18px) scale(1.1); }
}

.character.done::after {
  content: "✓";
  position: absolute;
  color: var(--green);
  font-size: 18px;
  transform: translate(10px, -20px);
  text-shadow: 0 0 4px var(--green);
  animation: char-done 1.5s ease-out forwards;
}
@keyframes char-done {
  0%   { opacity: 0; transform: translate(10px, -10px) scale(0.5); }
  20%  { opacity: 1; transform: translate(10px, -20px) scale(1.2); }
  100% { opacity: 0; transform: translate(10px, -28px) scale(0.8); }
}

.character.error::after {
  content: "⚠";
  position: absolute;
  color: var(--red);
  font-size: 14px;
  transform: translate(10px, -18px);
}

/* When the whole room is "working" (dispatched), boost all characters to thinking */
.room.working .character {
  animation: char-think 0.35s steps(2, end) infinite;
}
.room.working .character::after {
  content: "💭";
  position: absolute;
  font-size: 12px;
  transform: translate(8px, -16px);
  animation: think-bubble 1.2s ease-in-out infinite;
}

/* Slightly different floor color per category — picked up from --room-color */
.room { --room-color: #a78bfa; }
.scene::before {
  /* tinted "carpet" hint at top of floor */
  content: "";
  position: absolute;
  left: 0; right: 0;
  bottom: 18px;
  height: 4px;
  background: var(--room-color);
  opacity: 0.4;
}

/* On small screens, hide scenes to save vertical space */
@media (max-width: 480px) {
  .scene { height: 60px; }
  .character { font-size: 20px; }
  .decor { font-size: 14px; }
}

/* ────────── chat drawer ────────── */
.drawer {
  position: fixed;
  top: 0; right: 0;
  width: min(540px, 100vw);
  height: 100vh;
  background: var(--bg-card);
  border-left: 2px solid var(--border);
  box-shadow: -8px 0 24px rgba(0, 0, 0, 0.4);
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.2s ease-out;
  z-index: 20;
}
.drawer.open { transform: translateX(0); }
.drawer.hidden { display: flex; } /* always rendered; transform handles visibility */

.chat-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px;
  border-bottom: 2px solid var(--border);
}
.chat-header h2 { margin: 0 0 6px; font-size: 16px; color: var(--accent); }
.chat-header select {
  width: 100%;
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--border);
  padding: 6px 8px;
  font-family: inherit;
  font-size: 13px;
  border-radius: 3px;
}
.chat-header button {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
  cursor: pointer;
  font-size: 16px;
  padding: 4px 10px;
  border-radius: 3px;
}
.chat-header button:hover { border-color: var(--border-hi); }

.chat-log {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  scroll-behavior: smooth;
}
.msg {
  padding: 10px 12px;
  border-radius: 4px;
  max-width: 92%;
  font-size: 14px;
  line-height: 1.45;
  white-space: pre-wrap;
  word-break: break-word;
  border: 1px solid var(--border);
}
.msg.user {
  align-self: flex-end;
  background: rgba(167, 139, 250, 0.18);
  border-color: rgba(167, 139, 250, 0.4);
}
.msg.assistant {
  align-self: flex-start;
  background: var(--bg);
}
.msg .role-label { font-size: 10px; color: var(--text-dim); display: block; margin-bottom: 4px; }

.chat-form {
  display: flex;
  gap: 8px;
  padding: 12px;
  border-top: 2px solid var(--border);
}
.chat-form textarea {
  flex: 1;
  font-family: inherit;
  font-size: 14px;
  padding: 8px;
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 3px;
  resize: vertical;
  min-height: 40px;
}
.chat-form button {
  font-family: inherit;
  font-size: 14px;
  padding: 8px 18px;
  background: var(--accent);
  color: #1a1432;
  border: 2px solid #000;
  cursor: pointer;
  border-radius: 3px;
  box-shadow: 0 3px 0 #000;
  font-weight: bold;
}
.chat-form button:active { transform: translateY(2px); box-shadow: 0 1px 0 #000; }
.chat-form button:disabled { opacity: 0.5; cursor: not-allowed; }
.chat-footer {
  padding: 8px 16px;
  font-size: 11px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
}

/* ────────── meeting drawer (wide) ────────── */
.drawer.wide { width: min(800px, 100vw); }

.meeting-config { padding: 16px; border-bottom: 2px solid var(--border); }
.meeting-config label, .meeting-config legend {
  font-size: 12px; color: var(--text-dim);
  display: block; margin-bottom: 6px;
}
.meeting-config textarea {
  width: 100%;
  font-family: inherit; font-size: 14px;
  padding: 10px;
  background: var(--bg); color: var(--text);
  border: 1px solid var(--border); border-radius: 3px;
  resize: vertical; min-height: 60px;
  margin-bottom: 14px;
}
.meeting-config fieldset {
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 10px 12px;
  margin: 0 0 14px;
}
#meeting-agents-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 4px 12px;
  font-size: 12px;
}
#meeting-agents-list label {
  display: flex; align-items: center; gap: 6px;
  font-size: 12px; color: var(--text);
  margin: 0; cursor: pointer;
}
.meeting-presets {
  display: flex; gap: 6px; flex-wrap: wrap; margin-top: 10px;
}
.meeting-presets button {
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text-dim);
  font-family: inherit; font-size: 11px;
  padding: 4px 10px;
  border-radius: 3px;
  cursor: pointer;
}
.meeting-presets button:hover { color: var(--text); border-color: var(--border-hi); }

.convene-btn {
  width: 100%;
  background: var(--accent);
  color: #1a1432;
  font-family: inherit; font-weight: bold; font-size: 14px;
  padding: 12px;
  border: 2px solid #000; border-radius: 3px;
  cursor: pointer;
  box-shadow: 0 4px 0 #000;
}
.convene-btn:active { transform: translateY(2px); box-shadow: 0 2px 0 #000; }
.convene-btn:disabled { opacity: 0.5; cursor: not-allowed; }

.meeting-progress { padding: 12px 16px; border-bottom: 2px solid var(--border); flex: 1; overflow-y: auto; }
.meeting-status {
  display: flex; justify-content: space-between; align-items: center;
  font-size: 13px; color: var(--text-dim);
  padding: 8px 0 12px;
}
.ghost-btn {
  background: transparent; border: 1px solid var(--border);
  color: var(--text); padding: 4px 10px; font-family: inherit; font-size: 12px;
  cursor: pointer; border-radius: 3px;
}
.ghost-btn:hover { border-color: var(--border-hi); }

.meeting-panels {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 12px;
}
.pm-panel {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 10px 12px;
  display: flex; flex-direction: column;
  min-height: 120px;
}
.pm-panel.thinking { border-color: var(--yellow); box-shadow: 0 0 10px rgba(250, 204, 21, 0.25); }
.pm-panel.done     { border-color: var(--green); }
.pm-panel.error    { border-color: var(--red); }

.pm-panel-header {
  display: flex; justify-content: space-between; align-items: center;
  font-size: 12px; margin-bottom: 6px;
}
.pm-panel-name { font-weight: bold; color: var(--accent); }
.pm-panel-status { color: var(--text-dim); font-size: 11px; }
.pm-panel-status.thinking::before { content: "● "; color: var(--yellow); animation: pulse 0.9s ease-in-out infinite; }
.pm-panel-status.done::before     { content: "✓ "; color: var(--green); }
.pm-panel-status.error::before    { content: "✗ "; color: var(--red); }

.pm-panel-body {
  font-size: 13px; line-height: 1.45;
  white-space: pre-wrap; word-break: break-word;
  flex: 1;
}

.meeting-history { padding: 12px 16px; border-top: 1px solid var(--border); }
.meeting-history h3 { margin: 0 0 8px; font-size: 13px; color: var(--text-dim); }
.meeting-history ul { list-style: none; margin: 0; padding: 0; font-size: 12px; max-height: 220px; overflow-y: auto; }
.meeting-history li {
  padding: 6px 8px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  color: var(--text);
}
.meeting-history li:hover { background: var(--bg-card-hi); }
.meeting-history li time { color: var(--text-dim); margin-right: 8px; }

/* ────────── room "working" overlay (pulse during dispatch) ────────── */
.room.working {
  border-color: var(--yellow);
  box-shadow: 0 4px 0 #000, 0 0 0 2px var(--yellow), 0 0 20px rgba(250, 204, 21, 0.4);
}
.room.working .status-light {
  background: var(--yellow);
  color: var(--yellow);
  animation: pulse 0.6s ease-in-out infinite;
}

/* ────────── auth modal ────────── */
dialog {
  background: var(--bg-card);
  color: var(--text);
  border: 2px solid var(--border);
  border-radius: 6px;
  padding: 24px;
  max-width: 480px;
  font-family: inherit;
  box-shadow: 0 8px 0 #000;
}
dialog::backdrop { background: rgba(0, 0, 0, 0.7); }
dialog h3 { margin: 0 0 8px; color: var(--accent); }
dialog code { background: var(--bg); padding: 2px 5px; border-radius: 2px; font-size: 12px; }
dialog input {
  width: 100%;
  margin: 14px 0 8px;
  padding: 8px;
  font-family: inherit;
  font-size: 13px;
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 3px;
}
dialog menu { padding: 0; margin: 8px 0 0; }
dialog button {
  background: var(--accent);
  color: #1a1432;
  border: 2px solid #000;
  padding: 8px 18px;
  font-family: inherit;
  font-weight: bold;
  cursor: pointer;
  border-radius: 3px;
  box-shadow: 0 3px 0 #000;
}
