/* ============================================================================
 * 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 small actions; `.link-btn` only for a link to another screen.
 *   .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.
 *
 * Owned by agent A (Wave 1). Report a needed change; do not edit this file.
 * ========================================================================== */

:root {
  --ground: #f3f4f6;
  --surface: #ffffff;
  --surface-2: #fafafa;
  --surface-3: #f3f4f6;
  --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;

  --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"]) {
    --ground: #0d1014;
    --surface: #14181e;
    --surface-2: #1b2028;
    --surface-3: #262c35;
    --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"] {
  --ground: #0d1014;
  --surface: #14181e;
  --surface-2: #1b2028;
  --surface-3: #262c35;
  --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: 252px 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;
}

.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; }

.ok-dot   { background: var(--ok);   box-shadow: 0 0 0 3px color-mix(in srgb, var(--ok) 20%, transparent); }
.wait-dot { background: var(--wait); box-shadow: 0 0 0 3px color-mix(in srgb, var(--wait) 22%, transparent); }
.stop-dot { background: var(--stop); box-shadow: 0 0 0 3px color-mix(in srgb, var(--stop) 22%, transparent); }
.calm-dot { background: var(--ink-3); }

/* ── 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: 12px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase;
  color: var(--ink-3);
}
.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);
}

.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: 14px; 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: 500; }

/* 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: 12px; line-height: 1.35; color: var(--ink-3); 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: 12px; color: var(--ink-3); padding: 2px 10px 4px; margin: 0; }

.item .count {
  margin-left: auto; font-family: var(--mono); font-size: 11.5px;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 999px; padding: 1px 7px; color: var(--ink-3);
}
.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);
}

/* A link that takes you to another screen (#124): underlined, because it goes
   somewhere. An action on this screen is a `.btn.small`, never a link. */
.link-btn {
  font: inherit; font-size: 12px; cursor: pointer;
  background: none; border: 0; padding: 0;
  color: var(--accent-ink); text-decoration: underline;
}

/* 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: 13px; color: var(--ink-2); }
.theme {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 3px;
  background: var(--surface-3); border-radius: var(--radius); padding: 3px;
}
.theme-btn {
  font: inherit; font-size: 12.5px; cursor: pointer;
  border: 0; border-radius: var(--radius); padding: 5px 4px;
  background: none; color: var(--ink-2);
}
.theme-btn[aria-pressed="true"] {
  background: var(--surface); color: var(--ink); font-weight: 500;
  box-shadow: 0 1px 2px rgba(0, 0, 0, .08);
}
.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: 8px; padding: 11px 14px;
}
.elevation[hidden] { display: none; }
.elevation p { font-size: 14px; 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: 21px; 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-3); font-size: 14px; }

.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-3); }
.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(--mono); font-size: 13px; font-weight: 500;
  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-3); }
}

/* 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-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: 6px;
}
@media (max-width: 640px) {
  .help-panel { border-left: 0; padding: var(--s-4); }
}

.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; }

.filters, .choice { display: flex; flex-wrap: wrap; gap: 8px; }
.filter-bar { display: flex; flex-wrap: wrap; gap: var(--s-3); align-items: end; min-width: 0; }
.filter-bar .filter-group { display: grid; gap: var(--s-1); width: fit-content; max-width: 100%; min-width: 0; }
.filter-group-label {
  color: var(--ink-3); font-family: var(--mono); font-size: var(--text-xs);
  font-weight: 600; letter-spacing: .06em; text-transform: uppercase;
}
.filter-group-controls {
  display: flex; gap: 2px; max-width: 100%; min-width: 0;
  padding: 3px; overflow-x: auto;
  background: var(--surface-2); border: 1px solid var(--line);
  border-radius: var(--radius-lg);
}
.filter-bar .chip-filter {
  flex: none; border-color: transparent; border-radius: var(--radius);
  background: transparent; white-space: nowrap;
}
.filter-bar .chip-filter:hover { background: var(--surface); }
.filter-bar .chip-filter[aria-pressed="true"] {
  background: var(--accent); color: var(--on-accent); border-color: var(--accent);
}
.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, .pager .page-turns { 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 {
  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);
}

/* A chip that filters. `.filter` is the same shape under the older name. */
.chip-filter, .filter {
  font: inherit; font-size: 13px; cursor: pointer;
  background: var(--surface); color: var(--ink-2);
  border: 1px solid var(--line); border-radius: 999px; padding: 5px 12px;
}
.chip-filter[aria-pressed="true"], .filter[aria-pressed="true"] {
  background: var(--ink); color: var(--surface); border-color: var(--ink);
}
.chip-filter:hover, .filter:hover { border-color: var(--line-strong); }

.tick { font-family: var(--mono); font-size: 11px; margin-left: 7px; }
.chip-filter[aria-pressed="true"] .tick, .filter[aria-pressed="true"] .tick {
  color: color-mix(in srgb, currentColor 70%, transparent);
}

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

.chip {
  display: inline-flex; align-items: center; gap: 6px;
  border-radius: var(--radius); padding: 3px 9px;
  font-size: 12.5px; font-weight: 500; 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-2); color: var(--ink-3); }
/* "Is this sender in method.me?" (erp-status.js, owner's requests of 2026-10-09
   B5–B7). Smaller than a state chip and without its dot, so the two never read
   as one thing. "Not in method.me" is the one the owner wants to spot: the accent,
   outlined and bolder. The words always say it; the colour only helps. */
.chip.erp-chip {
  padding: 1px 7px; margin-left: var(--s-2); vertical-align: 1px;
  font-size: 11.5px; font-weight: 500;
}
.chip.erp-found   { background: var(--ok-soft);   color: var(--ok); }
.chip.erp-maybe   { background: var(--wait-soft); color: var(--wait); }
.chip.erp-new     { background: var(--accent-soft); color: var(--accent-ink); box-shadow: inset 0 0 0 1px var(--accent); font-weight: 600; }
.chip.erp-unknown { background: var(--surface-2); color: var(--ink-3); }
/* 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.erp-chip, .erp-cell .chip.erp-chip { margin-left: 0; }
.erp-cell .chip.erp-chip { 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 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(--mono); font-size: 11.5px; letter-spacing: .1em; text-transform: uppercase;
  color: var(--ink-3);
}
.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: 700;
  letter-spacing: 0; color: var(--accent-ink);
}
.sort-arrow.idle { font-weight: 400; color: var(--ink-3); 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: 500; }
/* 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: 11.5px; color: var(--ink-3); 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: 12.5px; color: var(--ink-3);
}
.msg-id.full { margin-left: 0; font-size: 12.5px; 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: 11.5px; color: var(--ink-3); 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: 13.5px; }
.attach-name { font-weight: 500; color: var(--ink); overflow-wrap: anywhere; min-width: 0; }
.attach-meta { color: var(--ink-3); font-size: 12.5px; }
.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: 12.5px; }
.attach-note { flex-basis: 100%; color: var(--ink-3); font-size: 12.5px; } /* 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-3); font-size: 12.5px; }
.attach-thumb { display: block; max-width: min(320px, 100%); max-height: 320px; height: auto; border: 1px solid var(--line); border-radius: 4px; background: #fff; }
.attach-read { flex-basis: 100%; margin: 0; font-size: 13px; 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: 500; }
/* Find, above the chips: as wide as a pasted id, never wider than the page. */
.filter-bar .find-group { width: min(380px, 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: 13.5px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.note { color: var(--ink-3); font-size: 13px; }
.when { font-family: var(--mono); font-size: 12px; color: var(--ink-3); }

.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: 18px; }
.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: 18px; }
.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; }
.message-dialog-body > .actions:first-child { display: none; }
.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: 14px;
}
.shelf-row.head {
  font-family: var(--mono); font-size: 11.5px; letter-spacing: .1em; text-transform: uppercase;
  color: var(--ink-3); 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: 14px; color: inherit;
  text-align: left; cursor: pointer; width: 100%;
}
button.shelf-row:hover { background: var(--surface-2); }
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; }
.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); }
/* Who has what (team.js): 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(--mono); font-variant-numeric: tabular-nums; font-size: 13px; 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: 8px;
  padding: 9px 14px; background: var(--surface-2);
}
.tally b { font-family: var(--mono); font-size: 19px; font-weight: 500; }
.tally span { font-size: 13px; color: var(--ink-2); }

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

.letter {
  border: 1px solid var(--line); border-radius: 8px;
  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: 13px; color: var(--ink-3);
}
.letter p, .reply p { max-width: 64ch; }

.reply {
  border: 1px solid var(--line-strong); border-left: 3px solid var(--ok);
  border-radius: 8px; 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(--mono); font-size: 11.5px; letter-spacing: .12em;
  text-transform: uppercase; color: var(--ink-3);
}

.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. */
.btn {
  font: inherit; font-size: 14px; cursor: pointer;
  border-radius: var(--radius); padding: 8px 15px;
  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);
}
.btn:hover:not([disabled]) { background: color-mix(in srgb, var(--surface-3), var(--ink) 8%); }
.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: 500; box-shadow: none; }
.btn.primary:hover:not([disabled]) { background: color-mix(in srgb, var(--accent) 86%, var(--ink)); }
/* 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-block; 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: 500;
  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%); }
/* A small ordinary button: the actions that used to be underlined text (sign out,
   Remove, Keep it, Add a phrase, Show all …). */
.btn.small { font-size: 12.5px; padding: 3px 10px; }

.sources { display: grid; gap: 6px; font-size: 13.5px; color: var(--ink-2); margin: 0; padding: 0; }
.sources li { margin-left: 18px; }
.sources li::marker { color: var(--ink-3); }
/* "Where this came from" starts closed (#98): the heading is the summary. It is a
   fold like every other (below); only its callout colours are set back to a fold's. */
.pane details.sources-fold { display: block; gap: 0; background: var(--surface); border-color: var(--line-strong); color: var(--ink-2); }
.pane details.sources-fold > summary > span { 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;
}

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

.callout {
  display: grid; gap: 6px;
  border-radius: var(--radius-lg); padding: 13px 16px;
  background: var(--wait-soft); color: var(--wait);
  border: 1px solid color-mix(in srgb, var(--wait) 28%, transparent);
  font-size: 14px;
}
.callout b { color: inherit; }
.callout.quiet { background: var(--surface-2); color: var(--ink-2); border-color: var(--line); }
/* 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-3); }
.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). It is deliberately
   not a callout: it is the last thing read before a change is kept, so it gets
   the accent edge and a heading of its own. */
.preview {
  display: grid; gap: 8px;
  border: 1px solid var(--line-strong); border-left: 3px solid var(--accent);
  border-radius: var(--radius-lg); background: var(--surface-2);
  padding: 14px 16px; font-size: 14px;
}
.preview > .label { color: var(--accent-ink); }
.preview ul { display: grid; gap: 6px; margin: 0; padding: 0; }
.preview li { margin-left: 18px; }
/* The deletion's confirmation reads as a stop, not as a save. Last on the
   message screen, below a rule, so it is never next to Approve. */
.delete-zone { border-top: 1px solid var(--line); padding-top: 14px; margin-top: 6px; }
.delete-form .preview { border-left-color: var(--stop); }
.delete-form .preview > .label { color: var(--stop); }
.case-history { display: grid; gap: 6px; margin: 0; padding: 0; font-size: 14px; }
.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: 15px; font-weight: 600; margin-top: 6px; }
/* 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: 13.5px; font-weight: 500; }
.help, .field .help { font-size: 13px; color: var(--ink-3); }
.field input, .field textarea, .field select {
  font: inherit; font-size: 14px;
  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 textarea { min-height: 128px; resize: vertical; font-family: var(--sans); }
/* 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);
}

/* 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: 6px; 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: 6px; padding: 10px 12px; background: var(--surface-2); }
.assist-col p { margin: 0 0 8px; overflow-wrap: anywhere; }

/* 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 > span:first-child { overflow-wrap: anywhere; min-width: 0; color: var(--ink-2); }
.reply-file.stop > span:first-child { color: inherit; }
.reply-file-mark {
  font-size: 11.5px; font-weight: 400; color: var(--ink-3);
  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: 14px;
  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: 13px;
}
.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-3); font-weight: 400; }
.reply-file-picker .note:empty { display: none; }

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

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

.center-note { color: var(--ink-3); font-size: 14px; 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: 14px;
  box-shadow: var(--shadow);
  animation: toast-in .18s ease;
}
@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, 320px); 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; }
  .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 .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; }
  .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: 14px;
}
.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: 13.5px; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.holder-name.unowned { color: var(--ink-3); }
.holder { display: block; margin-top: 2px; font-size: 12px; color: var(--ink-3); }
.holder b { color: var(--ink-2); font-weight: 500; }
.assigned-narrow { display: none; margin-top: 3px; font-size: 12px; color: var(--ink-3); }
.assigned-narrow b { color: var(--ink-2); font-weight: 500; }
.owner-bar {
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px;
  border: 1px solid var(--line); border-radius: 8px; background: var(--surface-2);
  padding: 10px 14px; font-size: 14px;
}
.owner-bar .who-has { display: grid; gap: 1px; }
.owner-bar .who-has span { font-size: 12.5px; color: var(--ink-3); }
.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: 14px; 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: 13.5px; }
.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: 8px; background: var(--surface); }
.prose p, .prose > ul, .prose > ol { max-width: 68ch; }
.prose code {
  font-family: var(--mono); font-size: 13px;
  background: var(--surface-2); border-radius: 4px; 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: 13px; line-height: 1.5;
  color: var(--ink-2); background: var(--surface-2);
  border: 1px solid var(--line); border-radius: 7px;
  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(--mono); font-size: 12px; color: var(--ink-3);
  border: 1px solid var(--line-strong); border-radius: 999px;
  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-3); }
@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: 8px; padding: 14px 16px; }
.addr-line { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.addr {
  font-family: var(--mono); font-size: 13.5px; background: var(--surface-2);
  border: 1px solid var(--line); border-radius: 6px; padding: 6px 9px;
  overflow-wrap: anywhere; max-width: 100%;
}
.td-answer { white-space: pre-wrap; max-width: 68ch; }
.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 the loudest thing on the page — a thick edge,
   a larger lead, and on every screen — never a footnote under a word that says On. */
.callout.platform-switch {
  margin: 0 0 16px; padding: 16px 18px;
  border-width: 2px; border-left-width: 8px; border-color: var(--wait);
  font-size: 15px;
}
.callout.platform-switch b { font-size: 17px; }
.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-strong); border-left-width: 6px;
  background: var(--accent-soft); color: var(--ink); border-left-color: var(--accent);
  font-size: var(--text-base);
}
.broa-notice.level-maintenance { background: var(--wait-soft); border-left-color: var(--wait); }
.broa-notice.level-problem { background: var(--stop-soft); border-left-color: var(--stop); }
.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(--accent-ink); }
.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: 13.5px; }
.setup-steps p { margin: 4px 0 0; font-size: 13px; color: var(--ink-3); }
.copyrow { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 6px; }
.copyable {
  font-family: var(--mono); font-size: 12.5px; background: var(--surface-3);
  border: 1px solid var(--line); border-radius: 6px; 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. A problem is
   the calm attention callout (`.callout`), never red; a test read back is the one
   good-news callout, and says so in words as well as colour. */
.reading-status { display: grid; gap: 4px; margin: 6px 0 2px; }
.reading-status p { margin: 0; }
.reading-status.ok .reading-line b { color: var(--ok); }
.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 TWO
   CHOICES ARE EQUAL — one class, one size, one weight, side by side; the choice in
   force is the pressed one, said by aria-pressed and a border as well as a fill, so
   neither way of running ever looks like the recommended one. */
.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: 14.5px; font-weight: 600; }
.kind-row p { margin: 0; }
.choices .btn.choice { min-width: 14em; text-align: center; }
.choices .btn.choice[aria-pressed="true"] {
  border-color: var(--accent); background: var(--accent-soft); color: var(--accent-ink); font-weight: 500;
  box-shadow: inset 0 0 0 1px var(--accent);
}
.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: 13px; color: var(--ok);
}
.auto-wait-words { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.auto-wait .btn { padding-top: 3px; padding-bottom: 3px; font-size: 13px; }
/* "Broa" where a person's name would be, on a reply Broa sent by itself. */
.holder-name.broa { color: var(--accent-ink); font-weight: 500; }
.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) {
  .choices .btn.choice { min-width: 0; flex: 1 1 12em; }
  .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: 18px; }
.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: 14px; }
.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: 20px; }
.page-text { white-space: pre-wrap; line-height: 1.5; padding: 12px 14px; border: 1px solid var(--line); border-radius: 8px; 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: 20px; }
.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: 16px; }
.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(--mono); font-variant-numeric: tabular-nums; color: var(--accent-ink); }
.tally .home-num { font-size: 19px; font-weight: 500; }
.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: 13px; }
.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-3); }
.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-3); font-size: var(--text-sm); }
.reason-narrow { display: none; margin-top: 3px; font-size: 12px; }
.reason-beside { margin-left: var(--s-1); }
/* 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: 6px 0 10px; font-size: var(--text-sm); }
.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(--ok); 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; }

/* Add — "What do you want to teach Broa?" (knowledge-and-rules plan step 1). */
.teach-choices { display: grid; gap: 10px; max-width: 640px; }
.teach-choice {
  text-decoration: none;
  display: grid; gap: 4px; text-align: left; padding: 14px 16px; cursor: pointer;
  background: var(--surface); color: var(--ink); font: inherit;
  border: 1px solid var(--line-strong); border-radius: var(--radius-lg);
}
.teach-choice:hover { background: var(--surface-2, var(--ground)); border-color: var(--accent); }
.teach-choice:focus-visible { outline: var(--focus-width) solid var(--accent); outline-offset: var(--focus-offset); }
.teach-choice b { font-size: var(--text-lg); }

/* 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: 8px; 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; max-width: 760px; }
.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); }
.feature-state { font-weight: 600; white-space: nowrap; color: var(--ink-3); }
.feature-state.on { color: var(--ok); }
.feature-change:empty { display: none; }
.feature-change { margin-top: 8px; display: grid; gap: 8px; }
.feature-change input.input { width: 100%; max-width: 480px; }

/* 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 { display: none !important; }
html.embed .app { grid-template-columns: minmax(0, 1fr); }
html.embed .pane { padding: 12px 6px 28px; }
