/* Garage AGI. Look ported from mockup v7 (docs/superpowers/specs/assets/2026-10-22-agi-site-mockup/).
   The mockup keeps its colours as inline hex values; each one is a custom property here, same value.
   No inline styles anywhere: the CSP (Task 7) will not allow them. */
:root {
  --bg: #101214;
  --line: #1e2226;
  --surface: #1a1d21;
  --surface-line: #2c3137;
  --text: #ecedee;
  --muted: #9ba3ad;
  --dim: #7d8590;
  --row-hover: #15181b;
  --focus: #5b9bff;
  --attn-bg: #1c2a44;
  --attn-fg: #a9c6ff;
  --ok: #4fbf73;
  --idle: #4a5058;
  --amber: #f2a93b;
  --amber-ink: #1a1206;
  --k3: #e8a94b;
  --k3-bg: #3a2c14;
  --strata: #4cc2b5;
  --strata-bg: #123431;
  --opus: #9db5ff;
  --opus-bg: #1e2a45;
  --bubble: #23272c;
  --dash: #3a4048;
  --queue-text: #d5d9de;
  --code: #c8cdd3;
  --spin-track: #2a3550;
  --team: #ecedee;
  --team-bg: #2c3137;
  --bad: #e5604d;          /* not in the mockup: ring for a stuck project */
  --column: 760px;
  --sans: "IBM Plex Sans", system-ui, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, monospace;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font-family: var(--sans); min-height: 100vh; }
a { color: var(--text); text-decoration: none; }
a:hover { color: #fff; }
button { font: inherit; color: inherit; cursor: pointer; }
button:disabled { cursor: default; }
a:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.noscript { padding: 16px; color: var(--muted); }

/* tones: one place decides the colour of K3, Strata, Opus and the orchestrator */
.tone-k3 { --tone: var(--k3); --tone-bg: var(--k3-bg); }
.tone-strata { --tone: var(--strata); --tone-bg: var(--strata-bg); }
.tone-opus { --tone: var(--opus); --tone-bg: var(--opus-bg); }
.tone-orchestrator { --tone: var(--ok); --tone-bg: var(--surface); }
.tone-team { --tone: var(--team); --tone-bg: var(--team-bg); }
.tone-barry { --tone: var(--text); --tone-bg: var(--bubble); }
.tone-text-attention { color: var(--attn-fg); }
.tone-text-muted { color: var(--muted); }

/* shared pieces */
#app { min-height: 100vh; display: flex; flex-direction: column; }
.page { flex: 1; display: flex; flex-direction: column; min-height: 100vh; }
.top { background: var(--bg); border-bottom: 1px solid var(--line); flex: none; padding-top: env(safe-area-inset-top); }
.bar { box-sizing: content-box; max-width: var(--column); margin: 0 auto; padding: 14px 16px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.icon-btn { width: 44px; height: 44px; border-radius: 22px; background: var(--surface); border: 1px solid var(--surface-line); color: var(--text); padding: 0; display: flex; align-items: center; justify-content: center; flex: none; }
.icon-btn-lg { width: 52px; height: 52px; border-radius: 26px; }
.icon-btn-plain { background: none; border: 0; color: var(--muted); }
.icon-btn:disabled { opacity: 0.4; }
.avatar { width: 30px; height: 30px; border-radius: 15px; background: var(--tone-bg); color: var(--tone); font-size: 12px; font-weight: 600; display: flex; align-items: center; justify-content: center; flex: none; }
.avatar-lg { width: 34px; height: 34px; border-radius: 17px; font-size: 13px; }
.avatar-sm { width: 28px; height: 28px; border-radius: 14px; font-size: 11px; }
.btn { height: 52px; border-radius: 26px; border: 0; padding: 0 22px; font-size: 16px; font-weight: 600; display: inline-flex; align-items: center; gap: 10px; }
.btn-primary { background: var(--amber); color: var(--amber-ink); }
a.btn-primary:hover { color: var(--amber-ink); }
.btn:disabled { opacity: 0.4; }
.btn-new:disabled { opacity: 1; background: var(--surface); color: var(--dim); border: 1px solid var(--surface-line); }
.offline { position: fixed; top: 8px; left: 50%; transform: translateX(-50%); z-index: 20; background: var(--surface); border: 1px solid var(--surface-line); color: var(--muted); border-radius: 14px; padding: 4px 12px; font-size: 13px; }
.toast { position: fixed; left: 50%; bottom: 150px; transform: translateX(-50%); z-index: 20; max-width: calc(100% - 32px); background: var(--bubble); border: 1px solid var(--surface-line); color: var(--text); border-radius: 14px; padding: 10px 16px; font-size: 14px; text-align: center; }

/* sign-in */
.signin { margin: auto; padding: 32px 16px; display: flex; flex-direction: column; align-items: center; gap: 14px; }
.signin-title { margin: 0; font-size: 24px; font-weight: 600; }
.signin-text { margin: 0 0 8px; color: var(--muted); font-size: 16px; }

/* projects page */
.top-title { font-size: 17px; font-weight: 600; letter-spacing: 0.01em; }
.bar-side { width: 44px; height: 44px; flex: none; }
.page-projects .top { position: sticky; top: 0; z-index: 2; }
.content { max-width: var(--column); width: 100%; margin: 0 auto; padding: 0 16px 120px; flex: 1; }
.section { margin: 24px 8px 12px; font-size: 15px; font-weight: 500; color: var(--muted); }
.section-projects { margin: 32px 8px 4px; }
.machines { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 8px; }
.machine { background: var(--surface); border: 1px solid var(--surface-line); border-radius: 14px; padding: 12px 14px; display: flex; gap: 12px; align-items: center; }
.machine-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.machine-name { font-size: 15px; font-weight: 500; }
.machine-role { font-size: 13px; color: var(--muted); }
.rows { display: flex; flex-direction: column; }
.list-note { margin: 12px 8px; color: var(--muted); font-size: 15px; }
.row { display: flex; gap: 16px; padding: 14px 8px; align-items: flex-start; border-radius: 12px; }
.row:hover { background: var(--row-hover); }
.ring { width: 18px; height: 18px; margin-top: 5px; border-radius: 9px; border: 2px solid var(--idle); flex: none; }
.ring-attention { border-color: var(--text); }
.ring-running { border-color: var(--ok); }
.ring-paused { border-color: var(--amber); }
.ring-waiting { border-color: var(--focus); }
.ring-stuck { border-color: var(--bad); }
.ring-idle { border-color: var(--idle); }
.row-body { display: flex; flex-direction: column; gap: 3px; flex: 1; min-width: 0; }
.row-name { font-size: 19px; font-weight: 500; overflow-wrap: anywhere; }
.row-sub { font-size: 15px; }
.row-where { font-size: 13px; color: var(--dim); display: flex; align-items: center; gap: 6px; min-width: 0; }
.row-where svg { flex: none; }
.row-where-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.badge { font-size: 12px; font-weight: 600; background: var(--attn-bg); color: var(--attn-fg); border-radius: 10px; padding: 3px 9px; margin-top: 5px; white-space: nowrap; }
.dot { width: 10px; height: 10px; border-radius: 5px; background: var(--focus); margin-top: 10px; flex: none; }
.dock { position: fixed; left: 0; right: 0; bottom: 0; background: var(--bg); border-top: 1px solid var(--line); }
.dock-inner { max-width: var(--column); margin: 0 auto; padding: 12px 16px calc(20px + env(safe-area-inset-bottom)); display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.search-input { display: none; flex: 1; min-width: 0; height: 52px; border-radius: 26px; border: 1px solid var(--surface-line); background: var(--surface); color: var(--text); font: inherit; font-size: 17px; padding: 0 20px; }
.search-input::placeholder { color: var(--dim); }
.search-open .search-input { display: block; }
.search-open .btn-new { display: none; }
.btn-new { gap: 10px; }

/* session page */
.page-session { flex: none; height: 100vh; height: 100dvh; min-height: 0; overflow: hidden; }
.top-session .bar { padding: 12px 16px; }
.sess-title { display: flex; flex-direction: column; align-items: center; gap: 1px; min-width: 0; flex: 1; }
.sess-name { font-size: 16px; font-weight: 600; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sess-step { font-size: 13px; color: var(--muted); max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sess-activity { box-sizing: content-box; max-width: var(--column); margin: 0 auto; padding: 0 16px 10px; display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--tone); min-width: 0; }
.act-spin { width: 11px; height: 11px; border-radius: 50%; border: 2px solid var(--tone-bg); border-top-color: var(--tone); flex: none; animation: agiSpin 0.9s linear infinite; }
.act-text { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.act-elapsed { flex: none; white-space: nowrap; font-variant-numeric: tabular-nums; color: var(--muted); }
@media (prefers-reduced-motion: reduce) { .act-spin { animation: none; background: var(--tone); border-color: var(--tone); } }
.bar-right { display: flex; gap: 8px; flex: none; }
.state-box { cursor: default; }
.menu-wrap { position: relative; }
.menu { position: absolute; right: 0; top: 52px; z-index: 5; min-width: 150px; background: var(--surface); border: 1px solid var(--surface-line); border-radius: 14px; padding: 6px; box-shadow: 0 8px 24px rgb(0 0 0 / 0.5); }
.menu-item { width: 100%; text-align: left; background: none; border: 0; border-radius: 10px; padding: 12px 14px; font-size: 16px; }
.menu-item:hover { background: var(--bubble); }
@keyframes agiSpin { to { transform: rotate(360deg); } }
.spin { animation: agiSpin 1.1s linear infinite; transform-origin: 50% 50%; }
@media (prefers-reduced-motion: reduce) { .spin { animation: none; } }

.scroll { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; }
.log { max-width: var(--column); margin: 0 auto; padding: 20px 16px 16px; display: flex; flex-direction: column; gap: 18px; }
.user { align-self: flex-end; max-width: 80%; background: var(--bubble); border-radius: 20px 20px 6px 20px; padding: 10px 15px; font-size: 16px; line-height: 1.45; white-space: pre-wrap; overflow-wrap: anywhere; }
.status { display: flex; gap: 10px; align-items: baseline; font-size: 14px; line-height: 1.5; color: var(--muted); }
.status-dot { width: 7px; height: 7px; border-radius: 4px; background: var(--tone); flex: none; transform: translateY(-1px); }
.status-icon { flex: none; align-self: center; }
.status-text { white-space: pre-wrap; overflow-wrap: anywhere; min-width: 0; }
.status-who { color: var(--text); font-weight: 500; }
.agent { display: flex; gap: 12px; align-items: flex-start; }
.agent .avatar { margin-top: 1px; }
.agent-body { display: flex; flex-direction: column; gap: 4px; min-width: 0; max-width: 64ch; }
.agent-who { font-size: 14px; font-weight: 600; color: var(--tone); }
.agent-text { font-size: 16px; line-height: 1.55; color: var(--text); white-space: pre-wrap; overflow-wrap: anywhere; }
.card { background: var(--attn-bg); border: 1px solid var(--spin-track); border-radius: 16px; padding: 12px 14px; display: flex; flex-direction: column; gap: 10px; }
.card-head { display: flex; gap: 8px; align-items: baseline; font-size: 13px; }
.card-label { font-weight: 600; color: var(--attn-fg); }
.card-from { color: var(--muted); }
.card-text { font-size: 16px; line-height: 1.5; white-space: pre-wrap; overflow-wrap: anywhere; }
.options { display: flex; flex-wrap: wrap; gap: 8px; }
.options-text { flex-wrap: nowrap; }
.opt { min-height: 44px; border-radius: 22px; border: 1px solid var(--focus); background: var(--surface); color: var(--text); padding: 0 18px; font-size: 15px; }
.opt:hover:not(:disabled) { background: var(--bubble); }
.opt:disabled { opacity: 0.4; }
.opt-solid { background: var(--amber); border-color: var(--amber); color: var(--amber-ink); font-weight: 600; flex: none; }
.card-input { flex: 1; min-width: 0; height: 44px; border-radius: 22px; border: 1px solid var(--surface-line); background: var(--surface); color: var(--text); font: inherit; font-size: 16px; padding: 0 16px; }
.card-answered { font-size: 14px; color: var(--attn-fg); overflow-wrap: anywhere; }

.foot { flex: none; background: var(--bg); }
.foot-inner { max-width: var(--column); margin: 0 auto; padding: 8px 12px calc(18px + env(safe-area-inset-bottom)); display: flex; flex-direction: column; gap: 8px; }
.queue { display: flex; flex-direction: column; gap: 8px; }
.queue:empty { display: none; }
.queued { display: flex; align-items: center; gap: 10px; border: 1px dashed var(--dash); border-radius: 16px; padding: 6px 6px 6px 14px; }
.queued-body { display: flex; flex-direction: column; gap: 1px; flex: 1; min-width: 0; }
.queued-label { font-size: 12px; color: var(--muted); }
.queued-text { font-size: 14px; color: var(--queue-text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pill-row { display: block; }
.pill { height: 38px; border-radius: 19px; border: 1px solid var(--surface-line); background: var(--surface); color: var(--queue-text); font-size: 14px; padding: 0 14px; display: inline-flex; align-items: center; gap: 8px; }
.composer { background: var(--surface); border: 1px solid var(--surface-line); border-radius: 24px; padding: 10px 8px 8px; display: flex; flex-direction: column; gap: 8px; }
.field { display: block; width: 100%; min-height: 36px; max-height: 140px; border: 0; background: transparent; color: var(--text); font: inherit; font-size: 17px; line-height: 24px; padding: 6px 10px; outline: none; resize: none; field-sizing: content; }
.field::placeholder { color: var(--dim); }
.composer-row { display: flex; align-items: center; gap: 8px; }
.grow { flex: 1; }
.round { width: 44px; height: 44px; border-radius: 22px; border: 0; background: var(--bubble); color: var(--text); padding: 0; display: flex; align-items: center; justify-content: center; flex: none; }
.round-send { background: var(--amber); color: var(--amber-ink); }
.round:disabled { opacity: 0.4; }
.round-send:disabled { opacity: 1; background: var(--bubble); color: var(--dim); }
.round.on { background: var(--focus); color: #fff; }
.chip { height: 44px; border-radius: 22px; border: 0; background: var(--bubble); color: var(--text); font-size: 15px; padding: 0 14px 0 8px; display: flex; align-items: center; gap: 8px; }
