/* The desk's design system (docs/desk-design.md, "Look"): direction A, calm. White cards on a light grey page, one
   indigo accent, a 16 px base, generous space. Tokens first; every component below takes its colours, sizes and
   spaces from them, and a new page uses the components, never colours or sizes of its own. No external font, no
   framework: the system's own font stack. */

/* ---------------------------------------------------------------------------------------------------------------
   Tokens. Colours for light, and for dark under prefers-color-scheme. Every text colour holds 4.5:1 against the
   surfaces it stands on (the test reads these values); --focus holds 3:1 against the page and the cards. */
:root {
  color-scheme: light dark;
  /* Type: the system's fonts; a 16 px base; six steps, and the page's title (smaller on a phone) */
  --font: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --fs-xs: 12px; --fs-sm: 14px; --fs-md: 16px; --fs-lg: 18px; --fs-xl: 22px; --fs-2xl: 30px; --fs-title: var(--fs-2xl);
  --lh: 1.55;
  /* Space: steps of four */
  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 24px; --s6: 32px; --s7: 48px;
  /* Corners: a mark's and the focus ring's, a small control's, a button's and a field's, a box's, a card's, a pill */
  --r-xs: 4px; --r-sm: 8px; --r-control: 10px; --r: 12px; --r-lg: 16px; --r-pill: 999px;
  /* Heights: what a finger taps, a small button with a mouse, a line's tiny act, a field, the page's header */
  --tap: 44px; --tap-sm: 36px; --h-xs: 28px; --h-field: 48px; --h-head: 60px; --h-head-sm: 52px;
  /* Widths: a page of text, a page with a side column, the browser */
  --w-page: 760px; --w-cols: 1120px; --w-wide: 1360px; --w-side: 340px;
  /* Layers, from the page up: a sticky bar, the page's header, a popover, the scrim, a drawer */
  --z-sticky: 4; --z-header: 5; --z-popover: 8; --z-scrim: 15; --z-drawer: 20;
}
/* Colour, for light; for dark under prefers-color-scheme, unless a page asks for light. A page (or a part of one) may
   ask for either by data-theme="light" or "dark" (no toggle yet); /design shows both side by side. */
:root, [data-theme="light"] {
  --bg: #f6f6f8; --surface: #ffffff; --surface-2: #f1f1f4; --border: #e4e4e9; --border-strong: #c9c9d2;
  --text: #17171c; --text-2: #55565f; --text-3: #6a6b74;
  --accent: #4f46e5; --accent-hover: #4338ca; --accent-soft: #eef0ff; --on-accent: #ffffff;
  --ok: #157037; --ok-soft: #e8f6ed; --warn: #8a4f06; --warn-soft: #fff5e0; --pending: #e0a100; --bad: #b4232a; --bad-soft: #fdecec;
  --neutral-soft: #ececf1; --focus: #4f46e5;
  /* The browser's picture stands on black, in both modes. */
  --screen: #000000;
  /* Elevation: a card's, a control's, a floating button's, a popover's, a drawer's; and the scrim behind a drawer, and
     behind an image opened large. */
  --shadow: 0 1px 2px rgba(20, 20, 40, .04), 0 2px 8px rgba(20, 20, 40, .04);
  --shadow-control: 0 1px 0 color-mix(in srgb, var(--text) 10%, transparent);
  --shadow-float: 0 2px 8px rgba(0, 0, 0, .12);
  --shadow-pop: 0 8px 24px color-mix(in srgb, var(--text) 18%, transparent);
  --shadow-drawer: 0 0 24px rgba(0, 0, 0, .25);
  --scrim: rgba(0, 0, 0, .4); --scrim-strong: rgba(0, 0, 0, .9);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0f0f13; --surface: #18181d; --surface-2: #202027; --border: #2b2b33; --border-strong: #464652;
    --text: #ededf2; --text-2: #b0b1bb; --text-3: #9a9ba5;
    --accent: #8f8bff; --accent-hover: #a29fff; --accent-soft: #24234b; --on-accent: #0f0f1f;
    --ok: #4ade80; --ok-soft: #12291b; --warn: #fbbf24; --warn-soft: #2c2310; --pending: #fbbf24; --bad: #f87171; --bad-soft: #321718;
    --neutral-soft: #2a2a33; --focus: #a29fff;
    --shadow: none; --shadow-control: 0 1px 0 color-mix(in srgb, var(--text) 10%, transparent);
    --shadow-float: 0 2px 8px rgba(0, 0, 0, .5); --shadow-pop: 0 8px 24px rgba(0, 0, 0, .5); --shadow-drawer: 0 0 24px rgba(0, 0, 0, .6);
  }
}
[data-theme="dark"] {
    --bg: #0f0f13; --surface: #18181d; --surface-2: #202027; --border: #2b2b33; --border-strong: #464652;
    --text: #ededf2; --text-2: #b0b1bb; --text-3: #9a9ba5;
    --accent: #8f8bff; --accent-hover: #a29fff; --accent-soft: #24234b; --on-accent: #0f0f1f;
    --ok: #4ade80; --ok-soft: #12291b; --warn: #fbbf24; --warn-soft: #2c2310; --pending: #fbbf24; --bad: #f87171; --bad-soft: #321718;
    --neutral-soft: #2a2a33; --focus: #a29fff;
    --shadow: none; --shadow-control: 0 1px 0 color-mix(in srgb, var(--text) 10%, transparent);
    --shadow-float: 0 2px 8px rgba(0, 0, 0, .5); --shadow-pop: 0 8px 24px rgba(0, 0, 0, .5); --shadow-drawer: 0 0 24px rgba(0, 0, 0, .6);
}
[data-theme="light"] { color-scheme: light; }
[data-theme="dark"] { color-scheme: dark; }
/* A part of a page in a theme of its own stands on its own ground. */
[data-theme]:not(:root) { background: var(--bg); color: var(--text); }

/* ---------------------------------------------------------------------------------------------------------------
   Base */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: var(--fs-md)/var(--lh) var(--font); }
h1, h2, h3 { letter-spacing: -.01em; line-height: 1.25; }
h1 { font-size: var(--fs-title); font-weight: 700; margin: var(--s2) 0 var(--s5); }
h2 { font-size: var(--fs-lg); font-weight: 650; margin: 0 0 var(--s2); }
h3 { font-size: var(--fs-md); font-weight: 650; margin: var(--s5) 0 var(--s1); }
p { margin: var(--s3) 0; }
p, li, label, dd { overflow-wrap: anywhere; }
a { color: var(--accent); text-underline-offset: 2px; }
a:hover { color: var(--accent-hover); }
a, button, input, select, textarea, summary { min-height: 24px; }
strong, b { font-weight: 650; }
/* Focus is always seen: a ring in the accent, outside the element, on everything that takes the keyboard. */
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: var(--r-xs); }
.muted { color: var(--text-2); }
.id { font-family: var(--mono); font-size: .9em; overflow-wrap: anywhere; }
.name { font-weight: 600; }
a.name { text-decoration: none; }
a.name:hover { text-decoration: underline; }
/* The sheet gives buttons a display, which would beat the browser's own rule for the hidden attribute. */
[hidden] { display: none !important; }
summary { cursor: pointer; color: var(--text-2); font-size: var(--fs-sm); font-weight: 600; }
summary:hover { color: var(--text); }
details { margin: var(--s2) 0; }
details > :not(summary) { font-size: var(--fs-sm); }
details p { margin: var(--s1) 0 0; }

/* ---------------------------------------------------------------------------------------------------------------
   Page header: the brand (a mark and the name), and Sign out as a quiet button. Sticky, white, one line. */
header.top { position: sticky; top: 0; z-index: var(--z-header); background: var(--surface); border-bottom: 1px solid var(--border); }
.top-in { display: flex; align-items: center; justify-content: space-between; gap: var(--s4); max-width: var(--w-cols);
  min-height: var(--h-head); margin: 0 auto; padding: 0 var(--s5); }
.brand { display: inline-flex; align-items: center; gap: var(--s2); min-height: var(--tap); color: var(--text); font-weight: 650;
  text-decoration: none; }
/* The brand's one mark (ui.brandMark), in the markup: "H" on the accent; the page header's a little larger than the
   sidebar's. */
.brand-mark { display: inline-flex; flex: none; align-items: center; justify-content: center; width: 24px; height: 24px;
  border-radius: var(--r-sm); background: var(--accent); color: var(--on-accent); font-size: var(--fs-sm); font-weight: 700; }
.brand > .brand-mark { width: 28px; height: 28px; }
a.brand:hover { color: var(--text); }
.signout { margin: 0; }
/* The way about, on every page (docs/decisions/0045): the organisation to switch to, Letters with the unread,
   Hotel for its owner, and the person's name, which leads to their account. */
.topnav { display: flex; flex-wrap: wrap; align-items: center; gap: 0 var(--s4); margin-left: auto; font-size: var(--fs-sm); }
.topnav > a { display: inline-flex; align-items: center; gap: var(--s2); min-height: var(--tap); color: var(--text-2); text-decoration: none; }
.topnav > a svg.icon { width: 16px; height: 16px; }
.topnav > a:hover { color: var(--accent); }
.topnav > a.me { color: var(--text); font-weight: 600; }
details.switch { position: relative; margin: 0; }
details.switch > summary { display: inline-flex; align-items: center; min-height: var(--tap-sm); padding: 0 var(--s3);
  border: 1px solid var(--border); border-radius: var(--r-sm); background: var(--surface-2); color: var(--text); list-style: none; }
details.switch > summary::-webkit-details-marker { display: none; }
details.switch > summary::after { content: ""; width: 6px; height: 6px; margin: 0 2px 3px var(--s2); border-right: 2px solid var(--text-2);
  border-bottom: 2px solid var(--text-2); transform: rotate(45deg); }
details.switch > ul { position: absolute; top: calc(100% + var(--s1)); left: 0; min-width: 220px; margin: 0; list-style: none;
  font-size: var(--fs-md); }
details.switch li a { display: flex; align-items: center; min-height: var(--tap); padding: 0 var(--s3); border-radius: var(--r-sm);
  color: var(--text); text-decoration: none; }
details.switch li a:hover, details.switch li a[aria-current] { background: var(--surface-2); }
/* An organisation in another hotel, written in by hotel-front as its switch form: a row as the links beside it. */
li > form.front-switch { margin: 0; }
li > form.front-switch > button { display: flex; align-items: center; justify-content: flex-start; width: 100%; min-height: var(--tap); padding: 0 var(--s3);
  border: 0; border-radius: var(--r-sm); background: none; font: inherit; color: var(--text); text-align: left; cursor: pointer; }
li > form.front-switch > button:hover { background: var(--surface-2); }

/* The page: one column of text, or a main column and a side column (.cols) on a computer. */
main { max-width: var(--w-page); margin: 0 auto; padding: var(--s6) var(--s5) var(--s7); }
main.cols { max-width: var(--w-cols); }
main.wide { max-width: var(--w-wide); padding-top: var(--s4); }
.grid { display: grid; grid-template-columns: minmax(0, 1fr) var(--w-side); gap: var(--s5); align-items: start; }
.col-main, .col-side { display: grid; gap: var(--s5); min-width: 0; align-content: start; }
.col-main > .card, .col-side > .card { margin: 0; }
/* Breadcrumbs above the title: where the page is, each linked but the last. */
.crumbs, .crumb { margin: 0; font-size: var(--fs-sm); color: var(--text-2); }
.crumbs a, .crumb a { display: inline-flex; align-items: center; min-height: var(--tap-sm); color: var(--text-2); }
.crumbs a:hover, .crumb a:hover { color: var(--accent); }
.crumbs > span { color: var(--text); font-weight: 550; }
.crumb a::before { content: "‹"; margin-right: 6px; font-size: 1.25em; line-height: 1; }
.crumbs + h1, .crumb + h1 { margin-top: var(--s1); }
/* The line under the title: who you are here, in one sentence. */
h1 + p.muted, .title-row + p.muted { margin-top: calc(-1 * var(--s4)); margin-bottom: var(--s5); }
/* A title with the menu of what the page is of (an organisation's Rename…), the menu just after the name. Its box
   opens from the title row's left edge, under it, so that a long name never pushes it off a phone's screen. */
.title-row { position: relative; display: flex; align-items: center; gap: var(--s2); margin: var(--s2) 0 var(--s5); }
.crumbs + .title-row { margin-top: var(--s1); }
.title-row > h1 { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.title-row > details.menu { position: static; flex: 0 0 auto; margin: 0; }
.title-row .menu-pop { right: auto; left: 0; top: 100%; }
footer { margin: var(--s6) 0 var(--s4); }

/* ---------------------------------------------------------------------------------------------------------------
   Card: what belongs together, in a white box. Its heading (h2), at most one line of explanation under it
   (p.muted), then the content. A card in a card (a team in an organisation) is a quiet inner box. */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); padding: var(--s5);
  margin: 0 0 var(--s5); box-shadow: var(--shadow); }
.card > :first-child { margin-top: 0; }
.card > h2:not(:first-child) { margin-top: var(--s6); }
.card > :last-child { margin-bottom: 0; }
.card > h2 + p.muted, .card > h2 a + p.muted { margin-top: 0; font-size: var(--fs-sm); max-width: 60ch; }
.card h2 a { color: var(--text); text-decoration: none; }
.card h2 a:hover { color: var(--accent); text-decoration: underline; }
.card .card { background: var(--surface); border-radius: var(--r); padding: var(--s4); margin: var(--s4) 0 0; box-shadow: none; }
.card .card h3 { margin: 0; display: flex; flex-wrap: wrap; align-items: baseline; gap: var(--s2); font-size: var(--fs-md); }
.card .card h3 a { color: var(--text); }
.card .card h3 .muted { font-weight: 400; font-size: var(--fs-sm); }
.card p.muted { font-size: var(--fs-sm); }

/* ---------------------------------------------------------------------------------------------------------------
   List rows: a name (bold, a link when it leads on), its status and its acts on the right; what belongs to the row
   (a line of detail, a fold, a sub-list) takes a line of its own under it. A line between rows, none after the last. */
ul.rows, ol.rows, ul.actions { list-style: none; padding: 0; margin: var(--s2) 0 0; }
ul.actions li { margin: 0 0 var(--s3); }
ul.rows > li, ol.rows > li { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s1) var(--s3);
  padding: var(--s3) 0; border-top: 1px solid var(--border); }
ul.rows > li:first-child, ol.rows > li:first-child { border-top: 0; }
ul.rows > li > :is(p, details, ul, div, h3, form:not(.inline)), ol.rows > li > :is(p, details, ul, div) { flex: 1 0 100%; margin: 0; }
ul.rows > li > p { font-size: var(--fs-sm); }
ul.rows > li > form.inline:first-of-type, ul.rows > li > .end { margin-left: auto; }
.end { display: inline-flex; flex-wrap: wrap; justify-content: flex-end; gap: var(--s2); }
/* A row headed by a name (a team's tool): the name at the text's size, what it is close under it. */
ul.rows h3 { font-size: var(--fs-md); margin: 0; }
ul.rows details p { margin: var(--s1) 0 0; }
/* A sub-list in a row (letters under a session, secrets under a tool): grey insets. */
ul.letters { list-style: none; display: grid; gap: var(--s1); margin: var(--s2) 0 0; padding: 0; }
ul.letters > li { padding: var(--s2) var(--s3); background: var(--surface-2); border-radius: var(--r-sm); font-size: var(--fs-sm); }
/* A secret's new value under its row: the label over the field, Save beside it. */
ul.letters > li form { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s2); margin-top: var(--s2); }
ul.letters > li form label { flex: 1 0 100%; margin: 0; font-size: var(--fs-sm); }
ul.letters > li form input:not([type=hidden]):not([type=radio]):not([type=checkbox]) { flex: 1 1 12em; width: auto; min-height: var(--tap); }
ul.letters > li form .row { margin: 0; }
/* A row of acts (links that lead to a wizard, buttons): side by side, wrapping. */
.row, p.acts { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s2) var(--s3); margin: var(--s4) 0 0; }
.card > .row:first-child, .card > p.acts:first-child { margin-top: 0; }

/* ---------------------------------------------------------------------------------------------------------------
   Buttons. Primary (filled, the one main act of a view); secondary (outlined: Back, Pause, Invite); danger
   (outlined in red: remove, delete, archive, leave, lock); ghost (no box: Cancel, Sign out). Small in lists.
   44 px high, 36 px for a small one with a mouse, 44 again on a touch screen. */
.button, button { display: inline-flex; align-items: center; justify-content: center; gap: var(--s2); min-height: var(--tap);
  padding: 0 var(--s4); border: 1px solid var(--accent); border-radius: var(--r-control); background: var(--accent); color: var(--on-accent);
  font: 600 var(--fs-md)/1.2 var(--font); text-decoration: none; cursor: pointer; white-space: nowrap;
  transition: background-color .12s ease, border-color .12s ease; }
.button:hover, button:hover { background: var(--accent-hover); border-color: var(--accent-hover); color: var(--on-accent); }
/* Secondary is one look: .secondary (ui.button, ui.linkButton); .quiet (a small button) and a.act (a small link to a
   wizard) are its aliases, kept until every page is built from the components. */
.button.secondary, button.secondary, button.quiet, a.act { background: var(--surface); color: var(--text);
  border-color: var(--border-strong); }
.button.secondary:hover, button.secondary:hover, button.quiet:hover, a.act:hover { background: var(--surface-2); color: var(--text);
  border-color: var(--border-strong); }
.button.danger, button.danger, a.act.danger { background: var(--surface); color: var(--bad);
  border-color: color-mix(in srgb, var(--bad) 45%, transparent); }
.button.danger:hover, button.danger:hover, a.act.danger:hover { background: var(--bad-soft); color: var(--bad);
  border-color: var(--bad); }
.button.ghost, button.ghost, .signout button { background: transparent; color: var(--text-2); border-color: transparent; }
.button.ghost:hover, button.ghost:hover, .signout button:hover { background: var(--surface-2); color: var(--text);
  border-color: transparent; }
/* Small: the acts in a list's row, and the links that lead to a wizard (a.act). */
button.quiet, a.act, .small { min-height: var(--tap-sm); padding: 0 var(--s3); border-radius: var(--r-sm); font-size: var(--fs-sm);
  display: inline-flex; align-items: center; text-decoration: none; border-width: 1px; border-style: solid; font-weight: 600; }
@media (pointer: coarse) { button.quiet, a.act, .small { min-height: var(--tap); } }
button:disabled { opacity: .45; cursor: default; }
form.inline { display: inline-flex; margin: 0; }
/* Icons (docs/decisions/0052): one set (Lucide), inline, in the text's colour. An icon button is a small square,
   36 px with a mouse and 44 px on a touch screen; its name is its aria-label and its tooltip. */
svg.icon { width: 20px; height: 20px; flex: 0 0 auto; }
.icon-button { min-width: var(--tap-sm); min-height: var(--tap-sm); padding: 0; justify-content: center; }
.icon-button svg.icon { width: 18px; height: 18px; }
@media (pointer: coarse) { .icon-button { min-width: var(--tap); min-height: var(--tap); } }
/* An icon button reads as a button, not a form control (the owner, 2026-11-13): a filled grey ground, a firm border,
   a small shadow and the text's colour for its glyph (4.5:1 on --surface-2 in both modes); the media glyphs are
   solid. The one primary icon button (Start where there is no session) keeps the accent. */
button.quiet.icon-button, a.act.icon-button, details.menu > summary.icon-button, .secondary.icon-button,
  .popover > summary.icon-button { background: var(--surface-2); color: var(--text);
  border: 1px solid var(--border-strong); border-radius: var(--r-control); box-shadow: var(--shadow-control); }
button.quiet.icon-button:hover, a.act.icon-button:hover, details.menu > summary.icon-button:hover, .secondary.icon-button:hover,
  .popover > summary.icon-button:hover, details.menu[open] > summary.icon-button, .popover[open] > summary.icon-button { background: var(--neutral-soft); color: var(--text); border-color: var(--text-3); }
.icon-button svg.icon.solid { width: 16px; height: 16px; }
/* A block's heading with its own acts beside it (PEOPLE's Invite…): on one line when they fit, else under it. */
.card > .block-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--s2) var(--s3);
  margin: 0 0 var(--s3); }
.card > .block-head > h2 { margin: 0; }
.card > .block-head > .acts { display: flex; flex-wrap: wrap; gap: var(--s2); }
/* A row's menu (docs/decisions/0052): one "⋯" at the row's end, a <details> that opens a small box of its acts under
   it; no script. The summary is an icon button (36 px, 44 on touch); each act a full-width line, a destructive one red. */
details.menu { position: relative; margin: 0 0 0 auto; }
ul.rows > li > details.menu { flex: 0 0 auto; margin-left: auto; }
/* A People row keeps its ⋯ on the name's line: a long name wraps within itself, the chips and the menu do not. */
ul.rows.people > li { flex-wrap: nowrap; }
ul.rows.people > li > .name { flex: 0 1 auto; min-width: 0; overflow-wrap: anywhere; }
ul.rows.people > li > .chip { flex: 0 0 auto; }
/* An organisation's sessions, for its admins: whose it is gives way first, then the place, so that the menu keeps its
   line and the place stays whole as long as it can. */
ul.rows.org-sessions > li { flex-wrap: nowrap; }
ul.rows.org-sessions > li > .name { flex: 0 0 auto; max-width: 60%; overflow-wrap: anywhere; }
ul.rows.org-sessions > li > .owner { flex: 0 1 auto; min-width: 0; overflow-wrap: anywhere; }
/* An organisation's invitations (docs/decisions/0055): the address gives way, so that its state and menu keep its line. */
ul.rows.invites > li > .name { flex: 1 1 8em; min-width: 0; overflow-wrap: anywhere; }
details.menu > summary { display: inline-flex; align-items: center; list-style: none; cursor: pointer;
  border: 1px solid var(--border-strong); border-radius: var(--r-sm); background: var(--surface); color: var(--text); }
details.menu > summary::-webkit-details-marker { display: none; }
details.menu > summary:hover, details.menu[open] > summary { background: var(--surface-2); }
.menu-pop { position: absolute; right: 0; top: calc(100% + var(--s1)); min-width: 15em; max-width: min(22em, 80vw); }
/* The popover (ui.popover, ui.menu): one box for every <details> popover of the desk, under its summary (or over it,
   at the foot of the sidebar), no script. The row's menu, the organisation switch, the person's menu, the quick
   switcher and the phone's menu are its aliases, each placed where it opens. */
.popover { position: relative; margin: 0; }
.popover > summary { display: inline-flex; align-items: center; list-style: none; cursor: pointer; }
.popover > summary::-webkit-details-marker { display: none; }
.popover-pop { position: absolute; left: 0; top: calc(100% + var(--s1)); min-width: 15em; max-width: min(22em, 80vw); }
.popover.end > .popover-pop { left: auto; right: 0; }
.popover-pop, .menu-pop, details.switch > ul, .account-menu, .code-switch > ul, .code-switch > p, .navmenu-in { z-index: var(--z-popover);
  padding: var(--s1); background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); box-shadow: var(--shadow-pop); }
/* A menu's line (ui.menuItem): the whole width, a destructive one red. */
.menu-item { display: flex; align-items: center; width: 100%; min-height: var(--tap-sm); padding: 0 var(--s3); border-radius: var(--r-sm);
  color: var(--text); font-size: var(--fs-sm); font-weight: 600; text-decoration: none; }
.menu-item:hover { background: var(--surface-2); color: var(--text); }
.menu-item.danger { color: var(--bad); }
.menu-item.danger:hover { background: var(--bad-soft); color: var(--bad); }
@media (pointer: coarse) { .menu-item { min-height: var(--tap); } }
ul.rows > li > div.end { flex: 0 1 auto; margin: 0 0 0 auto; align-items: center; }
ul.rows > li > div.end > details.menu { margin: 0; }
/* A one-click act in a menu (Restart, docs/decisions/0052) is a form whose button looks as the menu's links. */
.menu-pop form.inline { display: block; margin: 0; }
.menu-pop a.act, .menu-pop button.act { display: flex; width: 100%; justify-content: flex-start; border-color: transparent;
  background: transparent; color: var(--text); font-size: var(--fs-sm); white-space: normal; }
.menu-pop a.act:hover, .menu-pop button.act:hover { background: var(--surface-2); border-color: transparent; color: var(--text); }
.menu-pop a.act.danger { color: var(--bad); }
.menu-pop a.act.danger:hover { background: var(--bad-soft); }
.menu-pop p.id { margin: var(--s1) var(--s3) var(--s2); font-size: var(--fs-xs); color: var(--text-3); overflow-wrap: anywhere; }
/* A person's row: the name, "you" and the role as small chips. */
.chip { display: inline-flex; align-items: center; padding: 1px 8px; border: 1px solid var(--border); border-radius: var(--r-pill);
  background: var(--surface-2); color: var(--text-2); font-size: var(--fs-xs); font-weight: 600; line-height: 1.5; }
.chip.you { background: var(--accent-soft); border-color: transparent; color: var(--text-2); }
/* "Changes waiting": a short line under a running session's row, in the warning's colour, its mark a circle. */
/* A restart pending (docs/decisions/0105): a small yellow dot beside the session's state; its reason as a tooltip, as
   visually hidden text, and in a popover a tap opens. */
.restart-at { display: inline-flex; align-items: center; flex: 0 0 auto; }
.popover:has(> summary.restart-dot-at) { display: inline-block; vertical-align: middle; }
.restart-dot-at { display: inline-flex; align-items: center; justify-content: center; min-width: var(--h-xs); min-height: var(--h-xs); }
@media (pointer: coarse) { .restart-dot-at { min-width: var(--tap); min-height: var(--tap); } }
.restart-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--pending); box-shadow: 0 0 0 1px var(--warn); }
.restart-note { margin: 0; padding: var(--s2); font-size: var(--fs-sm); color: var(--text); }
/* A new place's setup: its steps under its row, each its name and its state's badge, one per line on a phone. */
ul.rows > li > ol.setup { display: flex; flex-wrap: wrap; gap: var(--s2) var(--s4); margin: var(--s2) 0 0; padding: 0; list-style: none;
  font-size: var(--fs-sm); color: var(--text-2); }
ol.setup > li.setup-step { display: inline-flex; align-items: center; gap: var(--s2); }

/* ---------------------------------------------------------------------------------------------------------------
   Status badges: always a word, and a shape of its own per state, so that colour is never the only signal.
   Running: a filled dot. Paused or stopped: a ring. Waiting or held: a square. Unknown: a dotted ring. Wrong,
   missing or expired: a diamond. */
.badge { display: inline-flex; align-items: center; gap: var(--s1); padding: 2px 9px 2px 7px; border: 1px solid transparent;
  border-radius: var(--r-pill); font-size: var(--fs-xs); font-weight: 600; line-height: 1.5; white-space: nowrap; }
.badge i { display: inline-block; width: 8px; height: 8px; flex: 0 0 auto; border-radius: 50%; background: currentColor; }
.badge.is-running { color: var(--ok); background: var(--ok-soft); }
.badge.is-stopped { color: var(--text-2); background: var(--neutral-soft); }
.badge.is-stopped i { background: transparent; border: 1.5px solid currentColor; }
.badge.is-held { color: var(--warn); background: var(--warn-soft); }
.badge.is-held i { border-radius: 1px; }
.badge.is-unknown { color: var(--text-2); background: transparent; border-color: var(--border-strong); }
.badge.is-unknown i { background: transparent; border: 2px dotted currentColor; }
.badge.is-bad { color: var(--bad); background: var(--bad-soft); }
.badge.is-bad i { border-radius: 1px; transform: rotate(45deg); }

/* ---------------------------------------------------------------------------------------------------------------
   Notices: a box with an icon and a sentence, at most one button. Success (.done, .is-ok), warning (.warn,
   .is-warn), error (.is-bad); .big for what may not be missed (an expired login, on top). An inline problem in a
   row or under a field (.note) is red text. */
.notice, .done, .warn { position: relative; margin: 0 0 var(--s5); padding: var(--s4) var(--s4) var(--s4) 48px;
  border-radius: var(--r); border: 1px solid transparent; font-size: var(--fs-sm); color: var(--text); }
.notice > :first-child, .warn > :first-child { margin-top: 0; }
.notice > :last-child, .warn > :last-child { margin-bottom: 0; }
.notice::before, .done::before, .warn::before { position: absolute; left: var(--s4); top: var(--s4); display: grid; place-items: center;
  width: 20px; height: 20px; border-radius: 50%; font: 700 var(--fs-xs)/1 var(--font); }
.done, .notice.is-ok { background: var(--ok-soft); border-color: color-mix(in srgb, var(--ok) 25%, transparent); }
/* A success's mark is a disc with a tick cut out of it (a mask, so that it takes the theme's colour; no font has to
   carry a tick). */
.done::before, .notice.is-ok::before { content: ""; background: var(--ok);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath fill-rule='evenodd' d='M10 0a10 10 0 1 1 0 20a10 10 0 0 1 0-20zM8.6 12.2 5.7 9.3 4.3 10.7l4.3 4.3 7.1-7.1-1.4-1.4z'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath fill-rule='evenodd' d='M10 0a10 10 0 1 1 0 20a10 10 0 0 1 0-20zM8.6 12.2 5.7 9.3 4.3 10.7l4.3 4.3 7.1-7.1-1.4-1.4z'/%3E%3C/svg%3E") center / contain no-repeat; }
.warn, .notice.is-warn { background: var(--warn-soft); border-color: color-mix(in srgb, var(--warn) 25%, transparent); }
.warn::before, .notice.is-warn::before { content: "!"; background: var(--warn); color: var(--surface); }
.notice.is-bad { background: var(--bad-soft); border-color: color-mix(in srgb, var(--bad) 25%, transparent); }
/* An error's mark is a diamond, a warning's a circle: the shape tells them apart, not the colour alone. */
.notice.is-bad::before { content: ""; width: 14px; height: 14px; margin: 3px; background: var(--bad); border-radius: 2px; transform: rotate(45deg); }
.notice.big { font-size: var(--fs-md); padding: var(--s5) var(--s5) var(--s5) 56px; }
.notice.big::before { left: var(--s5); top: calc(var(--s5) + 3px); }
.note { color: var(--bad); }
p.note { font-size: var(--fs-sm); }

/* Empty: says what the state is, in a quiet centred box; the act that fills it is next to it on the page. */
.empty { margin: var(--s2) 0 0; padding: var(--s5) var(--s3); border: 1px dotted var(--border-strong); border-radius: var(--r);
  text-align: center; color: var(--text-2); font-size: var(--fs-sm); }

/* A key and its value (a wizard's summary, a session's facts). */
dl { display: grid; grid-template-columns: minmax(0, 12em) minmax(0, 1fr); gap: var(--s2) var(--s4); margin: var(--s4) 0; }
dt { color: var(--text-2); font-size: var(--fs-sm); }
dd { margin: 0; }

/* ---------------------------------------------------------------------------------------------------------------
   Forms */
form label { display: block; margin: var(--s4) 0 var(--s1); font-weight: 600; }
form input:not([type=hidden]):not([type=radio]):not([type=checkbox]), form select, form textarea { width: 100%; min-height: var(--h-field);
  padding: 0 var(--s3); border: 1px solid var(--border-strong); border-radius: var(--r-control); background: var(--surface); color: var(--text);
  font: var(--fs-md) var(--font); }
form textarea { padding: var(--s3); line-height: var(--lh); }
form input:focus-visible, form select:focus-visible, form textarea:focus-visible { border-color: var(--accent);
  outline: 2px solid var(--focus); outline-offset: 1px; }
/* A choice is a plain list: each radio button or checkbox its own size (a 24 px target) before its label. */
form input[type=radio], form input[type=checkbox] { width: 24px; height: 24px; margin: 0; flex: 0 0 auto; accent-color: var(--accent); }
form ul.rows label { display: flex; align-items: center; gap: var(--s3); margin: 0; min-height: var(--tap); font-weight: 400; }
form.search { display: flex; flex-wrap: wrap; gap: var(--s2); align-items: center; }
form.search label { flex: 1 0 100%; margin: 0; }
form.search input { flex: 1 1 200px; width: auto !important; }

/* ---------------------------------------------------------------------------------------------------------------
   A wizard's step (docs/desk-design.md): one card; the step and a bar of progress; the question as the largest
   text; its example under it; the field; the problem under the field; Back and Next, side by side, and on a phone
   fixed to the bottom of the screen. */
.wizard { max-width: 640px; margin: 0 auto; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg);
  padding: var(--s6); box-shadow: var(--shadow); }
.progress { display: flex; gap: var(--s1); margin: 0 0 var(--s4); }
.progress span { flex: 1; height: 4px; border-radius: var(--r-pill); background: var(--neutral-soft); }
.progress span.on { background: var(--accent); }
.wizard .step-count { margin: 0 0 var(--s2); color: var(--text-2); font-size: var(--fs-xs); font-weight: 600; letter-spacing: .06em;
  text-transform: uppercase; }
.wizard h2, .question { margin: 0 0 var(--s2); font-size: var(--fs-xl); font-weight: 700; line-height: 1.3; }
.wizard h2 label { display: block; margin: 0; font-weight: inherit; }
.wizard .example, .wizard h2 + p.muted { margin: 0 0 var(--s4); font-size: var(--fs-sm); color: var(--text-2); }
.wizard p.note[role=alert] { margin: 0 0 var(--s4); padding: var(--s3) var(--s4); border-radius: var(--r); background: var(--bad-soft); }
.wizard .device-code { margin: 0 0 var(--s5); padding: var(--s4); font-family: var(--mono); font-size: var(--fs-2xl); font-weight: 700;
  letter-spacing: .12em; text-align: center; background: var(--surface-2); border-radius: var(--r); user-select: all; }
.wizard dl { padding: var(--s4); background: var(--surface-2); border-radius: var(--r); }
/* A device login's three steps on one page (docs/decisions/0057, the template of every login by a code): numbered, the current one in the accent, a done
   one a tick; each step's content stays in sight, so the code is never hidden. */
.login-steps { list-style: none; margin: var(--s5) 0 0; padding: 0; }
.login-step { display: flex; gap: var(--s4); padding: 0 0 var(--s5); }
.login-step > div { flex: 1; min-width: 0; }
.login-step h3 { margin: var(--s1) 0 var(--s2); font-size: var(--fs-lg); }
.login-step p { margin: 0 0 var(--s3); }
.login-step .device-code { margin: 0 0 var(--s3); }
.login-step .row { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s3); }
.login-num { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px;
  border-radius: 50%; border: 2px solid var(--border-strong); color: var(--text-2); font-weight: 700; font-size: var(--fs-sm); }
.login-step.is-current .login-num { border-color: var(--accent); background: var(--accent); color: var(--on-accent); }
.login-step.is-done .login-num { border-color: var(--ok); background: var(--ok-soft); font-size: 0; }
/* The tick is drawn, not a glyph: no font has to carry it. */
.login-step.is-done .login-num::after { content: ""; width: 6px; height: 12px; margin-top: -3px; border: solid var(--ok);
  border-width: 0 3px 3px 0; transform: rotate(45deg); }
.login-step.is-done h3 { color: var(--text-2); }
/* A person's setup on their invitation's page (docs/decisions/0007): each step a row of the list, its mark before its
   title with the row's gap, at every width (the title shrinks and wraps; the mark keeps its size). Its state is
   `data-state`, never a class: `done` is the success notice's, whose mark is placed over the box's padding. Waiting
   a ring, running the accent's ring, done a disc with a tick cut out, stopped the error's diamond. */
ol.steps > li > .step-mark { flex: 0 0 20px; width: 20px; height: 20px; box-sizing: border-box; border-radius: 50%;
  border: 2px solid var(--border-strong); }
ol.steps > li > .name { flex: 1 1 0; min-width: 0; }
ol.steps > li:is([data-state=running], [data-state=checking]) > .step-mark { border-color: var(--accent); }
ol.steps > li[data-state=waiting] > .step-mark { border-color: var(--warn); }
ol.steps > li[data-state=done] > .step-mark { border: 0; background: var(--ok);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath fill-rule='evenodd' d='M10 0a10 10 0 1 1 0 20a10 10 0 0 1 0-20zM8.6 12.2 5.7 9.3 4.3 10.7l4.3 4.3 7.1-7.1-1.4-1.4z'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath fill-rule='evenodd' d='M10 0a10 10 0 1 1 0 20a10 10 0 0 1 0-20zM8.6 12.2 5.7 9.3 4.3 10.7l4.3 4.3 7.1-7.1-1.4-1.4z'/%3E%3C/svg%3E") center / contain no-repeat; }
ol.steps > li[data-state=refused] > .step-mark { border: 0; border-radius: 2px; background: var(--bad);
  transform: rotate(45deg) scale(.7); }
.wizard-actions { display: flex; flex-wrap: nowrap; align-items: center; justify-content: space-between; gap: var(--s3);
  margin: var(--s6) 0 0; }
.wizard-actions > a { display: inline-flex; align-items: center; min-height: var(--tap); padding: 0 var(--s3); border-radius: var(--r-control);
  color: var(--text-2); font-weight: 600; text-decoration: none; }
.wizard-actions > a:hover { background: var(--surface-2); color: var(--text); }
.wizard-actions > button:last-child { margin-left: auto; min-width: 140px; }
.wizard-actions > button.quiet { min-height: var(--tap); font-size: var(--fs-md); padding: 0 var(--s4); }

/* ---------------------------------------------------------------------------------------------------------------
   The rig's view (docs/decisions/0017, 0019): the bar (tabs, address, the line that says what is true now) in one
   white box over the screen. The person always acts, so the screen always shows the crosshair. */
.rigbar { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg) var(--r-lg) 0 0; padding: 6px 6px 0; }
.rigbar > p { margin: 0; padding: 4px var(--s2); font-size: var(--fs-sm); }
.control { font-weight: 500; }
#tabnote:empty, #hint:empty { display: none; }
/* A finger dragged on the screen scrolls the rig's page (rig.js), so the desk's page does not pan under it; a pinch
   still zooms the desk's page. Outside the screen the page scrolls as any page. */
.screen { display: block; width: 100%; max-width: 1280px; border: 0; background: var(--screen); cursor: crosshair;
  touch-action: pinch-zoom; }
.screen:focus-visible { outline: 3px solid var(--focus); outline-offset: -3px; }
/* A phone types into a field of its own (0022): under the finger that tapped the picture, out of sight, and never
   in the way of a tap. 16 px, or the phone zooms the page when it is focused. */
.stage { position: relative; max-width: 1280px; border: 1px solid var(--border); border-top: 0; border-radius: 0 0 var(--r-lg) var(--r-lg);
  overflow: hidden; background: var(--screen); }
.keys { position: absolute; top: 0; left: 0; width: 1px; height: 1px; margin: 0; padding: 0; border: 0; opacity: 0;
  pointer-events: none; resize: none; overflow: hidden; font-size: var(--fs-md); color: transparent; background: transparent;
  caret-color: transparent; }
.rigbar, .stage + p, .help, .logins { max-width: 1280px; }
/* The rig's tabs (0021), a tight row: each tab is its name, its padlock and its close, in one quiet box and apart from
   each other; the row ends with a new tab and scrolls sideways when it is wider than the page (a phone). The tab
   shown is filled and bold; a locked one is told by its filled padlock alone, so that nothing in the row changes size
   or moves with a lock (0023); a long name is cut with an ellipsis. Every button is at least 44 px each way, to tap;
   the padlock is an image in the text's colour. */
.tabs { display: flex; align-items: center; gap: var(--s1); margin: 0; padding: 0 0 6px; overflow-x: auto; scrollbar-width: thin; }
.tabs .tabitem { display: flex; flex: 0 0 auto; align-items: center; gap: var(--s1); padding: 2px; border: 1px solid var(--border);
  border-radius: var(--r-control); background: var(--surface-2); }
.tabs .tabitem button { border: 0; border-radius: var(--r-sm); background: transparent; color: var(--text-2); font-size: var(--fs-sm); }
.tabs .tabitem button:hover { background: var(--neutral-soft); color: var(--text); }
.tabs .tab { display: block; min-width: 44px; max-width: 16em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tabs .tab[aria-current="true"] { background: var(--accent); color: var(--on-accent); font-weight: 600; }
.tabs .tab[aria-current="true"]:hover { background: var(--accent-hover); color: var(--on-accent); }
.tabs .padlock, .tabs .close, .tabs .newtab { justify-content: center; min-width: 44px; min-height: 44px; padding: 0 8px; }
.tabs .newtab { flex: 0 0 auto; border: 0; background: transparent; color: var(--text-2); font-size: 1.25rem; }
.tabs .newtab:hover { background: var(--surface-2); color: var(--text); }
.tabs .padlock.on { background: var(--accent); color: var(--on-accent); }
/* The padlock is drawn in the button's own colour, so it follows the theme. */
.tabs .padlock svg { width: 18px; height: 18px; }
.tabs button:disabled { opacity: 0.5; cursor: default; }
.tabs .muted { flex: 0 0 auto; font-size: var(--fs-sm); }
/* The picture is still the tab that was left, until the tab gone to gives its first frame. */
.screen.waiting { opacity: 0.4; }
/* The address row (0023): ← back, the address, Go, in one line down to a 375 px phone, on the bar's grey strip. The
   field gives way; the buttons keep 44 px to tap. */
form.address { display: flex; flex-wrap: nowrap; align-items: center; gap: var(--s2); margin: 0 -6px; padding: 6px;
  background: var(--surface-2); border-top: 1px solid var(--border); }
form.address input { flex: 1 1 auto; width: auto; min-width: 0; min-height: 44px; border-radius: var(--r-pill); font-family: var(--mono);
  font-size: var(--fs-md); }
form.address button { flex: 0 0 auto; justify-content: center; min-width: 44px; min-height: 44px; padding: 0 10px;
  background: transparent; border-color: transparent; color: var(--text-2); }
form.address button:hover { background: var(--neutral-soft); color: var(--text); border-color: transparent; }
form.address .go { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
form.address .go:hover { background: var(--accent-hover); color: var(--on-accent); }
form.address .nav { font-size: 1.25rem; }
/* The keyboard button (0023): on the picture's lower right corner, half seen, for a field the page was not told of.
   Only on a touch screen (the owner, 2026-11-11): with a mouse and a keyboard it is in the way. */
.kbd { display: none; position: absolute; right: 10px; bottom: 10px; justify-content: center; min-width: 44px;
  min-height: 44px; padding: 0 8px; opacity: 0.7; border-color: var(--border); border-radius: 50%; background: var(--surface);
  color: var(--text); font-size: 1.25rem; }
@media (hover: none) and (pointer: coarse) { .kbd { display: inline-flex; } }
.kbd:hover, .kbd:focus-visible { opacity: 1; background: var(--surface); color: var(--text); }
.stage + p { margin: var(--s2) 0 0; font-size: var(--fs-sm); }
.help { margin-top: var(--s4); padding: var(--s3) var(--s4); background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r); }
.help summary { padding: 6px 0; color: var(--text); font-size: var(--fs-md); }
.help ul { margin: var(--s2) 0 0; padding-left: 18px; color: var(--text-2); }
.help li { margin: 0 0 var(--s2); }

/* ---------------------------------------------------------------------------------------------------------------
   A phone: one column, 16 px from the edges, the title smaller; a wizard's Back and Next fixed to the bottom of
   the screen, equally wide; the browser's bar from edge to edge. */
/* A block of a scope's page (docs/decisions/0045): its tag (YOURS HERE, CONTENTS, PEOPLE, MANAGE and whose) over its
   heading. */
.card > .tag, details.fold > summary > .tag { display: block; margin: 0 0 var(--s1); font-size: var(--fs-xs); font-weight: 650; letter-spacing: .06em;
  color: var(--text-3); }
.card > .tag.role { color: var(--accent); }
.card > .tag + h2, details.fold > summary > .tag + h2 { margin-top: 0; }
/* A place's rows, indented under what they are of; the Browser last. On the organisation's page each team the viewer
   is in is a quiet box: its header the team's name and role, then "Team session", its projects and the Browser. */
ul.rows.places > li.in { padding-left: var(--s5); border-left: 2px solid var(--border); }
ul.rows.places > li .end { display: inline-flex; flex-wrap: wrap; gap: var(--s2); align-items: center; }
.team-block { border: 1px solid var(--border); border-radius: var(--r); padding: var(--s1) var(--s4); margin: var(--s4) 0 0; }
.team-block > ul.rows { margin: 0; }
/* A team card's header: the team's name and the viewer's role, no act; its rows follow. */
.team-block > .team-head { margin: var(--s3) 0 var(--s1); }

@media (max-width: 760px) {
  .top-in { padding: 0 var(--s4); min-height: 56px; flex-wrap: wrap; }
  .topnav { order: 3; flex: 1 0 100%; margin: 0; gap: 0 var(--s3); }
  ul.rows.places > li.in { padding-left: var(--s3); }
  main { padding: var(--s5) var(--s4) var(--s7); }
  :root { --fs-title: 26px; }
  h1 { margin-bottom: var(--s4); }
  .title-row { margin-bottom: var(--s4); }
  .grid { grid-template-columns: minmax(0, 1fr); gap: var(--s4); }
  .col-main, .col-side { gap: var(--s4); }
  .card { padding: var(--s4); border-radius: var(--r); margin-bottom: var(--s4); }
  .card .card { padding: var(--s3); }
  dl { grid-template-columns: minmax(0, 1fr); gap: 0; }
  dd { margin-bottom: var(--s3); }
  .wizard { padding: var(--s5) var(--s4) 0; border-radius: var(--r); }
  .wizard-actions { position: sticky; bottom: 0; z-index: var(--z-sticky); margin: var(--s6) calc(-1 * var(--s4)) 0; padding: var(--s3) var(--s4);
    background: var(--surface); border-top: 1px solid var(--border); border-radius: 0 0 var(--r) var(--r); }
  .wizard-actions > * { flex: 1 1 0; justify-content: center; }
  .wizard-actions > button:last-child { min-width: 0; }
  main.wide { padding: var(--s2) 0 var(--s5); }
  main.wide > :is(.crumb, .crumbs, h1) { padding: 0 var(--s4); }
  .rigbar, .stage { border-radius: 0; border-left: 0; border-right: 0; }
  .rigbar + p, .stage + p, .help, .logins { margin-left: var(--s4); margin-right: var(--s4); }
}

/* No motion for those who asked for none. */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}

/* ---------------------------------------------------------------------------------------------------------------
   Letters (docs/decisions/0053): a mail box. One compact row per letter, the whole row a link: unread's dot,
   From → To (each side's place in a quiet chip, the person before it when it is someone else), the time; under it
   the subject (bold while unread) and the state as a small word. A thread's replies indented under its first
   letter. An opened letter's text in a grey inset, its lines kept. */
.letters-list { list-style: none; margin: var(--s2) 0 0; padding: 0; }
.letters-list > li.letter { border-top: 1px solid var(--border); }
.letters-list > li.letter:first-child { border-top: 0; }
.letters-list > li.letter.reply { border-top: 0; padding-left: var(--s5); }
.letters-list > li.letter.reply > .letter-row { border-left: 2px solid var(--border); border-radius: 0 var(--r-sm) var(--r-sm) 0; }
a.letter-row { display: grid; grid-template-columns: var(--s3) minmax(0, 1fr) auto;
  grid-template-areas: "dot who at" ". subject state"; gap: var(--s1) var(--s3); align-items: baseline;
  min-height: var(--tap); padding: var(--s3) var(--s2); color: var(--text); text-decoration: none; border-radius: var(--r-sm); }
a.letter-row:hover { background: var(--surface-2); }
a.letter-row:hover .letter-subject { text-decoration: underline; }
a.letter-row[aria-current="page"] { background: var(--accent-soft); }
.letter-row > .dot, .letter-row > .unread-dot, .letter-row > .nodot { grid-area: dot; align-self: center; }
/* Unread (ui.unreadDot): the accent's dot; never a state's (a letter's .dot is its alias). */
.unread-dot, .letter-row > .dot, .letter-head .dot { display: inline-block; flex: none; width: 8px; height: 8px; border-radius: var(--r-pill);
  border: 0; background: var(--accent); }
.letter-head .dot, .letter-head .unread-dot { margin-right: var(--s2); vertical-align: middle; }
.letter-who { grid-area: who; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font-size: var(--fs-sm); color: var(--text-2); }
.letter-who .who-person { font-weight: 600; color: var(--text); }
.letter-who .place { padding: 0 var(--s1); border-radius: var(--r-sm); background: var(--surface-2); color: var(--text); }
a.letter-row[aria-current="page"] .place { background: var(--surface); }
.letter-who .arrow { color: var(--text-3); }
.letter-at { grid-area: at; white-space: nowrap; font-size: var(--fs-xs); color: var(--text-3); }
.letter-subject { grid-area: subject; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
li.letter.unread .letter-subject { font-weight: 650; }
.letter-row > .letter-at, .letter-row > .lstate { justify-self: end; }
.lstate { grid-area: state; white-space: nowrap; font-size: var(--fs-xs); color: var(--text-3); }
.lstate.is-delivered { color: var(--accent); }
/* Read by a screen reader, not seen: the word beside a mark that is only drawn (unread's dot, the arrow's "to"). */
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.letter-head { margin: 0; font-size: var(--fs-md); }
.letter-head .letter-who { white-space: normal; font-size: var(--fs-md); }
.letter-meta { margin: var(--s1) 0 0; font-size: var(--fs-sm); color: var(--text-2); }
.letter-meta .letter-at, .letter-meta .lstate { font-size: var(--fs-sm); }
.letter-text { margin: var(--s4) 0; padding: var(--s4); border-radius: var(--r); background: var(--surface-2);
  white-space: pre-wrap; overflow-wrap: anywhere; font-size: var(--fs-md); line-height: 1.6; }

@media (max-width: 760px) {
  .letters-list > li.letter.reply { padding-left: var(--s3); }
  a.letter-row { padding: var(--s3) var(--s1); grid-template-areas: "dot who who" ". subject subject" ". at state"; }
  .letter-row > .letter-at { justify-self: start; }
  .letter-who, .letter-subject { white-space: normal; }
}

/* The desk chat of a pi session (docs/decisions/0086), laid out as a chat (the owner, 2026-11-16, on the pattern of
   Claude Code's web view): pi's text plain on the page, the person's words in a soft bubble on the right, each tool
   call one quiet line that opens, a knock a small centred notice, newest at the bottom; the composer a rounded box. */
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0);
  white-space: nowrap; border: 0; }
.chat { display: flex; flex-direction: column; --chat-offset: 7rem; height: calc(100vh - var(--chat-offset)); height: calc(100dvh - var(--chat-offset));
  min-height: 22rem; }
.chat > * { flex: none; }
.chat > .chat-scroll { flex: 1 1 auto; min-height: 0; position: relative; display: flex; flex-direction: column; }
.chat-items { list-style: none; margin: 0; padding: var(--s2) var(--s1); display: flex; flex-direction: column; gap: var(--s3);
  flex: 1 1 auto; min-height: 0; overflow-y: auto; overflow-wrap: anywhere; overscroll-behavior: contain; }
.chat-down { position: absolute; left: 50%; bottom: var(--s2); transform: translateX(-50%); border-radius: var(--r-pill);
  background: var(--surface); color: var(--text); border: 1px solid var(--border-strong); box-shadow: var(--shadow-float); }
.chat-down[hidden] { display: none; }
.chat-down:hover { background: var(--surface-2); }
.chat-items li { margin: 0; }
.chat-items li p { margin: 0; white-space: pre-wrap; }
.chat-items .chat-user { align-self: flex-end; max-width: 80%; }
.chat-bubble { background: var(--surface-2); border-radius: var(--r-lg); padding: var(--s2) var(--s4); }
.chat-items .chat-agent { max-width: 100%; }
.chat-text { line-height: 1.6; }
.chat-who { display: block; font-size: var(--fs-xs); color: var(--text-3); margin-bottom: var(--s1); }
.chat-items .chat-notice { align-self: center; text-align: center; font-size: var(--fs-xs); color: var(--text-3); }
.chat-items .chat-notice p { padding: var(--s1) var(--s3); border-radius: var(--r-lg); background: var(--neutral-soft); color: var(--text-2); }
/* A queued message (decision 0086, amended 2026-11-17): dimmed until pi takes it up, its label and acts under it. */
.chat-items .is-queued .chat-bubble, .chat-items .chat-notice.is-queued > p:first-child { opacity: 0.6; }
.queued-line { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: var(--s2);
  font-size: var(--fs-xs); color: var(--text-3); }
.queued-why { font-style: italic; }
.chat-items .chat-notice .queued-line { justify-content: center; padding: 0; background: none; }
.chat-items .chat-error { color: var(--bad); font-size: var(--fs-sm); }
.chat-error-line::before { content: "\25C6"; margin-right: var(--s2); }
.chat-items details > summary { cursor: pointer; list-style: none; display: flex; flex-wrap: nowrap; align-items: baseline; gap: var(--s2);
  font-size: var(--fs-sm); color: var(--text-2); padding: var(--s1) 0; }
.chat-items details > summary::-webkit-details-marker { display: none; }
.chat-items details > summary::after { content: ""; width: 6px; height: 6px; border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor; transform: rotate(-45deg); align-self: center; transition: transform .15s; }
.chat-items details[open] > summary::after { transform: rotate(45deg); }
.chat-items details > summary:hover { color: var(--text); }
.tool-name { font-family: var(--mono); color: var(--text); }
.tool-sum { color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 40ch; min-width: 0; flex: 0 1 auto; }
.tool-name, .tool-failed, .tool-wait { flex: none; }
.tool-failed { color: var(--bad); }
.tool-wait { color: var(--text-3); }
.tool-body, .chat-group-in { margin: var(--s1) 0 var(--s2) var(--s3); padding-left: var(--s3); border-left: 2px solid var(--border); }
.chat-items .tool-head { font-size: var(--fs-xs); color: var(--text-3); margin-top: var(--s2); }
.chat-items pre { margin: var(--s1) 0 0; padding: var(--s2); background: var(--surface-2); border-radius: var(--r-sm); white-space: pre-wrap;
  font-family: var(--mono); font-size: var(--fs-xs); max-height: 40vh; overflow: auto; color: var(--text); }
.chat-state { min-height: 1.5em; margin: var(--s2) 0; font-size: var(--fs-sm); color: var(--text-2); }
.composer { display: flex; align-items: flex-start; gap: var(--s2); border: 1px solid var(--border-strong); border-radius: var(--r-lg);
  padding: var(--s2); background: var(--surface); }
/* The box's own focus ring gives way to the composer's border, as in Claude Code's composer: the caret shows where
   one types, and the border shows a keyboard user that the composer has the focus. The buttons keep their rings. */
.composer:focus-within { border-color: var(--focus); box-shadow: 0 0 0 1px var(--focus); }
.chat-send .composer textarea:focus-visible { outline: none; }
.chat-send .composer textarea { flex: 1; width: auto; border: 0; border-radius: var(--r-sm); background: transparent; resize: none; font: inherit;
  font-size: var(--fs-md); min-height: var(--tap-sm); max-height: 40vh; padding: calc((var(--tap-sm) - 1.5em) / 2) 0; line-height: 1.5; color: var(--text); }
.composer button.send { border-radius: var(--r-pill); flex: none; }
.chat-foot { display: flex; flex-wrap: nowrap; align-items: center; gap: var(--s3); margin: var(--s1) 0 0; font-size: var(--fs-xs); position: relative; }
.chat-foot > .chat-keys { flex: none; }
.chat-foot > [data-chat-sent] { flex: 1 1 auto; min-width: 0; }
/* The context and the seat's budget in the footer (docs/decisions/0085, amended): a small chip of its numbers, which opens
   the Chat section's right side, or on a session's own page the bars under the footer, in the flow. */
.chat-foot > .usage-chip { flex: none; min-height: 0; padding: 0 var(--s2); border: 1px solid var(--border); border-radius: var(--r-pill);
  background: none; color: var(--text-2); font: inherit; font-size: var(--fs-xs); line-height: 1.6; cursor: pointer; white-space: nowrap; }
.chat-foot > .usage-chip:hover { color: var(--text); border-color: var(--border-strong); }
/* "Queued" for a message sent while the agent works, until its queued bubble shows it: the usage chip's small look. */
.chat-foot > .queued-note { flex: none; padding: 0 var(--s2); border: 1px solid var(--border); border-radius: var(--r-pill);
  color: var(--text-2); font-size: var(--fs-xs); line-height: 1.6; white-space: nowrap; }
.usage-chip.hot { color: var(--bad); border-color: var(--bad); }
@media (pointer: coarse) { .chat-foot > .usage-chip { min-height: var(--tap-sm); } }
/* With nothing to say, the state of a send takes no room, nor its gap. */
.chat-foot > [data-chat-sent]:empty { display: none; }
.usage-inline { margin-top: var(--s3); padding: var(--s3); border: 1px solid var(--border); border-radius: var(--r); font-size: var(--fs-sm); }
/* The usage as bars, as Claude Code's "Plan usage limits": a label and its percent over a thin bar, and one quiet line
   under it; 90 % or more in the warning's colour. One scale of type: the side's own size, and the notes' smaller one. */
.usage-row { margin: 0 0 var(--s3); }
.usage-head { display: flex; justify-content: space-between; gap: var(--s2); margin: 0 0 var(--s1); }
.usage-label { font-weight: 600; }
.usage-value { font-variant-numeric: tabular-nums; color: var(--text-2); }
.usage-row progress { display: block; width: 100%; height: 6px; appearance: none; border: 0; border-radius: var(--r-pill);
  background: var(--surface-2); accent-color: var(--accent); overflow: hidden; }
.usage-row progress::-webkit-progress-bar { background: var(--surface-2); border-radius: var(--r-pill); }
.usage-row progress::-webkit-progress-value { background: var(--accent); border-radius: var(--r-pill); }
.usage-row progress::-moz-progress-bar { background: var(--accent); border-radius: var(--r-pill); }
.usage-row.hot progress { accent-color: var(--bad); }
.usage-row.hot progress::-webkit-progress-value { background: var(--bad); }
.usage-row.hot progress::-moz-progress-bar { background: var(--bad); }
.usage-row.hot .usage-value { color: var(--bad); font-weight: 600; }
/* Over 80 %, in the warning's yellow (the Fleet view's bars, docs/decisions/0102; `usageBar` in desk/ui.mjs). The
   numbers in words beside the bar say it too: the colour is never the only signal. */
.usage-row.warm progress { accent-color: var(--warn); }
.usage-row.warm progress::-webkit-progress-value { background: var(--warn); }
.usage-row.warm progress::-moz-progress-bar { background: var(--warn); }
.usage-row.warm .usage-value { color: var(--warn); font-weight: 600; }
.usage-note { margin: var(--s1) 0 0; font-size: var(--fs-xs); color: var(--text-2); }
.usage-models { list-style: none; margin: var(--s1) 0 0; padding: 0; font-size: var(--fs-xs); color: var(--text-2); }
.chat-foot > .model-line { flex: 0 1 auto; min-width: 0; margin: 0 0 0 auto; display: flex; align-items: center; gap: var(--s1); white-space: nowrap; }
/* Only the model's words shrink and end in "…"; Change… and Restart keep their size. */
.model-line.compact .model-text { min-width: 0; overflow: hidden; text-overflow: ellipsis; display: flex; align-items: center; }
/* The model's name is the way to change it (the owner, 2026-11-16): "Kimi K3.1 Pro ▾", its name may end in "…" on a
   narrow line, never its ▾; a clear hover and focus. */
.model-pick { display: inline-flex; align-items: center; gap: 2px; min-width: 0; max-width: 100%; padding: 0 var(--s1); border-radius: var(--r-sm); color: var(--text); text-decoration: none; }
.model-pick > b { min-width: 3ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.model-pick > .caret { flex: none; display: inline-flex; color: var(--text-2); }
.model-pick > .caret svg.icon { width: 14px; height: 14px; }
.model-pick:hover { background: var(--surface-2); color: var(--accent); }
.model-pick:hover > .caret { color: var(--accent); }
.model-pick:focus-visible { outline: 2px solid var(--focus); outline-offset: 1px; }
/* The model that runs has the room first: the next restart's words shrink, to nothing if they must, before its name. */
.model-line.compact [data-model-next] { flex: 0 1000 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.model-line.compact .model-pick { flex: none; }
/* In the right side, two lines: the model that runs, and under it, muted, the one of the next restart. */
.model-line.compact.stacked .model-text { flex-direction: column; align-items: flex-start; gap: 2px; overflow: visible; }
.model-line.compact.stacked .model-next { color: var(--text-2); font-size: var(--fs-xs); max-width: 100%; }
/* There, its name's hover area lines up with the words under it (the column has the room). */
.model-line.compact.stacked .model-pick { margin-left: calc(var(--s1) * -1); }
.model-line.compact.stacked .model-next[hidden] { display: none; }
.model-line.compact .model-acts { flex: none; display: inline-flex; align-items: center; gap: var(--s1); }
.model-line.compact .model-acts > span[hidden] { display: none; }
.model-line a.act.link { display: inline; min-height: 0; padding: 0; border: 0; background: none; color: var(--accent); font: inherit;
  text-decoration: underline; text-underline-offset: 2px; }
@media (pointer: coarse) { .chat-keys { display: none; } }
.model-line { margin-top: var(--s1); font-size: var(--fs-xs); }
.model-line .act, .model-line button { min-height: var(--h-xs); padding: 0 var(--s2); font-size: var(--fs-xs); }
@media (pointer: coarse) { .model-line .act, .model-line button { min-height: var(--tap); } }
.chat-foot { margin-top: var(--s1); }
.model-line form.inline { display: inline; }

/* The chat as an app of its own at /code (the owner, 2026-11-16 and 2026-11-17, as Claude Code's app): the window's
   height, in one row: the sidebar, the chat, this session; no header of the desk. Either side folds away by
   /chat.js (kept per viewer) and leaves no strip, only its button, at the edge of the chat's header. */
.code-body { overflow: hidden; }
.code { display: flex; height: 100vh; height: 100dvh; }
.code .chat-list { flex: none; width: 16rem; display: flex; flex-direction: column; min-height: 0; padding: var(--s3);
  background: var(--surface-2); border-right: 1px solid var(--border); font-size: var(--fs-sm); }
.side-head { display: flex; align-items: center; justify-content: space-between; gap: var(--s2); min-height: var(--tap); margin: 0 0 var(--s2); }
.code-brand { display: inline-flex; align-items: center; gap: var(--s2); padding: 0 var(--s1); font-size: var(--fs-md); font-weight: 650;
  color: var(--text); text-decoration: none; }
.side-new, .side-nav a, .recents a { display: flex; align-items: center; gap: var(--s2); min-height: var(--tap-sm); padding: 0 var(--s2);
  border-radius: var(--r-sm); color: var(--text); text-decoration: none; }
.side-new:hover, .side-nav a:hover, .recents a:hover { background: var(--neutral-soft); }
.side-new { font-weight: 600; }
.side-new svg.icon, .side-nav svg.icon { width: 16px; height: 16px; color: var(--text-2); }
.side-nav, .recents ul { list-style: none; margin: 0; padding: 0; }
.side-label { margin: var(--s4) var(--s2) var(--s1); font-size: var(--fs-xs); font-weight: 600; color: var(--text-3); }
.recents { flex: 1 1 auto; min-height: 0; overflow-y: auto; }
.recents a[aria-current="page"] { background: var(--surface); font-weight: 600; box-shadow: var(--shadow); }
.recents .name { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.recents .state { flex: none; font-size: var(--fs-xs); color: var(--text-3); }
.code-switch .state { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.recents p { padding: 0 var(--s2); }
/* A session's state as a dot (ui.statusDot; the Recents' .dot its alias), the shape still its tone's (a ring for stopped,
   a square while held, a diamond when wrong), its word beside it. Never unread's. */
.status-dot, .recents .dot, .code-switch .dot { display: inline-block; flex: none; width: 8px; height: 8px; border-radius: var(--r-pill);
  background: var(--text-3); }
:is(.status-dot, .dot).is-running { background: var(--ok); }
:is(.status-dot, .dot).is-stopped { background: none; border: 2px solid var(--text-3); }
:is(.status-dot, .dot).is-held { background: var(--warn); border-radius: 2px; }
:is(.status-dot, .dot).is-unknown { background: none; border: 2px dotted var(--text-3); }
:is(.status-dot, .dot).is-bad { background: var(--bad); border-radius: 1px; transform: rotate(45deg); }
/* The person's menu at the sidebar's foot: their name and the organisation, opening upwards. */
.account { position: relative; margin: var(--s2) 0 0; padding-top: var(--s2); border-top: 1px solid var(--border); }
.account > summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: var(--s1); min-height: var(--tap);
  padding: 0 var(--s2); border-radius: var(--r-sm); color: var(--text); }
.account > summary::-webkit-details-marker { display: none; }
.account > summary:hover, .account[open] > summary { background: var(--neutral-soft); }
.account-name { font-weight: 600; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account-org { flex: 0 1 auto; min-width: 0; color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account > summary svg.icon, .code-switch > summary svg.icon { flex: none; width: 14px; height: 14px; margin-left: auto; color: var(--text-2); }
.account-menu { position: absolute; left: 0; right: 0; bottom: calc(100% + var(--s1)); }
.account-menu ul { list-style: none; margin: 0; padding: 0; }
.account-menu ul + ul, .account-menu ul + form { border-top: 1px solid var(--border); margin-top: var(--s1); padding-top: var(--s1); }
.account-menu a { display: flex; align-items: center; gap: var(--s2); min-height: var(--tap-sm); padding: 0 var(--s3); border-radius: var(--r-sm);
  color: var(--text); text-decoration: none; }
.account-menu a svg.icon { width: 16px; height: 16px; color: var(--text-2); }
.account-menu a:hover, .account-menu a[aria-current="page"] { background: var(--surface-2); }
.account-menu form { margin: 0; }
.account-menu form button { width: 100%; justify-content: flex-start; min-height: var(--tap-sm); padding: 0 var(--s3); font: inherit; color: var(--text); }
/* Beside the sidebar a frame: a slim header across it to the window's right edge, over this session's pane too, so
   that this session's toggle at its right end stays where it is whether the pane shows or is folded (the owner,
   2026-11-17, as Claude Code's app); under it a row, the conversation and the pane, which take the rest of the
   window's height. */
.code-frame { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; min-height: 0; }
.code-row { flex: 1 1 auto; display: flex; min-height: 0; }
.code .chat-main { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; min-height: 0; padding: var(--s3) var(--s5); }
.code-head { flex: none; display: flex; flex-wrap: nowrap; align-items: center; gap: var(--s2); min-height: var(--h-head-sm);
  padding: 0 var(--s3); border-bottom: 1px solid var(--border); }
.code-head .icon-button { border: 0; background: none; box-shadow: none; color: var(--text-2); }
.code-head .icon-button:hover { background: var(--surface-2); color: var(--text); }
.head-end { margin-left: auto; display: inline-flex; }
.code-switch { position: relative; min-width: 0; }
.code-switch > summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: var(--s1); min-height: var(--tap-sm);
  padding: 0 var(--s2); border-radius: var(--r-sm); font-weight: 600; color: var(--text); }
.code-switch > summary::-webkit-details-marker { display: none; }
.code-switch > summary:hover, .code-switch[open] > summary { background: var(--surface-2); }
.code-switch > summary .name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.code-switch > summary svg.icon { margin-left: 0; }
.code-switch > ul, .code-switch > p { position: absolute; top: calc(100% + var(--s1)); left: 0; width: max-content;
  min-width: 16rem; max-width: min(24rem, calc(100vw - 2 * var(--s4))); max-height: 60vh; overflow-y: auto; margin: 0;
  list-style: none; font-size: var(--fs-sm); }
.code-switch a { display: flex; align-items: center; gap: var(--s2); min-height: var(--tap-sm); padding: 0 var(--s3); border-radius: var(--r-sm);
  color: var(--text); text-decoration: none; }
.code-switch a:hover, .code-switch a[aria-current="page"] { background: var(--surface-2); }
.code-switch .name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.code .notice { flex: none; }
.code .chat-main > .chat-card { flex: 1 1 auto; display: flex; flex-direction: column; min-height: 0; width: 100%; max-width: 52rem;
  margin: 0 auto; padding: 0; border: 0; background: none; box-shadow: none; }
.code .chat { flex: 1 1 auto; height: auto; min-height: 0; }
.code-empty { width: 100%; max-width: 52rem; margin: var(--s6) auto 0; }
/* This session on the right; its Restart there, not again in the footer, while it shows. */
.code .chat-context { flex: none; width: 19rem; padding: var(--s3) var(--s4); background: var(--surface); border-left: 1px solid var(--border); }
.pane-head { display: flex; align-items: center; justify-content: space-between; gap: var(--s2); min-height: var(--tap-sm); margin: 0 0 var(--s2);
  font-size: var(--fs-xs); font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--text-2); }
.side-head .pane-toggle, .drawer-close, .drawer-x { border: 0; background: none; box-shadow: none; color: var(--text-2); }
.side-head .pane-toggle:hover, .drawer-close:hover, .drawer-x:hover { background: var(--neutral-soft); color: var(--text); }
/* A side's toggle (the owner, 2026-11-17, as Claude Code's): highlighted, a soft filled ground, while its side shows. */
.pane-toggle[aria-pressed="true"] { background: var(--neutral-soft); color: var(--text); }
.side-head .code-brand { margin-right: auto; }
.drawer-close, .code-scrim { display: none; }
@media (min-width: 761px) {
  .code.left-closed .chat-list { display: none; }
  .code.right-closed .chat-context { display: none; }
  .code.has-chat:not(.right-closed) .chat-foot .model-acts > [data-model-restart] { display: none; }
}
.chat-context { overflow-y: auto; font-size: var(--fs-sm); }
.chat-context h3 { margin: 0 0 var(--s2); font-size: var(--fs-sm); font-weight: 600; }
.chat-context .ctx-part { padding: var(--s3) 0; border-top: 1px solid var(--border); }
.chat-context .ctx-part:first-of-type { border-top: 0; padding-top: 0; }
.chat-context .model-line { margin: 0 0 var(--s2); font-size: var(--fs-sm); color: var(--text); }
/* A section's one value (Agent's name with its Change…), as the environment's model is set. */
.ctx-value { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s2); margin: 0; }
.ctx-facts { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: var(--s1) var(--s3); margin: 0; }
.ctx-facts dt { color: var(--text-2); align-self: center; }
.ctx-facts dd { margin: 0; display: flex; flex-wrap: wrap; align-items: center; gap: var(--s2); }
.ctx-jobs { list-style: none; margin: 0 0 var(--s2); padding: 0; display: flex; flex-direction: column; gap: var(--s2); }
.ctx-jobs a { font-weight: 600; }
.ctx-jobs .usage-note { display: block; margin: 0; }
/* The session's subagents while they run (docs/decisions/0089): each its agent with its Stop, its task, its numbers. */
.ctx-subagents { list-style: none; margin: 0 0 var(--s2); padding: 0; display: flex; flex-direction: column; gap: var(--s2); }
.ctx-subagents p { margin: 0; }
.ctx-subagents .subagent-head { display: flex; justify-content: space-between; align-items: center; gap: var(--s2); }
.ctx-subagents .subagent-task { overflow-wrap: anywhere; }
/* A narrower desktop: the sides narrower, so that the chat keeps its room; the footer's hint left out while a restart
   is pending, so that the model's name and Restart fit. */
@media (max-width: 1200px) {
  .code .chat-foot:has([data-model-next]:not([hidden])) .chat-keys { display: none; }
  .code .chat-list { width: 13rem; }
  .code .chat-context { width: 16rem; }
  .code .chat-main { padding: var(--s3) var(--s4); }
}
/* /code on a phone: the chat takes the screen, 16 px gutters; the sidebar and this session are drawers over it, from
   the left and the right, opened from the chat's header (this session from the usage chip too), one at a time; what
   lies behind is dimmed, and a tap on it closes the drawer. A side folded on a desktop is still a drawer here. */
@media (max-width: 760px) {
  .code .chat-list, .code .chat-context { position: fixed; z-index: var(--z-drawer); top: 0; bottom: 0; width: min(20rem, 86vw); display: flex;
    flex-direction: column; overflow-y: auto; visibility: hidden; transition: transform .2s ease, visibility .2s; }
  .code .chat-list { left: 0; transform: translateX(-100%); }
  .code .chat-context { right: 0; transform: translateX(100%); display: block; }
  .code.list-open .chat-list, .code.context-open .chat-context { transform: none; visibility: visible; box-shadow: var(--shadow-drawer); }
  .code.context-open .chat-foot .model-acts > [data-model-restart] { display: none; }
  .code-scrim { display: block; position: fixed; inset: 0; z-index: var(--z-scrim); width: 100%; height: 100%; min-height: 0; padding: 0; border: 0;
    border-radius: 0; background: var(--scrim); }
  .drawer-close { display: inline-flex; }
  .code .chat-main { padding: var(--s2) var(--s4); }
  .code-head { flex-wrap: nowrap; min-height: 48px; gap: var(--s1); padding: 0 var(--s4); border-bottom: 0; }
  .code .chat { min-height: 12rem; }
}
@media (pointer: coarse) {
  .side-new, .side-nav a, .recents a, .account-menu a, .account-menu form button, .code-switch > summary, .code-switch a { min-height: var(--tap); }
  .code-head .icon-button, .side-head .pane-toggle, .drawer-close { min-width: var(--tap); min-height: var(--tap); }
}
@media (max-width: 760px) and (prefers-reduced-motion: reduce) {
  .code .chat-list, .code .chat-context { transition: none; }
}

/* pi's text as Markdown in the chat: plain elements, the page's own type and colours. */
.chat-items .md > * + * { margin-top: var(--s2); }
.chat-items .md p { white-space: normal; }
.chat-items .md .md-h { margin: var(--s3) 0 0; font-size: var(--fs-md); line-height: 1.4; }
.chat-items .md h3.md-h { font-size: var(--fs-lg); }
.chat-items .md ul, .chat-items .md ol { margin: 0; padding-left: var(--s5); }
.chat-items .md li + li { margin-top: var(--s1); }
.chat-items .md li > p { margin: 0; }
.chat-items .md code { font-family: var(--mono); font-size: .9em; background: var(--surface-2); border-radius: var(--r-sm); padding: 0 var(--s1); }
.chat-items .md pre code { background: none; padding: 0; font-size: inherit; }
.chat-items .md blockquote { margin: 0; padding-left: var(--s3); border-left: 3px solid var(--border-strong); color: var(--text-2); }
.chat-items .md hr { border: 0; border-top: 1px solid var(--border); margin: var(--s3) 0; }
.chat-items .md a { color: var(--accent); overflow-wrap: anywhere; }
.chat-items .md .md-table { overflow-x: auto; }
.chat-items .md table { border-collapse: collapse; font-size: var(--fs-sm); }
.chat-items .md th, .chat-items .md td { border: 1px solid var(--border); padding: var(--s1) var(--s2); text-align: left; vertical-align: top; }
.chat-items .md th { background: var(--surface-2); }

/* Images to send in the chat: small previews over the composer, each with its Remove. */
.chat-previews { list-style: none; margin: 0 0 var(--s2); padding: 0; display: flex; flex-wrap: wrap; gap: var(--s2); }
.chat-previews[hidden] { display: none; }
.chat-previews li { position: relative; }
.chat-previews img { display: block; height: 96px; width: auto; max-width: 192px; object-fit: cover; border-radius: var(--r); border: 1px solid var(--border); }
/* A message's own images in its bubble, sent from this page: the same thumbnails. */
.chat-items .chat-user { display: flex; flex-direction: column; align-items: flex-end; gap: var(--s1); }
.chat-thumbs { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: var(--s2); }
.chat-thumbs img { display: block; height: 96px; width: auto; max-width: 192px; object-fit: cover; border-radius: var(--r); border: 1px solid var(--border); }
/* Every image of the chat opens large (the lightbox, /chat.js): a thumbnail says so; one of the history while it is
   fetched holds its place, and one the session no longer has says so in its place. */
.chat-thumbs img, .chat-previews img { cursor: zoom-in; }
.chat-thumbs img.is-loading { width: 96px; background: var(--surface-2); }
.chat-thumbs .is-gone { display: inline-flex; align-items: center; height: 96px; padding: 0 var(--s3); border: 1px solid var(--border-strong);
  border-radius: var(--r); color: var(--text-2); font-size: var(--fs-sm); }
.tool-body .chat-thumbs { justify-content: flex-start; margin-top: var(--s2); }
/* The lightbox: the whole window, the page dimmed behind; its bar of Fit, 100%, zoom, Open original and Close on top,
   the image under it, fitted to the view at first, centred, scrolled when it is larger. */
.lightbox { position: fixed; inset: 0; width: 100vw; height: 100vh; height: 100dvh; max-width: none; max-height: none; margin: 0; padding: 0;
  border: 0; background: transparent; color: var(--text); flex-direction: column; overflow: hidden; }
.lightbox[open] { display: flex; }
.lightbox::backdrop { background: var(--scrim-strong); }
.lb-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: var(--s2); padding: var(--s2) var(--s3);
  background: var(--surface); border-bottom: 1px solid var(--border); }
.lb-bar button, .lb-bar a { min-height: var(--tap-sm); min-width: var(--tap-sm); padding: 0 var(--s3); display: inline-flex; align-items: center;
  justify-content: center; font-size: var(--fs-sm); }
.lb-bar button[aria-pressed="true"] { background: var(--accent-soft); }
.lb-bar .lb-original { margin-left: var(--s2); }
.lb-bar a[hidden] { display: none; }
.lb-bar .lb-close { font-size: var(--fs-lg); }
.lb-view { flex: 1 1 auto; min-height: 0; overflow: auto; display: flex; padding: var(--s3); box-sizing: border-box; }
.lb-view:focus-visible { outline-offset: -4px; }
.lb-view img { display: block; margin: auto; max-width: none; height: auto; cursor: zoom-out; background: var(--surface); }
.lightbox.is-fit .lb-view img { max-width: 100%; max-height: 100%; width: auto; object-fit: contain; cursor: zoom-in; }
@media (pointer: coarse) { .lb-bar button, .lb-bar a { min-height: var(--tap); min-width: var(--tap); } }
@media (max-width: 480px) { .lb-bar { flex-wrap: nowrap; gap: var(--s1); padding: var(--s2); } .lb-bar button, .lb-bar a { padding: 0 var(--s2); }
  .lb-bar .lb-original { margin-left: var(--s1); white-space: nowrap; } }
.chat-previews .remove { position: absolute; top: calc(var(--s1) * -1); right: calc(var(--s1) * -1); min-width: 24px; min-height: 24px;
  padding: 0; border-radius: var(--r-pill); font-size: var(--fs-sm); line-height: 1; background: var(--surface); border: 1px solid var(--border-strong); }
@media (pointer: coarse) { .chat-previews .remove { min-width: var(--tap); min-height: var(--tap); top: calc(var(--s3) * -1); right: calc(var(--s3) * -1); } }
/* The composer's "+" on its left, and its small menu over it (the owner, 2026-11-16, as Claude Code's). */
.composer > .add-menu { position: relative; flex: none; align-self: flex-start; }
.composer > .add-menu[hidden] { display: none; }
.composer button.add { border-radius: var(--r-pill); background: var(--surface-2); color: var(--text); border: 1px solid var(--border); }
.composer button.add:hover, .composer button.add[aria-expanded="true"] { background: var(--neutral-soft); }
.add-items { position: absolute; left: 0; bottom: calc(100% + var(--s1)); z-index: var(--z-popover); min-width: 15rem; margin: 0; padding: var(--s1);
  list-style: none; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); box-shadow: var(--shadow); }
.add-items[hidden] { display: none; }
.add-items button { display: flex; width: 100%; align-items: center; justify-content: space-between; gap: var(--s3); min-height: var(--tap-sm);
  padding: var(--s2) var(--s3); border: 0; border-radius: var(--r-sm); background: none; color: var(--text); font: inherit; font-size: var(--fs-sm);
  text-align: left; cursor: pointer; }
.add-items button:hover, .add-items button:focus-visible { background: var(--surface-2); }
.add-items .shortcut { font-family: var(--font); font-size: var(--fs-xs); color: var(--text-2); }

/* The header's menu and the page's name in it: a phone's alone (below). */
.navmenu, .top-here { display: none; }
.navmenu { position: relative; margin-left: auto; }
.navmenu > summary { list-style: none; cursor: pointer; display: inline-flex; align-items: center; justify-content: center;
  min-width: var(--tap); min-height: var(--tap); border-radius: var(--r-sm); color: var(--text); }
.navmenu > summary::-webkit-details-marker { display: none; }
.navmenu[open] > summary { background: var(--surface-2); }
.navmenu-in { position: absolute; right: 0; top: calc(100% + var(--s1)); width: min(18rem, calc(100vw - var(--s5))); }
.navmenu-in ul { list-style: none; margin: 0; padding: 0; }
.navmenu-in ul + ul, .navmenu-in ul + form { border-top: 1px solid var(--border); margin-top: var(--s1); padding-top: var(--s1); }
.navmenu-in a { display: flex; align-items: center; min-height: var(--tap); padding: 0 var(--s3); border-radius: var(--r-sm); color: var(--text);
  text-decoration: none; }
.navmenu-in a:hover, .navmenu-in a[aria-current="page"] { background: var(--surface-2); }
.navmenu-head { margin: var(--s1) var(--s3); font-size: var(--fs-xs); color: var(--text-3); }
.navmenu-in form { margin: 0; }
.navmenu-in form button { width: 100%; justify-content: flex-start; min-height: var(--tap); padding: 0 var(--s3); font: inherit;
  color: var(--text); }
/* A phone (the owner, 2026-11-16, from an iPhone's 393 x 852): the header one row (the mark, the page, the menu) on
   every page. */
@media (max-width: 600px) {
  .top-in { flex-wrap: nowrap; gap: var(--s2); min-height: var(--h-head-sm); padding: 0 var(--s3); }
  .top-in > .topnav,
  .top-in:has(.navmenu) > .signout { display: none; }
  .navmenu { display: block; }
  .brand { font-size: 0; gap: 0; flex: none; }
  .top-here { display: block; flex: 1 1 auto; min-width: 0; font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  main > h1, main > .title-row > h1 { position: absolute; width: 1px; height: 1px; margin: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .chat-keys { display: none; }
}

/* ---------------------------------------------------------------------------------------------------------------
   A drawer (ui.drawer): a side panel over the page, from the left or the right, shown while it is open; the scrim
   (ui.scrim) dims what lies behind it, and a tap on it closes it. /code's sidebar and right pane are its drawers on a
   phone (their own rules, above). */
.drawer { position: fixed; z-index: var(--z-drawer); top: 0; bottom: 0; width: min(20rem, 86vw); display: flex; flex-direction: column;
  overflow-y: auto; padding: var(--s3) var(--s4); background: var(--surface); visibility: hidden; transition: transform .2s ease, visibility .2s; }
.drawer.from-left { left: 0; transform: translateX(-100%); border-right: 1px solid var(--border); }
.drawer.from-right { right: 0; transform: translateX(100%); border-left: 1px solid var(--border); }
.drawer.is-open { transform: none; visibility: visible; box-shadow: var(--shadow-drawer); }
.drawer-head { display: flex; align-items: center; justify-content: space-between; gap: var(--s2); margin: 0 0 var(--s2); }
.drawer-head > .pane-head { margin: 0; }
.scrim, .scrim:hover { position: fixed; inset: 0; z-index: var(--z-scrim); width: 100%; height: 100%; min-height: 0; padding: 0; border: 0;
  border-radius: 0; background: var(--scrim); }
@media (prefers-reduced-motion: reduce) { .drawer { transition: none; } }

/* ---------------------------------------------------------------------------------------------------------------
   /design, the living page of the design system: every component in light and in dark side by side (one column on a
   phone), each in a card; a drawer and the app's shell in a frame of their own; the token table with a sample of each. */
.design-choose { margin: var(--s3) 0 0; font-size: var(--fs-sm); }
.design-themes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s5); margin: 0 0 var(--s5); }
.design-themes.one { grid-template-columns: minmax(0, 1fr); }
.design-pane { min-width: 0; padding: var(--s4); border: 1px solid var(--border); border-radius: var(--r-lg); }
.design-pane > .pane-head { margin: 0 0 var(--s3); }
.design-item > h2.design-name { margin-bottom: var(--s3); font-size: var(--fs-sm); color: var(--text-2); letter-spacing: .04em; text-transform: uppercase; }
.design-item .grid { grid-template-columns: minmax(0, 1fr) minmax(0, 40%); }
.design-frame { position: relative; height: 240px; overflow: hidden; contain: paint; border: 1px solid var(--border-strong); border-radius: var(--r);
  background: var(--bg); }
.design-frame.tall { height: 360px; }
.design-frame .code { height: 100%; }
.design-frame .code .chat-list { width: 13rem; }
.design-frame .code .chat-context { width: 12rem; }
.design-frame .wizard { padding: var(--s4); }
.dot-sample { display: inline-flex; align-items: center; gap: var(--s2); font-size: var(--fs-sm); }
.table-scroll { overflow-x: auto; }
table.tokens { width: 100%; border-collapse: collapse; font-size: var(--fs-sm); }
table.tokens th, table.tokens td { padding: var(--s2); border-top: 1px solid var(--border); text-align: left; vertical-align: middle; }
table.tokens td code { font-family: var(--mono); font-size: var(--fs-xs); overflow-wrap: anywhere; }
.swatch, .space-bar, .corner-box { display: inline-block; margin-right: var(--s2); vertical-align: middle; }
.swatch { width: 24px; height: 24px; border: 1px solid var(--border); border-radius: var(--r-xs); }
.space-bar { height: 12px; background: var(--accent); }
.corner-box { width: 36px; height: 24px; border: 2px solid var(--accent); }
.sw-bg { background: var(--bg); }
.sw-surface { background: var(--surface); }
.sw-surface-2 { background: var(--surface-2); }
.sw-border { background: var(--border); }
.sw-border-strong { background: var(--border-strong); }
.sw-text { background: var(--text); }
.sw-text-2 { background: var(--text-2); }
.sw-text-3 { background: var(--text-3); }
.sw-accent { background: var(--accent); }
.sw-accent-hover { background: var(--accent-hover); }
.sw-accent-soft { background: var(--accent-soft); }
.sw-on-accent { background: var(--on-accent); }
.sw-ok { background: var(--ok); }
.sw-ok-soft { background: var(--ok-soft); }
.sw-warn { background: var(--warn); }
.sw-warn-soft { background: var(--warn-soft); }
.sw-pending { background: var(--pending); }
.sw-bad { background: var(--bad); }
.sw-bad-soft { background: var(--bad-soft); }
.sw-neutral-soft { background: var(--neutral-soft); }
.sw-focus { background: var(--focus); }
.sw-screen { background: var(--screen); }
.sw-shadow { background: var(--surface); box-shadow: var(--shadow); }
.sw-shadow-control { background: var(--surface); box-shadow: var(--shadow-control); }
.sw-shadow-float { background: var(--surface); box-shadow: var(--shadow-float); }
.sw-shadow-pop { background: var(--surface); box-shadow: var(--shadow-pop); }
.sw-shadow-drawer { background: var(--surface); box-shadow: var(--shadow-drawer); }
.sw-scrim { background: var(--scrim); }
.sw-scrim-strong { background: var(--scrim-strong); }
.sp-s1 { width: var(--s1); }
.sp-s2 { width: var(--s2); }
.sp-s3 { width: var(--s3); }
.sp-s4 { width: var(--s4); }
.sp-s5 { width: var(--s5); }
.sp-s6 { width: var(--s6); }
.sp-s7 { width: var(--s7); }
.rd-r-xs { border-radius: var(--r-xs); }
.rd-r-sm { border-radius: var(--r-sm); }
.rd-r-control { border-radius: var(--r-control); }
.rd-r-lg { border-radius: var(--r-lg); }
.rd-r-pill { border-radius: var(--r-pill); }
@media (max-width: 760px) {
  .design-themes { grid-template-columns: minmax(0, 1fr); }
  .design-pane { padding: var(--s3); }
}
/* The slash menu (docs/decisions/0092): typed "/" in the composer lists the built-ins and the person's own commands,
   and /resume the session's conversations, over the composer as the "+" menu is. */
.chat-send .composer { position: relative; }
.slash-menu { position: absolute; left: 0; right: 0; bottom: calc(100% + var(--s1)); z-index: var(--z-popover); margin: 0; padding: var(--s1);
  list-style: none; max-height: 18rem; overflow-y: auto; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r); box-shadow: var(--shadow); }
.slash-menu[hidden] { display: none; }
.slash-menu li { display: flex; align-items: baseline; gap: var(--s3); min-height: var(--tap-sm); padding: var(--s2) var(--s3);
  border-radius: var(--r-sm); cursor: pointer; font-size: var(--fs-sm); color: var(--text); }
.slash-menu li[aria-selected="true"], .slash-menu li:hover { background: var(--surface-2); }
.slash-menu .slash-name { flex: none; font-weight: 600; }
.slash-menu .slash-help { flex: 1; min-width: 0; color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.slash-menu .slash-head { cursor: default; color: var(--text-2); font-size: var(--fs-xs); min-height: 0; }
.slash-menu .slash-head:hover { background: none; }

/* A card folded to its heading and one line (My logins here). */
details.fold > summary { list-style: none; cursor: pointer; color: var(--text); font-size: inherit; font-weight: inherit; }
details.fold > :not(summary) { font-size: inherit; }
details.fold > summary .muted { color: var(--text-2); font-size: var(--fs-sm); }
details.fold > summary::-webkit-details-marker { display: none; }
details.fold > summary h2 { display: inline-block; margin-right: var(--s2); }
details.fold > summary h2::after { content: ' ›'; color: var(--text-2); }
details.fold[open] > summary h2::after { content: ' ⌄'; }
details.fold > summary .muted { display: block; }
/* A code pasted from another site's box looks like that box: monospace, wrapping, on a quiet surface. */
textarea.pastecode { width: 100%; font-family: var(--mono);
  font-size: var(--fs-md); line-height: 1.6; padding: var(--s3) var(--s4); background: var(--surface-2);
  border-radius: var(--r); resize: none; word-break: break-all; overflow-wrap: anywhere; }
/* A choice shown but not open now: greyed, its reason under it. */
.rows li.off .name, .rows li.off input { opacity: .5; }
.rows li.off label { cursor: not-allowed; }
