:root {
  --bg: #141619; --panel: #1a1d21; --panel-2: #20242a; --line: #2c3036; --line-2: #3a3f46;
  --text: #ecedee; --muted: #a3a9b0; --soft: #b7bcc2;
  --free: #7cc7af; --free-edge: #2f5a4c;
  --agent: #7faeff; --agent-edge: #2e4468;
  --person: #ef6b6b; --person-edge: #6e2a2a;
  --offline: #7d838b;
  --font: "IBM Plex Sans", "SF Pro Text", "Segoe UI", system-ui, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, monospace;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font-family: var(--font); font-size: 15px; }
a { color: #8fb8ff; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.muted { color: var(--muted); font-size: 13px; }
.eyebrow { font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
h1, h2 { margin: 2px 0 0; font-weight: 600; letter-spacing: -.01em; }
h1 { font-size: 26px; } h2 { font-size: 22px; }

.button { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 0 18px;
  border-radius: 8px; border: 1px solid var(--line-2); background: transparent; color: var(--text);
  font: 600 14px var(--font); cursor: pointer; text-decoration: none; }
.button.primary { background: var(--free); border-color: var(--free); color: #0f1a16; }
.button:disabled { opacity: .5; cursor: default; }

.shell { display: flex; flex-wrap: wrap; min-height: 100vh; }
.rail { flex: 1 1 300px; max-width: 380px; border-right: 1px solid var(--line); padding: 24px 18px;
  display: flex; flex-direction: column; gap: 16px; }
.room { flex: 999 1 520px; min-width: 0; display: flex; flex-direction: column; height: 100vh; }

.filters { display: flex; flex-wrap: wrap; gap: 6px; }
.filters button { min-height: 36px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--line-2);
  background: transparent; color: var(--soft); font: 13px var(--font); cursor: pointer; }
.filters button[aria-pressed="true"] { background: var(--panel-2); color: var(--text); border-color: var(--text); }
.filters b { font-variant-numeric: tabular-nums; margin-right: 4px; }

.machines { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; overflow-y: auto; }
.machine { border: 1px solid var(--line); border-radius: 10px; background: var(--panel); padding: 12px 14px;
  display: flex; flex-direction: column; gap: 6px; }
.machine.free { border-color: var(--free-edge); }
.machine.agent { border-color: var(--agent-edge); }
.machine.person { border-color: var(--person-edge); }
.machine.offline { opacity: .75; }
.machine-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.machine-name { font-family: var(--mono); font-size: 15px; }
.chip { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; padding: 2px 9px;
  border-radius: 999px; border: 1px solid var(--line-2); }
.chip.free { color: var(--free); border-color: var(--free-edge); }
.chip.agent { color: var(--agent); border-color: var(--agent-edge); }
.chip.person { color: var(--person); border-color: var(--person-edge); }
.chip.offline { color: var(--offline); }
.machine-who { font-weight: 500; }
.machine-task { color: var(--soft); font-size: 13px; }
.machine-actions { display: flex; gap: 8px; margin-top: 4px; }
.machine-actions .button { min-height: 36px; padding: 0 12px; font-size: 13px; }

/* status marks differ by shape as well as color */
.dot { display: inline-block; width: 10px; height: 10px; margin-right: 6px; vertical-align: -1px; }
.dot.free { border: 2px solid var(--free); border-radius: 50%; }
.dot.agent { background: var(--agent); transform: rotate(45deg) scale(.85); }
.dot.person { background: var(--person); border-radius: 50%; }
.dot.offline { height: 2px; background: var(--offline); vertical-align: 3px; }
.legend { display: flex; flex-wrap: wrap; gap: 12px; font-size: 12px; color: var(--muted); margin-top: auto; }
.notice { font-size: 13px; color: var(--person); border: 1px dashed var(--person-edge); border-radius: 8px; padding: 10px; }

.room-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 12px;
  padding: 24px 28px 16px; border-bottom: 1px solid var(--line); }
.team { display: flex; flex-wrap: wrap; gap: 6px; }
.team span { font-size: 12px; color: var(--soft); border: 1px solid var(--line-2); border-radius: 999px; padding: 3px 10px; }
.team span.unset { color: var(--muted); border-style: dashed; }

.messages { list-style: none; margin: 0; padding: 20px 28px; flex: 1; overflow-y: auto; display: flex;
  flex-direction: column; gap: 14px; }
.msg { max-width: 820px; display: flex; flex-direction: column; gap: 4px; }
.msg .who { font-size: 13px; font-weight: 600; }
.msg .who time { font-weight: 400; color: var(--muted); margin-left: 8px; }
.msg .body { white-space: pre-wrap; line-height: 1.5; color: var(--text); background: var(--panel);
  border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px; overflow-wrap: anywhere; }
.msg.owner { align-self: flex-end; }
.msg.owner .body { background: #23303b; border-color: #2f4558; }
.msg.agent .who { color: var(--agent); }
.msg.coder .who { color: var(--free); }
.msg.system .body { background: transparent; border-style: dashed; color: var(--muted); font-size: 13px; }
.empty { color: var(--muted); padding: 40px 0; text-align: center; }

.working { padding: 0 28px 8px; font-size: 13px; color: var(--muted); }
.composer { border-top: 1px solid var(--line); padding: 14px 28px 20px; display: flex; flex-direction: column; gap: 10px; }
.to { display: flex; flex-wrap: wrap; gap: 6px; }
.to button { min-height: 36px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--line-2);
  background: transparent; color: var(--soft); font: 13px var(--font); cursor: pointer; }
.to button:hover { color: var(--text); border-color: var(--text); }
textarea { width: 100%; resize: vertical; min-height: 72px; background: var(--panel); color: var(--text);
  border: 1px solid var(--line-2); border-radius: 10px; padding: 12px; font: 15px/1.45 var(--font); }
textarea:focus, button:focus-visible, a:focus-visible { outline: 2px solid #8fb8ff; outline-offset: 2px; }
.composer-foot { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }

.login { display: flex; min-height: 100vh; align-items: center; justify-content: center; padding: 24px; }
.login-card { max-width: 380px; display: flex; flex-direction: column; gap: 12px; }
.login-card h1 { font-size: 40px; }
.login-card p { color: var(--soft); margin: 0 0 8px; }

@media (max-width: 760px) {
  .rail { max-width: none; border-right: 0; border-bottom: 1px solid var(--line); }
  .room { height: auto; min-height: 70vh; }
  .messages, .composer, .room-head, .working { padding-left: 16px; padding-right: 16px; }
}
