/* ============================================================================
 * FRONT DESK — the whole visual system, in one file.
 *
 * plans/front-desk-execution-plan.md §2. Six screens are written by six people at
 * the same time; the only thing that keeps them looking like one product is that
 * NONE of them writes CSS. Every class a screen needs is here, named, and listed
 * below. A screen that needs a shape this file does not have reports it rather
 * than inventing a sibling that is four pixels different.
 *
 * TOKENS FIRST. Nothing below uses a raw colour. The light palette is defined on
 * bare `:root`; dark is defined twice — once under `prefers-color-scheme: dark`
 * guarded by `:root:not([data-theme="light"])`, and once under
 * `:root[data-theme="dark"]` — so the Settings switch wins in both directions and
 * "follow the computer" still works when no choice has been made (§3 D6).
 *
 * COLOUR NEVER CARRIES MEANING ALONE (§2). `.chip` and `.stripe` take their tone
 * from state.js, and the chip always renders the word beside the dot. A stripe is
 * decorative and is always accompanied by its chip in the same row.
 *
 * ── THE SHARED CLASSES, and what each one is for ────────────────────────────
 *
 *   .chip            a state, as a word and a tone. Modifiers: .ok .wait .stop
 *                    .calm — exactly the four tones state.js hands out. Always
 *                    contains <span class="dot" aria-hidden="true"></span> + the word.
 *   .chip-filter     a filter button. <button class="chip-filter" aria-pressed>.
 *                    The pressed one IS the state of the list (README "the moves").
 *                    `.filter` is kept as an alias of the same shape.
 *   .stripe          the 3px state bar at the head of a row. .ok .wait .stop .calm.
 *   .mail-row        one piece of correspondence, as a full-width <button>.
 *                    Grid: stripe · who+subject · status · reason (.reason-cell)
 *                    · received · assigned (TODO #330).
 *   .shelf-row       one row of a plain table (pages, rules, customers, jobs).
 *                    `.shelf-row.head` is the header row; `.hide-narrow` drops a
 *                    cell at phone width. Wrap rows in `.shelf`.
 *   .letter          the customer's own words, quoted. `.letter .meta` is the
 *                    from/subject/when line.
 *   .reply           the suggested reply. `.reply .label` is the small caps
 *                    "SUGGESTED REPLY" line.
 *   .preview         the "Before saving" panel. EVERY save shows one first
 *                    (§3 D9) — that is what this class is for, and a save that
 *                    renders without it is a bug.
 *   .btn / .btn.primary / .btn.danger   actions. One primary per form, card or
 *                    dialog; danger only for what deletes or stops. `.btn.small`
 *                    for row actions; `.btn.go` goes to another screen; `.btn.link` is
 *                    words in a sentence. STYLE.md "Buttons" says which is which.
 *   .field           one labelled control: label, input/textarea/select, .help.
 *                    Group them in `.form`; a row of choices is `.choice`.
 *   .callout         something the reader should notice. Plain is amber-toned
 *                    (attention); `.callout.quiet` is the neutral version used
 *                    for "where this came from" and other asides.
 *   .tally           the counted summary strip: <div><b>7</b><span>…</span></div>.
 *
 * Also available and used by more than one screen: `.actions` (a row of buttons),
 * `.note` (a muted line), `.num` (tabular figures), `.sources` (a tight list
 * inside a callout), `.form`, `.field .help` (or bare `.help`), `.choice`,
 * `.filters` (a row of chip-filters), `.tick` (the number inside one), `.shelf`
 * (wraps `.shelf-row`s), `.meta` (a from/subject/when line, inside `.letter` or
 * not), `.from` `.subject` `.when` (the three parts of a mail row), `.label`
 * (small caps, e.g. SUGGESTED REPLY), `.hide-narrow` (drops the element at phone
 * width), `.hint`, `.center-note`. A `<h3>` inside `.form` or `.screen` is
 * already sized — no screen needs an inline style for one.
 *
 * THE STYLE GUIDE (STYLE.md, owner 2026-10-29) says what each class means and when
 * to use it; ui.js builds them. Six text sizes (12 13 14 16 18 21, as tokens) and
 * two weights (400, 600); 4px corners on controls and chips, 8px on boxes; the
 * typewriter font only for ids, addresses and code.
 *
 * Owned by agent A (Wave 1). Report a needed change; do not edit this file.
 * ========================================================================== */

:root {
  color-scheme: light;
  --ground: #f3f4f6;
  --surface: #ffffff;
  --surface-2: #fafafa;
  --surface-3: #f3f4f6;
  --surface-theirs: #f6f3ec;
  --surface-ours: #eef0fa;
  --ink: #14171a;
  --ink-2: #5b6472;
  --ink-3: #5b6472;
  --line: #e5e7eb;
  --line-strong: #d1d5db;
  --btn-line: #7d8592;
  --accent: #1d4ed8;
  --accent-ink: #1d4ed8;
  --accent-soft: #eff6ff;
  --on-accent: #ffffff;
  --ok: #065f46;
  --ok-soft: #ecfdf5;
  --wait: #92400e;
  --wait-soft: #fffbeb;
  --stop: #991b1b;
  --stop-soft: #fef2f2;
  --light-trouble: var(--stop);
  --light-on: var(--on-accent);

  --s-1: 4px;
  --s-2: 8px;
  --s-3: 12px;
  --s-4: 16px;
  --s-5: 24px;
  --s-6: 32px;
  --s-8: 48px;

  --text-xs: 12px;
  --text-sm: 13px;
  --text-base: 14px;
  --text-lg: 16px;
  --text-xl: 18px;
  --text-2xl: 21px;

  --radius: 4px;
  --radius-lg: 8px;
  --focus-width: 2px;
  --focus-offset: 2px;
  --shadow: 0 4px 16px rgba(0, 0, 0, .10), 0 1px 3px rgba(0, 0, 0, .06);
  --sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, monospace;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --ground: #0d1014;
    --surface: #14181e;
    --surface-2: #1b2028;
    --surface-3: #262c35;
    --surface-theirs: #26221a;
    --surface-ours: #1a2140;
    --ink: #e8eaed;
    --ink-2: #9aa4b2;
    --ink-3: #9aa4b2;
    --line: #262c35;
    --line-strong: #39414d;
    --btn-line: #717a88;
    --accent: #60a5fa;
    --accent-ink: #93c5fd;
    --accent-soft: #10203a;
    --on-accent: #0d1014;
    --ok: #6ee7b7;
    --ok-soft: #0d2620;
    --wait: #fbbf24;
    --wait-soft: #2a2113;
    --stop: #f87171;
    --stop-soft: #2a1213;
    --light-trouble: var(--stop);
    --light-on: var(--on-accent);
    --shadow: 0 4px 16px rgba(0, 0, 0, .5), 0 1px 3px rgba(0, 0, 0, .4);
  }
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --ground: #0d1014;
  --surface: #14181e;
  --surface-2: #1b2028;
  --surface-3: #262c35;
  --surface-theirs: #26221a;
  --surface-ours: #1a2140;
  --ink: #e8eaed;
  --ink-2: #9aa4b2;
  --ink-3: #9aa4b2;
  --line: #262c35;
  --line-strong: #39414d;
  --btn-line: #717a88;
  --accent: #60a5fa;
  --accent-ink: #93c5fd;
  --accent-soft: #10203a;
  --on-accent: #0d1014;
  --ok: #6ee7b7;
  --ok-soft: #0d2620;
  --wait: #fbbf24;
  --wait-soft: #2a2113;
  --stop: #f87171;
  --stop-soft: #2a1213;
  --light-trouble: var(--stop);
  --light-on: var(--on-accent);
  --shadow: 0 4px 16px rgba(0, 0, 0, .5), 0 1px 3px rgba(0, 0, 0, .4);
}

/* ── frame ─────────────────────────────────────────────────────────────── */

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font-family: var(--sans);
  font-size: var(--text-base);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { text-wrap: balance; margin: 0; letter-spacing: 0; }
p { margin: 0; }
a { color: var(--accent-ink); }

:focus-visible { outline: var(--focus-width) solid var(--accent); outline-offset: var(--focus-offset); }

/* The app fills the window: the rail scrolls on its own, and the pane scrolls on
   its own, so a long correspondence list never scrolls the menu out of reach. */
.app {
  display: grid;
  grid-template-columns: var(--rail-w, 315px) minmax(0, 1fr);
  min-height: 100%;
}

.mobile-bar, .rail-backdrop { display: none; }

.rail {
  background: var(--surface-2);
  border-right: 1px solid var(--line);
  padding: 16px 12px 22px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 100vh;
  overflow-y: auto;
  position: sticky;
  top: 0;
}

/* THE MENU'S WIDTH, AND HIDING IT (railsize.js, owner 2026-11-06). Wide screens
   only; the narrow drawer below hides all three. `--rail-w` on .app is the width.
   .rail-handle    the separator on the rail's right edge: a resize cursor, and a
                   thin accent line on hover, on focus and while dragging.
   .rail-hide      "‹ Hide menu", small and quiet, at the top of the rail.
   .rail-show      "Show menu ›", a tab at the pane's top left while it is hidden.
   .rail-hidden    on .app: the rail takes no space (railsize.js also makes it inert).
   .rail-dragging  on .app while dragging: no text selection, the cursor held.
   .rail-will-hide on .app while a drag would hide the menu if let go. */
.app.rail-hidden { grid-template-columns: minmax(0, 1fr); }
.app.rail-hidden > .rail { display: none; }
.rail-handle {
  position: fixed; top: 0; bottom: 0; z-index: 20;
  left: calc(var(--rail-w, 315px) - 4px); width: 8px;
  cursor: col-resize; touch-action: none;
}
.rail-handle::after {
  content: ""; position: absolute; top: 0; bottom: 0; left: 3px; width: 2px;
  background: transparent; transition: background .12s ease;
}
.rail-handle:hover::after, .rail-handle:focus-visible::after,
.app.rail-dragging .rail-handle::after { background: var(--accent); }
.rail-handle:focus-visible { outline: none; background: var(--accent-soft); }
.rail-handle[hidden] { display: none; }
.app.rail-dragging { cursor: col-resize; user-select: none; -webkit-user-select: none; }
.app.rail-will-hide > .rail { opacity: .5; }
.btn.rail-hide {
  align-self: flex-end; margin: -8px 0 -2px;
  background: transparent; border-color: transparent; box-shadow: none;
  color: var(--ink-2); font-weight: 400;
}
.btn.rail-hide:hover:not([disabled]) { background: var(--surface-3); color: var(--ink); }
.btn.rail-show {
  justify-self: start; position: sticky; top: var(--s-2); z-index: 20;
  margin: -12px 0 -6px -26px;
  border-left: 0; border-radius: 0 var(--radius) var(--radius) 0;
  background: var(--surface-2); color: var(--ink-2);
}
.btn.rail-show:hover:not([disabled]) { background: var(--surface-3); color: var(--ink); }
.btn.rail-show[hidden] { display: none; }

.brand-block {
  display: flex; align-items: center; gap: var(--s-2); width: 100%;
  margin-bottom: var(--s-2); padding: var(--s-2);
  font: inherit; text-align: left; cursor: pointer;
  border: 0; border-radius: var(--radius-lg);
}
.brand-block img { width: 30px; height: 30px; flex: none; }
.brand-copy { display: grid; line-height: 1.15; min-width: 0; }
.brand-copy b { font-size: var(--text-lg); font-weight: 600; }
.brand-copy span { font-size: var(--text-xs); overflow-wrap: anywhere; }
.brand-block:focus-visible, .mobile-brand:focus-visible {
  outline: var(--focus-width) solid var(--accent); outline-offset: var(--focus-offset);
}

/* THE HEALTH LIGHT (H8, healthlight.js): "Broa Front Office", in the rail and the
   phone header, draws a colour only when something is broken (#106, owner
   2026-10-04): red on trouble; otherwise ("Everything working", "Checking…", a
   check that only didn't answer) it is the plain title, no fill. The word under
   the name says the state, so colour never says it alone. Text on the red reaches
   4.5:1 in both themes: --on-accent on --stop is #fff on #991b1b (light) and
   #0d1014 on #f87171 (dark); the plain title is the rail's own ink. */
.light-plain { background: transparent; color: var(--ink); }
.light-trouble { background: var(--light-trouble); color: var(--light-on); }
.light-plain:hover { background: var(--surface-3); }
.light-trouble:hover { filter: brightness(1.08); }

.pane {
  background: var(--surface);
  padding: 22px 26px 40px;
  display: grid;
  align-content: start;
  gap: 18px;
  min-width: 0;
}

.pane:focus { outline: none; }

/* Skip link: a button rather than an anchor, because this document declares a
   <base> and a bare "#id" href would resolve against it and leave the page. */
.skip {
  position: absolute; left: -9999px; top: 0; z-index: 10;
  font: inherit; cursor: pointer;
  background: var(--surface); color: var(--ink);
  border: 1px solid var(--line-strong); border-radius: 0 0 7px 0;
  padding: 10px 14px;
}
.skip:focus { left: 0; }


/* ── the menu ──────────────────────────────────────────────────────────── */

.group { border-top: 1px solid var(--line); padding-top: 6px; }
.group:first-of-type { border-top: 0; }
.group > summary {
  list-style: none; cursor: pointer;
  display: flex; align-items: center; gap: 8px;
  padding: 7px 8px; border-radius: var(--radius);
  font-size: var(--text-xs); font-weight: 600; letter-spacing: .08em; text-transform: uppercase;
  color: var(--ink-2);
}
.group > summary::-webkit-details-marker { display: none; }
.group > summary:hover { background: var(--surface-3); color: var(--ink-2); }
.group > summary:focus-visible { outline: var(--focus-width) solid var(--accent); outline-offset: 1px; }

.chev {
  width: 9px; height: 9px; margin-left: auto;
  border-right: 1.6px solid currentColor; border-bottom: 1.6px solid currentColor;
  transform: rotate(-45deg); transition: transform .18s ease;
}
.group[open] > summary .chev { transform: rotate(45deg); }

/* Sub-items sit INSIDE their heading: indented, with a hairline down the left so the
   eye reads a group as one block rather than a heading followed by a flat list
   (owner, 2026-09-16). The rule is on the container, not the item, so a current
   item's highlight still spans its full row. */
.items {
  display: grid; gap: 2px;
  margin: 2px 0 8px 14px;
  padding-left: 8px;
  border-left: 1px solid var(--line);
}

/* A parent inside a group (owner, 2026-11-03: Correspondence → Correspondence lists;
   rail.js). It reads as an item, not a group heading: sentence case at an item's size,
   with the groups' chevron drawn smaller, and its children sit one step further in
   under their own hairline. It holds no badge. Holding the item you are on, its
   label takes the current colour while the child keeps the highlight. */
.subgroup > summary {
  list-style: none; cursor: pointer;
  display: flex; align-items: center; gap: 9px;
  padding: 8px 10px; border-radius: var(--radius);
  font-size: var(--text-base); color: var(--ink-2);
}
.subgroup > summary::-webkit-details-marker { display: none; }
.subgroup > summary:hover { background: var(--surface-3); color: var(--ink); }
.subgroup > summary:focus-visible { outline: var(--focus-width) solid var(--accent); outline-offset: 1px; }
.subgroup > summary .chev { width: 7px; height: 7px; }
.subgroup[open] > summary .chev { transform: rotate(45deg); }
.subgroup[data-current] > summary { color: var(--accent-ink); font-weight: 600; }
.subgroup > .items { margin: 2px 0 4px 12px; }

.item {
  display: flex; align-items: center; gap: 9px;
  width: 100%; text-align: left;
  background: none; border: 0; border-radius: var(--radius);
  padding: 8px 10px;
  font: inherit; font-size: var(--text-base); color: var(--ink-2);
  cursor: pointer;
}
.item:hover { background: var(--surface-3); color: var(--ink); }
.item:focus-visible { outline: var(--focus-width) solid var(--accent); outline-offset: 1px; }
.item[aria-current="true"] { background: var(--accent-soft); color: var(--accent-ink); font-weight: 600; }

/* An item with a one-line description under its label (Company settings, TODO #73):
   the two lines stack, the description quieter and never bold, even when current. */
.item.has-note { align-items: flex-start; }
.item-text { display: grid; gap: 1px; min-width: 0; }
.item-note { font-size: var(--text-xs); line-height: 1.35; color: var(--ink-2); font-weight: 400; }
.item[aria-current="true"] .item-note { color: inherit; opacity: .8; }
/* A group's own description, first inside it (Company settings). */
.group-note { font-size: var(--text-xs); color: var(--ink-2); padding: 2px 10px 4px; margin: 0; }

.item .count {
  margin-left: auto; font-family: var(--sans); font-variant-numeric: tabular-nums; font-size: var(--text-xs);
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 999px; padding: 1px 7px; color: var(--ink-2);
}
.item[aria-current="true"] .count { border-color: color-mix(in srgb, var(--accent) 30%, transparent); }
.item .count.attention {
  background: var(--wait-soft); color: var(--wait);
  border-color: color-mix(in srgb, var(--wait) 35%, transparent);
}


/* the appearance switch, in the menu and again on the Settings screen */
.setting { display: grid; gap: 6px; padding: 6px 10px 10px; }
.setting-label { font-size: var(--text-sm); color: var(--ink-2); }
.theme {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 3px;
  background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 3px;
}
.theme-btn {
  font: inherit; font-size: var(--text-xs); cursor: pointer;
  border: 0; border-radius: var(--radius); padding: 5px 4px;
  background: none; color: var(--ink-2);
}
.theme-btn:hover { background: var(--surface); color: var(--ink); }
.theme-btn[aria-pressed="true"] { background: var(--accent); color: var(--on-accent); font-weight: 600; }
.theme-btn:focus-visible { outline: var(--focus-width) solid var(--accent); outline-offset: 1px; }

/* ── borrowed access (§3 D4) ───────────────────────────────────────────── */

.elevation {
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px;
  background: var(--wait-soft); color: var(--wait);
  border: 1px solid color-mix(in srgb, var(--wait) 32%, transparent);
  border-radius: var(--radius-lg); padding: 11px 14px;
}
.elevation[hidden] { display: none; }
.elevation p { font-size: var(--text-base); max-width: 58ch; }
.elevation b { color: inherit; }
.elevation .btn { margin-left: auto; }

/* ── the pane ──────────────────────────────────────────────────────────── */

/* The top bar (TODO #154): the title on the left; on the right the company and
   the person, Help, then Sign out. The hint is its own line under them. */
.pane-head {
  display: grid; grid-template-columns: minmax(0, 1fr) auto;
  align-items: center; gap: 6px 14px;
}
.pane-head h2 { font-size: var(--text-2xl); font-weight: 600; letter-spacing: 0; min-width: 0; overflow-wrap: anywhere; }
.pane-head .hint { grid-column: 1 / -1; }
.pane-head .hint:empty { display: none; }
.hint { color: var(--ink-2); font-size: var(--text-base); }

.top-tools { display: flex; align-items: center; gap: var(--s-3); min-width: 0; }
.top-tools[hidden] { display: none; }
.top-who {
  display: grid; justify-items: end; gap: 0; min-width: 0;
  max-width: min(30ch, 32vw); line-height: 1.25; text-align: right;
}
.top-who > span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.top-company { font-weight: 600; font-size: var(--text-base); color: var(--ink); }
.top-person { font-size: var(--text-xs); color: var(--ink-2); }
.help-slot { display: contents; }

/* Sign out sits in the bar; the initials button and the names inside the account
   panel are the phone's (below). */
.account { position: relative; }
.account-toggle, .account-names { display: none; }
.account-panel { display: flex; align-items: center; }
.account-toggle {
  width: 36px; height: 36px; padding: 0; place-items: center; cursor: pointer;
  font-family: var(--sans); font-variant-numeric: tabular-nums; font-size: var(--text-sm); font-weight: 600;
  background: var(--accent); color: var(--on-accent);
  border: 0; border-radius: 999px;
}
.account-toggle:focus-visible { outline: var(--focus-width) solid var(--accent); outline-offset: var(--focus-offset); }

/* A phone: the names and Sign out fold into the initials button, which opens a
   small panel under it (topbar.js). */
@media (max-width: 640px) {
  .top-tools { gap: var(--s-2); }
  .top-who { display: none; }
  .account-toggle { display: grid; }
  .account-panel {
    display: none; position: absolute; top: calc(100% + 6px); right: 0; z-index: 40;
    flex-direction: column; align-items: stretch; gap: var(--s-3);
    width: max-content; max-width: calc(100vw - 2 * var(--s-4)); min-width: 200px;
    padding: var(--s-3); background: var(--surface);
    border: 1px solid var(--line-strong); border-radius: var(--radius-lg); box-shadow: var(--shadow);
  }
  .account.is-open .account-panel { display: flex; }
  .account-names { display: grid; gap: 1px; line-height: 1.3; min-width: 0; }
  .account-names b, .account-names span { overflow-wrap: anywhere; }
  .account-names span { font-size: var(--text-xs); color: var(--ink-2); }
}

/* Help over the page (TODO #155, help.js): a dialog fixed to the right edge, full
   width on a phone, over a dimmed page. Nothing in the page's flow opens and the
   scrollbar is left alone, so the page under it never moves. */
.help-backdrop {
  position: fixed; inset: 0; z-index: 70;
  background: rgba(0, 0, 0, .45);
}
.help-backdrop[hidden] { display: none; }
.help-panel {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 80;
  width: min(440px, 100vw); max-height: 100dvh; overflow-y: auto; overscroll-behavior: contain;
  display: grid; gap: var(--s-3); align-content: start; padding: var(--s-4) var(--s-5) var(--s-5);
  background: var(--surface); color: var(--ink);
  border-left: 1px solid var(--line-strong); box-shadow: var(--shadow);
  animation: help-in .18s ease;
}
.help-panel[hidden] { display: none; }
@keyframes help-in { from { opacity: 0; transform: translateX(16px); } to { opacity: 1; transform: none; } }
.help-head { display: flex; align-items: center; justify-content: space-between; gap: var(--s-3); }
.help-head h3 { font-size: var(--text-lg); font-weight: 600; }
.help-log { display: grid; gap: var(--s-3); }
.help-asked { font-weight: 600; }
.help-answer { display: grid; gap: var(--s-2); }
.help-steps { padding-left: 1.4em; display: grid; gap: var(--s-1); }
.help-links { margin-top: var(--s-2); }
.help-links .btn { font-weight: 600; }
.help-refused { color: var(--stop); }
.help-question {
  width: 100%; font: inherit; padding: var(--s-2);
  background: var(--surface); color: var(--ink);
  border: 1px solid var(--line-strong); border-radius: var(--radius);
}
@media (max-width: 640px) {
  .help-panel { border-left: 0; padding: var(--s-4); }
}
@media (max-width: 480px) {
  .help-links .btn { flex: 1 1 100%; }
}

.screen { display: grid; gap: 18px; align-content: start; min-width: 0; }
.screen[hidden] { display: none; }
/* A button dropped straight into a screen keeps its own width; the pane is a
   grid, and a stretched 900px "Send reply" is not a button anyone aims at. */
.screen > .btn, .screen > .chip-filter, .screen > .filter { justify-self: start; }

.choice { display: flex; flex-wrap: wrap; gap: 8px; }
/* THE SEGMENTED CONTROL (STYLE.md "Choosing things"): every filter, and every
   switch of what a screen shows. Joined squared blocks in a frame, a small label
   above (.filter-group-label), the chosen one solid blue. ui.js segmented() draws
   it; `.filters` is the frame for a row a screen builds itself. */
.filter-bar { display: flex; flex-wrap: wrap; gap: var(--s-3); align-items: end; min-width: 0; }
.filter-bar .filter-group, .filter-group { display: grid; gap: var(--s-1); width: fit-content; max-width: 100%; min-width: 0; }
.filter-group-label {
  color: var(--ink-2); font-family: var(--sans); font-size: var(--text-xs);
  font-weight: 600; letter-spacing: .06em; text-transform: uppercase;
}
.filter-group-controls, .filters:not(.pager):not(.filter-group) {
  display: flex; flex-wrap: wrap; gap: 2px; width: fit-content; max-width: 100%; min-width: 0;
  padding: 3px;
  background: var(--surface-2); border: 1px solid var(--line);
  border-radius: var(--radius-lg);
}
.pager { display: flex; flex-wrap: wrap; gap: 8px; }
.filter-group-controls .chip-filter, .filters .chip-filter,
.filter-group-controls .filter, .filters .filter {
  flex: none; border-color: transparent; background: transparent; white-space: nowrap;
}
.list-summary { color: var(--ink-2); font-size: var(--text-sm); }
/* "Showing 1–25 of 140", Previous and Next, and how many to a page (TODO #255):
   one wrapping row, its size chips styled as the filters above. */
.pager { align-items: center; }
.pager .list-summary { margin: 0; }

/* THE EMAIL PAGE'S TABS (emailpages.js): the same markup as the filters above, drawn
   as tabs — a rule under the whole row, the current page underlined — so they read
   as a way to other pages, not a filter on this one (owner, 2026-10-08). */
.filter-bar.email-pages { display: block; }
.filter-bar.email-pages .filter-group { display: grid; width: 100%; }
.email-pages-lead { margin: 0; color: var(--ink-2); font-size: var(--text-sm); }
.email-pages .filter-group-controls {
  width: 100%; gap: var(--s-1); padding: 0; background: transparent; border: 0; border-radius: 0;
  box-shadow: inset 0 -1px 0 var(--line-strong); overflow-y: hidden; scrollbar-width: thin;
}
.filter-bar.email-pages .chip-filter {
  padding: var(--s-2) var(--s-3);
  border: 0; border-bottom: 3px solid transparent; border-radius: 0;
  background: transparent; color: var(--ink-2); font-size: var(--text-base);
}
.filter-bar.email-pages .chip-filter:hover { color: var(--ink); border-bottom-color: var(--line-strong); background: transparent; }
.filter-bar.email-pages .chip-filter[aria-pressed="true"] {
  background: transparent; color: var(--accent-ink); font-weight: 600;
  border-bottom-color: var(--accent);
}

/* One block of a segmented control. `.filter` is the same shape under the older name. */
.chip-filter, .filter {
  font: inherit; font-size: var(--text-sm); line-height: 20px; cursor: pointer;
  background: var(--surface); color: var(--ink-2);
  border: 1px solid var(--line-strong); border-radius: var(--radius); padding: 4px 12px;
}
.chip-filter:hover, .filter:hover { background: var(--surface-3); color: var(--ink); }
.chip-filter[aria-pressed="true"], .filter[aria-pressed="true"],
.filter-group-controls .chip-filter[aria-pressed="true"], .filters .chip-filter[aria-pressed="true"] {
  background: var(--accent); color: var(--on-accent); border-color: var(--accent); font-weight: 600;
}
.chip-filter:focus-visible, .filter:focus-visible { outline: var(--focus-width) solid var(--accent); outline-offset: 1px; }

.tick { font-family: var(--sans); font-variant-numeric: tabular-nums; font-size: var(--text-xs); margin-left: 7px; color: var(--ink-2); }
.chip-filter[aria-pressed="true"] .tick, .filter[aria-pressed="true"] .tick {
  color: color-mix(in srgb, currentColor 75%, transparent);
}

/* THE RIBBON AND ITS MENU BUTTONS (STYLE.md "The ribbon", owner 2026-10-30): one row
   under the page title where every filter and view setting is a button that opens a
   small menu. ui.js ribbon(), menuButton() and moreFilters() draw it. A pick applies
   at once. Below 600px the filters fold into one Filters button and an in-place panel. */
.ribbon {
  display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-2);
  padding: var(--s-2); min-width: 0;
  background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius-lg);
}
.ribbon-end { display: flex; flex-wrap: wrap; gap: var(--s-2); margin-left: auto; }
/* The page arrows, ‹ and ›: last at the right end, one pair of 30px squares. */
.page-arrows { display: inline-flex; gap: var(--s-1); }
.page-arrows .btn { min-height: 30px; min-width: 30px; padding: 0 var(--s-2); }
.ribbon-find {
  box-sizing: border-box; width: 220px; max-width: 100%; height: 30px;
  font: inherit; font-size: var(--text-sm); padding: 0 var(--s-2);
  background: var(--surface); color: var(--ink);
  border: 1px solid var(--line-strong); border-radius: var(--radius);
}
.ribbon .filter-group { display: block; }
.ribbon .filter-group-label { display: none; }
/* A row of state chips that are not filters (a product's marks, Home's queue states). */
.chip-row { display: flex; flex-wrap: wrap; gap: var(--s-2); min-width: 0; }
/* A search the service answers (Product list): the input and its button stay together. */
.ribbon-search { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-2); margin: 0; }
.ribbon-search .btn { min-height: 30px; }
.menu-wrap { position: relative; display: inline-block; min-width: 0; }
.menu-btn {
  display: inline-flex; align-items: center; gap: var(--s-1); height: 30px; box-sizing: border-box;
  font: inherit; font-size: var(--text-sm); cursor: pointer; white-space: nowrap; max-width: 100%;
  padding: 0 var(--s-2) 0 var(--s-3);
  background: var(--surface); color: var(--ink);
  border: 1px solid var(--line-strong); border-radius: var(--radius);
}
.menu-btn:hover { background: var(--surface-3); }
.menu-btn:focus-visible, .menu-item:focus-visible { outline: var(--focus-width) solid var(--accent); outline-offset: 1px; }
.menu-btn .menu-label { color: var(--ink-2); }
.menu-btn .menu-choice { font-weight: 600; }
.menu-btn::after {
  content: ""; flex: none; width: 6px; height: 6px; margin: -3px 0 0 var(--s-1);
  border-right: 2px solid var(--ink-2); border-bottom: 2px solid var(--ink-2);
  transform: rotate(45deg); transition: transform .18s ease;
}
.menu-btn[aria-expanded="true"]::after { transform: rotate(225deg); margin-top: 3px; }
.menu-btn.is-set { background: var(--accent-soft); border-color: var(--accent); color: var(--accent-ink); }
.menu-btn.is-set .menu-label { color: var(--accent-ink); }
.menu-btn.is-set::after { border-color: var(--accent-ink); }
.menu-btn .count {
  min-width: 18px; padding: 0 5px; box-sizing: border-box; text-align: center;
  background: var(--accent); color: var(--on-accent); border-radius: 9px;
  font-size: var(--text-xs); font-weight: 600; line-height: 18px;
}
.menu-btn .count[hidden] { display: none; }
.menu {
  position: absolute; top: calc(100% + var(--s-1)); left: 0; z-index: 30;
  min-width: 220px; max-width: min(320px, 86vw); max-height: min(360px, 60vh); overflow-y: auto;
  padding: var(--s-1); box-sizing: border-box;
  background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}
.menu.align-right { left: auto; right: 0; }
.menu[hidden] { display: none; }
.menu hr { border: 0; border-top: 1px solid var(--line); margin: var(--s-1) 0; }
.menu-heading {
  padding: var(--s-1) var(--s-2); color: var(--ink-2);
  font-size: var(--text-xs); font-weight: 600; letter-spacing: .06em; text-transform: uppercase;
}
.menu-item {
  display: flex; align-items: center; gap: var(--s-2); width: 100%; box-sizing: border-box;
  font: inherit; font-size: var(--text-sm); text-align: left; cursor: pointer;
  padding: var(--s-2); background: transparent; color: var(--ink);
  border: 0; border-radius: var(--radius);
}
.menu-item:hover { background: var(--surface-3); }
.menu-item.danger { color: var(--stop); font-weight: 600; }
.menu-item[disabled] { opacity: .6; cursor: default; }
.menu-item[aria-checked="true"] { background: var(--accent-soft); font-weight: 600; }
.menu-item .radio {
  flex: none; width: 14px; height: 14px; box-sizing: border-box;
  border: 1px solid var(--line-strong); border-radius: 50%; background: var(--surface);
}
.menu-item[aria-checked="true"] .radio { border: 4px solid var(--accent); }
/* A multi-select filter's row (TODO #442): a square box, ticked in the accent when
   chosen, the same look as a check box (STYLE.md "Check marks and selection"). */
.menu-item .box {
  flex: none; width: 14px; height: 14px; box-sizing: border-box; position: relative;
  border: 1px solid var(--line-strong); border-radius: var(--radius); background: var(--surface);
}
.menu-item[aria-checked="true"] .box { background: var(--accent); border-color: var(--accent); }
.menu-item[aria-checked="true"] .box::after {
  content: ""; position: absolute; left: 4px; top: 1px; width: 4px; height: 8px;
  border-right: 2px solid var(--on-accent); border-bottom: 2px solid var(--on-accent); transform: rotate(45deg);
}
.menu-item .menu-words { flex: 1; min-width: 0; }
.menu-item .num { color: var(--ink-2); font-variant-numeric: tabular-nums; }
.ribbon-fold {
  flex: 1 1 100%; display: grid; gap: var(--s-3); padding: var(--s-3);
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg);
}
.ribbon-fold[hidden] { display: none; }
@media (max-width: 600px) {
  .ribbon-find { width: 100%; flex: 1 1 100%; }
}
/* ONE TABLE (table.js; owner 2026-11-18): the list's heading, then its menus and
   page arrows ON THE SAME LINE — the ribbon's controls without the ribbon's frame —
   then "Showing 1–25 of N" and the rows. Wraps under the heading when narrow. */
.desk-table { display: grid; gap: var(--s-3); min-width: 0; }
.desk-table-body { display: grid; gap: var(--s-2); min-width: 0; }
.table-title { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-2) var(--s-4); min-width: 0; }
.table-title > h3, .screen .table-title > h3 { margin: 0; }
.table-title > .ribbon { flex: 1 1 auto; padding: 0; background: none; border: 0; border-radius: 0; }
.desk-table-turns { display: inline-flex; }
.desk-table-turns:empty { display: none; }
@media (prefers-reduced-motion: reduce) {
  .menu-btn::after { transition: none; }
}

/* ── a state: word and tone, never tone alone ─────────────────────────── */

.chip {
  display: inline-flex; align-items: center; gap: 6px;
  border-radius: var(--radius); padding: 2px 8px; line-height: 18px;
  font-size: var(--text-xs); font-weight: 600; white-space: nowrap;
}
.chip.ok   { background: var(--ok-soft);   color: var(--ok); }
.chip.wait { background: var(--wait-soft); color: var(--wait); }
.chip.stop { background: var(--stop-soft); color: var(--stop); }
.chip.calm { background: var(--surface-3); color: var(--ink-2); }
/* "Is this sender in method.me?" (erp-status.js, owner's requests of 2026-10-09
   B5–B7): a state chip like any other since the style guide (2026-10-29) — dot and
   word — marked `data-erp`. Beside the sender's name it keeps a little room. */
.chip[data-erp] { margin-left: var(--s-2); vertical-align: 1px; }
/* Under the address on a message: the chip, then the customer and account, or why. */
.erp-line { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-2); margin: var(--s-2) 0 0; }
.erp-line .chip[data-erp], .erp-cell .chip[data-erp] { margin-left: 0; }
.erp-cell .chip[data-erp] { white-space: normal; }
/* Customers: a person or company method.me doesn't know. */
.shelf-row.erp-highlight { background: var(--accent-soft); box-shadow: inset 3px 0 0 var(--accent); }
.dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; flex: none; }

.stripe { width: 3px; height: 34px; border-radius: 2px; background: var(--line-strong); }
.stripe.ok   { background: var(--ok); }
.stripe.wait { background: var(--wait); }
.stripe.stop { background: var(--stop); }
.stripe.calm { background: var(--line-strong); }

/* ── lists ─────────────────────────────────────────────────────────────── */

.mail { display: grid; }
.mail-row {
  display: grid;
  grid-template-columns: 8px minmax(0, 1.35fr) 132px 84px minmax(0, 1fr) 112px 140px;
  gap: 14px; align-items: center;
  padding: 12px 6px 12px 0;
  border: 0; border-bottom: 1px solid var(--line);
  background: none; font: inherit; color: inherit;
  text-align: left; cursor: pointer; width: 100%;
}
.mail-row:hover { background: var(--surface-2); }
/* The column heads over .mail-row: same grid, not a button. */
.mail-row.head {
  cursor: default; padding-top: 0; padding-bottom: 8px;
  border-bottom-color: var(--line-strong);
  font-family: var(--sans); font-size: var(--text-xs); font-weight: 600; letter-spacing: .06em; text-transform: uppercase;
  color: var(--ink-2);
}
.mail-row.head:hover { background: none; }
/* One sortable column head for every table (sort-head.js, A3). The whole head is
   the button; every sortable column shows a faint ↕, the one the table is sorted
   by a clear ↑/↓ in the accent. The arrow is set at 16px whatever the head's own
   size (the mail heads are 11.5px capitals), so it reads at a glance. */
.sort-head {
  display: inline-flex; align-items: center; gap: var(--s-1);
  width: 100%; min-height: 24px;
  padding: 0; border: 0; background: transparent; color: inherit;
  font: inherit; letter-spacing: inherit; text-transform: inherit; text-align: left; cursor: pointer;
}
.sort-head:hover { color: var(--ink); }
.sort-head:focus-visible { outline: var(--focus-width) solid var(--accent); outline-offset: 2px; }
.sort-arrow {
  font-family: var(--sans); font-size: 16px; line-height: 1; font-weight: 600;
  letter-spacing: 0; color: var(--accent-ink);
}
.sort-arrow.idle { font-weight: 400; color: var(--ink-2); opacity: .5; }
.sort-head:hover .sort-arrow.idle { opacity: .9; }
.mail-row:focus-visible { outline: var(--focus-width) solid var(--accent); outline-offset: -2px; }
.from { font-weight: 600; }
/* The message id (A4): its first 8 characters on a row, the whole of it with a
   Copy button in the message window. Monospace so it reads character by character. */
.msg-id { font-family: var(--mono); font-size: var(--text-xs); color: var(--ink-2); margin-left: var(--s-2); }
.msg-id-line {
  display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-2);
  margin-top: var(--s-1); font-size: var(--text-xs); color: var(--ink-2);
}
.msg-id.full { margin-left: 0; font-size: var(--text-xs); color: var(--ink-2); overflow-wrap: anywhere; user-select: all; }
/* D4: a message that came with files — a small paperclip and the count, beside the
   id. The words are in aria-label and title; the clip only helps the eye. */
.attach-clip {
  display: inline-flex; align-items: center; gap: 2px; margin-left: var(--s-2);
  font-size: var(--text-xs); color: var(--ink-2); vertical-align: 1px;
}
.attach-clip::before {
  content: ""; width: 11px; height: 11px; flex: none; background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M21 11.5l-8.6 8.6a5.5 5.5 0 0 1-7.8-7.8l8.6-8.6a3.7 3.7 0 0 1 5.2 5.2l-8.6 8.6a1.8 1.8 0 0 1-2.6-2.6l7.9-7.9'/%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 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M21 11.5l-8.6 8.6a5.5 5.5 0 0 1-7.8-7.8l8.6-8.6a3.7 3.7 0 0 1 5.2 5.2l-8.6 8.6a1.8 1.8 0 0 1-2.6-2.6l7.9-7.9'/%3E%3C/svg%3E") center / contain no-repeat;
}
/* D4: the Attachments section of a message. One line a file: its name (the
   customer's words, wrapped anywhere so a long one never widens the page), its kind
   and size, what happened to it, and Download. */
.attachments .attach-list { list-style: none; margin: var(--s-2) 0 0; padding: 0; display: grid; gap: var(--s-2); }
.attach { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-1) var(--s-3); font-size: var(--text-sm); }
.attach-name { font-weight: 600; color: var(--ink); overflow-wrap: anywhere; min-width: 0; }
.attach-meta { color: var(--ink-2); font-size: var(--text-xs); }
.attach-mismatch { color: var(--wait); }
.attach .chip { white-space: normal; }
.attach .btn.small { margin-left: auto; }
.attach-trouble { flex-basis: 100%; color: var(--stop); font-size: var(--text-xs); }
.attach-note { flex-basis: 100%; color: var(--ink-2); font-size: var(--text-xs); } /* 2026-10-10: read by the AI provider */
.attachments details.attach-inline { margin-bottom: 0; }
/* TODO #309: a picture's safe preview, what Broa read from it, and the customer's pictures' heading. */
.attach-preview { flex-basis: 100%; color: var(--ink-2); font-size: var(--text-xs); }
.attach-thumb { display: block; max-width: min(320px, 100%); max-height: 320px; height: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.attach-read { flex-basis: 100%; margin: 0; font-size: var(--text-sm); color: var(--ink-2); }
.attach-read-text { white-space: pre-line; overflow-wrap: anywhere; }
.attachments .attach-sub { margin: var(--s-3) 0 0; font-weight: 600; }
/* Find, above the chips: as wide as a pasted id, never wider than the page. */
.filter-bar .find-group { width: min(380px, 100%); }
.filter-bar .find-group input { width: 100%; }
.find-group .filter-group-controls { padding: 0; border: 0; background: none; width: 100%; }
.subject {
  /* `display: block` is load-bearing: overflow and text-overflow do nothing on an
     inline box, so a long subject ran under the state chip at phone width. */
  display: block;
  color: var(--ink-2); font-size: var(--text-sm);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.note { color: var(--ink-2); font-size: var(--text-sm); }
.when { font-family: var(--sans); font-variant-numeric: tabular-nums; font-size: var(--text-xs); color: var(--ink-2); }

.message-dialog {
  width: min(920px, calc(100vw - var(--s-8)));
  max-height: calc(100dvh - var(--s-8));
  padding: 0; overflow: hidden;
  color: var(--ink); background: var(--surface);
  border: 1px solid var(--line-strong); border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}
.message-dialog::backdrop { background: rgba(0, 0, 0, .45); }
/* THE BODY ALWAYS FITS (TODO #156, owner 2026-10-07: "content at the bottom we
   can't scroll to"). The window is a column: the header takes what it needs —
   one row of copied buttons or three — and the body gets the rest and scrolls
   inside it. It used to be a fixed max-height that assumed an 82px header, so
   once the buttons wrapped the body ran past the window's edge and its last
   lines (a refusal, the Tidy up comparison) could not be reached. [open] only:
   a closed <dialog> keeps the browser's display: none. */
.message-dialog[open] { display: flex; flex-direction: column; }
/* The sign-in reminder about unaccepted terms (shell.js remindTerms): a short
   question, so a short box. */
.message-dialog.terms-reminder { width: min(520px, calc(100vw - var(--s-8))); }
.terms-reminder h2 { font-size: var(--text-xl); }
.message-dialog-head {
  flex: none;
  display: flex; align-items: flex-start; justify-content: space-between; gap: var(--s-4);
  padding: var(--s-4) var(--s-5); border-bottom: 1px solid var(--line);
}
.message-dialog-head h2 { font-size: var(--text-xl); }
.message-dialog-commands {
  display: flex; flex-wrap: wrap; justify-content: flex-end; gap: var(--s-2);
  margin-left: auto;
}
.detail-command-source { display: none !important; }
/* The window's header: the next step, then More (STYLE.md "One message's window"). */
.message-dialog-commands { align-items: center; }
.message-dialog-body > .actions:first-child { display: none; }
/* The message page's "← Back to All correspondence": the window has Close × instead. */
.message-dialog-body .btn.link.back { display: none; }
/* The window's body is a pane too (`pane`), so its folds, fields and boxes wear the
   page's look; its own spacing wins over the pane's, on a phone as well. */
.message-dialog-body, .message-dialog .message-dialog-body {
  display: grid; gap: var(--s-4); padding: var(--s-5);
  flex: 1 1 auto; min-height: 0; overflow-y: auto;
}

.shelf { display: grid; }
.shelf-row {
  display: grid; grid-template-columns: minmax(0, 1fr) 110px 150px 96px;
  gap: 14px; align-items: center;
  padding: 12px 0; border-bottom: 1px solid var(--line);
  font-size: var(--text-base);
}
.shelf-row.head {
  font-family: var(--sans); font-size: var(--text-xs); font-weight: 600; letter-spacing: .06em; text-transform: uppercase;
  color: var(--ink-2); border-bottom-color: var(--line-strong); padding-bottom: 8px;
}
/* A shelf row that opens something is a button, like every other row. */
button.shelf-row {
  border-left: 0; border-right: 0; border-top: 0;
  background: none; font: inherit; font-size: var(--text-base); color: inherit;
  text-align: left; cursor: pointer; width: 100%;
}
button.shelf-row:hover { background: var(--surface-2); }
/* Rows with their own actions column (Your rules): wide enough for two small
   buttons side by side. One column on a phone, the actions under the words. */
.shelf-row.with-actions { grid-template-columns: minmax(0, 1fr) 110px 110px 190px; }
/* Facts (knowledge.js): Page or source · Updated · Quoted in replies to · Pieces ·
   In use — the toggles in one column at the right (owner, 2026-11-07). */
.shelf-row.facts { grid-template-columns: minmax(0, 1fr) 110px 150px 64px 96px; }
/* Your rules (replyrules.js, owner 2026-11-18 #16): Rule · Kind · Added · (Remove, a
   curator's or an owner's) · In use — the toggles in one column at the right, as Facts'. */
.shelf-row.rules { grid-template-columns: minmax(0, 1fr) 150px 96px 96px; }
.shelf-row.rules.with-remove { grid-template-columns: minmax(0, 1fr) 150px 96px 96px 96px; }
.fact-change:empty { display: none; }
.fact-change { padding: var(--s-2) 0 var(--s-3); border-bottom: 1px solid var(--line); }
/* Where a fact or rule came from: one line under its name (sources.js). */
.source-line { margin: 2px 0 0; }
.shelf-row .source-line + .chip { margin-top: 4px; }
/* A list of one-cell rows. */
.shelf-row.single { grid-template-columns: minmax(0, 1fr); }
/* Trouble tickets (tickets.js, owner 2026-11-18 #23): Ticket · State · Opened ·
   Opened by (an owner's list) · Last change. A phone keeps Ticket and State. */
.shelf-row.tickets { grid-template-columns: minmax(0, 1fr) 150px 130px 130px; }
.shelf-row.tickets.with-by { grid-template-columns: minmax(0, 1fr) 150px 130px 140px 130px; }
/* Records for CRM (proposals.js, owner 2026-11-19: "look like the correspondence
   page"): the status stripe · Status · Kind · Title · Customer · From message · Who has
   it · Created, as All correspondence's rows. A row opens the record's window; its
   title and its message's subject are links of their own. A phone keeps the stripe,
   Status and Title. */
.shelf-row.records { grid-template-columns: 8px 150px 90px minmax(0, 1.3fr) minmax(0, 1fr) minmax(0, 1fr) 120px 112px; }
.shelf-row.records > .stripe { align-self: stretch; height: auto; min-height: 34px; }
.shelf-row.records .record-reason { display: block; margin-top: 3px; font-size: var(--text-xs); }
.shelf-row.records .btn.link { text-align: left; }
/* A record's head on its own page (#/proposal): the title and the hint on the left,
   the one main button and More on the right — the message window's header, on the page. */
.record-head {
  display: flex; align-items: flex-start; justify-content: space-between; gap: var(--s-4);
  padding-bottom: var(--s-4); border-bottom: 1px solid var(--line);
}
.record-head h3 { margin: 0; }
.record-commands { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: var(--s-2); margin-left: auto; }
.record-commands[hidden] { display: none; }
@media (max-width: 860px) {
  .shelf-row.with-actions { grid-template-columns: minmax(0, 1fr) auto; }
  .shelf-row.with-actions > .row-actions { grid-column: 1 / -1; justify-content: flex-start; }
  .shelf-row.single { grid-template-columns: minmax(0, 1fr); }
}
/* A selected row (STYLE.md "Check marks and selection"): the pale accent and a bar
   on the left edge — the same family as the current menu item. */
.shelf-row.selected, .shelf-row[aria-selected="true"], .shelf-row[aria-current="true"],
.mail-row.selected, .mail-row[aria-current="true"] {
  background: var(--accent-soft); box-shadow: inset 3px 0 0 var(--accent);
}
/* A row's own actions: small buttons at the right end, in their own column. */
.row-actions { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; align-items: center; min-width: 0; }
/* Long text cut with "…" (the full text goes in its title). */
.cut { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
/* Numbers line up on the right, with even-width digits. */
.num.right { text-align: right; justify-self: end; }
button.shelf-row:focus-visible { outline: var(--focus-width) solid var(--accent); outline-offset: -2px; }
.cell-link {
  display: inline; width: fit-content; padding: 0; border: 0;
  background: transparent; color: var(--accent-ink); font: inherit;
  text-align: left; text-decoration: underline; text-underline-offset: 2px;
  cursor: pointer;
}
.cell-link:hover { text-decoration-thickness: 2px; }
.shelf-row.two { grid-template-columns: minmax(0, 1fr) 150px; }
/* A record for method.me (proposals.js, ADR-0058): the field's label, then its value. */
.shelf-row.field-value { grid-template-columns: minmax(0, 220px) minmax(0, 1fr); }
.shelf-row.three { grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr) 170px; }
@media (max-width: 860px) {
  .shelf-row.three { grid-template-columns: minmax(0, 1fr); gap: 4px; }
}
/* Customers (customers.js): Who · Company · Messages · Last wrote · State · Details.
   The row is a div, not a button, because it holds two buttons of its own; a
   click anywhere else on it opens the person's messages, so it looks clickable. */
/* Every column fixed but the first: grid rows are laid out independently, so an
   `auto` Details column is zero wide in the header and pushes it out of line. */
.shelf-row.customers { grid-template-columns: minmax(0, 1fr) 130px 118px 96px 120px 88px; }
/* With the method.me column (B7), once the company has an ERP: after State, wide
   enough for "Not checked in method.me" on two lines. Companies gain it before
   Messages. At phone width both drop it (hide-narrow) and keep their usual
   columns — these rules outrank the phone ones, so they are repeated there. */
.shelf-row.customers.with-erp { grid-template-columns: minmax(0, 1fr) 130px 118px 96px 120px 132px 88px; }
.shelf-row.companies.with-erp { grid-template-columns: minmax(0, 1fr) 110px 150px 132px 96px; }
@media (max-width: 860px) {
  .shelf-row.customers.with-erp { grid-template-columns: minmax(0, 1fr) 118px 88px; }
  .shelf-row.companies.with-erp { grid-template-columns: minmax(0, 1fr) 96px; }
}
.shelf-row.clickable { cursor: pointer; }
.shelf-row.clickable:hover { background: var(--surface-2); }
/* How quickly we answer's person table (team.js, once Who has what): Person ·
   Holding now · then six figures, each
   hide-narrow, so a phone shows the first two. */
.shelf-row.team { grid-template-columns: minmax(0, 1.6fr) minmax(0, 1.2fr) repeat(6, minmax(0, 1fr)); }
.num { font-family: var(--sans); font-variant-numeric: tabular-nums; font-size: var(--text-sm); color: var(--ink-2); }

.tally { display: flex; flex-wrap: wrap; gap: 10px; }
.tally div {
  display: flex; align-items: baseline; gap: 8px;
  border: 1px solid var(--line); border-radius: var(--radius-lg);
  padding: 9px 14px; background: var(--surface-2);
}
.tally b { font-family: var(--sans); font-variant-numeric: tabular-nums; font-size: var(--text-xl); font-weight: 600; }
.tally span { font-size: var(--text-sm); color: var(--ink-2); }
/* A tally with its setting on the same line (How quickly we answer, #9: the three
   figures, then the Period's ribbon at the right end; it wraps under when narrow). */
.figures-line { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 10px; }
.figures-line > .tally { flex: 1 1 auto; min-width: 0; }
.figures-line > .ribbon { margin-left: auto; }

/* ── a letter, and the reply to it ─────────────────────────────────────── */

.letter {
  border: 1px solid var(--line); border-radius: var(--radius-lg);
  background: var(--surface-2); padding: 16px 18px;
  display: grid; gap: 10px;
}
/* `.meta` also stands on its own — a from/subject/when line outside a letter. */
.meta, .letter .meta {
  display: flex; flex-wrap: wrap; gap: 6px 14px;
  font-size: var(--text-sm); color: var(--ink-2);
}
.letter p, .reply p { max-width: 64ch; }

.reply {
  border: 1px solid var(--line-strong); border-left: 3px solid var(--ok);
  border-radius: var(--radius-lg); background: var(--surface); padding: 18px;
  display: grid; gap: 12px;
}
.reply.wait { border-left-color: var(--wait); }
.reply.stop { border-left-color: var(--stop); }
/* The whole website chat on a chat question (TODO #38, correspondence.js
   wholeChat): one line per question or answer, the one being read marked. */
.reply.chat-whole { border-left-color: var(--line-strong); }
.chat-line { display: grid; gap: 4px; padding-left: 10px; border-left: 2px solid transparent; }
.chat-line.current { border-left-color: var(--accent); }
.reply .label, .label {
  font-family: var(--sans); font-size: var(--text-xs); font-weight: 600; letter-spacing: .06em;
  text-transform: uppercase; color: var(--ink-2);
}

.actions { display: flex; flex-wrap: wrap; gap: 8px; padding-top: 4px; }

/* Every button looks like a button (#124, plans/front-desk-button-styles-plan.md
   §1). An ordinary one is grey-filled with a border of at least 3:1 against the
   page (--btn-line; WCAG 2.2 §1.4.11) and a 1px shade under it. The main one
   (.primary) is blue — one per form, card or dialog. An important one (.danger)
   is pale red with red words: it deletes or stops something. tests/buttons.test.mjs
   checks the contrast. */
/* STYLE.md "Buttons": four kinds and a link, two sizes, 4px corners. Regular is
   34px tall (every form, card, dialog and page action); .small is 26px and only
   for an action on each row of a list, or beside a file or chip. Build them with
   ui.js button(), never by hand. */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--s-1);
  font: inherit; font-size: var(--text-base); line-height: 20px; cursor: pointer;
  min-height: 34px; border-radius: var(--radius); padding: 6px 14px;
  border: 1px solid var(--btn-line); background: var(--surface-3); color: var(--ink);
  box-shadow: 0 1px 0 color-mix(in srgb, var(--btn-line) 45%, transparent);
  text-align: center; white-space: normal;
}
.btn:hover:not([disabled]) { background: color-mix(in srgb, var(--surface-3), var(--ink) 8%); }
.btn:active:not([disabled]) { background: color-mix(in srgb, var(--surface-3), var(--ink) 16%); box-shadow: none; }
.btn:focus-visible { outline: var(--focus-width) solid var(--accent); outline-offset: var(--focus-offset); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); font-weight: 600; box-shadow: none; }
.btn.primary:hover:not([disabled]) { background: color-mix(in srgb, var(--accent) 86%, var(--ink)); }
.btn.primary:active:not([disabled]) { background: color-mix(in srgb, var(--accent) 74%, var(--ink)); }
/* Go: takes you to another screen. White fill, accent border and words, and the
   arrow — drawn here, so the button's words stay "Open Rules". */
.btn.go { background: var(--surface); border-color: var(--accent); color: var(--accent-ink); font-weight: 600; box-shadow: none; }
.btn.go::after { content: "→" / ""; }
.btn.go:hover:not([disabled]) { background: color-mix(in srgb, var(--surface), var(--accent) 10%); }
.btn.go:active:not([disabled]) { background: color-mix(in srgb, var(--surface), var(--accent) 18%); }
/* Link: words in a sentence or a table cell ("Show all", a customer's name, and
   "← Back to …" above a page title). No box; never a main action. */
.btn.link {
  min-height: 0; padding: 0; border: 0; background: none; box-shadow: none;
  color: var(--accent-ink); text-decoration: underline; text-underline-offset: 2px;
  font-weight: 400; display: inline; text-align: left;
}
.btn.link:hover:not([disabled]), .btn.link:active:not([disabled]) { background: none; text-decoration-thickness: 2px; }
.btn.link.back { justify-self: start; font-size: var(--text-sm); }
/* Disabled stays grey-filled: still a button, one that cannot be pressed now. */
.btn[disabled] { cursor: default; opacity: .55; }
/* A link drawn as a button — the developer's guide is a file to download (docs.js,
   widget.js), so it is an <a download>, and must not wear a link's underline. It
   takes the button's look, and an ordinary one keeps the button's ink. */
a.btn { display: inline-flex; text-decoration: none; }
a.btn:not(.primary):not(.danger) { color: var(--ink); }
/* Deleting or stopping something (plans/deleting-correspondence-plan.md §3c; #124
   §6). It wears the stop tone — and the word on it says what it does, because
   colour never carries meaning alone. */
.btn.danger {
  background: var(--stop-soft); border-color: var(--stop); color: var(--stop); font-weight: 600;
  box-shadow: 0 1px 0 color-mix(in srgb, var(--stop) 35%, transparent);
}
.btn.danger:hover:not([disabled]) { background: color-mix(in srgb, var(--stop-soft), var(--stop) 14%); }
.btn.danger:active:not([disabled]) { background: color-mix(in srgb, var(--stop-soft), var(--stop) 24%); }
/* Small: 26px, an action on each row of a list (Remove, Turn off) or beside a file
   or chip. Never a page or form action. */
.btn.small { font-size: var(--text-sm); line-height: 18px; min-height: 26px; padding: 3px 10px; }
.btn.link.small { min-height: 0; padding: 0; }
/* Busy: the words say it ("Saving…") and the button is locked. */
.btn[aria-busy="true"] { cursor: progress; }

.sources { display: grid; gap: 6px; font-size: var(--text-sm); color: var(--ink-2); margin: 0; padding: 0; }
.sources li { margin-left: 18px; }
.sources li > .btn { margin-left: var(--s-2); }
.sources li::marker { color: var(--ink-2); }
/* A fold's count, after its title: "Logos and signatures · 3" (ui.fold). */
.pane details > summary .fold-count { font-weight: 400; color: var(--ink-2); }

/* ── folds: every section on a screen that opens and closes ─────────────────
   The owner's review, 2026-10-07 (improvements plan B3): folded sections "all blend
   in". So EVERY <details> in the pane — Home's cards, "Where this came from", the
   setup guidance on Get started and Email settings, a legal document in full, and
   any fold a screen adds later — wears ONE look, which says "this opens":
     - an edge (--line-strong) and the page's own surface, with room around it;
     - a tinted header (--accent-soft), its words in --ink;
     - a chevron in --accent-ink, pointing right when closed and down when open —
       drawn here, so a screen writes a plain <summary> and gets it;
     - the focus ring inside the header, so a keyboard user sees which fold is next.
   The chevron and the words are what say it; tests/folds.test.mjs checks their
   contrast on the tint in light and both darks. The menu's groups are <details> too,
   but they are in the rail, not the pane: navigation keeps the menu's own look. */
.pane details {
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-lg);
  background: var(--surface);
  padding: 0 var(--s-4);
  margin: var(--s-3) 0;
}
.pane details > summary {
  list-style: none; cursor: pointer;
  display: flex; align-items: center; gap: var(--s-2);
  margin: 0 calc(-1 * var(--s-4));
  padding: var(--s-3) var(--s-4);
  min-height: 44px;
  border-radius: calc(var(--radius-lg) - 1px);
  background: var(--accent-soft);
  color: var(--ink);
  font-size: var(--text-base); font-weight: 600;
}
.pane details > summary::-webkit-details-marker { display: none; }
.pane details > summary::after {
  content: ""; flex: none; margin-left: auto;
  width: 8px; height: 8px;
  border-right: 2px solid var(--accent-ink); border-bottom: 2px solid var(--accent-ink);
  transform: rotate(-45deg); transition: transform .18s ease;
}
.pane details[open] > summary::after { transform: rotate(45deg); }
.pane details > summary:hover { background: color-mix(in srgb, var(--accent-soft), var(--accent) 10%); }
.pane details > summary:focus-visible { outline: var(--focus-width) solid var(--accent); outline-offset: -3px; }
.pane details[open] { padding-bottom: var(--s-4); }
/* Straight in a screen, the screen's own grid gap already spaces it. */
.pane .screen > details { margin-block: 0; }
.pane details[open] > summary {
  margin-bottom: var(--s-3);
  border-bottom: 1px solid var(--line);
  border-radius: calc(var(--radius-lg) - 1px) calc(var(--radius-lg) - 1px) 0 0;
}

/* ── message window: summary and two surfaces ───────────────────────────── */
/* The message window (owner 2026-11-02, plans/message-window-summary-2026-11-03.md):
   their message and our reply on two tinted surfaces, so a reader never loses which
   is whose. Each section keeps its title, so the tint is never the only signal. The
   cards inside take the section's surface instead of drawing their own. */
.pane details.surface-theirs { background: var(--surface-theirs); }
.pane details.surface-ours { background: var(--surface-ours); }
.pane details.surface-theirs .letter,
.pane details.surface-theirs .reply,
.pane details.surface-ours .reply { background: transparent; }
.summary { display: grid; gap: var(--s-3); }
.summary-line { display: grid; grid-template-columns: 160px 1fr; gap: var(--s-1) var(--s-4); align-items: start; }
.summary-line p { margin: 0 0 var(--s-1); max-width: 64ch; }
.summary-checks { margin: var(--s-1) 0 0; padding-left: var(--s-5); }
@media (max-width: 600px) {
  .summary-line { grid-template-columns: 1fr; }
}

/* ── cards ─────────────────────────────────────────────────────────────── */

/* A card: one bordered box on a page that holds several (a connection, a division,
   a company file). 8px corners, a 1px border, 16px inside; its heading is an h3. */
.card {
  display: grid; gap: var(--s-2); align-content: start; min-width: 0;
  border: 1px solid var(--line); border-radius: var(--radius-lg);
  background: var(--surface); padding: var(--s-4);
}
.card > h3, .card > h4 { margin: 0; }
.cards { display: grid; gap: var(--s-3); }

/* ── things to notice ──────────────────────────────────────────────────── */

/* STYLE.md "Messages": one box shape — 8px corners, a 1px border, a tinted fill,
   the first line bold — in five kinds. ui.js message() draws the first four:
     info       .callout.quiet  grey   context, where this came from, suggestions, empty lists
     attention  .callout        amber  something to know or do first: paused, not finished
     problem    .callout.bad    red    something failed; always says what to do next
     done       .callout.ok     green  a success that must stay on screen
   and the fifth is `.preview`, "Before saving". No thick borders, no side bars. */
.callout {
  display: grid; gap: 6px;
  border-radius: var(--radius-lg); padding: 12px 16px;
  background: var(--wait-soft); color: var(--wait);
  border: 1px solid color-mix(in srgb, var(--wait) 28%, transparent);
  font-size: var(--text-base);
}
.callout b { color: inherit; }
.callout > b:first-child { font-weight: 600; }
.callout p { max-width: 75ch; }
.callout .actions { padding-top: 2px; }
.callout.quiet { background: var(--surface-2); color: var(--ink-2); border-color: var(--line); }
.callout.quiet > b:first-child { color: var(--ink); }
/* A grey box folded behind a ? (ui.js helpFold, owner 2026-10-31): the bold line
   and a round ?; the words show in a bubble while the pointer is on the line or the
   ?, and under the line once it is pressed (.fold-open). The bubble starts right at
   the line's foot, and waits a moment before it goes, so the pointer can move into
   it to read or select. */
.fold-head { position: relative; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; }
.fold-head > .fold-label { font-weight: 600; color: var(--ink); cursor: help; }
.fold-head > p.fold-label { font-weight: 400; margin: 0; max-width: 75ch; }
.fold-q {
  display: inline-grid; place-items: center; flex: none;
  width: 22px; height: 22px; padding: 0; border-radius: 50%;
  border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink-2);
  font: 600 var(--text-sm)/1 var(--sans); cursor: pointer;
}
.fold-q:hover { border-color: var(--accent); color: var(--accent-ink); }
.fold-q[aria-expanded="true"] { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.fold-details {
  position: absolute; top: 100%; left: 0; z-index: 30;
  display: grid; gap: 6px; width: max-content; max-width: min(60ch, calc(100vw - 48px));
  padding: 10px 14px; border: 1px solid var(--line); border-radius: var(--radius-lg);
  background: var(--surface); color: var(--ink-2); box-shadow: var(--shadow);
  font-weight: 400; visibility: hidden; opacity: 0;
  transition: opacity .12s ease .25s, visibility 0s linear .37s;
}
.fold-details p { margin: 0; max-width: 75ch; }
.fold-label:hover ~ .fold-details, .fold-q:hover ~ .fold-details,
.fold-q:focus-visible ~ .fold-details, .fold-details:hover {
  visibility: visible; opacity: 1; transition-delay: 0s;
}
.fold-open .fold-details {
  position: static; flex: 0 0 100%; width: auto; max-width: none;
  padding: 2px 0 0; border: 0; background: none; box-shadow: none;
  visibility: visible; opacity: 1; transition: none;
}
/* A long note or hint folded after its first sentence (ui.js foldLine, STYLE.md
   "Concise by default", owner 2026-11-04): the sentence keeps the note's own look;
   the ? and the bubble are the grey box's. */
.fold-line { position: relative; }
.fold-line .fold-head { display: inline; position: static; }
.fold-line .fold-head > .fold-label { font-weight: inherit; color: inherit; cursor: help; }
.fold-line .fold-q { display: inline-grid; vertical-align: text-bottom; margin-left: 6px; width: 18px; height: 18px; font-size: var(--text-xs); }
.fold-line .fold-details { font-size: inherit; }
.fold-line.fold-open .fold-details { display: block; margin-top: 4px; }
/* The × on every message box (ui.js closable, owner 2026-10-30): top right, in the
   box's own colour, with room kept for it so words never run under it. */
.callout { position: relative; }
.callout:has(> .close-x) { padding-right: 44px; }
.callout[hidden] { display: none; }
.callout > .btn.link.close-x {
  position: absolute; top: 6px; right: 6px;
  width: 30px; height: 30px; min-height: 0; padding: 0;
  display: grid; place-items: center;
  color: inherit; text-decoration: none;
  font-size: var(--text-xl); line-height: 1; border-radius: var(--radius);
}
.callout > .btn.link.close-x:hover:not([disabled]) {
  background: color-mix(in srgb, currentColor 12%, transparent); text-decoration: none;
}
/* An RMA form's fields (TODO #332): label, then what the form said. */
.rma-fields { display: grid; grid-template-columns: max-content 1fr; gap: 2px 14px; margin: 0; }
.rma-fields dt { color: var(--ink-2); }
.rma-fields dd { margin: 0; overflow-wrap: anywhere; min-width: 0; }
.callout.bad {
  background: var(--stop-soft); color: var(--stop);
  border-color: color-mix(in srgb, var(--stop) 28%, transparent);
}

/* "Before saving" — the panel every save shows first (§3 D9; STYLE.md "Messages").
   The fifth message kind: the accent's tint and edge, its own "Before saving"
   heading, and the save under it. ui.js previewBox() draws it. */
.preview {
  display: grid; gap: 8px;
  border: 1px solid color-mix(in srgb, var(--accent) 45%, transparent);
  border-radius: var(--radius-lg); background: var(--accent-soft);
  padding: 12px 16px; font-size: var(--text-base);
}
.preview > .label { color: var(--accent-ink); }
.preview ul { display: grid; gap: 6px; margin: 0; padding: 0; }
.preview li { margin-left: 18px; }
/* Danger sits apart (STYLE.md "Where buttons go"): at the end of the area, after a
   thin rule, never next to Save. A delete's confirmation reads as a stop, not as a
   save: ui.js confirmInPlace() draws it as `.preview.confirm-stop`. */
.delete-zone { border-top: 1px solid var(--line); padding-top: 14px; margin-top: 6px; display: grid; gap: 8px; justify-items: start; }
.learn-zone { border-top: 1px solid var(--line); padding-top: 14px; margin-top: 6px; display: grid; gap: 8px; justify-items: start; }
.delete-form .preview, .preview.confirm-stop {
  background: var(--stop-soft); border-color: color-mix(in srgb, var(--stop) 40%, transparent);
}
.delete-form .preview > .label, .preview.confirm-stop > .label { color: var(--stop); }
.preview.confirm-stop > p { color: var(--ink); }
.case-history { display: grid; gap: 6px; margin: 0; padding: 0; font-size: var(--text-base); }
.case-history li { margin-left: 18px; }

/* ── forms ─────────────────────────────────────────────────────────────── */

.form { display: grid; gap: 14px; max-width: 62ch; }
/* A heading inside a form ("Add a rule"). Sized here so no screen reaches for an
   inline style to do it — the mockup's one inline style was this. */
.form h3, .screen h3 { font-size: var(--text-lg); font-weight: 600; margin-top: 6px; }
/* STYLE.md "Type": page title 21, dialog title 18, section 16, card title 14, body
   14, help 13, labels and chips 12; weights 400 and 600. A heading a screen writes
   with no class of its own takes the section or card size — never the browser's,
   which drew "Your rules" bigger than the page title. :where() keeps these weaker
   than any class rule, so a dialog's or a card's own heading still wins. */
:where(.screen, .message-dialog, .help-panel) h2,
:where(.screen, .message-dialog, .help-panel) h3 { font-size: var(--text-lg); font-weight: 600; }
:where(.screen, .message-dialog, .help-panel) h4,
:where(.screen, .message-dialog, .help-panel) h5 { font-size: var(--text-base); font-weight: 600; margin: 0; }
.muted { color: var(--ink-2); }
/* One labelled part of a page that holds several (Your settings, TODO #74; Email
   settings' Sending and Receiving, TODO #75): its own heading, a hairline above
   every part but the first, so the page reads as labelled sections rather than one
   long form. A deep link that landed on a section scrolls it to the top with room
   for the heading. */
.settings-section { display: grid; gap: 10px; scroll-margin-top: 16px; }
.settings-section + .settings-section { border-top: 1px solid var(--line); padding-top: 16px; }
/* A section's heading with its state chip beside it (Email settings: "Sending · On"). */
.settings-section > h3.section-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.settings-section > h3:focus { outline: none; }
.settings-section > h3:focus-visible { outline: var(--focus-width) solid var(--accent); outline-offset: 2px; }
.field { display: grid; gap: 6px; }
.field label { font-size: var(--text-sm); font-weight: 600; }
.field .optional { font-weight: 400; color: var(--ink-2); }
.field + .field, .field + fieldset, fieldset + .field, fieldset + fieldset { margin-top: var(--s-4); }
.form > .field + .field, .form > .field + fieldset, .form > fieldset + .field, .form > fieldset + fieldset { margin-top: 0; }
/* Fields side by side on one line, wrapping when narrow (Invite your colleagues: the
   email and its role menu, #17). `.field-slot` holds a field drawn again with its
   error; `.field-menu` is a field whose control is a menu button, as wide as it is. */
.field-line { display: flex; flex-wrap: wrap; align-items: flex-start; gap: var(--s-3); }
.field-line > .field-slot { flex: 1 1 220px; min-width: 0; }
.field-line > .field.field-menu { flex: 0 0 auto; margin-top: 0; }
/* The file picker's own button wears the secondary button's look. */
input[type="file"] { font: inherit; font-size: var(--text-sm); color: var(--ink-2); max-width: 100%; }
input[type="file"]::file-selector-button {
  font: inherit; font-size: var(--text-base); cursor: pointer; margin-right: var(--s-3);
  min-height: 34px; padding: 6px 14px; border-radius: var(--radius);
  border: 1px solid var(--btn-line); background: var(--surface-3); color: var(--ink);
}
input[type="file"]::file-selector-button:hover { background: color-mix(in srgb, var(--surface-3), var(--ink) 8%); }
.help, .field .help { font-size: var(--text-sm); color: var(--ink-2); }
.field input, .field textarea, .field select {
  font: inherit; font-size: var(--text-base);
  color: var(--ink); background: var(--surface);
  border: 1px solid var(--line-strong); border-radius: var(--radius);
  padding: 9px 11px; width: 100%;
}
.field input:focus-visible, .field textarea:focus-visible, .field select:focus-visible {
  border-color: var(--accent);
}
.field input, .field select { max-width: 480px; }
/* A COLOUR PICKER shows its colour (Website widget → How the chat box looks; Front
   Office review 2026-11-18, #22). `.field input`'s padding and full width squeezed
   the browser's swatch to nothing, so a colour showed as a black or white box: a
   picker is a 44 × 34 swatch with a thin frame, its colour filling it. */
.field input[type="color"], input[type="color"] {
  flex: none; width: 44px; height: 34px; max-width: none; padding: 2px; cursor: pointer;
  border: 1px solid var(--line-strong); border-radius: var(--radius); background: var(--surface);
}
input[type="color"]::-webkit-color-swatch-wrapper { padding: 0; }
input[type="color"]::-webkit-color-swatch { border: 0; border-radius: calc(var(--radius) - 2px); }
input[type="color"]::-moz-color-swatch { border: 0; border-radius: calc(var(--radius) - 2px); }
/* The picker and the same colour as text, side by side; the text is as wide as a code. */
.colour-pick { display: flex; flex-wrap: wrap; gap: var(--s-2); align-items: center; }
.field .colour-pick input[type="text"] { width: calc(9ch + 22px); min-height: 34px; padding: 6px 10px; font-family: var(--mono); }
/* The colours read off the company's website, as chips to press: the colour, its
   code under it; the one that is the colour now is pressed (accent ring). */
.colour-chips { display: flex; flex-wrap: wrap; gap: var(--s-2); }
.colour-chip {
  display: inline-grid; justify-items: center; gap: 4px; padding: 6px; min-width: 44px; cursor: pointer;
  font: inherit; color: var(--ink-2); background: var(--surface);
  border: 1px solid var(--line-strong); border-radius: var(--radius);
}
.colour-chip:hover { border-color: var(--ink-2); }
.colour-chip[aria-pressed="true"] { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); color: var(--ink); }
.colour-chip:focus-visible { outline: var(--focus-width) solid var(--accent); outline-offset: var(--focus-offset); }
.colour-chip-swatch {
  display: block; width: 44px; height: 28px; border-radius: calc(var(--radius) - 2px);
  background: var(--chip-colour, transparent); box-shadow: inset 0 0 0 1px var(--line);
}
.colour-chip-code { font-family: var(--mono); font-size: var(--text-xs); }
.field textarea { min-height: 128px; resize: vertical; font-family: var(--sans); }
/* A field's error: under it, red, saying how to fix it; the control gets a red edge. */
.field .error, .note.bad, .help.bad { color: var(--stop); font-size: var(--text-sm); }
.field.has-error input, .field.has-error textarea, .field.has-error select,
.pane [aria-invalid="true"] { border-color: var(--stop); }
/* EVERY CONTROL LOOKS LIKE THE FIELD'S (STYLE.md "Forms"): a text box, drop-down or
   text area a screen puts anywhere in the pane or a dialog — inside a callout, a
   row, a toolbar — wears the field's border, padding and corners, never the
   browser's own small widget. Classed controls (the help question, the reply
   helper) keep their own rules, which come later or are more specific. */
:where(.pane, .message-dialog) :where(input:not([type]), input[type="text"], input[type="search"], input[type="email"],
  input[type="url"], input[type="tel"], input[type="number"], input[type="password"], input[type="date"],
  input[type="time"], input[type="datetime-local"], select, textarea) {
  font: inherit; font-size: var(--text-base); line-height: 20px;
  color: var(--ink); background: var(--surface);
  border: 1px solid var(--line-strong); border-radius: var(--radius);
  padding: 6px 10px; min-height: 34px; max-width: 100%;
}
:where(.pane, .message-dialog) :where(input, select, textarea):focus-visible { border-color: var(--accent); }
:where(.pane, .message-dialog) :where(input, select, textarea)[disabled] { opacity: .6; cursor: default; }
/* CHECK BOXES AND RADIOS (STYLE.md "Check marks"): the browser's own box at 18px,
   in the accent — a white tick on blue when checked. The box on the left, the
   words on the right and clickable too (`label.check`), help under the words. */
input[type="checkbox"], input[type="radio"] {
  width: 18px; height: 18px; margin: 1px 0 0; flex: none; accent-color: var(--accent); cursor: pointer;
}
.check input[type="radio"] { flex: none; }
.check > span { display: grid; gap: 2px; min-width: 0; }
.check .help { font-weight: 400; }
/* A group of radios or check boxes: labelled like a field, no browser box around it. */
.pane fieldset, .message-dialog fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
.pane legend, .message-dialog legend { padding: 0; margin-bottom: 6px; font-size: var(--text-sm); font-weight: 600; }
.choices-list { display: grid; gap: 8px; }
/* A tick box and its sentence, box FIRST, on one line. The `.field input` rule
   above gave checkboxes width:100% too, so the box floated mid-row and the
   sentence wrapped under it — hard to find on "Accept our terms" (2026-09-24). */
.field input[type="checkbox"], .field input[type="radio"] {
  width: auto; padding: 0; border: 0; background: none;
}
.check { display: flex; align-items: flex-start; gap: 10px; cursor: pointer; }
.check input[type="checkbox"] {
  flex: none; width: 18px; height: 18px; margin: 1px 0 0; accent-color: var(--accent);
}
.check, .field label.check { font-weight: 400; font-size: var(--text-base); }

/* The reply helper: the reviewer's words and the suggestion, side by side. */
.assist { display: grid; gap: 10px; }
.assist-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.assist-row input { flex: 1 1 240px; min-width: 0; padding: 7px 10px; font: inherit;
  border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); color: var(--ink); }
.assist-result { display: grid; gap: 10px; }
.assist-result:empty { display: none; }
.assist-compare { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; }
.assist-col { border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 12px; background: var(--surface-2); }
.assist-col p { margin: 0 0 8px; overflow-wrap: anywhere; }

/* A conversation (STYLE.md "Conversations", TODO #375; ui.turn and ui.composer):
   the person's turns on the right in the accent's soft colour, Broa's as cards on
   the left, and the composer stuck to the foot of the pane. Ask or teach Broa
   (knowledgechat.js) is the one screen that uses them. */
.talk { display: grid; gap: var(--s-4); max-width: 860px; }
.turn-you {
  justify-self: end; max-width: 70%;
  background: var(--accent-soft); color: var(--ink);
  border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent);
  border-radius: var(--radius-lg); padding: 10px 14px; overflow-wrap: anywhere;
}
.turn-you .label { display: block; margin-bottom: 2px; }
.turn-broa { display: grid; gap: var(--s-3); }
.turn-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.used { display: grid; gap: 4px; margin: 0; padding: 0; list-style: none; font-size: var(--text-sm); }
.composer {
  position: sticky; bottom: 0; max-width: 860px;
  background: var(--surface); border-top: 1px solid var(--line); padding-top: var(--s-3);
  display: grid; gap: 8px;
}
.composer textarea { min-height: 64px; }
.examples { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.examples > .btn.primary { margin-left: auto; }
@media (max-width: 640px) { .turn-you { max-width: 100%; } }

/* A reply's files (TODO #163, 2026-10-09; correspondence.js replyFiles): a chip
   each, under the reply, with a small × inside; Broa's own carry a quiet
   Suggested mark. Names wrap rather than push the page sideways at 375px. */
.reply-files { display: grid; gap: 6px; min-width: 0; }
.reply-files[hidden] { display: none; }
.reply-files p { margin: 0; }
.reply-file-chips { gap: 6px; }
.reply-file {
  white-space: normal; max-width: 100%; min-width: 0; flex-wrap: wrap;
  row-gap: 2px; padding: 2px 4px 2px 9px; line-height: 1.35;
}
.reply-file > .dot + span { overflow-wrap: anywhere; min-width: 0; color: var(--ink-2); }
.reply-file.stop > .dot + span { color: inherit; }
.reply-file-mark {
  font-size: var(--text-xs); font-weight: 400; color: var(--ink-2);
  border-left: 1px solid var(--line); padding-left: 6px;
}
.reply-file.stop .reply-file-mark { color: inherit; border-left-color: currentColor; }
.reply-file .btn.small {
  padding: 0 6px; min-width: 22px; min-height: 22px; line-height: 1; font-size: var(--text-base);
  box-shadow: none;
}
.reply-file .btn.small:focus-visible { outline: var(--focus-width) solid var(--accent); outline-offset: 1px; }
/* The sentence that stops Approve: the warning look every callout has. */
.reply-files .reply-files-blocked {
  background: var(--wait-soft); color: var(--wait);
  border: 1px solid color-mix(in srgb, var(--wait) 28%, transparent);
  border-radius: var(--radius); padding: 7px 10px; font-size: var(--text-sm);
}
.reply-file-picker { margin-top: 8px; min-width: 0; }
.reply-file-picker p { margin: 0; }
.reply-file-picker .field { display: grid; gap: 8px; }
.reply-file-picker .check > span { min-width: 0; overflow-wrap: anywhere; }
.reply-file-picker .muted { color: var(--ink-2); font-weight: 400; }
.reply-file-picker .note:empty { display: none; }

.field .fixed {
  font-family: var(--mono); font-size: var(--text-sm); color: var(--ink-2);
  background: var(--surface-2); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 9px 11px;
}

/* ── what the shell itself says ────────────────────────────────────────── */

.center-note { color: var(--ink-2); font-size: var(--text-base); padding: 8px 0; }
.loading { color: var(--ink-2); font-size: var(--text-base); padding: 8px 0; }
.noscript-note { padding: var(--s-5); }

.toasts {
  position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%);
  display: grid; gap: 8px; z-index: 20; width: min(92vw, 460px);
}
.toast {
  background: var(--ink); color: var(--ground);
  border-radius: var(--radius-lg); padding: 10px 14px; font-size: var(--text-base);
  box-shadow: var(--shadow);
  animation: toast-in .18s ease;
}
/* The message window's own line of them (TODO #443): a modal window covers the
   page's, so what a press did is said inside the window, in the same look. */
.dialog-toasts { z-index: 40; }
@keyframes toast-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* ── narrow width: the same rail opens from the left ──────────────────── */

@media (max-width: 860px) {
  body.drawer-open { overflow: hidden; }
  .app { display: block; min-height: 100%; }
  .mobile-bar {
    position: sticky; top: 0; z-index: 30;
    display: grid; grid-template-columns: 36px minmax(132px, auto) minmax(0, 1fr);
    align-items: center; gap: var(--s-3); min-height: 56px;
    padding: var(--s-2) var(--s-4);
    background: color-mix(in srgb, var(--surface) 92%, transparent);
    border-bottom: 1px solid var(--line);
    backdrop-filter: saturate(1.4) blur(10px);
  }
  .mobile-menu {
    display: grid; place-content: center; gap: 4px;
    width: 36px; height: 36px; padding: 0;
    background: var(--surface); color: var(--ink);
    border: 1px solid var(--line-strong); border-radius: var(--radius);
    cursor: pointer;
  }
  .mobile-menu span { display: block; width: 16px; height: 2px; background: currentColor; }
  .mobile-brand {
    display: flex; align-items: center; gap: var(--s-2); min-width: 132px;
    font: inherit; text-align: left; cursor: pointer;
    border: 0; border-radius: var(--radius); padding: 3px 8px 3px 4px;
  }
  .mobile-brand img { width: 28px; height: 28px; flex: none; }
  .mobile-brand > span { display: grid; line-height: 1.1; }
  .mobile-brand b { font-size: var(--text-base); white-space: nowrap; }
  .mobile-brand small { font-size: 10px; }
  .mobile-title {
    min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
    color: var(--ink-2); font-size: var(--text-sm); text-align: right;
  }
  .rail {
    position: fixed; inset: 0 auto 0 0; z-index: 60;
    width: min(88vw, 400px); max-height: 100dvh; overflow-y: auto;
    border-right: 1px solid var(--line); border-bottom: 0;
    padding: var(--s-4) var(--s-3) var(--s-5);
    box-shadow: var(--shadow);
    transform: translateX(-102%); visibility: hidden;
    transition: transform .18s ease, visibility 0s linear .18s;
  }
  .rail.is-open {
    transform: translateX(0); visibility: visible;
    transition-delay: 0s;
  }
  .rail-backdrop {
    display: block; position: fixed; inset: 0; z-index: 50;
    background: rgba(0, 0, 0, .45); opacity: 0; pointer-events: none;
    transition: opacity .18s ease;
  }
  .rail-backdrop.is-open { opacity: 1; pointer-events: auto; }
  /* The drawer has no width to drag and no Hide menu (railsize.js does nothing here). */
  .rail-handle, .btn.rail-hide, .btn.rail-show { display: none; }
  .pane { padding: 18px 16px 32px; }
  .mail-row { grid-template-columns: 6px minmax(0, 1fr) 128px; }
  .mail-row .received-cell { display: none; }
  .mail-row .reason-cell { display: none; }
  .mail-row .reason-narrow { display: block; }
  .mail-row .priority-narrow { display: inline; }
  .mail-row .assigned-narrow { display: block; }
  .shelf-row { grid-template-columns: minmax(0, 1fr) 96px; }
  .shelf-row.team { grid-template-columns: minmax(0, 1.6fr) minmax(0, 1.2fr); }
  .shelf-row.customers { grid-template-columns: minmax(0, 1fr) 118px 88px; }
  .shelf-row.facts { grid-template-columns: minmax(0, 1fr) 96px; }
  .shelf-row.rules { grid-template-columns: minmax(0, 1fr) 96px; }
  .shelf-row.rules.with-remove { grid-template-columns: minmax(0, 1fr) auto 96px; }
  .shelf-row.tickets, .shelf-row.tickets.with-by { grid-template-columns: minmax(0, 1fr) 150px; }
  .shelf-row.records { grid-template-columns: 8px 132px minmax(0, 1fr); }
  .record-head { flex-wrap: wrap; }
  .record-commands { width: 100%; justify-content: flex-start; }
  .hide-narrow { display: none !important; }
  .elevation .btn { margin-left: 0; }
  .message-dialog { width: calc(100vw - var(--s-4)); max-height: calc(100dvh - var(--s-4)); }
  .message-dialog-head { padding: var(--s-3) var(--s-4); }
  .message-dialog-head { flex-wrap: wrap; }
  .message-dialog-commands { order: 3; width: 100%; justify-content: flex-start; }
  .message-dialog-body { padding: var(--s-4); }
  /* Only the groups a phone needs open on arrival; the rest are one tap away. */
  .rail .group[open] > summary { position: sticky; top: 0; }
}

@media (max-width: 420px) {
  .theme { grid-template-columns: 1fr; }
  .tally div { flex: 1 1 100%; }
}

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

/* ── a report: one bar per person, on one scale ─────────────────────────────
   timings.js (How quickly we answer). The track and fill are spans, so both
   need display:block to take a height. Every bar is drawn against the same stated
   top, starting at zero — the screen says that top in words under the bars. */
.bars { display: grid; gap: 12px; }
.bar-row {
  display: grid; grid-template-columns: minmax(0, 14rem) minmax(0, 1fr) 6.5rem;
  gap: 12px; align-items: center; font-size: var(--text-base);
}
.bar-track { display: block; height: 10px; border-radius: 999px; background: var(--surface-3); overflow: hidden; }
.bar-fill { display: block; height: 100%; border-radius: 999px; background: var(--accent); }
.bar-fill.slow { background: var(--wait); }
.bar-row .num { text-align: right; }
@media (max-width: 860px) {
  .bar-row { grid-template-columns: minmax(0, 1fr) 5.5rem; }
  .bar-row .bar-track { grid-column: 1 / -1; order: 3; }
}

/* ── who has a message (assignment-and-timing plan) ─────────────────────────
   Wide: the "Assigned" column — the holder's name (.holder-name; .unowned is the
   quiet "Unassigned") over how long it has waited (.holder). Phone width drops
   that column (.hide-narrow) and shows .assigned-narrow, one compact line under
   the subject, so who has it is still on the row. The bar heads one message. */
.holder-name { display: block; font-size: var(--text-sm); color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.holder-name.unowned { color: var(--ink-2); }
.holder { display: block; margin-top: 2px; font-size: var(--text-xs); color: var(--ink-2); }
.holder b { color: var(--ink-2); font-weight: 600; }
.assigned-narrow { display: none; margin-top: 3px; font-size: var(--text-xs); color: var(--ink-2); }
.assigned-narrow b { color: var(--ink-2); font-weight: 600; }
.owner-bar {
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px;
  border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface-2);
  padding: 10px 14px; font-size: var(--text-base);
}
.owner-bar .who-has { display: grid; gap: 1px; }
.owner-bar .who-has span { font-size: var(--text-xs); color: var(--ink-2); }
.owner-bar .actions { margin-left: auto; padding-top: 0; }

/* `hidden` must always win. .callout and .preview set display:grid, which beat the
   browser's own [hidden] rule, so a panel a screen had hidden stayed on the page. */
/* ── a page that is words: documentation (docs.js) ──────────────────────────
   The Front Desk's one prose shape. Every screen before this was a list, a form
   or a panel, and `p { margin: 0 }` means a run of paragraphs with no block of
   its own reads as one wall. A `.prose` section IS the block: a heading and the
   words under it, spaced once, wrapped at a readable measure. Nothing here
   parses anything — the pages are built as nodes (website-widget seams §9). */
.prose { display: grid; gap: 10px; align-content: start; }
.prose h3 { margin-bottom: 2px; }
.prose h4 { font-size: var(--text-base); font-weight: 600; margin: 4px 0 0; }
/* The user's manual (docs.js manualPage, TODO #91): the runbook's lists and tables,
   readable at the pane's width; a wide table scrolls inside its own box. */
.manual-list { display: grid; gap: 8px; margin: 0; padding-left: 22px; }
.manual-list > li > p + p, .manual-list > li > * + * { margin-top: 6px; }
.table-wrap { overflow-x: auto; }
.manual-table { border-collapse: collapse; width: 100%; font-size: var(--text-sm); }
.manual-table th, .manual-table td { text-align: left; vertical-align: top; padding: 6px 8px; border-bottom: 1px solid var(--line); }
.manual-table th { font-weight: 600; color: var(--ink-2); }
/* A PDF read inside the desk (docs.js pdfScreen, TODO #92): the browser's own viewer,
   as tall as the window allows, never wider than the pane. */
.pdf-frame { width: 100%; height: calc(100vh - 220px); min-height: 420px; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface); }
.prose p, .prose > ul, .prose > ol { max-width: 68ch; }
.prose code {
  font-family: var(--mono); font-size: var(--text-sm);
  background: var(--surface-2); border-radius: var(--radius); padding: 1px 5px;
}

/* The two lines a client pastes into their own site, and anything else shown
   exactly as it must be typed. It WRAPS rather than scrolls: the button does the
   copying, and a person reading on a phone still sees all of it. */
.snippet {
  font-family: var(--mono); font-size: var(--text-sm); line-height: 1.5;
  color: var(--ink-2); background: var(--surface-2);
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: 11px 13px; margin: 0;
  white-space: pre-wrap; overflow-wrap: anywhere; tab-size: 2;
}

/* A settings table: the name (with its values) beside one line of meaning. Its
   own columns, because the four-column .shelf-row squeezes a sentence into 96px.
   The narrow rule is needed too: .shelf-row.setting outranks the phone-width
   .shelf-row rule above, so without this the 15rem column survives at 320px. */
.shelf-row.setting { grid-template-columns: minmax(0, 15rem) minmax(0, 1fr); align-items: start; }
.shelf-row.setting code { overflow-wrap: anywhere; }
@media (max-width: 860px) {
  .shelf-row.setting { grid-template-columns: minmax(0, 1fr); gap: 4px; }
}

/* ── Get started (getstarted.js, invite.js, company.js) ─────────────────────
   One row per step: what it asks, what was found and what skipping it costs on
   the left; the state (a word and a tone, never colour alone) and the one button
   that finishes it on the right. At phone width the side drops under the body. */
.steps { display: grid; gap: 12px; }
.steps-list { list-style: none; margin: 0; padding: 0; display: grid; }
.step {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 14px; align-items: start;
  padding: 14px 0; border-bottom: 1px solid var(--line);
}
.step-body { display: grid; gap: 4px; }
.step-body p { max-width: 64ch; }
.step-title { display: flex; align-items: baseline; gap: 10px; }
.step-num {
  font-family: var(--sans); font-variant-numeric: tabular-nums; font-size: var(--text-xs); color: var(--ink-2);
  border: 1px solid var(--line-strong); border-radius: var(--radius);
  min-width: 22px; height: 22px; display: inline-grid; place-items: center;
}
.step-side { display: grid; gap: 8px; justify-items: end; }
.step.unknown .step-body > p:not(.note) { color: var(--ink-2); }
@media (max-width: 860px) {
  .step { grid-template-columns: minmax(0, 1fr); }
  .step-side { justify-items: start; grid-auto-flow: column; justify-content: start; align-items: center; }
}
/* An address or a link a client copies. It wraps rather than scrolls. */
.addr-box { display: grid; gap: 8px; border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 14px 16px; }
.addr-line { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.addr {
  font-family: var(--mono); font-size: var(--text-sm); background: var(--surface-2);
  border: 1px solid var(--line); border-radius: var(--radius); padding: 6px 9px;
  overflow-wrap: anywhere; max-width: 100%;
}
.td-answer { white-space: pre-wrap; max-width: 68ch; }
/* A legal document read in full on Get started: its own scroll box. */
.pane [data-legal-body] { max-height: 26rem; overflow: auto; }
.shelf-row.invites { grid-template-columns: minmax(0, 1fr) 96px 150px auto; }
@media (max-width: 860px) {
  .shelf-row.invites { grid-template-columns: minmax(0, 1fr) auto; }
  .shelf-row.invites > :nth-child(2), .shelf-row.invites > :nth-child(3) { display: none; }
}

[hidden] { display: none !important; }

/* Paused (plans/client-onboarding-plan.md §3h): the company's answering is held. */
.callout.paused { margin: 0 0 16px; }
.callout.paused[hidden] { display: none; }
.callout.paused p { max-width: 70ch; }
/* The platform switch (owner, 2026-10-05): DRAFT_AUTONOMY below `on` overrides
   every company's choices, so it is on every screen with a lead of its own —
   never a footnote under a word that says On. Since the style guide (2026-10-29)
   it is the same attention box as Paused, stacked with it (STYLE.md "Banners"). */
.callout.platform-switch { margin: 0 0 16px; }
.callout.platform-switch p { margin: 0; max-width: 75ch; }
.callout.platform-switch code { font-family: var(--mono); font-weight: 600; }
.callout.platform-switch[hidden] { display: none; }

/* Broa notices (TODO #141): one banner per notice from Broa, at the top of every
   screen. The level is said in words on the banner and by its edge — never by
   colour alone: information in the accent, planned work amber, a problem red. A
   problem has no Close button while it shows. Tokens only, so both themes hold. */
.broa-notices { display: grid; gap: 8px; margin: 0 0 16px; }
.broa-notices[hidden] { display: none; }
.broa-notice {
  display: flex; gap: 12px; align-items: flex-start;
  border-radius: var(--radius-lg); padding: 12px 16px;
  border: 1px solid var(--line);
  background: var(--surface-2); color: var(--ink);
  font-size: var(--text-base);
}
.broa-notice.level-maintenance { background: var(--wait-soft); border-color: color-mix(in srgb, var(--wait) 28%, transparent); }
.broa-notice.level-problem { background: var(--stop-soft); border-color: color-mix(in srgb, var(--stop) 28%, transparent); }
.broa-notice-words { display: grid; gap: 4px; flex: 1; min-width: 0; }
.broa-notice-words p { margin: 0; max-width: 75ch; overflow-wrap: anywhere; }
.broa-notice-level { font-size: var(--text-xs); font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-2); }
.broa-notice.level-maintenance .broa-notice-level { color: var(--wait); }
.broa-notice.level-problem .broa-notice-level { color: var(--stop); }
.broa-notice-text { white-space: pre-line; }
.broa-notice > .btn { flex: none; }
/* Export your data (export.js): one export per row, its state, progress and download. */
.shelf-row.export { grid-template-columns: minmax(0, 1fr); }
.shelf-row.export p { margin: 0 0 6px; }
.export-make { display: grid; gap: 12px; margin: 8px 0 20px; justify-items: start; }
/* Sending (sending.js): connecting a mail system. The setup steps happen in the
   provider's own console, so anything that must match there is copied rather than
   retyped — a scope or a policy command differing by one character fails with an
   error that does not name the character. */
/* .guidance is a fold: its look is the pane's one fold look (see "folds"). */
.setup-steps { margin: 0; padding-left: 22px; display: grid; gap: 14px; }
.setup-steps li { font-size: var(--text-sm); }
.setup-steps p { margin: 4px 0 0; font-size: var(--text-sm); color: var(--ink-2); }
.copyrow { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 6px; }
.copyable {
  font-family: var(--mono); font-size: var(--text-xs); background: var(--surface-3);
  border: 1px solid var(--line); border-radius: var(--radius); padding: 4px 8px;
  overflow-wrap: anywhere; user-select: all;
}
/* Is Broa really reading it (sending.js, getstarted.js; cleanup C15): one line per
   connected mailbox — when Broa last looked, and whether it worked. Since the style
   guide (2026-10-29) a failure is the red problem box (`.callout.bad`) with what to
   do in it, and the mailbox's chip agrees; a test read back is the green done box. */
.reading-status { display: grid; gap: 4px; margin: 6px 0 2px; }
.reading-status p { margin: 0; }
.reading-line[title] { cursor: help; }
.reading-checks { margin: 0; padding-left: 20px; display: grid; gap: 4px; }
.callout.ok {
  background: var(--ok-soft); color: var(--ok);
  border-color: color-mix(in srgb, var(--ok) 28%, transparent);
}
/* How replies go out (autonomy.js; plans/autonomous-email-plan.md §3.6, TODO #18).
   Each kind of question is one card: its record, its choice and its pauses. The choice
   is the card's toggle (owner, 2026-11-06), in the one column on the right that every
   kind and the pause share; On and Off are said in words above the kinds. */
.autonomy-kinds, .autonomy-settings, .autonomy-rails, .autonomy-phase, .autonomy-company { display: grid; gap: 10px; }
.kind-row {
  display: grid; gap: 6px;
  border: 1px solid var(--line); border-radius: var(--radius-lg);
  padding: 12px 14px; background: var(--surface);
}
.kind-row.focus { border-color: var(--accent); }
.kind-row h4 { margin: 0; font-size: var(--text-base); font-weight: 600; }
.kind-row p { margin: 0; }
.kind-row .chip { white-space: normal; }
.autonomy-settings input[type="number"] { max-width: 8em; }
.autonomy-settings input[type="text"] { width: 100%; max-width: 60ch; }
/* "Sending by itself in 4:12 · Stop" — under the row of an automatic reply in its
   wait (correspondence.js waitStrip). Its own strip, not inside the row: the row is
   a button, and Stop must be a button of its own. The countdown is monospaced so it
   does not jitter as the digits change. */
.auto-wait {
  display: flex; align-items: center; flex-wrap: wrap; gap: 8px;
  padding: 6px 6px 10px 22px; border-bottom: 1px solid var(--line);
  font-size: var(--text-sm); color: var(--ok);
}
.auto-wait-words { font-family: var(--sans); font-variant-numeric: tabular-nums; }
.auto-wait .btn { padding-top: 3px; padding-bottom: 3px; font-size: var(--text-sm); }
/* "Broa" where a person's name would be, on a reply Broa sent by itself. */
.holder-name.broa { color: var(--accent-ink); font-weight: 600; }
.why-box ul { margin: 6px 0 0; }
/* The why, inside the "about the reply" box (TODO #256): empty, it takes no room. */
.why-lines ul { margin: 6px 0 0; }
.why-lines:empty { display: none; }
@media (max-width: 860px) {
  .auto-wait { padding-left: 12px; }
}
/* What changed in the email setup, or stopped by itself (setupnotices.js; TODO #26,
   plans/email-setup-notices-plan.md §3.5): the sign-in dialog and "Recent changes" on
   Sending and Connect your mailbox. One change a row — its time in the viewer's own
   clock, then the line. A stop is the red callout in the dialog and carries a Stopped
   chip in the list, so colour never says it alone. */
.message-dialog.setup-changes { width: min(620px, calc(100vw - var(--s-8))); }
.setup-changes h2 { font-size: var(--text-xl); }
.setup-changes-list { display: grid; gap: 10px; margin: 0; padding: 0; list-style: none; }
.setup-changes-list > li + li { border-top: 1px solid var(--line); padding-top: 10px; }
.setup-change { display: grid; gap: 4px; font-size: var(--text-base); }
.setup-change-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.setup-change-line { margin: 0; max-width: 72ch; overflow-wrap: anywhere; }
.setup-change.callout .when { color: inherit; opacity: .8; }
.setup-recent { display: grid; gap: 8px; margin-top: 20px; }
.setup-recent > p { margin: 0; }

/* TODO #86: one page of "Our pages", its words as Broa keeps them. */
.page-title { margin: 0 0 4px; font-size: var(--text-xl); }
.page-text { white-space: pre-wrap; line-height: 1.5; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface-2); margin: 12px 0; }

/* ── Home (home.js; plans/front-desk-home-build-plan.md H6) ─────────────────
   Each card is a <details open>: its heading is the summary and the menu's own
   chevron turns when it folds. The stacked bar is how messages closed; its key
   says every count in words and the bar carries the same as its label, so the
   colours never say anything alone. */
.home-head { display: grid; gap: 8px; margin-bottom: 16px; }
.home-greeting { margin: 0; font-size: var(--text-xl); }
/* THE ASK BOX (STYLE.md "The ask box"; owner 2026-11-03/04): Home's What would you
   like to do? and Ask or teach Broa's composer wear the same frame, drawn here once —
   the accent's soft tint, an accent edge and a heavier left bar, a larger heading, a
   larger text box and button. Accent tokens only, so dark mode follows. A screen adds
   layout of its own (Home's answer line, the composer's sticky foot), never a second
   frame: tests/style-guide.test.mjs holds the frame to this one rule. */
.ask-box {
  display: grid; gap: var(--s-3); padding: var(--s-5);
  background: var(--accent-soft);
  border: 1px solid color-mix(in srgb, var(--accent) 35%, transparent);
  border-left: 4px solid var(--accent);
  border-radius: var(--radius-lg);
  box-shadow: 0 1px 3px color-mix(in srgb, var(--accent) 18%, transparent);
}
.ask-box .ask-box-title { margin: 0; font-size: var(--text-2xl); font-weight: 700; color: var(--accent-ink); }
.ask-box-row { display: flex; flex-wrap: wrap; gap: var(--s-2); align-items: center; }
.ask-box .ask-box-input {
  max-width: 680px; min-width: 0; font: inherit;
  font-size: var(--text-lg); padding: var(--s-3);
  background: var(--surface); color: var(--ink);
  border: 1px solid var(--accent); border-radius: var(--radius);
}
.ask-box-row .ask-box-input { flex: 1 1 22rem; }
.ask-box .ask-box-input:focus-visible { outline: var(--focus-width) solid var(--accent); outline-offset: 1px; }
.ask-box-row .btn { min-height: 44px; padding-left: var(--s-5); padding-right: var(--s-5); font-size: var(--text-lg); }
/* In a conversation the box stays stuck to the foot of the pane (.composer); its text
   box takes the frame's width. */
.composer.ask-box { padding: var(--s-5); }
.composer.ask-box .ask-box-input { width: 100%; max-width: none; min-height: 96px; }
.home-ask-answer { display: grid; gap: var(--s-2); }
.home-ask-answer:empty { display: none; }
.home-ask-answer > p { margin: 0; }
.home-ask-where { font-weight: 600; }
.home-head .note { margin: 0; }
.home-desk { display: grid; gap: 14px; }
.home-limit { margin: 0; }
/* A card is a fold (see "folds"), whose body brings its own padding — so the card
   has none, its header is not pulled out to the edge, and the chevron is the one
   home.js draws (.chev), in the fold's colour, rather than a second one. */
.pane details.home-card { padding: 0; margin: 0; }
.pane details.home-card > summary { margin: 0; padding: 12px 16px; }
.pane details.home-card[open] > summary { margin-bottom: 12px; }
.pane details.home-card > summary::after { content: none; }
.home-card > summary h2 { margin: 0; font-size: var(--text-lg); }
.home-card > summary .chev { color: var(--accent-ink); border-width: 2px; flex: none; }
.home-card[open] > summary .chev { transform: rotate(45deg); }
.home-card-body { display: grid; gap: 12px; padding: 0 16px 16px; }
.home-card-body > p { margin: 0; }
.home-row { padding: 9px 0; }
.home-num { font-family: var(--sans); font-variant-numeric: tabular-nums; color: var(--accent-ink); }
.tally .home-num { font-size: var(--text-xl); font-weight: 600; }
.home-scroll { overflow-x: auto; }
.shelf-row.home-people { grid-template-columns: minmax(8rem, 1fr) 90px 90px 110px; }
.home-bar {
  display: flex; height: 14px; border-radius: var(--radius); overflow: hidden;
  background: var(--surface-3);
}
.home-bar-part { display: block; height: 100%; }
.home-key { display: flex; flex-wrap: wrap; gap: 6px 16px; margin: 8px 0 0; padding: 0; list-style: none; font-size: var(--text-sm); }
.home-key li { display: flex; align-items: center; gap: 6px; }
.home-swatch { display: inline-block; width: 10px; height: 10px; border-radius: 2px; }
.part-1 { background: var(--accent); }
.part-2 { background: var(--ok); }
.part-3 { background: var(--ink-2); }
.part-4 { background: var(--wait); }
.part-5 { background: var(--line-strong); }

/* THE REASON (TODO #330): two or three muted words after the status chip, never a
   second chip. Its own column wide; under the chip at phone width (.reason-narrow),
   where the Reason column is dropped; beside the chip in a message's heading. */
.reason { color: var(--ink-2); font-size: var(--text-sm); }
.priority-narrow { display: none; margin-left: 6px; }
.priority-box { margin: 0 0 16px; }
.reason-narrow { display: none; margin-top: 3px; font-size: var(--text-xs); }
.reason-beside { margin-left: var(--s-1); }
/* A message's priority (priority.js): its chip, and the hooks the tests read. */
.priority-tag { display: inline-flex; align-items: center; gap: 6px; }
/* A tag before a row's subject (Suspicious, Quote, Sent by Broa, Reassign asked,
   Team note): the way-in label's look, never in place of the status. */
.row-tag { color: var(--ink-2); }
/* The team's notes (Mike's issues D2, 2026-10-12): a sticky note, never the same
   grey as everything else — amber (the --wait pair, which has its dark-mode
   twin), a bar on the left, the words in the ink colour. A row carries a Team
   note tag; the Notes box at the top of a message holds them in full. */
.notes-box {
  margin: 0 0 16px; padding: 12px 14px;
  background: var(--wait-soft); border: 1px solid var(--wait); border-left-width: 4px;
  border-radius: var(--radius-lg);
}
.notes-box:not(.has-notes) { background: var(--surface); border-color: var(--line-strong); border-left-color: var(--wait); }
.notes-box .notes-title { margin: 0 0 2px; font-size: var(--text-lg); color: var(--ink); }
.notes-box .hint { margin: 0 0 8px; }
.notes-list { list-style: none; margin: 0 0 12px; padding: 0; }
.notes-list li { padding: 8px 10px; margin: 0 0 6px; background: var(--surface); border-radius: var(--radius); border: 1px solid var(--line); }
.notes-list li p { margin: 0; white-space: pre-wrap; color: var(--ink); }
.notes-list li p.note { font-size: var(--text-xs); font-weight: 600; margin-bottom: 2px; }
.notes-add textarea { width: 100%; box-sizing: border-box; }
/* Who the customer's email was from and to (TODO #305). */
.letter .email-header { margin: 0; font-size: var(--text-sm); }
/* The header and the customer's words, each in its own shaded box (front-office plan
   2026-11-18 #2), so where the header ends and the message starts is plain. Two
   existing surfaces, light and dark alike; in the message window the letter around
   them draws no box of its own. */
.letter .email-header, .letter .letter-body {
  border: 1px solid var(--line); border-radius: var(--radius-lg); padding: var(--s-3) var(--s-4);
}
.letter .email-header { background: var(--surface-3); }
.letter .letter-body { background: var(--surface); display: grid; gap: var(--s-3); }
.pane details.surface-theirs .letter { border: 0; padding: 0; }
/* What method.me says of the sender, on the EMAIL line (front-office plan 2026-11-18 #1). */
.letter .meta { align-items: center; }
.letter .meta .erp-line { margin: 0; }
.letter .email-header p { margin: 0 0 2px; }
.letter .email-header .label { display: inline-block; min-width: 2.5em; }
.letter .email-header .own-address { color: var(--ink-2); font-weight: 600; }

/* The note's length (TODO #308): quiet, then the wait colour near and over the limit. */
.notes-add .note-count { margin: 2px 0 0; font-size: var(--text-xs); }
.notes-add .note-count.warn { color: var(--wait); font-weight: 600; }


/* Test it (rules.js): one question, without and with the rule, side by side; one
   column on a phone. */
.compare { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 8px; }
.compare > div { border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 10px 12px; background: var(--surface-2); min-width: 0; }
.compare .pre { white-space: pre-wrap; overflow-wrap: anywhere; margin: 6px 0 0; }
@media (max-width: 640px) { .compare { grid-template-columns: 1fr; } }

/* Add a rule: "Only for" and the fact search under each side of a Prefer rule. */
[data-only-for] fieldset { border: 0; padding: 0; margin: 8px 0; display: grid; gap: 4px; }
[data-only-for] label.check { display: flex; gap: 8px; align-items: baseline; font-weight: normal; }
.fact-pick { margin: 4px 0 10px; }
.fact-pick input[type="search"] { width: 100%; max-width: 420px; }
.fact-pick .sources { margin: 6px 0 0; }

/* Company settings → Features (features.js, TODO #311): one card per feature, its On /
   Off beside its name, and the change's preview under it when a switch is pressed. */
.features { display: grid; gap: 12px; }
.feature { border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 12px 16px; background: var(--surface); }
.feature p { margin: 6px 0; max-width: 75ch; }
.feature-head { display: flex; gap: 12px; align-items: baseline; justify-content: space-between; }
.feature-head h2 { margin: 0; font-size: var(--text-lg); }
/* A kind's record on How replies go out: one line in sight, the rest behind its ? (autonomy.js, owner 2026-11-04). */
.kind-record { margin: 6px 0; }
.kind-record .fold-details ul { margin: 0; padding-left: 18px; }
/* What a feature does: one line in sight, the rest behind its ? (features.js about, owner 2026-11-04). */
.feature-about { margin: 6px 0; }
.feature-about .fold-details b { color: var(--ink); }
.feature-change:empty { display: none; }
.feature-change { margin-top: 8px; display: grid; gap: 8px; }
.feature-change input.input { width: 100%; max-width: 480px; }

/* TOGGLE SWITCHES (ui.toggle; STYLE.md "Toggle switches", owner 2026-11-06; the pill,
   owner 2026-11-07). A real button with role="switch": an oval track with a round knob
   that slides, then the word On or Off, so the state is never colour alone. On is the
   --ok green track with the knob at the right; Off the neutral grey track with the
   knob at the left; Disabled is the same, dimmed. Tokens only, so both dark themes
   follow. The one control besides an avatar and the menu counts that is a full pill
   (STYLE.md rule 5). The button is the 44px tap target; the track inside is 44 × 24.
   Pressing it saves nothing: `is-staged` marks a switch moved and not saved yet,
   under its preview. The knob slides only for those who have not asked for less
   motion. */
.toggle {
  display: inline-flex; align-items: center; gap: var(--s-2);
  min-height: 44px; min-width: 44px; padding: 0 var(--s-1); margin: 0;
  background: none; border: 0; border-radius: var(--radius);
  font: inherit; font-size: var(--text-sm); font-weight: 600; color: var(--ink-2);
  cursor: pointer;
}
.toggle-track {
  position: relative; flex: none; width: 44px; height: 24px; box-sizing: border-box;
  background: var(--surface-3); border: 1px solid var(--btn-line); border-radius: 999px;
}
.toggle-knob {
  position: absolute; top: 2px; left: 2px; width: 18px; height: 18px;
  background: var(--ink-2); border-radius: 50%;
}
.toggle-word { min-width: 2em; text-align: left; }
.toggle-line .toggle-word { width: 2em; }
.toggle[aria-checked="true"] { color: var(--ok); }
.toggle[aria-checked="true"] .toggle-track { background: var(--ok); border-color: var(--ok); }
.toggle[aria-checked="true"] .toggle-knob { transform: translateX(20px); background: var(--surface); }
.toggle:hover:not([disabled]) .toggle-track { border-color: var(--ink-2); }
.toggle[aria-checked="true"]:hover:not([disabled]) .toggle-track { border-color: var(--ok); }
.toggle[disabled] { cursor: not-allowed; opacity: .5; }
.toggle.is-staged .toggle-track { outline: 2px dashed var(--accent); outline-offset: 2px; }
.toggle:focus-visible { outline: none; }
.toggle:focus-visible .toggle-track { outline: var(--focus-width) solid var(--accent); outline-offset: var(--focus-offset); }
@media (prefers-reduced-motion: no-preference) {
  .toggle-knob { transition: transform .16s ease, background-color .16s ease; }
  .toggle-track { transition: background-color .16s ease, border-color .16s ease; }
}
/* A row with a toggle: what it is on the left, the toggle AT THE RIGHT EDGE of its row
   (owner, Front Office review 2026-11-18, #5/#18: Features showed them in the middle),
   the same on every screen that has one (Features, How replies go out). Its word is a
   fixed width, so On and Off rows keep their tracks in one line. Features' cards span
   the pane as How replies go out's do; their sentences keep their own measure. */
.toggle-line {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: var(--s-3); align-items: start;
}
.toggle-line > .toggle { justify-self: end; margin-top: -10px; margin-right: calc(-1 * var(--s-1)); }
/* Facts' own column of toggles (knowledge.js, owner 2026-11-07). */
.shelf-row.facts > .toggle, .shelf-row.rules > .toggle { justify-self: start; margin: -10px 0; }
.toggle-line > .chip { justify-self: end; margin-top: 2px; }
.toggle-line-main { min-width: 0; }
.toggle-line-main h3, .toggle-line-main h4 { margin: 0; }
.toggle-line-main p { margin: 0; }
.toggle-about { margin: 4px 0 0; }

/* EMBEDDED in the back office's Company workspace (embed.js, shell.js): the workspace
   draws the menu, the banner and the company, so the frame shows the screen alone. */
html.embed .mobile-bar, html.embed .rail, html.embed .rail-backdrop,
html.embed .top-tools, html.embed .elevation, html.embed .broa-notices,
html.embed .platform-switch, html.embed .rail-handle, html.embed .rail-show { display: none !important; }
html.embed .app { grid-template-columns: minmax(0, 1fr); }
html.embed .pane { padding: 12px 6px 28px; }

/* ── a person (STYLE.md "Naming people") ─────────────────────────────────────
   ui.person: the name, with the address (or the name, where the address is shown)
   on hover (`title`), on keyboard focus and on a tap (below). A dotted underline says
   there is more. */
.person { overflow-wrap: anywhere; }
.person[data-also] {
  position: relative; cursor: help;
  text-decoration: underline dotted var(--ink-2); text-underline-offset: 3px;
}
.person[data-also]:focus-visible { outline: var(--focus-width) solid var(--accent); outline-offset: 1px; border-radius: var(--radius); }
/* The mouse gets the browser's own tooltip (`title`), which no cell's edge can cut off;
   a keyboard or a tap, which has none, gets this one. */
.person[data-also]:focus::after {
  content: attr(data-also);
  position: absolute; left: 0; top: calc(100% + var(--s-1)); z-index: 30;
  padding: var(--s-1) var(--s-2); border-radius: var(--radius);
  background: var(--surface); color: var(--ink); border: 1px solid var(--line-strong);
  box-shadow: var(--shadow);
  font-size: var(--text-xs); font-weight: 400; white-space: nowrap;
}

/* ── See it in action (widget.js, TODO #393) ─────────────────────────────────
   The website chat preview: a large panel over a dimmed Front Desk, the company's
   site (or a plain ground) filling it, and the real chat box — drawn by
   /widget/v1.js itself — in its corner. */
.chat-preview-backdrop { position: fixed; inset: 0; z-index: 90; background: rgba(0, 0, 0, .45); }
.chat-preview {
  position: fixed; inset: 24px; z-index: 95;
  display: grid; grid-template-rows: auto minmax(0, 1fr);
  background: var(--surface); color: var(--ink);
  border: 1px solid var(--line-strong); border-radius: 8px; box-shadow: var(--shadow); overflow: hidden;
}
.chat-preview-head {
  display: flex; align-items: center; justify-content: space-between; gap: var(--s-3);
  padding: var(--s-2) var(--s-3); border-bottom: 1px solid var(--line-strong);
}
.chat-preview-where { margin: 0; color: var(--ink-2); font-size: .875em; }
.chat-preview-stage { position: relative; min-height: 0; }
.chat-preview-site { display: block; width: 100%; height: 100%; border: 0; background: #fff; }
.chat-preview-plain {
  display: flex; align-items: center; justify-content: center; height: 100%;
  padding: var(--s-5); color: var(--ink-2); text-align: center;
}
@media (max-width: 640px) { .chat-preview { inset: 0; border-radius: 0; } }
