/*
  GlobalBoost Studio styles.

  Palette idea: studio equipment. Anodized panel grays, a deep petrol for controls, and one
  amber "signal" color that is reserved for a model that is writing right now.
  To rebrand, change the custom properties in :root. Everything else derives from them.
  No fonts or other files are loaded from the network.
*/

:root {
  color-scheme: light dark;

  --panel: light-dark(#eceeea, #101716);
  --surface: light-dark(#fbfcfa, #18211f);
  --raised: light-dark(#ffffff, #1f2a28);
  --ink: light-dark(#14211f, #e6edea);
  --muted: light-dark(#52605c, #9aa8a3);
  --line: light-dark(#cdd4ce, #2a3835);
  --petrol: light-dark(#0e5a5c, #63c7c2);
  --on-petrol: light-dark(#ffffff, #06201f);
  --petrol-wash: light-dark(#dcebe8, #17302f);
  --signal: light-dark(#e79a1b, #ffb84a);
  --danger: light-dark(#a8321f, #ff9c88);
  --ok: light-dark(#1f7a4d, #6fd3a0);

  /* Map answers. Blue and orange stay apart for people with red-green color blindness. */
  --yes: light-dark(#1c6e8c, #4fa9cc);
  --no: light-dark(#d9642b, #f08a4f);
  --other: light-dark(#9aa5a0, #5d6b67);
  --failed: light-dark(#5b3a8c, #a98be0);
  --pending: light-dark(#dfe4df, #24302e);

  --font-ui: "Avenir Next", "Segoe UI Variable Text", "Segoe UI", "Helvetica Neue", system-ui, sans-serif;
  --font-page: "Iowan Old Style", Charter, "Sitka Text", Cambria, Georgia, serif;
  --font-code: ui-monospace, "SF Mono", "Cascadia Code", Menlo, Consolas, monospace;

  --radius: 8px;
  --measure: 72ch;
}

:root[data-theme="light"] { color-scheme: light; }
:root[data-theme="dark"] { color-scheme: dark; }

*, *::before, *::after { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  background: var(--panel);
  color: var(--ink);
  font: 15px/1.5 var(--font-ui);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6, p, ul, ol, pre, blockquote, fieldset, table { margin: 0; }
ul, ol { padding: 0; }
fieldset { border: 0; padding: 0; min-width: 0; }
[hidden] { display: none !important; }

:focus-visible { outline: 2px solid var(--petrol); outline-offset: 2px; }

a { color: var(--petrol); }
code, kbd, pre { font-family: var(--font-code); font-size: 0.9em; }
kbd {
  display: inline-block;
  min-width: 1.6em;
  padding: 0 0.35em;
  border: 1px solid var(--line);
  border-bottom-width: 2px;
  border-radius: 5px;
  background: var(--raised);
  text-align: center;
  line-height: 1.5;
}

/* ---------- controls ---------- */

button, input, select, textarea {
  font: inherit;
  color: inherit;
}

button {
  padding: 6px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--raised);
  cursor: pointer;
  white-space: nowrap;
}
button:hover:not(:disabled) { border-color: var(--petrol); }
button:disabled { opacity: 0.5; cursor: default; }
button.primary { background: var(--petrol); border-color: var(--petrol); color: var(--on-petrol); font-weight: 600; }
button.primary:hover:not(:disabled) { filter: brightness(1.1); }
button.quiet { border-color: transparent; background: none; color: var(--muted); }
button.quiet:hover:not(:disabled) { color: var(--ink); border-color: var(--line); }
button.danger { color: var(--danger); }
button.danger:hover:not(:disabled) { border-color: var(--danger); }
button.wide { width: 100%; }
button.link { padding: 0; border: 0; background: none; color: var(--petrol); text-decoration: underline; white-space: normal; }
button.chip { padding: 2px 10px; border-radius: 999px; font-size: 13px; white-space: normal; text-align: left; }

input[type="text"], input[type="url"], input[type="password"], input[type="number"], select, textarea {
  width: 100%;
  padding: 6px 9px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--raised);
}
input[type="number"] { width: 6.5em; }
input[type="color"] { width: 3.5em; height: 2.2em; padding: 2px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--raised); }
input[type="checkbox"] { width: 1.05em; height: 1.05em; accent-color: var(--petrol); }
select { width: auto; max-width: 100%; }
textarea { resize: vertical; min-height: 2.6em; }
textarea.code { font-family: var(--font-code); font-size: 13px; }

.field { display: grid; gap: 4px; align-content: start; }
.field-label { font-size: 13px; font-weight: 600; }
.field-hint { font-size: 13px; color: var(--muted); }
.check { display: flex; gap: 8px; align-items: center; }
.inline { display: inline-flex; gap: 8px; align-items: center; }
.grow { flex: 1; }

/* ---------- shell ---------- */

.app {
  display: grid;
  grid-template-columns: 84px minmax(0, 1fr);
  height: 100dvh;
}

.rail {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 14px 8px;
  background: var(--surface);
  border-right: 1px solid var(--line);
}
.brand { margin: 2px 0 16px; text-align: center; line-height: 1.15; }
.brand b { display: block; font-size: 11.5px; letter-spacing: 0.01em; }
.brand span { font: italic 600 19px/1 var(--font-page); color: var(--petrol); }

.rail button {
  display: grid;
  justify-items: center;
  gap: 3px;
  padding: 9px 2px 7px;
  border: 0;
  border-radius: var(--radius);
  background: none;
  color: var(--muted);
  font-size: 11.5px;
}
.rail button:hover { color: var(--ink); background: var(--panel); }
.rail button[aria-current="page"] { color: var(--petrol); background: var(--petrol-wash); font-weight: 600; }
.rail .spacer { flex: 1; }

.main {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  position: relative;
  background: color-mix(in srgb, var(--room-tint, var(--panel)) 18%, var(--panel));
}

/* The signal line appears only while a model is writing. It overlays the top edge so
   nothing below it moves. Its text is for screen readers. */
.signal {
  position: absolute;
  inset: 0 0 auto 0;
  z-index: 2;
  height: 3px;
  overflow: hidden;
  background: linear-gradient(90deg, transparent, var(--signal), transparent) 0 0 / 50% 100% no-repeat, color-mix(in srgb, var(--signal) 24%, transparent);
  animation: sweep 1.2s linear infinite;
}
.signal span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
@keyframes sweep {
  from { background-position: -100% 0, 0 0; }
  to { background-position: 200% 0, 0 0; }
}

.view { flex: 1; min-height: 0; }

.tool { display: grid; height: 100%; min-height: 0; }
.tool.chat { grid-template-columns: 232px minmax(0, 1fr); }
.tool.compare { grid-template-columns: minmax(0, 1fr) 350px; }

.stage {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
  min-height: 0;
  padding: 0 28px 20px;
  overflow-y: auto;
}
.tool.chat .stage, .tool.compare .stage { overflow: hidden; }
/* In a scrolling column nothing should be squeezed, except the two areas built to flex. */
.stage > :not(.transcript):not(.rounds) { flex-shrink: 0; }

.toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  padding: 16px 0 4px;
}
.toolbar h1 { margin-right: 8px; font-size: 22px; font-weight: 650; letter-spacing: -0.01em; }

.picker { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.picker select { max-width: 14em; }
.picker input { width: 15em; }
.picker .model-select { max-width: 18em; }
.picker-status { font-size: 12.5px; color: var(--muted); }

.options { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 7px 0; }
.options > summary { cursor: pointer; font-weight: 600; font-size: 13.5px; color: var(--muted); }
.options[open] > summary { color: var(--ink); margin-bottom: 10px; }
.options-body { display: grid; gap: 12px; max-width: var(--measure); padding-bottom: 6px; }

.lede { max-width: var(--measure); color: var(--muted); }
.section-title { margin-top: 14px; font-size: 16px; }
.examples { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); }
.demo-notice { max-width: var(--measure); padding: 8px 12px; border-left: 3px solid var(--signal); background: var(--surface); font-size: 13.5px; }

.blank { margin: auto; max-width: 46ch; padding: 32px 0; text-align: left; }
.blank h2 { margin-bottom: 8px; font: italic 600 26px/1.2 var(--font-page); }
.blank p { color: var(--muted); margin-bottom: 8px; }
.blank .demo-notice { margin-top: 14px; }

.empty { color: var(--muted); font-style: italic; }
.waiting { color: var(--muted); }
.waiting::after { content: "…"; }

.error-note { padding: 8px 12px; border-left: 3px solid var(--danger); background: var(--surface); }
.error-note p:first-child { color: var(--danger); font-weight: 600; }
.error-hint { font-size: 13.5px; color: var(--muted); margin-top: 3px; }
.ok { color: var(--ok); }

/* ---------- conversation ---------- */

.side {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 16px 12px;
  border-right: 1px solid var(--line);
  min-height: 0;
}
.chat-list { list-style: none; overflow-y: auto; display: grid; gap: 1px; align-content: start; }
.chat-list li { display: flex; align-items: center; border-radius: var(--radius); }
.chat-list li.current { background: var(--petrol-wash); }
.chat-list .chat-open {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: left;
  border: 0;
  background: none;
  padding: 7px 8px;
}
.chat-list li.empty { padding: 7px 8px; font-size: 13.5px; }
.chat-list .quiet { padding: 2px 8px; font-size: 17px; line-height: 1; }

.transcript, .rounds {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 8px 4px 8px 0;
}

.message { max-width: var(--measure); }
.message.from-user { align-self: flex-end; max-width: min(60ch, 85%); }
.bubble { padding: 8px 14px; border-radius: 14px 14px 3px 14px; background: var(--petrol-wash); white-space: pre-wrap; overflow-wrap: anywhere; }
.byline { margin-bottom: 2px; font-size: 12.5px; font-weight: 600; color: var(--muted); }
.message.pending .byline::after { content: ""; display: inline-block; width: 7px; height: 7px; margin-left: 7px; border-radius: 50%; background: var(--signal); }
.message-actions { display: flex; gap: 2px; margin: 4px 0 0 -10px; }
.message-actions button { font-size: 13px; padding: 2px 10px; }
.fired { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.fired li { padding: 1px 10px; border: 1px solid var(--signal); border-radius: 999px; font-size: 12.5px; }
.reasoning { margin-bottom: 6px; font-size: 13.5px; color: var(--muted); }
.reasoning summary { cursor: pointer; }
.reasoning-body { white-space: pre-wrap; padding: 6px 0 6px 12px; border-left: 2px solid var(--line); }

.prose { font-size: 16px; line-height: 1.6; overflow-wrap: anywhere; }
.prose > * + * { margin-top: 0.7em; }
.prose h3 { font-size: 1.2em; }
.prose h4, .prose h5, .prose h6 { font-size: 1.05em; }
.prose ul, .prose ol { padding-left: 1.4em; }
.prose li + li { margin-top: 0.25em; }
.prose pre { padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); overflow-x: auto; }
.prose :not(pre) > code { padding: 1px 5px; border-radius: 4px; background: var(--petrol-wash); }
.prose blockquote { padding-left: 12px; border-left: 3px solid var(--line); color: var(--muted); }
.prose hr { border: 0; border-top: 1px solid var(--line); }

.composer {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  padding-top: 4px;
}
.composer textarea { flex: 1; max-height: 40vh; }

/* ---------- token confidence ---------- */

.token-flow { font-size: 16px; line-height: 1.9; white-space: pre-wrap; }
.token { padding: 1px 0; border: 0; border-radius: 3px; background: none; white-space: pre-wrap; font: inherit; cursor: pointer; }
.token.band-0 { background: color-mix(in srgb, var(--no) 60%, transparent); }
.token.band-1 { background: color-mix(in srgb, var(--no) 40%, transparent); }
.token.band-2 { background: color-mix(in srgb, var(--no) 24%, transparent); }
.token.band-3 { background: color-mix(in srgb, var(--no) 11%, transparent); }
.token:hover, .token:focus-visible { outline: 1px solid var(--ink); }
.token.newline { color: var(--muted); }
.token-legend { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 8px; font-size: 12.5px; color: var(--muted); }
.token-legend .token { padding: 1px 6px; cursor: default; color: var(--ink); }
.token-detail { margin-top: 8px; padding: 8px 12px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); font-size: 13.5px; }
.alternatives { list-style: none; display: grid; gap: 3px; margin-top: 6px; }
.alternatives li { display: grid; grid-template-columns: 11em 1fr 4em; gap: 8px; align-items: center; }
.alternatives .bar { height: 8px; border-radius: 4px; background: linear-gradient(90deg, var(--petrol) var(--share), var(--pending) var(--share)); }
.alternatives .share { text-align: right; font-variant-numeric: tabular-nums; }

/* ---------- takes: blind replies and draft paragraphs ---------- */

.takes { display: grid; grid-template-columns: repeat(var(--count, 2), minmax(0, 1fr)); gap: 12px; align-items: start; }
.take {
  display: grid;
  gap: 8px;
  padding: 12px 14px 14px;
  border: 1px solid var(--line);
  border-top: 3px solid var(--line);
  border-radius: 4px 4px var(--radius) var(--radius);
  background: var(--surface);
  min-width: 0;
}
.take header { display: flex; align-items: baseline; gap: 10px; }
/* The one loud typographic element in the app: the neutral letter a blind reply hides behind. */
.letter { font: italic 600 38px/0.9 var(--font-page); color: var(--petrol); }
.take.draft .letter { font-size: 22px; }
.take.writing { border-top-color: var(--signal); }
.take.won { border-color: var(--petrol); border-top-color: var(--petrol); }
.take.lost { opacity: 0.8; }
.take .prose { font-size: 15px; }
.take > button { justify-self: start; }
.who { font-weight: 600; }
.badge { margin-left: auto; padding: 1px 10px; border-radius: 999px; background: var(--petrol); color: var(--on-petrol); font-size: 12.5px; font-weight: 600; }

.round { position: relative; display: flex; flex-direction: column; gap: 10px; padding-bottom: 14px; border-bottom: 1px dashed var(--line); }
.round-number { order: -1; font-size: 12.5px; font-weight: 600; color: var(--muted); }
.round.decided > .take { max-width: var(--measure); }
.others > summary { cursor: pointer; font-size: 13.5px; color: var(--muted); }
.others .takes { margin-top: 8px; }

.board { padding: 16px 16px 20px; border-left: 1px solid var(--line); background: var(--surface); overflow-y: auto; display: flex; flex-direction: column; gap: 10px; align-items: flex-start; }
.board h2 { font-size: 16px; }
.tally strong { font: italic 600 34px/1 var(--font-page); color: var(--petrol); margin-right: 4px; }

table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
th, td { padding: 5px 8px 5px 0; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
thead th { font-size: 12.5px; color: var(--muted); font-weight: 600; }
tbody th { font-weight: 600; }
.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.sub { display: block; font-weight: 400; font-size: 12.5px; color: var(--muted); }

.contenders { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; padding-bottom: 6px; }
.contenders > .field-hint { grid-column: 1 / -1; }
.contender, .trigger, .connection { display: grid; gap: 10px; padding: 12px 14px 14px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.contender legend, .trigger legend, .connection legend { padding: 0 6px; font-weight: 650; }
.contender .picker select, .contender .picker .model-select, .contender .picker input { width: 100%; max-width: none; }
.contenders > button { justify-self: start; align-self: start; }

/* ---------- write ---------- */

.tool.write .stage { max-width: 980px; }
.page {
  flex: 1 0 38vh;
  padding: 26px clamp(18px, 5vw, 56px);
  border: 1px solid var(--line);
  border-radius: 3px;
  background: var(--raised);
  font: 18px/1.7 var(--font-page);
  resize: none;
}
.page[readonly] { border-style: dashed; }
.count { margin-left: auto; font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.write-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.takes-panel { display: grid; gap: 10px; padding-bottom: 12px; }
.takes-panel:focus { outline: none; }
.draft-text { font: 16.5px/1.65 var(--font-page); }
.take-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.keys { flex-basis: 100%; font-size: 13px; color: var(--muted); }

/* ---------- maps ---------- */

.tool.maps .question { flex: 1 1 22em; min-width: 14em; font-size: 16px; }
.map-heading h2 { font: italic 600 24px/1.25 var(--font-page); }
.map-heading p { color: var(--muted); font-size: 13.5px; }
progress { width: 100%; height: 6px; accent-color: var(--signal); }
.map-frame { border: 1px solid var(--line); border-radius: 4px; background: var(--surface); padding: 8px; }
.world { display: block; width: 100%; height: auto; }
.place { fill: var(--pending); stroke: var(--surface); stroke-width: 0.6; stroke-linejoin: round; transition: fill 0.25s; }
.place.yes { fill: var(--yes); }
.place.no { fill: var(--no); }
.place.other { fill: var(--other); }
.place.error { fill: var(--failed); }
.place:hover { stroke: var(--ink); stroke-width: 1.3; }
.legend { list-style: none; display: flex; flex-wrap: wrap; gap: 18px; font-size: 13.5px; }
.swatch { display: inline-block; width: 12px; height: 12px; margin-right: 6px; border-radius: 2px; background: var(--pending); vertical-align: -1px; }
.swatch.yes { background: var(--yes); }
.swatch.no { background: var(--no); }
.swatch.other { background: var(--other); }
.swatch.error { background: var(--failed); }
.caveat { max-width: var(--measure); font-size: 13px; color: var(--muted); }
.map-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.map-actions select { max-width: 24em; }
.answers { display: grid; gap: 8px; }
.answers .reply { color: var(--muted); overflow-wrap: anywhere; }

/* ---------- triggers and connections ---------- */

.trigger-list, .connection-list { display: grid; gap: 12px; }
.trigger.off { opacity: 0.7; }
.trigger-grid, .connection-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; }
.trigger-actions, .data-actions, .add-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.prompt-preview { margin-top: 8px; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); white-space: pre-wrap; font-size: 13px; max-width: var(--measure); }
.activity { list-style: none; display: grid; gap: 3px; font-size: 13.5px; }
.activity time { color: var(--muted); font-variant-numeric: tabular-nums; }
.privacy { font-size: 13.5px; padding-left: 10px; border-left: 3px solid var(--ok); }
.privacy.remote { border-left-color: var(--signal); }
.connection.demo { background: none; border-style: dashed; color: var(--muted); }
.about { margin-top: 10px; font-size: 13px; color: var(--muted); }

/* ---------- generation settings ---------- */

.chat-controls { display: grid; gap: 8px; }
.chat-controls .options-body { max-height: 44vh; overflow-y: auto; padding-right: 8px; }
.dials { display: flex; flex-wrap: wrap; gap: 6px 18px; align-items: center; }
.dials label { display: inline-flex; align-items: center; gap: 7px; font-size: 13.5px; }
.dials label > span { color: var(--muted); font-weight: 600; }
.dials input[type="number"] { width: 5.2em; }
.pill { margin-left: 8px; padding: 0 9px; border-radius: 999px; background: var(--petrol-wash); color: var(--petrol); font-size: 12px; font-weight: 600; }
.picker-slot { display: contents; }

.tool-switches, .shared-settings { display: grid; gap: 8px; padding: 10px 14px 12px; border: 1px solid var(--line); border-radius: var(--radius); }
.tool-switches legend, .shared-settings legend { padding: 0 6px; font-size: 13px; font-weight: 600; }
.shared-settings { grid-column: 1 / -1; background: var(--surface); }
.check.unavailable { color: var(--muted); }
.check > span > .field-hint { font-weight: 400; }

/* ---------- documents, status, tool steps ---------- */

.stage.dropping { outline: 2px dashed var(--petrol); outline-offset: -8px; }
.docs-bar { display: flex; flex-wrap: wrap; gap: 6px; }
.doc-chip { display: inline-flex; align-items: center; gap: 4px; padding: 2px 4px 2px 10px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); font-size: 13px; }
.doc-chip.missing { border-style: dashed; color: var(--muted); }
.doc-chip .warn { color: var(--danger); }
.doc-chip button { padding: 0 7px; font-size: 16px; line-height: 1.2; }

.status-line { display: flex; align-items: center; gap: 8px; min-height: 1.6em; font-size: 13.5px; }
.pulse { width: 9px; height: 9px; border-radius: 50%; background: var(--signal); animation: pulse 1.1s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: 0.25; } }

.steps, .sources { margin: 4px 0 8px; padding: 6px 12px; border-left: 3px solid var(--line); background: var(--surface); font-size: 13.5px; }
.steps > summary, .sources > summary { cursor: pointer; font-weight: 600; color: var(--muted); }
.steps ol, .sources ol { display: grid; gap: 8px; margin: 8px 0 4px; padding-left: 1.6em; }
/* A long list of passages scrolls inside its fold, so the answer below stays in view. */
.sources ol { max-height: 17em; overflow-y: auto; padding-right: 8px; }
.step-mark { padding: 0 8px; border-radius: 999px; border: 1px solid var(--line); font-size: 12px; font-weight: 600; }
.step.done .step-mark { border-color: var(--ok); color: var(--ok); }
.step.failed .step-mark, .step.declined .step-mark { border-color: var(--danger); color: var(--danger); }
.step.running .step-mark, .step.waiting .step-mark { border-color: var(--signal); }
.steps pre, .approval pre { margin-top: 6px; padding: 8px 10px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--raised); white-space: pre-wrap; overflow-wrap: anywhere; max-height: 14em; overflow-y: auto; font-size: 12.5px; }
.results { list-style: none; display: grid; gap: 6px; margin-top: 6px; }
.results p, .sources p { color: var(--muted); }
.approval { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 8px; padding: 10px 12px; border: 2px solid var(--signal); border-radius: var(--radius); background: var(--raised); }
.approval pre, .approval p { flex-basis: 100%; margin-top: 0; }
.notes { list-style: none; margin-top: 6px; font-size: 13px; color: var(--muted); }
.notes li { padding-left: 10px; border-left: 3px solid var(--signal); }
.stats { margin-left: auto; align-self: center; font-size: 12.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.message-actions { align-items: center; }
.rate-bar { display: inline-block; width: 30px; height: 7px; margin-right: 7px; border-radius: 4px; background: linear-gradient(90deg, var(--petrol) var(--share), var(--pending) var(--share)); }

/* ---------- connections: found servers and models ---------- */

.found { display: grid; gap: 8px; }
.found-row { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; padding: 10px 14px; border: 1px solid var(--petrol); border-radius: var(--radius); background: var(--petrol-wash); }
.found-row p { flex: 1 1 20em; }
.model-chips { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.model-chips li { padding: 2px 10px; border: 1px solid var(--line); border-radius: 999px; background: var(--raised); font-size: 13px; }
.recommended { list-style: none; display: grid; gap: 10px; margin: 10px 0; }
.recommended li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px 14px; align-items: center; padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.recommended p { font-size: 13.5px; color: var(--muted); }
.download-slot { grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.download-slot:empty { display: none; }
.download-slot progress { flex: 1 1 12em; height: 8px; }
.more-models .add-row input { max-width: 26em; }
.tools-panel { display: grid; gap: 12px; }

/* ---------- shortcuts ---------- */

dialog.shortcuts { width: min(560px, calc(100vw - 32px)); max-height: calc(100dvh - 48px); padding: 22px 26px; border: 1px solid var(--line); border-radius: 10px; background: var(--raised); color: var(--ink); }
dialog.shortcuts::backdrop { background: rgb(0 0 0 / 0.45); }
dialog.shortcuts h2 { font: italic 600 24px/1.2 var(--font-page); }
dialog.shortcuts h3 { margin: 14px 0 2px; font-size: 13px; color: var(--muted); }
dialog.shortcuts th { width: 11.5em; font-weight: 400; white-space: nowrap; }
dialog.shortcuts form { margin-top: 16px; text-align: right; }

/* ---------- toasts ---------- */

.toasts { position: fixed; right: 18px; bottom: 18px; z-index: 10; display: grid; gap: 8px; justify-items: end; max-width: min(420px, calc(100vw - 36px)); }
.toast { padding: 9px 14px; border-radius: var(--radius); background: var(--ink); color: var(--panel); box-shadow: 0 6px 22px rgb(0 0 0 / 0.22); }
.toast.error { background: var(--danger); color: var(--surface); }
.toast.trigger { background: var(--signal); color: #1d1300; font-weight: 600; }

.startup-note { max-width: 56ch; margin: 12vh auto; padding: 0 24px; }
.startup-note h1 { font: italic 600 28px/1.2 var(--font-page); margin-bottom: 10px; }
.startup-note p { margin-bottom: 10px; }

/* ---------- small screens ---------- */

@media (max-width: 860px) {
  .app { grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(0, 1fr) auto; }
  .rail { order: 2; flex-direction: row; justify-content: space-around; padding: 4px 6px; border-right: 0; border-top: 1px solid var(--line); overflow-x: auto; }
  .rail .brand, .rail .spacer, .rail .theme-switch, .rail .shortcuts-button { display: none; }
  .rail button { flex: 1; min-width: 0; font-size: 10.5px; }
  .tool.chat, .tool.compare { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr); }
  .tool.compare { grid-template-rows: minmax(0, 1fr) auto; }
  .side { border-right: 0; border-bottom: 1px solid var(--line); padding: 10px 16px; max-height: 24vh; }
  .board { border-left: 0; border-top: 1px solid var(--line); max-height: 34vh; }
  .stage { padding: 0 16px 14px; }
  .takes { grid-template-columns: minmax(0, 1fr); }
  .alternatives li { grid-template-columns: 7em 1fr 4em; }
}

@media (prefers-reduced-motion: reduce) {
  .signal { animation: none; background: var(--signal); }
  .pulse { animation: none; }
  .place { transition: none; }
}

@media print {
  .rail, .composer, .toolbar button, .signal, .toasts { display: none; }
  .app, .main, .view, .tool, .stage { display: block; height: auto; overflow: visible; }
}
