/* Solarized light, as in the slides app, with one accent per meaning:
   green runs, red stops and errors, orange holds, blue informs. */
:root {
  --page: #fdf6e3;
  --surface: #fffdf6;
  --chrome: #f4ecd6;
  --border: #e2d9bf;
  --border-strong: #cfc4a5;
  --text: #586e75;
  --muted: #93a1a1;
  --strong: #073642;
  --blue: #268bd2;
  --yellow: #b58900;
  --orange: #cb4b16;
  --green: #859900;
  --green-dark: #6c7c00;
  --red: #dc322f;
  --red-tint: #fdeceb;
  --orange-tint: #fdf1e8;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --mono: "JetBrains Mono", "SF Mono", Menlo, Consolas, monospace;
  --radius: 6px;
  --control: 28px;
  --editor-height: 58vh;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

body {
  margin: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--page);
  color: var(--text);
  font: 13px/1.4 var(--sans);
}

/* ---- Header ------------------------------------------------------------ */

header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 8px 14px;
  background: var(--chrome);
  border-bottom: 1px solid var(--border);
}
.identity { display: flex; align-items: center; gap: 10px; min-width: 0; }
.badge {
  font-size: 11px;
  padding: 1px 7px;
  border-radius: 999px;
  color: var(--muted);
  border: 1px solid var(--border);
}
.badge.dirty { color: var(--orange); border-color: var(--orange); }
.controls { display: flex; align-items: center; gap: 14px; flex-shrink: 0; }
.group { display: flex; align-items: center; gap: 6px; }

/* ---- Buttons ----------------------------------------------------------- */

button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: var(--control);
  padding: 0 11px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--strong);
  font: 500 13px var(--sans);
  cursor: pointer;
  transition: background 0.1s, border-color 0.1s, color 0.1s;
}
button svg { width: 14px; height: 14px; fill: currentColor; stroke: currentColor; stroke-linecap: round; }
button:hover:not(:disabled) { border-color: var(--muted); background: white; }
button:focus-visible { outline: 2px solid var(--blue); outline-offset: 1px; }
button:disabled { opacity: 0.45; cursor: default; }
kbd {
  font: 11px var(--sans);
  padding: 0 4px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.22);
}

button.primary { background: var(--green); border-color: var(--green); color: white; }
button.primary:hover:not(:disabled) { background: var(--green-dark); border-color: var(--green-dark); }
button.danger { color: var(--red); border-color: rgba(220, 50, 47, 0.45); }
button.danger:hover:not(:disabled) { background: var(--red); border-color: var(--red); color: white; }
button.icon { padding: 0 9px; color: var(--text); }
button.icon[aria-pressed="true"] { background: var(--strong); border-color: var(--strong); color: var(--page); }
button.small { height: 24px; padding: 0 9px; font-size: 12px; }

/* ---- Layout ------------------------------------------------------------ */

main { flex: 1; display: flex; min-height: 0; }
#work { flex: 1; display: flex; flex-direction: column; min-width: 0; }
#editor { height: var(--editor-height); min-height: 80px; background: var(--page); }
#editor textarea {
  width: 100%;
  height: 100%;
  border: 0;
  padding: 10px 14px;
  resize: none;
  outline: none;
  background: var(--page);
  color: var(--text);
  font: 14px/1.6 var(--mono);
}
#divider {
  height: 7px;
  background: var(--chrome);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  cursor: row-resize;
  position: relative;
}
#divider::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 2px;
  width: 32px;
  height: 1px;
  margin-left: -16px;
  border-top: 1px solid var(--border-strong);
  border-bottom: 1px solid var(--border-strong);
}
#repl { flex: 1; display: flex; flex-direction: column; min-height: 80px; background: var(--surface); }
#transcript { flex: 1; overflow: auto; padding: 10px 16px; font: 12.5px/1.55 var(--mono); }

.prompt-row {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 8px 14px;
  border-top: 1px solid var(--border);
  background: white;
}
.caret { color: var(--green); font: 600 14px/1.5 var(--mono); }
#prompt {
  flex: 1;
  border: 0;
  padding: 0;
  resize: none;
  outline: none;
  background: transparent;
  color: var(--strong);
  font: 13px/1.5 var(--mono);
}
#prompt::placeholder { color: var(--muted); }

/* ---- Transcript -------------------------------------------------------- */

.entry { margin: 0 0 12px; }
.entry .line { color: var(--strong); font-weight: 600; white-space: pre-wrap; }
.entry .line::before { content: "› "; color: var(--green); }
.entry.evaluate .line { font-weight: 500; color: var(--text); }
.entry.evaluate .line::before { content: "▸ "; color: var(--muted); }
.entry .ms { color: var(--muted); font-weight: 400; font-size: 11px; margin-left: 8px; }
.entry .title { color: var(--blue); margin-top: 2px; }
.entry .lines { margin: 2px 0 0; white-space: pre-wrap; padding-left: 14px; }
.entry .error {
  margin-top: 4px;
  padding: 6px 10px;
  border-left: 3px solid var(--red);
  border-radius: 0 var(--radius) var(--radius) 0;
  background: var(--red-tint);
  color: var(--red);
  white-space: pre-wrap;
}
.entry a.span { color: var(--red); font-weight: 600; text-decoration: underline; cursor: pointer; }
.entry table { border-collapse: collapse; margin: 6px 0 2px 14px; }
.entry th, .entry td { text-align: left; padding: 2px 14px 2px 6px; vertical-align: top; }
.entry th {
  color: var(--muted);
  font-weight: 500;
  font-family: var(--sans);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border-bottom: 1px solid var(--border);
}
.entry tr:nth-child(even) td { background: rgba(238, 232, 213, 0.45); }
.entry td.n { text-align: right; color: var(--muted); }
.entry .plus { color: var(--green); }
.entry .minus { color: var(--red); }
.entry .note, .note { color: var(--muted); padding-left: 14px; }
.log {
  margin: 0 0 12px;
  padding: 4px 10px;
  color: var(--muted);
  font-size: 11.5px;
  white-space: pre-wrap;
  border-left: 2px solid var(--border);
}
.evaluation { color: var(--green); margin: 0 0 12px; font-family: var(--sans); font-size: 12px; }
.evaluation.failed { color: var(--red); }

/* ---- A run held at a gate, break, step or interrupt -------------------- */

#held {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 14px;
  background: var(--orange-tint);
  border-top: 1px solid var(--orange);
  color: var(--orange);
}
#held > svg { width: 14px; height: 14px; fill: var(--orange); }
#held-title { flex: 1; font: 500 12px var(--mono); }

/* ---- Editor margin ----------------------------------------------------- */

/* breakpoint glyphs: debugger.css */

/* ---- Summary strip ----------------------------------------------------- */

#summary {
  background: var(--chrome);
  border-bottom: 1px solid var(--border);
  font-size: 12px;
  color: var(--text);
}
.summary-head { display: flex; align-items: center; gap: 8px; padding: 2px 6px 2px 14px; min-height: 26px; cursor: default; }
.summary-head button.icon { height: 20px; padding: 0 6px; border-color: transparent; background: transparent; }
.summary-state { display: inline-flex; align-items: center; gap: 5px; color: var(--muted); font-size: 11.5px; white-space: nowrap; }
.summary-state.stale { color: var(--orange); }
.summary-text { flex: 1; min-width: 0; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#summary.open .summary-text { white-space: normal; }
.summary-body { padding: 0 14px 8px; display: grid; gap: 3px; }
.summary-note { color: var(--muted); }
.summary-error { color: var(--red); }
.summary-analysis { color: var(--text); }
.finding { font: 12px/1.5 var(--mono); color: var(--text); }
.finding a { cursor: pointer; text-decoration: underline; color: var(--blue); }
.finding.error a { color: var(--red); }
.finding.warning a { color: var(--yellow); }

/* ---- Welcome strip: starting from an example (starters.js) -------------- */

#welcome {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 6px 4px 14px;
  background: var(--chrome);
  border-bottom: 1px solid var(--border);
  font-size: 12px;
  color: var(--text);
}
#welcome[hidden] { display: none; }
.welcome-text { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.welcome-text strong { color: var(--strong); font-weight: 600; }
#welcome button.icon { height: 20px; padding: 0 6px; border-color: transparent; background: transparent; }

/* ---- Panels: Ask, Review, Scenarios ------------------------------------ */

button.panel-toggle[aria-pressed="true"] { background: var(--strong); border-color: var(--strong); color: var(--page); }
button.panel-toggle.ask { color: var(--blue); border-color: rgba(38, 139, 210, 0.5); }
button.panel-toggle.ask[aria-pressed="true"] { background: var(--blue); border-color: var(--blue); color: white; }
.count {
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--orange);
  color: white;
  font-size: 11px;
  font-weight: 600;
  line-height: 18px;
  text-align: center;
}
.tab { display: flex; flex-direction: column; min-height: 100%; }
#ask-tab { height: 100%; min-height: 0; }

/* The thread's header: one line, whatever the drawer's width. */
.thread-head { display: flex; align-items: center; gap: 8px; min-height: 26px; margin-bottom: 8px; }
.thread-head .thread-title { flex: 1; min-width: 0; font-size: 13.5px; }
.thread-title { font-weight: 600; color: var(--strong); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
button.back, button.quiet {
  flex: none;
  white-space: nowrap;
  border-color: transparent;
  background: none;
  color: var(--text);
  padding: 0 7px;
}
button.back:hover:not(:disabled), button.quiet:hover:not(:disabled) { border-color: var(--border-strong); background: var(--surface); }
button.quiet { color: var(--muted); }
button.quiet:hover:not(:disabled) { color: var(--red); }

.threads { flex: 1; overflow: auto; display: flex; flex-direction: column; gap: 6px; min-height: 0; margin: 0 -14px; padding: 0 14px 4px; }
.threads .empty { color: var(--muted); font-size: 12.5px; line-height: 1.55; margin: 4px 0; }

/* The inbox. */
.thread-item {
  flex: none;
  height: auto;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 3px 10px;
  align-items: center;
  padding: 8px 10px;
  text-align: left;
  font-weight: 400;
  background: var(--surface);
  border-color: var(--border);
}
.thread-item .when { color: var(--muted); font-size: 11px; white-space: nowrap; }
.thread-item .thread-status {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  color: var(--muted);
  font-size: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.thread-item.running .thread-status { color: var(--text); }

/* A transcript: turns of a request, what the agent did, and its reply. */
.turn { display: flex; flex-direction: column; gap: 6px; }
.turn + .turn { margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--border); }
.msg { font-size: 13px; line-height: 1.55; overflow-wrap: break-word; }
.msg.user {
  align-self: flex-end;
  max-width: 88%;
  padding: 6px 11px;
  border-radius: 12px 12px 3px 12px;
  background: #eee8d5;
  border: 1px solid var(--border);
  color: var(--strong);
  white-space: pre-wrap;
}
.msg.user.queued { opacity: 0.6; border-style: dashed; }
.msg.assistant { color: var(--strong); }
.msg.draft { opacity: 0.85; }
.msg.error {
  padding: 6px 10px;
  border-left: 3px solid var(--red);
  border-radius: 0 var(--radius) var(--radius) 0;
  background: var(--red-tint);
  color: var(--red);
  white-space: pre-wrap;
}
.msg.notice { color: var(--muted); font-size: 12px; }

/* Markdown, in replies, thoughts and notes. */
.md { overflow-wrap: break-word; }
.md > :first-child { margin-top: 0; }
.md > :last-child { margin-bottom: 0; }
.md p, .md ul, .md ol, .md blockquote, .md .code-block, .md .md-table { margin: 0 0 8px; }
.md h1, .md h2, .md h3, .md h4, .md h5, .md h6 { margin: 12px 0 6px; color: var(--strong); line-height: 1.3; }
.md h1 { font-size: 16px; }
.md h2 { font-size: 15px; }
.md h3 { font-size: 14px; }
.md h4, .md h5, .md h6 { font-size: 13px; }
.md ul, .md ol { padding-left: 20px; }
.md li { margin: 2px 0; }
.md li > ul, .md li > ol { margin: 2px 0 0; }
.md strong { color: var(--strong); font-weight: 600; }
.md a { color: var(--blue); text-decoration: none; }
.md a:hover { text-decoration: underline; }
.md hr { border: none; border-top: 1px solid var(--border); margin: 10px 0; }
.md blockquote { margin-left: 0; padding-left: 10px; border-left: 3px solid var(--border-strong); color: var(--text); }
.md code { font: 12px var(--mono); padding: 1px 4px; border-radius: 3px; background: var(--chrome); color: var(--strong); }
.md .code-block { position: relative; border: 1px solid var(--border); border-radius: var(--radius); background: var(--page); }
.md .code-block pre { margin: 0; padding: 8px 10px; overflow-x: auto; font: 12px/1.5 var(--mono); }
.md .code-block code { padding: 0; background: none; font: inherit; color: var(--text); }
.md .code-lang { position: absolute; top: 3px; left: 10px; font: 10px var(--sans); color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; }
.md .code-lang + button.copy + pre { padding-top: 18px; }
.md button.copy {
  position: absolute;
  top: 3px;
  right: 3px;
  height: 20px;
  padding: 0 6px;
  font: 11px var(--sans);
  color: var(--muted);
  background: var(--page);
  border-color: var(--border);
  opacity: 0;
}
.md .code-block:hover button.copy, .md button.copy:focus-visible { opacity: 1; }
.md .md-table { overflow-x: auto; }
.md table { border-collapse: collapse; font-size: 12px; }
.md th, .md td { padding: 3px 9px; border: 1px solid var(--border); text-align: left; vertical-align: top; }
.md th { background: var(--chrome); color: var(--strong); font-weight: 600; }
.tok-keyword { color: #859900; }
.tok-type { color: #b58900; }
.tok-operator { color: #cb4b16; }
.tok-string { color: #2aa198; }
.tok-number { color: #d33682; }
.tok-comment { color: var(--muted); font-style: italic; }

/* What the agent did: quiet rows, a group when several are consecutive. */
.tool, .tool-group, .thought { font-size: 12px; color: var(--muted); }
.tool > summary, .tool-group > summary, .thought > summary {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
  padding: 2px 0;
  cursor: pointer;
  list-style: none;
  white-space: nowrap;
}
.tool > summary::-webkit-details-marker, .tool-group > summary::-webkit-details-marker, .thought > summary::-webkit-details-marker { display: none; }
.tool > summary:hover .tool-label, .tool-group > summary:hover .tool-label, .thought > summary:hover { color: var(--strong); }
.tool-label { flex: none; color: var(--text); }
.tool-detail { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.tool-group > summary .tool-label::after, .tool > summary .tool-label::after { content: " ›"; color: var(--muted); }
.tool-group[open] > summary .tool-label::after, .tool[open] > summary .tool-label::after { content: " ⌄"; }
.tool-group-body { margin: 2px 0 2px 5px; padding-left: 12px; border-left: 1px solid var(--border); display: flex; flex-direction: column; }
.tool-body { margin: 2px 0 6px 18px; }
.tool-section { font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.04em; margin: 6px 0 2px; }
.tool-body pre {
  margin: 0;
  max-height: 220px;
  overflow: auto;
  padding: 6px 8px;
  border-radius: 4px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  font: 11.5px/1.45 var(--mono);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.tool-body pre.error { color: var(--red); }

/* A call's state: a spinner while it runs, a check or a cross after. */
.status { flex: none; display: inline-block; width: 11px; height: 11px; text-align: center; font-size: 10px; line-height: 11px; }
.status.running { border: 1.5px solid var(--border-strong); border-top-color: var(--blue); border-radius: 50%; animation: spin 0.8s linear infinite; }
.status.ok::before { content: "✓"; color: var(--green); }
.status.error::before { content: "✕"; color: var(--red); }
.status.lost::before { content: "·"; }
@keyframes spin { to { transform: rotate(360deg); } }

.thought { padding: 2px 0; }
.thought.live { color: var(--text); }
.thought .thought-text { margin: 4px 0 4px 2px; padding-left: 10px; border-left: 2px solid var(--border); color: var(--muted); font-size: 12px; }

.note-card { padding: 7px 10px; border: 1px solid var(--border); border-left: 3px solid var(--blue); border-radius: var(--radius); background: var(--surface); }
.note-title { font-size: 11px; font-weight: 600; color: var(--blue); margin-bottom: 2px; }
.note-title::before { content: "Note · "; color: var(--muted); font-weight: 400; }
.note-text { font-size: 12.5px; color: var(--strong); }

.plan { padding: 6px 10px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); font-size: 12px; }
.plan.pinned { position: sticky; top: 0; z-index: 1; box-shadow: 0 2px 6px rgba(7, 54, 66, 0.06); }
.plan-head { font-size: 11px; font-weight: 600; color: var(--muted); margin-bottom: 3px; }
.plan ul { margin: 0; padding: 0; list-style: none; }
.plan li { display: flex; gap: 6px; padding: 1px 0; color: var(--text); }
.plan .mark { flex: none; width: 13px; height: 13px; margin-top: 2px; border: 1px solid var(--border-strong); border-radius: 3px; font-size: 10px; line-height: 12px; text-align: center; }
.plan li.completed { color: var(--muted); text-decoration: line-through; }
.plan li.completed .mark { border-color: var(--green); color: var(--green); text-decoration: none; }
.plan li.in_progress { color: var(--strong); font-weight: 500; }
.plan li.in_progress .mark { border-color: var(--blue); color: var(--blue); }

.running-line { display: flex; align-items: center; gap: 7px; color: var(--text); font-size: 12px; padding: 2px 0; min-width: 0; }
.running-line .activity { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.running-line .elapsed { margin-left: auto; color: var(--muted); font-variant-numeric: tabular-nums; }
.turn-foot { color: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; }

/* The composer. */
.composer { flex: none; display: flex; flex-direction: column; gap: 5px; margin-top: 8px; }
.composer textarea {
  resize: none;
  min-height: 36px;
  padding: 8px 10px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  background: white;
  color: var(--strong);
  font: 13px/1.5 var(--sans);
  outline: none;
  overflow-y: auto;
}
.composer textarea:focus { border-color: var(--blue); }
.composer-row { display: flex; align-items: center; gap: 8px; min-width: 0; }
.composer-row .where { flex: 1; min-width: 0; color: var(--muted); font-size: 11.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.composer-row .settings { color: var(--muted); font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 45%; }

/* ---- Scenarios drawer -------------------------------------------------- */

#drawer {
  width: 420px;
  display: flex;
  flex-direction: column;
  border-left: 1px solid var(--border);
  background: var(--chrome);
  overflow: auto;
  padding: 12px 14px;
}
#drawer h2 { font-size: 14px; margin: 0 0 4px; color: var(--strong); }
.hint { color: var(--muted); font-size: 12px; margin: 0 0 12px; }
.notice { color: var(--text); font-size: 12px; margin: 0 0 12px; }
.hint code { font-family: var(--mono); font-size: 11px; }
.scenario {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 9px 10px;
  margin-bottom: 8px;
}
.scenario-head { display: flex; align-items: center; gap: 8px; }
.scenario-name { flex: 1; font: 500 12px var(--mono); color: var(--strong); }
.scenario .verdict { font-size: 11px; font-weight: 600; }
.scenario .result { font: 11.5px/1.55 var(--mono); margin-top: 8px; white-space: pre-wrap; }
.scenario .pass, .scenario .verdict.pass { color: var(--green); }
.scenario .fail, .scenario .verdict.fail { color: var(--red); }
.scenario .xfail { color: var(--yellow); }
.scenario .why { color: var(--muted); padding-left: 1.5em; }

/* ---- Status strip ------------------------------------------------------ */

/* Quiet while all is well: muted text, a dot; trouble reads stronger. */
footer {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 24px;
  padding: 3px 14px;
  background: var(--chrome);
  border-top: 1px solid var(--border);
  font-size: 11px;
  color: var(--muted);
}
.pill { display: inline-flex; align-items: center; gap: 5px; color: var(--muted); white-space: nowrap; }
.pill:empty { display: none; }
.pill:has(.state.bad) { color: var(--text); white-space: normal; }
#lane { cursor: pointer; }
#lane:hover { color: var(--text); }
.state { width: 6px; height: 6px; border-radius: 50%; background: var(--muted); display: inline-block; flex: none; }
.state.ok { background: var(--green); }
.state.busy { background: var(--yellow); animation: pulse 1s ease-in-out infinite; }
.state.bad { background: var(--red); }
.pill.held { color: var(--orange); font-weight: 600; }
button.quiet-link {
  height: auto;
  padding: 0;
  border: none;
  background: none;
  color: var(--muted);
  font: 11px var(--sans);
}
button.quiet-link:hover:not(:disabled) { background: none; color: var(--text); }
#restart { color: var(--blue); text-decoration: underline; }
.status-keys { margin-left: auto; display: flex; gap: 14px; }
#hints.locked { color: var(--blue); }
@keyframes pulse { 50% { opacity: 0.35; } }

/* ---- Accounts (server mode) -------------------------------------------- */

.account { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 12px; }

body.login { align-items: center; justify-content: center; }
body.login form {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 280px;
  padding: 24px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
body.login label { display: flex; flex-direction: column; gap: 4px; color: var(--muted); }
body.login input {
  height: var(--control);
  padding: 0 8px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  background: var(--page);
  color: var(--strong);
  font: 13px var(--sans);
}
body.login input:focus-visible { outline: 2px solid var(--blue); outline-offset: 1px; }
body.login button { justify-content: center; }
body.login .error { margin: 0; min-height: 1.4em; color: var(--red); }
body.login .alt { margin: 0; color: var(--muted); font-size: 12px; }
body.login .alt a { color: var(--blue); }
body.login .hint { margin: 0; color: var(--muted); font-size: 12px; max-width: 28em; }

/* ---- Project, files and tabs ------------------------------------------- */

#project {
  height: var(--control);
  max-width: 220px;
  padding: 0 6px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--strong);
  font: 600 13px var(--mono);
}
#files {
  width: 190px;
  flex-shrink: 0;
  overflow: auto;
  border-right: 1px solid var(--border);
  background: var(--chrome);
}
.files-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 10px 6px 12px;
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
/* New shows with the pointer or focus on the list (and in the palette). */
#files:not(:hover, :focus-within) #new-file { visibility: hidden; }
.file-row {
  display: flex;
  width: 100%;
  height: 26px;
  gap: 6px;
  padding: 0 10px 0 12px;
  border: 0;
  border-radius: 0;
  background: transparent;
  font: 12.5px var(--mono);
  color: var(--text);
}
.file-row:hover:not(:disabled) { background: var(--surface); }
.file-row.active { background: var(--surface); color: var(--strong); font-weight: 600; }
.file-row .name { flex: 1; overflow: hidden; text-overflow: ellipsis; text-align: left; }
.file-row .main-mark { font: 10.5px var(--sans); color: var(--green); }
.file-action { display: none; font: 10.5px var(--sans); color: var(--muted); }
.file-action:hover { color: var(--blue); text-decoration: underline; }
.file-row:hover .file-action { display: inline; }

#tabs {
  display: flex;
  gap: 1px;
  overflow-x: auto;
  background: var(--chrome);
  border-bottom: 1px solid var(--border);
}
.file-tab {
  height: 30px;
  gap: 6px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--text);
  font: 12.5px var(--mono);
}
.file-tab.active { background: var(--page); color: var(--strong); box-shadow: inset 0 2px var(--blue); }
.file-tab .unsaved-dot { color: var(--orange); font-size: 9px; }
.file-tab .close { color: var(--muted); padding: 0 2px; }
.file-tab .close:hover { color: var(--red); }

/* ---- Versions: the viewer and the time slider (more in diff.css) ------ */

#viewer { height: var(--editor-height); min-height: 80px; background: var(--surface); }
#timeline { border-top: 1px solid var(--border); background: var(--chrome); }
.timeline-row { display: flex; align-items: center; gap: 10px; padding: 3px 14px; }
#timeline-slider { flex: 1; accent-color: var(--blue); }
#timeline-label { font: 11.5px var(--mono); color: var(--muted); white-space: nowrap; }
#viewing {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  background: rgba(38, 139, 210, 0.08);
  border-bottom: 1px solid rgba(38, 139, 210, 0.35);
  color: var(--blue);
}
#viewing-title { flex: 1; font: 500 12px var(--mono); }

/* The evaluation mode: three quiet words, the current one filled. */
.mode-switch { display: inline-flex; border: 1px solid var(--border); border-radius: 6px; overflow: hidden; }
.mode-switch button { height: 26px; padding: 0 9px; border: none; border-radius: 0; background: transparent; color: var(--muted); font: 500 12px var(--sans); }
.mode-switch button + button { border-left: 1px solid var(--border); }
.mode-switch button:hover:not(:disabled) { background: var(--surface); color: var(--text); }
.mode-switch button[aria-checked="true"] { background: var(--strong); color: var(--surface); }
