:root {
  --bg: #15161c;
  --panel: #1e2029;
  --card: #262936;
  --line: #343849;
  --text: #e9e6dc;
  --muted: #9a9cab;
  --accent: #ffcf5a;
  --ok: #6fd08c;
  --warn: #ffb057;
  --bad: #ff6b6b;
  --idle: #8aa1ff;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text);
  font: 14px/1.4 ui-rounded, "SF Pro Rounded", "Nunito", system-ui, sans-serif; }
header { display: flex; align-items: center; gap: 16px; padding: 10px 16px; background: var(--panel);
  border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.brand { font-weight: 800; letter-spacing: .5px; display: flex; align-items: center; gap: 8px; }
.dot { width: 10px; height: 10px; border-radius: 50%; background: var(--muted); }
.dot.on { background: var(--ok); box-shadow: 0 0 8px var(--ok); }
.dot.off { background: var(--bad); }
.stats { display: flex; gap: 14px; flex: 1; flex-wrap: wrap; }
.stat { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 12px; }
.bar { width: 70px; height: 7px; background: var(--line); border-radius: 4px; overflow: hidden; }
.bar > i { display: block; height: 100%; background: var(--ok); }
.clock { color: var(--muted); font-variant-numeric: tabular-nums; }
main { display: grid; grid-template-columns: 1fr 340px; height: calc(100% - 49px); }
.floor { position: relative; overflow: hidden; display: flex; flex-direction: column; }
canvas { flex: 1; width: 100%; min-height: 0; display: block; image-rendering: pixelated; cursor: pointer; touch-action: manipulation; }
.ticker { padding: 6px 12px; font-size: 12px; color: var(--muted); background: var(--panel); border-top: 1px solid var(--line);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
aside { overflow-y: auto; padding: 12px; background: var(--panel); border-left: 1px solid var(--line); display: flex; flex-direction: column; gap: 10px; }
.card { background: var(--card); border-radius: 10px; padding: 10px 12px; }
.card h2 { margin: 0 0 6px; font-size: 12px; text-transform: uppercase; letter-spacing: 1px; color: var(--accent); display: flex; gap: 6px; align-items: center; }
.muted { color: var(--muted); font-size: 12px; }
.bubble { margin: 8px 0; padding: 8px 10px; background: #fffbe9; color: #2a2620; border-radius: 8px; font-weight: 600; }
.list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.list li { display: flex; gap: 8px; align-items: flex-start; }
.list.small li { font-size: 12px; color: var(--muted); }
.list li.click { cursor: pointer; border-radius: 6px; padding: 3px 4px; margin: -3px -4px; }
.list li.click:hover, .list li.sel { background: #30344a; }
.swatch { width: 12px; height: 12px; border-radius: 50%; flex: none; margin-top: 3px; }
.who { font-weight: 700; }
.what { color: var(--muted); font-size: 12px; }
.tag { font-size: 10px; padding: 1px 6px; border-radius: 8px; background: var(--line); color: var(--muted); text-transform: uppercase; }
.tag.working { background: #2e5a3c; color: #c9f5d6; }
.tag.thinking { background: #5a4d2e; color: #ffe9b8; }
.tag.waiting { background: #6a3535; color: #ffd3d3; }
.tag.idle { background: #33406a; color: #d5ddff; }
.badge { background: var(--bad); color: white; border-radius: 9px; padding: 0 7px; font-size: 11px; }
.badge:empty { display: none; }
.feed { margin: 0; padding-left: 18px; font-size: 12px; color: var(--muted); max-height: 220px; overflow-y: auto; }
.feed li { margin-bottom: 3px; }
.empty { color: var(--muted); font-style: italic; font-size: 12px; }
.zoom { position: absolute; right: 10px; top: 10px; display: flex; flex-direction: column; gap: 6px; }
.zoom button { width: 34px; height: 34px; border-radius: 8px; border: 1px solid var(--line); background: rgba(30,32,41,.85);
  color: var(--text); font: 800 18px/1 ui-rounded, system-ui; cursor: pointer; }
.zoom button:hover { background: #30344a; }
.face { width: 39px; height: 51px; flex: none; image-rendering: pixelated; margin: -6px 0 -4px -4px; }
.face.drone { width: 32px; height: 32px; margin: 2px 4px 0 0; }
.face.big { width: 52px; height: 68px; }
.focus-head { display: flex; gap: 8px; align-items: center; }
.grow { flex: 1; min-width: 0; }
.lv { color: var(--accent); font-weight: 800; font-size: 12px; }
.xp { display: block; height: 6px; background: var(--line); border-radius: 3px; overflow: hidden; margin-top: 4px; }
.xp > i { display: block; height: 100%; background: linear-gradient(90deg, #ffcf5a, #ff8f5a); }
#focus-xp .xp { display: inline-block; width: 90px; vertical-align: middle; margin: 0 6px 0 0; }
.tag.off { background: #3a3a46; color: #b9bccb; }
#key-gate { position: fixed; inset: 0; background: rgba(10,11,16,.82); display: grid; place-items: center; z-index: 10; padding: 16px; }
#key-gate[hidden] { display: none; }
#key-form { width: min(360px, 100%); display: flex; flex-direction: column; gap: 10px; padding: 18px; }
#key-form input { padding: 10px 12px; border-radius: 8px; border: 1px solid var(--line); background: var(--bg); color: var(--text); font: inherit; }
#key-form button { padding: 10px; border-radius: 8px; border: 0; background: var(--accent); color: #1b1608; font: 800 14px ui-rounded, system-ui; cursor: pointer; }
.small { font-size: 11px; }
@media (max-width: 860px) {
  main { grid-template-columns: 1fr; grid-template-rows: auto auto; height: auto; }
  canvas { flex: none; aspect-ratio: 1280 / 788; height: auto; }
  aside { border-left: 0; border-top: 1px solid var(--line); }
  header { padding: 8px 16px; gap: 6px 16px; }
  .brand { flex: 1; }
  .clock { order: 2; }
  .stats { order: 3; flex-basis: 100%; gap: 6px 12px; }
  .bar { width: 46px; }
}
