:root,
html.theme-dark {
  --bg: #0b0f14;
  --bg-glow: #152033;
  --panel: #121820;
  --border: #243041;
  --text: #e8eef6;
  --muted: #8b9bb0;
  --accent: #6cb6ff;
  --accent-dim: #3d7ab8;
  --user: #173325;
  --agent: #141c26;
  --tool: #1a2218;
  --thought: #1a1824;
  --error: #ff7b7b;
  --ok: #6ddea8;
  --input: #0d1218;
  --btn: #182230;
  --btn-hover: #203044;
  --chrome: rgba(12, 16, 22, 0.92);
  --menu: #101820;
  --picker: #15202c;
  --chip: #0e1520;
  --shadow: rgba(0, 0, 0, 0.45);
  --work: #39ff14;
  --radius: 12px;
  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  color-scheme: dark;
}

/* J-1004 owner refresh: compact violet + gold portal language. */
.cronus-mode #cronus-stage{background:radial-gradient(circle at 12% 0,#2b1b6640,transparent 32rem)}
.cronus-stage{width:min(1180px,100%);margin:auto;padding:clamp(1rem,3vw,2rem);overflow:auto}
.cronus-portal-head{display:flex;justify-content:space-between;align-items:flex-start;gap:1rem;margin-bottom:1rem}.cronus-portal-head h1{margin:0;font-size:clamp(1.6rem,3vw,2.35rem)}.eyebrow{color:#f2c46d;font:700 .68rem/1.2 var(--mono);letter-spacing:.16em;margin:0 0 .35rem}.cronus-head-actions{display:flex;gap:.5rem;align-items:center;flex-wrap:wrap}.cronus-head-actions button,.cronus-tabs button{border:1px solid var(--border);background:var(--panel);color:var(--muted);border-radius:8px;padding:.42rem .65rem}.cronus-usage-chip{border:1px solid #6f5e2a;color:#f2c46d;background:#211c0c;border-radius:999px;padding:.38rem .7rem;font-size:.72rem}.cronus-system-status{display:flex;align-items:center;gap:.55rem;border:1px solid #2a5f4a;background:#10251b;color:#8ce0ae;border-radius:10px;padding:.6rem .75rem;margin-bottom:.85rem;font-size:.78rem}.cronus-system-status .muted{margin-left:auto}.cronus-system-status.is-warn{border-color:#765921;background:#261d0d;color:#f2c46d}.cronus-system-status.is-bad{border-color:#7d3844;background:#28131a;color:#ff9da8}.status-dot{width:.55rem;height:.55rem;border-radius:50%;background:currentColor}.cronus-compose-card{width:100%;margin:0;padding:clamp(.8rem,2vw,1.2rem)}.cronus-heading{margin-bottom:.2rem}.cronus-heading h2{font-size:1.25rem;margin:0}.cronus-model-strip{display:grid;grid-template-columns:minmax(190px,260px) 1fr;align-items:end;gap:.75rem;margin:.2rem 0 .8rem}.cronus-model-note{border:1px solid var(--border);border-radius:8px;padding:.63rem .72rem;color:var(--muted);font-size:.74rem;min-height:2.5rem}.cronus-advanced{border-top:1px solid var(--border);padding-top:.65rem;margin-top:.3rem}.cronus-advanced summary{cursor:pointer;color:#f2c46d;font-size:.8rem}.cronus-advanced-grid{display:flex;flex-wrap:wrap;gap:.65rem;margin-top:.7rem}.cronus-advanced-grid .cronus-field{min-width:130px;flex:1}.cronus-check{color:var(--muted);font-size:.78rem;display:flex;align-items:center;gap:.35rem}.cronus-section-title{display:flex;justify-content:space-between;align-items:center;gap:1rem;margin:1.25rem 0 .5rem}.cronus-section-title h2{margin:0;font-size:1.1rem}.cronus-tabs{display:flex;gap:.35rem}.cronus-tabs button.is-on{color:#f2c46d;border-color:#80682c;background:#251d0c}.cronus-jobs{width:100%;margin:.45rem 0 0}.cronus-queue{width:100%;margin-top:.65rem}.cronus-jobs-list{display:grid;grid-template-columns:repeat(auto-fit,minmax(240px,1fr));gap:.55rem}.cronus-job{min-width:0}.cronus-job-snip{font-size:.78rem}.cronus-admin{width:100%;margin-top:1rem}.cronus-admin[hidden]{display:none}.cronus-admin-users{display:grid;gap:.45rem}.cronus-admin-row{display:grid;grid-template-columns:1.2fr 1fr 1fr;gap:.6rem;padding:.6rem .7rem;border:1px solid var(--border);border-radius:8px;font-size:.75rem}.cronus-admin-row span{color:var(--muted)}
@media(max-width:800px){.cronus-stage{padding:1rem .75rem 5rem}.cronus-portal-head{display:block}.cronus-head-actions{margin-top:.8rem}.cronus-system-status .muted{display:none}.cronus-model-strip{grid-template-columns:1fr}.cronus-section-title{align-items:flex-start;flex-direction:column}.cronus-tabs{width:100%}.cronus-tabs button{flex:1}.cronus-jobs-list{display:flex;flex-direction:column}.cronus-admin-row{grid-template-columns:1fr;gap:.1rem}}

/* Final cascade for the owner-wide desk layout. */
.cronus-stage:not(.hidden){width:min(1800px,100%);display:grid!important;grid-template-columns:minmax(0,1.25fr) minmax(240px,.8fr) minmax(240px,.8fr);grid-template-areas:"head head head" "status status status" "compose active queue" "admin admin admin";gap:.75rem 1rem;align-items:start}
.cronus-portal-head{grid-area:head}.cronus-system-status{grid-area:status}.cronus-compose-card{grid-area:compose;min-width:0;padding:.85rem 1rem}.cronus-section-title{grid-area:tabs;margin-top:.15rem}.cronus-compose-card .cronus-heading p{margin-bottom:.45rem}.cronus-compose-card .cronus-controls{margin:.5rem 0}
#cronus-jobs{grid-area:active;min-width:0;margin:0;max-height:calc(100dvh - 13rem);overflow:auto}#cronus-queue{grid-area:queue;min-width:0;margin:0;max-height:calc(100dvh - 13rem);overflow:auto}.cronus-admin{grid-area:admin}
#cronus-prompt{min-height:2.75rem;height:2.75rem;transition:height .18s ease}#cronus-prompt:focus{min-height:7rem;height:7rem!important}
@media(min-width:900px) and (max-width:1279px){.cronus-stage:not(.hidden){grid-template-columns:minmax(0,1.35fr) minmax(300px,.85fr);grid-template-areas:"head head" "status status" "compose active" "compose queue" "tabs tabs" "admin admin"}#cronus-jobs,#cronus-queue{max-height:24rem}}
@media(max-width:899px){.cronus-stage:not(.hidden){display:block!important;width:100%}#cronus-jobs,#cronus-queue{max-height:none}.cronus-compose-card{margin-bottom:1rem}#cronus-prompt:focus{min-height:6rem;height:6rem!important}}

/* Owner desk wide layout: keep the three working surfaces visible together. */
.cronus-stage:not(.hidden) {
  width: min(1800px, 100%);
  display: grid !important;
  grid-template-columns: minmax(0, 1.25fr) minmax(240px, .8fr) minmax(240px, .8fr);
  grid-template-areas:
    "head head head"
    "status status status"
    "compose active queue"
    "admin admin admin";
  gap: .75rem 1rem;
  align-items: start;
}
.cronus-portal-head { grid-area: head; }
.cronus-system-status { grid-area: status; }
.cronus-compose-card { grid-area: compose; min-width: 0; }
.cronus-section-title { grid-area: tabs; margin-top: .15rem; }
#cronus-jobs { grid-area: active; min-width: 0; margin: 0; max-height: calc(100dvh - 13rem); overflow: auto; }
#cronus-queue { grid-area: queue; min-width: 0; margin: 0; max-height: calc(100dvh - 13rem); overflow: auto; }
.cronus-admin { grid-area: admin; }
.cronus-compose-card { padding: .85rem 1rem; }
.cronus-compose-card .cronus-heading p { margin-bottom: .45rem; }
#cronus-prompt { min-height: 2.75rem; height: 2.75rem; transition: height .18s ease; }
#cronus-prompt:focus { min-height: 7rem; height: 7rem !important; }
.cronus-compose-card .cronus-controls { margin: .5rem 0; }

@media (min-width: 900px) and (max-width: 1279px) {
  .cronus-stage:not(.hidden) {
    grid-template-columns: minmax(0, 1.35fr) minmax(300px, .85fr);
    grid-template-areas:
      "head head"
      "status status"
      "compose active"
      "compose queue"
      "admin admin";
  }
  #cronus-jobs, #cronus-queue { max-height: 24rem; }
}

@media (max-width: 899px) {
  .cronus-stage:not(.hidden) {
    display: block !important;
    width: 100%;
  }
  #cronus-jobs, #cronus-queue { max-height: none; }
  .cronus-compose-card { margin-bottom: 1rem; }
  #cronus-prompt:focus { min-height: 6rem; height: 6rem !important; }
}
.cronus-stage:not(.hidden){display:block!important}
.cronus-retention-warn{color:#f2c46d!important}

/* J-1004-CRONUS-REDESIGN-PWA2: live owner desk adapter over the approved mockup CSS. */
body.cronus-mode { background: var(--c-bg, #090b10); }
body.cronus-mode .cronus-stage:not(.hidden) {
  width: min(1880px, 100%); box-sizing: border-box; margin: 0 auto; padding: 12px 20px 18px;
  display: grid !important; grid-template-columns: 420px minmax(0,1fr) 360px;
  grid-template-areas: "head head head" "status status status" "compose active queue" "compose active queue" "summary summary summary" "admin admin admin";
  gap: 16px; align-items: start; overflow: auto;
}

/* J-1004-ZEUS-HOME-REBUILD: same #chat > .topbar as Bridge, full width.
   #chat is display:contents while choosing, so .chat > .topbar { grid-area: top }
   would name a second column on #app and park the heading beside the list.
   Both bands span the only column: heading on row 1, sessions centered on row 2. */
body.choosing #app {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: auto minmax(0, 1fr);
  height: 100%;
  min-height: 0;
}
body.choosing #chat { display: contents; }
body.choosing #chat > .topbar {
  grid-area: 1 / 1 / 2 / -1;
  position: sticky;
  top: 0;
  z-index: 40;
  width: 100%;
  grid-template-columns: 1fr auto 1fr;
  justify-items: center;
}
body.choosing .brand {
  grid-column: 2;
  align-items: center;
}
body.choosing .topbar-actions {
  grid-column: 3;
  justify-self: end;
}
body.choosing .header-alert { grid-column: 1 / -1; }
body.choosing .header-alert.is-idle { display: none; }
body.choosing #session-picker,
body.choosing #new-session-btn,
body.choosing #admin-link,
body.choosing #user-label,
body.choosing #status { display: none !important; }
body.choosing #chat > .messages,
body.choosing #chat > .composer,
body.choosing #chat > .cronus-phone-tabs,
body.choosing #chat > .plato-gb-stage,
body.choosing #chat > .voice-stage,
body.choosing #chat > .cronus-stage { display: none !important; }
body.choosing #session-chooser {
  grid-area: 2 / 1 / 3 / -1;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  min-height: 0;
  overflow: auto;
  padding: clamp(1.5rem, 4vw, 3.5rem) 1rem 4rem;
}
body.choosing #session-chooser .chooser-card {
  width: min(720px, 100%);
  max-height: none;
  margin: 0 auto;
  padding: 0;
  background: transparent;
  border: 0;
  box-shadow: none;
  gap: .75rem;
  align-items: stretch;
}
body.choosing .chooser #chooser-new {
  width: min(280px, 100%);
  align-self: center;
}
body.choosing .chooser-section-label { margin-top: 1.4rem; text-align: left; }
body.choosing .chooser-list { max-height: none; width: 100%; }
@media (max-width: 720px) {
  body.choosing #session-chooser { padding: 1.25rem .75rem 3rem; }
  body.choosing .chooser #chooser-new { width: 100%; }
  /* One header row, same as /bridge: mark, peer menu, theme, settings.
     The chat toolbar stays hidden, so it cannot wrap onto the session column. */
  body.choosing #chat > .topbar {
    display: flex !important;
    flex-wrap: nowrap;
    align-items: center;
    justify-content: flex-start;
    height: auto;
    min-height: 48px;
    overflow: hidden;
    padding: 0.35rem 0.55rem;
    padding-top: max(0.35rem, env(safe-area-inset-top));
  }
  body.choosing .brand {
    grid-column: auto;
    width: auto;
    flex: 1 1 auto;
    min-width: 0;
    align-items: center;
  }
  body.choosing .topbar-actions {
    grid-column: auto;
    width: auto;
    flex: 0 0 auto;
    justify-self: end;
    justify-content: flex-end;
  }
  body.choosing #peer-dropdown {
    flex: 1 1 auto;
    min-width: 0;
    width: auto;
  }
}
body.cronus-mode .cronus-portal-head { grid-area: head; margin: 0; padding: 8px 0 2px; align-items: center; }
body.cronus-mode .cronus-portal-head h1 { font: 650 22px/28px var(--f-sans, ui-sans-serif); letter-spacing: -.01em; }
body.cronus-mode .cronus-portal-head .eyebrow, body.cronus-mode .cronus-portal-head > div:first-child > .muted { display:none; }
body.cronus-mode .cronus-head-actions { margin: 0; }
body.cronus-mode .cronus-live-header { display:inline-flex; align-items:center; gap:7px; color:#2ee6d6; font:550 12.5px/1 var(--f-sans, ui-sans-serif); }
body.cronus-mode .cronus-live-header i { width:8px; height:8px; border-radius:50%; background:#2ee6d6; box-shadow:0 0 0 3px #2ee6d62e,0 0 10px #2ee6d6; }
body.cronus-mode .cronus-owner-badge { display:inline-flex; align-items:center; height:18px; padding:0 7px; margin-left:4px; border-radius:999px; color:#1a1300; background:linear-gradient(#f7d58c,#e0a63f); font:700 10px/1 var(--f-sans,ui-sans-serif); text-transform:uppercase; }
body.cronus-mode #cronus-system-status { grid-area: status; display:none; }
body.cronus-mode .cronus-compose-card { grid-area: compose; min-width:0; margin:0; padding:16px; border-radius:14px; background:var(--c-surface-1,#11151d); border:1px solid var(--c-border,#252b38); }
body.cronus-mode #cronus-jobs { grid-area: active; min-width:0; width:auto; max-height:none; margin:0; overflow:visible; }
body.cronus-mode #cronus-queue { grid-area: queue; min-width:0; width:auto; max-height:none; margin:0; overflow:visible; }
body.cronus-mode .cronus-jobs-head { margin: 0 0 8px; }
body.cronus-mode .cronus-jobs-head h2 { font:650 15px/20px var(--f-sans,ui-sans-serif); }
body.cronus-mode .cronus-jobs-list { gap:0; border:1px solid var(--c-border,#252b38); border-radius:12px; overflow:hidden; background:var(--c-surface-1,#11151d); }
body.cronus-mode .cronus-job { border:0; border-top:1px solid var(--c-border,#252b38); border-left:3px solid var(--job,#677083); border-radius:0; box-shadow:none; padding:12px 14px; background:transparent; }
body.cronus-mode .cronus-job:first-child { border-top:0; }
body.cronus-mode .cronus-job-snip { white-space:nowrap; text-overflow:ellipsis; display:block; margin-top:5px; }
body.cronus-mode #cronus-queue .cronus-job { display:grid; grid-template-columns:88px minmax(0,1fr) auto; align-items:center; column-gap:10px; min-height:52px; padding:0 12px; }
body.cronus-mode #cronus-queue .cronus-job-top { grid-column:1; grid-row:1 / span 2; }
body.cronus-mode #cronus-queue .cronus-job-snip { grid-column:2; grid-row:1; margin:0; }
body.cronus-mode #cronus-queue .cronus-job-model { grid-column:3; grid-row:1; }
body.cronus-mode #cronus-queue .cronus-job-meta, body.cronus-mode #cronus-queue .cronus-detail-toggle, body.cronus-mode #cronus-queue .cronus-detail { display:none; }
body.cronus-mode .cronus-status-pills { grid-area:summary; display:grid; grid-template-columns:repeat(6,1fr); gap:10px; }
body.cronus-mode .cronus-summary-pill { display:flex; align-items:center; min-height:40px; padding:0 12px; border:1px solid var(--c-border,#252b38); border-radius:10px; background:var(--c-surface-1,#11151d); font:600 12px/1 var(--f-sans,ui-sans-serif); color:var(--c-text-2,#b3bdcf); }
body.cronus-mode .cronus-summary-pill::before { content:""; width:7px; height:7px; border-radius:50%; margin-right:8px; background:currentColor; }
body.cronus-mode .cronus-summary-pill.running { color:#2ee6d6; } body.cronus-mode .cronus-summary-pill.waiting { color:#76a9ff; } body.cronus-mode .cronus-summary-pill.paused { color:#e0a63f; } body.cronus-mode .cronus-summary-pill.finished { color:#40d98a; } body.cronus-mode .cronus-summary-pill.attention { color:#ff6680; } body.cronus-mode .cronus-summary-pill.cancelled { color:#98a2b4; }
body.cronus-mode .cronus-field select, body.cronus-mode .cronus-field input, body.cronus-mode .cronus-dispatch select { border:1px solid var(--c-border-strong,#39445a); border-radius:9px; background:var(--c-surface-1,#11151d); color:var(--c-text,#e8edf5); min-height:38px; padding:0 10px; }
body.cronus-mode .cronus-submit { background:linear-gradient(135deg,#b6a0ff,#8e79ef); color:#160d2f; border:0; }
@media (max-width: 899px) {
  body.cronus-mode .cronus-stage:not(.hidden) { display:block !important; padding:10px 12px 74px; }
  body.cronus-mode .cronus-portal-head { display:flex; }
  body.cronus-mode #cronus-jobs, body.cronus-mode #cronus-queue { margin:0 0 14px; }
  body.cronus-mode .cronus-status-pills { grid-template-columns:repeat(2,1fr); margin-top:8px; }
  body.cronus-mode .cronus-jobs-list { max-height:none; }
  body.cronus-mode .cronus-live-header, body.cronus-mode .cronus-usage-chip { display:none; }
  body.cronus-mode::after { content:"⌂  Zeus     ◉  Cronus     ◇  Models     ☰  More"; position:fixed; z-index:20; left:0; right:0; bottom:0; min-height:54px; display:flex; align-items:center; justify-content:center; background:#11151d; border-top:1px solid #252b38; color:#b8c0d2; font:600 11px/1 var(--f-sans,ui-sans-serif); letter-spacing:.04em; }
}

html.theme-light {
  --bg: #eef2f6;
  --bg-glow: #d9e6f4;
  --panel: #ffffff;
  --border: #c9d4e1;
  --text: #172033;
  --muted: #5a6b80;
  --accent: #1d6fc4;
  --accent-dim: #3d7ab8;
  --user: #e6f3ea;
  --agent: #f7f9fc;
  --tool: #eef5ea;
  --thought: #f3f0f8;
  --error: #c43b3b;
  --ok: #1f8a58;
  --input: #ffffff;
  --btn: #e8eef5;
  --btn-hover: #d9e3ee;
  --chrome: rgba(248, 250, 252, 0.94);
  --menu: #ffffff;
  --picker: #f3f6fa;
  --chip: #ffffff;
  --shadow: rgba(23, 32, 51, 0.14);
  --work: #1a9e3f;
  --radius: 12px;
  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  color-scheme: light;
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  font-family: var(--font);
  background: radial-gradient(1200px 600px at 20% -10%, var(--bg-glow) 0%, var(--bg) 55%);
  color: var(--text);
}

#app { height: 100%; min-height: 0; display: flex; flex-direction: column; }

.hidden { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: 0.8rem; }
.error { color: var(--error); margin-top: 0.75rem; }
code { font-family: var(--mono); font-size: 0.85em; color: var(--accent); }

/* Gate */
.gate {
  min-height: 100%;
  display: grid;
  place-items: center;
  padding: 1.5rem;
}
.gate-card {
  width: min(440px, 100%);
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) + 4px);
  padding: 1.5rem;
  box-shadow: 0 20px 60px rgba(0,0,0,.35);
}
.gate-card h1 { margin: 0 0 0.5rem; font-size: 1.5rem; }
.gate-card p { line-height: 1.45; }
.field { display: flex; flex-direction: column; gap: 0.35rem; margin: 1rem 0; }
.field span { font-size: 0.85rem; color: var(--muted); }
input, textarea, button {
  font: inherit;
  color: var(--text);
  background: var(--input);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.7rem 0.85rem;
}
input:focus, textarea:focus { outline: 2px solid var(--accent-dim); border-color: var(--accent-dim); }
button {
  cursor: pointer;
  background: var(--btn);
  transition: background .15s, border-color .15s;
}
button:hover { background: var(--btn-hover); }
button.primary {
  background: linear-gradient(180deg, #3d8fd6, #2a6eae);
  border-color: #4a9be0;
  font-weight: 600;
  width: 100%;
}
button.primary:hover { filter: brightness(1.06); }
button:disabled { opacity: 0.5; cursor: not-allowed; }

/* Cronus front desk */
.cronus-mode #messages, .cronus-mode footer.composer { display: none; }
.cronus-stage { flex: 1 1 auto; overflow: auto; padding: clamp(.75rem, 2vw, 1.5rem); }
.cronus-card { width: min(760px, 100%); margin: 0 auto; background: var(--panel); border: 1px solid var(--border); border-radius: 18px; padding: clamp(.85rem, 2vw, 1.25rem); box-shadow: 0 18px 50px var(--shadow); }
.cronus-heading { display: flex; justify-content: space-between; gap: 1rem; align-items: flex-start; }
.cronus-heading h1 { margin: 0 0 .3rem; }
.cronus-heading p { margin: 0 0 .75rem; }
.cronus-label { display: block; color: var(--muted); font-size: .82rem; margin-bottom: .35rem; }
#cronus-prompt { width: 100%; resize: vertical; min-height: 5.5rem; }
.cronus-controls { display: flex; flex-wrap: wrap; gap: .65rem; align-items: end; margin: .7rem 0; }
.cronus-group { flex: 1 1 100%; }
.cronus-chips { display: flex; gap: .45rem; }
.cronus-chip { padding: .35rem .65rem; }
.cronus-chip.is-on { border-color: var(--accent); color: var(--accent); background: var(--btn-hover); }
.cronus-field { display: flex; flex-direction: column; gap: .25rem; color: var(--muted); font-size: .82rem; }
.cronus-field select { min-width: 8.5rem; }
.cronus-submit { margin-top: .1rem; }
.cronus-status { min-height: 1.25rem; margin-top: .8rem; font-family: var(--mono); font-size: .78rem; overflow-wrap: anywhere; }
.cronus-status.ok { color: var(--ok); }
.cronus-status.bad { color: var(--error); }
.cronus-result { margin-top: 1rem; border-top: 1px solid var(--border); padding-top: 1rem; }
.cronus-result img { display: block; width: min(512px, 100%); height: auto; margin: 0 auto; border-radius: 10px; border: 1px solid var(--border); }
.cronus-result pre { white-space: pre-wrap; overflow-wrap: anywhere; font: .82rem/1.45 var(--mono); background: var(--input); border-radius: 10px; padding: 1rem; }
.cronus-hint { margin: .35rem 0 0; font-size: .75rem; }
.cronus-dispatch { margin-top: 1rem; border-top: 1px solid var(--border); padding-top: .75rem; }
.cronus-image-opts { margin: -.2rem 0 .7rem; }
.cronus-image-opts summary { cursor: pointer; color: var(--muted); font-size: .82rem; }
.cronus-image-opts[open] summary { margin-bottom: .45rem; }
.cronus-image-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(6.5rem, 1fr)); gap: .45rem .6rem; }
.cronus-image-opts input[type="number"], .cronus-image-opts input[type="text"] { padding: .35rem .5rem; font-size: .82rem; width: 100%; min-width: 0; }
.cronus-image-opts input:disabled { opacity: .5; }
.cronus-image-wide { margin-top: .45rem; }
.cronus-image-wide input[type="file"] { font-size: .75rem; padding: .3rem .4rem; }
.cronus-dispatch summary { cursor: pointer; color: var(--muted); font-size: .82rem; }
.cronus-dispatch[open] summary { color: inherit; margin-bottom: .35rem; }
.cronus-drop { border: 1px dashed var(--border); border-radius: 8px; padding: .45rem; color: var(--muted); font-size: .75rem; text-align: center; }
.cronus-drop:focus-visible, .cronus-detail-toggle:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.cronus-attachments { margin: .5rem 0; padding-left: 1.2rem; font: .72rem var(--mono); }
.cronus-detail-toggle { margin-top: .45rem; padding: .2rem .55rem; font-size: .7rem; }
.cronus-detail { margin-top: .55rem; border-top: 1px solid var(--border); padding-top: .55rem; font-size: .72rem; }
.cronus-detail p { margin: .2rem 0; overflow-wrap: anywhere; }
.cronus-detail pre { max-height: 18rem; overflow: auto; white-space: pre-wrap; overflow-wrap: anywhere; background: var(--input); padding: .55rem; border-radius: 7px; font: .7rem/1.4 var(--mono); }
/* Live job sidebar. Wide screens: left gutter of a 3-column grid whose middle
   column is exactly the old card width, so the card keeps its size and centre.
   Narrow screens: stacks under the card. */
.cronus-jobs { width: min(760px, 100%); margin: 1.25rem auto 0; font-size: .8rem; }
.cronus-jobs-head { display: flex; align-items: baseline; justify-content: space-between; gap: .5rem; margin-bottom: .5rem; }
.cronus-jobs-head h2 { margin: 0; font-size: .95rem; }
.cronus-jobs-meta { font-family: var(--mono); font-size: .7rem; }
.cronus-jobs-meta.bad { color: var(--error); }
.cronus-jobs-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .45rem; }
.cronus-jobs-empty { margin: .25rem 0 .6rem; padding: .7rem; border: 1px dashed var(--border); border-radius: 10px; text-align: center; }
.cronus-jobs-list .cronus-jobs-sep { margin-top: .5rem; color: var(--muted); font-size: .68rem; text-transform: uppercase; letter-spacing: .08em; }
.cronus-job { --job: var(--muted); background: var(--panel); border: 1px solid var(--border); border-left: 3px solid var(--job); border-radius: 10px; padding: .5rem .6rem; }
.cronus-job.is-queued { --job: #e0b85a; }
.cronus-job.is-running { --job: var(--accent); }
.cronus-job.is-done { --job: var(--ok); opacity: .82; }
.cronus-job.is-error { --job: var(--error); }
.cronus-job.is-cancelled { opacity: .6; }
.cronus-job-top { display: flex; align-items: center; gap: .4rem; }
.cronus-job-badge { color: var(--job); border: 1px solid var(--job); border-radius: 999px; padding: .05rem .45rem; font-size: .66rem; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.cronus-job.is-running .cronus-job-badge::before { content: ""; display: inline-block; width: .45rem; height: .45rem; margin-right: .3rem; border-radius: 50%; background: var(--job); animation: cronus-pulse 1.1s ease-in-out infinite; }
.cronus-job-lane { color: var(--muted); font-size: .7rem; }
.cronus-job-age { margin-left: auto; color: var(--muted); font-size: .68rem; white-space: nowrap; }
.cronus-job-snip { margin-top: .3rem; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow-wrap: anywhere; }
.cronus-job-model { margin-top: .2rem; font-family: var(--mono); font-size: .7rem; color: var(--job); overflow-wrap: anywhere; }
.cronus-job-meta { margin-top: .15rem; font-family: var(--mono); font-size: .64rem; color: var(--muted); overflow-wrap: anywhere; }
.cronus-job-progress { margin-top: .2rem; font-family: var(--mono); font-size: .66rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cronus-job-error { margin-top: .3rem; font-family: var(--mono); font-size: .68rem; color: var(--error); overflow: hidden; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow-wrap: anywhere; }
.cronus-job.is-new, .cronus-job.is-changed { animation: cronus-flash 1.4s ease-out; }
@keyframes cronus-pulse { 50% { opacity: .25; } }
@keyframes cronus-flash { from { box-shadow: 0 0 0 2px var(--job); } to { box-shadow: 0 0 0 0 transparent; } }
.cronus-job.is-paused { --job: #9aa4b2; }
/* Right Queue sidebar: waiting tickets in gate order, with manage controls. */
.cronus-queue .cronus-job-top { gap: .35rem; flex-wrap: wrap; row-gap: .15rem; }
.cronus-queue-pos { font-family: var(--mono); font-size: .66rem; color: var(--muted); min-width: 1.4rem; }
.cronus-queue-grip { cursor: grab; color: var(--muted); user-select: none; font-size: .9rem; line-height: 1; padding: 0 .1rem; }
.cronus-queue .cronus-job.is-dragging { opacity: .45; border-style: dashed; }
.cronus-queue .cronus-job[draggable="true"] { cursor: grab; }
.cronus-queue-actions { display: flex; gap: .3rem; margin-top: .4rem; flex-wrap: wrap; }
.cronus-queue-actions button { padding: .15rem .5rem; font-size: .68rem; border-radius: 7px; }
.cronus-queue-actions .cronus-queue-del { margin-left: auto; color: var(--error); }
.cronus-queue-actions button:disabled { opacity: .45; }
.cronus-queue-note { font-size: .66rem; margin: .5rem 0 0; }
/* Left rail rows open the live overlay. */
#cronus-jobs .cronus-job:not(.cronus-jobs-sep) { cursor: pointer; }
#cronus-jobs .cronus-job:hover { border-color: var(--job); }
#cronus-jobs .cronus-job:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
/* Live job overlay. */
.cronus-live { position: fixed; inset: 0; z-index: 60; display: flex; align-items: flex-start; justify-content: center; padding: clamp(.75rem, 6vh, 4rem) .75rem; background: rgba(0, 0, 0, .45); overflow-y: auto; }
.cronus-live.hidden { display: none; }
.cronus-live-card { --job: var(--muted); width: min(640px, 100%); background: var(--panel); border: 1px solid var(--border); border-top: 3px solid var(--job); border-radius: 14px; padding: .9rem 1rem; box-shadow: 0 18px 50px var(--shadow); font-size: .85rem; }
.cronus-live-card.is-running { --job: var(--accent); }
.cronus-live-card.is-done { --job: var(--ok); }
.cronus-live-card.is-error { --job: var(--error); }
.cronus-live-card.is-queued { --job: #e0b85a; }
.cronus-live-card.is-paused { --job: #9aa4b2; }
.cronus-live-card.is-running .cronus-job-badge::before { content: ""; display: inline-block; width: .45rem; height: .45rem; margin-right: .3rem; border-radius: 50%; background: var(--job); animation: cronus-pulse 1.1s ease-in-out infinite; }
.cronus-live-head { display: flex; align-items: center; gap: .5rem; }
.cronus-live-head h2 { margin: 0; font-size: 1rem; flex: 1 1 auto; }
.cronus-live-close { padding: .1rem .55rem; font-size: 1.1rem; line-height: 1; }
.cronus-live-ask { margin: .6rem 0; max-height: 7.5rem; overflow: auto; white-space: pre-wrap; overflow-wrap: anywhere; }
.cronus-live-progress { border: 1px solid var(--border); border-radius: 10px; padding: .55rem .65rem; }
.cronus-live-step { font-weight: 600; }
.cronus-live-bar { height: 4px; margin: .45rem 0 .35rem; background: var(--input); border-radius: 99px; overflow: hidden; }
.cronus-live-bar span { display: block; height: 100%; width: 0; background: var(--job); transition: width .4s ease; }
.cronus-live-bar.is-unknown span { width: 30%; animation: cronus-slide 1.4s ease-in-out infinite; }
@keyframes cronus-slide { from { transform: translateX(-100%); } to { transform: translateX(340%); } }
.cronus-live-times { font-size: .72rem; }
.cronus-live-answer { margin-top: .6rem; }
.cronus-live-answer summary { cursor: pointer; color: var(--muted); font-size: .78rem; }
.cronus-live-answer pre { max-height: 16rem; overflow: auto; white-space: pre-wrap; overflow-wrap: anywhere; background: var(--input); padding: .6rem; border-radius: 8px; font: .75rem/1.45 var(--mono); }
.cronus-live-actions { display: flex; align-items: center; gap: .6rem; margin-top: .6rem; flex-wrap: wrap; }
.cronus-live-actions:empty { display: none; }
.cronus-live-stop { color: var(--error); border-color: var(--error); padding: .25rem .7rem; }
.cronus-live-follow { margin-top: .75rem; border-top: 1px solid var(--border); padding-top: .6rem; }
.cronus-live-follow textarea { width: 100%; resize: vertical; min-height: 3rem; }
.cronus-live-follow-row { display: flex; align-items: center; gap: .6rem; margin-top: .4rem; flex-wrap: wrap; }
.cronus-live-follow-row button.primary { width: auto; padding: .35rem .9rem; }
#cronus-live-follow-note.bad, #cronus-live-action-note.bad { color: var(--error); }
#cronus-live-follow-note.ok, #cronus-live-action-note.ok { color: var(--ok); }
.cronus-live-card .cronus-job-meta { margin-top: .6rem; }
@media (min-width: 1240px) {
  .cronus-stage:not(.hidden) { display: grid; grid-template-columns: minmax(0, 1fr) min(760px, 100%) minmax(0, 1fr); column-gap: 1rem; align-items: start; padding-inline: 1rem; }
  .cronus-card { grid-column: 2; grid-row: 1; }
  .cronus-jobs { grid-column: 1; grid-row: 1; justify-self: end; width: 100%; max-width: 340px; margin: 0; padding-right: .3rem; position: sticky; top: 0; max-height: calc(100dvh - 8rem); overflow-y: auto; }
  .cronus-jobs.cronus-queue { grid-column: 3; justify-self: start; padding-right: 0; padding-left: .3rem; }
}
@media (prefers-reduced-motion: reduce) { .cronus-job, .cronus-job-badge::before, .cronus-live-bar span { animation: none !important; transition: none !important; } }

/* Chat layout */
.chat {
  height: 100%;
  min-height: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  grid-template-areas:
    "top"
    "main"
    "composer";
}
.chat > .topbar { grid-area: top; }
.chat > .messages { grid-area: main; min-height: 0; }
.chat > .plato-gb-stage { grid-area: main; min-height: 0; }
.chat > .voice-stage { grid-area: composer; }
.chat > .composer { grid-area: composer; }
.topbar {
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.65rem 1rem;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border);
  background: var(--chrome);
  backdrop-filter: blur(8px);
}
.brand { display: flex; flex-direction: column; gap: 0.15rem; }
.status { font-size: 0.8rem; color: var(--muted); transition: color .15s; }
.status.ok { color: var(--ok); }
.status.bad { color: var(--error); }
.status.working {
  color: var(--work);
  font-weight: 600;
  letter-spacing: 0.02em;
  animation: status-pulse 1.2s ease-in-out infinite;
}
@keyframes status-pulse {
  0%, 100% { opacity: 1; text-shadow: 0 0 0 transparent; }
  50% { opacity: 0.85; text-shadow: 0 0 10px rgba(57, 255, 20, 0.55); }
}
.topbar-actions { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; justify-content: flex-end; }
.topbar-actions button { padding: 0.4rem 0.7rem; font-size: 0.85rem; }

/* Indeterminate work bar (bounces while agent is working) */
.work-bar {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 4px;
  pointer-events: none;
  opacity: 0;
  transition: opacity .2s ease;
  z-index: 2;
}
.work-bar.active {
  opacity: 1;
}
.work-bar-track {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: rgba(57, 255, 20, 0.1);
}
.work-bar-thumb {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 160px;
  border-radius: 2px;
  background: linear-gradient(
    90deg,
    rgba(57, 255, 20, 0) 0%,
    #39ff14 22%,
    #b8ff7a 50%,
    #39ff14 78%,
    rgba(57, 255, 20, 0) 100%
  );
  box-shadow:
    0 0 10px rgba(57, 255, 20, 0.9),
    0 0 22px rgba(57, 255, 20, 0.5);
  animation: work-bounce 1.15s cubic-bezier(0.45, 0.05, 0.55, 0.95) infinite alternate;
  will-change: left;
}
.work-bar.active .work-bar-thumb {
  animation-play-state: running;
}
.work-bar:not(.active) .work-bar-thumb {
  animation-play-state: paused;
}
@keyframes work-bounce {
  from { left: 0; }
  to { left: calc(100% - 160px); }
}
@media (max-width: 480px) {
  .work-bar-thumb { width: 96px; }
  @keyframes work-bounce {
    from { left: 0; }
    to { left: calc(100% - 96px); }
  }
}

/* Final cascade for the owner Cronus portal refresh. */
.cronus-mode #cronus-stage{background:radial-gradient(circle at 12% 0,#2b1b6640,transparent 32rem)}
.cronus-stage{width:min(1180px,100%);margin:auto;padding:clamp(1rem,3vw,2rem);overflow:auto}
.cronus-portal-head{display:flex;justify-content:space-between;align-items:flex-start;gap:1rem;margin-bottom:1rem}.cronus-portal-head h1{margin:0;font-size:clamp(1.6rem,3vw,2.35rem)}.eyebrow{color:#f2c46d;font:700 .68rem/1.2 var(--mono);letter-spacing:.16em;margin:0 0 .35rem}.cronus-head-actions{display:flex;gap:.5rem;align-items:center;flex-wrap:wrap}.cronus-head-actions button,.cronus-tabs button{border:1px solid var(--border);background:var(--panel);color:var(--muted);border-radius:8px;padding:.42rem .65rem}.cronus-usage-chip{border:1px solid #6f5e2a;color:#f2c46d;background:#211c0c;border-radius:999px;padding:.38rem .7rem;font-size:.72rem}.cronus-system-status{display:flex;align-items:center;gap:.55rem;border:1px solid #2a5f4a;background:#10251b;color:#8ce0ae;border-radius:10px;padding:.6rem .75rem;margin-bottom:.85rem;font-size:.78rem}.cronus-system-status .muted{margin-left:auto}.cronus-system-status.is-warn{border-color:#765921;background:#261d0d;color:#f2c46d}.cronus-system-status.is-bad{border-color:#7d3844;background:#28131a;color:#ff9da8}.status-dot{width:.55rem;height:.55rem;border-radius:50%;background:currentColor}.cronus-compose-card{width:100%;margin:0;padding:clamp(.8rem,2vw,1.2rem)}.cronus-heading{margin-bottom:.2rem}.cronus-heading h2{font-size:1.25rem;margin:0}.cronus-model-strip{display:grid;grid-template-columns:minmax(190px,260px) 1fr;align-items:end;gap:.75rem;margin:.2rem 0 .8rem}.cronus-model-note{border:1px solid var(--border);border-radius:8px;padding:.63rem .72rem;color:var(--muted);font-size:.74rem;min-height:2.5rem}.cronus-advanced{border-top:1px solid var(--border);padding-top:.65rem;margin-top:.3rem}.cronus-advanced summary{cursor:pointer;color:#f2c46d;font-size:.8rem}.cronus-advanced-grid{display:flex;flex-wrap:wrap;gap:.65rem;margin-top:.7rem}.cronus-advanced-grid .cronus-field{min-width:130px;flex:1}.cronus-check{color:var(--muted);font-size:.78rem;display:flex;align-items:center;gap:.35rem}.cronus-section-title{display:flex;justify-content:space-between;align-items:center;gap:1rem;margin:1.25rem 0 .5rem}.cronus-section-title h2{margin:0;font-size:1.1rem}.cronus-tabs{display:flex;gap:.35rem}.cronus-tabs button.is-on{color:#f2c46d;border-color:#80682c;background:#251d0c}.cronus-jobs{width:100%;margin:.45rem 0 0}.cronus-queue{width:100%;margin-top:.65rem}.cronus-jobs-list{display:grid;grid-template-columns:repeat(auto-fit,minmax(240px,1fr));gap:.55rem}.cronus-job{min-width:0}.cronus-job-snip{font-size:.78rem}.cronus-admin{width:100%;margin-top:1rem}.cronus-admin[hidden]{display:none}.cronus-admin-users{display:grid;gap:.45rem}.cronus-admin-row{display:grid;grid-template-columns:1.2fr 1fr 1fr;gap:.6rem;padding:.6rem .7rem;border:1px solid var(--border);border-radius:8px;font-size:.75rem}.cronus-admin-row span{color:var(--muted)}
@media(max-width:800px){.cronus-stage{padding:1rem .75rem 5rem}.cronus-portal-head{display:block}.cronus-head-actions{margin-top:.8rem}.cronus-system-status .muted{display:none}.cronus-model-strip{grid-template-columns:1fr}.cronus-section-title{align-items:flex-start;flex-direction:column}.cronus-tabs{width:100%}.cronus-tabs button{flex:1}.cronus-jobs-list{display:flex;flex-direction:column}.cronus-admin-row{grid-template-columns:1fr;gap:.1rem}}
@media (prefers-reduced-motion: reduce) {
  .status.working { animation: none; }
  .work-bar-thumb {
    left: 0 !important;
    width: 100%;
    animation: work-pulse-static 1.4s ease-in-out infinite;
  }
  @keyframes work-pulse-static {
    0%, 100% { opacity: 0.45; }
    50% { opacity: 1; }
  }
}

/* Session picker */
.session-picker { position: relative; }
#session-picker-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  max-width: min(280px, 42vw);
  padding: 0.4rem 0.65rem;
  background: var(--picker);
  border-color: var(--border);
}
#session-picker-btn:hover { border-color: var(--accent-dim); }
.session-title {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text);
}
.session-id-short {
  font-family: var(--mono);
  font-size: 0.72rem;
  flex: 0 0 auto;
}
.session-chevron { color: var(--muted); font-size: 0.75rem; }
.session-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  width: min(340px, 92vw);
  max-height: min(420px, 70vh);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  background: var(--menu);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 16px 40px var(--shadow);
  z-index: 40;
}
.session-menu.hidden { display: none; }
.session-menu-item {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.15rem;
  width: 100%;
  text-align: left;
  border: 0;
  border-radius: 0;
  background: transparent;
  padding: 0.55rem 0.85rem;
  font-size: 0.85rem;
}
.session-menu-item:hover { background: rgba(108, 182, 255, 0.08); }
.session-menu-item.active {
  background: rgba(108, 182, 255, 0.12);
  box-shadow: inset 3px 0 0 var(--accent);
}
.session-menu-item.primary-item {
  font-weight: 600;
  color: var(--accent);
}
.session-menu-sep {
  height: 1px;
  background: var(--border);
  margin: 0.15rem 0;
}
.session-list {
  overflow-y: auto;
  max-height: 340px;
}
.session-item-title {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text);
}
.session-item-meta {
  font-family: var(--mono);
  font-size: 0.72rem;
}
.session-menu-empty { padding: 0.75rem 0.85rem; }

/* Post-login session chooser (bare /) */
.chooser {
  min-height: 100%;
  display: grid;
  place-items: center;
  padding: 1.5rem;
}
.chooser.hidden { display: none !important; }
.chooser-card {
  width: min(440px, 100%);
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) + 4px);
  padding: 1.35rem 1.4rem 1.1rem;
  box-shadow: 0 20px 60px rgba(0,0,0,.35);
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  max-height: min(88vh, 720px);
}
.chooser-brand {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
}
.chooser-topnav {
  display: flex;
  align-items: center;
  gap: 0.15rem;
  padding: 0.22rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--chip);
  overflow-x: auto;
  scrollbar-width: none;
}
.chooser-topnav::-webkit-scrollbar { display: none; }
.chooser-nav-status {
  margin: -0.3rem 0 0;
  padding-left: 0.35rem;
  font: 0.68rem/1.2 var(--mono);
  letter-spacing: 0.03em;
}
.chooser-nav-btn {
  appearance: none;
  flex: 0 0 auto;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 0.76rem;
  padding: 0.27rem 0.45rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  text-decoration: none;
  white-space: nowrap;
}
.chooser-nav-btn:hover { color: var(--text); background: var(--btn-hover); }
.chooser-nav-btn.is-on { color: #fff; background: var(--accent-dim); }
.chooser-nav-models {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  color: var(--muted);
  font-size: 0.76rem;
  white-space: nowrap;
}
.chooser-nav-models select {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--muted);
  font: inherit;
  cursor: pointer;
  padding: 0.27rem 0.15rem;
}
.chooser-nav-models .nav-i { flex: 0 0 auto; }
.chooser-nav-models select:hover { color: var(--text); }
.chooser-nav-board { color: var(--muted); }
.chooser-card h1 {
  margin: 0.15rem 0 0;
  font-size: 1.45rem;
}
.chooser-lead {
  margin: 0 0 0.35rem;
  line-height: 1.45;
  font-size: 0.92rem;
}
.chooser-lead code {
  font-size: 0.82em;
}
.chooser #chooser-new {
  width: 100%;
  margin: 0.25rem 0 0.15rem;
}
.chooser-actions {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  margin: 0.25rem 0 0.15rem;
}
.chooser-actions #chooser-new,
.chooser-actions #chooser-desk,
.chooser-actions #chooser-board {
  width: 100%;
  margin: 0;
}
#chooser-desk {
  border: 1px solid var(--border);
  background: var(--btn);
  color: var(--text);
  border-radius: 10px;
  padding: 0.65rem 0.9rem;
  font: inherit;
  cursor: pointer;
}
#chooser-desk:hover { background: var(--btn-hover); }
#chooser-board {
  box-sizing: border-box;
  display: block;
  text-align: center;
  text-decoration: none;
  border: 1px solid var(--border);
  background: var(--btn);
  color: var(--text);
  border-radius: 10px;
  padding: 0.65rem 0.9rem;
  font: inherit;
  cursor: pointer;
}
#chooser-board:hover { background: var(--btn-hover); }
/* Landing: Zeus + Cronus share the primary row; desks/board in one row; models collapse to a select. */
.chooser-primary-row,
.chooser-secondary-row {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  gap: 0.45rem;
}
.chooser-primary-row > *,
.chooser-secondary-row > * {
  width: 100%;
  min-width: 0;
  margin: 0;
  box-sizing: border-box;
}
.chooser #chooser-new,
.chooser #chooser-cronus {
  width: 100%;
  margin: 0;
}
.chooser-secondary-row > * {
  border: 1px solid var(--border);
  background: var(--btn);
  color: var(--text);
  border-radius: 10px;
  padding: 0.65rem 0.6rem;
  font: inherit;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: pointer;
}
.chooser-secondary-row > *:hover { background: var(--btn-hover); }
.chooser-models {
  appearance: none;
  width: 100%;
  border: 1px solid var(--border);
  background: var(--btn);
  color: var(--text);
  border-radius: 10px;
  padding: 0.6rem 0.9rem;
  font: inherit;
  cursor: pointer;
}
.chooser-models:hover { background: var(--btn-hover); }
.chooser-launchers {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}
.chooser-pwa { margin: 0.65rem 0 0; line-height: 1.4; }
.peer-dropdown,
.chooser-dropdown {
  display: none;
  appearance: none;
  border: 1px solid var(--border);
  background: var(--btn);
  color: var(--text);
  border-radius: 10px;
  padding: 0.4rem 0.6rem;
  font: inherit;
  cursor: pointer;
}
.chooser-dropdown {
  width: 100%;
  margin: 0.25rem 0 0.15rem;
}
.peer-dropdown:hover,
.chooser-dropdown:hover { background: var(--btn-hover); }
.peer-switch {
  display: inline-flex;
  align-items: center;
  gap: 0;
  max-width: 100%;
  border: 1px solid var(--border);
  border-radius: 999px;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
  background: var(--chip);
}
.peer-switch::-webkit-scrollbar { display: none; }
body.desk-mode .session-picker,
body.desk-mode #new-session-btn,
body.bridge-mode .session-picker,
body.bridge-mode #new-session-btn,
body.platogb-mode .session-picker,
body.platogb-mode #new-session-btn {
  display: none !important;
}
body.bridge-mode .composer,
body.bridge-mode .work-bar,
body.platogb-mode .composer,
body.platogb-mode .work-bar,
body.platogb-mode .messages {
  display: none !important;
}
.plato-gb-stage {
  display: none;
  flex-direction: column;
  min-height: 0;
  background: #0b0f14;
  overflow: hidden;
}
body.platogb-mode .plato-gb-stage {
  display: flex !important;
}
.plato-gb-banner {
  flex: 0 0 auto;
  padding: 0.35rem 0.75rem;
  font-size: 0.75rem;
  color: var(--muted);
  border-bottom: 1px solid var(--border);
  background: var(--chrome);
}
.plato-gb-banner.is-live { color: var(--ok); }
.plato-gb-banner.is-idle { color: var(--muted); }
.plato-gb-banner.is-down { color: var(--error); }
.plato-gb-log {
  flex: 0 1 28%;
  min-height: 5rem;
  max-height: 28vh;
  overflow: auto;
  padding: 0.65rem 0.85rem 0.4rem;
  border-bottom: 1px solid var(--border);
}
.plato-gb-turn {
  margin: 0 0 0.85rem;
}
.plato-gb-turn-role {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.2rem;
}
.plato-gb-turn.is-user .plato-gb-turn-role { color: #8fcea8; }
.plato-gb-turn.is-assistant .plato-gb-turn-role { color: #6cb6ff; }
.plato-gb-turn-body {
  margin: 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font: 0.88rem/1.4 var(--sans, ui-sans-serif, system-ui, sans-serif);
  color: var(--text);
}
.plato-gb-term {
  flex: 1 1 72%;
  min-height: 24rem;
  max-height: none;
  overflow: auto;
  padding: 0.4rem;
}
.plato-gb-term .xterm {
  width: max-content;
  height: auto;
}
.plato-gb-term .xterm-viewport,
.plato-gb-term .xterm-screen {
  overflow: hidden;
}
.plato-gb-term:has(.xterm) .plato-gb-fallback {
  display: none;
}
.plato-gb-fallback {
  margin: 0;
  font: 12px/1.2 var(--mono);
  color: var(--text);
  white-space: pre;
  overflow: auto;
  height: 100%;
}
.peer-label-short { display: none; }
@media (max-width: 720px) {
  .peer-label-full { display: none; }
  .peer-label-short { display: inline; }
  .peer-btn { padding: 0.22rem 0.42rem; }
  .peer-switch { display: none; }
  .peer-dropdown {
    display: block;
    flex: 1 1 auto;
    min-width: 0;
    max-width: 100%;
    font-size: 0.82rem;
    padding: 0.32rem 0.4rem;
  }
  .chooser-launchers .chooser-actions,
  .chooser-launchers .chooser-section-label {
    display: none;
  }
  .chooser-dropdown { display: block; }
}
body.bridge-mode .messages .msg.bridge .role {
  color: var(--accent);
}
.peer-btn {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 0.78rem;
  padding: 0.22rem 0.55rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  text-decoration: none;
}
a.peer-btn:hover { color: var(--text); }
.peer-btn.is-on {
  background: var(--accent-dim);
  color: #fff;
}
.peer-models-chevron { font-size: 0.7em; opacity: 0.8; }
.peer-models-menu {
  position: fixed;
  z-index: 60;
  display: flex;
  flex-direction: column;
  min-width: 11rem;
  padding: 0.3rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--chrome);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.35);
}
.peer-models-head {
  padding: 0.25rem 0.55rem 0.35rem;
}
.peer-models-sep {
  height: 1px;
  margin: 0.25rem 0.2rem;
  background: var(--border);
}
.peer-models-menu .peer-btn {
  width: 100%;
  justify-content: flex-start;
  border-radius: 7px;
  font-size: 0.85rem;
  padding: 0.38rem 0.6rem;
  color: var(--text);
}
.peer-models-menu .peer-btn:hover,
.peer-models-menu .peer-btn:focus-visible { background: var(--btn-hover); outline: none; }
.peer-models-menu .peer-btn.is-on { background: var(--accent-dim); color: #fff; }
.peer-badge {
  min-width: 1.1rem;
  height: 1.1rem;
  border-radius: 999px;
  background: var(--work);
  color: #062;
  font-size: 0.65rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 0.25rem;
}
.msg.bot .role { color: var(--ok); }
.msg.bridge .role { color: var(--accent); }
.chooser-section-label {
  margin-top: 0.35rem;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  font-size: 0.72rem;
}
.chooser-list {
  overflow-y: auto;
  max-height: min(42vh, 360px);
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #0d1218;
}
.chooser-list .session-menu-item {
  border-bottom: 1px solid rgba(36, 48, 65, 0.65);
}
.chooser-list .session-menu-item:last-child {
  border-bottom: 0;
}
.chooser-list .session-menu-item.last-used .session-item-meta::after {
  content: " · last used";
  color: var(--accent);
}
.chooser-status { min-height: 1.2em; margin: 0.15rem 0 0; }
.chooser-footer {
  display: flex;
  justify-content: flex-end;
  gap: 0.85rem;
  margin-top: 0.15rem;
}
.chooser-linkish {
  background: transparent;
  border: 0;
  color: var(--muted);
  padding: 0.35rem 0.25rem;
  font-size: 0.85rem;
  width: auto;
}
.chooser-linkish:hover {
  color: var(--text);
  background: transparent;
}
/* While chooser is up, keep the shared topbar visible; content below it is hidden. */
body.choosing #chat { display: contents; }

/* Installed PWAs may draw under the status bar/notch. Keep the shared heading
   and its controls inside the safe area on both iOS and Android. */
body.choosing #chat > .topbar {
  padding-top: max(0.75rem, env(safe-area-inset-top));
}

.messages {
  overflow-y: auto;
  overflow-x: hidden;
  padding: 1rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  width: 100%;
  max-width: none;
  min-height: 0;
  scrollbar-gutter: stable;
  scrollbar-width: auto;
  scrollbar-color: #4aa3e8 #101820;
}
.messages::-webkit-scrollbar {
  width: 32px;
}
.messages::-webkit-scrollbar-track {
  background:
    linear-gradient(180deg, rgba(57, 255, 20, 0.06), transparent 18%, transparent 82%, rgba(108, 182, 255, 0.08)),
    #0c1218;
  border-left: 1px solid #1c2836;
  box-shadow: inset 2px 0 0 rgba(57, 255, 20, 0.12);
}
.messages::-webkit-scrollbar-thumb {
  background:
    linear-gradient(180deg, #6ee7a0 0%, #39d98a 28%, #3d8fd6 100%);
  border: 4px solid #0c1218;
  border-radius: 999px;
  box-shadow:
    0 0 10px rgba(57, 255, 20, 0.28),
    inset 0 1px 0 rgba(255, 255, 255, 0.25);
  min-height: 48px;
}
.messages::-webkit-scrollbar-thumb:hover {
  background:
    linear-gradient(180deg, #8ef0b4 0%, #4dff9a 30%, #6cb6ff 100%);
  box-shadow:
    0 0 14px rgba(57, 255, 20, 0.5),
    inset 0 1px 0 rgba(255, 255, 255, 0.35);
}
.messages::-webkit-scrollbar-thumb:active {
  background: linear-gradient(180deg, #39ff14, #6cb6ff);
}
.messages::-webkit-scrollbar-corner {
  background: #0c1218;
}

/* Avatars sit *inside* bubbles: green you-dot (right) · blue G (left) */
.msg-avatar {
  flex: 0 0 auto;
  display: block;
}
.msg-avatar-user {
  width: 9px;
  height: 9px;
  margin-top: 0.45rem;
  border-radius: 50%;
  background: #39ff14;
  box-shadow:
    0 0 0 2px rgba(57, 255, 20, 0.22),
    0 0 10px rgba(57, 255, 20, 0.45);
}
.msg-avatar-agent {
  width: 22px;
  height: 22px;
  margin-top: 0.1rem;
  border-radius: 6px;
  object-fit: cover;
  box-shadow: 0 0 0 1px rgba(108, 182, 255, 0.28);
}
.msg-avatar-agent-sm {
  width: 18px;
  height: 18px;
  margin-top: 0;
  border-radius: 5px;
}

.msg {
  max-width: 100%;
  padding: 0.85rem 1.1rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-word;
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
}
.msg-main {
  flex: 1 1 auto;
  min-width: 0;
}

/* User: right-justified bubble + green dot inside on the right */
.msg.user {
  align-self: flex-end;
  width: fit-content;
  max-width: 100%;
  flex-direction: row;
  align-items: flex-start;
  background: var(--user);
  border-color: #2d5a40;
  box-shadow: 0 0 0 1px rgba(57, 255, 20, 0.12);
}
.msg.user .msg-main {
  text-align: left;
}
.msg.user .role {
  display: none;
}

/* Agent reply: full-width bubble + G logo inside on the left */
.msg.agent {
  align-self: stretch;
  width: 100%;
  max-width: 100%;
  background: var(--agent);
  border-color: #2a3d55;
  box-shadow: 0 0 0 1px rgba(108, 182, 255, 0.08);
  white-space: normal;
}
/* Answer text: capped height + own scrollbar so streaming/TTS doesn't race the reader */
.msg.agent .body {
  max-height: min(42vh, 360px);
  overflow-y: auto;
  overflow-x: auto;
  overscroll-behavior: contain;
  padding-right: 0.25rem;
  white-space: normal;
  word-break: break-word;
  scrollbar-gutter: stable;
  min-width: 0;
}
.msg.agent .body::-webkit-scrollbar { width: 6px; height: 6px; }
.msg.agent .body::-webkit-scrollbar-thumb {
  background: #334;
  border-radius: 4px;
}
.msg.system {
  align-self: center;
  width: auto;
  max-width: min(720px, 100%);
  background: transparent;
  border-style: dashed;
  color: var(--muted);
  font-size: 0.9rem;
}
.msg.tool {
  align-self: stretch;
  width: 100%;
  background: var(--tool);
  font-family: var(--mono);
  font-size: 0.82rem;
  color: #c5d4b8;
}
.msg.thought {
  align-self: stretch;
  width: 100%;
  background: var(--thought);
  color: #b7aed4;
  font-size: 0.85rem;
  opacity: 0.9;
}
.msg .role {
  display: block;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  margin-bottom: 0.35rem;
  font-weight: 600;
}
.msg .body :is(p, ul, ol, pre) { margin: 0.4em 0; }
.msg .body pre {
  background: #0a0e13;
  padding: 0.6rem 0.75rem;
  border-radius: 8px;
  overflow-x: auto;
  max-width: 100%;
  min-width: 0;
  font-family: var(--mono);
  font-size: 0.82rem;
}
.msg .body table {
  display: block;
  width: max-content;
  max-width: 100%;
  overflow-x: auto;
  border-collapse: collapse;
}
.msg .body code { font-family: var(--mono); font-size: 0.88em; }

/* ---- Turn group: full-width stack; each panel/answer has its own in-bubble G ---- */
.turn {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  max-width: 100%;
  width: 100%;
  align-self: stretch;
}
.panel {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--panel);
  overflow: hidden;
  width: 100%;
}
.panel-thought {
  background: var(--thought);
  border-color: #2a2640;
}
.panel-plan {
  background: var(--agent);
  border-color: var(--border);
}
.panel-tools {
  background: var(--tool);
  border-color: #2a3326;
}
.panel-head {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
  margin: 0;
  padding: 0.45rem 0.75rem;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  text-align: left;
  cursor: pointer;
}
.panel-head:hover { background: rgba(255, 255, 255, 0.03); }
.panel-chevron {
  display: inline-block;
  width: 0.9em;
  color: var(--muted);
  font-size: 0.85rem;
}
.panel-title { color: var(--muted); }
.panel-meta {
  margin-left: auto;
  font-family: var(--mono);
  font-size: 0.75rem;
  font-weight: 500;
  text-transform: none;
  letter-spacing: 0;
  color: #7a8a9a;
}
.panel-body {
  padding: 0 0.75rem 0.65rem;
  border-top: 1px solid transparent;
}
.panel.collapsed .panel-body { display: none; }
.panel.collapsed .panel-head { border-bottom: 0; }

/* Thinking: capped height, scrolls inside */
.thought-body {
  max-height: 140px;
  overflow-y: auto;
  color: #b7aed4;
  font-size: 0.85rem;
  line-height: 1.45;
  white-space: pre-wrap;
  word-break: break-word;
  border-top-color: #2a2640;
}

/* Live wait — never a blank Thinking/Response column while Zeus has the turn */
.turn-wait {
  display: flex;
  align-items: flex-start;
  gap: 0.7rem;
  padding: 0.4rem 0 0.2rem;
  color: var(--muted);
  white-space: normal;
}
.turn-wait-pulse {
  flex: 0 0 auto;
  width: 0.72rem;
  height: 0.72rem;
  margin-top: 0.28rem;
  border-radius: 50%;
  background: var(--work);
  box-shadow: 0 0 10px color-mix(in srgb, var(--work) 70%, transparent);
  animation: turn-wait-pulse 1.2s ease-in-out infinite;
}
.turn-wait-copy {
  display: flex;
  flex-direction: column;
  gap: 0.18rem;
  min-width: 0;
  flex: 1 1 auto;
}
.turn-wait-title {
  color: var(--work);
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: 0.01em;
}
.turn-wait-sub {
  font-size: 0.8rem;
  line-height: 1.4;
}
.turn-wait-time {
  font-family: var(--mono);
  font-size: 0.82rem;
  color: #7a8a9a;
  padding-top: 0.18rem;
  font-variant-numeric: tabular-nums;
}
.turn-wait-more {
  margin-top: 1rem;
  padding-top: 0.75rem;
  border-top: 1px dashed var(--border);
}
.panel-thought.is-waiting .panel-title,
.msg.agent.is-waiting .panel-title {
  color: var(--work);
}
@keyframes turn-wait-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.82); }
}
@media (prefers-reduced-motion: reduce) {
  .turn-wait-pulse { animation: none; opacity: 1; }
}

/* Plan: capped list of execution steps */
.plan-body {
  max-height: 160px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  padding-top: 0.35rem;
  border-top: 1px solid #2a3a50;
  font-size: 0.84rem;
  color: #c5d4e8;
}
.panel.collapsed .plan-body { border-top: 0; }
.plan-row {
  display: flex;
  align-items: flex-start;
  gap: 0.45rem;
  padding: 0.3rem 0.45rem;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.18);
  border-left: 3px solid #3a4a60;
}
.plan-row.status-completed,
.plan-row.status-done { border-left-color: var(--ok); opacity: 0.85; }
.plan-row.status-in_progress,
.plan-row.status-in-progress,
.plan-row.status-running { border-left-color: #c9a227; }
.plan-row.status-cancelled,
.plan-row.status-canceled { border-left-color: var(--error); opacity: 0.7; }
.plan-icon {
  flex: 0 0 auto;
  width: 1em;
  text-align: center;
  font-size: 0.75rem;
  line-height: 1.4;
  color: #8aa0b8;
}
.plan-row.status-completed .plan-icon,
.plan-row.status-done .plan-icon { color: var(--ok); }
.plan-row.status-in_progress .plan-icon,
.plan-row.status-in-progress .plan-icon,
.plan-row.status-running .plan-icon { color: #c9a227; }
.plan-text { flex: 1 1 auto; line-height: 1.35; word-break: break-word; }
.plan-priority {
  flex: 0 0 auto;
  font-family: var(--mono);
  font-size: 0.7rem;
  text-transform: uppercase;
}

/* Tools: capped height so the answer never gets pushed off-screen */
.tools-body {
  max-height: 200px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding-top: 0.35rem;
  border-top: 1px solid #2a3326;
  font-family: var(--mono);
  font-size: 0.78rem;
  color: #c5d4b8;
}
.panel.collapsed .tools-body { border-top: 0; }

.tool-row {
  padding: 0.35rem 0.5rem;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.18);
  border-left: 3px solid #4a5a40;
  cursor: pointer;
}
.tool-row:hover { background: rgba(0, 0, 0, 0.28); }
.tool-row:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}
.tool-row.empty { cursor: default; }
.tool-row.empty .tool-chevron { visibility: hidden; }
.tool-row.running { border-left-color: #c9a227; }
.tool-row.bg { border-left-color: #6cb6ff; }
.tool-row.bg .tool-status { color: #6cb6ff; }
.tool-row.ok { border-left-color: var(--ok); }
.tool-row.fail { border-left-color: var(--error); }
.msg.agent .turn-usage {
  margin-top: 0.45rem;
  font-family: var(--mono);
  font-size: 0.72rem;
}
.tool-row-main {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  min-width: 0;
}
.tool-chevron {
  flex: 0 0 auto;
  font-size: 0.62rem;
  color: var(--muted);
  transition: transform 0.12s ease;
  line-height: 1;
}
.tool-row.open .tool-chevron { transform: rotate(90deg); }
.tool-status {
  font-size: 0.55rem;
  line-height: 1;
  color: #c9a227;
  flex: 0 0 auto;
}
.tool-row.ok .tool-status { color: var(--ok); }
.tool-row.fail .tool-status { color: var(--error); }
.tool-name {
  font-weight: 600;
  color: #dce8d0;
  flex: 0 0 auto;
}
.tool-summary {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 400;
  font-size: 0.72rem;
}
.tool-result { margin-left: auto; font-size: 0.72rem; flex: 0 0 auto; }
.tool-detail {
  display: none;
  margin-top: 0.4rem;
  cursor: text;
}
.tool-row.open .tool-detail { display: block; }
.tool-sec { margin-top: 0.35rem; }
.tool-sec:first-child { margin-top: 0; }
.tool-sec-label {
  font-size: 0.62rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.15rem;
}
.tool-pre {
  margin: 0;
  padding: 0.4rem 0.5rem;
  max-height: 14rem;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-word;
  font-family: var(--mono);
  font-size: 0.72rem;
  line-height: 1.35;
  color: #c5d4b8;
  background: rgba(0, 0, 0, 0.22);
  border-radius: 6px;
  user-select: text;
}
.tools-body:has(.tool-row.open) {
  max-height: min(60vh, 420px);
}
.msg.agent .body strong {
  font-weight: 700;
}

/* Subtle scrollbars inside panels */
.thought-body::-webkit-scrollbar,
.tools-body::-webkit-scrollbar,
.plan-body::-webkit-scrollbar { width: 6px; }
.thought-body::-webkit-scrollbar-thumb,
.tools-body::-webkit-scrollbar-thumb,
.plan-body::-webkit-scrollbar-thumb {
  background: #334;
  border-radius: 4px;
}

.composer {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  padding: 0.75rem 1rem calc(0.75rem + env(safe-area-inset-bottom));
  border-top: 1px solid var(--border);
  background: var(--chrome);
}
.composer.drag-over {
  outline: 2px dashed var(--accent, #39ff14);
  outline-offset: -4px;
  background: rgba(20, 40, 28, 0.95);
}
/* One horizontal row: [ textarea ........ ] [📎] [🎙] [Send]
   Stacked actions used to force a tall column + empty space above the field. */
.composer-main {
  display: flex;
  flex-direction: row;
  align-items: flex-end;
  gap: 0.45rem;
}
.composer textarea {
  flex: 1 1 auto;
  min-width: 0;
  resize: none;
  min-height: 44px;
  max-height: 50vh;
  /* keep visual height close to the icon/send row; JS grows up to 50vh then scrolls */
  line-height: 1.35;
  overflow-y: hidden;
}
.composer-actions {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: center;
  gap: 0.35rem;
  flex: 0 0 auto;
}
.composer .primary {
  width: auto;
  min-width: 4.25rem;
  height: 2.5rem;
  padding: 0 0.9rem;
  border-radius: 10px;
  font-weight: 600;
}
.composer .stop-turn-btn {
  width: auto;
  min-width: 4.25rem;
  height: 2.5rem;
  padding: 0 0.9rem;
  border-radius: 10px;
  font-weight: 700;
  border: 1px solid #7a3030;
  background: #3a1616;
  color: #ffb4b4;
  cursor: pointer;
}
.composer .stop-turn-btn:hover {
  background: #5a1e1e;
  border-color: #c05050;
  color: #fff;
}
.composer .stop-turn-btn:disabled {
  opacity: 0.65;
  cursor: wait;
}
.hidden-file-input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}
.attach-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  background: #1a2030;
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text, #e8eef7);
  font-weight: 600;
  cursor: pointer;
}
.attach-btn:hover { border-color: #4a7cff; color: #9ec0ff; }
.attach-btn:disabled { opacity: 0.45; cursor: not-allowed; }
/* Compact icon-only attach / mic (labels via title + aria-label) */
.composer-actions .icon-btn {
  min-width: 2.5rem;
  width: 2.5rem;
  height: 2.5rem;
  padding: 0;
  border-radius: 10px;
  font-size: 1.1rem;
  line-height: 1;
  flex: 0 0 2.5rem;
}
.composer-actions .icon-btn.mic-btn,
.mic-btn.icon-btn {
  min-width: 3.6rem;
  width: 3.6rem;
  height: 3.6rem;
  flex: 0 0 3.6rem;
  border-radius: 50%;
  font-size: 1.55rem;
}
@media (max-width: 720px) {
  html, body, #app, .chat {
    max-width: 100%;
    overflow-x: hidden;
  }
  .composer-actions .icon-btn.mic-btn,
  .mic-btn.icon-btn {
    min-width: 2.75rem;
    width: 2.75rem;
    height: 2.75rem;
    flex: 0 0 2.75rem;
    font-size: 1.25rem;
  }
  .composer {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
    padding: 0.5rem max(0.7rem, env(safe-area-inset-right)) calc(0.5rem + env(safe-area-inset-bottom)) max(0.7rem, env(safe-area-inset-left));
    gap: 0.35rem;
  }
}
.composer-actions .icon-btn .attach-label,
.composer-actions .icon-btn .mic-label { display: none; }
.attach-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  max-height: 7.5rem;
  overflow: auto;
}
.attach-chips.hidden { display: none; }
.attach-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  max-width: 100%;
  padding: 0.25rem 0.4rem 0.25rem 0.25rem;
  background: #151c28;
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 0.78rem;
}
.attach-chip img {
  width: 40px;
  height: 40px;
  object-fit: cover;
  border-radius: 6px;
  background: #0b0f14;
}
.attach-chip .attach-chip-icon {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 6px;
  background: #1e2838;
  font-size: 1.1rem;
}
.attach-chip .attach-chip-meta {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.05rem;
}
.attach-chip .attach-chip-name {
  max-width: 11rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 600;
}
.attach-chip .attach-chip-size { color: var(--muted); font-size: 0.72rem; }
.attach-chip-remove {
  border: none;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
  padding: 0.15rem 0.25rem;
}
.attach-chip-remove:hover { color: #ff8a8a; }
.msg.user .body .msg-attachments {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.45rem;
}
.msg.user .body .msg-attachments img {
  max-width: min(280px, 70vw);
  max-height: 200px;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,0.08);
  cursor: zoom-in;
}
.msg.user .body .msg-file-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.25rem 0.5rem;
  border-radius: 8px;
  background: rgba(0,0,0,0.25);
  font-size: 0.8rem;
}
.mic-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  background: #15241a;
  border: 1px solid #2a5a38;
  border-radius: 10px;
  color: #9dff6a;
  font-weight: 600;
  user-select: none;
  touch-action: none;
  cursor: pointer;
}
.mic-btn:hover { background: #1a3022; border-color: #39ff14; }
.mic-btn.recording {
  background: linear-gradient(180deg, #1e4a28, #14321c);
  border-color: #39ff14;
  color: #39ff14;
  box-shadow: 0 0 0 1px rgba(57, 255, 20, 0.35), 0 0 16px rgba(57, 255, 20, 0.25);
  animation: mic-pulse 1s ease-in-out infinite;
}
/* Conversation listen (tap-to-talk + silence VAD) — cooler pulse */
.mic-btn.listening {
  background: linear-gradient(180deg, #1a3a4a, #122830);
  border-color: #3ecbff;
  color: #7ae0ff;
  box-shadow: 0 0 0 1px rgba(62, 203, 255, 0.4), 0 0 16px rgba(62, 203, 255, 0.25);
  animation: mic-listen-pulse 1.4s ease-in-out infinite;
}
.talk-btn {
  flex: 0 0 auto;
  width: auto;
  min-width: 3.4rem;
  height: 2.5rem;
  padding: 0 0.75rem;
  border-radius: 10px;
  border: 1px solid #3a6a44;
  background: #15241a;
  color: #9dff6a;
  font: inherit;
  font-weight: 700;
  font-size: 0.9rem;
  cursor: pointer;
}
.talk-btn:hover { background: #1a3022; border-color: #39ff14; }
.talk-btn.hidden { display: none !important; }
.voice-stage {
  display: flex;
  align-items: stretch;
  padding: 0.55rem max(0.7rem, env(safe-area-inset-right)) calc(0.55rem + env(safe-area-inset-bottom)) max(0.7rem, env(safe-area-inset-left));
  border-top: 1px solid var(--border);
  background: var(--panel);
}
.voice-stage.hidden { display: none !important; }
.voice-stage-inner {
  width: 100%;
  text-align: left;
}
.voice-stage-peer {
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}
.voice-stage-state {
  font-size: 1.15rem;
  font-weight: 750;
  line-height: 1.2;
  margin: 0.1rem 0 0.25rem;
}
.voice-stage-hint {
  margin: 0 0 0.55rem;
  font-size: 0.86rem;
  line-height: 1.35;
  max-height: 4.2em;
  overflow: hidden;
}
.voice-stage-actions {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 0.45rem;
}
.voice-ctl {
  min-height: 44px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--btn);
  color: var(--text);
  font: inherit;
  font-weight: 650;
  cursor: pointer;
}
.voice-ctl[aria-pressed="true"] {
  border-color: #e8c56a;
  color: #ffe08a;
  background: #3a2a10;
}
.voice-ctl-end {
  background: #3a1818;
  border-color: #8a3030;
  color: #ffb4b4;
}
body.voice-on .composer { display: none !important; }
@media (max-width: 720px) {
  .voice-stage-state { font-size: 1.05rem; }
  .voice-stage-actions { grid-template-columns: 1fr 1fr; }
  .voice-ctl-end { grid-column: 1 / -1; }
}
.mic-btn:disabled { opacity: 0.45; }
@keyframes mic-pulse {
  0%, 100% { box-shadow: 0 0 0 1px rgba(57, 255, 20, 0.35), 0 0 10px rgba(57, 255, 20, 0.2); }
  50% { box-shadow: 0 0 0 2px rgba(57, 255, 20, 0.55), 0 0 20px rgba(57, 255, 20, 0.4); }
}
@keyframes mic-listen-pulse {
  0%, 100% { box-shadow: 0 0 0 1px rgba(62, 203, 255, 0.35), 0 0 10px rgba(62, 203, 255, 0.2); }
  50% { box-shadow: 0 0 0 2px rgba(62, 203, 255, 0.55), 0 0 22px rgba(62, 203, 255, 0.4); }
}
.composer-voice-opts {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
  min-height: 1.25rem;
}
.voice-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.82rem;
  color: var(--muted);
  cursor: pointer;
  user-select: none;
}
.voice-toggle input { accent-color: #39ff14; width: 0.95rem; height: 0.95rem; }
.voice-picker-label {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.82rem;
}
.tts-voice-select {
  max-width: 14rem;
  padding: 0.2rem 0.4rem;
  font-size: 0.78rem;
  background: var(--panel, #141a22);
  color: var(--text, #e8eef6);
  border: 1px solid var(--border, #2a3544);
  border-radius: 6px;
}
.tts-voice-select:disabled { opacity: 0.55; }
.preview-voice-btn {
  padding: 0.25rem 0.55rem;
  font-size: 0.78rem;
  border-color: #3a4a5a;
}
.stop-speech-btn {
  padding: 0.25rem 0.55rem;
  font-size: 0.78rem;
  border-color: #5a3a3a;
  color: #ffb0b0;
  background: #221818;
}
.voice-status { font-size: 0.78rem; }
.voice-status.err { color: var(--error); }
.voice-status.ok { color: var(--ok); }
.voice-status.busy { color: #39ff14; }

@media (max-width: 720px) {
  .composer-voice-opts {
    gap: 0.4rem;
    min-height: 0;
    flex-wrap: nowrap;
    min-width: 0;
    width: 100%;
    overflow: hidden;
  }
  .composer-voice-opts > .muted.small,
  .composer-voice-opts .voice-picker-label > .muted.small,
  .composer-voice-opts #preview-voice-btn,
  .composer-voice-opts #voice-status.ok {
    display: none;
  }
  .composer-voice-opts .voice-toggle { flex: 0 0 auto; }
  .composer-voice-opts .voice-picker-label {
    flex: 1 1 0;
    min-width: 0;
  }
  .tts-voice-select {
    min-width: 0;
    width: 100%;
    max-width: none;
  }
}
@media (max-width: 560px) {
  .composer-main {
    flex-wrap: wrap;
    align-items: flex-end;
  }
  .composer textarea {
    flex: 1 1 100%;
    order: 1;
    padding: 0.5rem 0.65rem;
  }
  .composer-actions {
    flex: 1 1 100%;
    order: 2;
    justify-content: flex-end;
  }
  .composer .primary { min-width: 4rem; height: 2.25rem; }
  .composer .stop-turn-btn { min-width: 4rem; height: 2.25rem; }
  .talk-btn { height: 2.5rem; min-width: 3.2rem; min-height: 44px; }
  .composer-actions .icon-btn {
    width: 2.5rem;
    flex: 0 0 2.5rem;
  }
}

/* Presence conflict modal */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: grid;
  place-items: center;
  padding: 1.25rem;
  background: rgba(4, 8, 14, 0.72);
  backdrop-filter: blur(4px);
}
.modal-card {
  width: min(440px, 100%);
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) + 4px);
  padding: 1.35rem 1.4rem;
  box-shadow: 0 24px 64px rgba(0,0,0,.45);
}
.modal-card h2 {
  margin: 0 0 0.6rem;
  font-size: 1.2rem;
}
.modal-card p {
  margin: 0 0 0.85rem;
  line-height: 1.45;
  font-size: 0.92rem;
}
.presence-holders {
  list-style: none;
  margin: 0 0 1.1rem;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}
.presence-holders li {
  font-size: 0.82rem;
  color: var(--muted);
  background: #0d1218;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.55rem 0.7rem;
  line-height: 1.35;
}
.presence-holders li strong {
  color: var(--text);
  font-weight: 600;
}
.modal-actions {
  display: flex;
  gap: 0.6rem;
  justify-content: flex-end;
  flex-wrap: wrap;
}
.modal-actions .primary {
  width: auto;
  min-width: 8rem;
}
.modal-actions .btn-secondary,
button.btn-secondary {
  background: #182230;
  border-color: var(--border);
  color: var(--text);
  padding: 0.7rem 0.95rem;
  border-radius: 10px;
  font: inherit;
  cursor: pointer;
}
.modal-actions .btn-secondary:hover {
  background: #203044;
}
.session-item-meta .active-dot,
.session-active-badge {
  display: inline-block;
  margin-left: 0.35rem;
  padding: 0.05rem 0.4rem;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: #9ef0c4;
  background: rgba(61, 180, 120, 0.18);
  border: 1px solid rgba(109, 222, 168, 0.35);
  vertical-align: middle;
}
.presence-banner {
  margin: 0.5rem 1rem 0;
  padding: 0.65rem 0.85rem;
  border-radius: 10px;
  border: 1px solid rgba(255, 123, 123, 0.4);
  background: rgba(80, 24, 24, 0.45);
  color: #ffc9c9;
  font-size: 0.88rem;
  line-height: 1.4;
}
.presence-banner.hidden { display: none !important; }

.brand {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.45rem 0.65rem;
}
.brand-home {
  color: inherit;
  text-decoration: none;
  border-radius: 8px;
  padding: 0.05rem 0.15rem;
}
.brand-home:hover {
  color: var(--accent);
}
.brand-home:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
/* Header connection / transport alerts (between Zeus+chip and username) */
.header-alert {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  min-width: 0;
  max-width: 100%;
  justify-self: stretch;
  padding: 0.28rem 0.4rem 0.28rem 0.75rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 123, 123, 0.45);
  background: rgba(70, 18, 22, 0.78);
  color: #ffc9c9;
  font-size: 0.78rem;
  line-height: 1.3;
  box-shadow: 0 0 0 1px rgba(255, 80, 80, 0.08), 0 0 18px rgba(255, 80, 80, 0.08);
}
.header-alert.ok {
  border-color: rgba(109, 222, 168, 0.4);
  background: rgba(16, 40, 28, 0.78);
  color: #b8f0d0;
  box-shadow: 0 0 0 1px rgba(57, 255, 20, 0.08);
}
.header-alert.warn {
  border-color: rgba(230, 180, 60, 0.5);
  background: rgba(48, 36, 10, 0.78);
  color: #ffe6a8;
  box-shadow: none;
}
.header-alert-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
  flex: 1 1 auto;
}
.header-alert-dismiss {
  flex: 0 0 auto;
  width: 1.45rem;
  height: 1.45rem;
  padding: 0;
  border-radius: 999px;
  border-color: transparent;
  background: transparent;
  color: inherit;
  font-size: 1.05rem;
  line-height: 1;
  opacity: 0.8;
}
.header-alert-dismiss:hover {
  background: rgba(255, 255, 255, 0.08);
  opacity: 1;
}
.header-alert.is-idle {
  visibility: hidden;
  pointer-events: none;
  border-color: transparent;
  background: transparent;
  box-shadow: none;
}
@media (max-width: 820px) {
  .topbar {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
  }
  .header-alert {
    flex: 1 1 100%;
    order: 5;
    border-radius: 10px;
    justify-content: flex-start;
  }
  .header-alert.is-idle { display: none; }
}

/* ---- Desktop turn: fixed-px columns for EVERY question (not just the live one) ---- */
.turn-stage {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  width: 100%;
  align-self: stretch;
  flex: 0 0 auto;
}
.turn-stage > .msg.user {
  flex: 0 0 auto;
}
@media (min-width: 900px) {
  /* Height is a measured px value (--chunk-h), applied to all stages equally.
     flex-basis: 0 (not auto) so content cannot stretch the stage or columns. */
  .turn-stage {
    height: var(--chunk-h, auto);
    flex: 0 0 var(--chunk-h, auto);
    max-height: var(--chunk-h, none);
    min-height: 0;
    overflow: hidden;
  }
  .turn-stage > .msg.user {
    max-height: 7rem;
    overflow-y: auto;
    overscroll-behavior: contain;
  }
  .turn-stage .turn {
    flex: 1 1 0;
    min-height: 0;
    overflow: hidden;
    display: flex;
    flex-direction: row;
    align-items: stretch;
    gap: 0.5rem;
  }
  .turn-stage .panel,
  .turn-stage .msg.agent {
    flex: 1 1 0;
    min-width: 10.5rem;
    max-width: none;
    width: auto;
    align-self: stretch;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-height: 0;
  }
  .turn-stage .msg.agent {
    padding: 0;
    white-space: normal;
    flex: 2.4 1 0;
    min-width: 16rem;
  }
  .turn-stage .msg.agent > .msg-avatar-agent { display: none; }
  .turn-stage .msg.agent .msg-main > .role { display: none; }
  .turn-stage .response-head { display: flex; }
  .turn-stage .msg.agent .msg-main {
    flex: 1 1 0;
    min-height: 0;
    min-width: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    padding: 0 0.75rem 0.65rem;
  }
  .turn-stage .panel-head {
    flex: 0 0 auto;
  }
  .turn-stage .thought-body,
  .turn-stage .plan-body,
  .turn-stage .tools-body,
  .turn-stage .msg.agent .body {
    flex: 1 1 0;
    min-height: 0;
    min-width: 0;
    max-height: none;
    overflow-y: auto;
    overflow-x: auto;
    overscroll-behavior: contain;
    scrollbar-gutter: stable;
    scrollbar-width: thin;
    scrollbar-color: #6cb6ff #182230;
  }
  .turn-stage .panel-thought.is-waiting .thought-body,
  .turn-stage .msg.agent.is-waiting .body {
    display: flex;
    align-items: center;
  }
  .turn-stage .turn-wait {
    width: 100%;
    padding: 1.1rem 0.2rem;
  }
  .work-bar { height: 5px; }
  .status.working {
    font-size: 0.88rem;
  }
  .turn-stage .tool-pre {
    max-height: min(40vh, 18rem);
  }
  .turn-stage .msg.agent .turn-usage {
    flex: 0 0 auto;
  }

  /* Manual horizontal minimize — rail gives room to the other columns */
  .turn-stage .panel.collapsed,
  .turn-stage .msg.agent.collapsed {
    flex: 0 0 2.4rem;
    min-width: 2.4rem;
    max-width: 2.4rem;
    width: 2.4rem;
  }
  .turn-stage .panel.collapsed .panel-head,
  .turn-stage .msg.agent.collapsed .panel-head {
    writing-mode: vertical-rl;
    transform: rotate(180deg);
    height: 100%;
    width: 100%;
    justify-content: flex-start;
    align-items: center;
    padding: 0.85rem 0.3rem;
    gap: 0.45rem;
    border-bottom: 0;
  }
  .turn-stage .panel.collapsed .panel-meta,
  .turn-stage .msg.agent.collapsed .panel-meta,
  .turn-stage .panel.collapsed .msg-avatar,
  .turn-stage .msg.agent.collapsed .msg-avatar,
  .turn-stage .msg.agent.collapsed .msg-main {
    display: none;
  }

  .turn-stage .thought-body::-webkit-scrollbar,
  .turn-stage .tools-body::-webkit-scrollbar,
  .turn-stage .plan-body::-webkit-scrollbar,
  .turn-stage .msg.agent .body::-webkit-scrollbar,
  .turn-stage > .msg.user::-webkit-scrollbar {
    width: 11px;
    height: 11px;
  }
  .turn-stage .thought-body::-webkit-scrollbar-track,
  .turn-stage .tools-body::-webkit-scrollbar-track,
  .turn-stage .plan-body::-webkit-scrollbar-track,
  .turn-stage .msg.agent .body::-webkit-scrollbar-track,
  .turn-stage > .msg.user::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.28);
    border-radius: 999px;
  }
  .turn-stage .thought-body::-webkit-scrollbar-thumb,
  .turn-stage .tools-body::-webkit-scrollbar-thumb,
  .turn-stage .plan-body::-webkit-scrollbar-thumb,
  .turn-stage .msg.agent .body::-webkit-scrollbar-thumb,
  .turn-stage > .msg.user::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #6ee7a0, #3d8fd6);
    border: 2px solid transparent;
    background-clip: padding-box;
    border-radius: 999px;
    min-height: 32px;
  }
}

/* Response column head is desktop-stage only; stacked/mobile keep the old Zeus label */
.response-head { display: none; }

.theme-toggle {
  min-width: 2.4rem;
  width: 2.4rem;
  height: 2.4rem;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  font-size: 1.05rem;
  line-height: 1;
}
.theme-toggle-icon { display: block; transform: translateY(1px); }

html.theme-light .chooser-card,
html.theme-light .modal-card,
html.theme-light .gate-card {
  background: var(--panel);
  box-shadow: 0 20px 60px var(--shadow);
}
html.theme-light .chooser-list,
html.theme-light .session-list {
  background: var(--input);
}
html.theme-light .attach-btn,
html.theme-light .mic-btn,
html.theme-light .preview-voice-btn {
  background: var(--btn);
  color: var(--text);
}
html.theme-light .panel,
html.theme-light .msg.agent {
  background: var(--panel);
}
html.theme-light .panel-thought { background: var(--thought); border-color: #d4cce6; }
html.theme-light .panel-tools { background: var(--tool); border-color: #c9d9c2; }
html.theme-light .panel-plan { background: var(--agent); border-color: var(--border); }
html.theme-light .msg.user {
  background: var(--user);
  border-color: #9ec9a8;
  box-shadow: none;
}
html.theme-light .msg.user .role { display: none; }
html.theme-light .msg.agent { border-color: var(--border); box-shadow: none; }
html.theme-light .tool-name { color: var(--text); }
html.theme-light .tool-row { background: rgba(23, 32, 51, 0.05); }
html.theme-light .tool-row:hover { background: rgba(23, 32, 51, 0.09); }
html.theme-light .tool-pre {
  background: rgba(23, 32, 51, 0.06);
  color: var(--text);
}
html.theme-light .messages {
  scrollbar-color: var(--accent) var(--picker);
}
html.theme-light .modal-actions .btn-secondary,
html.theme-light button.btn-secondary {
  background: var(--btn);
}
html.theme-light .modal-actions .btn-secondary:hover {
  background: var(--btn-hover);
}
html.theme-light .modal-backdrop {
  background: rgba(23, 32, 51, 0.35);
}
html.theme-light .talk-btn {
  background: #e7f5ea;
  border-color: #8fbf98;
  color: #1b5c2e;
}
html.theme-light .talk-btn:hover {
  background: #d7edd9;
  border-color: #3d8a4d;
}
html.theme-light .voice-ctl {
  background: var(--btn);
  color: var(--text);
}
html.theme-light .voice-ctl[aria-pressed="true"] {
  background: #f3e6c0;
  border-color: #c9a227;
  color: #6a4b00;
}
html.theme-light .voice-ctl-end {
  background: #f8e4e4;
  border-color: #d09090;
  color: #8a2020;
}

/* ---- Phone chrome: two tight header rows (desktop unchanged) ---- */
.brand-mark { display: none; }
.chrome-more { display: none; }
.chrome-more-btn {
  min-width: 2.4rem;
  width: 2.4rem;
  height: 2.4rem;
  padding: 0;
  border-radius: 10px;
  font-size: 1.25rem;
  line-height: 1;
}
.settings-card {
  width: min(420px, 100%);
}
.settings-actions {
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
  margin-top: 0.85rem;
}
.settings-actions .primary,
.settings-actions .btn-secondary {
  width: 100%;
  min-width: 0;
  min-height: 44px;
  text-align: center;
  text-decoration: none;
  box-sizing: border-box;
}
.settings-update-status {
  min-height: 1.2em;
  margin: 0.35rem 0 0;
}

.settings-passkey {
  margin: 0.75rem 0;
  padding: 0.75rem;
  border: 1px solid var(--border);
  border-radius: 8px;
}

.settings-passkey p { margin: 0.35rem 0; }

@media (max-width: 720px) {
  .topbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.28rem 0.35rem;
    width: 100%;
    max-width: 100%;
    overflow: hidden;
    padding: 0.28rem max(0.7rem, env(safe-area-inset-right)) 0.28rem max(0.55rem, env(safe-area-inset-left));
  }
  .brand {
    width: 100%;
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    justify-content: flex-start;
    align-items: center;
    gap: 0.3rem;
    min-width: 0;
  }
  .brand-word { display: none; }
  .brand-mark {
    display: inline;
    font-size: 0.9rem;
    font-weight: 800;
    letter-spacing: 0;
  }
  .brand-home { flex: 0 0 auto; }
  .peer-switch {
    flex: 1 1 auto;
    min-width: 0;
    overflow-x: auto;
    scrollbar-width: none;
  }
  .peer-switch::-webkit-scrollbar { display: none; }
  .peer-btn { padding: 0.18rem 0.34rem; font-size: 0.72rem; }
  .status.ok {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
  }
  .status:not(.ok) {
    flex: 0 0 auto;
    font-size: 0.72rem;
  }
  .topbar-actions {
    width: 100%;
    flex-wrap: nowrap;
    justify-content: flex-start;
    align-items: center;
    gap: 0.28rem;
    min-width: 0;
  }
  .topbar-actions #user-label,
  .topbar-actions #admin-link,
  .topbar-actions #disconnect-btn,
  .session-id-short { display: none !important; }
  .session-picker {
    flex: 1 1 0;
    min-width: 0;
  }
  #session-picker-btn {
    width: 100%;
    max-width: none;
    min-width: 0;
    padding: 0.28rem 0.45rem;
  }
  #new-session-btn {
    min-width: 2.4rem;
    width: 2.4rem;
    height: 2.4rem;
    padding: 0;
    font-size: 1.15rem;
    border-radius: 10px;
    overflow: hidden;
    text-indent: -99px;
    position: relative;
  }
  #new-session-btn::after {
    content: "+";
    position: absolute;
    inset: 0;
    text-indent: 0;
    display: grid;
    place-items: center;
    font-weight: 700;
  }
  .theme-toggle {
    min-width: 2.4rem;
    width: 2.4rem;
    height: 2.4rem;
    padding: 0;
  }
  .chrome-more {
    display: block;
    position: relative;
    flex: 0 0 auto;
    flex-shrink: 0;
  }
  #new-session-btn,
  .theme-toggle,
  .chrome-more-btn {
    flex-shrink: 0;
  }
  body.desk-mode .topbar-actions,
  body.bridge-mode .topbar-actions,
  body.platogb-mode .topbar-actions {
    justify-content: flex-end;
  }
}

/* Keep the owner refresh above the legacy Cronus rules. */
.cronus-mode #cronus-stage{background:radial-gradient(circle at 12% 0,#2b1b6640,transparent 32rem)}
.cronus-stage{width:min(1180px,100%);margin:auto;padding:clamp(1rem,3vw,2rem);overflow:auto}
.cronus-portal-head{display:flex;justify-content:space-between;align-items:flex-start;gap:1rem;margin-bottom:1rem}.cronus-portal-head h1{margin:0;font-size:clamp(1.6rem,3vw,2.35rem)}.eyebrow{color:#f2c46d;font:700 .68rem/1.2 var(--mono);letter-spacing:.16em;margin:0 0 .35rem}.cronus-head-actions{display:flex;gap:.5rem;align-items:center;flex-wrap:wrap}.cronus-head-actions button,.cronus-tabs button{border:1px solid var(--border);background:var(--panel);color:var(--muted);border-radius:8px;padding:.42rem .65rem}.cronus-usage-chip{border:1px solid #6f5e2a;color:#f2c46d;background:#211c0c;border-radius:999px;padding:.38rem .7rem;font-size:.72rem}.cronus-system-status{display:flex;align-items:center;gap:.55rem;border:1px solid #2a5f4a;background:#10251b;color:#8ce0ae;border-radius:10px;padding:.6rem .75rem;margin-bottom:.85rem;font-size:.78rem}.cronus-system-status .muted{margin-left:auto}.cronus-system-status.is-warn{border-color:#765921;background:#261d0d;color:#f2c46d}.cronus-system-status.is-bad{border-color:#7d3844;background:#28131a;color:#ff9da8}.status-dot{width:.55rem;height:.55rem;border-radius:50%;background:currentColor}.cronus-compose-card{width:100%;margin:0;padding:clamp(.8rem,2vw,1.2rem)}.cronus-heading{margin-bottom:.2rem}.cronus-heading h2{font-size:1.25rem;margin:0}.cronus-model-strip{display:grid;grid-template-columns:minmax(190px,260px) 1fr;align-items:end;gap:.75rem;margin:.2rem 0 .8rem}.cronus-model-note{border:1px solid var(--border);border-radius:8px;padding:.63rem .72rem;color:var(--muted);font-size:.74rem;min-height:2.5rem}.cronus-advanced{border-top:1px solid var(--border);padding-top:.65rem;margin-top:.3rem}.cronus-advanced summary{cursor:pointer;color:#f2c46d;font-size:.8rem}.cronus-advanced-grid{display:flex;flex-wrap:wrap;gap:.65rem;margin-top:.7rem}.cronus-advanced-grid .cronus-field{min-width:130px;flex:1}.cronus-check{color:var(--muted);font-size:.78rem;display:flex;align-items:center;gap:.35rem}.cronus-section-title{display:flex;justify-content:space-between;align-items:center;gap:1rem;margin:1.25rem 0 .5rem}.cronus-section-title h2{margin:0;font-size:1.1rem}.cronus-tabs{display:flex;gap:.35rem}.cronus-tabs button.is-on{color:#f2c46d;border-color:#80682c;background:#251d0c}.cronus-jobs{width:100%;margin:.45rem 0 0}.cronus-queue{width:100%;margin-top:.65rem}.cronus-jobs-list{display:grid;grid-template-columns:repeat(auto-fit,minmax(240px,1fr));gap:.55rem}.cronus-job{min-width:0}.cronus-job-snip{font-size:.78rem}.cronus-admin{width:100%;margin-top:1rem}.cronus-admin[hidden]{display:none}.cronus-admin-users{display:grid;gap:.45rem}.cronus-admin-row{display:grid;grid-template-columns:1.2fr 1fr 1fr;gap:.6rem;padding:.6rem .7rem;border:1px solid var(--border);border-radius:8px;font-size:.75rem}.cronus-admin-row span{color:var(--muted)}
@media(max-width:800px){.cronus-stage{padding:1rem .75rem 5rem}.cronus-portal-head{display:block}.cronus-head-actions{margin-top:.8rem}.cronus-system-status .muted{display:none}.cronus-model-strip{grid-template-columns:1fr}.cronus-section-title{align-items:flex-start;flex-direction:column}.cronus-tabs{width:100%}.cronus-tabs button{flex:1}.cronus-jobs-list{display:flex;flex-direction:column}.cronus-admin-row{grid-template-columns:1fr;gap:.1rem}}

/* Final owner-wide cascade (after the legacy Cronus rules). */
.cronus-stage:not(.hidden){width:min(1800px,100%);display:grid!important;grid-template-columns:minmax(0,1.25fr) minmax(240px,.8fr) minmax(240px,.8fr);grid-template-areas:"head head head" "status status status" "compose active queue" "tabs tabs tabs" "admin admin admin";gap:.75rem 1rem;align-items:start}
.cronus-portal-head{grid-area:head}.cronus-system-status{grid-area:status}.cronus-compose-card{grid-area:compose;min-width:0;padding:.85rem 1rem}.cronus-section-title{grid-area:tabs;margin-top:.15rem}.cronus-compose-card .cronus-heading p{margin-bottom:.45rem}.cronus-compose-card .cronus-controls{margin:.5rem 0}
#cronus-jobs{grid-area:active;min-width:0;margin:0;max-height:calc(100dvh - 13rem);overflow:auto}#cronus-queue{grid-area:queue;min-width:0;margin:0;max-height:calc(100dvh - 13rem);overflow:auto}.cronus-admin{grid-area:admin}
#cronus-prompt{min-height:2.75rem;height:2.75rem;transition:height .18s ease}#cronus-prompt:focus{min-height:7rem;height:7rem!important}
@media(min-width:900px) and (max-width:1279px){.cronus-stage:not(.hidden){grid-template-columns:minmax(0,1.35fr) minmax(300px,.85fr);grid-template-areas:"head head" "status status" "compose active" "compose queue" "tabs tabs" "admin admin"}#cronus-jobs,#cronus-queue{max-height:24rem}}
@media(max-width:899px){.cronus-stage:not(.hidden){display:block!important;width:100%}#cronus-jobs,#cronus-queue{max-height:none}.cronus-compose-card{margin-bottom:1rem}#cronus-prompt:focus{min-height:6rem;height:6rem!important}}

/* J-1004-CRONUS-REDESIGN-PWA2 — three zones, live dot, pills, one-line other jobs. */
.nav-i{vertical-align:-2px;margin-right:4px}
.cronus-owner-badge{display:none}
body.cronus-mode .cronus-owner-badge{display:inline-flex;align-items:center;height:18px;margin-left:8px;padding:0 7px;border-radius:999px;font:700 10px/1 system-ui,sans-serif;letter-spacing:.06em;text-transform:uppercase;color:#1a1300;background:linear-gradient(180deg,#F7D58C,#E0A63F)}
.cronus-phone-tabs{display:none}
#cronus-stage.cronus-stage{font:400 14px/22px Inter,ui-sans-serif,system-ui,sans-serif}
#cronus-stage.cronus-stage:not(.hidden){display:grid!important;width:min(1800px,100%);grid-template-columns:minmax(300px,400px) minmax(0,1fr) minmax(260px,340px);grid-template-areas:"head head head" "models models models" "compose center rail" "admin admin admin";gap:14px 16px;align-items:start}
#cronus-stage .cronus-portal-head{grid-area:head}
#cronus-stage .cronus-system-status{grid-area:head;justify-self:end;align-self:center;margin:0;width:auto;border:0;background:transparent;color:#2EE6D6;padding:0;font:500 13px/1 Inter,system-ui,sans-serif}
#cronus-stage .cronus-system-status.is-warn{color:#F7B955;background:transparent;border:0}
#cronus-stage .cronus-system-status.is-bad{color:#FF7482;background:transparent;border:0}
#cronus-stage .cronus-live-i,#cronus-stage .status-dot{width:8px;height:8px;border-radius:50%;background:currentColor;box-shadow:0 0 0 3px rgba(46,230,214,.18);display:inline-block}
.cronus-live-header{display:none}
#cronus-stage .cronus-compose-card{grid-area:compose}
#cronus-stage .cronus-center{grid-area:center;min-width:0;display:flex;flex-direction:column;gap:14px}
#cronus-stage #cronus-recent{grid-area:rail;min-width:0;margin:0;max-height:calc(100dvh - 12rem);overflow:auto}
#cronus-stage .cronus-admin{grid-area:admin}
#cronus-stage #cronus-live{position:fixed}
#cronus-stage select{appearance:none;background-color:#0F1219;border:1px solid #343C50;border-radius:10px;color:#E8ECF4;padding:8px 28px 8px 10px;min-height:38px}
#cronus-stage .cronus-job-badge.pill{display:inline-flex;align-items:center;gap:5px;border-radius:999px;padding:2px 8px;font-size:12px;border:1px solid currentColor}
#cronus-stage .s-queued{color:#7AA7FF}#cronus-stage .s-running{color:#2EE6D6}#cronus-stage .s-held{color:#F7B955}#cronus-stage .s-done{color:#4ADE80}#cronus-stage .s-failed{color:#FF7482}#cronus-stage .s-cancelled{color:#A3ACBB}
#cronus-stage .cronus-job.is-foreign{display:flex;align-items:center;gap:8px;min-height:48px;padding:6px 10px}
#cronus-stage .cronus-job.is-foreign .cronus-job-snip{flex:1;min-width:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
#cronus-stage .cronus-job.is-foreign .cronus-job-meta,#cronus-stage .cronus-job.is-foreign .cronus-job-progress,#cronus-stage .cronus-job.is-foreign .cronus-job-error,#cronus-stage .cronus-job.is-foreign .cronus-detail,#cronus-stage .cronus-job.is-foreign .cronus-detail-toggle{display:none}
@media(max-width:899px){
  #cronus-stage.cronus-stage:not(.hidden){display:block!important;padding-bottom:76px}
  #cronus-stage[data-phone-tab="new"] .cronus-center,#cronus-stage[data-phone-tab="new"] #cronus-recent{display:none}
  #cronus-stage[data-phone-tab="active"] .cronus-compose-card,#cronus-stage[data-phone-tab="active"] #cronus-queue,#cronus-stage[data-phone-tab="active"] #cronus-recent{display:none}
  #cronus-stage[data-phone-tab="queue"] .cronus-compose-card,#cronus-stage[data-phone-tab="queue"] #cronus-jobs,#cronus-stage[data-phone-tab="queue"] #cronus-recent{display:none}
  #cronus-stage[data-phone-tab="recent"] .cronus-compose-card,#cronus-stage[data-phone-tab="recent"] .cronus-center{display:none}
  body.cronus-mode .cronus-phone-tabs{display:flex;position:fixed;left:0;right:0;bottom:0;z-index:30;height:64px;background:#0F1219;border-top:1px solid #252B3A}
  body.cronus-mode .cronus-phone-tabs button{flex:1;min-height:64px;border:0;background:transparent;color:#A9B2C3}
  body.cronus-mode .cronus-phone-tabs button.is-on{color:#A594FF}
}

/* J-1004-CRONUS-REDESIGN-PWA3: the owner desk uses a compact header live
   indicator; the old full-width readiness banner is intentionally removed. */
#cronus-stage.cronus-stage:not(.hidden) #cronus-system-status{display:none!important}
#cronus-stage.cronus-stage:not(.hidden) .cronus-live-header{display:inline-flex;align-items:center;gap:7px;color:#2EE6D6;font:600 13px/1 Inter,ui-sans-serif,system-ui,sans-serif}
#cronus-stage.cronus-stage:not(.hidden) .cronus-live-header i{width:8px;height:8px;border-radius:50%;background:#2EE6D6;box-shadow:0 0 0 3px rgba(46,230,214,.18),0 0 10px rgba(46,230,214,.8)}
#cronus-stage.cronus-stage:not(.hidden){width:100%;max-width:1800px;margin-inline:auto;padding:18px 20px 34px}
#cronus-stage.cronus-stage:not(.hidden) .cronus-portal-head{margin-bottom:0}
#cronus-stage.cronus-stage:not(.hidden) .cronus-head-actions{align-items:center}
#cronus-stage.cronus-stage:not(.hidden) .cronus-status-pills{display:grid;grid-template-columns:repeat(6,minmax(0,1fr));gap:10px;margin-top:14px}
#cronus-stage.cronus-stage:not(.hidden) .cronus-summary-pill{min-height:46px;display:flex;align-items:center;justify-content:center;border-radius:10px;border:1px solid #343C50;background:#151924;color:#A9B2C3;font-size:12px}
#cronus-stage.cronus-stage:not(.hidden) .cronus-summary-pill.running{color:#2EE6D6;border-color:#287f78;background:rgba(46,230,214,.10)}
#cronus-stage.cronus-stage:not(.hidden) .cronus-summary-pill.waiting{color:#7AA7FF;border-color:#3d5f9a;background:rgba(122,167,255,.10)}
#cronus-stage.cronus-stage:not(.hidden) .cronus-summary-pill.paused{color:#F7B955;background:rgba(247,185,85,.10)}
#cronus-stage.cronus-stage:not(.hidden) .cronus-summary-pill.finished{color:#4ADE80;background:rgba(74,222,128,.10)}
#cronus-stage.cronus-stage:not(.hidden) .cronus-summary-pill.attention{color:#FF7482;background:rgba(255,116,130,.10)}
#cronus-stage.cronus-stage:not(.hidden) .cronus-summary-pill.cancelled{color:#A3ACBB;background:rgba(163,172,187,.08)}
@media(max-width:899px){
  #cronus-stage.cronus-stage:not(.hidden){padding:10px 12px 76px}
  #cronus-stage.cronus-stage:not(.hidden) .cronus-status-pills{grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}
}

/* J-1004-BRIDGE-HEADER-FIX
   cronus-ui.css sets .topbar { height: 56px }, so the bridge status line
   paints on the first note and the note's top line sits under the pills.
   Same centred grid as / (body.choosing). Pills stay ZeusHeading, no copy. */
body.bridge-mode #chat > .topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  width: 100%;
  height: auto;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  justify-items: center;
  align-items: center;
  overflow: visible;
}
body.bridge-mode .brand {
  grid-column: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: auto;
  max-width: calc(100vw - 220px);
  min-width: 0;
}
body.bridge-mode .peer-switch { max-width: 100%; }
body.bridge-mode .topbar-actions {
  grid-column: 3;
  justify-self: end;
  align-self: center;
}
body.bridge-mode .header-alert.is-idle { display: none; }
body.bridge-mode .header-alert:not(.is-idle) {
  grid-column: 1 / -1;
  grid-row: 2;
  width: 100%;
}
body.bridge-mode #status {
  position: static;
  width: auto;
  height: auto;
  margin: 0;
  padding: 0;
  overflow: visible;
  clip: auto;
  white-space: nowrap;
}
body.bridge-mode .messages {
  scroll-padding-top: 0.75rem;
}
body.bridge-mode .messages .msg {
  scroll-margin-top: 0.75rem;
}
@media (max-width: 720px) {
  body.bridge-mode #chat > .topbar {
    display: flex !important;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-start;
    height: auto;
    min-height: 48px;
    overflow: visible;
    padding: 0.35rem 0.55rem 0.25rem;
    padding-top: max(0.35rem, env(safe-area-inset-top));
  }
  body.bridge-mode .brand { display: contents; }
  body.bridge-mode .brand-home { order: 1; flex: 0 0 auto; }
  body.bridge-mode .peer-dropdown { order: 2; flex: 1 1 auto; min-width: 0; }
  body.bridge-mode .topbar-actions {
    order: 4;
    grid-column: auto;
    width: auto;
    flex: 0 0 auto;
    margin-left: auto;
    justify-content: flex-end;
  }
  body.bridge-mode #status,
  body.bridge-mode .status.ok {
    order: 5;
    flex: 1 0 100%;
    position: static;
    width: auto;
    height: auto;
    margin: 0.15rem 0 0;
    padding: 0;
    overflow: visible;
    clip: auto;
    white-space: nowrap;
    text-align: center;
    font-size: 0.75rem;
    line-height: 1.3;
  }
}

/* J-1004-JOB-TITLES: title is the main text, ticket id sits small beside it. */
body.cronus-mode .cronus-job-snip.cronus-job-name {
  display: flex;
  align-items: baseline;
  gap: .45rem;
  min-width: 0;
  white-space: normal;
  text-overflow: unset;
}
.cronus-job-title {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 650;
}
.cronus-job-code {
  flex: none;
  max-width: 46%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-family: var(--mono, ui-monospace, monospace);
  font-size: .64rem;
  color: var(--muted);
}
.cronus-live-head h2 {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
#cronus-live-code { flex: none; }
/* Keep the plain title and ticket id visible on a one-line other-user row. */
#cronus-stage .cronus-job.is-foreign .cronus-job-snip.cronus-job-name {
  display: flex;
  align-items: baseline;
  gap: .4rem;
  flex: 1 1 auto;
  min-width: 14rem;
  margin-top: 0;
}
#cronus-stage .cronus-job.is-foreign .cronus-job-title {
  flex: 0 0 auto;
  overflow: visible;
  text-overflow: clip;
}
#cronus-stage .cronus-job.is-foreign .cronus-job-model {
  flex: 0 1 7.5rem;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* One compact models card. Active listing and the installed menu share two rows. */
#cronus-stage #cronus-active-models {
  grid-area: models;
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
  overflow: visible;
  margin: 0;
  border: 1px solid #343C50;
  background: #151924;
  border-radius: 12px;
  padding: 8px 12px;
}
#cronus-stage .cronus-models-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  grid-template-areas:
    "title listing button"
    "status status clock";
  column-gap: 12px;
  row-gap: 2px;
  align-items: center;
  min-width: 0;
}
#cronus-stage .cronus-models-title {
  grid-area: title;
  display: flex;
  align-items: baseline;
  gap: 8px;
  min-width: 0;
}
#cronus-stage .cronus-models-title h2 {
  margin: 0;
  font-size: 15px;
  line-height: 1.3;
  white-space: nowrap;
}
#cronus-stage .cronus-models-build {
  font: 600 11px/1.2 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color: #8ea0b8;
  white-space: nowrap;
}
#cronus-stage .cronus-models-listing { grid-area: listing; min-width: 0; }
#cronus-stage #cronus-models-empty {
  margin: 0;
  padding: 0;
  border: 0;
  text-align: left;
}
#cronus-stage #cronus-models-meta { grid-area: clock; margin: 0; justify-self: end; white-space: nowrap; }
#cronus-stage .cronus-models-list { list-style: none; margin: 0; padding: 0; min-width: 0; }
#cronus-stage .cronus-model-row {
  display: flex;
  flex-wrap: wrap;
  gap: 2px 8px;
  align-items: baseline;
  min-width: 0;
  padding: 0;
  border: 0;
}
#cronus-stage .cronus-model-name { min-width: 0; }
#cronus-stage .cronus-model-name strong,
#cronus-stage .cronus-model-exact,
#cronus-stage .cronus-model-size,
#cronus-stage .cronus-model-state,
#cronus-stage .cronus-model-job,
#cronus-stage .cronus-model-rate { display: inline; }
#cronus-stage .cronus-model-exact,
#cronus-stage .cronus-model-job,
#cronus-stage .cronus-model-rate {
  color: #8ea0b8;
  font-size: 12px;
  overflow-wrap: anywhere;
}
#cronus-stage .cronus-model-exact:empty { display: none; }
#cronus-stage .cronus-model-size { font-variant-numeric: tabular-nums; white-space: nowrap; }
#cronus-stage .cronus-model-state { min-width: 0; }
#cronus-stage .cronus-model-row.is-working .cronus-model-state > span:first-child { color: #2EE6D6; }
#cronus-stage .cronus-model-row.is-loading .cronus-model-state > span:first-child { color: #F7B955; }
#cronus-stage .cronus-model-row.is-idle .cronus-model-state > span:first-child { color: #A9B2C3; }
#cronus-stage .cronus-models-sources {
  grid-area: status;
  margin: 0;
  min-width: 0;
  font-size: 12px;
  overflow-wrap: anywhere;
}
#cronus-stage .cronus-installed-wrap { grid-area: button; position: relative; justify-self: end; min-width: 0; }
#cronus-stage .cronus-installed-toggle {
  min-height: 36px;
  border: 1px solid #343C50;
  background: #0F1219;
  color: #E8ECF4;
  border-radius: 8px;
  padding: 6px 12px;
  font: inherit;
  cursor: pointer;
  white-space: nowrap;
}
#cronus-stage .cronus-installed-toggle.is-open { border-color: #A594FF; }
#cronus-stage .cronus-installed-toggle.is-bad { color: #ff6680; }
#cronus-stage .cronus-installed-toggle:focus-visible {
  outline: 2px solid #A594FF;
  outline-offset: 2px;
}
/* The models row sits above the rails, so the recent list must end above the viewport. */
#cronus-stage #cronus-recent { max-height: calc(100dvh - 16rem); }

/* Installed models menu. One line each, inside the active card. No sideways scroll. */
#cronus-stage .cronus-installed-pop {
  position: absolute;
  z-index: 25;
  top: calc(100% + 6px);
  right: 0;
  width: min(560px, calc(100vw - 36px));
  box-sizing: border-box;
  overflow: visible;
  margin: 0;
  padding: 0 0 6px;
  border: 1px solid #343C50;
  border-radius: 10px;
  background: #1b2130;
  box-shadow: 0 12px 32px rgba(0, 0, 0, .45);
}
#cronus-stage .cronus-installed-glabel {
  margin: 6px 10px 2px;
  color: #8ea0b8;
  font-size: 11px;
  letter-spacing: .04em;
}
#cronus-stage .cronus-installed-cols,
#cronus-stage .cronus-installed-item {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) 4.7rem minmax(8.5rem, 1.15fr) 2.8rem;
  grid-template-areas: "name size gen score";
  column-gap: 8px;
  align-items: baseline;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  min-width: 0;
}
#cronus-stage .cronus-installed-cols {
  margin: 0;
  padding: 6px 10px 5px;
  border-bottom: 1px solid #2a3142;
  color: #8ea0b8;
  font-size: 11px;
  letter-spacing: .03em;
  line-height: 1.3;
}
#cronus-stage .cronus-installed-item {
  margin: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  padding: 6px 10px;
  min-height: 32px;
  cursor: pointer;
}
#cronus-stage .cronus-installed-item:hover,
#cronus-stage .cronus-installed-item.is-open { background: #1c2230; }
#cronus-stage .cronus-installed-item:focus-visible {
  outline: 2px solid #A594FF;
  outline-offset: -2px;
}
#cronus-stage .cronus-loaded-dot {
  position: absolute;
  left: 0;
  top: .45em;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #2EE6D6;
  box-shadow: 0 0 0 2px rgba(46, 230, 214, .25);
}
#cronus-stage .cronus-installed-h-name,
#cronus-stage .cronus-installed-name { grid-area: name; min-width: 0; }
#cronus-stage .cronus-installed-h-name { padding-left: 14px; }
#cronus-stage .cronus-installed-name { position: relative; padding-left: 14px; }
#cronus-stage .cronus-installed-name-text {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
#cronus-stage .cronus-installed-h-size,
#cronus-stage .cronus-installed-size {
  grid-area: size;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
#cronus-stage .cronus-installed-size { color: #8ea0b8; font-size: 12px; }
#cronus-stage .cronus-installed-h-gen,
#cronus-stage .cronus-installed-gen { grid-area: gen; min-width: 0; }
#cronus-stage .cronus-installed-gen {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 2px 6px;
}
#cronus-stage .cronus-installed-quant {
  color: #8ea0b8;
  font-size: 11px;
  line-height: 1.45;
  letter-spacing: .02em;
  border: 1px solid #343C50;
  border-radius: 999px;
  padding: 0 5px;
  white-space: nowrap;
}
#cronus-stage .cronus-installed-h-score,
#cronus-stage .cronus-installed-score {
  grid-area: score;
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
#cronus-stage .cronus-installed-score { color: #8ea0b8; font-size: 12px; }
#cronus-stage .cronus-installed-none { margin: 8px 10px; color: #8ea0b8; }
#cronus-stage .cronus-installed-detail {
  min-width: 0;
  max-width: 100%;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid #2a3142;
}
#cronus-stage .cronus-installed-detail h3 { margin: 0 0 6px; font-size: 16px; overflow-wrap: anywhere; }
#cronus-stage .cronus-installed-lead { margin: 0 0 10px; }
#cronus-stage .cronus-installed-facts {
  display: grid;
  grid-template-columns: minmax(0, 9.5rem) minmax(0, 1fr);
  gap: 4px 12px;
  margin: 0 0 12px;
}
#cronus-stage .cronus-installed-facts dt { color: #8ea0b8; margin: 0; }
#cronus-stage .cronus-installed-facts dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
#cronus-stage .cronus-installed-test {
  margin: 0 0 10px;
  padding-top: 8px;
  border-top: 1px solid #2a3142;
}
#cronus-stage .cronus-installed-test p { margin: 4px 0 0; }
#cronus-stage .cronus-installed-source { color: #8ea0b8; font-size: 12px; overflow-wrap: anywhere; }
#cronus-stage .cronus-installed-status {
  display: inline-block;
  margin-left: 8px;
  border-radius: 999px;
  padding: 0 8px;
  font-size: 12px;
  line-height: 1.6;
  border: 1px solid currentColor;
  white-space: normal;
}
#cronus-stage .cronus-installed-status.is-finished { color: #40d98a; }
#cronus-stage .cronus-installed-status.is-attention { color: #ff6680; }
#cronus-stage .cronus-installed-close {
  margin-top: 4px;
  min-height: 36px;
}
@media (max-width: 899px) {
  #cronus-stage #cronus-active-models { margin: 0 0 14px; }
  #cronus-stage .cronus-models-row {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
      "title clock"
      "listing listing"
      "status status"
      "button button";
  }
  #cronus-stage .cronus-models-title { flex-wrap: wrap; max-width: 100%; }
  #cronus-stage .cronus-models-build { white-space: normal; }
  #cronus-stage .cronus-installed-wrap { justify-self: stretch; width: 100%; }
  #cronus-stage .cronus-installed-toggle { width: 100%; }
  #cronus-stage .cronus-installed-pop { left: 0; right: 0; width: 100%; max-width: 100%; }
  #cronus-stage #cronus-models-meta { justify-self: end; }
  #cronus-stage .cronus-installed-facts { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 520px) {
  #cronus-stage .cronus-installed-cols,
  #cronus-stage .cronus-installed-item {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    grid-template-areas:
      "name score"
      "size gen";
    row-gap: 1px;
    align-items: center;
  }
  #cronus-stage .cronus-installed-name-text {
    white-space: normal;
    overflow: visible;
    text-overflow: unset;
    overflow-wrap: anywhere;
  }
  #cronus-stage .cronus-installed-gen { justify-content: flex-start; }
  #cronus-stage .cronus-installed-h-score,
  #cronus-stage .cronus-installed-score { text-align: right; }
}
