/* The home page (home.html): the top bar, the agents column, the work grouped by stream,
   the session dialog and the small dialogs. Its own tokens, not those of cockpit.css: the
   page is the first of the new surface. The dark values sit under the attribute theme.js
   sets, and nowhere else. */
/* The look: a near-black page with panels only a little lighter and no heavy borders, ONE
   accent colour for what is active, the main button, the "your move" marks and the focus
   ring, small uppercase heads, monospace for times, ages and refs. The state colours (green,
   amber, red) stay apart from the accent.
   The accent is the user's choice: --accent, --accent-soft, --on-accent and --hairline are
   computed from one colour by accent.js and set on the root element; the values here are
   those of the default accent, so the page looks right before the script has run. The
   backgrounds must stay in step with THEME_BASE in accent.js (a test checks it). */
:root {
  --bg: #f4f3f0; --surface: #ffffff; --sunk: #eceae6; --ink: #1b1a18; --muted: #615d57; --line: #dcd9d3;
  --accent: #b04930; --accent-soft: #f6e9e6; --on-accent: #ffffff; --hairline: #c8988a;
  --ok: #1f7a55; --ok-soft: #dcf1e7; --warn: #8a5a08; --warn-soft: #fbeed3;
  --bad: #b3372f; --bad-soft: #fbe2df; --idle: #615d57; --idle-soft: #e9e7e3;
  /* The colour of everything that marks a mocked part. Used for nothing else. */
  --mock: #a3189b; --mock-soft: #fbe4f9;
  --f-text: "Segoe UI", system-ui, sans-serif;
  --f-mono: Consolas, monospace;
  --gap: 24px; /* the space around the session dialog, the same on all sides */
  /* Density (see "Density" near the end): the heights and the air that the two densities
     set apart. A button is about 28 px high on the desk and 36 px where a finger taps it. */
  --btn-h: 28px; --btn-sm: 24px; --row-y: 6px; --agent-y: 4px; --conv-gap: 8px; --stack: 12px;
  /* The glass (see "Glass" near the end). The page is a pattern of crystal facets and a grid
     of hexagons; the large panels are frosted glass over it. The facets are bands a step
     lighter (--facet, with a bright cut edge --facet-edge) and a step darker (--shade) than
     the page. On the light theme only the shade, the grid and the glow make the page darker,
     on the dark theme only the facets, the edges, the grid and the glow make it lighter:
     those are held so that the worst point (every one of them on top of each other, the
     glow taken as black or white) still carries the main and the muted text at 4,5:1 or
     more, and a panel over it every accent. test/glass.test.mjs computes it. */
  --page: #f2f1ed;
  --facet: rgba(255, 255, 255, .8); --facet-edge: rgba(255, 255, 255, 1); --shade: rgba(27, 26, 24, .025);
  --glow: 2%; --hex-line: rgba(27, 26, 24, .045);
  --panel: rgba(255, 255, 255, .64); --panel-dlg: rgba(255, 255, 255, .94);
}
html[data-theme="dark"] {
  --bg: #0d0d0f; --surface: #141416; --sunk: #1a1a1d; --ink: #ecebe8; --muted: #9a9892; --line: #26262b;
  --accent: #ff6a45; --accent-soft: #3e231e; --on-accent: #000000; --hairline: #884537;
  --ok: #5fc493; --ok-soft: #15291f; --warn: #e3ad55; --warn-soft: #2e2410;
  --bad: #f08a81; --bad-soft: #351b19; --idle: #9a9892; --idle-soft: #222225;
  --mock: #f3a0ee; --mock-soft: #45203f;
  --page: #0b0b0e;
  --facet: rgba(255, 255, 255, .03); --facet-edge: rgba(255, 255, 255, .05); --shade: rgba(0, 0, 0, .55);
  --glow: 2%; --hex-line: rgba(255, 255, 255, .04);
  --panel: rgba(20, 20, 22, .64); --panel-dlg: rgba(20, 20, 22, .94);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--page); color: var(--ink); font-family: var(--f-text); font-size: 15px; line-height: 1.45; }
h1, h2, h3 { font-family: var(--f-text); margin: 0; line-height: 1.2; }
p { margin: 0; }
a { color: var(--accent); }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { opacity: .55; cursor: default; }
code, pre { font-family: var(--f-mono); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.grow { flex: 1 1 auto; }
.ic { flex: none; vertical-align: -2px; }
.loading::after { content: " \2026"; }

.wrap { max-width: 1320px; margin: 0 auto; padding-left: 16px; padding-right: 16px; }

/* ---- buttons ---- */
.act { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 1px solid var(--line); background: var(--surface); border-radius: 7px; padding: 3px 9px; font-size: .8rem; font-weight: 600; white-space: nowrap; text-decoration: none; min-height: var(--btn-h); }
.act.primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
/* Weight follows need: a filled button only where the user is asked to act (Answer,
   Confirm done); a row that waits too long gets a warn outline; the buttons of quiet rows
   are ghosts. */
.act.okb { border-color: var(--ok); background: var(--ok); color: var(--on-accent); }
.act.warnb { border-color: var(--warn); color: var(--warn); }
.act.ghost { border-color: transparent; background: none; color: var(--muted); font-weight: 500; }
.act.ghost:hover:not(:disabled) { border-color: var(--line); color: var(--ink); filter: none; }
.act:hover:not(:disabled) { filter: brightness(.96); }
.act.io { padding: 3px 7px; position: relative; }
.act.io .lbl { display: none; }
.badge { min-width: 16px; padding: 0 4px; border-radius: 99px; background: var(--bad); color: #fff; font-size: .66rem; line-height: 16px; text-align: center; }
.badge[hidden] { display: none; }
.chip { display: inline-flex; align-items: center; gap: 4px; font-size: .72rem; font-weight: 500; padding: 1px 8px; border-radius: 5px; border: 1px solid var(--line); color: var(--muted); max-width: 100%; overflow-wrap: anywhere; }
.chip.on { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }
.chip.ref, .sid code { font-family: var(--f-mono); }
.chip .x { border: 0; background: none; padding: 0 0 0 2px; color: inherit; display: inline-flex; }
/* The x of an active filter chip in the head of the list: a 24 px target that keeps the chip compact. */
.fchip { padding-right: 0; }
.chip-x { display: inline-flex; align-items: center; justify-content: center; min-width: 24px; min-height: 24px; margin: -5px 0 -5px 2px; padding: 0; border: 0; border-radius: 5px; background: none; color: inherit; font-size: .95rem; line-height: 1; cursor: pointer; }
.chip-x:hover, .chip-x:focus-visible { background: var(--accent); color: var(--on-accent); }

/* ---- top bar ---- */
.bar { background: var(--surface); border-bottom: 1px solid var(--line); }
.bar .wrap { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; padding-top: 6px; padding-bottom: 6px; }
.brand { font-size: 1.05rem; margin-right: 6px; }
/* The search field of the top bar opens the command palette. */
.search-box { flex: 1 1 180px; max-width: 420px; min-width: 0; }
button.search { width: 100%; min-height: var(--btn-h); text-align: left; cursor: text; font-size: .88rem; }
button.search span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
button.search:hover { border-color: var(--accent); }
kbd { font-family: var(--f-text); font-size: .7rem; font-weight: 600; padding: 1px 5px; border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 5px; background: var(--surface); color: var(--muted); white-space: nowrap; }
.search { display: flex; align-items: center; gap: 6px; border: 1px solid var(--line); border-radius: 8px; padding: 0 9px; background: var(--bg); color: var(--muted); }
.search:focus-within { outline: 2px solid var(--accent); outline-offset: 1px; }
.search input { flex: 1; min-width: 0; border: 0; background: none; padding: 4px 0; font-size: .88rem; color: var(--ink); outline: none; }
.links { flex: 1 1 100%; display: flex; gap: 2px 16px; flex-wrap: wrap; font-size: .84rem; }
.links a { color: var(--muted); text-decoration: none; padding: 2px 0; white-space: nowrap; }
.links a:hover { color: var(--ink); text-decoration: underline; }

/* ---- the page: agents beside the work ---- */
.page { display: grid; grid-template-columns: 270px minmax(0, 1fr); gap: 14px; align-items: start; padding-top: 10px; padding-bottom: 96px; }
.page[data-agents="off"] { grid-template-columns: minmax(0, 1fr); }
.page[data-agents="off"] .agents { display: none; }
.view-tabs { display: none; }
main { min-width: 0; }

.agents { position: sticky; top: 52px; max-height: calc(100vh - 68px); overflow: auto; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; }
.agents-head { display: flex; align-items: center; gap: 6px; padding: 8px 10px 4px; }
.agents-head h2 { font-size: .98rem; font-weight: 600; }
.side-note { padding: 4px 10px 8px; font-size: .84rem; color: var(--muted); }
.side-note.bad { color: var(--bad); }
.side-acts { padding: 0 10px 8px; }
.side-note.hint { padding-bottom: 6px; font-size: .8rem; }
/* The search of the agents column. */
.ag-search { display: flex; align-items: center; gap: 6px; margin: 0 10px 6px; padding: 0 4px 0 8px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); color: var(--muted); }
.ag-search:focus-within { outline: 2px solid var(--accent); outline-offset: 1px; }
.ag-search input { flex: 1; min-width: 0; border: 0; background: none; padding: 4px 0; font-size: .88rem; color: var(--ink); outline: none; }
.ag-search .x { display: inline-flex; border: 0; background: none; padding: 3px; color: var(--muted); border-radius: 5px; }
.ag-search .x:hover { color: var(--ink); background: var(--sunk); }
/* The two sections of the column: the favourites, then all other agents. */
.ag-sec { display: flex; align-items: center; gap: 6px; padding: 5px 10px 4px; border-top: 1px solid var(--line); font-size: .7rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); background: var(--sunk); }
.ag-sec .s-fold { text-transform: inherit; letter-spacing: inherit; padding: 0; }
.ag-n { margin-left: auto; font-variant-numeric: tabular-nums; font-weight: 600; }
.agent-row .star { grid-column: 1; grid-row: 1 / span 2; border-color: transparent; background: none; color: var(--muted); padding: 2px 4px; min-height: 0; }
.agent-row .star:hover { color: var(--warn); }
.agent-row .star.on { color: var(--warn); }
.agent-row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto; gap: 0 6px; align-items: center; padding: var(--agent-y) 10px var(--agent-y) 4px; border-top: 1px solid var(--line); cursor: pointer; font-size: .88rem; line-height: 1.3; }
.agent-row:hover { background: var(--sunk); }
.agent-row:focus-visible { outline-offset: -2px; }
.agent-row.on { background: var(--accent-soft); box-shadow: inset 3px 0 0 var(--accent); }
.agent-row b { grid-column: 2; font-weight: 600; min-width: 0; overflow-wrap: anywhere; }
.agent-row .kind { grid-column: 2; grid-row: 2; font-size: .7rem; color: var(--muted); }
.agent-row .kind.project::before { content: "\25A0  "; color: var(--accent); }
.agent-row .kind.knowledge::before { content: "\25A1  "; }
.agent-row .cnt { grid-column: 3; grid-row: 1 / span 2; font-variant-numeric: tabular-nums; font-size: .8rem; color: var(--muted); background: var(--sunk); border-radius: 99px; padding: 0 8px; }
.agent-row [data-new-for] { grid-column: 4; grid-row: 1 / span 2; }
.agent-row .desc { grid-column: 2 / -1; font-size: .78rem; color: var(--muted); display: none; }
.agent-row.on .desc { display: block; }

/* ---- the list ---- */
.list-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 6px; min-height: var(--btn-h); }
.list-head h1 { font-size: 1.15rem; font-weight: 600; }
/* The two switches of the Work bar ("For me | All", "Streams | Agents") stay together: on a
   narrow screen they move to the next line as one, not one by one. */
.list-head .segs { display: inline-flex; gap: 6px; align-items: center; flex-wrap: wrap; }
/* Not clipped: the list of the stream field of a row's editor may reach beyond the frame. */
.frame { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; }
.banner { margin-bottom: 8px; padding: 6px 10px; border: 1px solid var(--warn); border-radius: 10px; background: var(--warn-soft); color: var(--ink); font-size: .88rem; overflow-wrap: anywhere; }
.inbox-strip { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; padding: 3px 10px; border: 1px solid var(--accent); border-radius: 10px; background: var(--accent-soft); font-size: .88rem; }
.inbox-strip span { flex: 1 1 160px; }
.empty { padding: 20px 14px; color: var(--muted); text-align: center; }

/* Each group is a card of its own, with space between the cards. Its head is a band: the
   group must be recognised at a glance, before any row is read. A stream carries the accent
   on its left edge; the rows of no stream have a plain head.
   Not clipped: the list of the stream field of a row's editor may reach beyond the card. */
.streams { display: flex; flex-direction: column; gap: var(--stack); }
.stream { background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--accent); border-radius: 12px; }
.stream.quick, .stream.bare { border-left-color: var(--idle); }
.s-head { background: var(--sunk); border-bottom: 1px solid var(--line); border-radius: 0 11px 0 0; padding: 7px 12px 7px 10px; }
.stream.folded .s-head { border-bottom: 0; border-radius: 0 11px 11px 0; }
.stream.quick .s-head { background: transparent; }
.s-top { display: flex; gap: 6px 10px; align-items: center; flex-wrap: wrap; }
.s-head h2 { font-size: 1.08rem; font-weight: 700; min-width: 0; }
.s-fold { display: inline-flex; align-items: center; gap: 6px; border: 0; background: none; padding: 2px 4px 2px 0; font: inherit; color: inherit; text-align: left; overflow-wrap: anywhere; border-radius: 6px; }
.s-fold .ic { transition: transform .15s; color: var(--muted); }
.s-fold[aria-expanded="false"] .ic { transform: rotate(-90deg); }
.s-fold:hover { color: var(--accent); }
.s-head .ref { font-family: var(--f-mono); font-size: .72rem; color: var(--muted); border: 1px solid var(--line); border-radius: 5px; padding: 0 6px; background: var(--surface); }
.s-counts { display: flex; gap: 5px; flex-wrap: wrap; margin-left: auto; }
.s-counts .cnt { font-size: .7rem; font-weight: 600; padding: 1px 8px; border-radius: 99px; white-space: nowrap; background: var(--idle-soft); color: var(--idle); }
/* What is for the user comes first and in colour; the quiet states stay grey. */
.s-counts .cnt.quiet { background: none; box-shadow: inset 0 0 0 1px var(--line); color: var(--muted); font-weight: 500; }
.s-counts .cnt.you { background: var(--accent); color: var(--on-accent); }
.s-counts .cnt.new { background: var(--accent-soft); color: var(--accent); }
.s-counts .cnt.confirm { background: var(--ok-soft); color: var(--ok); }
.s-counts .cnt.stale { background: var(--warn-soft); color: var(--warn); }
.s-head .sn { margin: 1px 0 0 20px; font-size: .84rem; color: var(--muted); overflow-wrap: anywhere; }
.s-none { padding: 8px 12px 8px 14px; font-size: .84rem; color: var(--muted); }

/* The proposal sits inside the head of its stream. */
.prop { margin: 6px 0 0 20px; padding: 5px 8px; border: 1px dashed var(--accent); border-radius: 8px; background: var(--accent-soft); display: flex; gap: 6px 10px; align-items: center; flex-wrap: wrap; font-size: .84rem; }
.prop-text { flex: 1 1 200px; min-width: 0; white-space: pre-line; overflow-wrap: anywhere; }
.prop-acts { display: flex; gap: 8px; flex-wrap: wrap; }

/* A row has two lines, the title and under it what comes next, and a column each for the
   state, the agent, the age and the buttons: every title starts at the same place and a long
   title wraps inside its own column. */
.srow { display: grid; grid-template-columns: 132px minmax(0, 1fr) 132px 62px 178px; gap: 0 10px; align-items: center; padding: var(--row-y) 12px var(--row-y) 14px; font-size: .9rem; cursor: pointer; border-top: 1px solid var(--line); }
.s-rows > .srow:first-child { border-top: 0; }
.s-rows > :last-child { border-radius: 0 0 11px 0; }
.srow:hover { background: var(--sunk); }
.srow:focus-visible { outline-offset: -2px; }
.srow .sref { justify-self: start; display: flex; flex-direction: column; align-items: flex-start; gap: 1px; min-width: 0; }
.srow .main { display: flex; flex-direction: column; gap: 0; min-width: 0; line-height: 1.35; }
.srow .t { font-weight: 600; min-width: 0; overflow-wrap: anywhere; }
.srow .nx { color: var(--muted); font-size: .84rem; min-width: 0; overflow-wrap: anywhere; }
.srow .nx:empty { display: none; }
.srow .agent { justify-self: start; max-width: 100%; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.srow .agent[hidden] { display: block; visibility: hidden; }
.srow .age { justify-self: end; }
.srow .acts { display: flex; gap: 6px; align-items: center; justify-content: flex-end; }
.srow.done .t { color: var(--muted); text-decoration: line-through; }
.age { font-size: .74rem; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.row-note { margin: 0 12px 6px 14px; padding: 4px 8px; border-left: 3px solid var(--mock); background: var(--mock-soft); border-radius: 0 6px 6px 0; font-size: .84rem; }

.pill { display: inline-flex; align-items: center; gap: 5px; font-size: .7rem; font-weight: 600; padding: 1px 8px; border-radius: 99px; white-space: nowrap; }
.pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill.you { background: var(--accent-soft); color: var(--accent); }
.pill.finished { background: var(--ok-soft); color: var(--ok); }
/* "Claude works" is the quietest state: an outline, not a fill. */
.pill.working { background: none; box-shadow: inset 0 0 0 1px var(--line); color: var(--muted); font-weight: 500; }
.pill.waiting { background: var(--warn-soft); color: var(--warn); }
.pill.parked { background: var(--idle-soft); color: var(--idle); }
.pill.done { background: transparent; color: var(--muted); box-shadow: inset 0 0 0 1px var(--line); }
.pill.working::before { animation: pulse 1.4s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .25; } }
@keyframes spin { to { transform: rotate(360deg); } }
.spin { flex: none; width: 12px; height: 12px; border-radius: 50%; border: 2px solid var(--line); border-top-color: var(--accent); animation: spin .9s linear infinite; }

/* ---- fields ---- */
.editor input, .np input[type="text"], .np textarea, .np select, .set input, .set select, .card input[type="text"], .card textarea, .composer textarea, .composer select, .combo input[type="text"] {
  border: 1px solid var(--line); border-radius: 7px; background: var(--surface); color: var(--ink); padding: 4px 8px; font-size: .88rem; min-width: 0; width: 100%;
}
textarea { resize: vertical; }

/* The field with a list to choose from (combo.js). */
.combo { position: relative; display: block; }
.combo [role="listbox"] { position: absolute; z-index: 30; left: 0; right: 0; top: calc(100% + 2px); margin: 0; padding: 4px; list-style: none; max-height: 240px; overflow: auto; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 8px 24px rgba(10, 14, 22, .25); }
.combo [role="listbox"][hidden] { display: none; }
.combo [role="option"] { display: flex; gap: 8px; align-items: baseline; justify-content: space-between; padding: 5px 8px; border-radius: 6px; font-size: .88rem; color: var(--ink); cursor: pointer; }
.combo [role="option"].on, .combo [role="option"]:hover { background: var(--accent-soft); }
.combo [role="option"] small { color: var(--muted); font-family: var(--f-mono); font-size: .72rem; }
.combo-none { padding: 7px 8px; color: var(--muted); font-size: .84rem; }
/* The clear button of a list with an empty choice ("No stream"), inside the field on the right. */
.combo.clearable input[type="text"] { padding-right: 28px; }
.combo-x { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); width: 22px; height: 22px; display: inline-flex; align-items: center; justify-content: center; padding: 0; border: 0; border-radius: 5px; background: none; color: var(--muted); font-size: 1rem; line-height: 1; cursor: pointer; }
.combo-x:hover, .combo-x:focus-visible { background: var(--sunk); color: var(--ink); }
.combo-x[hidden] { display: none; }

/* ---- the inline editor of a row ---- */
.editor { margin: 2px 12px 8px 14px; padding: 8px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 10px; }
.editor label, .np-f { display: flex; flex-direction: column; gap: 2px; font-size: .74rem; color: var(--muted); min-width: 0; }
.editor-acts { grid-column: 1 / -1; display: flex; gap: 8px; }

.list-foot { display: flex; justify-content: flex-end; padding: 6px 2px 0; }

/* ---- toast: a popover, so that it shows above an open dialog ---- */
#toast { position: fixed; inset: auto auto 20px 50%; transform: translateX(-50%); margin: 0; border: 0; gap: 12px; align-items: center; max-width: calc(100% - 24px); padding: 9px 12px 9px 14px; border-radius: 10px; background: var(--ink); color: var(--bg); font-size: .88rem; box-shadow: 0 6px 24px rgba(10, 14, 22, .3); }
#toast:popover-open { display: flex; }
#toast span { min-width: 0; overflow-wrap: anywhere; }
#toast .act { background: transparent; border-color: currentColor; color: inherit; }

/* ---- dialogs. The session: about 940 wide on the desk, the height follows the window with
   the same space on all sides. On the phone the whole screen. Never a side panel. ---- */
dialog.dlg { padding: 0; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); color: var(--ink); max-width: none; max-height: none; overflow: hidden; width: min(940px, calc(100vw - 2 * var(--gap))); height: calc(100vh - 2 * var(--gap)); height: calc(100dvh - 2 * var(--gap)); }
dialog.dlg[open] { display: flex; flex-direction: column; }
dialog.dlg::backdrop { background: rgba(10, 14, 22, .55); }
/* A scroll inside a dialog stays inside it: the boxes that scroll a dialog (its body with
   the conversation, the files, the history; the two columns of the settings; the list of
   the palette) do not hand the wheel or the touch on to the page behind at their end.
   A box inside one of them (a tool output, a file preview, a code block) hands on to that
   body on purpose: with `contain` on it too, the wheel over a short output or a wide code
   block would not move the conversation any more. */
dialog.dlg, dialog.palette, .d-body, .set-nav, .set-main, .pal-list { overscroll-behavior: contain; }
/* While a dialog is open the page behind it does not scroll at all. The session dialog sets
   the class (home-lock.js, which also puts the place of the page back); the rule beside it
   holds the page for every other modal dialog of this page. */
html.dlg-lock, html:has(dialog[open]) { overflow: hidden; }
dialog.panel { width: min(640px, calc(100vw - 2 * var(--gap))); height: auto; max-height: calc(100dvh - 2 * var(--gap)); }
/* Tall enough for the open list of the agent field. */
dialog.panel[data-kind="new"] { height: min(640px, calc(100dvh - 2 * var(--gap))); }
/* The fork form (fork-view.js): as high as its fields, not the whole window. */
dialog.panel[data-kind="fork"] { width: min(560px, calc(100vw - 2 * var(--gap))); height: fit-content; }
dialog.panel[data-kind="settings"] { width: min(820px, calc(100vw - 2 * var(--gap))); height: calc(100dvh - 2 * var(--gap)); }
.d-head { flex: none; background: var(--sunk); border-bottom: 1px solid var(--line); padding: 6px 10px 0 14px; }
.d-title { display: flex; gap: 6px; align-items: center; padding-bottom: 4px; }
.d-title h2 { font-size: 1.05rem; font-weight: 600; min-width: 0; overflow-wrap: anywhere; }
.d-meta { display: flex; gap: 4px 6px; align-items: center; flex-wrap: wrap; padding-bottom: 6px; }
/* What the state asks of the user, under the head (a touch screen has no tooltip). */
.d-why { margin: -2px 0 6px; font-size: .76rem; color: var(--muted); line-height: 1.35; }
.sid { display: inline-flex; align-items: center; gap: 4px; font-size: .72rem; color: var(--muted); min-width: 0; }
.sid code { overflow-wrap: anywhere; }
.sid .act { min-height: 24px; padding: 2px 6px; }
.d-tabs { display: flex; gap: 2px; }
.d-tabs button, .view-tabs button { display: inline-flex; align-items: center; gap: 6px; border: 0; background: none; border-radius: 8px 8px 0 0; padding: 5px 10px; font-size: .86rem; font-weight: 600; color: var(--muted); }
.d-tabs button[aria-selected="true"] { background: var(--surface); color: var(--ink); }
.d-body { flex: 1 1 auto; min-height: 0; overflow: auto; padding: 10px 14px; }
.d-foot { flex: none; border-top: 1px solid var(--line); background: var(--surface); padding: 6px 12px; }
.tab-note { font-size: .84rem; color: var(--muted); margin-bottom: 6px; max-width: 72ch; }
.tab-acts { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; margin-bottom: 8px; }

/* conversation */
.conv { max-width: 780px; margin: 0 auto; display: flex; flex-direction: column; gap: var(--conv-gap); }
/* The thin line before the first message said since the user last opened the row. */
.new-line { display: flex; align-items: center; gap: 8px; color: var(--accent); font-size: .68rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; }
.new-line::before, .new-line::after { content: ""; flex: 1; height: 1px; background: var(--accent); opacity: .6; }
/* The number key of an option (option-keys.js): small, after its label; a touch screen has no keys. */
.key-hint { display: inline-block; min-width: 1.3em; margin-left: 6px; padding: 0 4px; border: 1px solid var(--line); border-radius: 4px; font-family: var(--f-mono); font-size: .66rem; line-height: 1.4; color: var(--muted); text-align: center; background: var(--sunk); vertical-align: middle; }
@media (pointer: coarse) { .key-hint { display: none; } }
/* A card that holds the focus (it waits; the number keys pick its options). */
[data-card]:focus { outline: 2px solid var(--accent); outline-offset: 2px; }
[data-card]:focus:not(:focus-visible) { outline-color: var(--accent-soft); }
/* An answered card folded to one line (dialog-view.js): its icon, title, the answer in short and a chevron. */
.card.folded { padding: 0; }
.card-fold { display: flex; align-items: center; gap: 8px; width: 100%; min-height: var(--btn-h); padding: 4px 10px; border: 0; border-radius: inherit; background: none; color: var(--ink); text-align: left; font-size: .84rem; cursor: pointer; }
.card-fold:hover { background: var(--sunk); }
.card-fold .cf-title { flex: 1 1 auto; min-width: 0; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card-fold .cf-said { flex: 0 1 auto; min-width: 0; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card-fold > .ic:last-child { flex: none; transform: rotate(-90deg); color: var(--muted); }
.card-h .card-fold-x { margin-left: auto; display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 24px; padding: 0; border: 0; border-radius: 5px; background: none; color: var(--muted); cursor: pointer; }
.card-h .card-fold-x:hover { background: var(--sunk); color: var(--ink); }
.ro-bar { max-width: 780px; margin: 0 auto 8px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; padding: 5px 10px; border: 1px solid var(--warn); background: var(--warn-soft); border-radius: 10px; font-size: .86rem; }
.ro-bar span { flex: 1 1 200px; }
/* The bar of the conversation up to a call stays in sight while the reader scrolls. */
.ro-bar.at-bar { position: sticky; top: 0; z-index: 2; }
.msg { border: 1px solid var(--line); border-radius: 10px; padding: 6px 10px; display: flex; flex-direction: column; gap: 4px; background: var(--bg); min-width: 0; }
.msg.me { background: var(--accent-soft); border-color: transparent; align-self: flex-end; max-width: 88%; }
/* A message the page sent that the transcript does not have yet: its state beside "You". */
.msg.me.local .local-state { color: var(--muted); font-weight: 400; }
.msg.me.local.failed { border-color: var(--bad); }
.msg.me .local-fail { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 6px; color: var(--bad); }
.msg.me .local-fail span { flex: 1 1 12em; }
.who { font-size: .7rem; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); line-height: 1.3; }
.md p + p { margin-top: 4px; }
.md { overflow-wrap: anywhere; }
.md code { background: var(--sunk); border-radius: 4px; padding: 0 4px; font-size: .86em; }
.conv-note { font-size: .8rem; color: var(--muted); text-align: center; }
.code, .cmd { display: flex; gap: 8px; align-items: flex-start; background: var(--sunk); border-radius: 8px; padding: 6px 8px; min-width: 0; }
.code pre { flex: 1; min-width: 0; margin: 0; overflow-x: auto; font-size: .8rem; line-height: 1.45; }
.cmd code { flex: 1; min-width: 0; overflow-x: auto; white-space: pre; font-size: .8rem; padding: 4px 0; }
.tw { overflow-x: auto; }
.tw table { border-collapse: collapse; font-size: .84rem; font-variant-numeric: tabular-nums; min-width: 100%; }
.tw th, .tw td { border-bottom: 1px solid var(--line); padding: 3px 12px 3px 0; text-align: left; white-space: nowrap; }
.tw th { color: var(--muted); font-weight: 600; }
.blk-acts { display: flex; justify-content: flex-end; }

.tool, .tools { font-size: .82rem; color: var(--muted); }
.tools summary { cursor: pointer; }
.tools .tool { padding: 1px 0 0 16px; }
.tool { display: flex; gap: 6px 8px; align-items: center; flex-wrap: wrap; min-width: 0; }
.tool b { color: var(--ink); font-weight: 600; }
.tool code { background: var(--sunk); border-radius: 4px; padding: 0 5px; overflow-wrap: anywhere; min-width: 0; }
.tool .el { font-variant-numeric: tabular-nums; }
/* The call the statistics opened the session at. */
.tool.hit { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; background: var(--accent-soft); }
.tool.run { border: 1px solid var(--line); border-radius: 10px; padding: 3px 6px 3px 8px; background: var(--surface); }
.tool.run .el { margin-left: auto; }
/* A running tool keeps its Stop on the line of its name: a long command wraps inside its own
   box (it starts from no width and takes what is free) instead of pushing the time and Stop
   onto a line of their own. Stop is a small button here, as in the line "Claude works". */
.tool.run code { flex: 1 1 0; min-width: 12ch; }
.tool.run .act, .tail-h .act { min-height: var(--btn-sm); padding: 1px 7px; }
.tool.warn { border-color: var(--warn); background: var(--warn-soft); }
.tool-warn { flex: 1 1 100%; color: var(--warn); font-weight: 600; }
.tool-warn[hidden] { display: none; }

.card { border: 1px solid var(--accent); border-radius: 12px; padding: 8px 10px; display: flex; flex-direction: column; gap: 6px; background: var(--surface); min-width: 0; scroll-margin-top: 8px; }
.card.open { box-shadow: 0 0 0 3px var(--accent-soft); }
.card.done { border-color: var(--line); }
.card-h { display: flex; align-items: center; gap: 6px; font-size: .72rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--accent); }
.card.done .card-h { color: var(--muted); }
.card-acts { display: flex; gap: 6px; flex-wrap: wrap; }
.card-said { display: flex; align-items: center; gap: 6px; font-size: .84rem; color: var(--ok); font-weight: 600; line-height: 1.3; }
.card-note { font-size: .8rem; color: var(--muted); }
.perm-what { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.perm-what code { background: var(--sunk); border-radius: 4px; padding: 1px 6px; overflow-wrap: anywhere; }
.q { border: 0; margin: 0; padding: 0; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.q legend, .f-label { font-weight: 600; font-size: .9rem; padding: 0; margin-bottom: 2px; display: block; }
.q legend small { font-weight: 400; color: var(--muted); }
.opts { display: flex; gap: 5px; flex-wrap: wrap; }
.opt { display: flex; flex-direction: column; align-items: flex-start; gap: 0; text-align: left; border: 1px solid var(--line); background: var(--surface); border-radius: 8px; padding: 3px 9px; font-size: .86rem; line-height: 1.3; }
.opt b { font-weight: 600; }
.opt small { color: var(--muted); font-size: .76rem; }
.opt[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-soft); box-shadow: inset 0 0 0 1px var(--accent); }
.f-blk { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
iframe.page { width: 100%; height: 340px; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
/* a page whose frame cannot be shown: its text without tags */
.page-text { margin: 0; padding: 8px 10px; font-size: .84rem; line-height: 1.5; background: var(--sunk); border-radius: 8px; overflow: auto; max-height: 340px; white-space: pre-wrap; overflow-wrap: anywhere; }
/* what Claude writes now (a session of the session holder): not a message yet */
.msg.tail { border-style: dashed; }
.tail-h { display: flex; gap: 8px; align-items: center; min-width: 0; }
.tail-h .who { flex: 1 1 auto; }
/* the stored "Allow always" rules in the settings */
.set-rules { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.set-rules h4 { margin: 0; font-size: .82rem; font-weight: 600; }
.set-rules ul { margin: 4px 0 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 4px; }
.set-rules li { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; min-width: 0; }
.set-rules code { flex: 1 1 200px; min-width: 0; overflow-wrap: anywhere; background: var(--sunk); border-radius: 4px; padding: 1px 6px; font-size: .8rem; }
.set-rules small { color: var(--muted); font-size: .76rem; }

/* the answer box */
.composer { max-width: 780px; margin: 0 auto; display: flex; flex-direction: column; gap: 5px; }
.composer select { width: auto; padding-top: 2px; padding-bottom: 2px; min-height: var(--btn-h); }
.c-row { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.chips { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.chips-h { font-size: .72rem; font-weight: 600; color: var(--muted); }
/* What the answer box waits for: the call that sends, the session that has to show the message. */
.c-hint { margin: 0; font-size: .8rem; color: var(--muted); }
.act.busy, .act[aria-busy="true"] { cursor: progress; }
.composer textarea:disabled { opacity: .6; }
.card-note.wait { display: flex; align-items: center; gap: 6px; margin: 6px 0 0; }
.attach { cursor: pointer; }
/* Files with a message (attach-view.js): a chip per file with its name, size and state; the
   bar of an upload is a progress element. The drop zone shows only while a drag with files
   is over the answer area or the new session form (home-attach.js sets drop-over on the
   dialog). */
.att-chips:empty { display: none; }
.chip.att { gap: 6px; padding: 2px 8px; }
.chip.att .att-name { color: var(--ink); font-weight: 600; min-width: 0; overflow-wrap: anywhere; }
.chip.att .att-size, .chip.att .att-st { font-variant-numeric: tabular-nums; white-space: nowrap; }
.chip.att .att-st.bad { white-space: normal; }
.chip.att.done { border-color: var(--ok); }
.chip.att.failed, .chip.att.refused { border-color: var(--bad); color: var(--bad); background: var(--bad-soft); }
.chip.att .att-retry { font-weight: 600; text-decoration: underline; }
.att-bar { width: 64px; height: 6px; accent-color: var(--accent); }
[data-drop] { position: relative; }
.drop-zone { display: none; position: absolute; inset: 0; z-index: 2; align-items: center; justify-content: center; border: 2px dashed var(--accent); border-radius: 10px; background: var(--accent-soft); color: var(--accent); font-weight: 600; pointer-events: none; }
.drop-over [data-drop] .drop-zone { display: flex; }
.np-files { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

/* terminal, files, history */
.term-wait { display: flex; align-items: center; gap: 10px; padding: 24px 0; color: var(--muted); }
.term-state { font-size: .84rem; color: var(--ok); }
.term-screen { margin: 0; padding: 12px 14px; min-height: 260px; background: #0c1016; color: #d6e2f0; border-radius: 10px; font-size: .82rem; line-height: 1.5; white-space: pre-wrap; overflow: auto; }
/* The Terminal tab (plan 5): the repainted part and the frame of the terminal are both laid
   out as children of the dialog; the frame never moves in the document (term-frame.js). */
.d-paint { display: contents; }
.d-term { flex: 1 1 auto; min-height: 0; display: flex; padding: 0 14px 10px; }
.d-term[hidden] { display: none; }
.d-term .term-frame { flex: 1 1 auto; width: 100%; min-height: 260px; border: 0; border-radius: 10px; background: #0c1016; }
.d-term .term-screen { flex: 1 1 auto; }
.d-body[data-term-on] { flex: none; }
.term-bar { align-items: center; }
.term-steps { margin: 0 0 8px 22px; font-size: .86rem; color: var(--muted); }
.term-steps li.done { color: var(--ok); }
.term-steps li.on { color: var(--ink); font-weight: 600; }
.ro-warn { max-width: 780px; margin: -4px auto 8px; padding: 0 10px; font-size: .86rem; color: var(--bad); }
.files { display: grid; grid-template-columns: minmax(180px, 280px) minmax(0, 1fr); gap: 14px; align-items: start; }
.file-list, .hist-list { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.file, .hist { display: grid; gap: 2px 8px; align-items: baseline; text-align: left; border: 0; border-top: 1px solid var(--line); background: none; padding: 5px 8px; font-size: .84rem; min-width: 0; }
.file:first-child, .hist:first-child { border-top: 0; }
/* A file of the Files tab with its "Copy path" button beside it. */
.file-row { display: flex; align-items: center; gap: 4px; border-top: 1px solid var(--line); padding-right: 6px; }
.file-row:first-child { border-top: 0; }
.file-row .file { flex: 1; border-top: 0; }
.file { grid-template-columns: minmax(0, 1fr) auto; }
.file.on, .hist.on { background: var(--accent-soft); }
.file:hover, .hist:hover { background: var(--sunk); }
.f-path { font-family: var(--f-mono); font-size: .8rem; overflow-wrap: anywhere; min-width: 0; }
.f-change { font-size: .72rem; color: var(--muted); }
.f-change.created { color: var(--ok); }
.f-change.edited { color: var(--warn); }
.f-lines { grid-column: 1 / -1; font-size: .72rem; color: var(--muted); font-family: var(--f-mono); }
.file-pane { min-width: 0; border: 1px solid var(--line); border-radius: 10px; }
.pane-h { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; padding: 5px 8px; border-bottom: 1px solid var(--line); font-size: .8rem; }
.pane-h code { flex: 1 1 120px; min-width: 0; overflow-wrap: anywhere; }
.file-text { margin: 0; padding: 10px 12px; font-size: .8rem; line-height: 1.5; overflow: auto; max-height: 52vh; white-space: pre; }
.hist { grid-template-columns: auto auto minmax(0, 1fr) auto; }
.h-n { font-variant-numeric: tabular-nums; color: var(--muted); }
.h-when { font-variant-numeric: tabular-nums; white-space: nowrap; }
.h-how { color: var(--muted); min-width: 0; }
.h-res { grid-column: 2 / -1; color: var(--ink); min-width: 0; overflow-wrap: anywhere; }
.hist .chip { grid-column: -2; grid-row: 1; justify-self: end; }
.hist-shown { margin-top: 14px; border: 1px solid var(--line); border-radius: 10px; }
.hist-shown .conv { padding: 12px; }

/* new session */
.np { display: flex; flex-direction: column; gap: 8px; }
.np-how { border: 1px solid var(--line); border-radius: 8px; padding: 5px 8px; margin: 0; display: flex; flex-direction: column; gap: 4px; font-size: .88rem; }
.np-how legend { font-size: .74rem; color: var(--muted); padding: 0 4px; }
/* "Done when finished" (host autoDone.js): the checkbox of the form, the mark of a row and the switch of the dialog head. */
.np-check { display: flex; align-items: center; gap: 6px; font-size: .88rem; }
.np-done-note { margin: -4px 0 0; }
.auto-done { font-size: .68rem; color: var(--ok); border: 1px solid var(--ok); border-radius: 6px; padding: 0 5px; white-space: nowrap; }
button.chip.auto-done { cursor: pointer; background: var(--ok-soft); }
.np-acts { display: flex; gap: 8px; }

/* settings */
.d-body.set { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 18px; padding: 0; overflow: hidden; }
.set-nav { display: flex; flex-direction: column; gap: 2px; padding: 10px 0 10px 12px; overflow: auto; font-size: .86rem; }
.set-nav a { color: var(--muted); text-decoration: none; padding: 5px 8px; border-radius: 6px; }
.set-nav a:hover { background: var(--sunk); color: var(--ink); }
.set-main { overflow: auto; padding: 10px 14px 18px 0; min-width: 0; }
.set-g { padding-bottom: 10px; margin-bottom: 10px; border-bottom: 1px solid var(--line); scroll-margin-top: 8px; }
.set-g h3 { font-size: .98rem; margin-bottom: 8px; }
.set-f { display: grid; grid-template-columns: minmax(0, 1fr) minmax(120px, 240px); gap: 4px 14px; align-items: center; padding: 4px 0; font-size: .88rem; }
.set-f.col { grid-template-columns: minmax(0, 1fr); }
.set-f:has(.set-secret) { grid-template-columns: minmax(0, 1fr) auto auto; }
.set-l { display: flex; flex-direction: column; min-width: 0; }
.set-l small { color: var(--muted); font-size: .76rem; }
.set-secret { font-size: .8rem; color: var(--muted); }
.set-list { margin: 0; padding: 0; list-style: none; font-family: var(--f-mono); font-size: .8rem; color: var(--muted); }
/* A value that is no setting, and the three values of the session holder in one dense row. */
.set-fixed { justify-self: end; font-family: var(--f-mono); font-size: .8rem; color: var(--muted); }
/* The push-to-talk key: its name as a key cap, and Change. */
.set-key { display: flex; align-items: center; gap: 8px; justify-self: end; }
.keycap { font-family: var(--f-mono); font-size: .8rem; padding: 1px 7px; border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 5px; background: var(--surface); color: var(--ink); white-space: nowrap; }
.set-key [aria-pressed="true"] { border-color: var(--accent); color: var(--accent); }
.hold-row { display: flex; flex-wrap: wrap; align-items: end; gap: 6px 12px; }
.hold-f { display: flex; flex-direction: column; gap: 2px; font-size: .76rem; color: var(--muted); }
.hold-f input[type="number"] { width: 7ch; padding: 2px 6px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); font-size: .86rem; }
.hold-f.hold-on { flex-direction: row; align-items: center; gap: 6px; color: var(--ink); font-size: .86rem; min-height: var(--btn-h); }
.hold-waits { margin: 0; color: var(--warn); }
/* The never-stop list of the resource control: one name per line. */
.res-never textarea { width: 100%; min-height: 4.2em; resize: vertical; font-size: .86rem; padding: 4px 8px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); color: var(--ink); }
.set-resources .tab-note { margin: 0; }
/* A checkbox keeps its own size beside its label (a wider rule for the inputs of a setting
   made it 130 px wide), and the switch of the control has a line of its own. */
.set-resources input[type="checkbox"] { width: auto; flex: none; margin: 0; }
.set-resources .hold-on > span { white-space: nowrap; }
.set-resources .hold-row:first-of-type .hold-on { flex-basis: 100%; }
.switch { justify-self: end; width: 40px; height: 22px; border-radius: 99px; border: 1px solid var(--line); background: var(--sunk); padding: 2px; display: flex; }
.switch span { width: 16px; height: 16px; border-radius: 50%; background: var(--muted); transition: transform .15s; }
.switch[aria-checked="true"] { background: var(--accent); border-color: var(--accent); }
.switch[aria-checked="true"] span { background: var(--on-accent); transform: translateX(18px); }

/* inbox */
/* ---- the view "For me" ---- */
/* One segmented control, as high as the buttons beside it; the active segment is filled. */
.seg { display: inline-flex; align-items: stretch; min-height: var(--btn-h); border: 1px solid var(--line); border-radius: 7px; overflow: hidden; background: var(--surface); }
.seg button { appearance: none; border: 0; border-radius: 0; margin: 0; background: none; padding: 0 12px; font: inherit; font-size: .8rem; font-weight: 600; line-height: 1; color: var(--muted); cursor: pointer; }
.seg button:hover { color: var(--ink); background: var(--sunk); }
.seg button[aria-pressed="true"]:hover { color: var(--on-accent); background: var(--accent); }
.seg button + button { border-left: 1px solid var(--line); }
.seg button[aria-pressed="true"] { background: var(--accent); color: var(--on-accent); }
.need-line { display: flex; align-items: center; gap: 5px 8px; flex-wrap: wrap; margin-bottom: 8px; font-size: .9rem; }
/* The parts of "5 need you" read as chips, not as buttons. */
.need-part { appearance: none; margin: 0; border: 1px solid var(--line); background: var(--surface); border-radius: 99px; padding: 1px 9px; font: inherit; font-size: .8rem; font-weight: 600; line-height: 1.5; color: var(--ink); cursor: pointer; }
.need-part:hover { border-color: var(--accent); }
.need-part.you { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.need-part.new { color: var(--accent); border-color: var(--accent); }
.need-part.confirm { color: var(--ok); border-color: var(--ok); }
.need-part.stale { color: var(--warn); border-color: var(--warn); }
/* New for the user: an accent dot before a bolder title, and the reason before the second line. */
.dot { display: inline-block; width: 8px; height: 8px; margin-right: 7px; border-radius: 50%; background: var(--accent); vertical-align: 1px; }
.srow.unseen .t { font-weight: 700; }
.why { color: var(--accent); font-weight: 600; }
.srow .nx.late { color: var(--warn); font-weight: 600; }
.srow.need { box-shadow: inset 3px 0 0 transparent; }
.srow.muted { background: var(--bg); }
.srow.muted .t { font-weight: 500; color: var(--muted); }
.srow.flash { animation: flash 1.6s ease-out; }
@keyframes flash { 0%, 40% { background: var(--accent-soft); } }
/* All quiet rows of a group in one line; it opens them in place. */
.quiet-line { display: flex; align-items: center; gap: 6px; width: 100%; border: 0; border-top: 1px solid var(--line); background: none; padding: 4px 12px 4px 14px; font-size: .82rem; color: var(--muted); text-align: left; }
.s-rows > .quiet-line:first-child { border-top: 0; }
.quiet-line:hover { color: var(--ink); background: var(--sunk); }
.quiet-line .ic { transition: transform .15s; transform: rotate(-90deg); }
.quiet-line[aria-expanded="true"] .ic { transform: none; }
/* Groups with nothing for the user: under a divider, one line each. */
.divider { display: flex; align-items: center; gap: 8px; margin: 16px 2px 6px; font-size: .72rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.divider::after { content: ""; flex: 1; height: 1px; background: var(--line); order: 1; }
.divider .ag-n { margin-left: 0; order: 0; }
.slims { display: flex; flex-direction: column; gap: 4px; }
.slim { display: flex; align-items: center; gap: 4px 10px; flex-wrap: wrap; width: 100%; text-align: left; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); padding: 4px 10px; font-size: .86rem; color: var(--muted); }
.slim:hover { border-color: var(--accent); color: var(--ink); }
.slim .ic { transform: rotate(-90deg); }
.slim b { font-weight: 600; color: var(--ink); }
.slim .ref { font-family: var(--f-mono); font-size: .72rem; }
.slim .s-counts { margin-left: 0; }
.slim .sn { flex: 1 1 200px; min-width: 0; font-size: .8rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-align: right; }
.stream.nothing { border-left-color: var(--line); margin-top: 0; }
.calm { margin-bottom: 10px; padding-bottom: 10px; }
.calm .empty { display: flex; flex-direction: column; gap: 4px; padding-bottom: 12px; }
.calm .empty b { color: var(--ink); font-size: 1rem; }
.calm-acts { display: flex; justify-content: center; }

/* ---- the command palette: one input in the top third of the window, results below ---- */
dialog.palette { padding: 0; margin: 12vh auto auto; width: min(660px, calc(100vw - 32px)); max-height: min(72vh, 620px); border: 1px solid var(--line); border-radius: 14px; background: var(--surface); color: var(--ink); overflow: hidden; box-shadow: 0 24px 60px rgba(10, 14, 22, .45); }
dialog.palette[open] { display: flex; flex-direction: column; }
dialog.palette::backdrop { background: rgba(10, 14, 22, .45); }
.pal-top { flex: none; display: flex; align-items: center; gap: 8px; padding: 7px 10px; border-bottom: 1px solid var(--line); }
.pal-top input { flex: 1; min-width: 0; border: 0; background: none; outline: none; font-size: 1rem; color: var(--ink); padding: 4px 0; }
.pal-ic { display: inline-flex; flex: none; color: var(--muted); }
.pal-esc { border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 5px; background: var(--surface); color: var(--muted); font-size: .7rem; font-weight: 600; padding: 1px 6px; }
.pal-list { flex: 1 1 auto; min-height: 0; overflow: auto; padding: 4px 6px 6px; }
.pal-sec h3 { display: flex; align-items: center; gap: 6px; padding: 7px 8px 3px; font-size: .68rem; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); }
.pal-more { margin-left: auto; font-weight: 500; letter-spacing: 0; text-transform: none; }
.pal-item { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; border: 0; background: none; border-radius: 8px; padding: 5px 8px; font-size: .9rem; color: var(--ink); scroll-margin: 30px 0 6px; }
.pal-item:hover { background: var(--sunk); }
.pal-item.on { background: var(--accent-soft); box-shadow: inset 3px 0 0 var(--accent); }
.pal-main { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }
.pal-main b { font-weight: 600; overflow-wrap: anywhere; }
.pal-line { font-size: .8rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pal-meta { flex: none; max-width: 40%; font-size: .76rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pal-item mark { background: none; color: var(--accent); font-weight: 700; text-decoration: underline; text-underline-offset: 2px; }
.pal-none, .pal-wait { padding: 12px 10px; font-size: .86rem; color: var(--muted); }
.pal-wait { padding-top: 4px; }
.pal-wait.bad { color: var(--bad); }
.pal-foot { flex: none; display: flex; align-items: center; gap: 6px 14px; flex-wrap: wrap; padding: 7px 12px; border-top: 1px solid var(--line); background: var(--sunk); font-size: .74rem; color: var(--muted); }
.pal-back { border: 1px solid var(--line); border-radius: 6px; background: var(--surface); color: var(--ink); font-size: .74rem; font-weight: 600; padding: 2px 8px; }

/* ---- history ---- */
dialog.panel[data-kind="history"] { width: min(820px, calc(100vw - 2 * var(--gap))); height: calc(100dvh - 2 * var(--gap)); }
.hi-bar { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.hi-text { flex: 1 1 200px; display: flex; align-items: center; gap: 6px; border: 1px solid var(--line); border-radius: 8px; padding: 0 9px; background: var(--bg); color: var(--muted); }
.hi-text:focus-within { outline: 2px solid var(--accent); outline-offset: 1px; }
.hi-text input { flex: 1; min-width: 0; border: 0; background: none; padding: 6px 0; font-size: .88rem; color: var(--ink); outline: none; }
.hi-bar select { border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--ink); padding: 6px 8px; font-size: .86rem; max-width: 100%; }
.hi-count { font-size: .8rem; color: var(--muted); margin-bottom: 4px; }
.hi h3.day { margin: 10px 0 4px; font-size: .78rem; font-weight: 700; letter-spacing: .05em; color: var(--muted); border-bottom: 1px solid var(--line); padding-bottom: 4px; }
.hi-item { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 10px; align-items: center; border-radius: 8px; padding: 2px 0; }
.hi-item:hover { background: var(--sunk); }
.hi-open { display: grid; grid-template-columns: 46px minmax(0, 1fr); gap: 1px 8px; text-align: left; border: 0; background: none; padding: 4px 8px; font-size: .88rem; min-width: 0; border-radius: 8px; }
.hi-open b { font-weight: 600; min-width: 0; overflow-wrap: anywhere; }
.hi-time { grid-row: 1 / span 3; font-size: .78rem; color: var(--muted); font-variant-numeric: tabular-nums; padding-top: 2px; }
.hi-open .res-meta { grid-column: 2; text-align: left; max-width: none; white-space: normal; }
.hi-open .res-line { grid-column: 2; color: var(--ink); }
.hi-acts { display: flex; gap: 6px; padding-right: 6px; }

.in h3 { font-size: .8rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin: 4px 0 8px; }
.in-item { border: 1px solid var(--line); border-radius: 10px; padding: 7px 10px; margin-bottom: 6px; display: flex; flex-direction: column; gap: 4px; font-size: .88rem; }
.in-h { display: flex; gap: 8px; align-items: baseline; }
.in-h b { flex: 1; min-width: 0; overflow-wrap: anywhere; }
/* The head of an inbox card, under its title: the row (its ref opens it), its state, the agent. */
/* The model of the last turn of a session, on its row and in the head of its dialog. Quiet;
   Fable in the warn colour, so a session that still runs on it is seen at once. */
.mchip { display: inline-block; font-family: var(--f-mono); font-size: .66rem; font-weight: 600; line-height: 15px; padding: 0 6px; border-radius: 5px; border: 1px solid var(--line); color: var(--muted); vertical-align: 1px; white-space: nowrap; }
.mchip.warn { border-color: var(--warn); color: var(--warn); background: color-mix(in srgb, var(--warn) 14%, transparent); }
.d-meta .mchip { align-self: center; }
/* How full the context is: quiet, warn from 70 %, bad from 90 % (home-model.js contextChip). */
.chip.ctx.warn { border-color: var(--warn); background: var(--warn-soft); color: var(--warn); }
.chip.ctx.bad { border-color: var(--bad); background: var(--bad-soft); color: var(--bad); }
.nx .ctx { font-weight: 600; }
.nx .ctx.warn { color: var(--warn); }
.nx .ctx.bad { color: var(--bad); }
.in-meta { margin: 1px 0 4px; font-size: .76rem; color: var(--muted); line-height: 1.4; }
.in-ref { border: 0; background: none; padding: 0; font: inherit; font-family: var(--f-mono); color: var(--accent); cursor: pointer; text-decoration: underline; text-underline-offset: 2px; }
.in-ref:hover { color: var(--ink); }
/* Under the options: an answer in the user's own words, then the way into the session and Dismiss. */
.in-own { display: flex; gap: 8px; align-items: center; }
.in-own input { flex: 1 1 auto; border: 1px solid var(--line); border-radius: 7px; background: var(--surface); color: var(--ink); padding: 6px 8px; font-size: .88rem; min-width: 0; }
.in-foot { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; border-top: 1px solid var(--line); padding-top: 6px; margin-top: 2px; }
.card-said.muted { color: var(--muted); }

/* ---- MOCKUP STAGE: the banner and the tags. Remove with the list of parts in home-data.js. ---- */
.mock-banner { position: sticky; top: 0; z-index: 15; background: var(--mock-soft); color: var(--ink); border-bottom: 2px dashed var(--mock); font-size: .86rem; }
.mock-banner[hidden] { display: none; }
.mock-banner .wrap { display: flex; gap: 2px 16px; align-items: baseline; flex-wrap: wrap; padding-top: 5px; padding-bottom: 5px; }
.mock-banner strong { color: var(--mock); }
.mock-cases { display: flex; gap: 2px 10px; flex-wrap: wrap; color: var(--muted); }
.mock-cases a { color: var(--ink); }
.mock-cases a[aria-current="page"] { font-weight: 600; text-decoration: none; }
.mock-banner details { min-width: 0; }
.mock-banner details[open] { flex: 1 1 100%; }
.mock-banner summary { cursor: pointer; font-weight: 600; width: fit-content; }
.mock-banner details p { margin: 6px 0 2px; color: var(--muted); }
.mock-banner ul { margin: 4px 0 6px; padding: 0; list-style: none; max-height: 46vh; overflow: auto; display: grid; gap: 6px; }
.mock-banner li { display: grid; gap: 1px; padding: 6px 8px; border-left: 3px solid var(--mock); background: var(--surface); border-radius: 0 6px 6px 0; overflow-wrap: anywhere; }
.mock-banner li i { font-style: normal; color: var(--muted); font-size: .8rem; }
.mock-tag { display: inline-block; flex: none; margin-left: 6px; padding: 0 4px; border: 1px dashed var(--mock); border-radius: 4px; background: var(--mock-soft); color: var(--mock); font-family: var(--f-text); font-size: .58rem; font-weight: 700; line-height: 1.5; letter-spacing: .06em; text-transform: uppercase; text-decoration: none; vertical-align: middle; white-space: nowrap; }


/* ==== THE LOOK (round 6). Component rules of the style direction; they come after the
   rules above on purpose and change weight and type, not layout. ==== */
/* A thin line in the accent family at the top of the page. */
.bar { border-top: 2px solid var(--hairline); border-bottom-color: var(--line); background: var(--panel); }
.brand { letter-spacing: .14em; text-transform: uppercase; font-size: .92rem; }
/* Panels: a step lighter than the page, a hairline, no shadow. */
.stream, .agents, .frame, .panel { border-color: var(--line); box-shadow: none; }
.s-head { background: var(--sunk); border-bottom-color: var(--line); }
/* Heads of panels and sections: small, uppercase, widely spaced. */
.agents-head h2, .list-head h1, .p-label, .d-tabs button, .view-tabs button, .links a {
  font-size: .72rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; }
.list-head h1 { color: var(--muted); }
.agents-head h2 { color: var(--muted); }
.links a { letter-spacing: .1em; font-weight: 600; }
/* Monospace for times, ages, refs, counts and the small status labels. */
.age, .ref, .s-head .ref, .ag-n, .p-n, .cnt, .pill, .chip.ref, .hi-time, .h-when, .f-lines, .mono, kbd, .s-counts .cnt, .need-part {
  font-family: var(--f-mono); }
.pill, .s-counts .cnt { text-transform: uppercase; letter-spacing: .06em; font-size: .64rem; }
.need-part { font-size: .74rem; text-transform: uppercase; letter-spacing: .05em; }
/* Buttons: small and outlined. The fill is for the ONE main action of a row or dialog. */
.act { background: none; border-color: var(--line); font-size: .76rem; letter-spacing: .03em; }
.act:hover:not(:disabled) { border-color: var(--accent); color: var(--accent); filter: none; }
.act.primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.act.primary:hover:not(:disabled) { color: var(--on-accent); filter: brightness(1.08); }
.act.okb { background: none; border-color: var(--ok); color: var(--ok); }
.act.okb:hover:not(:disabled) { background: var(--ok-soft); border-color: var(--ok); color: var(--ok); }
.act.ghost:hover:not(:disabled) { border-color: var(--line); color: var(--ink); }
/* The marks of "your move" carry the accent. */
.pill.you { background: var(--accent-soft); color: var(--accent); }
.s-counts .cnt.you, .need-part.you { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.stream { border-left: 3px solid var(--hairline); }
.stream.quick, .stream.bare, .stream.nothing { border-left-color: var(--line); }
.seg { background: none; }
.search, .ag-search, .hi-text { background: var(--surface); }
dialog.dlg, dialog.palette { border-color: var(--line); }
.d-head, .pal-foot { background: var(--sunk); }
.pal-item.on { box-shadow: inset 2px 0 0 var(--accent); }

/* Density. The default (comfortable) is already close: small buttons, little air in the rows.
   Compact takes the rest out and a point off the type. Most rules read the tokens of :root
   (--btn-h, --row-y, ...); the few below change what the tokens do not reach. Where a finger
   taps (a phone, a touch screen) the buttons keep their height in both densities, further
   down. */
html[data-density="compact"] { --btn-h: 26px; --btn-sm: 22px; --row-y: 3px; --agent-y: 2px; --conv-gap: 6px; --stack: 8px; }
html[data-density="compact"] body { font-size: 14px; line-height: 1.4; }
html[data-density="compact"] .s-head { padding-top: 5px; padding-bottom: 5px; }
html[data-density="compact"] .quiet-line { padding-top: 2px; padding-bottom: 2px; }
html[data-density="compact"] .msg { padding: 4px 9px; gap: 2px; }
html[data-density="compact"] .card { padding: 6px 9px; gap: 4px; }
html[data-density="compact"] .opt { padding: 2px 8px; }
html[data-density="compact"] .d-body { padding: 8px 12px; }
html[data-density="compact"] .d-foot { padding: 4px 10px; }
html[data-density="compact"] .page { padding-top: 8px; gap: 10px; }

/* ---- the switch of the top level: the list or the dashboard ---- */
.page[data-layout="dash"] { display: block; }
.page[data-layout="dash"] .agents, .page[data-layout="dash"] main { display: none; }
.page[data-layout="list"] .dash { display: none; }

/* ---- the menu "Views" of the top bar ---- */
.menu-box { position: relative; }
.menu { position: absolute; z-index: 40; left: 0; top: calc(100% + 6px); min-width: 210px; padding: 5px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 12px 32px rgba(0, 0, 0, .4); display: flex; flex-direction: column; }
.menu[hidden] { display: none; }
.menu [role="menuitem"] { display: flex; align-items: center; gap: 8px; border: 0; background: none; border-radius: 7px; padding: 5px 8px; font: inherit; font-size: .86rem; color: var(--ink); text-align: left; text-decoration: none; cursor: pointer; }
.menu [role="menuitem"]:hover { background: var(--sunk); color: var(--accent); }
.menu [aria-current="page"] { color: var(--accent); font-weight: 600; }
.menu-sep { margin: 5px 4px 2px; padding-top: 7px; border-top: 1px solid var(--line); font-size: .64rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
/* A chip that filters: the same look as a chip, pressed when its filter is on. */
button.cnt { appearance: none; border: 0; margin: 0; cursor: pointer; font-family: var(--f-mono); }
button.cnt[aria-pressed="true"], .need-part[aria-pressed="true"] { outline: 2px solid var(--ink); outline-offset: 1px; }
.need-all { appearance: none; border: 0; background: none; padding: 0; margin: 0; font: inherit; font-weight: 700; color: var(--ink); cursor: pointer; }
.need-all[aria-pressed="false"] { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
.agent-row { grid-template-columns: auto minmax(0, 1fr) auto auto auto; }
.agent-row [data-caps-for] { grid-column: 4; grid-row: 1 / span 2; }
.agent-row [data-new-for] { grid-column: 5; }
@media (min-width: 900px) { .dcol.left { order: 1; } .dcol.centre { order: 2; } .dcol.right { order: 3; } }

/* ---- the dashboard: three columns of panels ---- */
.dash { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.5fr) minmax(0, 1fr); gap: 12px; align-items: start; }
.dcol { display: flex; flex-direction: column; gap: var(--stack); min-width: 0; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; min-width: 0; }
.p-head { display: flex; align-items: center; gap: 8px; padding: 6px 8px 6px 10px; border-bottom: 1px solid var(--line); }
.panel.folded .p-head { border-bottom: 0; }
.p-fold { display: inline-flex; align-items: center; gap: 7px; border: 0; background: none; padding: 0; color: var(--muted); font: inherit; }
.p-fold:hover { color: var(--accent); }
.p-fold .ic { color: var(--accent); }
.p-n { font-size: .72rem; color: var(--muted); }
.p-head .act { min-height: var(--btn-sm); padding: 1px 8px; font-size: .68rem; text-transform: uppercase; letter-spacing: .08em; }
.p-body { padding: 4px 0; }
.p-note { padding: 7px 10px; font-size: .84rem; color: var(--muted); }
.p-note.bad { color: var(--bad); }
.drow, .pl { display: flex; align-items: center; gap: 8px; width: 100%; padding: calc(var(--row-y) - 1px) 10px; border: 0; border-top: 1px solid var(--line); background: none; text-align: left; font-size: .88rem; color: var(--ink); min-width: 0; }
.p-body > :first-child { border-top: 0; }
.drow { cursor: pointer; }
.drow:hover, button.pl:hover { background: var(--sunk); }
.d-main, .pl-main { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }
.d-main b, .pl-main b { font-weight: 600; overflow-wrap: anywhere; }
.d-line, .pl-main small { font-size: .78rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.d-line .why { white-space: normal; }
.pl-time { flex: none; min-width: 44px; font-family: var(--f-mono); font-size: .76rem; color: var(--muted); }
.pl-tag { flex: none; font-family: var(--f-mono); font-size: .62rem; letter-spacing: .08em; text-transform: uppercase; padding: 1px 6px; border-radius: 4px; border: 1px solid var(--line); color: var(--muted); }
.pl-tag.next { border-color: var(--accent); color: var(--accent); }
.pl-tag.paused { border-style: dashed; }
.pl-tag.prop { border-color: var(--accent); color: var(--accent); }
.quiet-link { display: flex; align-items: center; gap: 6px; width: 100%; border: 0; border-top: 1px solid var(--line); background: none; padding: 5px 10px; font-size: .8rem; color: var(--muted); text-align: left; }
.quiet-link:hover { color: var(--accent); }
.use { display: grid; grid-template-columns: 62px minmax(0, 1fr) 44px; gap: 8px; align-items: center; padding: 4px 10px; font-size: .8rem; }
.use span:first-child { font-family: var(--f-mono); color: var(--muted); text-transform: uppercase; font-size: .7rem; letter-spacing: .06em; }
.use span:last-child { font-family: var(--f-mono); text-align: right; }
.use progress { width: 100%; height: 6px; appearance: none; border: 0; border-radius: 99px; background: var(--sunk); overflow: hidden; }
.use progress::-webkit-progress-bar { background: var(--sunk); border-radius: 99px; }
.use progress::-webkit-progress-value { background: var(--accent); border-radius: 99px; }
.use progress::-moz-progress-bar { background: var(--accent); border-radius: 99px; }
.use.high progress::-webkit-progress-value { background: var(--warn); }
.use.high progress::-moz-progress-bar { background: var(--warn); }
.use-cost { padding: 4px 12px 9px; font-size: .8rem; color: var(--muted); }
.use-cost b { font-family: var(--f-mono); color: var(--ink); }
.in-mini { padding: 6px 10px; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 6px; font-size: .86rem; }
.in-mini b { font-weight: 600; }

/* ---- capabilities ---- */
dialog.panel[data-kind="caps"] { width: min(900px, calc(100vw - 2 * var(--gap))); height: calc(100dvh - 2 * var(--gap)); }
.cap-sec { margin-top: 12px; }
.p-label { display: flex; align-items: center; gap: 7px; color: var(--muted); padding-bottom: 6px; border-bottom: 1px solid var(--line); margin-bottom: 4px; }
.p-label .ic { color: var(--accent); }
.cap { padding: 6px 2px; border-bottom: 1px solid var(--line); display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 3px 12px; align-items: start; }
.cap-h { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; min-width: 0; }
.cap-h b { font-family: var(--f-mono); font-size: .88rem; overflow-wrap: anywhere; }
.cap-d { grid-column: 1; font-size: .84rem; color: var(--muted); overflow-wrap: anywhere; }
.cap-m { grid-column: 1; font-family: var(--f-mono); font-size: .72rem; color: var(--muted); overflow-wrap: anywhere; }
.cap-acts { grid-column: 2; grid-row: 1 / span 3; display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.cap details { grid-column: 1 / -1; font-size: .8rem; }
.cap summary { cursor: pointer; color: var(--accent); width: fit-content; }
.cap pre { margin: 6px 0 0; padding: 9px 11px; background: var(--sunk); border-radius: 8px; font-size: .78rem; line-height: 1.5; white-space: pre-wrap; overflow: auto; max-height: 240px; }
.chip.dup { border-color: var(--warn); color: var(--warn); }

/* ---- settings: the accent ---- */
.swatches { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.swatch { width: 26px; height: 26px; border-radius: 50%; border: 2px solid transparent; padding: 0; background: var(--sw); box-shadow: inset 0 0 0 1px rgba(128, 128, 128, .35); }
.swatch[aria-pressed="true"] { border-color: var(--ink); box-shadow: 0 0 0 2px var(--bg) inset; }
.swatch-custom { display: inline-flex; align-items: center; gap: 6px; font-size: .8rem; color: var(--muted); }
.swatch-custom input[type="color"] { width: 34px; height: 28px; padding: 0; border: 1px solid var(--line); border-radius: 6px; background: none; }
.set-f.wide { grid-template-columns: minmax(0, 1fr); }
/* Export and import of the settings of this browser: a text to copy, a text to paste. */
.set-io textarea { width: 100%; min-height: 4.2em; resize: vertical; font-family: var(--f-mono); font-size: .78rem; padding: 6px 8px; border: 1px solid var(--line); border-radius: 8px; background: var(--sunk); color: var(--ink); overflow-wrap: anywhere; }
.set-io-acts { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.set-io .side-note { margin: 0; }
/* A question of the inbox that is on hold: seen, answered later. */
.in-item.held { border-style: dashed; }
/* A proposal and a schedule a session made: their lines as the host wrote them. */
.in-item.prop, .in-item.made { box-shadow: inset 3px 0 0 var(--accent); }
.in-pre { white-space: pre-wrap; overflow-wrap: anywhere; max-height: 12em; overflow: auto; }
.in-warn { font-size: .8rem; color: var(--warn, var(--muted)); margin: 0; }
.in-held { margin-left: 2px; }
.accent-demo { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 6px; font-size: .8rem; }
.accent-demo code { font-family: var(--f-mono); color: var(--muted); }

/* ---- phone ---- */
@media (max-width: 899px) {
  /* The agents and the work are two views with a tab each. */
  .view-tabs { display: flex; gap: 2px; padding: 4px 12px 0; border-bottom: 1px solid var(--line); background: var(--surface); }
  .view-tabs button[aria-selected="true"] { color: var(--ink); box-shadow: inset 0 -2px 0 var(--accent); }
  .page, .page[data-agents="off"] { grid-template-columns: minmax(0, 1fr); }
  .page[data-view="work"] .agents, .page[data-view="agents"] main { display: none; }
  .page[data-view="agents"] .agents, .page[data-agents="off"][data-view="agents"] .agents { display: block; position: static; max-height: none; }
  .desk-only { display: none; }
  .links { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 2px; scrollbar-width: none; }
  .dash { grid-template-columns: minmax(0, 1fr); }
  .search-box { flex: 1 1 80px; }
  button.search kbd { display: none; }
  .bar .wrap { gap: 6px; }
  .brand { margin-right: 0; }
}
@media (max-width: 559px) {
  .act.io-phone { padding: 5px 9px; }
  .act.io-phone .lbl { display: none; }
  /* The height of a button on the phone: --btn-h, set under "Density". */
  /* The row keeps the order: pill and age, title, line, buttons. */
  .seg button { padding: 4px 10px; }
  .dash { grid-template-columns: minmax(0, 1fr); }
  .cap { grid-template-columns: minmax(0, 1fr); }
  .cap-acts { grid-column: 1; grid-row: auto; justify-content: flex-start; }
  dialog.panel[data-kind="caps"] { inset: 0; width: 100%; height: 100%; max-height: none; border: 0; border-radius: 0; margin: 0; }
  /* The palette is a sheet at the top, as wide as the screen. */
  dialog.palette { margin: 0; width: 100%; max-width: none; max-height: 86vh; max-height: 86dvh; border: 0; border-bottom: 1px solid var(--line); border-radius: 0 0 14px 14px; }
  .pal-foot span:nth-last-child(-n+2) { display: none; }
  .pal-meta { display: none; }
  .slim .sn { flex-basis: 100%; text-align: left; white-space: normal; }
  .res-meta { grid-column: 1 / -1; text-align: left; max-width: none; white-space: normal; }
  .hi-item { grid-template-columns: minmax(0, 1fr); }
  .hi-acts { padding: 0 8px 8px 62px; flex-wrap: wrap; }
  dialog.panel[data-kind="history"] { inset: 0; width: 100%; height: 100%; max-height: none; border: 0; border-radius: 0; margin: 0; }
  /* The row keeps its order: state and age, the title with its line, the agent and the buttons. */
  .srow { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "pill age" "main main" "agent acts"; gap: 3px 8px; padding: calc(var(--row-y) + 2px) 10px; }
  .srow .sref { grid-area: pill; flex-direction: row; align-items: center; gap: 8px; }
  .srow .age { grid-area: age; }
  .srow .main { grid-area: main; }
  .srow .agent { grid-area: agent; align-self: center; }
  .srow .acts { grid-area: acts; }
  .s-head { padding: 6px 10px 7px; }
  .s-head .sn, .prop { margin-left: 0; }
  .s-counts { margin-left: 0; flex-basis: 100%; }
  .s-none, .row-note, .editor { margin-left: 10px; }
  .s-none { padding-left: 0; }
  .editor { grid-template-columns: minmax(0, 1fr); }
  /* A dialog is the whole screen. */
  /* Percent, not vw: the width without a scrollbar of the page behind. */
  dialog.dlg, dialog.panel, dialog.panel[data-kind="new"], dialog.panel[data-kind="settings"] { inset: 0; width: 100%; height: 100%; max-height: none; border: 0; border-radius: 0; margin: 0; }
  .d-head { padding: 5px 6px 0 10px; }
  .d-body { padding: 8px 10px; }
  .d-tabs button { padding: 5px 8px; }
  .d-tabs .lbl { font-size: .78rem; }
  .msg.me { max-width: 100%; }
  .files { grid-template-columns: minmax(0, 1fr); }
  .hist { grid-template-columns: auto minmax(0, 1fr) auto; }
  .h-how { grid-column: 2 / -1; }
  .d-body.set { grid-template-columns: minmax(0, 1fr); overflow: auto; }
  .set-nav { flex-direction: row; flex-wrap: nowrap; overflow-x: auto; padding: 10px 12px 0; white-space: nowrap; scrollbar-width: none; }
  .set-main { overflow: visible; padding: 10px 12px 24px; }
  .set-f { grid-template-columns: minmax(0, 1fr) minmax(90px, 130px); }
  iframe.page { height: 380px; }
}

@media (prefers-reduced-motion: reduce) { .pill.working::before, .spin { animation: none; } }

/* Late refinements of the dashboard (round 6). */
.p-fold.p-label { font-size: .72rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; border-bottom: 0; padding-bottom: 0; margin-bottom: 0; }
.pl .s-counts { margin: 3px 0 0; }
.pl-main small { white-space: normal; }

/* The views with a dialog of their own (round 7): their sizes, and the count on the menu. */
dialog.panel[data-kind="sched"] { width: min(980px, calc(100vw - 2 * var(--gap))); height: calc(100dvh - 2 * var(--gap)); }
dialog.panel[data-kind="deck"] { width: min(900px, calc(100vw - 2 * var(--gap))); height: calc(100dvh - 2 * var(--gap)); }
dialog.panel[data-kind="sugg"] { width: min(780px, calc(100vw - 2 * var(--gap))); height: calc(100dvh - 2 * var(--gap)); }
dialog.panel[data-kind="apps"] { width: min(760px, calc(100vw - 2 * var(--gap))); height: min(680px, calc(100dvh - 2 * var(--gap))); }
.menu .badge, [data-views] .badge { margin-left: auto; background: var(--accent); color: var(--on-accent); font-family: var(--f-mono); }
[data-views] .badge { margin-left: 2px; }
@media (max-width: 559px) {
  /* The button of the menu sits at the right edge on a phone: the menu opens towards the left
     and scrolls inside itself when it is longer than the screen. */
  .menu { left: auto; right: 0; max-height: calc(100dvh - 140px); overflow-y: auto; }
  dialog.panel[data-kind="sched"], dialog.panel[data-kind="deck"], dialog.panel[data-kind="sugg"], dialog.panel[data-kind="apps"] { inset: 0; width: 100%; height: 100%; max-height: none; border: 0; border-radius: 0; margin: 0; }
}

/* The model and effort a session was started with, in the head of its dialog. */
.chip.run-with { font-family: var(--f-mono); text-transform: uppercase; letter-spacing: .06em; font-size: .68rem; }

/* A dialog that takes the focus itself on opening shows no ring around the whole dialog; its controls keep theirs. */
dialog.dlg:focus, dialog.dlg:focus-visible { outline: none; }

/* The schedules as a full view of the page, like the dashboard. */
.sched-page { display: none; }
.page[data-layout="sched"] { display: block; }
.page[data-layout="sched"] .agents, .page[data-layout="sched"] main, .page[data-layout="sched"] .dash { display: none; }
.page[data-layout="sched"] .sched-page { display: block; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius, 12px); }
.v-head { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-bottom: 1px solid var(--line); }
.v-head h2 { margin: 0; font-size: 1.05rem; }
.v-body { padding: 10px 12px 14px; }

/* What a group waits on, beside its headline. */
.sn-wait { display: inline-flex; align-items: center; gap: 4px; margin-left: 10px; color: var(--warn); }
.sn-wait:first-child { margin-left: 0; }

/* The park chooser and "Wait for reply": small dialogs. */
dialog.panel[data-kind="park"], dialog.panel[data-kind="wait-reply"] { width: min(440px, calc(100vw - 2 * var(--gap))); height: auto; max-height: calc(100dvh - 2 * var(--gap)); }
@media (max-width: 559px) {
  dialog.panel[data-kind="park"], dialog.panel[data-kind="wait-reply"] { inset: auto 0 0 0; width: 100%; height: auto; border-radius: 14px 14px 0 0; }
}
.park-times { display: flex; flex-direction: column; gap: 6px; margin-bottom: 10px; }
.park-times .act { justify-content: flex-start; }
.park-times .act small { margin-left: auto; color: var(--muted); font-variant-numeric: tabular-nums; }
.park-own { display: flex; gap: 8px; align-items: end; flex-wrap: wrap; }
.park-own label { display: flex; flex-direction: column; gap: 2px; font-size: .74rem; color: var(--muted); flex: 1 1 200px; }
.park-own input { font: inherit; padding: 6px 8px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--ink); }
.wait-reply { display: flex; flex-direction: column; gap: 8px; }
.wait-reply label { display: flex; flex-direction: column; gap: 2px; font-size: .74rem; color: var(--muted); }
.wait-reply input { font: inherit; padding: 6px 8px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--ink); }
.wait-reply .wait-from { color: var(--muted); }

/* A run of a schedule that still runs: an outline with a dot (the other marks are in sched.css). */
.wk-mark.wk-running { border-color: var(--ok); }
.wk-mark.wk-running::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--ok); }

/* The question the inbox was opened on, and the mark of a row that has a question. */
.in-item.focus { outline: 2px solid var(--accent); outline-offset: 2px; }

/* The session dialog on a host: what the read serves, and what is not built. */
.cut-mark { display: inline-block; font-size: .68rem; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--warn); border: 1px solid var(--warn); border-radius: 4px; padding: 0 5px; margin-left: 6px; vertical-align: middle; }
.conv-older { display: flex; justify-content: center; }
.tool-out { flex: 1 1 100%; margin: 2px 0 4px; padding: 6px 8px; font-size: .76rem; line-height: 1.45; background: var(--sunk); border-radius: 6px; overflow: auto; max-height: 180px; white-space: pre-wrap; overflow-wrap: anywhere; color: var(--ink); }
.ro-line { font-size: .84rem; color: var(--muted); }
.classic-link { font-size: .8rem; white-space: nowrap; }
.file-note { padding: 6px 10px; font-size: .78rem; color: var(--muted); border-bottom: 1px solid var(--line); }
.file-note.bad { color: var(--warn); }
.f-at { grid-column: 1 / -1; font-size: .72rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.hist[disabled] { opacity: .6; cursor: default; }

/* An agent row: the title takes the free space on one line and never falls under a width
   that can be read; a long title is cut with dots and whole in its tooltip. The controls
   beside it keep their own width and never take the title's. */
.agent-row { grid-template-columns: auto minmax(8ch, 1fr) auto auto auto; }
.agent-row b, .agent-row .kind { min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; overflow-wrap: normal; }
.agent-row .act { flex: none; min-height: var(--btn-sm); padding: 1px 6px; }
/* A tag inside a small control widened it by a whole word: in a row of the agents it is
   left out, the head of the column or the banner carries the mark. */
.agent-row .mock-tag { display: none; }

/* A text in a narrow column never breaks letter by letter: it keeps a width it can be read
   at, and what does not fit is cut with dots or wraps at a word. */
.pl-main, .d-main, .hi-main, .cap-main, .deck-cand-main, .sched-h { min-width: 0; }
.pl-main b, .d-main b, .drow .d-line, .pl-main small { overflow-wrap: break-word; word-break: normal; }
.drow .d-main { min-width: 8ch; }
.pl .pl-main { min-width: 8ch; }

/* On a real host nothing says "mock". A control of a part that is not built yet is pale (its
   tooltip says "Not built yet"), and the banner lists the parts that are not built. */
html[data-source="real"] .mock-tag { display: none; }
html[data-source="real"] :is(button, a):has(> .mock-tag) { opacity: .55; }

/* The title of an agent may take two lines, broken at words; more is cut and whole in the
   tooltip. The column of the agents grows with the window so that real titles fit; it stays
   out of the way where the column is switched off, in the other views and on the phone. */
.agent-row b { white-space: normal; overflow-wrap: break-word; word-break: normal; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow: hidden; text-overflow: clip; }
@media (min-width: 560px) {
  .page[data-layout="list"]:not([data-agents="off"]) { grid-template-columns: clamp(270px, 24vw, 340px) minmax(0, 1fr); }
}

/* ==== Density on a touch screen: the buttons keep a height a finger can hit, in both
   densities. Last, so that it wins over the tokens of :root and of compact. ==== */
@media (max-width: 559px), (pointer: coarse) {
  :root, html[data-density="compact"] { --btn-h: 36px; --btn-sm: 32px; }
}

/* ==== Glass. The page is a pattern: large facets like the cut faces of a crystal, a soft
   glow in the accent at two corners, and over it a fine grid of hexagons. The large panels
   (the top bar, the agents column, the groups of the work, the panels of the dashboard, the
   dialogs) are frosted glass over it: translucent, with the pattern blurred behind. The
   rows inside a panel have no glass of their own: the blur is drawn once per panel, never
   per row.
   The facets are bands with hard edges at four angles; where they cross they cut the page
   into faces of different tones. Each light band starts with a bright edge, the cut of the
   crystal. The two light layers carry two bands each that never meet, so at any point of
   the page at most two light bands lie on top of each other (the test counts it so).
   The pattern is two layers fixed to the window, so a scroll only moves the panels; nothing
   in it moves by itself. The grid is a mask (glass-hex.svg, a file next to this one, so the
   CSP needs nothing new) over a colour of the theme, so it follows light and dark. The
   colours are tokens at the top of the file (test/glass.test.mjs). ==== */
body::before, body::after { content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none; }
body::before {
  background:
    linear-gradient(118deg, transparent 0 30%, var(--facet-edge) 30% calc(30% + 1.5px), var(--facet) calc(30% + 1.5px) 46%, transparent 46% 74%, var(--facet-edge) 74% calc(74% + 1.5px), var(--facet) calc(74% + 1.5px) 86%, transparent 86%),
    linear-gradient(62deg, transparent 0 8%, var(--facet-edge) 8% calc(8% + 1.5px), var(--facet) calc(8% + 1.5px) 21%, transparent 21% 53%, var(--facet-edge) 53% calc(53% + 1.5px), var(--facet) calc(53% + 1.5px) 70%, transparent 70%),
    linear-gradient(152deg, var(--shade) 0 20%, transparent 20% 78%, var(--shade) 78%),
    linear-gradient(24deg, transparent 0 36%, var(--shade) 36% 52%, transparent 52%);
  background:
    radial-gradient(1100px 640px at 92% -6%, color-mix(in srgb, var(--accent) var(--glow), transparent), transparent 72%),
    radial-gradient(900px 560px at -8% 106%, color-mix(in srgb, var(--accent) var(--glow), transparent), transparent 72%),
    linear-gradient(118deg, transparent 0 30%, var(--facet-edge) 30% calc(30% + 1.5px), var(--facet) calc(30% + 1.5px) 46%, transparent 46% 74%, var(--facet-edge) 74% calc(74% + 1.5px), var(--facet) calc(74% + 1.5px) 86%, transparent 86%),
    linear-gradient(62deg, transparent 0 8%, var(--facet-edge) 8% calc(8% + 1.5px), var(--facet) calc(8% + 1.5px) 21%, transparent 21% 53%, var(--facet-edge) 53% calc(53% + 1.5px), var(--facet) calc(53% + 1.5px) 70%, transparent 70%),
    linear-gradient(152deg, var(--shade) 0 20%, transparent 20% 78%, var(--shade) 78%),
    linear-gradient(24deg, transparent 0 36%, var(--shade) 36% 52%, transparent 52%);
}
body::after {
  background: linear-gradient(170deg, var(--hex-line) 0%, color-mix(in srgb, var(--hex-line) 70%, transparent) 100%);
  -webkit-mask: url("glass-hex.svg") 0 0 / 42px 72px repeat;
  mask: url("glass-hex.svg") 0 0 / 42px 72px repeat;
}
.bar, .agents, .stream, .frame, .panel, .page[data-layout="sched"] .sched-page { background: var(--panel); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); }
dialog.dlg, dialog.palette { background: var(--panel-dlg); -webkit-backdrop-filter: blur(24px); backdrop-filter: blur(24px); }
dialog.dlg::backdrop, dialog.palette::backdrop { -webkit-backdrop-filter: blur(2px); backdrop-filter: blur(2px); }
/* The head of a group lets the glass through a little, so the card reads as one piece. */
.s-head { background: color-mix(in srgb, var(--sunk) 70%, transparent); }
.slim { background: var(--panel); }
/* A blur makes a panel a layer of its own: what reaches out of it (the list of a field in a
   row's editor, the menu of the top bar) would be covered by the next panel. The panel
   being worked in, and the top bar, are lifted above their neighbours; the bar stays under
   the sticky banner of the mock. */
.bar { position: relative; z-index: 14; }
.stream:focus-within, .panel:focus-within { z-index: 2; }
@media (max-width: 899px) { .view-tabs { background: var(--panel); } }
/* The phone: the blur only on the bar and the agents, not on every card of a long list. A
   dialog is the whole screen there, so it is solid: through it the page would only show as
   smudges. */
@media (max-width: 559px) {
  .stream, .panel, .slim { -webkit-backdrop-filter: none; backdrop-filter: none; }
  dialog.dlg, dialog.palette { background: var(--surface); -webkit-backdrop-filter: none; backdrop-filter: none; }
  dialog.dlg::backdrop, dialog.palette::backdrop { -webkit-backdrop-filter: none; backdrop-filter: none; }
}
/* Backings. The pattern is strong enough to be seen, so a coloured text that stood straight on
   the page (the accent, a state colour) could lose its contrast where two facets, the glow
   and a line of the grid meet. Everything of the list that is not inside a panel stands on
   a small solid strip of the panel colour instead: the head of the list (its name, the
   chips of the filter, "For me | All", the button of the agents column), the line of
   "N need you" with its chips, the button under the list and the words of the divider
   "Nothing for you". --surface is opaque, and
   accent.js keeps every accent readable on it. The banner and the line of loose questions
   bring their own fill. test/glass.test.mjs holds the list and the contrast. */
.list-head, .need-line { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; }
.list-head { padding: 3px 4px 3px 10px; }
.need-line { width: fit-content; max-width: 100%; padding: 3px 6px 3px 10px; }
.list-foot .act { background: var(--surface); }
/* The divider "Nothing for you": its words and count on a pill, the rule beside them stays a line. */
.divider > span { background: var(--surface); border: 1px solid var(--line); border-radius: 99px; padding: 0 8px; }
/* Without a blur the panels are almost solid, so the pattern does not show through sharp. */
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  :root, html[data-theme="dark"] { --panel: color-mix(in srgb, var(--surface) 94%, transparent); }
}
/* The user asked for less transparency: solid panels, no blur. The pattern stays on the
   page, where no text sits on a panel. */
@media (prefers-reduced-transparency: reduce) {
  :root, html[data-theme="dark"] { --panel: var(--surface); --panel-dlg: var(--surface); }
  .bar, .agents, .stream, .frame, .panel, .page[data-layout="sched"] .sched-page, dialog.dlg, dialog.palette,
  dialog.dlg::backdrop, dialog.palette::backdrop { -webkit-backdrop-filter: none; backdrop-filter: none; }
  .s-head { background: var(--sunk); }
}
/* The ref of a work row (W-n) under its state: small, muted, monospace, like the ref of a group head. */
.srow .wref { padding-left: 2px; font-family: var(--f-mono); font-size: .68rem; font-weight: 400; color: var(--muted); white-space: nowrap; }

/* The files of a claude-ask question or note (ask-files-view.js): a chip per file, an image with a small preview. */
.ask-files { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0 2px; }
.ask-file { display: inline-flex; align-items: center; gap: 6px; max-width: 100%; padding: 3px 9px; border: 1px solid var(--line); border-radius: 7px; background: var(--surface); color: var(--ink); font: inherit; font-size: .8rem; text-decoration: none; overflow-wrap: anywhere; }
a.ask-file:hover, button.ask-file:hover { border-color: var(--muted); }
button.ask-file { cursor: pointer; }
.ask-file.img { flex-direction: column; align-items: flex-start; padding: 4px; }
.ask-thumb { display: block; max-width: 160px; max-height: 96px; border-radius: 5px; background: var(--sunk); object-fit: contain; }

/* The messages of a dropped Teams chat to tick, in the New session form and the answer box (msg-pick-view.js). */
.mpick { border: 1px solid var(--line); border-radius: 10px; background: var(--bg); margin: 6px 0; }
.mpick > .tab-note { margin: 0; padding: 6px 10px; }
.mpick-bar { display: flex; align-items: center; gap: 6px; padding: 4px 10px; border-bottom: 1px solid var(--line); font-size: .8rem; }
.mpick .link { border: 0; background: none; padding: 0 2px; font: inherit; color: var(--accent); cursor: pointer; text-decoration: underline; }
.mpick-list { max-height: 220px; overflow: auto; }
.mpick-row { display: flex; gap: 8px; padding: 5px 10px; border-top: 1px solid var(--line); font-size: .84rem; cursor: pointer; }
.mpick-row:first-child { border-top: 0; }
.mpick-row input { margin-top: 3px; flex: none; }
.mpick-main { display: grid; gap: 1px; min-width: 0; }
.mpick-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); }
.mpick > .c-hint { margin: 0; padding: 4px 10px 6px; }

/* ---- Edit and Delete of an agent (agent-edit-view.js, home-agent-edit.js) and the mark of a
   folder that is gone. Edit sits before Setup and New session; the note and the question of
   Delete take the width of the row under its title. ---- */
.agent-row { grid-template-columns: auto minmax(8ch, 1fr) auto auto auto auto; }
.agent-row [data-edit-agent] { grid-column: 4; grid-row: 1 / span 2; }
.agent-row [data-caps-for] { grid-column: 5; }
.agent-row [data-new-for] { grid-column: 6; }
.agent-row .miss { margin-left: 6px; padding: 0 6px; border-radius: 99px; background: var(--bad-soft); color: var(--bad); font-weight: 600; }
.agent-row.gone b { color: var(--muted); text-decoration: line-through; text-decoration-color: var(--bad); }
.agent-row .gone-note, .agent-row .del-confirm { grid-column: 2 / -1; margin: 4px 0 2px; padding: 6px 8px; border: 1px solid var(--bad); border-radius: 8px; background: var(--bad-soft); color: var(--ink); font-size: .8rem; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; cursor: default; }
.agent-row .gone-note > span, .agent-row .del-confirm > p { flex: 1 1 100%; overflow-wrap: anywhere; }
.act.bad { color: var(--bad); border-color: var(--bad); }
.act.primary.bad { background: var(--bad); border-color: var(--bad); color: #fff; }
dialog.panel[data-kind="agent-edit"] { width: min(600px, calc(100vw - 2 * var(--gap))); height: fit-content; }
.agent-edit .np-f { margin-bottom: 8px; }
.agent-edit .np-f input[aria-invalid="true"] { border-color: var(--bad); }
.agent-edit fieldset.kinds { border: 0; padding: 0; min-width: 0; }
.agent-edit fieldset.kinds legend { padding: 0; margin-bottom: 2px; }
.agent-edit fieldset.kinds label { display: block; color: var(--ink); font-size: .85rem; margin: 2px 0; }
.agent-edit fieldset.kinds small { color: var(--muted); }
.agent-edit .edit-acts { align-items: center; margin-top: 6px; }
.agent-edit .edit-acts .grow { flex: 1 1 auto; }
.agent-edit .del-confirm { margin-top: 10px; padding: 8px 10px; border: 1px solid var(--bad); border-radius: 8px; background: var(--bad-soft); font-size: .85rem; }
.agent-edit .del-confirm p { margin-bottom: 8px; }

/* ---- two columns of the work list on a wide screen (wide-cols.js) ----
   The page lifts its width from about 2.000 px where the user keeps two columns on
   (html[data-two-cols], a preference of this browser). The list then splits its streams in
   two columns (.streams.two, one .s-col each) where it is wide enough that each column holds
   a whole row (about 770 px, the columns of .srow plus room for the title); narrower, the two
   columns stand one under the other, which is exactly the one column of before.
   The list is a container only inside the wide window: inline-size containment sizes an
   element without its content, so where a layout sizes the list by its content (the phone,
   with its Work and Agents tabs) the list would shrink to nothing. Two columns need a list of
   1.560 px, which no window below this one gives anyway. */
@media (min-width: 1980px) {
  html[data-two-cols="on"] .wrap { max-width: 2800px; }
  html[data-two-cols="on"] .page > main { container-type: inline-size; }
}
.streams.two > .s-col { display: contents; }
@container (min-width: 1560px) {
  .streams.two { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: var(--stack) 14px; align-items: start; }
  .streams.two > .s-col { display: flex; flex-direction: column; gap: var(--stack); min-width: 0; }
  .slims { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 4px 14px; }
}

/* ==== The session dialog on a phone (dialog-view.js phoneHeadHtml and the answer box with
   opts.narrow, the same max-width as cmd-model.js NARROW_QUERY): the conversation gets the
   screen. The head is the title in two lines at most, Confirm done, Details and Close, one
   line of chips and the tabs; Details opens the rest of the head. The answer box is a field
   that grows from one line and one row of controls. The desk does not change. ==== */
.d-head.phone { padding: 4px 4px 0 10px; }
.d-head.phone .d-title { gap: 4px; padding-bottom: 2px; align-items: flex-start; }
.d-head.phone h2 { font-size: .92rem; line-height: 1.3; padding-top: 4px; cursor: pointer; overflow-wrap: break-word; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow: hidden; }
.d-head.phone[data-details] h2 { display: block; -webkit-line-clamp: none; line-clamp: none; }
.d-head.phone .d-title .act { flex: none; min-height: 32px; min-width: 32px; padding: 3px 6px; }
.d-more-btn .ic { transition: transform .15s; }
.d-more-btn[aria-expanded="true"] .ic { transform: rotate(180deg); }
.d-head.phone .d-line { flex-wrap: nowrap; overflow: hidden; padding-bottom: 5px; }
.d-head.phone .d-line > * { flex: none; }
.d-head.phone .d-line .chip.agent, .d-head.phone .d-line .chip.grp { flex: 0 1 auto; min-width: 6ch; }
.d-head.phone .d-line .chip .t { min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.d-details { display: flex; flex-direction: column; gap: 6px; padding: 2px 6px 8px 0; }
.d-details .d-meta { padding-bottom: 0; }
.d-details .d-why { margin: 0; }
.d-acts { display: flex; gap: 6px; flex-wrap: wrap; }
.d-acts .act.io-phone .lbl { display: inline; }
.d-head.phone .d-tabs button { padding: 5px 9px; letter-spacing: .06em; }
@media (max-width: 559px) {
  .d-foot { padding: 5px 8px; }
  .composer { gap: 4px; }
  .composer textarea { field-sizing: content; min-height: var(--btn-h); max-height: 9.5em; resize: none; }
  /* One row while the controls fit; a second line where a running turn adds its own (the
     priority, Compact), never a row that pushes Send out of the screen. The status line
     stands above the controls, and Send stays the last control, at the right. */
  .composer .c-row { flex-wrap: wrap; gap: 4px; }
  .composer .c-row > * { flex: none; }
  .composer .c-row > .grow { flex: 1 1 0; }
  .composer .c-row select { flex: 0 1 auto; min-width: 0; max-width: 9.5em; }
  .composer .c-row .c-hint { flex: 1 1 100%; order: -1; min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
  .composer .c-row > [type="submit"] { margin-left: auto; }
}

/* "Show the whole message" under a message the read cut (dialog-view.js wholeOf). */
.msg-more { display: flex; margin-top: 2px; }

/* A hidden reply (dialog-view.js, kind thinking): what the session wrote in its thinking at the
   end of a turn and left out of its reply. Quiet, it is not the session's message: no box, a
   line at the left, small muted text; open at first, folded by its head. */
.msg-think { font-size: .84rem; color: var(--muted); border-left: 2px solid var(--line); padding: 1px 0 1px 10px; margin: 2px 0; min-width: 0; }
.msg-think > summary { cursor: pointer; font-size: .76rem; font-weight: 600; }
.msg-think[open] > summary { margin-bottom: 2px; }
.msg-think .md { overflow-wrap: anywhere; }

/* The chip "Show parked (n)" of the list head (home-view.js listHeadHtml): a toggle, drawn as
   the filter chips beside it; pressed, it reads "Hide parked" in the colour of a filter that is on. */
button.chip.pchip { cursor: pointer; background: none; min-height: 24px; font-size: .74rem; }
button.chip.pchip:hover { border-color: var(--accent); color: var(--ink); }
button.chip.pchip.on { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }

/* An agent row where the agents are a tab of their own (up to 899px): the title, the kind (with
   "folder missing"), the count and an "i". The "i" opens the description, the folder and the
   buttons the desk shows in the row; the note of a missing folder stays in the row. On the
   desk the "i" and its panel are not there. */
.agent-row .ag-i, .agent-row .ag-info { display: none; }
@media (max-width: 899px) {
  .agents .agent-row { grid-template-columns: minmax(8ch, 1fr) auto auto; padding-left: 12px; }
  .agent-row b, .agent-row .kind { grid-column: 1; }
  .agent-row .cnt { grid-column: 2; }
  .agent-row > .star, .agent-row > [data-edit-agent], .agent-row > [data-caps-for], .agent-row > [data-new-for],
  .agent-row > .desc, .agent-row.on > .desc { display: none; }
  .agent-row .ag-i { display: inline-flex; grid-column: 3; grid-row: 1 / span 2; min-width: var(--btn-sm); justify-content: center; }
  .agent-row .ag-i[aria-expanded="true"] { color: var(--accent); border-color: var(--accent); background: var(--accent-soft); }
  .agent-row .ag-info { display: block; grid-column: 1 / -1; margin: 6px 0 2px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--sunk); cursor: default; font-size: .82rem; }
  .agent-row .gone-note, .agent-row .del-confirm { grid-column: 1 / -1; }
  .ag-info p { margin: 0 0 6px; overflow-wrap: anywhere; }
  .ag-info .ag-desc.none { color: var(--muted); }
  .ag-info .ag-folder { display: flex; gap: 8px; align-items: baseline; color: var(--muted); font-size: .76rem; }
  .ag-info .ag-folder code { font-family: var(--f-mono); color: var(--ink); overflow-wrap: anywhere; }
  .ag-info .ag-acts { display: flex; flex-wrap: wrap; gap: 6px; }
  .ag-info .fav.on .ic { color: var(--warn); }
}
