/* Bulbboard. Palette: colorhunt.co/palette/522d6080426ef2a67bffd38b.
   Lamps: steady gold = working, pulsing rose with a ring = waiting for you, an empty gold ring = idle,
   unlit = no session (see "lamps" below). */

/* Archivo (SIL Open Font License, archivo-OFL.txt), the variable font with its width and weight axes,
   in the two subsets Google Fonts serves for Latin text. It comes with the page, so opening it asks
   nothing of anyone. */
@font-face {
  font-family: 'Archivo';
  font-style: normal;
  font-weight: 300 800;
  font-stretch: 62% 125%;
  font-display: swap;
  src: url('archivo-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: 'Archivo';
  font-style: normal;
  font-weight: 300 800;
  font-stretch: 62% 125%;
  font-display: swap;
  src: url('archivo-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --sans: 'Archivo', ui-sans-serif, system-ui, -apple-system, sans-serif;
  --mono: ui-monospace, 'SF Mono', Menlo, monospace;
  --gutter: clamp(16px, 2.4vw, 32px);
  --toolbar-height: 56px;
  /* The corner of a focus ring where the element has none of its own (:focus-visible below): the ring follows the shape it surrounds. */
  --focus-radius: 6px;
}

* {
  box-sizing: border-box;
}

html {
  background: var(--night);
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--night);
  color: var(--ink);
  font: 400 15px/1.5 var(--sans);
  font-stretch: 100%;
  -webkit-font-smoothing: antialiased;
}

code {
  font: 400 12.5px/1.4 var(--mono);
  color: var(--ink-soft);
  overflow-wrap: anywhere;
}

code.block {
  display: block;
}

h1,
h2,
h3 {
  margin: 0;
  font-weight: 650;
  font-stretch: 112%;
  letter-spacing: 0.005em;
}

h2 {
  font-size: 15px;
}

h3 {
  font-size: 13.5px;
  color: var(--ink-soft);
}

small {
  font-size: 12.5px;
  color: var(--ink-faint);
}

button {
  font: inherit;
}

/* The Settings button's line icon shows where the button is narrow (the phone's bar, the rail), see the media queries below. */
.settings-icon {
  display: none;
}

/* One ring for the page. An outline follows the element's border-radius (WebKit, Chromium and Firefox), so the ring is as round as what
   it surrounds: an element that sets its own radius later in this file keeps it, every other one gets the token's, never a square ring. */
:focus-visible {
  outline: 2px solid var(--accent-ink);
  outline-offset: 2px;
  border-radius: var(--focus-radius);
}

/* Settings opened with the mouse puts focus in the dialog (public/app.js) without a ring, until a key is pressed in it. */
dialog[data-opened='pointer'] :focus-visible {
  outline: none;
}

[data-tone='bad'] {
  color: var(--bad-ink);
}

.quiet {
  color: var(--ink-faint);
}

/* ---------- toolbar: wordmark, views, usage, settings ---------- */

.toolbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 10px 28px;
  min-height: var(--toolbar-height);
  padding: 8px var(--gutter);
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--night) 92%, transparent);
  backdrop-filter: blur(10px);
}

.wordmark {
  font-size: 22px;
  font-weight: 800;
  font-stretch: 125%;
  letter-spacing: 0.01em;
  color: var(--accent-ink);
}

.orch-state[data-tone='busy'] {
  color: var(--work-ink);
}

.orch-state[data-tone='waiting'] {
  color: var(--bad-ink);
  font-weight: 600;
}

/* ---------- plan usage meters and settings ---------- */

.toolbar-end {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 10px 18px;
  margin-left: auto;
}

.usage {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 18px;
}

.meter {
  display: grid;
  grid-template-columns: auto 92px 3.2ch;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  color: var(--ink-soft);
  font-variant-numeric: tabular-nums;
}

.meter-label {
  color: var(--ink-faint);
}

.meter-track {
  position: relative;
  height: 6px;
  border-radius: 3px;
  background: var(--line);
}

.meter-fill {
  position: absolute;
  inset: 0 auto 0 0;
  border-radius: 3px;
  background: var(--gold);
}

.meter[data-tone='warm'] .meter-fill {
  background: var(--peach);
}

.meter[data-tone='bad'] .meter-fill {
  background: var(--rose);
}

.meter[data-tone='bad'] .meter-value {
  color: var(--bad-ink);
  font-weight: 600;
}

/* No window open: the meter stays in place, quiet, with a dash for the value. */
.meter[data-tone='none'] .meter-value {
  color: var(--ink-faint);
}

/* The pause line: where new work stops. */
.meter-line {
  position: absolute;
  top: -3px;
  bottom: -3px;
  width: 2px;
  margin-left: -1px;
  background: var(--ink-faint);
}

.meter-value {
  text-align: right;
}

/* When the window resets: small and faint beside the meter, the full time stays in the tooltip.
   The 4th column only when there is one, so no empty track adds a gap. */
.meter:has(.meter-reset) {
  grid-template-columns: auto 92px 3.2ch auto;
}

.meter-reset {
  font-size: 11px;
  color: var(--ink-faint);
  white-space: nowrap;
}

/* Below this width the labels would push Settings onto a second toolbar line, and the dock under the
   toolbar expects one. The label is then read out but not shown (as .visually-hidden); the tooltip and
   Activity keep the full time. */
@media (max-width: 1339px) {
  .toolbar .meter:has(.meter-reset) {
    grid-template-columns: auto 92px 3.2ch;
  }

  .toolbar .meter-reset {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
  }
}

/* ---------- what blocks work, at the top of the Inbox ---------- */

.needs {
  display: grid;
  gap: 8px;
  margin: 0 var(--gutter) 18px;
}

.needs[hidden] {
  display: none;
}

.needs h3 {
  color: var(--bad-ink);
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.needs-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr));
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.need {
  display: grid;
  grid-template-columns: 10px minmax(0, 1fr) auto;
  align-items: start;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-left: 3px solid var(--peach);
  border-radius: 6px;
  background: var(--panel);
}

.need[data-tone='waiting'] {
  border-left-color: var(--rose);
  background: var(--need-waiting-bg);
}

.need .lamp {
  margin-top: 6px;
}

/* A notice: nothing waits on it, so it is quieter than a blocker (no warn colour on its edge or its heading). */
.needs-notices h3 {
  color: var(--ink-faint);
}

.need[data-tone='info'] {
  border-left-color: var(--line);
  background: transparent;
}

.need-why summary {
  cursor: pointer;
  font-size: smaller;
}

.need-text {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.need-text strong {
  font-weight: 600;
  font-size: 14px;
}

/* Names and paths with no spaces break anywhere instead of pushing the page wider (test/visual). */
.need-text strong,
.need-text small,
.need-list li,
.queue-text small,
.mcp-line strong {
  overflow-wrap: anywhere;
}

/* macOS blocked a folder, or Claude Code would not start in an untrusted one: the row's full width. */
.need[data-kind='folder-access'],
.need[data-kind='untrusted'] {
  grid-column: 1 / -1;
}

/* Folder trust (Health) and the untrusted folders of Calls for you: a Trust button at the end of a line. */
.trust-group {
  display: grid;
  gap: 6px;
  margin-top: 14px;
}

.trust-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 6px 12px;
}

.trust-head h4 {
  margin: 0;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-faint);
  overflow-wrap: anywhere;
}

/* Before .mcp-list li in the file, so it needs the two classes to win. */
.mcp-list.trust-list li {
  grid-template-columns: 10px minmax(0, 1fr) auto;
}

.mcp-list.trust-list li > button {
  align-self: center;
}

.trust-refused li {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 2px 10px;
}

.trust-names {
  margin-bottom: 6px;
}

.need-list {
  display: grid;
  gap: 2px;
  margin: 4px 0 0;
  padding-left: 18px;
  font-size: smaller;
}

/* Why a step is not there: under the steps, as small as they are. */
.need-note {
  margin: 4px 0 0;
  font-size: smaller;
}

/* An answer to a session that asked a question in its reply: the field, then Send reply beside it. */
.reply-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: 8px;
  margin-top: 6px;
}

.reply-form textarea {
  min-width: 0;
  min-height: 38px;
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--night);
  color: var(--ink);
  font: inherit;
  font-size: 14px;
  resize: vertical;
}

.reply-form > :not(textarea, button) {
  grid-column: 1 / -1;
}

/* More than one action: stacked, right-aligned, in the item's last column. */
.need-actions {
  display: grid;
  gap: 6px;
  justify-items: end;
}

/* ---------- the board: one jack per repo ---------- */

.board {
  padding: 8px var(--gutter) 14px;
  background:
    radial-gradient(120% 140% at 50% 0%, var(--board-hi) 0%, var(--panel) 55%, var(--board-lo) 100%);
  border-block: 1px solid var(--line);
}

/* Outside Repos the board folds to this one row (syncOverview, public/app.js): the name, how many repos, a chevron. */
.overview-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  min-height: 40px;
  padding: 6px var(--gutter);
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  background: var(--panel);
  color: var(--ink-soft);
  font-size: 13px;
  text-align: left;
  cursor: pointer;
}

.overview-toggle[hidden],
.board[hidden] {
  display: none;
}

.overview-toggle::after {
  content: '';
  width: 7px;
  height: 7px;
  border-right: 2px solid var(--ink-soft);
  border-bottom: 2px solid var(--ink-soft);
  transform: rotate(45deg);
}

.overview-toggle[aria-expanded='true']::after {
  transform: rotate(-135deg);
}

.board-empty {
  margin: 12px 0;
  color: var(--ink-faint);
}

.rail {
  display: grid;
  grid-template-columns: minmax(120px, 170px) 1fr;
  gap: 8px 20px;
  align-items: start;
  padding-block: 12px;
}

.rail + .rail {
  border-top: 1px dashed var(--line);
}

.rail-label {
  padding-top: 10px;
  font-size: 12.5px;
  font-weight: 500;
  font-stretch: 112%;
  color: var(--ink-faint);
  overflow-wrap: anywhere;
}

.jacks {
  display: flex;
  flex-wrap: wrap;
  gap: 2px;
}

.jack {
  display: grid;
  justify-items: center;
  gap: 7px;
  width: 84px;
  padding: 9px 4px 7px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: none;
  color: var(--ink-faint);
  font-size: 11.5px;
  font-stretch: 88%;
  line-height: 1.2;
  cursor: pointer;
}

.jack:hover {
  border-color: var(--line);
  color: var(--ink-soft);
}

.jack[data-live] {
  color: var(--ink);
}

.rail-note {
  flex: 1 1 180px;
  align-self: center;
  margin: 0 0 0 10px;
  color: var(--ink-faint);
  font-size: 12.5px;
}

.rail-note .link-button {
  /* 24 px tall, so it is a target of its own next to the lamps (WCAG 2.5.8). */
  min-height: 24px;
  font-weight: 500;
  color: var(--ink-soft);
  white-space: nowrap;
}

/* A jack and its hide control, which shows on the jack's corner on hover or keyboard focus. */
.jack-slot {
  position: relative;
  display: flex;
}

/* 24 px: a target of its own size (WCAG 2.5.8), though it sits on the jack's corner. */
.jack-hide {
  position: absolute;
  top: 0;
  right: 4px;
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  padding: 0 0 1px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--panel);
  color: var(--ink-faint);
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
  opacity: 0;
  transition: opacity 120ms ease;
}

.jack-slot:hover .jack-hide,
.jack-slot:focus-within .jack-hide {
  opacity: 1;
}

.jack-hide:hover:not(:disabled) {
  border-color: var(--accent-ink);
  color: var(--accent-ink);
}

/* Without hover, the control would be invisible and in the way: hiding is in the repo's details there. */
@media (hover: none) {
  .jack-hide {
    display: none;
  }
}

.jack-socket {
  position: relative;
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--socket);
  box-shadow: var(--socket-shadow);
}

.jack-name {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* What the lamp means for this repo, in a word (working, calling, idle, on hold, plan limit, stopped, no session). */
.jack-word {
  max-width: 100%;
  margin-top: -4px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* lamp block: begin */
/* ---------- lamps ---------- */
/* As on an old telephone exchange, every lamp of the page has three looks, by what you must do (decided
   2026-11-19): Working is lit all over and steady, something of yours at work now; Calling is rose with a ring
   apart from its face, pulsing, you must act, the only look that moves; Quiet is unlit, a dark face in a mauve
   ring, for everything else (fine, idle, on hold, a plan limit Bulbboard continues after the reset, unknown,
   stopped, off, none). A word beside the lamp says which quiet one it is (SESSION_WORDS in dom.js); the shape
   never does, and there is no fourth. A session's lamp and any other mark of the page (Health, Inbox, setup,
   the exchange lamp, the loading screen's board, the Mac menu bar) are drawn by the same helper, lamp() in
   dom.js, which maps each state a mark can have to one of the three. Each stands 3:1 or more against what is
   behind it in both themes (WCAG 1.4.11), Quiet by its ring, and its word carries the state at the text's own
   contrast. Only the call moves, by opacity alone, which the compositor animates without painting;
   test/e2e/motion.spec.ts holds all of this.

   This block is the one place a lamp is drawn (test/lamp-states.test.ts finds a copy by its patterns): the rules
   around a lamp set where it stands and its --size, nothing else. docs/lamps.md has the sizes and where each is used. */

/* One outer size for every state: the lamp's box (the face, --size) plus a band of --ring all round it, whatever
   the state, so lamps stand side by side as the same size (test/visual/lamp-size.spec.ts). Sizes and ring are
   whole pixels (the --lamp-* tokens of palette.css), so the band is as thick on every side and the face sits in
   the middle of it (the same test measures that from pixels). Every state draws its ring in that band, outside its
   face, and its look inside the box stays its own, centred: nothing is lit from one side. A lit lamp's band is its
   colour edge (--edge, 1 px less than the band) and then the rim, which is mauve on paper and clear on the dark
   page, where the edge colour shows through it. The glow fades out past the band and is no part of the size. */
.lamp {
  --size: var(--lamp-size-normal);
  --ring: var(--lamp-ring);
  /* Quiet's band: a mauve ring round a dark face (3:1 against the page in both themes). */
  --edge: var(--lamp-off-ring);
  --glow: 0 0 0 0 transparent;
  --band: 0 0 0 calc(var(--ring) - 1px) var(--edge), 0 0 0 var(--ring) var(--lamp-rim), 0 0 0 var(--ring) var(--edge);
  position: relative;
  display: inline-block;
  flex: none;
  width: var(--size);
  height: var(--size);
  border-radius: 50%;
  /* Quiet: unlit, a dent in the socket, the same on every side. */
  background: radial-gradient(circle at 50% 50%, var(--lamp-off-hi) 0%, var(--lamp-off-lo) 75%);
  /* Quiet: a dark face in a mauve ring, so it is clearly unlit and still stands out 3:1 from what is behind it (WCAG 1.4.11). */
  box-shadow: var(--lamp-dent), var(--band);
}

/* The other sizes change the face and nothing else: the ring is the same band at every size. */
.lamp.medium {
  --size: var(--lamp-size-medium);
}

.lamp.small {
  --size: var(--lamp-size-small);
}

/* The smallest: the dot beside a view in the nav (app.js, navLinks). */
.lamp.tiny {
  --size: var(--lamp-size-tiny);
}

/* Working: gold, lit all over and steady. */
.lamp[data-state='busy'] {
  --edge: var(--lamp-busy-edge);
  --glow: 0 0 12px 2px rgb(255 211 139 / 0.42);
  background: var(--lamp-busy-face);
  box-shadow: var(--band), var(--glow);
}

/* Calling: rose, with a ring apart from its face, and it pulses. The ring is the border of its ::after, in
   the band all round the lamp, and its face is 1 px in from the box (padding, the face clipped to the content
   box), so the gap shows whatever is behind the lamp, and it holds when nothing moves. Not an outline:
   Chrome paints an outline again while its lamp pulses, the ::after rides on the lamp's own layer
   (test/visual/performance.spec.ts). Its face alone is 3:1 on paper, so it needs no rim. */
.lamp[data-state='waiting'] {
  --edge: var(--lamp-call-edge);
  --glow: 0 0 16px 4px rgb(255 143 143 / 0.45);
  padding: 1px;
  background: var(--lamp-call-face);
  background-origin: content-box;
  background-clip: content-box;
  box-shadow: var(--glow);
  animation: var(--lamp-call-pulse);
}

.lamp[data-state='waiting']::after {
  content: '';
  position: absolute;
  inset: calc(-1 * var(--ring));
  border: var(--ring) solid var(--lamp-call-ring);
  border-radius: 50%;
  pointer-events: none;
}

/* A small lamp has no glow: a lit one stands out by its face and its band; a quiet one by its ring. After the
   states, so its --glow wins at the same specificity. */
.lamp.small,
.lamp.tiny {
  --glow: 0 0 0 0 transparent;
}

/* The word beside a mark's lamp where its row has none of its own (markWord in dom.js). */
.mark-word {
  margin-left: 0.1em;
  color: var(--ink-soft);
  font-size: 0.85em;
  font-weight: 400;
}

.mark-word[data-state='busy'] {
  color: var(--work-ink);
}

.mark-word[data-state='waiting'],
.mark-word[data-state='warn'],
.mark-word[data-state='bad'] {
  color: var(--bad-ink);
}

@keyframes calling {
  50% {
    opacity: 0.4;
  }
}

@media (prefers-reduced-motion: reduce) {
  .lamp,
  .lamp::before,
  .lamp::after {
    animation: none !important;
  }
}

/* Calm (calm.js): nobody looks at the page, which is hidden or has been in the background a while.
   Lamps stop pulsing and show their state by colour and shape alone, at full strength; any other
   decoration holds still where it is. */
:root[data-calm] .lamp,
:root[data-calm] .lamp::before,
:root[data-calm] .lamp::after {
  animation: none !important;
}

:root[data-calm] *,
:root[data-calm] *::before,
:root[data-calm] *::after {
  animation-play-state: paused !important;
}
/* lamp block: end */

/* ---------- repo list ---------- */

.lines {
  padding: 24px var(--gutter) 64px;
}

/* "Repos": the section's own heading, as the other sections have theirs. */
.lines-head h2 {
  font-size: 22px;
  font-weight: 750;
  font-stretch: 115%;
}

.lines-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 24px;
  margin-bottom: 10px;
}

.filters {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 18px;
}

input[type='search'] {
  width: min(260px, 100%);
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel);
  color: var(--ink);
  font: inherit;
  font-size: 14px;
}

input[type='search']::placeholder {
  color: var(--ink-faint);
}

.toggle {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--ink-soft);
  font-size: 14px;
  cursor: pointer;
}

.toggle input {
  accent-color: var(--gold);
}

.repo-list {
  margin: 0;
  padding: 0;
  list-style: none;
  border-top: 1px solid var(--line);
}

/* The column names: the same grid as a row's summary (keep the two in step), the Tasks columns' header
   style, stuck under the toolbar while the list scrolls. */
.repo-head {
  position: sticky;
  top: var(--toolbar-height);
  z-index: 5;
  display: grid;
  grid-template-columns: 18px minmax(150px, 1.3fr) minmax(120px, 1fr) minmax(90px, 0.8fr) minmax(150px, 1.3fr) minmax(110px, 0.9fr);
  gap: 4px 16px;
  padding: 8px 8px 6px;
  background: var(--night);
}

.repo-head[hidden] {
  display: none;
}

.repo-head h3 {
  margin: 0;
  font-size: 12px;
  font-weight: 650;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

/* A cell's own name: only where the columns stack and the header row is gone. */
.cell-label {
  display: none;
}

.repo summary {
  display: grid;
  grid-template-columns: 18px minmax(150px, 1.3fr) minmax(120px, 1fr) minmax(90px, 0.8fr) minmax(150px, 1.3fr) minmax(110px, 0.9fr);
  align-items: center;
  gap: 4px 16px;
  padding: 10px 8px;
  border-bottom: 1px solid var(--line);
  list-style: none;
  cursor: pointer;
}

.repo summary::-webkit-details-marker {
  display: none;
}

.repo summary:hover {
  background: var(--hover);
}

.repo details[open] > summary {
  background: var(--panel);
  border-bottom-color: transparent;
}

.repo.is-target summary {
  background: rgb(255 211 139 / 0.12);
  transition: background 1.2s ease-out;
}

.cell-name {
  display: grid;
  min-width: 0;
}

.cell-name strong {
  font-weight: 600;
  overflow-wrap: anywhere;
}

.cell-name small {
  overflow-wrap: anywhere;
}

.cell-branch {
  display: flex;
  flex-wrap: wrap;
  gap: 2px 8px;
  min-width: 0;
  font-size: 13px;
}

.drift {
  display: inline-flex;
  gap: 6px;
  color: var(--busy-ink);
  font-size: 12.5px;
  font-variant-numeric: tabular-nums;
}

.cell-changes,
.cell-packages {
  font-size: 13px;
  color: var(--ink-soft);
}

.cell-sessions {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 6px;
  font-size: 13px;
}

.chip {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  max-width: 100%;
  gap: 0 6px;
  padding: 2px 8px 2px 6px;
  border: 1px solid var(--line);
  border-radius: 4px;
  font-size: 12.5px;
}

.chip em {
  flex: none;
  font-style: normal;
  white-space: nowrap;
  color: var(--ink-faint);
}

/* The state stays whole and drops to a second line when the name and it do not fit side by side; the name
   keeps the first line and is cut with an ellipsis only when it alone is too long (its full text is the title). */
.chip-name {
  min-width: 0;
  max-width: calc(100% - 20px);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chip[data-tone='busy'] em {
  color: var(--work-ink);
}

.chip[data-tone='waiting'] {
  border-color: var(--danger-line);
}

.chip[data-tone='waiting'] em {
  color: var(--bad-ink);
}

.bumps {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 2px 10px;
}

[data-bump='major'] {
  color: var(--bad-ink);
}

[data-bump='minor'] {
  color: var(--busy-ink);
}

[data-bump='patch'] {
  color: var(--accent-ink);
}

[data-bump='other'],
[data-bump='not-installed'] {
  color: var(--ink-faint);
}

/* An open repo is one piece: a rule down its left edge, in a palette token, runs from its row through its
   body, and the body is named for the repo (repoBody). The attribute, not :has(), and the rule is laid
   over the edge instead of being a border, so no column moves against the closed rows. */
.repo > details[open] {
  position: relative;
}

.repo > details[open]::before {
  content: '';
  position: absolute;
  z-index: 1;
  top: 0;
  bottom: 0;
  left: 0;
  width: 3px;
  background: var(--lamp-off-ring);
  pointer-events: none;
}

.repo-body {
  display: grid;
  gap: 14px;
  padding: 2px 14px 16px 42px;
  background: var(--panel);
  border-bottom: 1px solid var(--line);
}

/* What the repo is, quietly: folder, origin and what it tracks run on, wrapping as a line of text. */
.facts {
  display: flex;
  flex-wrap: wrap;
  gap: 2px 18px;
  margin: 0;
  font-size: 12.5px;
}

.facts > div {
  display: flex;
  flex-wrap: wrap;
  gap: 0 6px;
  min-width: 0;
}

.facts dt {
  color: var(--ink-faint);
}

.facts dd {
  margin: 0;
  min-width: 0;
  color: var(--ink-soft);
  overflow-wrap: anywhere;
}

.facts code {
  font-size: 12px;
}

.block-section {
  display: grid;
  gap: 8px;
  min-width: 0;
  overflow-x: auto;
}

.block-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 14px;
}

.block-head .quiet-button {
  margin-left: auto;
}

table {
  border-collapse: collapse;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}

th {
  padding: 4px 18px 6px 0;
  color: var(--ink-faint);
  font-weight: 500;
  text-align: left;
  white-space: nowrap;
}

td {
  padding: 4px 18px 4px 0;
  border-top: 1px solid var(--line);
  vertical-align: top;
}

.status {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  white-space: nowrap;
}

.quiet-button {
  padding: 3px 10px;
  border: 1px solid var(--mauve);
  border-radius: 5px;
  background: none;
  color: var(--ink-soft);
  font-size: 12.5px;
  cursor: pointer;
}

.quiet-button:hover:not(:disabled) {
  border-color: var(--accent-ink);
  color: var(--accent-ink);
}

.quiet-button:disabled {
  border-color: var(--line);
  color: var(--ink-faint);
  cursor: default;
}

.empty {
  padding: 18px 8px;
  color: var(--ink-faint);
}

.cloud-group summary {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  gap: 16px;
  align-items: start;
  padding: 14px 8px;
  border-bottom: 1px solid var(--line);
  list-style: none;
  cursor: pointer;
}

.cloud-group summary::-webkit-details-marker {
  display: none;
}

.cloud-group summary > span:last-child {
  display: grid;
  gap: 2px;
}

.cloud-group summary strong {
  font-weight: 500;
  color: var(--ink-soft);
}

.cloud-group summary:hover {
  background: rgb(82 45 96 / 0.25);
}

.cloud-names {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 6px 24px;
  margin: 0;
  padding: 12px 8px 18px 42px;
  list-style: none;
  border-bottom: 1px solid var(--line);
  font-size: 13.5px;
}

.cloud-names li {
  display: grid;
  min-width: 0;
}

.cloud-names span {
  overflow-wrap: anywhere;
}

.hidden-names li {
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 4px 10px;
}

.hidden-names li > .flash {
  grid-column: 1 / -1;
}

/* ---------- side panels ---------- */

.panel {
  display: grid;
  /* One column no wider than the panel, so a long line wraps or scrolls inside it, and a name or
     path with no spaces breaks where it has to (test/visual: page-scroll). */
  grid-template-columns: minmax(0, 1fr);
  overflow-wrap: anywhere;
  gap: 10px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.panel > h2 {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-faint);
}

.panel p {
  margin: 0;
  font-size: 14px;
}

.panel-lede {
  color: var(--ink-soft);
}

.mcp-list,
.outside-list,
.source-list,
.warnings {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.mcp-list li,
.outside-list li {
  display: grid;
  grid-template-columns: 10px 1fr;
  gap: 12px;
  align-items: start;
}

.mcp-list .lamp,
.outside-list .lamp {
  margin-top: 6px;
}

.mcp-list li > div,
.outside-list li > div {
  display: grid;
  min-width: 0;
}

.mcp-line {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0 12px;
  font-size: 14px;
}

.mcp-line strong {
  font-weight: 500;
}

.mcp-line span {
  color: var(--ink-faint);
  font-size: 13px;
}

[data-health='needs-auth'] .mcp-line span {
  color: var(--busy-ink);
}

[data-health='failed'] .mcp-line span {
  color: var(--bad-ink);
}

.hint {
  color: var(--ink-soft);
}

.source-list li {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 2px;
}

.source-line {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 14px;
}

.source-line strong {
  font-weight: 500;
}

.warnings li {
  padding-left: 10px;
  border-left: 2px solid var(--peach);
  color: var(--ink-soft);
  font-size: 12.5px;
}

.fineprint {
  color: var(--ink-faint);
  font-size: 12.5px !important;
}

/* ---------- console: terminals ---------- */

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.console {
  background: var(--terminal-bg);
  border-bottom: 1px solid var(--line);
}

.console-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 20px;
  padding: 10px var(--gutter) 0;
  border-bottom: 1px solid var(--line);
}

/* One row that scrolls sideways: wrapped, a dozen terminals pushed the actions below the dock (test/visual). */
.console-tabs {
  display: flex;
  flex-wrap: nowrap;
  gap: 2px;
  min-width: 0;
  max-width: 100%;
  min-height: 34px;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: thin;
}

.tab {
  display: inline-flex;
  flex: none;
  align-items: center;
  max-width: 100%;
  border: 1px solid transparent;
  border-bottom: none;
  border-radius: 6px 6px 0 0;
}

.tab[data-selected] {
  background: var(--night);
  border-color: var(--line);
  box-shadow: inset 0 2px 0 var(--gold-mark);
}

.tab [role='tab'] {
  /* Inside a tab capped at the list's width, the label gives way with its ellipsis instead of spilling over the next tab. */
  min-width: 0;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 4px 7px 12px;
  border: none;
  background: none;
  color: var(--ink-soft);
  font-size: 13px;
  cursor: pointer;
}

.tab[data-selected] [role='tab'] {
  color: var(--ink);
}

/* A long label ends in an ellipsis; the tab's title and name hold all of it. */
.tab-label {
  max-width: 24ch;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tab [role='tab'] em {
  font-style: normal;
  color: var(--ink-faint);
}

.console-tabrow {
  position: relative;
  display: flex;
  align-items: center;
  min-width: 0;
  max-width: 100%;
}

/* The × inside a tab, for the mouse: on the selected tab and under the pointer. */
.tab-x {
  align-self: center;
  margin-right: 6px;
  padding: 0 4px;
  border-radius: 4px;
  color: var(--ink-faint);
  font-size: 16px;
  line-height: 1;
  opacity: 0;
}

.tab[data-selected] .tab-x,
.tab:hover .tab-x {
  opacity: 1;
}

.tab-x:hover {
  color: var(--bad-ink);
}

/* The button beside the list is for assistive technology and the keyboard: out of sight until it has focus. */
.tab-close {
  flex: none;
  padding: 4px 10px;
  border: none;
  background: var(--night);
  color: var(--ink-soft);
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
}

.tab-close {
  position: absolute;
  top: 0;
  right: 0;
  z-index: 1;
}

.tab-close:not(:focus) {
  opacity: 0;
  pointer-events: none;
}

.tab-close:hover {
  color: var(--bad-ink);
}

.console-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 16px;
  padding-bottom: 8px;
}

.orch-state {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.console-actions .orch-state {
  font-size: 13px;
}

.console-actions .flash {
  flex-basis: 100%;
}

.console-screen {
  position: relative;
  height: clamp(300px, 46vh, 640px);
  padding: 10px var(--gutter) 12px;
}

/* With no terminal open, the console is only an invitation. */
.console-screen.is-empty {
  height: auto;
  padding-block: 22px 26px;
}

.term {
  height: 100%;
  /* xterm keeps its input field at the cursor; at the end of a line it would stick out past the
     screen's edge and let a phone scroll sideways (test/visual: page-scroll). */
  overflow: hidden;
}

.term .xterm {
  height: 100%;
}

.term .xterm-viewport {
  background: transparent !important;
}

.console-empty {
  display: grid;
  align-content: center;
  justify-items: start;
  gap: 6px;
  height: 100%;
  max-width: 62ch;
  color: var(--ink-soft);
}

.console-empty[hidden] {
  display: none;
}

.console-empty p {
  margin: 0;
}

.console-empty strong {
  font-size: 18px;
  font-weight: 650;
  font-stretch: 112%;
  color: var(--accent-ink);
}

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

.action-button {
  padding: 6px 14px;
  border: 1px solid var(--gold);
  border-radius: 6px;
  background: var(--gold);
  color: #2a1530;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}

.action-button:hover:not(:disabled) {
  background: #ffe1ad;
}

.action-button:disabled {
  border-color: var(--mauve);
  background: none;
  color: var(--ink-faint);
  cursor: default;
}

.quiet-button[data-kind='danger'] {
  border-color: var(--danger-line);
}

.quiet-button[data-kind='danger']:hover:not(:disabled) {
  border-color: var(--rose);
  color: var(--bad-ink);
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 8px;
}

.flash {
  font-size: 13px;
}

.flash p {
  margin: 0;
}

.flash[data-tone='ok'] {
  color: var(--accent-ink);
}

.flash[data-tone='bad'] {
  color: var(--bad-ink);
}

.flash ul {
  margin: 4px 0 0;
  padding-left: 16px;
  color: var(--ink-soft);
}

.hint {
  margin: 0;
  color: var(--ink-soft);
  font-size: 13px;
}

.start-form {
  padding-top: 4px;
}

.form-row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 10px 14px;
}

.field {
  display: grid;
  gap: 4px;
  font-size: 12.5px;
  color: var(--ink-faint);
}

.field.grow {
  flex: 1 1 280px;
}

.field input,
.field select,
.field textarea {
  min-width: 0;
  max-width: 100%;
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--night);
  color: var(--ink);
  font: inherit;
  font-size: 14px;
}

.field textarea {
  resize: vertical;
  min-height: 38px;
}

.field input:invalid {
  border-color: var(--danger-line);
}

tr:not([data-live]) td {
  color: var(--ink-faint);
}

small.block {
  display: block;
}

.confirm {
  display: grid;
  gap: 8px;
  padding: 10px 12px;
  border-left: 3px solid var(--rose);
  background: var(--danger-bg);
}

.confirm p {
  margin: 0;
}

/* ---------- findings ---------- */

.finding-list {
  display: grid;
  gap: 14px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.finding {
  display: grid;
  gap: 4px;
  padding-left: 12px;
  border-left: 2px solid var(--mauve);
  font-size: 14px;
}

.finding[data-status='new'] {
  border-left-color: var(--gold);
}

.finding[data-type='security'] {
  border-left-color: var(--rose);
}

.finding[data-status='dropped'],
.finding[data-status='ticketed'],
.finding[data-status='done'] {
  opacity: 0.6;
}

.finding-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 12.5px;
}

.finding-type {
  color: var(--busy-ink);
}

.finding strong {
  font-weight: 600;
}

.finding details summary {
  color: var(--ink-faint);
  font-size: 12.5px;
  cursor: pointer;
}

.finding pre {
  margin: 6px 0 0;
  padding: 8px 10px;
  max-height: 220px;
  overflow: auto;
  background: var(--panel);
  font: 12px/1.45 var(--mono);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

/* ---------- narrow screens ---------- */

@media (max-width: 720px) {
  .rail {
    grid-template-columns: minmax(0, 1fr);
  }

  .rail-label {
    padding-top: 0;
  }

  .jack {
    width: 76px;
  }
}

/* The same rules for a middle panel the terminal dock has narrowed, whatever the window. */
@container middle (max-width: 580px) {
  .rail {
    grid-template-columns: minmax(0, 1fr);
  }

  .rail-label {
    padding-top: 0;
  }

  .jack {
    width: 76px;
  }
}

/* A repo row's six columns need about 720 px. They follow the room the Repos list has, not the window:
   with the terminal dock open, a 1180 px window leaves the views 580 px and a 768 px one 420, and the
   row ran past its column, cut off (test/visual). */
.lines {
  container: repos / inline-size;
}

@container repos (max-width: 720px) {
  .repo-head {
    display: none;
  }

  .cell-label {
    display: inline;
    margin-right: 6px;
    font-size: 12px;
    font-weight: 650;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--ink-faint);
  }

  .repo summary {
    grid-template-columns: 18px minmax(0, 1fr);
  }

  .repo summary > :nth-child(n + 3) {
    grid-column: 2;
  }

  /* The rule at the edge is the cue here, so the body keeps clear of it. */
  .repo-body {
    padding-left: 14px;
    padding-right: 10px;
  }
}

/* ---------- context per session ---------- */

.context {
  display: grid;
  gap: 3px;
  min-width: 110px;
}

.context-track {
  position: relative;
  height: 5px;
  border-radius: 3px;
  background: var(--line);
}

.context-fill {
  position: absolute;
  inset: 0 auto 0 0;
  border-radius: 3px;
  background: var(--mauve);
}

.context small {
  white-space: nowrap;
}

/* ---------- the sessions of a repo ---------- */
/* One list, grouped by folder. A row: lamp, name, status, its actions; below it what it runs, one clipped
   line each; its detail (model, context, start, every command in full) opens from the button at its end.
   Where the Repos list is narrow (a phone, or a wide terminal dock) the status drops under the name. */

.session-list {
  display: grid;
  gap: 10px;
  min-width: 0;
}

.work-folder + .work-folder {
  padding-top: 8px;
  border-top: 1px solid var(--line);
}

.work-folder-head {
  margin: 0 0 2px;
  font-size: 12.5px;
  color: var(--ink-soft);
  overflow-wrap: anywhere;
}

.work-folder-head code {
  font-size: 12.5px;
  color: var(--ink-soft);
}

.work-branch {
  font: 400 11.5px/1.5 var(--mono);
  color: var(--ink-faint);
}

.session-rows {
  margin: 0;
  padding: 0;
  list-style: none;
}

.session-row {
  display: grid;
  grid-template-columns: 12px minmax(0, 27rem) minmax(8rem, 1fr) minmax(10rem, 15rem) max-content;
  grid-template-areas:
    'lamp name status context acts'
    '. runs runs runs runs'
    '. detail detail detail detail'
    '. note note note note';
  gap: 2px 12px;
  align-items: center;
  padding: 7px 0;
  border-top: 1px solid var(--line);
}

.session-rows > .session-row:first-child {
  border-top: 0;
}

.session-row > .lamp {
  grid-area: lamp;
  justify-self: center;
}

.session-name {
  grid-area: name;
  min-width: 0;
  font-weight: 550;
  overflow-wrap: anywhere;
}

.stopped-sessions .session-name {
  font-weight: 450;
  color: var(--ink-soft);
}

.session-status {
  grid-area: status;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0 6px;
  min-width: 0;
  font-size: 13px;
  color: var(--ink-soft);
}

.session-status .status {
  white-space: normal;
}

.session-row[data-live] .status {
  color: var(--ink);
}

.session-status small.block {
  flex-basis: 100%;
}

/* "Opus · 45k": one short line that gives way with an ellipsis, never a second line, at 320 px too. */
.session-brief {
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

/* The context column of a live session: its size with a bar, the model and the effort; a long line gives way with an ellipsis. */
.session-context {
  grid-area: context;
  min-width: 0;
}

.session-context .context small {
  overflow: hidden;
  text-overflow: ellipsis;
}

.session-acts {
  grid-area: acts;
  display: flex;
  align-items: center;
  gap: 4px;
  justify-self: end;
}

/* Two fixed tracks, so every row's main button and ⋯ line up down the list. */
.session-acts .row-actions {
  grid-template-columns: 6rem 30px;
}

.detail-toggle {
  display: grid;
  place-items: center;
  flex: none;
  width: 30px;
  height: 30px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 6px;
  background: none;
  color: var(--ink-soft);
  cursor: pointer;
}

.detail-toggle:hover {
  border-color: var(--line);
  background: var(--hover);
  color: var(--ink);
}

/* An arrow drawn with two borders: right when closed, down when open. */
.chevron {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-right: 1.6px solid currentColor;
  border-bottom: 1.6px solid currentColor;
  transform: rotate(-45deg);
  transition: transform 0.15s;
}

.detail-toggle[aria-expanded='true'] .chevron,
.stopped-sessions[open] > summary .chevron {
  transform: rotate(45deg);
}

@media (prefers-reduced-motion: reduce) {
  .chevron {
    transition: none;
  }
}

.session-note {
  grid-area: note;
  padding: 4px 0 6px;
  color: var(--ink);
}

.session-note .confirm,
.session-note .flash {
  max-width: 68ch;
}

.session-detail {
  grid-area: detail;
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  gap: 3px 16px;
  margin: 6px 0 4px;
  padding: 8px 12px;
  border-left: 1px solid var(--line);
  font-size: 12.5px;
}

.session-detail[hidden] {
  display: none;
}

.session-detail dt {
  color: var(--ink-faint);
}

.session-detail dd {
  margin: 0;
  min-width: 0;
  color: var(--ink-soft);
}

.session-detail code {
  font-size: 12px;
  overflow-wrap: anywhere;
}

.session-detail .context {
  max-width: 14rem;
}

.session-detail .work-command {
  white-space: pre-wrap;
}

/* "N stopped": a native disclosure, closed until opened. */
.stopped-sessions > summary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 6px 4px 0;
  list-style: none;
  font-size: 13px;
  color: var(--ink-soft);
  cursor: pointer;
}

.stopped-sessions > summary::-webkit-details-marker {
  display: none;
}

.session-list > .stopped-sessions:not(:first-child) {
  padding-top: 6px;
  border-top: 1px solid var(--line);
}

/* What a session runs: one line each, cut at the edge of the row. The whole text is in its detail. */
.work-runs {
  grid-area: runs;
  display: grid;
  min-width: 0;
  margin: 0;
  padding: 0;
  list-style: none;
}

.work-runs li {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
  font-size: 12px;
  line-height: 19px;
  color: var(--ink-faint);
}

.work-runs code {
  color: var(--ink-soft);
}

.work-runs .work-type,
.work-runs .work-time {
  flex: none;
}

.work-runs .work-desc,
.work-runs .work-command {
  flex: 0 1 auto;
  min-width: 0;
  overflow: hidden;
  color: var(--ink-soft);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.work-time {
  color: var(--ink-faint);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* The foot of the open repo: a rare action, after everything else. */
.repo-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 12px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
  font-size: 12.5px;
}

.repo-foot .flash {
  flex-basis: 100%;
}

@container repos (max-width: 560px) {
  .session-row {
    grid-template-columns: 12px minmax(0, 1fr) max-content;
    grid-template-areas:
      'lamp name name'
      '. status status'
      '. context context'
      '. acts acts'
      '. runs runs'
      '. detail detail'
      '. note note';
  }

  .session-row > .lamp {
    align-self: start;
    margin-top: 5px;
  }

  .session-acts {
    justify-self: start;
    margin-top: 4px;
  }

  .session-detail {
    grid-template-columns: minmax(0, 1fr);
    gap: 0;
    padding: 6px 8px;
  }

  .session-detail dd {
    margin-bottom: 4px;
  }
}

/* What a session runs besides its own turn (public/work.js): two small lamp lines, "worktree 2" and
   "agents 2 · 1 shell", under its name and under a repo's session chips. A line is left out at 0. */
.work-lines {
  display: grid;
  gap: 2px;
  margin-top: 2px;
}

.work-line {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  line-height: 18px;
  color: var(--ink-soft);
  white-space: nowrap;
}

.work-n {
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

/* Said next to the count of sessions working in the Now strip: "4 working · 3 agents". */
.now-work {
  color: var(--ink-soft);
}

.session-model {
  display: grid;
}

.model-name {
  overflow: hidden;
  color: var(--ink-soft);
  white-space: nowrap;
  text-overflow: ellipsis;
}

.session-row:not([data-live]) .model-name {
  color: inherit;
}

.model-effort {
  font-size: 12px;
}

/* Two fixed tracks, so every row's main button and ⋯ line up down the table. */
.row-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 30px;
  gap: 6px;
  align-items: center;
}

.row-actions-note {
  display: block;
  padding-top: 5px;
  line-height: 1.35;
}

.row-button {
  height: 30px;
  padding: 0 10px;
  border: 1px solid var(--accent-ink);
  border-radius: 6px;
  background: none;
  color: var(--ink);
  font-size: 13px;
  font-weight: 550;
  white-space: nowrap;
  cursor: pointer;
}

.row-button:hover:not(:disabled) {
  background: color-mix(in srgb, var(--accent-ink) 16%, transparent);
}

.row-button:disabled {
  border-color: var(--line);
  color: var(--ink-faint);
  cursor: default;
}

.more-button {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 6px;
  background: none;
  color: var(--ink-soft);
  cursor: pointer;
}

.more-button:hover:not(:disabled),
.more-button[aria-expanded='true'] {
  border-color: var(--line);
  background: var(--hover);
  color: var(--ink);
}

.more-button:disabled {
  color: var(--ink-faint);
  cursor: default;
}

.more-dots {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: -6px 0 currentColor, 6px 0 currentColor;
}

/* A popover: fixed in the top layer, placed under its button by placeMenu. */
.row-menu {
  position: fixed;
  inset: auto;
  margin: 0;
  /* WebKit's own [popover] rule says height: fit-content, and on a grid that stretches to the whole
     window (Chrome does not): the items spread over the screen. The menu is as tall as its items. */
  height: auto;
  min-width: 11rem;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--night);
  color: var(--ink);
  box-shadow: var(--menu-shadow);
}

.row-menu:popover-open {
  display: grid;
}

.row-menu button {
  padding: 7px 10px;
  border: 0;
  border-radius: 5px;
  background: none;
  color: var(--ink);
  font-size: 13.5px;
  text-align: left;
  cursor: pointer;
}

.row-menu button:hover:not(:disabled) {
  background: var(--hover);
}

.row-menu button:focus-visible {
  outline-offset: -2px;
  background: var(--hover);
}

.row-menu button.danger {
  color: var(--menu-danger-ink, var(--bad-ink));
}

.row-menu button:disabled {
  color: var(--ink-faint);
  cursor: default;
}

.session-note .confirm,
.session-note .flash {
  max-width: 68ch;
}

/* Fingers get bigger targets. */
@media (pointer: coarse) {
  .row-button,
  .more-button,
  .detail-toggle {
    height: 40px;
  }

  .row-actions {
    grid-template-columns: minmax(0, 1fr) 40px;
  }

  .session-acts .row-actions {
    grid-template-columns: 6.5rem 40px;
  }

  .more-button,
  .detail-toggle {
    width: 40px;
  }

  .row-menu button {
    padding: 11px 14px;
  }
}

/* ---------- setup ---------- */

.setup-list {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.setup-list[hidden] {
  display: none;
}

.setup-list li {
  display: grid;
  grid-template-columns: 10px 1fr;
  gap: 12px;
  align-items: start;
}

.setup-list .lamp {
  margin-top: 6px;
}

.setup-list li > div {
  display: grid;
}

/* ---------- settings dialog ---------- */

.settings {
  width: min(640px, calc(100vw - 32px));
  max-height: calc(100vh - 48px);
  padding: 0;
  border: 1px solid var(--mauve);
  border-radius: 10px;
  background: var(--panel);
  color: var(--ink);
  box-shadow: 0 24px 60px rgb(0 0 0 / 0.55);
}

.settings::backdrop {
  background: rgb(18 8 22 / 0.72);
}

.settings-head {
  display: grid;
  gap: 4px;
  padding: 20px 22px 0;
}

.settings-head h2 {
  font-size: 19px;
  color: var(--accent-ink);
}

/* The main Settings dialog: its head stays at the top with the X (top right) in reach, and the folded sections below it. */
.settings-main .settings-head {
  position: sticky;
  top: 0;
  z-index: 1;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  padding-bottom: 10px;
  background: var(--panel);
}

.settings-main .settings-head small {
  grid-column: 1 / -1;
}

.settings-close {
  grid-column: 2;
  grid-row: 1;
  width: 44px;
  padding: 0;
  font-size: 22px;
  line-height: 1;
}

/* A folded section (public/disclosure.js): the one component for every part of the page that opens and closes. The arrow is
   drawn here, never the browser's triangle; a folded section says in one sentence what it holds. */
.disclosure {
  border-top: 1px solid var(--line);
}

.disclosure-head {
  margin: 0;
  font: inherit;
}

.disclosure-button {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 2px 12px;
  width: 100%;
  min-height: 44px;
  padding: 8px 0;
  border: 0;
  background: none;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
}

.disclosure-button::after {
  content: '';
  grid-column: 2;
  grid-row: 1 / span 2;
  width: 8px;
  height: 8px;
  margin-right: 4px;
  border-right: 2px solid var(--ink-soft);
  border-bottom: 2px solid var(--ink-soft);
  transform: rotate(45deg);
}

.disclosure-button[aria-expanded='true']::after {
  transform: rotate(-135deg);
}

.disclosure-title {
  color: var(--busy-ink);
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.disclosure-summary {
  grid-column: 1;
  color: var(--ink-soft);
  font-size: 13px;
}

.disclosure-summary[hidden],
.disclosure-body[hidden] {
  display: none;
}

.disclosure-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 14px;
  padding: 4px 0 18px;
}

/* Settings is for fingers too: every button, field and list in it is at least 44 px tall (test/e2e/settings.spec.ts). */
.settings-main button,
.settings-main select,
.settings-main input:not([type='checkbox'], [type='radio']) {
  min-height: 44px;
}

.settings-main .setting input[type='checkbox'],
.settings-main .theme-choice input[type='radio'] {
  flex: none;
  width: 22px;
  height: 22px;
}

.settings-main .setting-check label,
.settings-main .theme-choice label {
  min-height: 44px;
}

/* The sections touch, each with its rule; the question about unsaved changes fills the sticky bar's width. */
.settings-main .settings-form {
  gap: 0;
  padding-bottom: 0;
}

/* The bar with Save sticks to the dialog's bottom edge whole (its button is 44 px: the old -20 px offset cut it). */
.settings-main .settings-actions {
  bottom: 0;
  margin-bottom: 0;
}

.settings-main .settings-problems {
  margin-bottom: 12px;
}

.settings-actions .settings-confirm {
  flex: 1 0 100%;
}

.settings-confirm[hidden] {
  display: none;
}

.settings-form {
  display: grid;
  /* One column no wider than the dialog: a long option in a select would otherwise widen it past a phone screen. */
  grid-template-columns: minmax(0, 1fr);
  gap: 18px;
  padding: 16px 22px 20px;
}

.settings fieldset {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 14px;
  /* A fieldset is at least as wide as its widest content by default; this one shrinks with the dialog. */
  min-inline-size: 0;
  margin: 0;
  padding: 14px 0 0;
  border: 0;
  border-top: 1px solid var(--line);
}

.settings legend {
  padding: 0 8px 0 0;
  color: var(--busy-ink);
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.setting {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 5px;
}

.setting label {
  font-weight: 600;
  font-size: 14px;
}

/* The field's name, and beside it when a change takes effect (New sessions, After restart) as a small muted label. */
.setting-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 10px;
}

.setting-when {
  color: var(--ink-faint);
  font-size: 12px;
}

.setting .unit {
  color: var(--ink-faint);
  font-weight: 400;
}

.setting input,
.setting select,
.setting textarea {
  max-width: 100%;
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--night);
  color: var(--ink);
  font: inherit;
  font-size: 14px;
}

/* A choice with a button beside it (Notifications, Send a test); the answer of the button takes the row below. */
.setting-control {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 10px;
}

.setting-control select {
  flex: 1 1 auto;
}

.setting-control .flash-slot {
  flex: 1 1 100%;
}

.setting textarea {
  font-family: var(--mono);
  font-size: 13px;
  resize: vertical;
}

.setting input[type='number'] {
  width: 14ch;
}

/* Work pace (settings.js, paceControl): the levels as buttons, each with what it sets. The current one is told by
   a thick border and the word "Current", never by colour alone. */
.pace {
  display: grid;
  gap: 8px;
}

.pace-head {
  display: grid;
  gap: 3px;
}

.pace-title {
  font-weight: 600;
  font-size: 14px;
}

.pace-head small,
.pace-says,
.pace-values,
.pace-status {
  font-size: 13px;
  color: var(--ink-soft);
}

.pace-option {
  display: grid;
  gap: 3px;
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--night);
  color: var(--ink);
  font: inherit;
  text-align: start;
  cursor: pointer;
}

.pace-option[aria-pressed='true'] {
  padding: 8px 11px;
  border: 2px solid var(--accent-ink);
}

.pace-option:focus-visible {
  outline: 2px solid var(--accent-ink);
  outline-offset: 2px;
}

.pace-name {
  font-weight: 600;
  font-size: 14px;
}

.pace-mark {
  margin-inline-start: 6px;
  padding: 1px 6px;
  border: 1px solid var(--accent-ink);
  border-radius: 999px;
  color: var(--accent-ink);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.pace-mark[hidden] {
  display: none;
}

.pace-values {
  font-variant-numeric: tabular-nums;
}

.pace-status:empty {
  display: none;
}

.pace-status[data-tone='ok'] {
  color: var(--accent-ink);
}

.pace-status[data-tone='bad'] {
  color: var(--bad-ink);
}

/* Preferred language: the list, and for "Other…" a tag and a name side by side. */
.language-control {
  display: grid;
  gap: 6px;
}

.language-free {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 2fr);
  gap: 6px;
}

.language-free[hidden] {
  display: none;
}

/* A switch that takes effect at once (Start at login): the box beside its label, not a text field. */
.setting-check label {
  display: flex;
  gap: 8px;
  align-items: center;
}

.setting-offer {
  margin: 2px 0 0;
  font-size: 13px;
  color: var(--ink-soft);
}

.setting-check input[type='checkbox'] {
  width: 16px;
  height: 16px;
  margin: 0;
  padding: 0;
  accent-color: var(--peach);
}

.setting[data-locked] input,
.setting[data-locked] select,
.setting[data-locked] textarea {
  opacity: 0.6;
}

.setting .locked {
  color: var(--busy-ink);
}

.settings-problems {
  padding: 10px 12px;
  border-left: 3px solid var(--rose);
  background: var(--alert-bg);
  font-size: 13px;
}

.settings-problems p {
  margin: 0;
}

.settings-problems ul {
  margin: 4px 0 0;
  padding-left: 18px;
}

.settings-actions {
  position: sticky;
  bottom: -20px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  margin: 0 -22px -20px;
  padding: 14px 22px;
  border-top: 1px solid var(--line);
  background: var(--panel);
}

.settings-status {
  margin: 0 auto 0 0;
  font-size: 13px;
}

.settings-status[data-tone='ok'] {
  color: var(--accent-ink);
}

.settings-status[data-tone='bad'] {
  color: var(--bad-ink);
}

/* ---------- version and updates ---------- */

/* The exchange lamp (updates.js, exchange-lamp.js): the version beside Settings with a small lamp in the board's own
   language, a count and a word. Quiet while nothing is to do; its colour is never alone, the count or the word says it too. */
.version-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  /* A target of at least 24 x 24 CSS px at every width (WCAG 2.5.8): the lamp alone is a 16 px ring. */
  min-width: 24px;
  min-height: 24px;
  justify-content: center;
  padding: 3px 4px;
  border: 0;
  background: none;
  color: var(--ink-faint);
  font: 500 12.5px/1 var(--sans);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  cursor: pointer;
}

.version-chip[hidden] {
  display: none;
}

.version-chip:hover,
.version-chip[aria-expanded='true'] {
  color: var(--accent-ink);
}

.version-chip[data-state='busy'] {
  color: var(--busy-ink);
}

.version-chip[data-state='bad'] {
  color: var(--bad-ink);
  font-weight: 600;
}

.chip-word {
  font-weight: 400;
}

.chip-count {
  min-width: 16px;
  padding: 2px 5px;
  border-radius: 8px;
  background: var(--panel);
  color: var(--ink);
  font-size: 11px;
  font-weight: 600;
  text-align: center;
}

/* The panel: a non-modal dialog beside the lamp (placed by updates.js) with a sheet over the bottom bar on a phone. */
.exchange-panel {
  position: fixed;
  z-index: 35;
  top: var(--ex-top, auto);
  right: var(--ex-right, auto);
  bottom: var(--ex-bottom, auto);
  left: var(--ex-left, auto);
  display: grid;
  gap: 4px;
  width: min(440px, calc(100vw - 24px));
  max-height: min(560px, calc(100vh - 24px));
  overflow-y: auto;
  padding: 14px 16px 16px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel);
  color: var(--ink);
  box-shadow: 0 12px 30px rgb(0 0 0 / 0.35);
}

.exchange-panel[hidden] {
  display: none;
}

.exchange-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.exchange-head h2 {
  margin: 0;
  font-size: 16px;
}

.exchange-panel .update-panel {
  gap: 10px;
  font-size: 13.5px;
}

.exchange-rows {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.exchange-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 12px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-left: 3px solid var(--peach);
  border-radius: 6px;
}

.exchange-row[data-tone='bad'] {
  border-left-color: var(--rose);
}

.exchange-text {
  flex: 1 1 220px;
  min-width: 0;
}

.exchange-text p {
  margin: 4px 0 0;
  color: var(--ink-soft);
}

.exchange-text .exchange-note {
  color: var(--bad-ink);
}

.exchange-links {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 12px;
  margin: 0;
}

.exchange-links a {
  text-decoration: none;
}

.update-dialog {
  width: min(560px, calc(100vw - 32px));
  overflow-y: auto;
}

.update-dialog .update-panel {
  padding: 14px 22px 20px;
}

.update-panel {
  display: grid;
  gap: 12px;
  font-size: 14px;
}

/* ---------- the orchestrator's board: a modal from its band (app.js, renderOrchBoard) ---------- */
/* The look of Settings: its panel and backdrop; a lamp and the state in the lamps' inks under the name. */

.orch-board {
  width: min(560px, calc(100vw - 32px));
  overflow-y: auto;
  overscroll-behavior: contain;
}

.orch-board-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 6px 12px;
  padding: 20px 22px 14px;
  border-bottom: 1px solid var(--line);
}

.orch-board-head h2 {
  margin: 0;
  color: var(--accent-ink);
  font-size: 19px;
  font-stretch: 112%;
}

.orch-board-state,
.orch-board-facts {
  grid-column: 1 / -1;
  margin: 0;
}

.orch-board-state {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 15px;
  font-weight: 600;
  color: var(--ink);
}

/* Beside the first line when the state takes two (a limit's reset, a restart's reason). */
.orch-board-state .lamp {
  flex: none;
  margin-top: 0.15em;
}

.orch-board-state > span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.orch-board-state[data-tone='busy'] {
  color: var(--work-ink);
}

.orch-board-state[data-tone='waiting'],
.orch-board-state[data-tone='warn'] {
  color: var(--bad-ink);
}

.orch-board-facts {
  color: var(--ink-soft);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}

.orch-board-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 16px;
  padding: 16px 22px;
}

.orch-board-group,
.orch-board-error {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.orch-board-group h3,
.orch-board-error h3 {
  margin: 0;
  color: var(--busy-ink);
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.orch-board-count {
  color: var(--ink-faint);
  font-variant-numeric: tabular-nums;
}

/* The whole message of the action that failed, in the ink and box of the page's other failures. */
.orch-board-error {
  padding: 12px 14px;
  border-left: 3px solid var(--rose);
  border-radius: 0 6px 6px 0;
  background: var(--danger-bg);
}

.orch-board-error h3 {
  color: var(--bad-ink);
}

.orch-board-error-what {
  margin: 0;
  color: var(--ink-soft);
  font-size: 13px;
}

/* Every word of it, on as many lines as it takes: a path or a command breaks rather than run out of the box. */
.orch-board-error-text {
  margin: 0;
  font-family: var(--mono);
  font-size: 12.5px;
  line-height: 1.45;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  user-select: text;
}

.orch-board-copied {
  color: var(--ink-soft);
  font-size: 13px;
}

.orch-board-list {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.orch-board-task {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.orch-board-task p {
  margin: 0;
  overflow-wrap: anywhere;
}

.orch-board-task .task-title {
  font-size: 14px;
}

/* The worker's lamp stays beside its words, which wrap after it on a phone. */
.orch-board-task .task-worker {
  flex-wrap: nowrap;
  align-items: flex-start;
}

.orch-board-task .task-worker .lamp {
  flex: none;
  margin-top: 0.3em;
}

.orch-board-task .task-worker > span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.orch-board-none {
  color: var(--ink-faint);
  font-size: 13px;
}

.orch-board-call {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 14px;
}

.orch-board-call .lamp {
  flex: none;
  margin-top: 0.38em;
}

.orch-board-call > span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.orch-board-more,
.orch-board-inbox,
.orch-board-decisions {
  justify-self: start;
  color: var(--accent-ink);
  font-size: 13px;
}

.orch-board > .confirm {
  margin: 0 22px;
}

.orch-board-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 14px 22px 20px;
}

/* Away from the rest: Stop ends the orchestrator's turn. */
.orch-board-actions [data-key='orch-board:stop'] {
  margin-left: auto;
}

@media (prefers-reduced-motion: no-preference) {
  .orch-board[open] {
    animation: orch-board-in 160ms ease-out;
  }

  .orch-board[open]::backdrop {
    animation: orch-board-fade 160ms ease-out;
  }
}

@keyframes orch-board-in {
  from {
    opacity: 0;
    transform: translateY(6px) scale(0.985);
  }
}

@keyframes orch-board-fade {
  from {
    opacity: 0;
  }
}

/* A phone: the board is the screen's width less its gutters, its buttons tall enough for a finger. */
@media (max-width: 760px) {
  .orch-board-head,
  .orch-board-body,
  .orch-board-actions {
    padding-inline: 16px;
  }

  .orch-board > .confirm {
    margin-inline: 16px;
  }

  .orch-board button {
    min-height: 44px;
  }
}

.update-versions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 28px;
  margin: 0;
}

.update-versions div {
  display: grid;
  gap: 2px;
}

.update-versions dt {
  color: var(--ink-faint);
  font-size: 12px;
}

.update-versions dd {
  margin: 0;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.update-versions dd[data-tone='new'] {
  color: var(--accent-ink);
}

.update-line {
  margin: 0;
  color: var(--ink-soft);
  font-size: 13px;
}

.update-title {
  margin: 4px 0 0;
  color: var(--busy-ink);
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.update-notes {
  display: grid;
  gap: 12px;
  max-height: 320px;
  overflow-y: auto;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--night);
}

.update-notes h4 {
  margin: 0;
  font-size: 14px;
}

.update-notes h4 small {
  color: var(--ink-faint);
  font-weight: 400;
}

.update-notes h5 {
  margin: 6px 0 2px;
  color: var(--ink-faint);
  font-size: 12px;
  font-weight: 600;
}

.update-notes ul,
.update-facts {
  margin: 0;
  padding-left: 18px;
}

.update-notes li,
.update-facts li {
  margin: 2px 0;
}

.update-facts {
  color: var(--ink-soft);
  font-size: 13px;
}

.update-facts li[data-tone='warn'] {
  color: var(--busy-ink);
}

.update-note {
  margin: 0;
  font-size: 13px;
}

.update-note[data-tone='ok'] {
  color: var(--accent-ink);
}

.update-note[data-tone='bad'] {
  color: var(--bad-ink);
}

.update-steps {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 13px;
}

.update-steps li {
  color: var(--ink-faint);
}

.update-steps li::before {
  content: '○ ';
}

.update-steps li[data-state='done'] {
  color: var(--ink-soft);
}

.update-steps li[data-state='done']::before {
  content: '✓ ';
  color: var(--accent-ink);
}

.update-steps li[data-state='now'] {
  color: var(--busy-ink);
  font-weight: 600;
}

.update-steps li[data-state='now']::before {
  content: '● ';
}

.update-steps li[data-state='wait'] {
  color: var(--busy-ink);
}

.update-progress {
  display: grid;
  gap: 8px;
}

.update-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

.settings-updates .update-actions {
  justify-content: flex-start;
}


/* Under 620 px the chip is the lamp and its count: the version and its word (up to date, update, to do) are left out of
   the toolbar (they stay in the name the button is read by, and in the panel). Updating…, Reconnecting…, Security and Page error keep their words. */
@media (max-width: 619px) {
  .version-chip:is([data-kind='quiet'], [data-kind='update'], [data-kind='todo']) :is(.chip-text, .chip-word) {
    display: none;
  }
}

@media (max-width: 760px) {
  /* The lamp stays on a phone, with its count or word; the panel is a sheet over the bottom bar. */
  .version-chip {
    padding: 9px 6px;
  }

  .exchange-panel {
    inset: auto 0 0 0;
    width: auto;
    max-height: 80vh;
    padding-bottom: calc(16px + env(safe-area-inset-bottom));
    border-width: 1px 0 0;
    border-radius: 14px 14px 0 0;
    box-shadow: 0 -10px 28px rgb(0 0 0 / 0.4);
  }
}

/* ---------- waiting on others ---------- */

/* --others-ink (public/palette.css): the peach of its lamp; on paper a darker peach. */
.chip[data-tone='others'] em,
.waiting-on {
  color: var(--others-ink);
}

/* ---------- tokens per day ---------- */
/* One column per day, midnight to midnight. The columns touch, so the baseline runs unbroken and a
   column's band shows exactly where its day starts and ends: a faint band on weekends, an accent band
   on today, a wash on hover. The bar inside is capped at 24 px, so air separates the days. */

.tokens-chart {
  --plot-height: 84px;
  display: grid;
  grid-template-columns: repeat(var(--days), minmax(0, 1fr));
}

.tokens-day {
  display: grid;
  grid-template-rows: var(--plot-height) auto;
  min-width: 0;
  padding: 0 0 4px;
  border: none;
  border-radius: 0;
  background: none;
  color: inherit;
  cursor: default;
}

.tokens-day[data-weekend] {
  background-color: var(--chart-weekend);
}

.tokens-day[data-today] {
  background-color: var(--chart-today);
}

/* Over the band the day already has, not instead of it. */
.tokens-day:hover {
  background-image: linear-gradient(var(--hover), var(--hover));
}

/* Inside the column: the next day's band would cover an outline drawn outside it. */
.tokens-day:focus-visible {
  outline: 2px solid var(--accent-ink);
  outline-offset: -2px;
}

.tokens-day .plot {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  border-bottom: 1px solid var(--line);
}

.tokens-day:hover .stack,
.tokens-day:focus-visible .stack {
  filter: brightness(1.12);
}

.tokens-day .tick {
  display: grid;
  justify-items: center;
  gap: 1px;
  padding-top: 5px;
  font-size: 11px;
  line-height: 1.35;
  font-variant-numeric: tabular-nums;
}

.tokens-day .tick [data-text]::before {
  content: attr(data-text);
}

.tokens-day .weekday {
  color: var(--ink-faint);
}

.tokens-day .date {
  min-width: 2.2em;
  padding: 0 3px;
  border-radius: 999px;
  color: var(--ink-soft);
}

/* Softer ink than other days: faint ink on today's band is under 4.5:1 in the light theme. */
.tokens-day[data-today] .weekday {
  color: var(--ink-soft);
}

.tokens-day[data-today] .date {
  background: var(--accent-ink);
  color: var(--night);
  font-weight: 650;
}

.tokens-month {
  grid-row: 2;
  padding: 2px 0 0 4px;
  font-size: 11px;
  color: var(--ink-faint);
  white-space: nowrap;
}

/* The numbers of a day, over its bar while the pointer is on it or it has the focus. It sits above the chart, at the
   day's own position, kept inside the chart's edges by its half width. */
.tokens-chart {
  position: relative;
}

.tokens-tooltip {
  --half: 9.5rem;
  position: absolute;
  bottom: calc(100% + 6px);
  left: clamp(var(--half), var(--at), calc(100% - var(--half)));
  z-index: 2;
  display: none;
  box-sizing: border-box;
  width: calc(var(--half) * 2);
  max-width: 100%;
  padding: 8px 10px;
  transform: translateX(-50%);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--night);
  color: var(--ink-soft);
  box-shadow: var(--menu-shadow);
  font-size: 12.5px;
  font-variant-numeric: tabular-nums;
  text-align: left;
  pointer-events: none;
}

.tokens-tooltip > * {
  display: block;
}

.tokens-tooltip strong {
  color: var(--ink);
}

.tokens-day:hover .tokens-tooltip,
.tokens-day:focus .tokens-tooltip {
  display: block;
}

/* Tokens per repo: a bar for each, the biggest first, in the meter of Plan usage. */
.repo-bars {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.repo-bars li {
  display: grid;
  grid-template-columns: minmax(0, 9rem) minmax(0, 1fr) 4.5em;
  align-items: center;
  gap: 12px;
}

.repo-bars-name {
  min-width: 0;
  overflow-wrap: anywhere;
}

.repo-bars-n {
  color: var(--ink-soft);
  font-variant-numeric: tabular-nums;
  text-align: right;
}

/* Tokens of a session or a task, one line under its name; a sign makes it stand out, in weight and not in colour alone. */
.tokens-line {
  color: var(--ink-faint);
  font-size: 12.5px;
  font-variant-numeric: tabular-nums;
}

.tokens-line[data-signal] {
  color: var(--ink-soft);
  font-weight: 600;
}

/* ---------- guardrails ---------- */

.guardrail-list {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.guardrail {
  display: grid;
  gap: 3px;
  padding-left: 12px;
  border-left: 2px solid var(--mauve);
  font-size: 14px;
}

.guardrail[data-retired] {
  opacity: 0.6;
}

.guardrail[data-proposed] {
  border-left-color: var(--peach);
}

.guardrail-flag {
  color: var(--busy-ink);
}

.guardrail-form {
  display: grid;
  gap: 8px;
  padding-top: 8px;
}

/* Start a review: what to review across the whole width, then the options two to a row where two fit. */
.review-form {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 200px), 1fr));
  gap: 10px 14px;
  padding-top: 8px;
}

.review-form > :is(.wide, .detail-actions, .flash, p) {
  grid-column: 1 / -1;
}

/* The challenge round's box: the box beside its name, the hint under both. */
.review-form .field.check {
  grid-template-columns: auto 1fr;
  align-items: center;
  column-gap: 8px;
}

.review-form .field.check > span {
  grid-column: 2;
  grid-row: 1;
  color: var(--ink);
}

.review-form .field.check input {
  grid-column: 1;
  grid-row: 1;
  width: 16px;
  height: 16px;
  padding: 0;
  accent-color: var(--gold);
}

.review-form .field.check small {
  grid-column: 1 / -1;
}

/* ---------- checkup ---------- */

.checkup-list {
  display: grid;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 13px;
}

.checkup-list li {
  display: grid;
  grid-template-columns: 10px minmax(0, 1fr);
  gap: 10px;
}

.checkup-list .lamp {
  margin-top: 5px;
}

/* ---------- theme button and wide tables ---------- */

.table-scroll {
  /* Positioned, so it also clips what is placed absolutely in the table (visually hidden text):
     without it, those escape the scroll box and the page scrolls sideways (test/visual: page-scroll). */
  position: relative;
  max-width: 100%;
  overflow-x: auto;
}

/* ---------- the shell: views on the left, the terminal dock on the right ---------- */

.shell {
  display: grid;
  /* The views keep 360 px however wide the dock was set (at 768 px a 600 px dock left them 170); dragged
     further, the dock takes the whole shell and the middle panel is hidden (app.js, setDockSize). */
  grid-template-columns: minmax(0, 1fr) min(var(--dock-width, 600px), calc(100vw - var(--rail-width, 0px) - 360px));
  min-height: calc(100vh - var(--toolbar-height));
}

.shell[data-dock='folded'] {
  grid-template-columns: minmax(0, 1fr) 56px;
}

/* The middle panel is a container of its own: its views take their phone layout (the rules of the phone
   @media blocks, repeated under @container middle) when the panel is narrow, whatever the window. */
.views-area {
  min-width: 0;
  container: middle / inline-size;
}

.shell[data-middle='hidden'] {
  grid-template-columns: minmax(0, 1fr);
}

.shell[data-middle='hidden'] .views-area {
  display: none;
}

.shell[data-middle='hidden'] .dock {
  border-left: none;
}

.view[hidden] {
  display: none;
}

.lamp-legend {
  flex: none;
  max-width: 100%;
  font-size: 13px;
  color: var(--ink-soft);
}

.lamp-legend > summary {
  width: fit-content;
  min-height: 24px;
  cursor: pointer;
}

.lamp-legend[open] {
  flex-basis: 100%;
}

.lamp-legend[open] > summary {
  margin-left: auto;
}

.lamp-legend ul {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 24px;
  margin: 8px 0 0;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  list-style: none;
}

.lamp-legend li {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

/* ---------- the Now strip ---------- */
/* On top of every section: the oldest call for you, the orchestrator's line and one count per lamp state
   (renderCall, renderOrchestrator, renderLamps in app.js). Every part has a fixed height and every line
   of text stays on one line, cut with an ellipsis, so the strip is as tall with a call as without one,
   whatever the words: nothing below it moves when a call comes or goes. Wide, the call and the rest
   stand side by side; where they do not fit, one above the other, by the width alone. On a phone, a
   compact card that sticks below the toolbar. */

.now {
  --now-height: 108px;
  position: relative;
  display: flex;
  flex-wrap: wrap;
  gap: 12px 22px;
  padding: 14px var(--gutter);
  border-bottom: 1px solid var(--line);
  background: linear-gradient(var(--board-hi), var(--night));
}

.now p {
  margin: 0;
}

/* One line, cut at its end; the whole text is in its title (app.js). The orchestrator's line is never
   cut: its state is a few words, and its board has the rest (renderOrchBoard). */
.now-call-age,
.now-call-meta,
.now-calm,
.now-more {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ----- the call: the oldest one in full, or "No calls for you" in the same space ----- */

.now-call {
  flex: 1 1 360px;
  min-width: 0;
  height: var(--now-height);
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px 14px;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
  overflow: hidden;
}

.now-call[data-state='call'] {
  border-color: color-mix(in srgb, var(--rose) 45%, var(--line));
  background: var(--need-waiting-bg);
}

.now-call[data-state='calm'] {
  grid-template-columns: auto minmax(0, 1fr);
}

.now-calm {
  color: var(--ink-soft);
}

/* Claude Code cannot be started: said where a call would be, in the tone of something to look at. */
.now-call[data-state='problem'] {
  grid-template-columns: auto minmax(0, 1fr);
  border-color: color-mix(in srgb, var(--peach) 50%, var(--line));
}

.now-problem {
  color: var(--ink);
}

.now-call-text {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.now-call-kicker {
  display: flex;
  align-items: baseline;
  gap: 12px;
  min-width: 0;
  font-size: 12px;
  color: var(--ink-faint);
}

/* "Calls for you" stays whole; how long it waited gives way first. */
.now-call-when {
  display: flex;
  align-items: baseline;
  gap: 6px;
  flex: 0 1 auto;
  min-width: 0;
}

.now-call-label {
  flex: none;
}

.now-call-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--bad-ink);
}

.now-more {
  flex: 0 1 auto;
  margin-left: auto;
  font-size: 12.5px;
  color: var(--ink-soft);
}

/* Two lines at most: a long session name still leaves room for what it asks. */
.now-call-title {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  overflow-wrap: anywhere;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.3;
}

.now-call-meta {
  font-size: 13px;
  color: var(--ink-soft);
}

/* An error or a problem says what failed: it wraps to three lines at most (a failed Answer's four) (the whole text is in its title)
   instead of one line cut at its end, and a failed Answer's card grows to hold it. */
.now-fail,
.now-problem {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  overflow: hidden;
  overflow-wrap: anywhere;
  text-overflow: clip;
  white-space: normal;
  font-size: 13px;
  line-height: 1.3;
}

.now-problem {
  font-size: 14px;
}

/* A real osascript failure is ~170 characters and what matters is at its end: four lines. */
.now-fail {
  grid-column: 1 / -1;
  -webkit-line-clamp: 4;
  color: var(--bad-ink);
}

.now-call[data-failed] {
  height: auto;
  min-height: var(--now-height);
}

.now-more:focus-visible,
.now-orch-tasks:focus-visible {
  outline: 2px solid var(--accent-ink);
  outline-offset: 2px;
  border-radius: 3px;
}

/* ----- the orchestrator and the lamps ----- */

.now-side {
  flex: 1 1 360px;
  min-width: 0;
  height: var(--now-height);
  display: grid;
  align-content: center;
  gap: 10px;
}

/* Lamp, "Orchestrator" (its heading, set as a name), what it does and its button; its tasks under it. */
.now-orch {
  display: grid;
  grid-template-columns: auto auto minmax(0, 1fr) auto;
  grid-template-rows: 30px 20px;
  align-items: center;
  gap: 2px 10px;
  min-width: 0;
}

.now-orch-line {
  display: contents;
}

.now-orch-line > .jack-socket {
  grid-area: 1 / 1;
}

.now-orch-title {
  grid-area: 1 / 2;
  font-size: 13.5px;
  font-weight: 650;
}

.now-orch-state {
  grid-area: 1 / 3;
  justify-self: start;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 100%;
  margin: 0;
  padding: 2px 0;
  border: 0;
  background: none;
  color: var(--ink-soft);
  font: inherit;
  white-space: nowrap;
  text-align: left;
  cursor: pointer;
}

/* The state opens the orchestrator's board: underlined on hover, as the tasks link beside it. */
.now-orch-state:hover .now-orch-word {
  text-decoration: underline;
  text-decoration-color: currentColor;
  text-underline-offset: 3px;
}

.now-orch-state:focus-visible {
  outline: 2px solid var(--accent-ink);
  outline-offset: 2px;
  border-radius: 3px;
}

/* The lamp and the name open the board too (app.js), for the mouse. */
#orchestrator-line > .jack-socket,
.now-orch-title {
  cursor: pointer;
}

/* An action from the band failed: a small mark beside the state; the board has the message. */
.now-orch-mark {
  display: inline-grid;
  place-items: center;
  flex: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--bad-ink);
  color: var(--night);
  font-size: 11px;
  font-weight: 750;
  line-height: 1;
}

.now-orch-actions {
  grid-area: 1 / 4;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.now-orch-line > .confirm {
  grid-area: 3 / 1 / 4 / 5;
  margin-top: 6px;
}

.now-orch-tasks {
  grid-area: 2 / 2 / 3 / 5;
  justify-self: start;
  max-width: 100%;
  white-space: nowrap;
  font-size: 13px;
  color: var(--ink-soft);
  font-variant-numeric: tabular-nums;
  text-decoration: underline;
  text-decoration-color: var(--line);
  text-underline-offset: 3px;
}

.now-orch-tasks:hover {
  color: var(--ink);
  text-decoration-color: currentColor;
}

.now-orch-state[data-tone='busy'] {
  color: var(--work-ink);
}

.now-orch-state[data-tone='waiting'] {
  color: var(--bad-ink);
  font-weight: 600;
}

/* A session that outlived the login it started in (src/outlived.ts): in the ink of a call, as it needs one. */
.now-orch-state[data-tone='warn'],
.outlived {
  color: var(--bad-ink);
}

/* One count per lamp state, two lines at most; What the lamps mean opens over the page, not in it. */
.now-lamps {
  display: flex;
  align-items: flex-start;
  gap: 8px 16px;
  min-width: 0;
}

.now-counts {
  flex: 1 1 auto;
  display: flex;
  flex-wrap: wrap;
  gap: 4px 16px;
  min-width: 0;
  max-height: 44px;
  /* The lamp's ring band (box-shadow, up to 2 px) is drawn outside its box, and overflow: hidden cuts it
     at the padding edge: the first lamp lost its left side. A gutter the size of the band keeps it whole,
     and the negative margin gives the gutter back, so the row sits where it did (test/visual/lamp-clip.spec.ts). */
  margin: 0 0 0 -2px;
  padding: 0 0 0 2px;
  overflow: hidden;
  list-style: none;
  font-size: 13px;
  line-height: 20px;
  color: var(--ink-soft);
  font-variant-numeric: tabular-nums;
}

.now-counts li {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  /* A count never outgrows its row: what the quiet one is made of gives way, with an ellipsis, before the words do. */
  max-width: 100%;
  white-space: nowrap;
}

.now-counts li > span:last-child {
  display: inline-flex;
  min-width: 0;
}

/* The words keep their spaces as flex items; only the breakdown is cut, with an ellipsis (its whole text is in the title). */
.now-counts li > span:last-child > span {
  white-space: pre;
}

.now-counts .now-parts {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.now-counts [data-tone='busy'] {
  color: var(--work-ink);
}

.now-counts [data-tone='waiting'] {
  color: var(--bad-ink);
  font-weight: 600;
}

.now .lamp-legend {
  position: relative;
  flex: none;
  font-size: 13px;
  line-height: 20px;
  color: var(--ink-soft);
}

.now .lamp-legend > summary {
  min-height: 20px;
  cursor: pointer;
}

.now .lamp-legend[open] {
  flex-basis: auto;
}

.now .lamp-legend[open] > summary {
  margin-left: 0;
}

.now .lamp-legend ul {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  z-index: 15;
  width: max-content;
  max-width: min(560px, 80vw);
  margin: 0;
  box-shadow: 0 12px 28px rgb(0 0 0 / 0.35);
}

/* A control scrolled into view stays clear of the sticky toolbar and Now bar above and the tab bar below. */
@media (max-width: 760px) {
  html {
    scroll-padding-block: calc(var(--toolbar-height) + 160px) 84px;
  }
}

@media (max-width: 760px) {
  /* A compact card that sticks below the toolbar: the call with its button, the orchestrator on one
     line, the counts as lamps and numbers on one (their words are read out). */
  .now {
    position: sticky;
    top: var(--toolbar-height);
    z-index: 15;
    flex-direction: column;
    flex-wrap: nowrap;
    gap: 8px;
    padding: 10px var(--gutter);
    box-shadow: 0 10px 20px rgb(0 0 0 / 0.25);
  }

  /* Lamp; "Calls for you · waiting 3 min", the call and "+1 more" on three short lines; the button beside them. */
  .now-call {
    flex: none;
    height: 72px;
    grid-template-rows: repeat(3, auto);
    align-content: center;
    gap: 1px 8px;
    padding: 6px 8px;
  }

  .now-call-text,
  .now-call-kicker {
    display: contents;
  }

  .now-call > .jack-socket {
    grid-area: 1 / 1 / -1 / 2;
    width: 24px;
    height: 24px;
  }

  .now-call .lamp {
    --size: var(--lamp-size-medium);
  }

  .now-call-when {
    grid-area: 1 / 2;
  }

  .now-call-title {
    grid-area: 2 / 2;
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 14px;
  }

  .now-more {
    grid-area: 3 / 2;
    margin-left: 0;
    font-size: 12px;
  }

  .now-calm {
    grid-area: 1 / 2 / -1 / 3;
  }

  .now-call-meta {
    display: none;
  }

  /* A failed Answer's error is the one meta line a phone shows: under the three lines, the card grows. */
  .now-call[data-failed] {
    height: auto;
    min-height: 72px;
  }

  .now-fail {
    grid-area: 4 / 1 / 5 / -1;
    font-size: 12.5px;
  }

  .now-problem {
    font-size: 13px;
  }

  .now-answer {
    grid-area: 1 / 3 / -1 / 4;
    min-height: 44px;
    padding-inline: 10px;
  }

  .now-call-label {
    letter-spacing: 0.04em;
  }

  .now-side {
    flex: none;
    height: auto;
    gap: 6px;
  }

  /* Lamp, what it does and its button on a line 44 px tall for the finger; its tasks under what it does,
     as on a wide screen: beside it, a phone has no room for them uncut. */
  .now-orch {
    grid-template-columns: auto minmax(0, 1fr) auto;
    grid-template-rows: 44px 24px;
    row-gap: 0;
  }

  .now-orch-title {
    display: none;
  }

  .now-orch-state {
    grid-area: 1 / 2;
    min-height: 44px;
  }

  /* 24 px tall, as a target the finger can find under the state's 44. */
  .now-orch-tasks {
    grid-area: 2 / 2 / 3 / 4;
    display: inline-flex;
    align-items: center;
    min-height: 24px;
  }

  .now-orch-actions {
    grid-area: 1 / 3;
  }

  .now-orch-actions > button {
    min-height: 44px;
  }

  .now-orch-actions > .more-button {
    width: 44px;
    height: 44px;
  }

  .now-orch-line > .confirm {
    grid-area: 3 / 1 / 4 / 4;
  }

  .now-lamps {
    height: 20px;
  }

  .now-counts {
    flex-wrap: nowrap;
    max-height: 20px;
    gap: 4px 12px;
  }

  /* The word stays (calling, working, quiet); what the quiet count is made of does not fit one line and is on the board. */
  .now-counts .now-parts {
    display: none;
  }

  /* The counts take the line; the lamps are explained in the README and on a wider screen. */
  .now .lamp-legend {
    display: none;
  }
}

/* The same rules for a middle panel the terminal dock has narrowed, whatever the window. */
@container middle (max-width: 580px) {
  /* A compact card that sticks below the toolbar: the call with its button, the orchestrator on one
     line, the counts as lamps and numbers on one (their words are read out). */
  .now {
    position: sticky;
    top: var(--toolbar-height);
    z-index: 15;
    flex-direction: column;
    flex-wrap: nowrap;
    gap: 8px;
    padding: 10px var(--gutter);
    box-shadow: 0 10px 20px rgb(0 0 0 / 0.25);
  }

  /* Lamp; "Calls for you · waiting 3 min", the call and "+1 more" on three short lines; the button beside them. */
  .now-call {
    flex: none;
    height: 72px;
    grid-template-rows: repeat(3, auto);
    align-content: center;
    gap: 1px 8px;
    padding: 6px 8px;
  }

  .now-call-text,
  .now-call-kicker {
    display: contents;
  }

  .now-call > .jack-socket {
    grid-area: 1 / 1 / -1 / 2;
    width: 24px;
    height: 24px;
  }

  .now-call .lamp {
    --size: var(--lamp-size-medium);
  }

  .now-call-when {
    grid-area: 1 / 2;
  }

  .now-call-title {
    grid-area: 2 / 2;
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 14px;
  }

  .now-more {
    grid-area: 3 / 2;
    margin-left: 0;
    font-size: 12px;
  }

  .now-calm {
    grid-area: 1 / 2 / -1 / 3;
  }

  .now-call-meta {
    display: none;
  }

  /* A failed Answer's error is the one meta line a phone shows: under the three lines, the card grows. */
  .now-call[data-failed] {
    height: auto;
    min-height: 72px;
  }

  .now-fail {
    grid-area: 4 / 1 / 5 / -1;
    font-size: 12.5px;
  }

  .now-problem {
    font-size: 13px;
  }

  .now-answer {
    grid-area: 1 / 3 / -1 / 4;
    min-height: 44px;
    padding-inline: 10px;
  }

  .now-call-label {
    letter-spacing: 0.04em;
  }

  .now-side {
    flex: none;
    height: auto;
    gap: 6px;
  }

  /* Lamp, what it does and its button on a line 44 px tall for the finger; its tasks under what it does,
     as on a wide screen: beside it, a phone has no room for them uncut. */
  .now-orch {
    grid-template-columns: auto minmax(0, 1fr) auto;
    grid-template-rows: 44px 24px;
    row-gap: 0;
  }

  .now-orch-title {
    display: none;
  }

  .now-orch-state {
    grid-area: 1 / 2;
    min-height: 44px;
  }

  /* 24 px tall, as a target the finger can find under the state's 44. */
  .now-orch-tasks {
    grid-area: 2 / 2 / 3 / 4;
    display: inline-flex;
    align-items: center;
    min-height: 24px;
  }

  .now-orch-actions {
    grid-area: 1 / 3;
  }

  .now-orch-actions > button {
    min-height: 44px;
  }

  .now-orch-actions > .more-button {
    width: 44px;
    height: 44px;
  }

  .now-orch-line > .confirm {
    grid-area: 3 / 1 / 4 / 4;
  }

  .now-lamps {
    height: 20px;
  }

  .now-counts {
    flex-wrap: nowrap;
    max-height: 20px;
    gap: 4px 12px;
  }

  /* The word stays (calling, working, quiet); what the quiet count is made of does not fit one line and is on the board. */
  .now-counts .now-parts {
    display: none;
  }

  /* The counts take the line; the lamps are explained in the README and on a wider screen. */
  .now .lamp-legend {
    display: none;
  }
}

/* The Tasks section: three columns (To do, In progress, Done, as on a kanban board), one column on a phone, same order. */
.task-board {
  display: grid;
  gap: 10px;
  min-width: 0;
  padding: 4px var(--gutter) 64px;
}

.task-counts {
  font-variant-numeric: tabular-nums;
}

.task-empty {
  margin: 0;
}

.task-columns {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  align-items: start;
}

.task-column {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.task-column h3 {
  margin: 0;
  font-size: 12px;
  font-weight: 650;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

.task-list,
.task-done,
.task-next {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
  min-width: 0;
}

.task {
  display: grid;
  gap: 4px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-left: 3px solid var(--mauve);
  border-radius: 6px;
  background: var(--night);
  min-width: 0;
  overflow-wrap: anywhere;
}

.task[data-state='waiting-for-you'] {
  border-left-color: var(--lamp-call-ring);
}

.task[data-state='done'],
.task[data-state='dropped'] {
  border-left-color: var(--line);
}

.task p {
  margin: 0;
}

.task-title {
  font-weight: 600;
}

.task-id {
  color: var(--ink-faint);
  font-weight: 400;
  font-variant-numeric: tabular-nums;
}

.task-note,
.task-finished {
  color: var(--ink-soft);
  font-size: 13px;
}

.task-by {
  color: var(--ink-faint);
  font-size: 12px;
}

.task-sessions {
  font-size: 12.5px;
  color: var(--ink-faint);
  font-variant-numeric: tabular-nums;
}

.task-sessions summary {
  cursor: pointer;
}

.task-sessions-list {
  margin: 4px 0 0;
  padding-left: 18px;
}

.task-outcome {
  font-size: 13px;
}

.task-outcome summary {
  cursor: pointer;
  color: var(--ink-soft);
}

.task-outcome[data-outcome='reported'] .task-outcome-state {
  color: var(--ink);
  font-weight: 600;
}

.task-outcome-parts {
  margin: 6px 0;
}

.task-outcome-parts dt {
  color: var(--ink-faint);
  font-size: 12px;
}

.task-outcome-parts dd {
  margin: 0 0 6px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.task-spec {
  font-size: 13px;
}

.task-spec summary {
  cursor: pointer;
  color: var(--ink-soft);
}

.task-spec[data-spec='waiting'] .task-spec-state {
  color: var(--ink);
  font-weight: 600;
}

.task-spec-parts {
  margin: 6px 0;
}

.task-spec-parts dt {
  color: var(--ink-faint);
  font-size: 12px;
}

.task-spec-parts dd {
  margin: 0 0 6px;
  overflow-wrap: anywhere;
}

.task-spec-parts ul {
  margin: 0;
  padding-left: 18px;
}

.task-proposed-title {
  margin: 6px 0 0;
  color: var(--ink-soft);
  font-size: 13px;
}

.task-worker {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 8px;
  font-size: 13px;
}

.task-worker[data-tone='busy'] {
  color: var(--work-ink);
}

.task-worker[data-tone='waiting'] {
  color: var(--bad-ink);
  font-weight: 600;
}

.task-worker small {
  color: var(--ink-faint);
}

.task-none {
  padding: 6px 2px;
  color: var(--ink-faint);
  font-size: 13px;
}

.task-moves,
.task-clear {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.task-clear {
  align-items: center;
}

/* The ⋯ of a task's details is a finger-sized button like the others of its row, and an item that cannot act says so. */
.board-detail-actions .more-button {
  width: 44px;
  height: 44px;
  border-color: var(--line);
}

.row-menu button[aria-disabled='true'] {
  color: var(--ink-faint);
  cursor: default;
}

.task-earlier summary {
  cursor: pointer;
  color: var(--ink-soft);
  font-size: 13px;
}

.task-earlier .task-list {
  margin-top: 8px;
}

/* ---------- A board's tiles, their drag and their details (public/board.js): Tasks now, the Roadmap next ---------- */
/* Every colour is a palette token; every state a colour shows is also an outline style or words. */

/* A tile: the title (the button that opens the details) and its grip on one line, the note on two lines at most, the
   state in words beside its lamp, the repo quieter at the end of that line. */
.board-tile {
  gap: 6px;
}

.board-tile-head {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  min-width: 0;
}

.task-open {
  flex: 1 1 auto;
  min-width: 0;
  min-height: 24px;
  margin: 0;
  padding: 0;
  border: none;
  background: none;
  color: var(--ink);
  font-weight: 600;
  line-height: 1.35;
  text-align: left;
  overflow-wrap: anywhere;
  cursor: pointer;
}

.task-open:hover .task-title-text {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.task-open .task-id {
  margin-right: 1px;
  font-size: 12.5px;
}

/* The grip: two columns of dots, quiet until it is pointed at or held; a finger drags from here only. */
.board-grip {
  flex: none;
  width: 24px;
  height: 28px;
  margin: -2px -4px 0 0;
  border: 1px solid transparent;
  border-radius: 5px;
  background-color: transparent;
  background-image: radial-gradient(circle, var(--ink-faint) 1.3px, transparent 1.7px);
  background-position: 6px 5px;
  background-size: 6px 6px;
  background-repeat: repeat;
  background-clip: content-box;
  padding: 5px 6px;
  cursor: grab;
  touch-action: none;
}

.board-grip:hover {
  border-color: var(--line);
  background-image: radial-gradient(circle, var(--accent-ink) 1.3px, transparent 1.7px);
}

.board-tile .task-note {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
}

.board-tile-status {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 2px 8px;
  min-width: 0;
  color: var(--ink-soft);
  font-size: 12.5px;
}

.board-tile-status .lamp {
  flex: none;
}

.board-tile-state {
  min-width: 0;
  overflow-wrap: anywhere;
}

.board-tile-state[data-tone='busy'] {
  color: var(--work-ink);
}

.board-tile-state[data-tone='waiting'],
.board-tile-state[data-tone='warn'] {
  color: var(--bad-ink);
  font-weight: 600;
}

.board-tile-aside {
  margin-left: auto;
  min-width: 0;
  color: var(--ink-faint);
  font-size: 12px;
  overflow-wrap: anywhere;
}

/* The repo, demoted: plain quiet words at the end of the state's line, not a chip. */
.board-tile-aside .task-repo {
  padding: 0;
  border: none;
  color: inherit;
  font-size: inherit;
}

/* A dragged tile: lifted under the pointer (a solid outline and a shadow), held from the keyboard (a dashed one). */
.board-tile[data-drag] {
  position: relative;
  z-index: 3;
  outline: 2px solid var(--accent-ink);
  outline-offset: 2px;
  user-select: none;
}

.board-tile[data-drag='lifted'] {
  pointer-events: none;
  box-shadow: var(--menu-shadow);
  cursor: grabbing;
}

.board-tile[data-drag='grabbed'] {
  outline-style: dashed;
}

/* Where it lands: a bar between the tiles, in the outline's ink. */
.board-marker {
  height: 0;
  margin: -1px 0;
  border-top: 3px solid var(--accent-ink);
  border-radius: 2px;
  list-style: none;
}

/* The zone under it: a dashed outline and its words, the outline's ink where it may land, the alarm's where it may not. */
[data-drop-zone][data-drop] {
  outline: 2px dashed var(--accent-ink);
  outline-offset: 4px;
  border-radius: 4px;
}

[data-drop-zone][data-drop]::before {
  content: attr(data-drop-note);
  display: block;
  color: var(--accent-ink);
  font-size: 12px;
  font-weight: 650;
}

[data-drop-zone][data-drop='refused'] {
  outline-color: var(--bad-ink);
}

[data-drop-zone][data-drop='refused']::before {
  content: '\2715\00a0' attr(data-drop-note);
  color: var(--bad-ink);
}

@media (prefers-reduced-motion: no-preference) {
  .board-tile[data-drag='lifted'] {
    transition: box-shadow 120ms ease-out;
  }
}

/* Proposed: its own group at the top of To do, inside a dashed boundary, so a tile is seen to land in or out of it. */
.task-proposed {
  display: grid;
  gap: 8px;
  padding: 8px;
  border: 1px dashed var(--ink-faint);
  border-radius: 8px;
}

.task-proposed .task-proposed-title {
  margin: 0;
}

/* Done: a dropped task is told apart by its dashed frame and its word; Show all under the newest five. */
.task[data-state='dropped'] {
  border-style: dashed;
  border-left-style: solid;
  background: none;
}

.task[data-state='dropped'] .task-open {
  color: var(--ink-soft);
}

.board-more {
  justify-self: start;
  min-height: 24px;
}

/* Clear finished, apart from the list and quieter than Show all: a line above it, no frame. */
.task-column > .task-clear {
  padding-top: 8px;
  border-top: 1px solid var(--line);
}

.task-column > .task-clear .quiet-button {
  min-height: 24px;
  border-color: transparent;
  color: var(--ink-faint);
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* The details: the orchestrator's board's modal, its heading and its actions kept in sight while the body scrolls. */
.board-detail {
  width: min(640px, calc(100vw - 32px));
}

.board-detail-head {
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--panel);
}

.board-detail-head h2 {
  overflow-wrap: anywhere;
}

.board-detail-actions {
  position: sticky;
  bottom: 0;
  z-index: 1;
  align-items: center;
  border-top: 1px solid var(--line);
  background: var(--panel);
}

.board-detail button {
  min-height: 28px;
}

.board-detail > .confirm,
.board-detail > .flash {
  margin: 0 22px 12px;
}

/* The details' status line takes no room while it says nothing; it stays in the page, so what it says next is read out. */
.board-detail > .board-detail-status:empty {
  margin-block: 0;
}

.board-detail .confirm .field input,
.board-detail .confirm .field select {
  max-width: 100%;
}

.board-detail-part {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.board-detail-part h3 {
  margin: 0;
  color: var(--busy-ink);
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.board-detail-part p {
  margin: 0;
}

.board-move-to {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-left: auto;
}

.board-move-to-label {
  color: var(--ink-soft);
  font-size: 13px;
}

.board-detail-note {
  margin: 0;
  font-size: 13px;
}

/*
 * A phone (900 px and below, where the board is one column): the details are a sheet from the bottom of the screen,
 * as wide as it, Close in sight at its top.
 */
@media (max-width: 900px) {
  /* .settings sets a phone's dialogs later in this file: both classes, so the sheet wins. */
  .settings.board-detail {
    width: 100vw;
    max-width: 100vw;
    max-height: 92vh;
    margin: auto 0 0;
    border-bottom: none;
    border-radius: 12px 12px 0 0;
  }

  .board-detail > .confirm,
  .board-detail > .flash {
    margin-inline: 16px;
  }

  .board-detail button {
    min-height: 44px;
  }

  .board-move-to {
    margin-left: 0;
  }
}

/* ---------- Tasks: the repo chips, New task and its form, unplanned sessions, a session's steps ---------- */

.task-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 16px;
  padding: 0 var(--gutter) 14px;
}

/* On a wide screen the chips take the room New task leaves and wrap inside it, so the button stays beside them.
   Up to 900 px wide the chips keep their own width: a basis wider than the screen sent New task to a row of its own.
   The rule covers every .task-bar's chips: Tasks, Roadmap and Notes. */
@media (min-width: 901px) {
  .task-bar .task-repos {
    flex: 1 1 24rem;
  }
}

.task-bar .task-repos {
  min-width: 0;
  max-width: 100%;
  padding: 0;
}

/* A long repo name is cut, its path is in the chip's tooltip. */
.task-repos button {
  display: block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  line-height: 1.2;
  padding-block: 4px;
}

.task-repos[hidden] {
  display: none;
}

/* A repo filter that is on says so in words, beside the pressed chip (not by the chip's colour alone). */
.task-repos .board-filter-on {
  align-self: center;
  color: var(--accent-ink);
  font-size: 12px;
  font-weight: 650;
}

.segments button[aria-pressed='true'] {
  border-color: var(--gold-mark);
  background: var(--panel);
  color: var(--ink);
}

.task-bar #task-new {
  margin-left: auto;
}

.task-form {
  display: grid;
  gap: 10px;
  margin: 0 var(--gutter) 16px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.task-form[hidden] {
  display: none;
}

.task-form h3 {
  margin: 0;
  font-size: 15px;
}

.task-form p {
  margin: 0;
}

.task-form .field textarea {
  width: 100%;
}

.task-form .check {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 24px;
  font-size: 14px;
}

.task-form .check input {
  width: 18px;
  height: 18px;
  margin: 0;
}

.task-repo {
  justify-self: start;
  padding: 1px 8px;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--ink-soft);
  font-size: 12px;
}

.task-steps {
  color: var(--ink-soft);
  font-size: 13px;
}

.task-steps-count {
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  color: var(--ink);
}

/* In progress (a running task, an Unplanned session): the left edge is the palette gold, the New task button's colour, in
   both themes. A task waiting for you keeps its red edge: that is the Needs-you signal and outranks this one. */
.task-column[data-column='in-progress'] .task:not([data-state='waiting-for-you']) {
  border-left-color: var(--gold);
}

/* A session no task has: grey, with a dashed edge, until someone adds it to the plan. */
.task-unplanned {
  border-style: dashed;
  border-left-style: solid;
  border-left-color: var(--ink-faint);
  background: none;
}

.task-unplanned .task-id {
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-size: 11px;
}

/* ---------- Roadmap: the Tasks look for ideas (tiles, columns, move buttons); only what an idea adds is here ---------- */

.idea-lede {
  /* A row of its own, as the filter and New idea are on Tasks: the chips and the button stand under it. */
  flex: 1 1 100%;
  margin: 0;
  max-width: 70ch;
}

.task-bar #idea-new {
  margin-left: auto;
}

/* A business idea has the gold edge, a feature the mauve one; the kind is also said in words on the tile. */
.idea[data-kind='business'] {
  border-left-color: var(--gold);
}

.idea[data-state='planned'] {
  border-left-color: var(--line);
}

/* The Plan stands in a row of its own under the three columns: the drop target and what was planned, its tiles side by side. */
.idea-plan {
  margin-top: 18px;
}

.idea-plan .task-list {
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr));
}

.idea-plan .task-none {
  grid-column: 1 / -1;
}

@media (max-width: 900px) {
  .task-columns {
    grid-template-columns: minmax(0, 1fr);
  }

  /* One column: what runs is on top, so a lit tile is in sight at once (the DOM order stays To do, In progress, Done). */
  .task-column[data-column='in-progress'] {
    order: -1;
  }
}

/* The same rules for a middle panel the terminal dock has narrowed, whatever the window. */
@container middle (max-width: 580px) {
  .task-columns {
    grid-template-columns: minmax(0, 1fr);
  }

  /* One column: what runs is on top, so a lit tile is in sight at once (the DOM order stays To do, In progress, Done). */
  .task-column[data-column='in-progress'] {
    order: -1;
  }
}

.view-head {
  display: grid;
  gap: 4px;
  padding: 24px var(--gutter) 14px;
}

.view-head h2 {
  font-size: 22px;
  font-weight: 750;
  font-stretch: 115%;
}

.view-lede {
  margin: 0;
  color: var(--ink-soft);
}

.needs-list.rows {
  grid-template-columns: minmax(0, 1fr);
  padding: 0 var(--gutter) 18px;
}

.needs-list.rows:empty {
  display: none;
}

.view-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr));
  align-items: start;
  gap: 28px 40px;
  padding: 4px var(--gutter) 64px;
}

.view-grid > .wide {
  grid-column: 1 / -1;
}

.view-stack {
  display: grid;
  gap: 28px;
}

.panel > h3 {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-faint);
}

/* A section another script registered (sections.js): its body, below its heading. */
.section-body {
  padding: 4px var(--gutter) 64px;
  min-width: 0;
}

/* Views in the toolbar: a segmented switch. */
.views {
  display: flex;
  gap: 2px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--panel);
}

.views a,
.tabbar a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 6px 12px;
  border-radius: 6px;
  color: var(--ink-soft);
  font: 600 13.5px/1 var(--sans);
  font-stretch: 105%;
  text-decoration: none;
}

.views a:hover {
  color: var(--ink);
}

.views a[aria-current='page'] {
  background: var(--night);
  color: var(--ink);
  box-shadow: inset 0 -2px 0 var(--gold-mark);
}

.views a:focus-visible,
.tabbar a:focus-visible {
  outline: 2px solid var(--accent-ink);
  outline-offset: 1px;
}

.view-count {
  min-width: 19px;
  padding: 0 6px;
  border-radius: 10px;
  background: var(--peach);
  color: #2a1530;
  font: 700 11px/19px var(--sans);
  font-variant-numeric: tabular-nums;
  text-align: center;
}

.view-count:empty {
  display: none;
}

.view-count[data-tone='bad'] {
  background: var(--rose);
}

/* A dot, not a number: Health has problems (Calling), Activity has sessions at work (Working). It is a tiny lamp
   (app.js, navLinks; docs/lamps.md), so this sets only that a view with nothing to say has no dot; the view's name
   stands beside it, so it is never told by colour alone. */
.view-dot:not([data-tone]),
.view-dot[data-tone=''] {
  display: none;
}

/* The dock: sticks below the toolbar, full height, resizable from its left edge. */
.dock {
  position: sticky;
  top: var(--toolbar-height);
  height: calc(100vh - var(--toolbar-height));
  min-width: 0;
  border-left: 1px solid var(--line);
  background: var(--terminal-bg);
}

.dock > .console {
  display: flex;
  flex-direction: column;
  height: 100%;
  border: none;
}

.dock .console-bar {
  position: relative;
  padding-right: 44px;
}

.dock .console-screen {
  flex: 1;
  height: auto;
  min-height: 0;
}

.dock-handle {
  position: absolute;
  inset: 0 auto 0 -4px;
  z-index: 3;
  width: 8px;
  cursor: col-resize;
}

.dock-handle:hover,
.dock-handle:focus-visible,
.resizing .dock-handle {
  background: linear-gradient(90deg, transparent 3px, var(--handle-focus) 3px 5px, transparent 5px);
  outline: none;
}

.dock-hint {
  position: absolute;
  top: 50%;
  left: 14px;
  z-index: 3;
  max-width: calc(100% - 28px);
  margin: 0;
  padding: 8px 12px;
  border: 1px solid var(--mauve);
  border-radius: 8px;
  background: var(--panel);
  color: var(--ink);
  font-size: 13px;
  pointer-events: none;
}

.dock-hint[hidden] {
  display: none;
}

.resizing {
  cursor: col-resize;
  user-select: none;
}

.dock-toggle {
  border: 1px solid var(--line);
  border-radius: 6px;
  background: none;
  color: var(--ink-soft);
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
}

.console-bar > .dock-toggle {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 28px;
  height: 28px;
}

.dock-rail {
  display: none;
}

.shell[data-dock='folded'] .dock > .console,
.shell[data-dock='folded'] .dock-handle {
  display: none;
}

.shell[data-dock='folded'] .dock-rail {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  height: 100%;
  padding: 12px 0;
  overflow-y: auto;
}

.dock-rail .dock-toggle {
  display: grid;
  place-items: center;
  flex: none;
  width: 40px;
  height: 40px;
  border-radius: 9px;
  background: var(--night);
}

.dock-rail .dock-toggle .nav-icon {
  display: grid;
}

.dock-rail-rule {
  flex: none;
  width: 24px;
  height: 1px;
  margin: 4px 0;
  background: var(--line);
}

.rail-lamp {
  display: grid;
  place-items: center;
  flex: none;
  width: 40px;
  height: 40px;
  border: none;
  border-radius: 9px;
  background: none;
  cursor: pointer;
}

.rail-lamp:hover {
  background: var(--panel);
}

.tabbar {
  display: none;
}

.theme-choice {
  display: flex;
  flex-wrap: wrap;
  gap: 0 16px;
  margin: 0;
  padding: 0;
  border: none;
  font-size: 13.5px;
  color: var(--ink-soft);
}

.theme-choice label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

/* ---------- a narrow desktop: the toolbar wraps ---------- */

@media (max-width: 1180px) {
  .toolbar {
    flex-wrap: wrap;
  }

  .toolbar-end {
    margin-left: 0;
  }
}

/* Ten sections (Agent notes is the tenth) no longer fit one line of the toolbar's switch at 768 px with the
   usual padding: a tighter switch, so no section sits past the edge (test/visual: page-scroll). */
@media (min-width: 761px) and (max-width: 1199px) {
  .views {
    gap: 0;
  }

  .views a {
    padding: 6px 6px;
  }
}

/* ---------- the rail: the header down the left, 1200 px and wider ---------- */
/* The same header as the toolbar (index.html), laid out as a column: the brand, Jump, the orchestrator,
   the sections with their icons, and at its foot the plan, the workers, Keep awake and Settings.
   Narrower, the rail's own parts are left out and the sections are tabs again. */

.rail-only,
.nav-icon,
.wordmark .brand {
  display: none;
}

.views .view-name {
  white-space: nowrap;
}

@media (min-width: 1200px) {
  :root {
    /* No toolbar on top: what sticks below it (the dock) sticks to the top. */
    --toolbar-height: 0px;
    --rail-width: 216px;
  }

  body {
    padding-left: var(--rail-width);
  }

  .toolbar {
    position: fixed;
    inset: 0 auto 0 0;
    width: var(--rail-width);
    flex-direction: column;
    align-items: stretch;
    gap: 2px;
    padding: 16px 12px 12px;
    border-bottom: none;
    border-right: 1px solid var(--line);
    background: var(--rail-bg);
    backdrop-filter: none;
    overflow-y: auto;
  }

  .wordmark {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 2px 8px 14px;
    font-size: 17px;
    font-stretch: 112%;
    color: var(--ink);
  }

  .wordmark .brand {
    display: block;
    flex: none;
  }

  .rail-only {
    display: flex;
  }

  /* Jump, ask or run: looks like a field, opens the palette (a button). */
  .jump {
    align-items: center;
    gap: 8px;
    min-height: 36px;
    margin-bottom: 12px;
    padding: 0 10px;
    border: 1px solid var(--line);
    border-radius: 9px;
    background: var(--panel);
    color: var(--ink-faint);
    font: 13px/1 var(--sans);
    text-align: left;
    cursor: pointer;
  }

  .jump:hover {
    color: var(--ink-soft);
  }

  /* One line, with "Ctrl K" off the Mac too: the words give way, cut with an ellipsis, before the key. */
  .jump-text {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .jump kbd {
    flex: none;
    white-space: nowrap;
    padding: 1px 5px;
    border: 1px solid var(--line);
    border-bottom-width: 2px;
    border-radius: 5px;
    color: var(--ink-soft);
    font: 11px/1.3 var(--mono);
  }

  .rail-orch {
    margin-bottom: 16px;
  }

  .rail-orch-button {
    display: flex;
    flex: 1;
    align-items: center;
    gap: 10px;
    min-width: 0;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--panel);
    color: var(--ink);
    font: inherit;
    text-align: left;
    cursor: pointer;
  }

  .rail-orch-button:hover:not(:disabled) {
    border-color: var(--mauve);
  }

  .rail-orch-text {
    display: flex;
    flex-direction: column;
    min-width: 0;
  }

  .rail-orch-name {
    font-size: 13.5px;
    font-weight: 600;
  }

  /* The state is information (when a limit resets, why it restarted): it wraps, two lines at most, with
     the whole text in its title. The model and effort under it are the ordinary line that may be cut. */
  .rail-orch-state {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow: hidden;
    overflow-wrap: anywhere;
    color: var(--ink-faint);
    font-size: 12px;
  }

  .rail-orch-facts {
    overflow: hidden;
    color: var(--ink-faint);
    font-size: 12px;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .rail-orch-state[data-tone='waiting'] {
    color: var(--bad-ink);
    font-weight: 600;
  }

  /* The sections: one link a line, its icon, its name, its number or dot at the end. */
  .views {
    flex-direction: column;
    gap: 2px;
    padding: 0;
    border: none;
    background: none;
  }

  .views a {
    justify-content: flex-start;
    gap: 10px;
    min-height: 36px;
    padding: 0 10px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    font-stretch: 100%;
  }

  .views a:hover {
    background: var(--panel);
  }

  .views a[aria-current='page'] {
    background: var(--panel);
    box-shadow: inset 2px 0 0 var(--gold-mark);
    font-weight: 650;
  }

  .views .nav-icon {
    display: grid;
    flex: none;
  }

  .views a[aria-current='page'] .nav-icon {
    color: var(--accent-ink);
  }

  .views .view-name {
    flex: 1;
  }

  /* At the rail's foot. */
  .toolbar-end {
    flex-direction: column;
    flex-wrap: nowrap;
    align-items: stretch;
    gap: 10px;
    margin: auto 0 0;
    padding: 14px 4px 0;
    border-top: 1px solid var(--line);
  }

  .toolbar-end > :first-child {
    margin-top: 0;
  }

  .usage {
    flex-direction: column;
    gap: 12px;
  }

  /* A meter as a line of its own: "5h 62%", the track under it, when it resets under that. */
  .toolbar .meter,
  .toolbar .meter:has(.meter-reset) {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
      'label value'
      'track track'
      'reset reset';
    gap: 5px 8px;
  }

  .toolbar .meter-label {
    grid-area: label;
    color: var(--ink-soft);
  }

  .toolbar .meter-value {
    grid-area: value;
    font-weight: 600;
  }

  .toolbar .meter-track {
    grid-area: track;
  }

  .toolbar .meter-reset {
    position: static;
    width: auto;
    height: auto;
    overflow: visible;
    clip-path: none;
    grid-area: reset;
  }

  .rail-workers {
    justify-content: space-between;
    gap: 8px;
    color: var(--ink-soft);
    font-size: 12.5px;
    text-decoration: none;
  }

  .rail-workers:hover .rail-workers-label {
    text-decoration: underline;
  }

  .rail-workers b {
    color: var(--ink);
    font-weight: 600;
  }

  .toolbar-end .awake-button,
  .toolbar-end .settings-button,
  .toolbar-end .version-chip,
  .toolbar-end .setup-chip {
    justify-content: flex-start;
    width: 100%;
  }

  .toolbar-end #awake {
    display: flex;
  }
}

/* ---------- the phone's bar: Now, Tasks, Inbox, Terminal, More ---------- */

@media (max-width: 760px) {
  .tabbar a,
  .bar-more {
    flex-direction: column;
    gap: 3px;
  }

  .tabbar .nav-icon {
    display: grid;
  }

  .more {
    position: relative;
    display: grid;
  }

  .bar-more {
    position: relative;
    display: flex;
    width: 100%;
    align-items: center;
    justify-content: center;
    min-height: 46px;
    padding: 4px 0;
    border: none;
    border-radius: 6px;
    background: none;
    color: var(--ink-soft);
    font: 600 12px/1 var(--sans);
    font-stretch: 85%;
    cursor: pointer;
  }

  .bar-more[aria-expanded='true'] {
    background: var(--night);
    color: var(--ink);
  }

  .bar-more .view-dot {
    position: absolute;
    top: 6px;
    right: 6px;
  }

  .more-menu {
    position: absolute;
    right: 0;
    bottom: calc(100% + 10px);
    min-width: 200px;
    margin: 0;
    padding: 6px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--panel);
    box-shadow: 0 -10px 28px rgb(0 0 0 / 0.3);
    list-style: none;
  }

  .more-menu[hidden] {
    display: none;
  }

  .tabbar .more-menu a {
    flex-direction: row;
    justify-content: flex-start;
    gap: 10px;
    min-height: 44px;
    padding: 0 12px;
    font-size: 14px;
    font-stretch: 100%;
  }

  .tabbar .more-menu .view-name {
    flex: 1;
  }

  .tabbar .more-menu .view-count,
  .tabbar .more-menu .view-dot {
    position: static;
  }
}

/* ---------- phone: views in a bottom bar, the terminals as a view of their own ---------- */

@media (max-width: 760px) {
  :root {
    --toolbar-height: 52px;
  }

  body {
    padding-bottom: calc(62px + env(safe-area-inset-bottom));
  }

  /* One line where it fits; on a 320 px screen, or with many chips, the chips go to a second line
     instead of past the edge (test/visual: page-scroll). */
  .toolbar {
    flex-wrap: wrap;
    gap: 6px 10px;
  }

  /* Usage stays on the Board's caption and in Activity; the toolbar keeps who waits for you. */
  .toolbar .views,
  .toolbar .usage {
    display: none;
  }

  /* The brand's lamps stand for the name, as in the design, so the search button fits beside Keep
     awake and Settings at 320 px; the name is still read out. */
  .wordmark {
    display: flex;
    align-items: center;
    font-size: 19px;
  }

  .wordmark .brand {
    display: block;
  }

  .wordmark-text {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
  }

  .settings-button span {
    display: none;
  }

  /* The line icon of the page's set (the sections' icons, public/app.js ICONS), where the button is the icon alone. */
  .settings-button .settings-icon {
    display: block;
  }

  .toolbar-end {
    flex-wrap: wrap;
    gap: 8px;
  }

  .shell,
  .shell[data-dock='folded'] {
    grid-template-columns: minmax(0, 1fr);
  }

  .dock {
    display: none;
  }

  body[data-view='terminal'] .views-area {
    display: none;
  }

  body[data-view='terminal'] .dock {
    display: block;
    position: static;
    height: calc(100vh - var(--toolbar-height) - 62px - env(safe-area-inset-bottom));
    border-left: none;
  }

  .dock-handle,
  .console-bar > .dock-toggle {
    display: none;
  }

  .tabbar {
    position: fixed;
    inset: auto 0 0 0;
    z-index: 30;
    display: grid;
    /* One column per link, however many sections are registered. */
    grid-auto-flow: column;
    grid-auto-columns: minmax(0, 1fr);
    gap: 2px;
    padding: 6px 6px calc(6px + env(safe-area-inset-bottom));
    border-top: 1px solid var(--line);
    background: var(--panel);
    box-shadow: 0 -10px 28px rgb(0 0 0 / 0.3);
  }

  /* Six links share 320 px: the names narrower (Archivo's width axis), the number and the dot on the
     link's corner, so every name sits on one line, centred, with or without one. */
  .tabbar a {
    position: relative;
    min-height: 46px;
    padding: 4px 0;
    font-size: 12px;
    font-stretch: 85%;
    gap: 4px;
  }

  .tabbar .view-count {
    position: absolute;
    top: 1px;
    right: 1px;
    min-width: 16px;
    padding: 0 4px;
    font-size: 10px;
    line-height: 16px;
  }

  .tabbar .view-dot {
    position: absolute;
    top: 6px;
    right: 6px;
  }

  .tabbar a[aria-current='page'] {
    background: var(--night);
    color: var(--ink);
    box-shadow: inset 0 -2px 0 var(--gold-mark);
  }

  .console-bar {
    padding-inline: 8px;
  }

  .form-row {
    flex-direction: column;
    align-items: stretch;
  }

  .settings {
    width: calc(100vw - 16px);
    max-height: calc(100vh - 16px);
  }
}

/* The middle panel's own part of the phone layout, a block of its own so that a panel the dock has narrowed can repeat it (below). */
@media (max-width: 760px) {
  .rail {
    grid-template-columns: minmax(0, 1fr);
  }

  .jack-slot {
    flex: 0 0 calc((100% - 6px) / 4);
  }

  .jack {
    width: 100%;
  }

  .rail-note {
    flex-basis: 100%;
    margin-top: 6px;
  }

  .needs-list {
    grid-template-columns: minmax(0, 1fr);
  }

  .repo summary {
    gap: 2px 10px;
  }
}

/* The same rules for a middle panel the terminal dock has narrowed, whatever the window. */
@container middle (max-width: 580px) {
  .rail {
    grid-template-columns: minmax(0, 1fr);
  }

  .jack-slot {
    flex: 0 0 calc((100% - 6px) / 4);
  }

  .jack {
    width: 100%;
  }

  .rail-note {
    flex-basis: 100%;
    margin-top: 6px;
  }

  .needs-list {
    grid-template-columns: minmax(0, 1fr);
  }

  .repo summary {
    gap: 2px 10px;
  }
}

.source-list + details {
  margin-top: 6px;
}

/* ---------- demo build only ---------- */

.demo-banner {
  margin: 0;
  padding: 8px var(--gutter);
  background: var(--plum);
  color: #fbefe4;
  font-size: 13.5px;
  text-align: center;
}

.demo-banner a {
  margin-left: 8px;
  color: var(--gold);
  font-weight: 600;
}

/* ---------- Inbox: a queue and the selected item ---------- */

.segments {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 0 var(--gutter) 16px;
}

.segments button {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 12px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: none;
  color: var(--ink-soft);
  font: 600 13px/1 var(--sans);
  cursor: pointer;
}

.segments button[aria-selected='true'] {
  border-color: var(--gold-mark);
  background: var(--panel);
  color: var(--ink);
}

.inbox,
.notes {
  display: grid;
  grid-template-columns: minmax(260px, 380px) minmax(0, 1fr);
  align-items: start;
  gap: 24px;
  padding: 0 var(--gutter) 64px;
}

/* Agent notes: a wider list than the Inbox's, so a row (a title and one line of the rest) reads on one line; it stacks as the Inbox does. */
.notes {
  grid-template-columns: minmax(300px, 3fr) minmax(0, 2fr);
}

/* A dense row: the title and the rest on one line, the title shortened where they do not fit. */
.queue[data-dense='true'] .queue-item {
  align-items: center;
  padding: 6px 12px;
}

.queue[data-dense='true'] .queue-item .lamp {
  margin-top: 0;
}

.queue[data-dense='true'] .queue-text {
  /* The title keeps the larger share, so a long line beside it never cuts it to a few letters. */
  grid-template-columns: minmax(0, 3fr) minmax(0, 2fr);
  align-items: baseline;
  gap: 12px;
}

.queue[data-dense='true'] .queue-text strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.queue[data-dense='true'] .queue-text small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.notes-caption {
  margin: 0 0 6px;
  font-size: 13px;
}

.queue-group {
  margin-bottom: 18px;
}

.queue-group h4,
.queue-group > summary {
  margin: 0 0 6px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-faint);
  cursor: default;
}

.queue-group > summary {
  cursor: pointer;
}

.queue {
  display: grid;
  gap: 2px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.queue-item {
  display: grid;
  grid-template-columns: 10px minmax(0, 1fr);
  align-items: start;
  gap: 12px;
  width: 100%;
  padding: 9px 12px;
  border: 1px solid transparent;
  border-radius: 7px;
  background: none;
  color: var(--ink);
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.queue-item .lamp {
  margin-top: 5px;
}

.queue-item:hover {
  background: var(--hover);
}

.queue-item[aria-current='true'] {
  border-color: var(--line);
  background: var(--panel);
  box-shadow: inset 3px 0 0 var(--gold-mark);
}

.queue-item:focus-visible {
  outline: 2px solid var(--accent-ink);
  outline-offset: 1px;
}

.queue-text {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.queue-text strong {
  font-weight: 600;
  font-size: 14px;
  overflow-wrap: anywhere;
}

.empty-queue {
  margin: 8px 0;
}

.inbox-detail {
  position: sticky;
  top: calc(var(--toolbar-height) + 16px);
  min-width: 0;
  /* A title, a repo or a path with no break in it (a finding's) wraps in the panel instead of widening the page. */
  overflow-wrap: anywhere;
}

.detail,
.detail-empty {
  display: grid;
  gap: 12px;
  padding: 20px 22px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel);
}

.detail-empty {
  color: var(--ink-soft);
}

.detail-empty p,
.detail p {
  margin: 0;
}

.detail h3 {
  font-size: 19px;
  font-weight: 700;
  line-height: 1.3;
  color: var(--ink);
}

.detail-kicker {
  color: var(--busy-ink);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: 11.5px;
}

.detail[data-type='security'] .detail-kicker {
  color: var(--bad-ink);
}

.detail-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.detail-actions .action-button {
  text-decoration: none;
}

.evidence,
.screen {
  max-height: 340px;
  margin: 0;
  padding: 12px 14px;
  overflow: auto;
  border-radius: 7px;
  background: var(--terminal-bg);
  color: #fbefe4;
  font: 12.5px/1.45 var(--mono);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.screen-preview {
  display: grid;
  gap: 8px;
}

.screen-preview h4 {
  margin: 0;
  font-size: 13px;
  color: var(--ink-soft);
}

.link-button {
  padding: 0;
  border: none;
  background: none;
  color: var(--ink);
  font: inherit;
  font-weight: 600;
  text-decoration: underline;
  text-decoration-color: var(--line);
  text-underline-offset: 3px;
  cursor: pointer;
}

/* ---------- Activity ---------- */

/* Starts waiting for room, each with why and Cancel; a long reason wraps. */
.start-queue {
  display: grid;
  gap: 6px;
  margin-bottom: 12px;
}

.start-queue h4 {
  margin: 0;
  font-size: 0.95em;
}

.queue-list {
  display: grid;
  gap: 6px;
  margin: 0;
  padding-left: 22px;
}

.queue-list li {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  justify-content: space-between;
}

.queue-text {
  min-width: 0;
  overflow-wrap: anywhere;
}

/* A start's name opens Edit: the page's link button, as wide as its name, at the size of the name beside a wake. */
.queue-text .queue-name {
  justify-self: start;
  font-size: 14px;
  text-align: left;
  overflow-wrap: anywhere;
}

.queue-buttons {
  display: flex;
  gap: 6px;
  flex: none;
}

.queue-list li.queue-editing {
  display: block;
}

.queue-edit {
  display: grid;
  gap: 8px;
}

.queue-done {
  overflow-wrap: anywhere;
}

.fleet-bar {
  display: grid;
  gap: 6px;
  margin-bottom: 8px;
}

.usage-row {
  display: grid;
  gap: 6px;
  margin-bottom: 12px;
}

.usage-line {
  display: flex;
  justify-content: space-between;
  font-variant-numeric: tabular-nums;
}

.meter-track.big {
  height: 10px;
  border-radius: 5px;
}

.usage-row[data-tone='bad'] .meter-fill {
  background: var(--rose);
}

.usage-row[data-tone='warm'] .meter-fill {
  background: var(--peach);
}

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 14px;
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 12.5px;
  color: var(--ink-soft);
}

.legend li {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.swatch {
  width: 10px;
  height: 10px;
  border-radius: 3px;
}

[data-family='opus'] {
  background: var(--model-opus);
}

[data-family='sonnet'] {
  background: var(--model-sonnet);
}

[data-family='haiku'] {
  background: var(--model-haiku);
}

[data-family='fable'] {
  background: var(--model-fable);
}

[data-family='other'] {
  background: var(--model-other);
}

.panel[hidden] {
  display: none;
}

/* A bar at most 24 px wide, and never the whole column: the air around it keeps the days apart. */
.tokens-day .stack {
  display: flex;
  flex-direction: column;
  gap: 2px;
  width: min(24px, 62%);
  min-height: 0;
  border-radius: 4px 4px 0 0;
  overflow: hidden;
}

.tokens-day .stack > span {
  display: block;
  flex-basis: 0;
  min-height: 2px;
}

/* ---------- Health ---------- */

.tiles {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr));
  gap: 10px;
  padding: 0 var(--gutter) 14px;
}

.tiles:empty {
  display: none;
}

.tile {
  display: grid;
  grid-template-columns: 10px minmax(0, 1fr);
  overflow-wrap: anywhere;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-left: 3px solid var(--peach);
  border-radius: 7px;
  background: var(--panel);
}

.tile[data-tone='bad'] {
  border-left-color: var(--rose);
}

.tile .lamp {
  margin-top: 6px;
}

.tile p {
  margin: 2px 0;
  color: var(--ink-soft);
  font-size: 13.5px;
}

/* Health's one action may be a link to docs/health.md: the quiet button, as a link. */
a.quiet-button {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  text-decoration: none;
}

.tile a.quiet-button {
  margin-top: 4px;
}

#claude-sessions {
  margin-top: 10px;
}

/* The inline confirmation's link is in the page's link colour, not the browser's blue. */
.confirm a {
  color: var(--accent-ink);
}

/* Folder trust: "N trusted." and Show all, with the trusted folders under them once opened. */
.trust-trusted {
  margin-top: 14px;
}

/* Keep awake: one line, the lamp and what it does now, and Change… */
.awake-line .awake-now {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

/* Folder trust: the confirmation opens in the folder's own row, across its columns. */
.mcp-list.trust-list li > .confirm {
  grid-column: 1 / -1;
}

.healthy {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 0 var(--gutter) 18px;
}

.healthy:empty {
  display: none;
}

.ok-chip {
  color: var(--ink-soft);
}

details.panel > summary {
  list-style: none;
  cursor: pointer;
}

details.panel > summary::-webkit-details-marker {
  display: none;
}

details.panel > summary h3 {
  display: inline;
}

details.panel > summary::after {
  content: ' ▸';
  color: var(--ink-faint);
}

details.panel[open] > summary::after {
  content: ' ▾';
}

@media (max-width: 900px) {
  .inbox,
  .notes {
    grid-template-columns: minmax(0, 1fr);
  }

  .inbox-detail {
    position: static;
  }

  /* A dense row has no room for its line beside the title: it goes under it, still on one line. */
  .queue[data-dense='true'] .queue-text {
    grid-template-columns: minmax(0, 1fr);
    gap: 0;
  }
}

/* The same rules for a middle panel the terminal dock has narrowed, whatever the window. */
@container middle (max-width: 650px) {
  .inbox,
  .notes {
    grid-template-columns: minmax(0, 1fr);
  }

  .inbox-detail {
    position: static;
  }

  /* A dense row has no room for its line beside the title: it goes under it, still on one line. */
  .queue[data-dense='true'] .queue-text {
    grid-template-columns: minmax(0, 1fr);
    gap: 0;
  }
}

/* ---------- the setup guide ---------- */

.guide-head {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
}

.guide {
  display: grid;
  grid-template-columns: 240px minmax(0, 720px);
  align-items: start;
  gap: 32px;
  padding: 4px var(--gutter) 64px;
}

.guide-steps {
  display: grid;
  gap: 2px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.guide-steps button {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 9px 12px;
  border: 1px solid transparent;
  border-radius: 7px;
  background: none;
  color: var(--ink-soft);
  font: 600 14px/1.3 var(--sans);
  text-align: left;
  cursor: pointer;
}

.guide-steps button[aria-current='step'] {
  border-color: var(--line);
  background: var(--panel);
  color: var(--ink);
  box-shadow: inset 3px 0 0 var(--gold-mark);
}

.guide-body {
  display: grid;
  gap: 18px;
}

.guide-step {
  display: grid;
  gap: 14px;
  padding: 22px 24px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel);
}

.guide-step h3 {
  font-size: 20px;
  color: var(--ink);
  outline: none;
}

.guide-step p {
  margin: 0;
}

.check-rows,
.setup-items {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.check-rows li {
  display: grid;
  grid-template-columns: 10px 110px minmax(0, 1fr);
  align-items: baseline;
  gap: 12px;
}

.check-rows.how li {
  grid-template-columns: 10px minmax(0, 1fr);
}

.check-rows span {
  color: var(--ink-soft);
}

.setup-items li {
  display: grid;
  grid-template-columns: 10px minmax(0, 1fr) auto;
  align-items: start;
  gap: 12px;
  padding: 10px 0;
  border-top: 1px solid var(--line);
}

.setup-items .lamp,
.check-rows .lamp {
  align-self: center;
}

.setup-items .change {
  margin: 6px 0 0;
  font: 12.5px/1.45 var(--mono);
  color: var(--ink-soft);
  overflow-wrap: anywhere;
}

.folder-choice {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  border: none;
}

.folder-choice legend {
  margin-bottom: 6px;
  font-weight: 600;
}

.folder-choice label {
  display: flex;
  align-items: baseline;
  gap: 10px;
}

.folder-choice .form-row input {
  flex: 1;
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--night);
  color: var(--ink);
  font: inherit;
}

.guide-step .field input {
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--night);
  color: var(--ink);
  font: inherit;
}

.guide-nav {
  display: flex;
  justify-content: space-between;
}

.guide-nav > :only-child {
  margin-left: auto;
}

.setup-chip {
  padding: 5px 12px;
  border: 1px dashed var(--peach);
  border-radius: 20px;
  color: var(--busy-ink);
  font: 600 13px/1 var(--sans);
  text-decoration: none;
  white-space: nowrap;
}

.setup-chip[hidden] {
  display: none;
}

.guide-link {
  justify-self: start;
  margin-top: 10px;
}

/* The first step: one card for each agent. The planned ones are muted and cannot be picked, but stay readable. */
.agent-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 12px;
  margin: 0;
  padding: 0;
  border: none;
}

.agent-cards legend {
  margin-bottom: 8px;
  font-weight: 600;
}

.agent-card {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  border: 1px solid var(--gold-mark);
  border-radius: 8px;
  background: var(--board-hi);
  cursor: default;
}

.agent-card:has(input:checked) {
  box-shadow: inset 3px 0 0 var(--gold-mark);
}

.agent-card:has(input:focus-visible) {
  outline: 2px solid var(--gold-mark);
  outline-offset: 2px;
}

.agent-card.is-planned {
  border: 1px dashed var(--line);
  background: transparent;
  color: var(--ink-soft);
}

.agent-card input {
  margin: 3px 0 0;
  accent-color: var(--gold);
}

.agent-text strong {
  color: var(--ink);
}

.agent-card.is-planned .agent-text strong {
  color: var(--ink-soft);
}

.agent-where {
  color: var(--ink-soft);
  font-family: var(--mono);
  font-size: 12px;
}

/* The sign-in step: the three kinds of access, then Model and Effort. */
.access-kinds {
  display: grid;
  gap: 8px;
}

.access-kinds h4 {
  margin: 0;
  font-size: 15px;
}

.access-kinds ul {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.access-kinds li {
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 7px;
}

.access-kinds li[data-current='true'] {
  border-color: var(--gold-mark);
  box-shadow: inset 3px 0 0 var(--gold-mark);
}

.access-you {
  color: var(--accent-ink);
  font-weight: 600;
}

.session-defaults .form-row {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
}

.session-defaults select {
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--night);
  color: var(--ink);
  font: inherit;
}

@media (max-width: 760px) {
  .guide {
    grid-template-columns: minmax(0, 1fr);
  }

  /* The steps stay a list, one under the other: all six fit the screen and none starts off it. */
  .guide-steps button {
    padding: 7px 12px;
  }

  /* The lamp, then the label, with its value under the label: no word waits in the lamp's column. */
  .check-rows li {
    grid-template-columns: 10px minmax(0, 1fr);
  }

  .check-rows li > .lamp {
    grid-column: 1;
    grid-row: 1;
  }

  .check-rows li > strong {
    grid-column: 2;
    grid-row: 1;
  }

  .check-rows li > span {
    grid-column: 2;
    grid-row: 2;
  }

  .check-rows.how li > span {
    grid-row: 1;
  }

  .setup-items li {
    grid-template-columns: 10px minmax(0, 1fr);
  }

  .setup-items li > .button-row {
    grid-column: 2;
  }
}

/* The same rules for a middle panel the terminal dock has narrowed, whatever the window. */
@container middle (max-width: 580px) {
  .guide {
    grid-template-columns: minmax(0, 1fr);
  }

  /* The steps stay a list, one under the other: all six fit the screen and none starts off it. */
  .guide-steps button {
    padding: 7px 12px;
  }

  /* The lamp, then the label, with its value under the label: no word waits in the lamp's column. */
  .check-rows li {
    grid-template-columns: 10px minmax(0, 1fr);
  }

  .check-rows li > .lamp {
    grid-column: 1;
    grid-row: 1;
  }

  .check-rows li > strong {
    grid-column: 2;
    grid-row: 1;
  }

  .check-rows li > span {
    grid-column: 2;
    grid-row: 2;
  }

  .check-rows.how li > span {
    grid-row: 1;
  }

  .setup-items li {
    grid-template-columns: 10px minmax(0, 1fr);
  }

  .setup-items li > .button-row {
    grid-column: 2;
  }
}

/* ---------- Activity: one column ---------- */

.view-column {
  display: grid;
  /* minmax(0, 1fr), not the default auto track: a wide table scrolls in its .table-scroll instead of widening the page. */
  grid-template-columns: minmax(0, 1fr);
  gap: 32px;
  padding: 4px var(--gutter) 64px;
}

.view-column .panel {
  grid-template-columns: minmax(0, 1fr);
}

/* A table scrolls sideways in its .table-scroll; a name broken mid-word would not make it fit. */
.panel table {
  overflow-wrap: normal;
}

/* The two windows side by side; the note and the resume button below them. */
.usage-pair {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr));
  gap: 8px 40px;
}

.usage-pair > :not(.usage-row) {
  grid-column: 1 / -1;
}

.view-column .tokens-chart {
  --plot-height: 160px;
}

/* ---------- keep awake: the toolbar button, its dialog, the Health panel ---------- */
/* A gold lamp while caffeinate runs, an unlit one while the Mac may sleep. */

.awake-button {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  white-space: nowrap;
}

/* A line of text even when only the lamp shows, so the button is as tall as Settings beside it. */
.awake-button::after {
  content: '\200b';
  margin-left: -7px;
}

.awake-short {
  display: none;
}

.awake-dialog {
  width: min(460px, calc(100vw - 32px));
}

.awake-explain {
  margin: 4px 0 0;
  color: var(--ink-soft);
  font-size: 13.5px;
}

.awake-form fieldset {
  gap: 8px;
}

.awake-option {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  font-size: 14px;
  cursor: pointer;
}

.awake-option:hover {
  background: var(--hover);
}

.awake-option:has(:checked) {
  border-color: var(--accent-ink);
}

.awake-option input {
  flex: none;
  margin: 0;
  accent-color: var(--accent-ink);
}

.awake-now {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin: 0;
  color: var(--ink-soft);
  font-size: 13.5px;
}

/* A long word (a path, a command's message) breaks instead of running out of the dialog. */
.awake-now > span {
  min-width: 0;
  overflow-wrap: anywhere;
}

/* Beside the first line when the text takes two. */
.awake-now .lamp {
  margin-top: 0.38em;
}

.awake-more {
  justify-self: start;
  color: var(--accent-ink);
  font-size: 13px;
}

#awake-health {
  display: grid;
  gap: 10px;
}

#awake-health .fineprint {
  margin: 0;
}

/* The full label fits on the toolbar's one line beside both meters from 1600 px, and in the rail.
   Narrower, one word beside the lamp; the full label is still read out, and the tooltip says more. */
@media (max-width: 1199px) {
  .awake-label {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
  }

  .awake-short {
    display: inline;
  }
}

@media (max-width: 760px) {
  .awake-button {
    min-height: 32px;
  }
}

/* ---------- status screen (status.js) ---------- */
/* One layer over the page while it cannot show the board: a picture, and one sentence. While Bulbboard
   works the picture is the exchange (exchange.js, below); while it does not, a faceplate of small lamps
   lit in waves. Both animate transform and opacity only, so the compositor runs them. */

.status-screen {
  position: fixed;
  inset: 0;
  z-index: 100;
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 48px var(--gutter) 9vh;
  border: 0;
  background: var(--night);
  color: var(--ink);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  overflow: auto;
  overscroll-behavior: contain;
}

.status-screen:not([open]) {
  display: none;
}

.status-screen.is-ready {
  transition: opacity 0.22s ease-out, display 0.26s allow-discrete, overlay 0.26s allow-discrete;
}

.status-screen.is-ready:not([open]) {
  opacity: 0;
  pointer-events: none;
}

@starting-style {
  .status-screen.is-ready[open] {
    opacity: 0;
  }
}

.status-screen::backdrop {
  background: transparent;
}

/* The page under the screen does not scroll, nor show its scroll bar. */
html.status-open {
  overflow: hidden;
}

/* Nor does it move: the page under the screen is covered and inert, but its pulsing lamps (a call for you)
   kept running, and WebKit drew the covered page again every frame beside the screen's own animations
   (headless WebKit: 30-46% of a core, 7% with the page's animations paused; test/visual/measure-status-cpu.ts).
   Paused, not removed: they go on from where they stopped when the screen fades out. */
html.status-open body > :not(.status-screen) *,
html.status-open body > :not(.status-screen) *::before,
html.status-open body > :not(.status-screen) *::after {
  animation-play-state: paused !important;
}

.status-board {
  /* The grid is made of the small lamp (docs/lamps.md): a lamp's outer size and 6 px between two (4 px on a phone). */
  --pitch: calc(var(--lamp-outer-small) + 6px);
  /* The board is a backdrop for the title, so it dims while nothing works: the quiet and the alert moods. */
  --board-dim: 0.55;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background:
    radial-gradient(circle at 50% 50%, var(--board-socket-hi) 0 1.5px, var(--board-socket-lo) 4.5px, transparent 5.5px) 0 0 / var(--pitch) var(--pitch),
    radial-gradient(120% 140% at 50% 0%, var(--board-hi) 0%, var(--panel) 55%, var(--board-lo) 100%);
  background-origin: content-box, border-box;
  background-clip: content-box, border-box;
  box-shadow: var(--menu-shadow);
}

.status-lights {
  display: flex;
  transition: opacity 0.6s ease;
}

.status-column {
  display: flex;
  flex-direction: column;
}

/* A lamp of the board is lamp() like any other (status.js); the board sets where it stands, and no more. */
.status-lights .lamp {
  margin: calc((var(--pitch) - var(--lamp-size-small)) / 2);
}

/* Calm (calm.js) stops every animation after the page has been without focus for a while. Here the dots of the
   title are the only sign that something is happening, so they run on; a hidden page (data-calm="hidden") stops them. */
:root[data-calm=''] .status-title .status-dots {
  animation-play-state: running !important;
}

/* The … of a title that says what is going on blinks, a slow count of dots. */
.status-dots {
  animation: status-dots 1.4s steps(1, end) infinite;
}

/* The board shows while nothing works, in the lamps' three looks, which status.js draws by the screen's mood
   (lamp() in dom.js): Bulbboard not running or the page without its link (quiet) is Quiet, every lamp an unlit
   face in its ring; an error (alert) is Calling, every lamp rose with a ring, pulsing. Both dim, and the pulse
   stops with reduced motion and with calm, as any lamp's does. The word beside the board is the screen's title. */
.status-screen[data-mood='quiet'] .status-lights,
.status-screen[data-mood='alert'] .status-lights {
  opacity: var(--board-dim);
}

@keyframes status-dots {
  0% { opacity: 0.2; }
  35% { opacity: 0.55; }
  70% { opacity: 1; }
}

/* ---------- the exchange (exchange.js) ---------- */
/* While Bulbboard works: the metro map that is the bulbboard.com hero's background, drawn the same way
  : the land as a thin contour, six slim lines in one quiet tone, the stations as open rings
   with no names, the exchange a larger one, all of it one quiet layer behind the title. A call: the caller's
   route to the exchange lights rose and its station rings, a light runs along it to the exchange and on
   along the callee's route, which lights gold; both stations end gold, and the lines go back to their tone.
   Every number here is LOOK in exchange.js, set as the custom properties --map-* (lookVars()), and every
   colour a token of the palette, so this and the site cannot drift (test/world-parity.test.ts). Moving
   parts change opacity or transform alone, as Web Animations that exchange.js gives them. */

/* The page under the map is the site's: the dark terminal ground, or the light board's lowest tone; a station
   is filled with it. While the board of lamps shows instead, the screen keeps the page's own ground. */
.status-screen {
  --map-page: var(--terminal-bg);
}

:root[data-theme='light'] .status-screen {
  --map-page: var(--board-lo);
}

@media (prefers-color-scheme: light) {
  :root:not([data-theme='dark']) .status-screen {
    --map-page: var(--board-lo);
  }
}

.status-screen[data-mood='live'],
.status-screen[data-mood='off'] {
  background: var(--map-page);
}

/* The map is the screen's background: it fades out into the page below, and its colour is never seen,
   only its alpha. */
.status-exchange {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: clip;
  pointer-events: none;
  container: world / size;
  mask-image: linear-gradient(to bottom, transparent 0, var(--ink) var(--map-fade-in), var(--ink) var(--map-fade-out), transparent 100%);
}

/* One picture at a time: the exchange while Bulbboard works or is not running (off), the board of
   lamps while the page has no link or hit an error. */
.status-screen:not([data-mood='live']):not([data-mood='off']) .status-exchange,
.status-screen[data-mood='live'] .status-board,
.status-screen[data-mood='off'] .status-board {
  display: none;
}

/* Not connected (status.js stops the exchange, so nothing moves and nothing runs): the same map dimmed,
   its lines dashed, out of service. A static look: no animation, so it costs no more than the board of
   lamps does, and it is the same in every motion setting. */
.status-screen[data-mood='off'] .exchange-stage {
  opacity: 0.6;
}

.status-screen[data-mood='off'] .metro-lines {
  stroke-dasharray: 3px 5px;
  stroke-linecap: butt;
}

/* The map's own size, its width over its height (MAP_WIDTH, MAP_HEIGHT in map.js): on a wide screen the whole
   map; on a tall one (a phone) it fills the screen and is sliced, so Europe and Africa sit behind the title. */
.exchange-stage {
  position: absolute;
  left: 50%;
  top: 50%;
  width: min(100cqw, calc(var(--map-ratio) * 100cqh));
  aspect-ratio: var(--map-aspect);
  transform: translate(-50%, -50%);
  container-type: inline-size;
}

@container world (max-aspect-ratio: 5 / 4) {
  .exchange-stage {
    width: max(100cqw, calc(var(--map-ratio) * 100cqh));
  }
}

.exchange-stage svg,
.exchange-slot {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.metro-base {
  fill: none;
  stroke: var(--ink-faint);
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: var(--map-layer-opacity);
}

.metro-land {
  stroke-width: var(--map-land-width);
  opacity: var(--map-land-opacity);
}

/* Slim and all in one quiet tone, a single token of the palette in both themes: the lines
   are no colour each. In a call the lit route is what shows; the lines go back to this tone when it is over. */
.metro-lines {
  stroke-width: var(--map-line-width);
  opacity: var(--map-line-opacity);
  vector-effect: non-scaling-stroke;
}

/* A station is an open ring: the page's ground inside, the line's tone round it. */
.metro-stops {
  fill: var(--map-page);
  stroke-width: var(--map-stop-width);
  opacity: var(--map-stop-opacity);
  vector-effect: non-scaling-stroke;
}

/* The call: the lit route (out in rose, back in gold), then the colours fade back to the neutral lines. */
.exchange-route,
.metro-still {
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: var(--map-route-width);
}

.exchange-route {
  opacity: 0;
}

.route-out {
  stroke: var(--lamp-call-ring);
  stroke-opacity: var(--map-route-out-opacity);
}

.route-back {
  stroke: var(--gold-mark);
  stroke-opacity: var(--map-route-back-opacity);
}

/* The still call (reduced motion, exchange.js sets data-still): two stations connected through the exchange. */
.metro-still {
  opacity: 0;
  stroke: none;
}

.metro-still circle {
  fill: var(--gold-mark);
}

.metro-still path {
  fill: none;
}

.metro-still .route-out {
  stroke: var(--lamp-call-ring);
}

.metro-still .route-back {
  stroke: var(--gold-mark);
}

.exchange-stage[data-still] .metro-still {
  opacity: 1;
}

.exchange-slot i {
  position: absolute;
  display: block;
  width: var(--map-dot);
  height: var(--map-dot);
  margin: calc(var(--map-dot) / -2) 0 0 calc(var(--map-dot) / -2);
  border-radius: 50%;
  opacity: 0;
}

.exchange-core,
.exchange-gold {
  background: var(--gold-mark);
}

.exchange-rose {
  background: var(--rose);
}

.exchange-ring {
  border: var(--map-ring-width) solid var(--lamp-call-ring);
}

.exchange-slot .exchange-spark {
  width: var(--map-spark);
  height: var(--map-spark);
  margin: calc(var(--map-spark) / -2) 0 0 calc(var(--map-spark) / -2);
  left: 0;
  top: 0;
  background: var(--map-spark-fill);
}

.status-message {
  display: grid;
  gap: 10px;
  max-width: 34rem;
  margin-top: 36px;
  outline: none;
}

.status-title {
  margin: 0;
  font-size: clamp(21px, 1.1rem + 0.7vw, 28px);
  font-weight: 600;
  font-stretch: 112%;
  letter-spacing: -0.012em;
  line-height: 1.2;
  color: var(--ink);
  text-wrap: balance;
}

.status-detail {
  justify-self: center;
  max-width: 46ch;
  margin: 0;
  color: var(--ink-soft);
  font-size: 15px;
  line-height: 1.55;
  text-wrap: pretty;
}

.status-detail[data-tone='bad'] {
  color: var(--bad-ink);
}

.status-detail p {
  margin: 0;
}

.status-detail ul {
  margin: 8px 0 0;
  padding: 0;
  list-style: none;
  line-height: 1.75;
}

.status-steps {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.status-step-word {
  margin-left: 4px;
  color: var(--ink-soft);
  font-size: 13px;
}

.status-steps[hidden] {
  display: none;
}

.status-retry {
  margin: 14px 0 0;
  color: var(--ink-faint);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}

.status-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-top: 18px;
}

.status-actions:empty {
  display: none;
}

@media (max-width: 760px) {
  .status-column:nth-child(n + 19) {
    display: none;
  }
}

/* The same rules for a middle panel the terminal dock has narrowed, whatever the window. */
@container middle (max-width: 580px) {
  .status-column:nth-child(n + 19) {
    display: none;
  }
}

@media (max-width: 480px) {
  .status-board {
    --pitch: calc(var(--lamp-outer-small) + 4px);
  }

  .status-column:nth-child(n + 15) {
    display: none;
  }
}

/* The same rules for a middle panel the terminal dock has narrowed, whatever the window. */
@container middle (max-width: 480px) {
  .status-board {
    --pitch: calc(var(--lamp-outer-small) + 4px);
  }

  .status-column:nth-child(n + 15) {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .status-dots {
    animation: none;
  }

  .status-screen.is-ready {
    transition: none;
  }
}

/* ---------- Agents section (public/agents.js) ---------- */
.matrix-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 18px;
  margin: 8px 0 10px;
}

.matrix-tabs {
  display: inline-flex;
  gap: 2px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--panel);
}

.matrix-tab {
  padding: 6px 14px;
  border: 0;
  border-radius: 6px;
  background: none;
  color: var(--ink-soft);
  font: 600 13.5px/1 var(--sans);
  font-stretch: 105%;
  cursor: pointer;
}

.matrix-tab:hover {
  color: var(--ink);
}

.matrix-tab[aria-selected='true'],
.matrix-tab[aria-pressed='true'] {
  background: var(--night);
  color: var(--ink);
  box-shadow: inset 0 -2px 0 var(--gold);
}

.matrix-fresh {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
  color: var(--ink-faint);
  font-size: 13px;
}

.matrix-scope .origin-count {
  margin-left: 2px;
  font-weight: 500;
}

.matrix-note {
  margin: -2px 0 10px;
  color: var(--ink-soft);
  font-size: 13px;
}

.matrix-note:empty {
  display: none;
}

.matrix-note .quiet-button {
  min-height: 26px;
}

.matrix-status {
  margin: 0 0 8px;
  font-size: 13.5px;
}

.matrix-status:empty {
  display: none;
}

.matrix-empty {
  margin: 0;
  padding: 18px 2px;
}

.origin-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0 0 12px;
}

.origin-choice {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 30px;
  padding: 4px 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: none;
  color: var(--ink-soft);
  font-size: 13px;
  cursor: pointer;
}

.origin-choice:hover {
  border-color: var(--accent-ink);
  color: var(--ink);
}

.origin-choice[aria-pressed='true'] {
  border-color: var(--accent-ink);
  background: var(--panel);
  color: var(--ink);
  box-shadow: inset 0 -2px 0 var(--accent-ink);
}

.origin-count {
  color: var(--ink-faint);
  font-variant-numeric: tabular-nums;
}

.origin-dot {
  display: inline-block;
  flex: none;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--origin-unknown);
}

.origin-dot[data-group='yours'] {
  background: var(--origin-yours);
}

.origin-dot[data-group='web'] {
  background: var(--origin-web);
}

.origin-dot[data-group='bulbboard'] {
  background: var(--origin-bulbboard);
}

.origin-dot[data-group='review-role'] {
  background: var(--origin-review);
}

.origin-dot[data-group='claude-code'] {
  background: var(--origin-claude);
}


.origin-chip {
  --chip: var(--origin-unknown);
  display: inline-block;
  max-width: 100%;
  padding: 1px 7px;
  border: 1px solid var(--chip);
  border-radius: 999px;
  color: var(--chip);
  font-size: 11.5px;
  font-weight: 650;
  line-height: 1.5;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.origin-chip[data-group='yours'] {
  --chip: var(--origin-yours);
}

.origin-chip[data-group='web'] {
  --chip: var(--origin-web);
}

.origin-chip[data-group='bulbboard'] {
  --chip: var(--origin-bulbboard);
}

.origin-chip[data-group='review-role'] {
  --chip: var(--origin-review);
}

.origin-chip[data-group='claude-code'] {
  --chip: var(--origin-claude);
}


.origin-detail {
  font-weight: 500;
}

.agent-group + .agent-group {
  margin-top: 20px;
}

.agent-group-title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 8px;
  color: var(--ink);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.agent-group-note {
  margin: 0 0 8px;
  max-width: 62ch;
  color: var(--ink-soft);
  font-size: 13px;
}

.agent-group-error {
  margin: 0 0 8px;
  font-size: 13px;
}

.agent-group-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 0 0 8px;
}

.agent-group-bar .quiet-button,
.agent-names .quiet-button,
.agent-hidden .quiet-button {
  min-height: 28px;
}

/* The names no file defines: one line each, the name, how it was used, and Hide. */
.agent-names,
.agent-hidden-names {
  display: grid;
  gap: 4px;
  margin: 0 0 8px;
  padding: 0;
  list-style: none;
}

.agent-names > li,
.agent-hidden-names > li {
  display: grid;
  grid-template-columns: minmax(8rem, 14rem) minmax(0, 1fr) auto;
  align-items: center;
  gap: 4px 12px;
  padding: 5px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--night);
  font-size: 13px;
}

.agent-hidden-names > li {
  grid-template-columns: minmax(0, 1fr) auto;
}

.agent-names .agent-name,
.agent-hidden-names .agent-name {
  overflow-wrap: anywhere;
}

.agent-names-uses {
  min-width: 0;
  color: var(--ink-soft);
  overflow-wrap: anywhere;
}

.agent-hidden {
  margin: 6px 0 0;
  color: var(--ink-soft);
  font-size: 13px;
}

.agent-hidden p {
  margin: 0 0 6px;
}

@media (max-width: 560px) {
  .agent-names > li {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .agent-names-uses {
    grid-column: 1 / -1;
    grid-row: 2;
  }
}

/* The same rules for a middle panel the terminal dock has narrowed, whatever the window. */
@container middle (max-width: 560px) {
  .agent-names > li {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .agent-names-uses {
    grid-column: 1 / -1;
    grid-row: 2;
  }
}

/* One column at the phone width, as many 15rem columns as fit above it; never wider than the page. */
.agent-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 15rem), 1fr));
  align-items: start;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

/* A tile: its front (a button) and its back stacked in one place; the side not shown is turned away,
   out of the flow (so the tile is as tall as the side it shows) and inert. */
.agent-tile {
  min-width: 0;
  perspective: 1400px;
}

.agent-tile-inner {
  position: relative;
  transform-style: preserve-3d;
}

.agent-face {
  box-sizing: border-box;
  width: 100%;
  min-height: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--night);
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}

.agent-front {
  display: grid;
  gap: 6px;
  padding: 11px 12px 10px;
  color: inherit;
  font: inherit;
  font-size: 13px;
  text-align: left;
  cursor: pointer;
}

.agent-front:hover {
  border-color: var(--mauve);
  background: var(--panel);
}

.agent-front:focus-visible,
.agent-back-head:focus-visible {
  outline: 2px solid var(--accent-ink);
  outline-offset: 2px;
}

.agent-back {
  display: grid;
  gap: 10px;
  padding: 0 12px 12px;
  background: var(--panel);
  font-size: 13px;
  transform: rotateY(180deg);
  cursor: pointer;
}

.agent-tile:not([data-flipped='true']) .agent-back,
.agent-tile[data-flipped='true'] .agent-front {
  position: absolute;
  inset: 0;
  overflow: hidden;
  visibility: hidden;
}

.agent-tile[data-flipped='true'] .agent-tile-inner {
  transform: rotateY(180deg);
}

@media (prefers-reduced-motion: no-preference) {
  .agent-tile-inner {
    transition: transform 0.45s cubic-bezier(0.2, 0.7, 0.2, 1);
  }

  /* The side turning away stays visible while it turns, and goes once it faces away. */
  .agent-face {
    transition: visibility 0s linear 0.45s;
  }

  .agent-tile[data-flipped='true'] .agent-back,
  .agent-tile:not([data-flipped='true']) .agent-front {
    transition-delay: 0s;
  }
}

.agent-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 4px 8px;
  min-width: 0;
}

.agent-name {
  min-width: 0;
  color: var(--ink);
  font-size: 14px;
  font-weight: 650;
  overflow-wrap: anywhere;
}

.agent-usage {
  color: var(--ink-soft);
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}

.agent-avail {
  color: var(--ink-faint);
  font-size: 12.5px;
  overflow-wrap: anywhere;
}

.agent-turn {
  justify-self: end;
  color: var(--ink-faint);
  font-size: 12px;
  white-space: nowrap;
}

.agent-deleted {
  justify-self: start;
  padding: 1px 7px;
  border-radius: 4px;
  background: var(--danger-bg);
  color: var(--bad-ink);
  font-size: 12px;
  font-weight: 650;
}

/* A built-in skill that is turned off: sessions do not see it. Not an error, so no danger colours. */
.agent-off {
  justify-self: start;
  padding: 0 7px;
  border: 1px solid var(--ink-faint);
  border-radius: 4px;
  color: var(--ink-faint);
  font-size: 12px;
  font-weight: 650;
}

.agent-tile[data-off='true'] .agent-name {
  color: var(--ink-faint);
}

.agent-tile[data-deleted='true'] .agent-name {
  text-decoration: line-through;
  text-decoration-color: var(--ink-faint);
}

.agent-back-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  width: calc(100% + 24px);
  margin: 0 -12px;
  padding: 11px 12px 8px;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 10px 10px 0 0;
  background: none;
  color: inherit;
  text-align: left;
  cursor: pointer;
}

.agent-back-head:hover .agent-turn {
  color: var(--accent-ink);
}

.agent-facts {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 2px;
  margin: 0;
  cursor: auto;
}

.agent-facts dt {
  margin-top: 6px;
  color: var(--ink-faint);
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.agent-facts dt:first-child {
  margin-top: 0;
}

.agent-facts dd {
  margin: 0;
  color: var(--ink-soft);
  overflow-wrap: anywhere;
}

.agent-facts code,
.agent-remove code {
  font: 12px var(--mono);
  overflow-wrap: anywhere;
}

.agent-file {
  display: block;
  margin-top: 2px;
}

.agent-where {
  display: grid;
  gap: 1px;
  margin: 0;
  padding: 0;
  list-style: none;
  font-variant-numeric: tabular-nums;
}

.agent-where strong {
  color: var(--work-ink);
  font-weight: 650;
}

.agent-remove {
  display: grid;
  gap: 6px;
  cursor: auto;
}

.agent-remove p {
  margin: 0;
  overflow-wrap: anywhere;
}

.agent-remove > .quiet-button {
  justify-self: start;
  min-height: 28px;
}

.agent-remove[data-state='deleted'] {
  padding: 8px 10px;
  border-left: 3px solid var(--origin-bulbboard);
  background: var(--night);
}

.agent-commands {
  display: grid;
  gap: 3px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.agent-commands code {
  display: block;
  padding: 3px 6px;
  border-radius: 4px;
  background: var(--night);
  color: var(--ink);
  user-select: all;
}

.confirm-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.confirm-actions .quiet-button {
  min-height: 28px;
}

@media (max-width: 760px) {
  .matrix-fresh {
    margin-left: 0;
  }
}

/* The same rules for a middle panel the terminal dock has narrowed, whatever the window. */
@container middle (max-width: 580px) {
  .matrix-fresh {
    margin-left: 0;
  }
}

/* The rail's foot (1200 px and wider): Keep awake, the version and Settings as plain lines, as the
   sections above them are; after the rules for those buttons, so these win. */
@media (min-width: 1200px) {
  .toolbar-end .awake-button,
  .toolbar-end .settings-button,
  .toolbar-end .version-chip {
    display: flex;
    /* The rail is narrow: "v1.0.0 + 3 commits" stays whole and the word and the count go to a line of their own when they do not fit. */
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-start;
    gap: 2px 10px;
    width: 100%;
    min-height: 34px;
    padding: 0 6px;
    border: none;
    border-radius: 8px;
    font-size: 13px;
    text-align: left;
  }

  .toolbar-end .awake-button:hover,
  .toolbar-end .settings-button:hover,
  .toolbar-end .version-chip:hover {
    background: var(--panel);
  }

  /* The count at the rail's right edge, as the sections' counts are. */
  .toolbar-end .version-chip .chip-count {
    margin-left: auto;
  }

  .toolbar-end .settings-button .settings-icon {
    display: block;
    flex: none;
    width: 16px;
    height: 16px;
  }

  /* "Plan · 5h 46%" over its track, "Resets 4:53 PM" under it. */
  .toolbar .meter-label::before {
    content: 'Plan · ';
  }

  .toolbar .meter-reset .visually-hidden {
    position: static;
    width: auto;
    height: auto;
    overflow: visible;
    clip: auto;
    clip-path: none;
    white-space: normal;
  }

  .toolbar .meter-reset::first-letter {
    text-transform: uppercase;
  }
}

/* Keep awake in the rail has room for its whole label ("Awake: while working"). */
@media (min-width: 1200px) {
  .toolbar-end .awake-label {
    position: static;
    width: auto;
    height: auto;
    overflow: visible;
    clip-path: none;
  }

  .toolbar-end .awake-short {
    display: none;
  }
}

/* ---------- the ⌘K palette (openPalette in app.js) ---------- */
/* One box near the top: the field, the groups of lines, a note for the second Enter, and the keys. On a
   phone it takes the whole width from the top. */

.palette {
  width: min(680px, calc(100vw - 32px));
  max-height: calc(100vh - 120px);
  margin: 88px auto auto;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel);
  color: var(--ink);
  box-shadow: 0 24px 60px rgb(0 0 0 / 0.55);
  overflow: hidden;
}

.palette[open] {
  display: flex;
  flex-direction: column;
}

.palette::backdrop {
  background: rgb(18 8 22 / 0.6);
}

.palette-field {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  color: var(--ink-soft);
}

.palette-field input {
  flex: 1;
  min-width: 0;
  border: 0;
  background: none;
  color: var(--ink);
  font: 400 17px/1.4 var(--sans);
  outline: none;
}

.palette-field input::placeholder {
  color: var(--ink-faint);
}

.palette kbd {
  padding: 1px 6px;
  border: 1px solid var(--line);
  border-bottom-width: 2px;
  border-radius: 5px;
  color: var(--ink-soft);
  font: 11px/1.3 var(--mono);
}

.palette-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 6px 8px 8px;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.palette-list[hidden] {
  display: none;
}

.palette-group-label {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 10px 4px;
  color: var(--ink-faint);
  font: 700 11px/1.2 var(--sans);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.palette-group-label[data-group='needs'] {
  color: var(--bad-ink);
}

.palette-module {
  padding: 1px 6px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--accent-ink) 14%, transparent);
  color: var(--ink-soft);
  font-size: 10px;
  letter-spacing: 0.04em;
}

.palette-option {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 40px;
  padding: 4px 10px;
  border-radius: 9px;
  cursor: pointer;
}

.palette-option[aria-selected='true'] {
  background: color-mix(in srgb, var(--ink) 8%, var(--panel));
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent-ink) 40%, transparent);
}

.palette-option[data-confirm='true'] {
  box-shadow: inset 0 0 0 1px var(--danger-line);
  background: var(--danger-bg);
}

.palette-lead {
  display: grid;
  flex: none;
  width: 20px;
  place-items: center;
  color: var(--ink-soft);
}

.palette-lead .nav-icon {
  display: grid;
}

.palette-label {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  font-size: 14px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.palette-label mark {
  background: none;
  color: var(--accent-ink);
  font-weight: 700;
}

.palette-hint {
  flex: none;
  max-width: 45%;
  overflow: hidden;
  color: var(--ink-faint);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* On the selected line's background the faint ink is too faint (4.2:1 in the light theme). */
.palette-option[aria-selected='true'] .palette-hint {
  color: var(--ink-soft);
}

.palette-option[data-confirm='true'] .palette-hint {
  color: var(--bad-ink);
  font-weight: 600;
}

.palette-note {
  margin: 0;
  padding: 0 18px;
  color: var(--ink-soft);
  font-size: 13px;
}

.palette-note:not(:empty):not(.visually-hidden) {
  padding: 10px 18px;
  border-top: 1px solid var(--line);
}

/* Said aloud only (the line shows the same words): no padding, so it stays one pixel. */
.palette-note.visually-hidden {
  padding: 0;
}

.palette-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 16px;
  padding: 10px 16px;
  border-top: 1px solid var(--line);
  color: var(--ink-faint);
  font-size: 12px;
}

.palette-foot span {
  display: flex;
  align-items: center;
  gap: 5px;
}

.palette-foot-end {
  margin-left: auto;
}

/* The toast (toast.js): what an action answered, under the toolbar, for a while; a note that stays has its buttons and ×. */
.palette-toast {
  position: fixed;
  display: flex;
  align-items: center;
  gap: 4px 12px;
  flex-wrap: wrap;
  z-index: 40;
  top: calc(var(--toolbar-height, 0px) + 12px);
  left: 50%;
  /* As wide as its words, up to the screen less a gutter: with left at 50% a plain shrink-to-fit would only have half the screen. */
  width: max-content;
  max-width: min(560px, calc(100vw - 32px));
  margin: 0;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent-ink);
  border-radius: 8px;
  background: var(--panel);
  color: var(--ink);
  box-shadow: 0 12px 30px rgb(0 0 0 / 0.35);
  transform: translateX(-50%);
}

.palette-toast[data-tone='bad'] {
  border-left-color: var(--rose);
}

.palette-toast[hidden] {
  display: none;
}

.toast-text {
  min-width: 0;
  flex: 1 1 auto;
  overflow-wrap: anywhere;
}

.toast-close {
  padding-inline: 8px;
  font-size: 16px;
  line-height: 1;
}

/* The search button in the toolbar, below the rail's width; the rail has the field instead. */
.jump-small {
  display: inline-grid;
  place-items: center;
  min-width: 36px;
  min-height: 36px;
}

@media (min-width: 1200px) {
  .jump-small {
    display: none;
  }
}

@media (max-width: 760px) {
  .palette {
    width: 100vw;
    max-width: 100vw;
    max-height: 100dvh;
    margin: 0 0 auto;
    border-width: 0 0 1px;
    border-radius: 0 0 14px 14px;
  }

  /* A line wraps instead of being cut, and the second Enter's words go on a line of their own. */
  .palette-option {
    flex-wrap: wrap;
    min-height: 48px;
    padding-block: 6px;
  }

  .palette-label {
    white-space: normal;
    overflow-wrap: anywhere;
  }

  .palette-hint,
  .palette-enter {
    display: none;
  }

  .palette-option[data-confirm='true'] .palette-hint {
    display: block;
    flex-basis: 100%;
    max-width: none;
    padding-left: 32px;
    white-space: normal;
  }

  .palette-foot {
    display: none;
  }
}

/* ---------- Modules (public/modules.js, docs/modules.md) ---------- */

/* "module" beside what a module added: its rail group, its section's heading, its task fields. */
.module-chip {
  display: inline-block;
  padding: 1px 6px;
  border-radius: 999px;
  background: var(--module-bg);
  color: var(--module);
  font-size: 10px;
  font-weight: 600;
  line-height: 1.4;
  letter-spacing: 0.04em;
  text-transform: none;
  vertical-align: middle;
  white-space: nowrap;
}

/* A module's sections: in the toolbar's tabs, after the page's own, its name before them. */
.nav-module {
  display: flex;
  align-items: center;
  gap: 2px;
  min-width: 0;
}

.nav-module-head {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 4px 0 10px;
  color: var(--ink-faint);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
}

.nav-module a .nav-icon {
  color: var(--module);
}

/* In the rail: a heading of its own, as in the design (name, module chip), then its links. */
@media (min-width: 1200px) {
  .nav-module {
    flex-direction: column;
    align-items: stretch;
  }

  .nav-module-head {
    margin-top: 16px;
    padding: 0 10px 4px;
  }
}

/* Its one line in the Now strip, under the lamps: its icon, its name in bold, its words, Open. The
   strip is taller by a line while a module has one, so it keeps one height whether the line shows. */
.now[data-module-line] {
  --now-height: 136px;
}

.now-module {
  display: grid;
  gap: 6px;
  min-width: 0;
}

/* No module has a line: the slot takes no room, as before modules. */
.now-module[hidden] {
  display: none;
}

.now-module-line {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  min-width: 0;
  margin: 0;
  color: var(--ink-soft);
  font-size: 13.5px;
  overflow-wrap: anywhere;
}

.now-module-line > .nav-icon {
  flex: none;
  margin-top: 1px;
  color: var(--module);
}

.now-module-line b {
  color: var(--ink);
  font-weight: 600;
}

.now-module-text {
  flex: 0 1 auto;
  min-width: 0;
}

.now-module-open {
  flex: none;
  color: var(--accent-ink);
  font-weight: 500;
  white-space: nowrap;
}

/* A module's section: the chip beside its heading, as wide as its word. */
.view-head > .module-chip {
  justify-self: start;
}

/* A task's module fields: "Estimate  M", quiet, under its note. */
.task-modules {
  display: grid;
  gap: 2px;
  margin: 0;
  font-size: 12.5px;
}

.task-modules > div {
  display: flex;
  gap: 8px;
  min-width: 0;
}

.task-modules dt {
  flex: none;
  color: var(--ink-faint);
}

.task-modules dd {
  min-width: 0;
  margin: 0;
  color: var(--ink-soft);
  overflow-wrap: anywhere;
}

/* Settings › Modules: a group of the dialog like Updates (.settings fieldset). */

.settings-modules p {
  margin: 0;
  min-width: 0;
  overflow-wrap: anywhere;
}

.modules-warning {
  padding: 8px 10px;
  border-left: 3px solid var(--module);
  border-radius: 4px;
  background: var(--module-bg);
  color: var(--ink);
  font-size: 13px;
}

.modules-problem {
  color: var(--bad-ink);
}

.modules-list {
  display: grid;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.module-row {
  display: grid;
  gap: 2px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  min-width: 0;
}

.module-version {
  color: var(--ink-faint);
}

.module-status[data-status='loaded'] {
  color: var(--work-ink);
}

.module-status[data-status='failed'] {
  color: var(--bad-ink);
  overflow-wrap: anywhere;
}

.module-folder code,
.module-hash code {
  color: var(--ink-soft);
  font-size: 12px;
  overflow-wrap: anywhere;
}

.module-hash,
.module-changed {
  color: var(--ink-soft);
  font-size: 12px;
}

.module-status[data-status='waiting'] {
  color: var(--module);
  font-weight: 600;
}

.module-approve {
  justify-self: start;
  margin-top: 4px;
}

/* The page's one link style (More, the docs links, Open the page without modules): the accent colour of the theme, underlined,
   darker to the body ink on hover. The focus ring is the page's own (:focus-visible above). No link shows the browser's blue. */
a.doc-link {
  color: var(--accent-ink);
  text-decoration: underline;
  text-underline-offset: 3px;
}

a.doc-link:hover {
  color: var(--ink);
  text-decoration-thickness: 2px;
}

/* Settings › Help › Rotate the token: the control Help opens in place; its confirmation is the page's (.confirm). */

.settings-token p {
  margin: 0;
  min-width: 0;
  overflow-wrap: anywhere;
}

.settings-token .token-rotate[hidden],
.settings-token .token-confirm[hidden] {
  display: none;
}

.settings-token .token-status:empty {
  display: none;
}

/* The guided tour (public/tour.js): one modal dialog as big as the screen and clear, a ring round the
   part a step points at (its huge shadow dims the rest of the page) and a card. The card sits beside the
   ring from 761 px; on a phone it is a sheet along the bottom, and the part scrolls into the room above.
   A step whose part is not on screen has no ring and a card in the middle. */

.tour {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--ink);
  overflow: hidden;
}

.tour::backdrop {
  background: transparent;
}

.tour-spot {
  position: fixed;
  border-radius: 10px;
  outline: 3px solid var(--accent-ink);
  outline-offset: 0;
  box-shadow: 0 0 0 100vmax rgb(12 5 16 / 0.62);
  pointer-events: none;
}

.tour-spot[hidden] {
  display: none;
}

/* No ring, nothing to point at: the whole page is dimmed by the dialog itself. */
.tour:has(.tour-spot[hidden]) {
  background: rgb(12 5 16 / 0.62);
}

.tour-card {
  position: fixed;
  display: grid;
  gap: 8px;
  width: min(400px, calc(100vw - 32px));
  max-height: calc(100vh - 32px);
  overflow-y: auto;
  padding: 16px 18px 14px;
  border: 1px solid var(--mauve);
  border-radius: 12px;
  background: var(--panel);
  color: var(--ink);
  box-shadow: 0 24px 60px rgb(0 0 0 / 0.55);
}

.tour-card[data-at='center'] {
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

.tour-card[data-at='sheet'] {
  top: auto;
  right: 16px;
  bottom: 16px;
  left: 16px;
  width: auto;
  max-height: 58vh;
}

.tour-card > * {
  margin: 0;
  min-width: 0;
  overflow-wrap: anywhere;
}

.tour-count {
  color: var(--ink-soft);
  font: 600 12px/1.3 var(--sans);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.tour-title {
  font: 700 19px/1.25 var(--sans);
}

.tour-title:focus {
  outline: none;
}

.tour-title:focus-visible {
  outline: 2px solid var(--accent-ink);
  outline-offset: 3px;
  border-radius: 4px;
}

.tour-text {
  color: var(--ink);
  font: 400 15px/1.5 var(--sans);
}

.tour-empty {
  padding: 8px 10px;
  border-left: 3px solid var(--peach);
  background: var(--board-lo);
  color: var(--ink-soft);
  font: 400 14px/1.45 var(--sans);
}

.tour-more a {
  color: var(--accent-ink);
  font: 600 14px/1.4 var(--sans);
}

.tour-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 4px;
}

.tour-skip {
  margin-left: auto;
}

.tour-actions button:disabled {
  opacity: 0.55;
}

.tour-keys {
  color: var(--ink-faint);
  font: 400 12px/1.3 var(--sans);
}

@media (max-width: 760px), (hover: none) {
  .tour-keys {
    display: none;
  }
}

/* On a phone the card covers the bottom of the screen, so while the tour is open the page has room
   below its end: a part near the bottom can still be scrolled up above the card. */
@media (max-width: 760px) {
  html[data-tour] body {
    padding-bottom: 62vh;
  }

  /* The Now strip stops sticking while the tour is open: stuck under the toolbar it would hide the part
     a step points at, in the little room a phone has above the card. */
  html[data-tour] .now {
    position: relative;
    top: auto;
  }
}

/* Settings: the setup guide, the tour and the feature list, side by side where there is room. */
.settings-help {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.settings-help .guide-link {
  margin-top: 0;
}

.settings-help .features-link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  text-decoration: none;
}

/* The ring's move from one part to the next: the only motion, and none when it is asked for none. */
@media (prefers-reduced-motion: no-preference) {
  .tour-spot {
    transition: top 0.18s ease, left 0.18s ease, width 0.18s ease, height 0.18s ease;
  }
}

/* ---------- Decisions: the standing orders the orchestrator keeps to ---------- */

.decisions {
  display: grid;
  gap: 16px;
  min-width: 0;
  padding: 0 var(--gutter) 64px;
}

.decisions-group {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.decisions-group h3 {
  margin: 0;
  font-size: 12px;
  font-weight: 650;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

/* A part's title with its count beside it, then one quiet sentence under both. */
.decisions-head {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.decisions-count {
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  color: var(--ink-soft);
}

.decisions-caption {
  margin: 0;
  font-size: 13px;
}

/* Open questions with nothing waiting: Tasks' empty-column line (.task-none) with a lamp in front; only the lamp's place is set here. */
.decisions-empty {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
}


.decisions-clear {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.decision-list {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
  min-width: 0;
}

.decision {
  display: grid;
  gap: 4px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-left: 3px solid var(--mauve);
  border-radius: 6px;
  background: var(--night);
  min-width: 0;
  overflow-wrap: anywhere;
}

.decision[data-state='retired'] {
  border-left-color: var(--line);
  color: var(--ink-soft);
}

.decision p {
  margin: 0;
}

.decision-quote {
  color: var(--ink-soft);
  font-style: italic;
}

.decision-note {
  color: var(--ink-soft);
  font-size: 13px;
}

.decision-meta {
  color: var(--ink-faint);
  font-size: 12px;
}

.decision-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.decision-form {
  display: grid;
  gap: 8px;
}

/* The Team slot (public/team.js): a blurred preview of a team board, and over it one line and one link.
   The preview is decoration (aria-hidden, inert); nothing on it can be clicked or focused. */
.team-placeholder {
  position: relative;
  display: grid;
  min-height: 300px;
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  background: var(--night);
}

.team-preview {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 12px;
  padding: 16px;
  filter: blur(7px);
  pointer-events: none;
  user-select: none;
}

.team-person {
  display: grid;
  align-content: start;
  gap: 8px;
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel);
}

.team-name {
  font-weight: 700;
  color: var(--ink);
}

.team-session,
.team-task {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 9px;
  border-radius: 8px;
  background: var(--board-lo);
  color: var(--ink-soft);
  font-size: 14px;
}

.team-offer {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 0;
  padding: 16px;
  text-align: center;
}

.team-card {
  display: grid;
  justify-items: center;
  gap: 8px;
  max-width: 34ch;
  padding: 16px 20px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel);
  text-align: center;
}

.team-line {
  margin: 0;
  color: var(--ink);
  font-size: 17px;
  font-weight: 650;
}

.team-link {
  color: var(--accent-ink);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.team-link:hover {
  text-decoration-thickness: 2px;
}

.task-edit {
  display: grid;
  gap: 10px;
  min-width: 0;
}

.task-edit .field input,
.task-edit .field textarea {
  width: 100%;
  box-sizing: border-box;
}

/* Health, Leftover processes: each ended process on a line of its own, pid and command. */
.leftover-pids {
  font-family: var(--mono);
  font-size: 0.85em;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
