/* One stylesheet for the whole site: the application, the desk, the Notebook
   and every other page.

   The look is "The Office Cast". The eighteen characters are the brand, the
   page is mostly paper, and the colour comes from the faces. Open /style.html
   to see every shared piece on one page; shared/cast.ts lists the cast.

   How this file is laid out:
   1. THE SHARED LAYER, from here down to the line "CRM shell": the fonts, the
      named colours and sizes, type, the wordmark, buttons, form boxes, chips,
      cards, the egg, the cast, the four states, the four motions, and the
      site header and footer. Every page is built from these.
   2. One block for each part of the site, each under its own marker.

   The phone rules, which are the owner's and are not optional:
   - the layout changes at ONE width, 720px (max-width: 720px is "a phone");
   - at 390px wide nothing scrolls sideways;
   - anything tapped is at least 44px tall, a form's main button 52px;
   - anything typed in is at least 16px, so an iPhone does not zoom the page;
   - every picture has a width and a height in its tag;
   - anything that moves stands still, on its last frame, for a reader who has
     asked their device for less motion. */

/* ── The fonts ────────────────────────────────────────────────────────────── */
/* Three files, kept on this site (the security policy allows no other source).
   "swap" shows the words at once in a font the device already has, then
   changes to ours when it arrives. */
@font-face { font-family: 'Fraunces'; src: url('/fonts/fraunces-var-v1.woff2') format('woff2'); font-weight: 100 900; font-style: normal; font-display: swap; }
@font-face { font-family: 'Fraunces'; src: url('/fonts/fraunces-italic-var-v1.woff2') format('woff2'); font-weight: 100 900; font-style: italic; font-display: swap; }
@font-face { font-family: 'Instrument Sans'; src: url('/fonts/instrument-sans-var-v1.woff2') format('woff2'); font-weight: 400 700; font-style: normal; font-display: swap; }
/* The stand-in for Fraunces during the moment before it arrives: Times New Roman, which every iPhone, Mac
   and Windows computer already has, drawn a touch smaller so that it sets a headline to the same width
   as Fraunces does (its bold at 99%, and its italic, which runs wider, at 93%). Measured on fifteen of the
   site's own headlines at 390px and 1280px: 97% to 101% of the real width, and every one keeps its line
   breaks, so nothing under a headline jumps when the real font arrives. Georgia and Iowan Old Style look
   closer but run a fifth to a quarter wider: the Notebook's headline took two lines in them, then one.
   Nothing is fetched for these two: they only name a font already on the device, and are skipped where
   it is not. They stand in for the letters and marks our Fraunces file holds and for nothing else
   (the list of ranges is that file's own), so a character Fraunces does not have, such as the arrow in
   "Factor rate → real cost", is still drawn by the serifs named after them, as it always was. */
@font-face { font-family: 'Fraunces Fallback'; src: local('Times New Roman Bold'), local('TimesNewRomanPS-BoldMT'); font-weight: 100 900; font-style: normal; size-adjust: 99%; unicode-range: U+0020-007E, U+00A0-00FF, U+0131, U+0152-0153, U+02BC, U+02C6, U+02DA, U+02DC, U+2013-2014, U+2018-201A, U+201C-201E, U+2022, U+2026, U+2032-2033, U+2039-203A, U+2044, U+20AC, U+2122, U+2212, U+2215; }
@font-face { font-family: 'Fraunces Fallback'; src: local('Times New Roman Italic'), local('TimesNewRomanPS-ItalicMT'); font-weight: 100 900; font-style: italic; size-adjust: 93%; unicode-range: U+0020-007E, U+00A0-00FF, U+0131, U+0152-0153, U+02BC, U+02C6, U+02DA, U+02DC, U+2013-2014, U+2018-201A, U+201C-201E, U+2022, U+2026, U+2032-2033, U+2039-203A, U+2044, U+20AC, U+2122, U+2212, U+2215; }

/* ── The names ────────────────────────────────────────────────────────────── */
:root {
  /* The three that carry the brand. The mix on a page: paper a little over half,
     peach and espresso about a sixth each, colour homes a tenth, pink a twentieth. */
  --peach: #FCC697;
  --paper: #FEF4EA;
  --espresso: #372C26;

  /* The wardrobe colours, sampled from the cast. */
  --mustard: #EAA940;
  --pink: #DE2C6B;
  --sky: #86B0DC;
  --lilac: #B9A1C7;
  --blush: #E4969A;
  --cocoa: #8F5C38;
  --taupe: #867364;
  --shirt: #EEEAE4;

  /* Colour homes: the light tint that sits BEHIND A CHARACTER, and nowhere else.
     Use them through the .home-… classes. The same values are in shared/cast.ts. */
  --home-sky: #CFDFF1;
  --home-lilac: #E3D9E9;
  --home-blush: #F4D5D7;
  --home-mustard: #F7DDB3;
  --home-taupe: #DBD5D1;
  --home-shirt: #F8F7F4;
  --home-peach: #FEE8D5;
  --home-pink: #F5C0D3;

  /* Working colours, each made from the ones above. */
  --white: #FFFFFF;
  --text: var(--espresso);        /* words. A dark surface (.on-espresso) turns this to paper. */
  --on-text: var(--paper);        /* words on top of a block filled with --text, such as the main button. */
  --text-soft: #64574D;           /* quieter words: espresso let down with paper. */
  --pink-ink: #CF2863;            /* Kelly Pink a shade deeper, for SMALL pink words (an error sentence), so they pass the reading-contrast test on paper. */
  --peach-soft: #FEE8D5;          /* a quiet peach panel: something chosen, a note, a hover. */
  --paper-deep: #F6E7D8;          /* paper one step darker: a quiet fill on white or on paper. */
  --rule: #EDE1D5;                /* hairlines and the edge of a card. */
  --rule-strong: #CDBFB2;         /* a line that has to be seen: a dashed drop zone, an old-style box. */
  --shade: rgba(55, 44, 38, 0.5); /* behind a pop-up. */
  --lift: 0 2px 10px rgba(55, 44, 38, 0.1); /* the soft shadow under a floating chip. */

  /* Corners: round, soft, roomy. Fields 12, cards 16 / 24 / 32, pills 999. */
  --r-12: 12px;
  --r-16: 16px;
  --r-24: 24px;
  --r-32: 32px;
  --r-pill: 999px;

  /* Type. Fraunces for display and headlines, with its soft axis at 100 and its
     optical size at 144. Instrument Sans for everything else: 400 to read, 600 for buttons and labels.
     After Fraunces comes its stand-in for the moment before it arrives (see "The fonts" above), then
     the serifs that draw a character Fraunces does not have, and a device's own serif last. */
  --font-display: 'Fraunces', 'Fraunces Fallback', 'Iowan Old Style', 'Palatino Linotype', Georgia, serif;
  --font-body: 'Instrument Sans', system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;
  --fraunces: 'SOFT' 100, 'opsz' 144, 'WONK' 0;
  --fs-display: 96px;  --lh-display: 0.96;   /* 96 / 92 */
  --fs-h1: 64px;       --lh-h1: 1;           /* 64 / 64 */
  --fs-h2: 40px;       --lh-h2: 1.05;        /* 40 / 42 */
  --fs-h3: 24px;       --lh-h3: 1.1;         /* the headline of a card */
  --fs-body-l: 21px;   --lh-body-l: 1.524;   /* 21 / 32 */
  --fs-body: 17px;     --lh-body: 1.588;     /* 17 / 27 */
  --fs-label: 13px;                          /* capitals, 600, letters set 14% apart */

  /* The page: how wide the content runs, and the space at its sides. Two widths
     only: the full page (the header, a home page, a hub) and a reading page (an
     article, a form, a legal page). */
  --page-max: 1164px;
  --page-text: 720px;
  --gutter: 24px;

  /* How the cast moves. */
  --ease-pop: cubic-bezier(0.34, 1.56, 0.64, 1);

  /* ONE OLD NAME IS LEFT. Every block of this file, and every screen, now asks
     for the names above. The Newsroom's editor (src/crm/newsroom/PostEditor.tsx)
     still asks for --ink in one place; when that line says --text, delete this. */
  --ink: var(--espresso);
}
@media (max-width: 720px) {
  /* Phones: the three headline sizes come down; reading sizes stay as they are. */
  :root { --fs-display: 52px; --fs-h1: 40px; --lh-h1: 1.05; --fs-h2: 28px; --lh-h2: 1.1; --gutter: 16px; }
}

/* ── The page itself ──────────────────────────────────────────────────────── */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--text);
  font-family: var(--font-body);
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, p { margin: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
/* A link is the colour of the words around it, with the pink line under it. */
a { color: inherit; text-decoration-line: underline; text-decoration-color: var(--pink); text-decoration-thickness: 2px; text-underline-offset: 0.18em; }
a:hover { text-decoration-color: currentColor; }
/* Where the keyboard is: a firm espresso ring, clear on paper, white, peach and every colour home.
   (On espresso the ring is paper.) A plain link gets soft corners on its ring; a pill keeps its own. */
:focus-visible { outline: 3px solid var(--text); outline-offset: 2px; }
:where(a, button, summary):focus-visible { border-radius: 8px; }
/* A class name or a file name quoted in a sentence. */
code { font-family: ui-monospace, 'SF Mono', Menlo, Consolas, monospace; font-size: 0.88em; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
[hidden] { display: none !important; }
/* The first thing the Tab key reaches: a way past the header. It stays off the page until then. */
.skip-link { position: absolute; left: -9999px; top: 0; padding: 12px 18px; }
.skip-link:focus { left: 8px; top: 8px; z-index: 100; border-radius: var(--r-pill); background: var(--espresso); color: var(--paper); font-weight: 600; text-decoration: none; }
/* In a browser-app page the link hands the keyboard to the middle of the page itself. That needs no ring round the whole page. */
main:focus { outline: none; }

/* ── Type ─────────────────────────────────────────────────────────────────── */
/* Every headline is Fraunces at weight 800 with its letters drawn 3.5% closer.
   A plain <h1> or <h2> gets the face without being asked; its size comes from
   one of the classes below or from the page's own block. */
h1, h2, .t-display, .t-h1, .t-h2, .t-h3, .h1, .h2 {
  font-family: var(--font-display); font-variation-settings: var(--fraunces); font-weight: 800; letter-spacing: -0.035em;
}
.t-display { font-size: var(--fs-display); line-height: var(--lh-display); text-wrap: balance; overflow-wrap: break-word; }
.t-h1 { font-size: var(--fs-h1); line-height: var(--lh-h1); text-wrap: balance; overflow-wrap: break-word; }
.t-h2 { font-size: var(--fs-h2); line-height: var(--lh-h2); text-wrap: balance; overflow-wrap: break-word; }
.t-h3 { font-size: var(--fs-h3); line-height: var(--lh-h3); overflow-wrap: break-word; }
/* The ONE highlighted word in a headline: Fraunces italic 500, in pink. One per headline, never two. */
.t-hl { font-family: var(--font-display); font-variation-settings: var(--fraunces); font-style: italic; font-weight: 500; letter-spacing: -0.02em; color: var(--pink); }
.t-body-l { font-size: var(--fs-body-l); line-height: var(--lh-body-l); }
.t-body { font-size: var(--fs-body); line-height: var(--lh-body); }
/* The small capital line above a headline: "STEP 2 OF 3". */
.t-label { font-family: var(--font-body); font-size: var(--fs-label); font-weight: 600; line-height: 1.4; letter-spacing: 0.14em; text-transform: uppercase; color: var(--text-soft); }

/* The compact headings the application and the desk use inside cards and screens. */
.h1 { font-size: clamp(28px, 2.4vw + 16px, 36px); line-height: 1.08; }
.h2 { font-size: 22px; line-height: 1.15; letter-spacing: -0.03em; }
.h3 { font-family: var(--font-body); font-variation-settings: normal; font-size: 15px; font-weight: 700; letter-spacing: 0.01em; }
.muted { color: var(--text-soft); }
.small { font-size: 15px; }
.tiny { font-size: 13px; }
.strong { font-weight: 600; }
.num { font-variant-numeric: tabular-nums; }
.pre { white-space: pre-wrap; overflow-wrap: anywhere; }

/* ── The wordmark ─────────────────────────────────────────────────────────── */
/* Lowercase "mcafax" in Fraunces 900 with a pink full stop, as live text. Type
   only: the cast is the symbol, so nothing is ever drawn beside it as a logo.
   Write it with wordmark() on the server or <Wordmark /> in the browser.
   Its size is --wordmark-size (38px unless told otherwise, about 119px wide).
   It never draws narrower than 72px, which is a size of 23px, and it wants
   clear space of one letter-height on every side. */
.wordmark {
  display: inline-block; flex: none; font-family: var(--font-display); font-variation-settings: var(--fraunces); font-weight: 900;
  font-size: max(23px, var(--wordmark-size, 38px)); line-height: 1; letter-spacing: -0.055em; white-space: nowrap; justify-self: start;
  color: inherit; text-decoration: none;
}
/* As a link it is 44px tall to the finger, in the header and in the footer alike. */
a.wordmark { display: inline-flex; align-items: center; min-height: 44px; }
.wordmark-dot { color: var(--pink); }
/* On pink the full stop flips to espresso. */
.on-pink .wordmark-dot { color: var(--espresso); }
.wordmark-lg { --wordmark-size: 56px; }
.wordmark-xl { --wordmark-size: 96px; }

/* ── Layout helpers ───────────────────────────────────────────────────────── */
.row { display: flex; align-items: center; gap: 10px; }
.wrap { flex-wrap: wrap; }
.spread { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.stack { display: grid; gap: 12px; }
.stack-lg { display: grid; gap: 20px; }
/* Grid children may shrink, so a wide table scrolls inside its card instead of stretching the page. */
.stack > *, .stack-lg > *, .today-grid > *, .deal-grid > *, .grid-2 > *, .grid-3 > *, .grid-4 > * { min-width: 0; }
.grow { flex: 1 1 auto; min-width: 0; }
.right { margin-left: auto; }
.cols-2 { display: grid; gap: 12px; grid-template-columns: 1fr 1fr; }
/* Two, three or four equal columns where there is room for them, and fewer where there is not. A column
   is never narrower than 320, 280 or 200px, so in a narrow box or on a tablet the cards drop to the next
   line by themselves, with no second breakpoint. On a phone: one column (four become two). */
.grid-2, .grid-3, .grid-4 { display: grid; gap: 20px; }
.grid-2 { grid-template-columns: repeat(auto-fill, minmax(min(100%, max(320px, calc((100% - 20px) / 2))), 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fill, minmax(min(100%, max(280px, calc((100% - 40px) / 3))), 1fr)); }
.grid-4 { grid-template-columns: repeat(auto-fill, minmax(min(100%, max(200px, calc((100% - 60px) / 4))), 1fr)); }
/* A band of a page, with air above and below it. */
.section { padding-top: 56px; padding-bottom: 56px; }
/* A comfortable line length for a paragraph that would otherwise run the full width. */
.measure { max-width: 680px; }
/* The middle of every server-made page: server/layout.ts writes it as <main class="site-main …">. It has
   no width and no side margins of its own. A page gives its <main> one of the two widths below, or a
   class of its own that lays out the blocks inside it. This line stays ahead of the two widths, so
   that they win without any page having to say them twice. */
.site-main { margin: 0 auto; }
/* The two page widths. .page-wide is the width the header runs to, so content lines up with the wordmark:
   a home page, a hub, a page of cards. .page-text is the narrower column for a page that is read or
   filled in: an article, a form, a legal page. Both keep the page's side margins. */
.page-wide, .page-text { margin-left: auto; margin-right: auto; padding-left: var(--gutter); padding-right: var(--gutter); }
.page-wide { max-width: calc(var(--page-max) + 2 * var(--gutter)); }
.page-text { max-width: calc(var(--page-text) + 2 * var(--gutter)); }
@media (max-width: 720px) {
  .cols-2, .grid-2, .grid-3 { grid-template-columns: minmax(0, 1fr); }
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .section { padding-top: 36px; padding-bottom: 36px; }
}

/* ── Buttons ──────────────────────────────────────────────────────────────── */
/* Pills, 52px tall, weight 600.
   .btn alone, or .btn-outline: the second choice, a 2px espresso outline.
   .btn-primary: the main action, espresso with paper words.
   .btn-pink: the one highlighted action. AT MOST ONE ON A PAGE.
   .btn-sm: 44px, for a header or a row of small actions. */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 52px; padding: 8px 26px; border-radius: var(--r-pill);
  border: 2px solid var(--text); background: transparent; color: var(--text);
  font-family: var(--font-body); font-size: 17px; font-weight: 600; line-height: 1.2; text-align: center; text-decoration: none; white-space: nowrap;
  cursor: pointer; transition: background-color 0.15s, color 0.15s, border-color 0.15s, box-shadow 0.15s, transform 0.06s;
}
.btn:hover { background: var(--text); color: var(--on-text); }
.btn:active { transform: translateY(1px); }
.btn[disabled], .btn[aria-disabled='true'] { opacity: 0.5; cursor: not-allowed; }
.btn-outline { background: transparent; }
.btn-primary { background: var(--text); color: var(--on-text); }
/* A filled button lightens a little under the pointer, whatever its colour. */
.btn-primary:hover, .btn-pink:hover { box-shadow: inset 0 0 0 99px rgba(255, 255, 255, 0.14); }
/* White on pink is only allowed at 19px bold or larger, so this button keeps that size even when it is small. */
.btn-pink, .btn-pink.btn-sm { min-height: 54px; padding: 8px 28px; border-color: var(--pink); background: var(--pink); color: var(--white); font-size: 19px; font-weight: 700; }
.btn-pink:hover { background: var(--pink); color: var(--white); }
.btn-ghost { border-color: transparent; }
.btn-ghost:hover { background: var(--paper-deep); color: var(--espresso); }
.btn-danger { border-color: var(--pink-ink); color: var(--pink-ink); }
.btn-danger:hover { background: var(--white); color: var(--pink-ink); box-shadow: inset 0 0 0 1px var(--pink-ink); }
.btn-sm { min-height: 44px; padding: 6px 18px; font-size: 15px; }
.btn-block { width: 100%; }
/* A button that reads as a link, inside a sentence or a small corner. It takes a tap 10px above and
   below its words (44px in all) without pushing the lines around it apart. */
.link-btn { background: none; border: 0; padding: 10px 4px; margin: -10px -4px; min-height: 44px; color: inherit; font-weight: 600; cursor: pointer; text-decoration: underline; text-decoration-color: var(--pink); text-decoration-thickness: 2px; text-underline-offset: 0.18em; }
.link-btn:hover { text-decoration-color: currentColor; }
/* A link standing on its own line: weight 600, a thick pink line under it, and tall enough to tap. */
.link { display: inline-flex; align-items: center; min-width: 44px; min-height: 44px; color: inherit; font-weight: 600; text-decoration: underline; text-decoration-color: var(--pink); text-decoration-thickness: 3px; text-underline-offset: 0.3em; }
.link:hover { text-decoration-color: currentColor; }
/* "Open tool" and its arrow: the quiet way into a card. The arrow is drawn by the style, so the words stay clean. */
.link-arrow { display: inline-flex; align-items: center; gap: 6px; min-width: 44px; min-height: 44px; color: inherit; font-weight: 600; text-decoration: none; }
.link-arrow::after { content: '\2192'; transition: transform 0.15s; }
.link-arrow:hover::after { transform: translateX(3px); }
/* A row of buttons under a form. On a phone each one takes the full width. */
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
/* A label too long for a full-width button, or for the whole row, folds onto a second line inside its
   pill. The pill grows taller (it starts at 52px) and stays a pill, and the card it is in is never
   pushed wider than a phone. This is for the buttons that take the width they are given: the ones in
   .actions, and .btn-block. A button standing in a row beside other things keeps its label on one
   line, so that a neighbour can never squeeze it into two. */
.actions > .btn, .btn-block { white-space: normal; }
@media (max-width: 720px) { .actions > .btn { width: 100%; } }

/* ── Form boxes ───────────────────────────────────────────────────────────── */
/* White, a 2px espresso edge, 12px corners, the label above in 600. A box with
   something wrong in it (aria-invalid="true") turns its edge pink, and one pink
   sentence goes under it: "Please enter a number, like 40,000." */
/* (A field keeps its own height: in a card stretched to match a taller neighbour, the spare room goes under the field, not into the box.) */
.field { display: grid; align-content: start; gap: 8px; }
.label { font-weight: 600; font-size: 15px; line-height: 1.3; }
.input, .select, .textarea {
  width: 100%; min-height: 52px; padding: 12px 16px; border-radius: var(--r-12);
  border: 2px solid var(--espresso); background: var(--white); color: var(--espresso); font-size: 17px; line-height: 1.4;
}
.input::placeholder, .textarea::placeholder { color: var(--taupe); opacity: 1; }
/* A date box has parts of the browser's own inside it that make it a little taller, so its height is fixed at the 52px every other box has. */
.input[type='date'], .input[type='datetime-local'] { height: 52px; }
.textarea { min-height: 112px; resize: vertical; }
/* The device's own arrow is replaced by one in espresso, so the box looks the same everywhere. */
.select {
  -webkit-appearance: none; appearance: none; padding-right: 44px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 14 9'%3E%3Cpath d='M1.5 1.5 7 7l5.500-5.500' fill='none' stroke='%23372C26' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 16px center; background-size: 14px 9px;
}
.input:disabled, .select:disabled, .textarea:disabled { border-color: var(--rule-strong); background: var(--paper-deep); color: var(--text-soft); }
.input[aria-invalid='true'], .select[aria-invalid='true'], .textarea[aria-invalid='true'] { border-color: var(--pink); }
.hint { font-size: 14px; line-height: 1.45; color: var(--text-soft); }
.error { font-size: 14px; line-height: 1.45; font-weight: 500; color: var(--pink-ink); }
/* A box to tick, or one of several to choose, with its sentence. The whole line is the thing to tap.
   The tick box (square) and the choice (round) are drawn 22px across, but the part that takes a tap
   is 44px, reaching past the drawing on every side. */
.check { display: flex; gap: 10px; align-items: flex-start; cursor: pointer; }
.check input { width: 22px; height: 22px; margin: 2px 0 0; flex: none; accent-color: var(--espresso); }
.check input[type='checkbox'], .check input[type='radio'] {
  -webkit-appearance: none; appearance: none; width: 44px; height: 44px; margin: -9px -11px -13px; border-radius: var(--r-12); cursor: pointer;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Crect x='2' y='2' width='20' height='20' rx='5' fill='%23fff' stroke='%23372C26' stroke-width='2'/%3E%3C/svg%3E") center / 24px 24px no-repeat;
}
.check input[type='checkbox']:checked {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Crect x='2' y='2' width='20' height='20' rx='5' fill='%23372C26' stroke='%23372C26' stroke-width='2'/%3E%3Cpath d='M7 12.500l3.300 3.300L17 9' fill='none' stroke='%23FEF4EA' stroke-width='2.400' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}
.check input[type='radio'] {
  border-radius: 50%;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Ccircle cx='12' cy='12' r='10' fill='%23fff' stroke='%23372C26' stroke-width='2'/%3E%3C/svg%3E");
}
.check input[type='radio']:checked {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Ccircle cx='12' cy='12' r='10' fill='%23fff' stroke='%23372C26' stroke-width='2'/%3E%3Ccircle cx='12' cy='12' r='5.500' fill='%23372C26'/%3E%3C/svg%3E");
}
.check input[type='checkbox']:disabled, .check input[type='radio']:disabled { opacity: 0.5; cursor: not-allowed; }
.check input[type='checkbox']:focus-visible, .check input[type='radio']:focus-visible { outline-offset: -8px; }
/* The box a person never sees and a robot fills in, which is how a robot's form is told from a person's.
   It is moved off the page, not switched off, because a robot skips a box that is switched off. Every
   form that has one (the application, Stop the Calls, the public tools) hides it with this one line. */
.trap { position: absolute; left: -9999px; top: auto; width: 1px; height: 1px; overflow: hidden; }

/* ── Chips ────────────────────────────────────────────────────────────────── */
/* .chip is a pill that is pressed to choose something. It is quiet: white with
   a thin edge, so a row of them does not read as a row of buttons (a button
   has the firm 2px espresso outline). The chosen one is filled: a button says
   so with aria-pressed="true", and a chip that is a link to another page says
   "you are here" with aria-current="page". For the pill with a face in it,
   see .cast-chip further down. */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 0 18px; border-radius: var(--r-pill); border: 1px solid var(--rule-strong); background: var(--white); color: var(--espresso); font-size: 15px; font-weight: 600; line-height: 1.25; text-decoration: none; cursor: pointer; }
.chip:hover { border-color: var(--espresso); background: var(--peach-soft); }
.chip[aria-pressed='true'], .chip[aria-current='page'] { border-color: var(--espresso); background: var(--espresso); color: var(--paper); }

/* ── Cards and small pieces ───────────────────────────────────────────────── */
/* A card is white on paper with soft corners: 24px, or 16px (.card-sm), or 32px (.card-lg). No shadow. */
.card { background: var(--white); border: 1px solid var(--rule); border-radius: var(--r-24); }
.card-sm { border-radius: var(--r-16); }
.card-lg { border-radius: var(--r-32); }
.pad { padding: 22px; }
.pad-sm { padding: 14px 16px; }
.pad-lg { padding: 32px; }
@media (max-width: 720px) { .pad-lg { padding: 22px; } }
.divider { height: 1px; background: var(--rule); border: 0; margin: 0; }
/* A small marker. The ground tells the tones apart, and the grounds are the ones words are allowed on
   (shirt, peach, mustard, sky, white). A colour home is never one of them: those tints go behind
   characters only. Something wrong or late ("Needs fixing", "2 late") is the one marker with pink
   words and a firm pink edge on white, so it is the first thing seen and cannot be taken for "sent",
   which is white with a thin espresso edge and espresso words. Pink here is pink for an error, and
   the words use the deeper pink that passes the reading test at this size. */
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: var(--r-pill); font-size: 13px; font-weight: 600; line-height: 1.35; white-space: nowrap; background: var(--shirt); color: var(--espresso); }
.b-green { background: var(--peach); }
.b-amber { background: var(--mustard); }
.b-red { background: var(--white); color: var(--pink-ink); box-shadow: inset 0 0 0 2px var(--pink); }
.b-blue { background: var(--sky); }
.b-purple { background: var(--white); box-shadow: inset 0 0 0 1.5px var(--espresso); }
/* A note across a card or a page: a quiet peach panel. Something to check has a mustard edge and
   something wrong a pink edge, both on white; the edge says it, never pink words or a tint. */
.banner { border-radius: var(--r-16); padding: 14px 18px; background: var(--peach-soft); color: var(--espresso); font-size: 15px; line-height: 1.5; }
.banner-warn { background: var(--white); border: 2px solid var(--mustard); padding: 12px 16px; }
.banner-bad { background: var(--white); border: 2px solid var(--pink); padding: 12px 16px; }
.banner-good { background: var(--peach); }
.empty { text-align: center; padding: 28px 16px; color: var(--text-soft); }
.empty strong { display: block; color: var(--text); margin-bottom: 4px; font-weight: 600; }
.spinner { width: 20px; height: 20px; border-radius: 50%; border: 3px solid var(--rule-strong); border-top-color: var(--text); animation: spin 0.8s linear infinite; }
/* Inside a button the spinner takes the colour of the button's words, so it shows on espresso too. */
.btn .spinner { border-color: color-mix(in srgb, currentColor 30%, transparent); border-top-color: currentColor; }
@keyframes spin { to { transform: rotate(360deg); } }
.center-screen { min-height: 60vh; display: grid; place-items: center; padding: 24px; }

.toast-wrap { position: fixed; left: 0; right: 0; bottom: calc(24px + env(safe-area-inset-bottom)); display: grid; justify-items: center; gap: 8px; z-index: 60; pointer-events: none; padding: 0 16px; }
.toast { pointer-events: auto; background: var(--espresso); color: var(--paper); padding: 11px 20px; border-radius: var(--r-pill); font-weight: 600; font-size: 15px; box-shadow: var(--lift); max-width: 100%; }
/* A message that something failed is white with a pink edge, so it cannot be taken for the espresso "Saved". */
.toast-bad { background: var(--white); color: var(--espresso); box-shadow: var(--lift), inset 0 0 0 2px var(--pink); }

/* A pop-up: a sheet from the bottom of a phone, a centred card on a wide screen. */
.modal-back { position: fixed; inset: 0; background: var(--shade); z-index: 50; display: grid; place-items: center; padding: 24px; }
.modal { background: var(--white); width: 100%; max-width: 560px; max-height: 92vh; overflow: auto; border-radius: var(--r-24); padding: 24px; }
@media (max-width: 720px) {
  .modal-back { place-items: end center; padding: 0; }
  .modal { border-radius: var(--r-24) var(--r-24) 0 0; padding: 20px 18px calc(20px + env(safe-area-inset-bottom)); }
}

.table { width: 100%; border-collapse: collapse; font-size: 15px; }
.table th { text-align: left; font-size: 13px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-soft); padding: 8px 10px; border-bottom: 1px solid var(--rule); white-space: nowrap; }
.table td { padding: 10px; border-bottom: 1px solid var(--rule); vertical-align: top; }
.table tr:last-child td { border-bottom: 0; }
.table .n { text-align: right; font-variant-numeric: tabular-nums; }
.table-scroll { overflow-x: auto; position: relative; }
tr.clickable { cursor: pointer; }
tr.clickable:hover td { background: var(--paper); }

.kv { display: grid; grid-template-columns: minmax(110px, 38%) 1fr; gap: 4px 12px; font-size: 15px; }
.kv dt { color: var(--text-soft); }
.kv dd { margin: 0; overflow-wrap: anywhere; }

/* ── The egg ──────────────────────────────────────────────────────────────── */
/* The cast's own outline, used as a frame: a little narrower at the top than at
   the bottom. Peach unless a colour-home class says otherwise. Its width is --egg-size. */
.egg { display: block; flex: none; width: var(--egg-size, 120px); aspect-ratio: 7 / 10; border-radius: 50% 50% 50% 50% / 58% 58% 42% 42%; background-color: var(--peach); }

/* ── The cast ─────────────────────────────────────────────────────────────── */
/* A character is used exactly as drawn: placed, scaled, cropped. A picture of a
   character may be moved, made larger or smaller as one piece, and tilted by at
   most 4 degrees. Nothing else, ever: no stretch, no squash, no filter, no new
   colour, no outline, no mirror image, no props, and no crop that touches the
   eyes or the face.

   Every picture is a square with the figure in the same place. No figure
   starts higher than 6% from the top or ends lower than 86.2%, and none
   reaches further than 12.8% to 87.2% side to side. Both eyes of every
   character are inside the box from 46% to 75% across and 23% to 49% down
   (the eyes, not the rims of Dwight's and Stanley's glasses, which reach
   further out and may be clipped by a side peek, as the concept's own card
   does). Every number below comes from those, and was checked against all
   eighteen in a picture (see /style.html, "Crops").

   Write these with castFace(), castCut(), castRow(), castCrowd(), castChip(),
   castSteps(), pageTop() and castState() in server/cast.ts, or <CastFace>,
   <CastCut>, <CastRow>, <CastCrowd>, <CastChip>, <CastSteps>, <PageTop> and
   <CastState> in src/ui.tsx. */

/* The picture inside any cast piece. These lines are marked "important" on
   purpose: they are the guarantee that no page's own rule about pictures
   (a rounded corner, a fixed shape, "fill the box") can stretch, squash, crop
   or tint a character. The picture is always a whole square, drawn as it is. */
.cast > img, .cast-cut > img {
  position: absolute !important; display: block !important; height: auto !important; max-width: none !important; max-height: none !important; margin: 0 !important; padding: 0 !important;
  aspect-ratio: 1 / 1 !important; object-fit: contain !important; border: 0 !important; border-radius: 0 !important; box-shadow: none !important; background: none !important;
  filter: none !important; opacity: 1 !important; mix-blend-mode: normal !important; transform: none !important;
}

/* 1. A face in its colour home: round, cropped at the shoulders, the whole
      head showing. Four sizes: 110, 48, 32 and 24px. Below 24px a face cannot
      be read; use a plain line icon. The picture is drawn 115% as wide as the
      home, which is the largest it can be before Pam's or Kelly's hair is cut.
      (A box that crops a character says "overflow: clip" after "hidden", here
      and on the stage and the host's card. A hidden box can still be scrolled
      by a script, which would move the crop; a clipped one cannot. The first
      word is for a browser too old to know the second.) */
.cast { position: relative; display: inline-block; flex: none; width: var(--cast-size, 48px); height: var(--cast-size, 48px); border-radius: 50%; overflow: hidden; overflow: clip; vertical-align: middle; background-color: var(--home-peach); }
.cast > img { left: -7.5% !important; top: -2% !important; width: 115% !important; }
.cast-24 { --cast-size: 24px; }
.cast-32 { --cast-size: 32px; }
.cast-48 { --cast-size: 48px; }
.cast-110 { --cast-size: 110px; }
/* The same face in a home with rounded corners, for an app-style tile. */
.cast-sq { border-radius: 28%; }

/* 2. A whole figure with nothing behind it: a "cutout". Its box is the part of
      the picture every figure fits inside (12% to 88% across, 5.5% to 86.5% down),
      so it stands on whatever is under it and nothing is ever cut. The empty
      margin of the picture is trimmed at the sides, so a figure at the edge of
      a phone never makes the page scroll sideways. --cut-size is the height of
      the box, which is the figure's height. Put the size on the cutout, or on
      the row or stage it stands in. */
.cast-cut { position: relative; display: inline-block; flex: none; height: var(--cut-size, 148px); aspect-ratio: 76 / 81; overflow-x: clip; vertical-align: bottom; }
.cast-cut > img { left: -15.789% !important; top: -6.790% !important; width: 131.579% !important; }
.cut-xs { --cut-size: 64px; }
.cut-sm { --cut-size: 96px; }
.cut-md { --cut-size: 148px; }
.cut-lg { --cut-size: 230px; }
.cut-xl { --cut-size: 300px; }
@media (max-width: 720px) {
  .cut-lg { --cut-size: 180px; }
  .cut-xl { --cut-size: 200px; }
}

/* 3. A row: heads standing shoulder to shoulder, each overlapping the next by
      about a third. Three to five is the usual row; all eighteen make the
      strip that closes a page.

      WHO IS IN FRONT: the middle. The row is stacked from both ends towards
      the centre, as the concept draws its hero, its lockup and its strip:
      of five, the first is at the back, the second in front of it, the third
      in front of everybody, then the fourth and the fifth step back again.
      Every character's eyes sit to the right of the face, so this is the
      order that keeps the most eyes in view.

      A ROW ALWAYS FITS ITS BOX. The size asked for (cut-sm, cut-md …) is
      the largest the heads stand. The row is that wide where there is room
      and never wider than the box it is in; each head is a fixed share of the
      row's width, so in a narrow box every head is made smaller together and
      nobody is ever sliced by an edge. This needs no extra class and works in
      a card, a column, a stack, a stage or straight on the page. The one
      thing a row needs is a box that has a width of its own: wrapped in a box
      that only ever shrinks to fit what is inside it, a row has nothing to
      measure itself against and does not show. --n is how many heads there
      are (the helpers write the class row-2 … row-18) and --k is how many
      head-widths wide the row is. */
.cast-row {
  --k: calc(1 + (var(--n, 5) - 1) * 0.54171);
  display: inline-flex; align-items: flex-end; flex: 0 1 auto; min-width: 0; isolation: isolate;
  width: min(100%, calc(var(--cut-size, 148px) * 0.93827 * var(--k)));
}
.row-2 { --n: 2; } .row-3 { --n: 3; } .row-4 { --n: 4; } .row-5 { --n: 5; } .row-6 { --n: 6; } .row-7 { --n: 7; }
.row-8 { --n: 8; } .row-9 { --n: 9; } .row-10 { --n: 10; } .row-11 { --n: 11; } .row-12 { --n: 12; } .row-13 { --n: 13; }
.row-14 { --n: 14; } .row-15 { --n: 15; } .row-16 { --n: 16; } .row-17 { --n: 17; } .row-18 { --n: 18; }
/* Each head is 1/k of the row wide (its height follows from its shape), and overlaps the one before it by 45.8% of a head. */
.cast-row > .cast-cut { position: relative; flex: none; width: calc(100% / var(--k)); height: auto; }
.cast-row > .cast-cut + .cast-cut { margin-left: calc(-45.829% / var(--k)); }
/* The stacking. Counted from the left, each head is one step further forward than the one before it … */
.cast-row > .cast-cut:nth-child(1) { z-index: 1; } .cast-row > .cast-cut:nth-child(2) { z-index: 2; } .cast-row > .cast-cut:nth-child(3) { z-index: 3; }
.cast-row > .cast-cut:nth-child(4) { z-index: 4; } .cast-row > .cast-cut:nth-child(5) { z-index: 5; } .cast-row > .cast-cut:nth-child(6) { z-index: 6; }
.cast-row > .cast-cut:nth-child(7) { z-index: 7; } .cast-row > .cast-cut:nth-child(8) { z-index: 8; } .cast-row > .cast-cut:nth-child(9) { z-index: 9; }
/* … until the middle; past it, each head is as far forward as its place counted from the right. (Where two are
   level, as the two of a pair or the middle two of four, the one on the right is in front.) */
.cast-row > .cast-cut:nth-last-child(1):nth-child(n+2) { z-index: 1; } .cast-row > .cast-cut:nth-last-child(2):nth-child(n+3) { z-index: 2; }
.cast-row > .cast-cut:nth-last-child(3):nth-child(n+4) { z-index: 3; } .cast-row > .cast-cut:nth-last-child(4):nth-child(n+5) { z-index: 4; }
.cast-row > .cast-cut:nth-last-child(5):nth-child(n+6) { z-index: 5; } .cast-row > .cast-cut:nth-last-child(6):nth-child(n+7) { z-index: 6; }
.cast-row > .cast-cut:nth-last-child(7):nth-child(n+8) { z-index: 7; } .cast-row > .cast-cut:nth-last-child(8):nth-child(n+9) { z-index: 8; }
.cast-row > .cast-cut:nth-last-child(9):nth-child(n+10) { z-index: 9; }

/* 4. The crowd: a row of heads in front of a peach egg. "A crowd, not a mascot."
      It takes the full width it is given and picks its own size: 222px heads
      where there is room, smaller where there is not, so that the whole row
      always fits inside its box (on a phone, between the page's side margins).
      --n is how many heads there are; --row is how many head-widths they span. */
.cast-crowd { --n: 5; --row: calc(0.9383 * (1 + (var(--n) - 1) * 0.5417)); position: relative; display: flex; justify-content: center; align-items: flex-end; width: 100%; container-type: inline-size; }
.crowd-3 { --n: 3; }
.crowd-4 { --n: 4; }
.crowd-5 { --n: 5; }
/* First by the width of the screen, for an older phone; then, where the browser can, by the width of the crowd's own box. */
.cast-crowd > * { --cut-size: min(222px, calc((100vw - 2 * var(--gutter)) / var(--row))); }
@supports (width: 1cqw) { .cast-crowd > * { --cut-size: min(222px, calc(100cqw / var(--row))); } }
.cast-crowd > .egg { position: absolute; left: 0; right: 0; top: 0; margin: 0 auto; width: calc(var(--cut-size) * var(--row) * 0.81); height: calc(var(--cut-size) * 2.5); aspect-ratio: auto; border-radius: 50% 50% 50% 50% / 56% 56% 44% 44%; }
.cast-crowd > .cast-row { position: relative; margin-top: calc(var(--cut-size) * 1.5); }

/* 5. A stage: a block of one colour home that the cast stands in. Its edges do
      the cropping. A figure stands on the bottom edge. Add to the figure:
        .to-shoulders   sunk so the edge crops it at the shoulders
        .to-eyes        sunk so only the hair and both eyes show: the "peek"
        .peek-right     looking in from the right edge, both eyes showing
        .peek-left      looking in from the left edge, both eyes showing
      These four are the only crops. None of them can reach an eye. */
.cast-stage { position: relative; display: flex; align-items: flex-end; justify-content: center; gap: 12px; overflow: hidden; overflow: clip; min-height: 120px; padding: 16px 20px 0; border-radius: var(--r-24); background-color: var(--home-peach); }
.cast-stage .cast-cut { margin-bottom: calc(var(--cut-size, 148px) * var(--sink, 0) * -1); }
/* In a row the sink is a share of the head's real height (106.58% of its width), so a row that has been made smaller is still cropped in the same place. */
.cast-stage .cast-row > .cast-cut { margin-bottom: calc(var(--sink, 0) * -106.579% / var(--k)); }
.to-shoulders { --sink: 0.22; }
.to-eyes { --sink: 0.34; }
.cast-stage > .peek-right, .cast-stage > .peek-left { position: absolute; bottom: 0; }
.cast-stage > .peek-right { right: calc(var(--cut-size, 148px) * -0.135); }
.cast-stage > .peek-left { left: calc(var(--cut-size, 148px) * -0.33); }
/* Words on a stage, to the left of the figure: the large "×1.3" of an illustration. The figure then stands a little in from the right. */
.stage-text { align-self: center; flex: 1 1 auto; min-width: 0; padding-bottom: 16px; }
.stage-text + .cast-cut { margin-right: 6%; }

/* 6. A card with its host looking in from the bottom right corner. The card
      takes the host's colour home, and its words keep clear of the face. */
.card-host { position: relative; overflow: hidden; overflow: clip; display: grid; align-content: space-between; gap: 12px; min-height: 172px; padding: 22px calc(var(--cut-size, 148px) * 0.84) 22px 22px; border: 0; --cut-size: 148px; }
.card-host > .cast-cut { position: absolute; right: calc(var(--cut-size) * -0.135); bottom: calc(var(--cut-size) * -0.22); }

/* 7. A chip with a face: a pill, a 30px face on its colour home, a few words.
      White by default (a floating note). With .cast-chip-tint and a .home-…
      class the chip fills with that colour and the face sits on white (a section). */
.cast-chip { display: inline-flex; align-items: center; gap: 8px; min-height: 46px; max-width: 100%; padding: 0 18px 0 8px; border-radius: var(--r-pill); background-color: var(--white); color: var(--espresso); font-size: 15px; font-weight: 600; line-height: 1.25; text-decoration: none; box-shadow: var(--lift); }
.cast-chip > .cast { --cast-size: 30px; }
.cast-chip-tint { box-shadow: none; }
a.cast-chip:hover { box-shadow: var(--lift), inset 0 0 0 2px var(--espresso); }
a.cast-chip-tint:hover { box-shadow: inset 0 0 0 2px var(--espresso); }

/* 8. Steps: progress shown by faces. Each step is a 48px face and its name,
      joined to the next by a short line. The step you are on has a pink ring;
      a step still to come has a quiet ring and quieter words. The ring goes
      round the colour home, with a white gap. It is never an outline drawn on
      the character.

      THE LINE FITS ITS BOX, as a row of heads does. Where the box is wide
      (520px or more) every step is named. In a narrower box, on a phone or
      on any other screen, only the current step's name is written out (a
      screen reader still hears all of them), and the faces, the joining lines
      and the gaps are sized from the width of the line's own box and from
      how many steps there are: 48px faces where there is room, all of them
      smaller together where there is not, and never under 30px. So three
      steps stay on one line inside a padded card on the narrowest phone
      (320px), as they do on a bare page and in the application's sheet on a
      tablet. Room is kept for a name of about ten letters ("Statements").
      With a longer name, or more steps than fit at 30px, the line folds onto
      a second row and nothing is cut. --n is how many steps there are (the
      helpers write the class steps-2 … steps-8). Like a row, the line needs a
      box with a width of its own. */
.cast-steps { --n: 3; display: flex; flex-wrap: wrap; align-items: center; gap: 12px 0; width: 100%; margin: 0; padding: 4px; list-style: none; container-type: inline-size; }
.steps-2 { --n: 2; } .steps-3 { --n: 3; } .steps-4 { --n: 4; } .steps-5 { --n: 5; } .steps-6 { --n: 6; } .steps-7 { --n: 7; } .steps-8 { --n: 8; }
.cast-step { display: inline-flex; align-items: center; gap: 12px; font-size: 15px; font-weight: 600; line-height: 1.25; }
.cast-step + .cast-step::before { content: ''; flex: none; width: 28px; height: 2px; margin: 0 4px 0 16px; border-radius: 2px; background: var(--rule-strong); }
.cast-current { box-shadow: 0 0 0 2px var(--white), 0 0 0 4px var(--pink); }
.cast-next { box-shadow: 0 0 0 2px var(--white), 0 0 0 3.5px var(--rule-strong); }
.step-next { color: var(--text-soft); }
/* IN A NARROW BOX (under 520px: a phone, the application's sheet on a tablet, a card in a column) only
   the step you are on is named (a screen reader still hears every name), and the faces, the joining
   lines and the gaps are sized from the width of the line's own box. This asks about the box, not the
   screen, so it is not a second breakpoint.
   --step-face is how wide one face is drawn. A joining line is 37.5% of a face and a gap 21%, so the
   whole line is (1.795 x the number of steps - 0.585) faces wide, plus the one name that is written
   out. 90px is kept for that name and a little to spare; the faces share what is left of the box. */
@container (max-width: 520px) {
  .cast-step { --step-face: clamp(30px, calc((100cqw - 90px) / (1.795 * var(--n) - 0.585)), 48px); }
  .cast-step { gap: calc(var(--step-face) * 0.21); }
  .cast-step > .cast { --cast-size: var(--step-face); }
  .cast-step + .cast-step::before { width: calc(var(--step-face) * 0.375); margin: 0 0 0 calc(var(--step-face) * 0.21); }
  .cast-step-label { white-space: nowrap; }
  .cast-step:not([aria-current]) > .cast-step-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
}
/* An older phone cannot ask about a box. It gets the same line worked out from the width of the screen,
   as if the line stood on a bare page. The shares are the ones above; change them together. */
@media (max-width: 720px) {
  @supports not (width: 1cqw) {
    .cast-step { --step-face: clamp(30px, calc((100vw - 2 * var(--gutter) - 98px) / (1.795 * var(--n) - 0.585)), 48px); gap: calc(var(--step-face) * 0.21); }
    .cast-step > .cast { --cast-size: var(--step-face); }
    .cast-step + .cast-step::before { width: calc(var(--step-face) * 0.375); margin: 0 0 0 calc(var(--step-face) * 0.21); }
    .cast-step-label { white-space: nowrap; }
    .cast-step:not([aria-current]) > .cast-step-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  }
}

/* 9. The top of a page: where you are, in small plain words; the section's
      host on a chip of the host's colour; the headline; then, if the page has
      them, a sentence and a quiet last line. One pattern for every page that
      belongs to a section. Write it with pageTop() or <PageTop>. */
.page-top { display: grid; justify-items: start; gap: 16px; padding: 28px 0 24px; }
.page-top > * { min-width: 0; max-width: 100%; }
/* The sentence under the headline keeps to a comfortable line (680px), however wide the page; in a
   narrower box it is as wide as the box. (The line above would otherwise undo the shared .measure.) */
.page-top > .measure { max-width: min(100%, 680px); }
.crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 0 8px; margin: -12px 0; font-size: 14px; line-height: 1.4; color: var(--text-soft); }
.crumbs a { display: inline-flex; align-items: center; min-width: 44px; min-height: 44px; color: inherit; text-decoration: none; }
.crumbs a:hover { color: var(--text); text-decoration: underline; text-decoration-color: var(--pink); text-decoration-thickness: 2px; text-underline-offset: 0.3em; }
.page-meta { font-size: 15px; line-height: 1.5; color: var(--text-soft); }
@media (max-width: 720px) {
  .page-top { gap: 12px; padding: 16px 0 20px; }
  /* A long trail ("Notebook / Business Funding / Equipment & Invoice Finance") wraps onto
     the next line. It used to stay on one line and slide sideways, and on a 390px screen the
     last crumb was cut off with the scrollbar hidden. The slash is drawn at the end of the
     crumb before it, so the next line starts on the words and not on a "/". A crumb wider
     than the screen itself ends in an ellipsis. The box still reaches the screen's edges
     (the page's side margin, given back as padding) so the keyboard's ring is not cut, and
     the page does not scroll sideways. Above 720px this block does not apply. */
  .crumbs { flex-wrap: wrap; justify-self: stretch; max-width: none; margin: -12px calc(-1 * var(--gutter)) 0; padding: 6px var(--gutter); overflow-x: clip; }
  .crumbs > span[aria-hidden="true"] { display: none; }
  .crumbs > a:not(:last-child)::after,
  .crumbs > span:not([aria-hidden="true"]):not(:last-child)::after { content: "/"; margin-left: 8px; }
  .crumbs > a,
  .crumbs > span:not([aria-hidden="true"]) { display: inline-block; flex: none; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; line-height: 44px; }
}

/* The colour homes. On a face, a stage, a card or a chip. Behind a character, and nowhere else. */
.home-sky { background-color: var(--home-sky); }
.home-lilac { background-color: var(--home-lilac); }
.home-blush { background-color: var(--home-blush); }
.home-mustard { background-color: var(--home-mustard); }
.home-taupe { background-color: var(--home-taupe); }
.home-shirt { background-color: var(--home-shirt); }
.home-peach { background-color: var(--home-peach); }
.home-pink { background-color: var(--home-pink); }
.home-white { background-color: var(--white); }

/* ── Surfaces ─────────────────────────────────────────────────────────────── */
/* The grounds words may sit on. Each sets the ground and the right colour for
   the words, so a pair that is hard to read cannot be made by accident. (This
   block comes after the cards and the cast so that "card on-peach" is peach.)
   Espresso on paper, on peach, on mustard and on sky, and paper on espresso,
   are good for words of any size. White on pink is for 19px bold or larger only. */
/* A light ground starts the words again at espresso, wherever it sits (a white card in the dark footer, say). */
.on-paper, .on-peach, .on-mustard, .on-sky, .card, .state, .cast-chip,
.home-sky, .home-lilac, .home-blush, .home-mustard, .home-taupe, .home-shirt, .home-peach, .home-pink, .home-white {
  --text: var(--espresso); --on-text: var(--paper); --text-soft: #64574D; --rule: #EDE1D5; color: var(--espresso);
}
.on-paper { background-color: var(--paper); }
.on-peach { background-color: var(--peach); }
.on-mustard { background-color: var(--mustard); }
.on-sky { background-color: var(--sky); }
/* On the three full colours, and on the light pink home, the quieter brown is too faint, so every word is espresso. */
.on-peach, .on-mustard, .on-sky, .home-pink { --text-soft: var(--espresso); }
/* Words on pink start at the smallest size they are allowed: 19px bold. Make them larger, never smaller or lighter. */
.on-pink { --text: var(--white); --on-text: var(--pink); --text-soft: var(--white); background-color: var(--pink); color: var(--white); font-size: 19px; font-weight: 700; line-height: 1.4; }
.on-espresso { --text: var(--paper); --on-text: var(--espresso); --text-soft: #D9CCBF; --rule: rgba(254, 244, 234, 0.2); background-color: var(--espresso); color: var(--paper); }

/* ── The four states ──────────────────────────────────────────────────────── */
/* "Somebody is always there." One pattern: the cast on their colour home, then
   a small label, a headline and a sentence. Who appears is fixed:
     empty    Toby on taupe, standing quietly        "Nothing saved yet."
     loading  Kevin, Darryl and Stanley on sky       "Pulling it together…"
     error    Creed on shirt, peeking over the edge  "That page wandered off."
     success  Andy and Kelly on light pink           "Done. Nice work."
   Write one with castState() or <CastState>. */
.state { --art-one: 142px; --art-three: 92px; --art-peek: 204px; --art-two: 150px; display: grid; grid-template-rows: auto 1fr; overflow: hidden; width: 100%; max-width: 420px; background: var(--white); border: 1px solid var(--rule); border-radius: var(--r-24); color: var(--espresso); }
.state-art { height: 168px; min-height: 0; gap: 10px; padding: 0 16px; border-radius: 0; container-type: inline-size; }
/* How tall the figures stand: one alone, three in a line, one peeking, two together. Each is the size named
   above where there is room and smaller in a narrow card, so nobody is ever cut off by the card's sides. */
.state-art > * { --cut-size: var(--art-one); }
.state-loading .state-art > * { --cut-size: min(var(--art-three), 72px); }
.state-error .state-art > * { --cut-size: var(--art-peek); }
.state-success .state-art > * { --cut-size: var(--art-two); }
@supports (width: 1cqw) {
  .state-art > * { --cut-size: min(var(--art-one), calc(100cqw / 0.9383)); }
  .state-loading .state-art > * { --cut-size: min(var(--art-three), calc((100cqw - 20px) / 2.815)); }
  .state-error .state-art > * { --cut-size: min(var(--art-peek), calc(100cqw / 0.9383)); }
  .state-success .state-art > * { --cut-size: min(var(--art-two), calc(100cqw / 1.4466)); }
}
.state-empty .cast-cut { --sink: 0.05; }
/* The three who are loading stand at three heights and bob in turn. */
.state-loading .cast-cut:nth-child(1) { --sink: 0.12; }
.state-loading .cast-cut:nth-child(2) { --sink: -0.3; animation-delay: -0.53s; }
.state-loading .cast-cut:nth-child(3) { --sink: -0.08; animation-delay: -1.07s; }
/* The words start straight under the art in every card, so four states in a row keep their lines level. */
.state-body { display: grid; align-content: start; gap: 6px; padding: 18px 22px 24px; }
.state-title { font-family: var(--font-display); font-variation-settings: var(--fraunces); font-weight: 800; font-size: var(--fs-h3); line-height: var(--lh-h3); letter-spacing: -0.035em; }
.state-text { font-size: 15px; line-height: 1.5; color: var(--text-soft); }
/* The same state standing on its own in the middle of a page, larger. */
.state-page { --art-one: 180px; --art-three: 116px; --art-peek: 258px; --art-two: 190px; max-width: 520px; margin-left: auto; margin-right: auto; }
.state-page .state-art { height: 212px; }
.state-page .state-body { padding: 22px 28px 30px; }
.state-page .state-title { font-size: var(--fs-h2); line-height: var(--lh-h2); text-wrap: balance; }
.state-page .state-text { font-size: 17px; }

/* ── The four motions ─────────────────────────────────────────────────────── */
/* Move the whole cutout, never the drawing. Put one of these on a .cast-cut or
   a .cast (or .m-stagger on the group they stand in).
     .m-bob      up 8px and back, 1.6s, for ever: idle and loading
     .m-pop      up from 40px below, 90% to full size, 420ms, with a little overshoot: success
     .m-peek     slides in from its edge until both eyes show, 360ms: errors and tips
     .m-stagger  on a group: its members pop in one at a time, 60ms apart, from the middle outwards */
.m-bob { animation: cast-bob 1.6s ease-in-out infinite; }
.m-pop { animation: cast-pop 420ms var(--ease-pop) both; }
.m-peek { animation: cast-peek-up 360ms ease-out both; }
.peek-right.m-peek { animation-name: cast-peek-from-right; }
.peek-left.m-peek { animation-name: cast-peek-from-left; }
.m-stagger > * { animation: cast-pop 420ms var(--ease-pop) both; animation-delay: calc(var(--o, 0) * 60ms); }
/* --o is each member's turn, counted from 0 at the middle, worked out from how many stand in the group (two to five). */
.m-stagger > :nth-child(1):nth-last-child(2) { --o: 1; }
.m-stagger > :nth-child(1):nth-last-child(3) { --o: 1; }
.m-stagger > :nth-child(3):nth-last-child(1) { --o: 2; }
.m-stagger > :nth-child(1):nth-last-child(4) { --o: 2; }
.m-stagger > :nth-child(3):nth-last-child(2) { --o: 1; }
.m-stagger > :nth-child(4):nth-last-child(1) { --o: 3; }
.m-stagger > :nth-child(1):nth-last-child(5) { --o: 3; }
.m-stagger > :nth-child(2):nth-last-child(4) { --o: 1; }
.m-stagger > :nth-child(4):nth-last-child(2) { --o: 2; }
.m-stagger > :nth-child(5):nth-last-child(1) { --o: 4; }
@keyframes cast-bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
@keyframes cast-pop { from { transform: translateY(40px) scale(0.9); } to { transform: translateY(0) scale(1); } }
@keyframes cast-peek-up { from { transform: translateY(68%); } to { transform: translateY(0); } }
@keyframes cast-peek-from-right { from { transform: translateX(90%); } to { transform: translateX(0); } }
@keyframes cast-peek-from-left { from { transform: translateX(-68%); } to { transform: translateX(0); } }
/* A reader who has asked for less motion sees the last frame, standing still. */
@media (prefers-reduced-motion: reduce) {
  .m-bob, .m-pop, .m-peek, .m-stagger > * { animation: none !important; }
  .link-arrow::after, .btn { transition: none; }
  /* The spinner stands still as well; the word beside it ("Loading…") says what is happening. */
  .spinner { animation: none; }
  * { scroll-behavior: auto !important; }
}

/* ── The site header ──────────────────────────────────────────────────────── */
/* The wordmark, four links, and the estimate button. The link for the page you
   are on has the pink line under it. On a phone the links fold behind a round
   Menu button (public/site-menu.js opens and closes it; without that script the
   button stays hidden and the links sit in a row under the wordmark).
   In the page the Menu button is written straight after the wordmark and just
   before the links, so the Tab key goes from the button into the links it
   opens. On a phone the styles place it at the right-hand end. */
.site-head { background: var(--paper); color: var(--espresso); }
/* Three columns, so the links sit in the middle of the page whether or not the button is there. */
.site-head-in { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 8px 24px; max-width: calc(var(--page-max) + 2 * var(--gutter)); margin: 0 auto; padding: 22px var(--gutter); }
.site-nav { display: flex; align-items: center; gap: 0 36px; }
.site-nav a { position: relative; display: inline-flex; align-items: center; min-height: 44px; color: var(--espresso); font-size: 17px; font-weight: 500; text-decoration: none; white-space: nowrap; }
.site-nav a::after { content: ''; position: absolute; left: 0; right: 0; bottom: 5px; height: 3px; border-radius: 2px; background: transparent; }
.site-nav a:hover::after { background: var(--espresso); }
.site-nav a[aria-current='page']::after { background: var(--pink); }
.site-head-end { display: flex; align-items: center; justify-self: end; gap: 10px; }
.site-menu-btn { display: none; place-items: center; flex: none; width: 44px; height: 44px; padding: 0; border: 0; border-radius: 50%; background: var(--espresso); color: var(--paper); cursor: pointer; }
.site-menu-icon, .site-menu-icon::before, .site-menu-icon::after { display: block; width: 18px; height: 2px; border-radius: 2px; background: currentColor; }
.site-menu-icon { position: relative; }
.site-menu-icon::before, .site-menu-icon::after { content: ''; position: absolute; left: 0; transition: transform 0.15s; }
.site-menu-icon::before { top: -6px; }
.site-menu-icon::after { top: 6px; width: 12px; }
/* Open: the three lines become a cross. */
.site-menu-btn[aria-expanded='true'] .site-menu-icon { background: transparent; }
.site-menu-btn[aria-expanded='true'] .site-menu-icon::before { top: 0; transform: rotate(45deg); }
.site-menu-btn[aria-expanded='true'] .site-menu-icon::after { top: 0; width: 18px; transform: rotate(-45deg); }
@media (max-width: 720px) {
  /* One row: the wordmark, the estimate button, the Menu button. On the narrowest phones (320px) the
     wordmark and the button's side padding each give up a little so the row still fits. The gap
     between two things to tap never does: it is 8px at every width. */
  .site-head-in { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; padding-top: 10px; padding-bottom: 10px; }
  .site-head .wordmark { --wordmark-size: clamp(24px, 7.2vw, 28px); margin-right: auto; }
  .site-head-end { order: 1; gap: 8px; }
  /* A link-like button here ("Start over") reaches 4px past its words at each side, which would bring it that much nearer the Menu button. */
  .site-head-end > .link-btn:last-child { margin-right: 0; }
  .site-head-end .btn-sm { padding-left: clamp(10px, calc(8.5vw - 14px), 18px); padding-right: clamp(10px, calc(8.5vw - 14px), 18px); }
  .site-menu-btn { order: 2; }
  /* No script: the links are a plain row under the wordmark. */
  .site-nav { order: 3; flex: 1 0 100%; flex-wrap: wrap; gap: 0 22px; }
  /* With the script: the links wait behind the Menu button, and open as a list. */
  .site-menu-btn:not([hidden]) { display: inline-grid; }
  .site-head[data-menu] .site-nav { display: none; }
  .site-head[data-menu='open'] .site-nav { display: grid; gap: 0; padding: 6px 0 8px; }
  .site-head[data-menu='open'] .site-nav a { min-height: 52px; border-top: 1px solid var(--rule); font-size: 19px; font-weight: 600; }
  .site-head[data-menu='open'] .site-nav a::after { left: auto; right: 2px; bottom: auto; top: 50%; width: 10px; height: 10px; margin-top: -5px; border-radius: 50%; }
  .site-head[data-menu='open'] .site-nav a:hover::after { background: transparent; }
  .site-head[data-menu='open'] .site-nav a[aria-current='page']::after { background: var(--pink); }
}
@media (prefers-reduced-motion: reduce) { .site-menu-icon::before, .site-menu-icon::after { transition: none; } }

/* ── The site footer ──────────────────────────────────────────────────────── */
/* Espresso, with the wordmark reversed, the few links and the small print.
   A short page still ends with its footer at the foot of the screen: the page
   is at least as tall as the screen and the middle part takes up the slack.
   Server-made pages get this by themselves; a browser-app page puts the class
   "site-page" on the block that holds its header, <main> and footer. */
body:has(> .site-foot), .site-page { display: flex; flex-direction: column; min-height: 100vh; min-height: 100dvh; }
/* The middle part grows, and what is in it stays at the top instead of spreading out to fill the space. */
body:has(> .site-foot) > main, .site-page > main { flex: 1 0 auto; width: 100%; align-content: start; }
.site-foot { background: var(--espresso); color: var(--paper); }
.site-foot-in { display: grid; gap: 10px; max-width: calc(var(--page-max) + 2 * var(--gutter)); margin: 0 auto; padding: 36px var(--gutter) calc(40px + env(safe-area-inset-bottom)); }
.site-foot nav { display: flex; flex-wrap: wrap; gap: 0 28px; margin: 4px 0; }
.site-foot nav a { display: inline-flex; align-items: center; min-height: 44px; font-size: 16px; font-weight: 600; text-decoration: none; }
.site-foot nav a:hover { text-decoration: underline; text-decoration-color: var(--pink); text-decoration-thickness: 2px; text-underline-offset: 0.3em; }
.site-foot p { max-width: 720px; font-size: 14px; line-height: 1.5; color: var(--text-soft); }
.site-foot :focus-visible { outline-color: var(--peach); }

/* ── CRM shell ────────────────────────────────────────────────────────────── */
/* The broker desk. It wears the same look as the rest of the site: paper, white
   cards with hairline edges, espresso words, the wordmark, and one face (Jim,
   who hosts the desk). But it is a tool that is open all day, so it is set a
   little tighter than a page that is read: 16px words, the compact headings,
   and rows as close together as they have always been.

   The layout changes at the one width. On a phone (max-width: 720px) the side
   bar is put away and the same links sit in a tab bar along the bottom. */
.shell { min-height: 100vh; display: grid; grid-template-columns: 228px minmax(0, 1fr); font-size: 16px; line-height: 1.5; }
.side { display: flex; flex-direction: column; gap: 4px; position: sticky; top: 0; height: 100vh; overflow-y: auto; padding: 10px 12px 16px; border-right: 1px solid var(--rule); background: var(--white); }
.main { min-width: 0; }
/* A desk screen runs as wide as the site's wide pages, with the same side margins. */
.page { max-width: calc(var(--page-max) + 2 * var(--gutter)); margin: 0 auto; padding: 28px var(--gutter) 48px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.demo-bar { background: var(--peach); color: var(--espresso); font-size: 13.5px; font-weight: 600; text-align: center; padding: 6px 12px; }

/* On the demo, the bar across the top pushes the side bar down by its own height. The foot of the side bar keeps
   that much clear of the bottom, so Sign out is never under the edge of the window. */
.demo-bar + .shell .side { padding-bottom: 50px; }
/* An icon at the start of a row keeps its size when the row is tight. */
.main .row > svg, .main .spread > svg { flex: none; }

/* The top of the side bar, and of the sign-in card: the wordmark, then the word "desk" as a small label. */
.brand { display: flex; align-items: baseline; gap: 8px; min-height: 44px; padding: 4px 10px; color: inherit; text-decoration: none; }
.brand .wordmark { --wordmark-size: 28px; }
.side-nav { display: grid; gap: 2px; }
.nav-item { display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 8px 12px; border-radius: var(--r-12); color: var(--text); font-weight: 600; text-decoration: none; }
.nav-item svg { flex: none; width: 20px; height: 20px; color: var(--text-soft); }
.nav-item:hover { background: var(--paper); }
/* The screen you are on: a quiet peach panel, and the pink dot the site's own menu uses for "you are here". */
.nav-item.active { background: var(--peach-soft); }
.nav-item.active svg { color: var(--text); }
/* (The dot is drawn with its edge alone, 4px all round, which makes a filled 8px circle.) */
.nav-item.active::after { content: ''; flex: none; width: 0; height: 0; margin-left: auto; border: 4px solid var(--pink); border-radius: 50%; }
.nav-count { margin-left: auto; background: var(--espresso); color: var(--paper); border-radius: var(--r-pill); font-size: 12px; font-weight: 600; padding: 1px 7px; }
/* The foot of the side bar: Jim beside the name of whoever is signed in, then the two small links. */
.side-foot { display: grid; margin-top: auto; padding: 8px 8px 0; border-top: 1px solid var(--rule); font-size: 14px; }
.side-me { display: flex; align-items: center; gap: 10px; min-width: 0; padding-bottom: 2px; line-height: 1.3; overflow-wrap: anywhere; }
/* Each of the two is a row 44px tall, so a finger on a tablet finds one without catching the other. */
.side-foot > a, .side-foot > .link-btn { display: inline-flex; align-items: center; justify-self: start; min-height: 44px; margin: 0; padding: 0; text-align: left; }

/* The tab bar: only on a phone. Each tab is an icon over a word; the one you are on has the pink line above it. */
.tabbar { display: none; position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); padding-bottom: env(safe-area-inset-bottom); border-top: 1px solid var(--rule); background: var(--white); }
.tab { position: relative; display: grid; justify-items: center; align-content: center; gap: 2px; min-width: 0; min-height: 56px; padding: 8px 1px 7px; overflow: hidden; border: 0; background: none; color: var(--text-soft); font-size: clamp(10px, 3vw, 11.5px); font-weight: 600; line-height: 1.3; text-decoration: none; cursor: pointer; }
.tab svg { width: 22px; height: 22px; }
.tab.active { color: var(--text); }
.tab.active::before { content: ''; position: absolute; top: 0; left: 50%; width: 28px; margin-left: -14px; border-top: 3px solid var(--pink); border-radius: 0 0 3px 3px; }

/* The sign-in card, and the two cards shown in its place when the desk cannot open: Jim, the wordmark, then the words. */
.signin { display: grid; gap: 14px; width: 100%; max-width: 440px; }
.signin-top { display: grid; justify-items: center; gap: 6px; padding-bottom: 4px; }
.signin-top .brand { padding: 0; }
.signin-top .brand .wordmark { --wordmark-size: 38px; }
.signin-or { text-align: center; }
/* A button or a last line under the sentence of a whole-screen state: a little air above it. */
.desk-state-more { margin-top: 10px; }

/* A box with a line round it inside a card or a pop-up: one group of fields, one choice. */
.desk-box { border: 1px solid var(--rule-strong); border-radius: var(--r-12); padding: 14px; }
/* One of two choices drawn as boxes. The chosen one is the quiet peach panel with an espresso edge. */
.desk-choice { border: 2px solid var(--rule-strong); border-radius: var(--r-12); background: var(--white); padding: 12px; }
.desk-choice.on { border-color: var(--espresso); background: var(--peach-soft); }
/* A card whose form has changes that are not saved yet: the mustard edge of something to check. */
.card.desk-unsaved { border-color: var(--mustard); box-shadow: inset 0 0 0 1px var(--mustard); }
/* Cancel and Save stay in reach at the foot of a long pop-up form. */
.desk-foot { position: sticky; bottom: 0; z-index: 1; justify-content: flex-end; padding: 12px 0 calc(12px + env(safe-area-inset-bottom)); border-top: 1px solid var(--rule); background: var(--white); }
/* A line across a card, above its last row of small print. */
.desk-rule-top { border-top: 1px solid var(--rule); padding-top: 10px; }
/* A link on a line of its own that is shorter than a finger: the area that answers a tap reaches 12px above and
   below the words, and nothing on the page moves to make room for it. */
.desk-tap { display: inline-block; padding: 12px 0; margin: -12px 0; }
/* A bar that shows a share of something: the track is quiet, the filled part is espresso. Its width is set where it is used. */
.desk-meter { height: 12px; overflow: hidden; border-radius: var(--r-pill); background: var(--paper-deep); }
.desk-meter > span { display: block; height: 100%; border-radius: var(--r-pill); background: var(--espresso); }

/* On a phone: the side bar is put away, the tab bar shows, the page keeps clear of it at the bottom, and a "saved"
   message sits just above it. */
@media (max-width: 720px) {
  .shell { grid-template-columns: minmax(0, 1fr); padding-bottom: calc(68px + env(safe-area-inset-bottom)); }
  .side { display: none; }
  .tabbar { display: grid; }
  .page { padding: 18px var(--gutter) 32px; }
  /* Cancel and Save share the full width of a pop-up form. */
  .desk-foot .btn { flex: 1 1 auto; }
  body:has(.tabbar) .toast-wrap { bottom: calc(76px + env(safe-area-inset-bottom)); }
}

/* ── Today ────────────────────────────────────────────────────────────────── */
/* The row of numbers: four across where there is room, fewer in a narrow column, two on a phone. */
.stat-grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(min(100%, max(190px, calc((100% - 36px) / 4))), 1fr)); }
.stat { padding: 14px 16px; border-radius: var(--r-16); }
.stat .v { font-size: 24px; font-weight: 700; line-height: 1.2; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
/* Two columns side by side where both have room to be read, one under the other where they do not. */
.today-grid { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 16px; }
.today-grid > :first-child { flex: 1.15 1 400px; }
.today-grid > :last-child { flex: 1 1 380px; }
.list { display: grid; }
/* One row of a list. On a narrow card the marker at the end of the row drops under the words instead of squeezing them. */
.list-item { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; min-height: 56px; padding: 12px 16px; border-top: 1px solid var(--rule); color: inherit; text-decoration: none; }
.list-item:first-child { border-top: 0; }
.list-item > .grow { flex: 1 1 0; min-width: min(100%, 11em); }
.list-item > :last-child:not(.grow) { margin-left: auto; }
.list-item a { color: inherit; text-decoration: none; }
.list-item a:hover { text-decoration: underline; text-decoration-color: var(--pink); text-decoration-thickness: 2px; text-underline-offset: 0.18em; }
a.list-item:hover, button.list-item:hover { background: var(--paper); }
/* A row that is a card by itself keeps the card's own edge, and the last row of a list follows the card's round corners. */
.card.list-item { border-top: 1px solid var(--rule); border-radius: var(--r-16); }
.card > .list:last-child > .list-item:last-child { border-radius: 0 0 23px 23px; }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 14px 16px 10px; }
/* The round "mark done" button: 44px, so a thumb finds it. */
.tick { flex: none; display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; border: 2px solid var(--rule-strong); background: var(--white); color: var(--text-soft); cursor: pointer; }
.tick:hover { border-color: var(--text); background: var(--peach-soft); color: var(--text); }
@media (max-width: 720px) {
  .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stat { padding: 12px 14px; }
  .stat .v { font-size: 22px; }
}

/* ── Pipeline board ───────────────────────────────────────────────────────── */
/* The board is wider than most screens, so it scrolls sideways inside its own box and the page never does. */
.board { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(264px, 1fr); gap: 12px; overflow-x: auto; padding-bottom: 12px; scroll-snap-type: x proximity; }
.col { display: grid; gap: 8px; align-content: start; min-height: 160px; padding: 10px; border-radius: var(--r-16); background: var(--paper-deep); scroll-snap-align: start; }
/* The column a card is being dragged over. */
.col.drop { outline: 3px dashed var(--espresso); outline-offset: -3px; background: var(--peach-soft); }
.col-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; padding: 2px 4px 4px; }
.deal-card { display: block; padding: 10px 12px; border: 1px solid var(--rule); border-radius: var(--r-12); background: var(--white); color: inherit; text-decoration: none; cursor: grab; }
.deal-card:hover { border-color: var(--espresso); }
.deal-card.dragging { opacity: 0.45; }
.deal-card .name { font-weight: 600; line-height: 1.25; overflow-wrap: anywhere; }
/* The same deals as a list. On a phone the list scrolls sideways inside its card, so the business's name keeps
   room to be read instead of being folded into a narrow strip. */
.deal-table td:first-child { min-width: 11em; }
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 14px; }
.toolbar .input { max-width: 320px; }
/* A row of choices where one is always picked: a white pill, and the picked one filled with espresso. */
.seg { display: inline-flex; flex-wrap: wrap; gap: 2px; max-width: 100%; padding: 3px; border: 1px solid var(--rule-strong); border-radius: 26px; background: var(--white); }
.seg button { min-height: 44px; padding: 0 16px; border: 0; border-radius: var(--r-pill); background: transparent; color: var(--text); font-size: 15px; font-weight: 600; cursor: pointer; }
.seg button:hover { background: var(--peach-soft); }
.seg button[aria-pressed='true'] { background: var(--espresso); color: var(--paper); }
.seg button[disabled] { opacity: 0.5; cursor: not-allowed; }
@media (max-width: 720px) {
  .toolbar .input { max-width: none; }
}

/* ── Deal page ────────────────────────────────────────────────────────────── */
/* What happened on the left, who they are on the right; one under the other where the two would be squeezed. */
.deal-grid { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 16px; }
.deal-grid > :first-child { flex: 1.25 1 420px; }
.deal-grid > :last-child { flex: 1 1 360px; }
/* Call, Text, Email, Note: four across, sharing the row equally. In a row too narrow for four (under 310px, which
   is only the narrowest phones) they stand as two rows of two instead of pushing the page sideways. The sum in the
   middle does the choosing: it is a huge number in a narrow row and a negative one in a roomy row. */
.quick { display: flex; flex-wrap: wrap; gap: 6px; }
.quick .btn { flex: 1 1 clamp(70px, (310px - 100%) * 999, calc(50% - 3px)); padding: 0 2px; }
/* A button further down a deal's page can carry a long line or a lender's name, so its words wrap inside it. */
.deal-grid .btn { white-space: normal; text-align: center; padding-top: 6px; padding-bottom: 6px; }
/* The stages a deal goes through, left to right. The ones behind it are peach, the one it is at is espresso.
   Where one row is too narrow for all eight they fold onto a second row, so no stage is ever out of sight.
   On a phone they stay on one row that slides sideways inside its own box, which costs far less height. */
.stagebar { display: flex; flex-wrap: wrap; gap: 4px; margin: -3px; padding: 3px 3px 5px; }
.stagebar button { flex: none; min-height: 44px; padding: 0 14px; border: 1px solid var(--rule-strong); border-radius: var(--r-pill); background: var(--white); color: var(--text-soft); font-size: 14px; font-weight: 600; white-space: nowrap; cursor: pointer; }
.stagebar button:hover { border-color: var(--text); color: var(--text); }
.stagebar button.past { border-color: var(--peach); background: var(--peach); color: var(--espresso); }
.stagebar button.now { border-color: var(--espresso); background: var(--espresso); color: var(--paper); }
.timeline { display: grid; }
.tl-item { display: grid; grid-template-columns: 30px 1fr; gap: 10px; padding: 10px 0; border-top: 1px solid var(--rule); }
.tl-item:first-child { border-top: 0; }
/* The round mark beside each line of the history. Its ground says what kind of line it is; the icon is always espresso. */
.tl-dot { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: var(--paper-deep); color: var(--espresso); font-size: 14px; }
.tl-dot.t-call, .tl-dot.t-email, .tl-dot.t-text { background: var(--sky); }
.tl-dot.t-stage { background: var(--shirt); }
.tl-dot.t-funding { background: var(--peach); }
.tl-dot.t-permission, .tl-dot.t-lender { background: var(--white); box-shadow: inset 0 0 0 1.5px var(--espresso); }
/* The line that opens the numbers Oscar read: 44px to the finger, in the room a 32px line took before. */
.deal-more { padding: 11px 0; margin: -6px 0; cursor: pointer; }
.sub-card { border: 1px solid var(--rule); border-radius: var(--r-16); padding: 12px; }
.offer { background: var(--peach-soft); border-radius: var(--r-12); padding: 10px 12px; }
@media (max-width: 720px) {
  .stagebar { flex-wrap: nowrap; overflow-x: auto; }
}

/* ── Public pages ─────────────────────────────────────────────────────────── */
/* The home page, the application and the permission page. They are built from
   the shared pieces; what is here is only where those pieces stand on these
   three pages. */

/* THE HOME PAGE. Four parts with a lot of paper between them: the hero, the
   three doors, Oscar's estimate, and the whole cast on espresso. */
.home-doors, .home-estimate, .home-strip { margin-top: 112px; }

/* The hero: the words on the left, the crowd on its peach egg on the right.
   The headline is the one place the largest size is used. It comes down a
   little on a narrower screen so that "Small-business" always fits on a line. */
.home-hero { display: grid; grid-template-columns: minmax(0, 1.08fr) minmax(0, 1fr); align-items: end; gap: 16px; padding-top: 44px; }
.home-hero-words { display: grid; justify-items: start; gap: 28px; }
/* (The headline fills each line before starting the next, which is how the concept breaks it: "money, in plain" stays together.) */
.home-hero-title { font-size: min(var(--fs-display), 7.5vw); text-wrap: wrap; }
.home-hero-words > .t-body-l { max-width: 520px; }
.home-hero-art { position: relative; }
/* The two floating notes over the egg, clear of every face. */
.home-note { position: absolute; z-index: 1; white-space: nowrap; }
.home-note-oscar { left: 6%; top: 10%; }
.home-note-angela { right: 0; top: 29%; }

/* The three doors. Each card is one link: the arrow line is the link, and it
   reaches over the whole card, so the card can be tapped anywhere. */
.home-doors { display: grid; gap: 28px; }
.home-door { min-height: 252px; padding-top: 26px; padding-bottom: 14px; padding-left: 26px; }
.home-door:hover { box-shadow: inset 0 0 0 2px var(--espresso); }
.home-door .link-arrow::before { content: ''; position: absolute; inset: 0; z-index: 1; }

/* Oscar's part: the estimate. Its headline and button beside Oscar on his sky
   stage, then the three steps with the faces the application uses for them,
   then the two promises, each on its own white card. */
.home-estimate { display: grid; gap: 64px; }
.home-estimate-top { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(360px, 1fr); align-items: center; gap: 48px; }
.home-estimate-words { display: grid; justify-items: start; gap: 20px; }
/* (Oscar stands as tall as the stage has room for: full size on a wide screen, smaller beside a narrow column.) */
.home-oscar { --cut-size: clamp(148px, 18vw, 230px); min-height: 0; padding: 0 8px 0 36px; border-radius: var(--r-32); }
.home-oscar .stage-text { display: grid; gap: 6px; padding: 32px 0; }
.home-how { display: grid; gap: 28px; }
.home-steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 40px; margin: 0; padding: 0; list-style: none; }
.home-steps li { display: grid; align-content: start; gap: 14px; }
.home-steps li > div { display: grid; gap: 4px; }
/* The two promises keep their words at the top of the card when one card is taller than the other. */
.home-promise { align-content: start; }

/* The whole cast, standing on the line where the footer starts. */
.home-strip { padding-top: 88px; border-bottom: 1px solid var(--rule); }
.home-strip-in { display: grid; gap: 64px; }
.home-strip-in > .cast-row { justify-self: center; }

@media (max-width: 720px) {
  .home-doors, .home-estimate, .home-strip { margin-top: 64px; }
  /* The hero in the order the concept draws it: chip, headline, sentence, the two buttons full width, then the crowd. */
  .home-hero { grid-template-columns: minmax(0, 1fr); gap: 36px; padding-top: 12px; }
  .home-hero-words { gap: 20px; }
  .home-hero-title { font-size: min(var(--fs-display), 14.4vw); }
  .home-hero-words > .actions, .home-estimate-words > .actions { width: 100%; }
  .home-note { display: none; }
  .home-doors { gap: 20px; }
  .home-door { min-height: 216px; }
  .home-estimate { gap: 44px; }
  .home-estimate-top { grid-template-columns: minmax(0, 1fr); gap: 28px; }
  .home-oscar { --cut-size: clamp(110px, 34vw, 148px); padding-left: 24px; border-radius: var(--r-24); }
  .home-steps { grid-template-columns: minmax(0, 1fr); gap: 24px; }
  .home-steps li { grid-template-columns: 48px minmax(0, 1fr); }
  .home-strip { padding-top: 56px; }
  .home-strip-in { gap: 40px; }
}

/* ── Oscar thread ─────────────────────────────────────────────────────────── */
/* A FORM PAGE: the application and the permission page. One white sheet on
   paper. Its top is the host's chip, the headline, a sentence and the progress
   line of faces; under that, the conversation and whatever is being asked now.
   On the application a second card stands beside it with the help text. */
.apply { display: grid; grid-template-columns: minmax(0, 1fr) minmax(240px, 34%); align-items: start; gap: clamp(20px, 3vw, 40px); padding-top: 28px; padding-bottom: 104px; }
/* A form page with no help card is one reading column. */
.apply.page-text { grid-template-columns: minmax(0, 1fr); }
.sheet { display: grid; gap: 36px; padding: 48px clamp(24px, 4.2vw, 52px) 52px; }
.sheet > * { min-width: 0; }
.sheet-top { display: grid; justify-items: start; gap: 16px; }
.sheet-top > .cast-steps { margin-top: 8px; }
/* A list inside the sheet or inside something Oscar says. */
.sheet-list { display: grid; gap: 4px; margin: 0; padding-left: 22px; }

/* A form page that is nothing but one of the four states (still loading, or it could not load): the state stands in the middle. */
.site-page > .apply-screen { display: grid; grid-template-columns: minmax(0, 1fr); align-content: center; padding: 40px var(--gutter) 96px; }
.apply-screen .state-body > .actions { margin-top: 12px; }

/* The help card: the section's helper looks in from the corner, under the words. */
.apply-help { --cut-size: 230px; position: sticky; top: 24px; align-content: start; min-height: 0; padding: 40px clamp(22px, 3vw, 40px) 196px; border-radius: var(--r-32); }
.apply-help .t-h3 { text-wrap: balance; }

/* The conversation. Oscar's lines are paper bubbles beside his face; the
   merchant's answers are espresso bubbles on the right, each with its "Edit". */
.thread { display: grid; gap: 16px; }
.thread > * { min-width: 0; }
.thread-pair { display: grid; gap: 16px; }
/* When the page brings the newest part into view, it leaves some room under it. The marker itself takes no room. */
.thread-end { margin-top: -16px; scroll-margin-bottom: 40px; }
.msg { display: grid; grid-template-columns: 40px minmax(0, 1fr); gap: 12px; align-items: start; }
.bubble { justify-self: start; max-width: 100%; padding: 12px 18px; border-radius: 6px 20px 20px 20px; background: var(--paper); overflow-wrap: anywhere; }
.bubble p + p, .bubble p + ul { margin-top: 8px; }
/* Oscar's face stands beside the first thing he says. When he says several things in a row, and straight
   after the card that already shows him, the later bubbles keep their place without repeating his face. */
.msg:not(.msg-me) + .msg:not(.msg-me) > .cast, .msg:not(.msg-me) + .thread-pair > .msg:first-child > .cast, .answer + .msg > .cast { visibility: hidden; }
.msg-me { grid-template-columns: minmax(0, 1fr); justify-items: end; }
.bubble-me { display: flex; align-items: baseline; gap: 14px; max-width: 86%; padding: 10px 18px; border-radius: 20px 20px 6px 20px; overflow-wrap: anywhere; }
.bubble-me .link-btn { flex: none; font-size: 15px; }
/* What is being asked now: the small label, the fields, the buttons. It is part of the sheet, not a box of its own. */
.composer { display: grid; gap: 18px; margin-top: 8px; padding-top: 28px; border-top: 1px solid var(--rule); }
.composer > * { min-width: 0; }
.composer > .link-btn { justify-self: start; }
/* One statement file: its name, its size, and the way to take it off the list. */
.file-list { display: grid; gap: 8px; padding: 0; margin: 0; list-style: none; }
.file-list li { display: flex; align-items: center; gap: 12px; min-height: 52px; padding: 4px 16px; border-radius: var(--r-12); background: var(--paper); font-size: 15px; }
/* A long file name folds; its size and "Remove" stay whole on one line. */
.file-list .grow { overflow-wrap: anywhere; }
.file-list li > :not(.grow) { flex: none; white-space: nowrap; }
/* Oscar's answer: the range, large, on his own card. */
.answer { align-content: center; }
.answer-range { font-variant-numeric: tabular-nums; }
/* A lender that fits. Picking one fills its card with quiet peach and firms its edge. */
.lender-list { display: grid; gap: 12px; }
.lender-card { display: grid; gap: 6px; padding: 16px 18px; }
.lender-card.picked { border-color: var(--espresso); box-shadow: inset 0 0 0 1px var(--espresso); background: var(--peach-soft); }
/* A state inside the conversation (the wait, the finish) sits in the middle of the sheet. */
.thread > .state { margin-left: auto; margin-right: auto; }

@media (max-width: 720px) {
  /* One column: the sheet, then the help card under it. */
  .apply { grid-template-columns: minmax(0, 1fr); gap: 20px; padding-top: 8px; padding-bottom: 56px; }
  .sheet { gap: 28px; padding: 24px 20px 28px; border-radius: var(--r-24); }
  .sheet-top { gap: 12px; }
  .apply-help { --cut-size: 148px; position: relative; top: auto; padding: 24px 22px 128px; border-radius: var(--r-24); }
  .bubble { padding: 10px 14px; }
  .bubble-me { max-width: 94%; padding: 8px 14px; }
  .composer { padding-top: 24px; }
}

/* ── Notebook: public pages ─────────────────────────────────────────────────
   The Notebook's reading pages (server/notebook/pages.ts): the front page and
   its lists, the section, category and series pages, every article, and the
   lender reviews hub. Keep them between this line and the next marker.

   These pages are built from the shared pieces: the page top with the host's
   chip, the type classes, chips, cards, buttons, the cast. Only where those
   pieces stand on these pages, and how the words of an article are set, is
   here. The guides, the legal pages and the desk's preview set their text with
   the same article styles (.nb-body).

   The rules the owner insists on, and where each is kept:
   - nothing scrolls sideways from 320px up: long words and addresses wrap,
     pictures shrink, a table or code block scrolls inside its own box;
   - anything meant to be tapped is at least 44px tall;
   - article text is 17px on a 27px line, never smaller;
   - the layout changes at 720px and nowhere else. */

/* The page: the full width of the header (the shared .page-wide, written on the <main>), with air under
   the last line before the footer. */
.nb-wide { padding-bottom: 96px; }
/* A page that is nothing but a state (not found) stands clear of the header. */
.nb-wide > .state { margin-top: 32px; }
.nb-wide > .state-page { margin-top: 56px; }
.nb-wide .state-body .btn { margin-top: 10px; }

/* ── Small lines used all over these pages ── */
.nb-meta { font-size: 14px; line-height: 1.5; color: var(--text-soft); }
/* A sentence that has to be there and should not shout: the compensation line, a legal note. */
.nb-note { max-width: 680px; margin-top: 24px; padding-top: 16px; border-top: 1px solid var(--rule); font-size: 15px; line-height: 1.5; color: var(--text-soft); }
/* Straight under the top of a page it is simply the next quiet line. */
.page-top + .nb-note { margin-top: 0; padding-top: 0; border-top: 0; }
.nb-note + .nb-body { margin-top: 32px; }
.nb-empty { padding: 28px 0; color: var(--text-soft); }

/* ── The article ──
   The words on the left at the reading width; beside them, the list of the article's headings and
   the card that leads to the application. Both stay in view while the article is read. */
.nb-split { display: grid; grid-template-columns: minmax(0, 1fr) clamp(280px, 31%, 360px); align-items: start; gap: 0 48px; }
.nb-main { min-width: 0; max-width: var(--page-text); }
/* A long headline comes down a little on a screen between a phone and a desk, where its column is narrow. */
.nb-main .t-h1 { font-size: min(var(--fs-h1), max(40px, 5.2vw + 6px)); }
/* The quiet line under the headline: who wrote it and when. Its link takes a tap above and below the words. */
.page-meta.nb-byline { margin: -8px 0 32px; }
.nb-byline a { display: inline-block; padding: 12px 0; margin: -12px 0; }
/* The post's own picture. */
.nb-cover { margin: 0 0 32px; }
.nb-cover img { display: block; width: 100%; height: auto; border-radius: var(--r-24); background: var(--paper-deep); }
.nb-cover figcaption { margin-top: 10px; font-size: 14px; line-height: 1.5; color: var(--text-soft); }
/* What follows the article and is still read: the questions, the way to the next part. */
.nb-read { max-width: var(--page-text); }
/* The few paragraphs that open a series or the reviews hub, under the top of the page. */
.nb-intro { margin-top: 24px; }
.page-top + .nb-intro { margin-top: 0; }

/* Beside the article. The first card starts level with the host's chip. */
.nb-aside { position: sticky; top: 24px; display: grid; gap: 16px; max-height: calc(100vh - 48px); margin-top: 64px; overflow-y: auto; }
.nb-aside > * { min-width: 0; }
/* "On this page": one line for each main heading, with a hairline between them. */
.nb-toc { padding: 24px 24px 10px; }
.nb-toc ol { margin: 10px 0 0; padding: 0; list-style: none; }
.nb-toc li + li { border-top: 1px solid var(--rule); }
.nb-toc a { display: flex; align-items: center; min-height: 52px; padding: 10px 0; font-size: 16px; line-height: 1.3; text-decoration: none; overflow-wrap: anywhere; }
.nb-toc a:hover { text-decoration: underline; text-decoration-color: var(--pink); text-decoration-thickness: 2px; text-underline-offset: 0.3em; }
/* The card that leads to the application: Oscar looks in from the corner, a little smaller than on a
   full card, so the words run the whole width above him and the button stands beside him. */
.nb-apply { --cut-size: 112px; align-content: center; justify-items: start; gap: 24px; min-height: 124px; padding: 22px; font-size: 16px; line-height: 1.5; }
.nb-apply > .btn { max-width: calc(100% - var(--cut-size) * 0.8); white-space: normal; }
/* The quiet line under the estimate button. Same small print as the rest of a Notebook card, kept clear of Oscar, and pulled up so it reads as a note on the button rather than a second block. */
.nb-apply > .nb-apply-note { max-width: calc(100% - var(--cut-size) * 0.8); margin-top: -12px; }

/* ── The words of an article ──
   Everything an author can type is styled from here: 17px on a 27px line, with real air between blocks. */
.nb-body { font-size: var(--fs-body); line-height: var(--lh-body); overflow-wrap: break-word; }
.nb-body > * + * { margin-top: 20px; }
.nb-body > :first-child { margin-top: 0; }
/* Headings: the size of a part of a page, then the size of a card, then plain bold. A link from
   "On this page" lands with a little air above the heading. */
.nb-body h2, .nb-body h3 { font-family: var(--font-display); font-variation-settings: var(--fraunces); font-weight: 800; letter-spacing: -0.035em; text-wrap: balance; overflow-wrap: anywhere; scroll-margin-top: 24px; }
.nb-body h2 { margin-top: 56px; font-size: var(--fs-h2); line-height: var(--lh-h2); }
.nb-body h3 { margin-top: 40px; font-size: var(--fs-h3); line-height: var(--lh-h3); }
.nb-body h4, .nb-body h5, .nb-body h6 { margin: 32px 0 0; font-size: var(--fs-body); font-weight: 700; line-height: 1.35; overflow-wrap: anywhere; }
.nb-body h2 + *, .nb-body h3 + * { margin-top: 16px; }
.nb-body a { overflow-wrap: anywhere; }
/* In a lender review, a link that leads to our own application is dotted, so it is not mistaken for a source. */
.nb-body a.apply-inline { text-decoration-style: dotted; }
.nb-body ul, .nb-body ol { margin-bottom: 0; padding-left: 1.4em; }
.nb-body li + li, .nb-body li > ul, .nb-body li > ol { margin-top: 8px; }
.nb-body li::marker { color: var(--text-soft); font-weight: 600; }
/* A quote or a call-out: a quiet peach panel, its own words in the display face. Nobody signs it. */
.nb-body blockquote { margin-left: 0; margin-right: 0; padding: 24px 28px; border-radius: var(--r-24); background: var(--peach-soft); font-family: var(--font-display); font-variation-settings: var(--fraunces); font-size: var(--fs-body-l); font-style: italic; font-weight: 500; line-height: 1.43; letter-spacing: -0.01em; }
.nb-body blockquote > * + * { margin-top: 12px; }
.nb-body blockquote strong { font-weight: 800; }
.nb-body img { max-width: 100%; height: auto; border-radius: var(--r-16); }
.nb-body figure { margin-left: 0; margin-right: 0; }
.nb-body figcaption { margin-top: 8px; font-size: 14px; line-height: 1.5; color: var(--text-soft); }
.nb-body hr { height: 1px; margin: 40px 0 0; border: 0; background: var(--rule); }
.nb-body code { padding: 2px 6px; border-radius: 6px; background: var(--paper-deep); overflow-wrap: anywhere; }
.nb-body pre { overflow-x: auto; padding: 18px 20px; border-radius: var(--r-16); background: var(--paper-deep); font-size: 15px; line-height: 1.55; }
.nb-body pre code { padding: 0; background: none; font-size: inherit; overflow-wrap: normal; }
/* A table is a white card. A wide one scrolls inside the card, so the page itself never does.
   The keyboard ring is the same espresso ring as every other control, so a person tabbing
   can see they have landed on the scrolling box or on a paste box. */
.nb-body .table-scroll { overflow-x: auto; border: 1px solid var(--rule); border-radius: var(--r-16); background: var(--white); -webkit-overflow-scrolling: touch; }
.nb-body .table-scroll:focus-visible, .nb-body pre:focus-visible { outline: 3px solid var(--text); outline-offset: 2px; }
.nb-body table { width: 100%; border-collapse: collapse; font-size: var(--fs-body); line-height: 1.4; }
.nb-body th, .nb-body td { padding: 14px 16px; border-bottom: 1px solid var(--rule); text-align: left; vertical-align: top; }
.nb-body thead th { font-size: var(--fs-label); font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-soft); white-space: nowrap; }
.nb-body th[align='right'], .nb-body td[align='right'] { text-align: right; }
.nb-body th[align='center'], .nb-body td[align='center'] { text-align: center; }
.nb-body tr:last-child td { border-bottom: 0; }
/* The first column names the row. It keeps room for a few words when a wide table is pressed for space. */
.nb-body th:first-child:not(:only-child), .nb-body td:first-child:not(:only-child) { min-width: 132px; }
/* A part that opens and closes. */
.nb-body details { padding: 0 20px; border: 1px solid var(--rule); border-radius: var(--r-16); background: var(--white); }
.nb-body summary { min-height: 52px; padding: 13px 0; font-weight: 600; cursor: pointer; }
.nb-body details[open] { padding-bottom: 18px; }
.nb-body details > * + * { margin-top: 12px; }
.nb-body details > summary + * { margin-top: 0; }

/* Questions and answers: each question under a hairline, in the size of a card's headline. */
.nb-faq { display: grid; margin-top: 72px; font-size: var(--fs-body); line-height: var(--lh-body); }
.nb-faq > h2 { margin-bottom: 20px; font-size: var(--fs-h2); line-height: var(--lh-h2); text-wrap: balance; overflow-wrap: break-word; }
.nb-faq-item { padding: 24px 0; border-top: 1px solid var(--rule); }
.nb-faq-item:last-child { padding-bottom: 0; }
.nb-faq-item h3 { font-family: var(--font-display); font-variation-settings: var(--fraunces); font-size: var(--fs-h3); font-weight: 800; line-height: var(--lh-h3); letter-spacing: -0.035em; overflow-wrap: break-word; }
.nb-faq-item p { margin-top: 10px; overflow-wrap: anywhere; }

/* Previous and next in a series: two white cards, side by side. */
.nb-series-nav { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-top: 56px; }
.nb-series-nav a { display: grid; align-content: start; gap: 8px; min-height: 64px; padding: 20px 22px; border: 1px solid var(--rule); border-radius: var(--r-24); background: var(--white); color: var(--espresso); font-weight: 600; line-height: 1.3; text-decoration: none; overflow-wrap: anywhere; transition: box-shadow 0.15s; }
.nb-series-nav a:hover { box-shadow: inset 0 0 0 2px var(--espresso); }
.nb-series-nav > :last-child { text-align: right; }

/* ── Lists of posts ── */
/* The pills that lead to the other lists. The one for the page you are on is filled. The pill for
   the lender reviews carries their host; the plain ones stand as tall as it does. */
.nb-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.nb-chips + .nb-chips { margin-top: 12px; }
.nb-chips .chip { min-height: 46px; }

/* The heading over a list, with the way to the rest of it at the right. */
.nb-rule { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 24px; margin-top: 72px; }
.nb-rule + .nb-meta { margin-top: 8px; font-size: var(--fs-body); line-height: var(--lh-body); }

/* The newest post, with room: its words on one side and, on the other, its own picture or the
   section's host on a stage of the host's colour. The whole card is one link. */
.nb-lead { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 0 24px; margin-top: 40px; padding: 16px; color: var(--espresso); text-decoration: none; transition: box-shadow 0.15s; }
.nb-lead:hover { box-shadow: inset 0 0 0 2px var(--espresso); }
.nb-lead-words { display: grid; align-content: center; justify-items: start; gap: 16px; min-width: 0; padding: 32px 8px 32px 32px; }
.nb-lead-words > p { color: var(--text-soft); }
.nb-lead-art { align-self: stretch; min-width: 0; border-radius: var(--r-24); }
.nb-lead-art.cast-stage { min-height: 336px; }
/* A post's own picture is shown whole, in its own shape, never cut to fit the card. */
img.nb-lead-art { display: block; align-self: center; width: 100%; height: auto; aspect-ratio: 1200 / 630; object-fit: cover; background: var(--paper-deep); }

/* The other posts: white cards, three across where there is room. A card is one link, so it is an easy
   target on a phone. Its last line (the date) sits at the foot, with an arrow that says the card opens. */
.nb-grid { display: grid; gap: 20px; grid-template-columns: repeat(auto-fill, minmax(min(100%, max(280px, calc((100% - 40px) / 3))), 1fr)); margin-top: 24px; }
.nb-grid > * { min-width: 0; }
.nb-card { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; min-width: 0; color: var(--espresso); text-decoration: none; transition: box-shadow 0.15s; }
.nb-card:hover { box-shadow: inset 0 0 0 2px var(--espresso); }
.nb-card > img { display: block; width: 100%; height: auto; aspect-ratio: 1200 / 630; margin-bottom: 6px; border-radius: var(--r-16); object-fit: cover; background: var(--paper-deep); }
.nb-card > p { font-size: 16px; line-height: 1.5; color: var(--text-soft); }
.nb-card > .nb-meta { display: flex; align-items: center; justify-content: space-between; gap: 12px; align-self: stretch; margin-top: auto; padding-top: 10px; }
.nb-card > .nb-meta::after, .nb-row::after { content: '\2192'; font-size: 17px; font-weight: 600; line-height: 1; color: var(--espresso); transition: transform 0.15s; }
.nb-card:hover > .nb-meta::after { transform: translateX(3px); }

/* A long list, one line for each post: a white card with a hairline between the lines. */
.nb-rows { display: grid; overflow: hidden; margin-top: 24px; border: 1px solid var(--rule); border-radius: var(--r-24); background: var(--white); }
.nb-grid + .nb-rows { margin-top: 20px; }
.nb-row { position: relative; display: grid; align-content: center; gap: 4px; min-height: 64px; padding: 16px 60px 16px 22px; color: var(--espresso); text-decoration: none; }
.nb-row + .nb-row { border-top: 1px solid var(--rule); }
.nb-row:hover { background: var(--peach-soft); }
.nb-row:focus-visible { outline-offset: -4px; border-radius: var(--r-16); }
.nb-row > * { min-width: 0; }
.nb-row h2, .nb-row h3 { font-family: var(--font-body); font-variation-settings: normal; font-size: 19px; font-weight: 600; line-height: 1.3; letter-spacing: 0; overflow-wrap: anywhere; }
.nb-row::after { position: absolute; right: 22px; top: 50%; margin-top: -8px; }
.nb-row:hover::after { transform: translateX(3px); }
/* On a wide screen the Notebook's own lists put the category and the date at the right of the line. */
.nb-rows-wide > .nb-row { grid-template-columns: minmax(0, 1fr) auto; column-gap: 32px; }
.nb-rows-wide > .nb-row > * { grid-column: 1; }
.nb-rows-wide > .nb-row > .nb-meta { grid-column: 2; grid-row: 1 / span 2; align-self: center; text-align: right; }

/* Newer and older pages. */
.nb-pager { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 12px; margin-top: 48px; font-size: 15px; color: var(--text-soft); }
.nb-pager > :first-child { justify-self: start; }
.nb-pager > :last-child { justify-self: end; }

@media (max-width: 720px) {
  .nb-wide { padding-bottom: 64px; }
  .nb-wide > .state-page { margin-top: 24px; }
  /* The article is one column. The list of headings is left out, so the words start at once; the
     card that leads to the application follows the article. */
  .nb-split { display: block; }
  .nb-aside { position: static; max-height: none; margin-top: 32px; overflow-y: visible; }
  .nb-toc { display: none; }
  .page-meta.nb-byline { margin: -4px 0 24px; }
  .nb-cover { margin-bottom: 24px; }
  .nb-body h2 { margin-top: 40px; }
  .nb-body h3 { margin-top: 32px; }
  .nb-body blockquote { padding: 20px; font-size: 19px; }
  .nb-body th, .nb-body td { padding: 12px 14px; }
  /* A comparison table is a stack of cards. Each cell carries its column name, and the words
     wrap, so a header such as "Best for (contractor situation)" is never cut off mid-word.
     Above 720px the same table stays a table: this is the one width the layout changes at. */
  .nb-body table:has(td[data-label]) { display: block; }
  .nb-body table:has(td[data-label]) > thead { display: block; position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
  .nb-body table:has(td[data-label]) > tbody,
  .nb-body table:has(td[data-label]) > tbody > tr,
  .nb-body table:has(td[data-label]) > tbody > tr > td,
  .nb-body table:has(td[data-label]) > tbody > tr > th { display: block; width: auto; }
  .nb-body table:has(td[data-label]) > tbody > tr { margin: 0 0 12px; border: 1px solid var(--rule); border-radius: var(--r-16); background: var(--white); overflow: hidden; }
  .nb-body table:has(td[data-label]) > tbody > tr:last-child { margin-bottom: 0; }
  .nb-body table:has(td[data-label]) > tbody > tr > td,
  .nb-body table:has(td[data-label]) > tbody > tr > th { min-width: 0; border-bottom: 1px solid var(--rule); white-space: normal; overflow-wrap: anywhere; text-align: left; }
  .nb-body table:has(td[data-label]) > tbody > tr > :last-child { border-bottom: 0; }
  .nb-body td[data-label]::before, .nb-body tbody th[data-label]::before { content: attr(data-label); display: block; margin-bottom: 4px; font-size: var(--fs-label); font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-soft); overflow-wrap: anywhere; white-space: normal; }
  .nb-body .table-scroll:has(td[data-label]) { overflow: visible; border: 0; background: transparent; }
  .nb-faq { margin-top: 48px; }
  .nb-faq > h2 { margin-bottom: 12px; }
  .nb-faq-item { padding: 20px 0; }
  .nb-series-nav { grid-template-columns: minmax(0, 1fr); gap: 12px; margin-top: 40px; }
  .nb-series-nav > :last-child { text-align: left; }
  .nb-rule { margin-top: 48px; }
  /* A row of pills stays on one line and is pushed sideways with a finger, inside its own strip: stacked,
     eleven pills would fill the first screen before a single story. The page itself does not move. */
  .nb-wide > .nb-chips { flex-wrap: nowrap; overflow-x: auto; margin: -6px calc(-1 * var(--gutter)); padding: 6px var(--gutter); scrollbar-width: none; -webkit-overflow-scrolling: touch; }
  .nb-wide > .nb-chips::-webkit-scrollbar { display: none; }
  .nb-wide > .nb-chips + .nb-chips { margin-top: 2px; }
  .nb-wide > .nb-chips > a { flex: none; white-space: nowrap; }
  /* The newest post: the picture first, then the words. */
  .nb-lead { grid-template-columns: minmax(0, 1fr); gap: 0; margin-top: 28px; padding: 12px; }
  .nb-lead-words { order: 1; gap: 12px; padding: 20px 10px 14px; }
  .nb-lead-words > p { font-size: var(--fs-body); line-height: var(--lh-body); }
  .nb-lead-art { border-radius: var(--r-16); }
  .nb-lead-art.cast-stage { min-height: 188px; }
  .nb-grid { grid-template-columns: minmax(0, 1fr); gap: 16px; margin-top: 20px; }
  .nb-rows { margin-top: 20px; }
  .nb-row { padding: 14px 52px 14px 18px; }
  .nb-row::after { right: 18px; }
  /* The category and the date go back under the headline. */
  .nb-rows-wide > .nb-row { grid-template-columns: minmax(0, 1fr); }
  .nb-rows-wide > .nb-row > .nb-meta { grid-column: 1; grid-row: auto; text-align: left; }
  /* The two buttons keep to the edges; the page number between them folds if it has to. */
  .nb-pager { grid-template-columns: auto minmax(0, 1fr) auto; gap: 8px; margin-top: 36px; text-align: center; }
  .nb-pager .btn { padding-left: 18px; padding-right: 18px; }
}

@media (prefers-reduced-motion: reduce) {
  .nb-lead, .nb-card, .nb-card > .nb-meta::after, .nb-row::after, .nb-series-nav a { transition: none; }
}

/* ── Newsroom: the desk's editor ────────────────────────────────────────────
   Styles for the Newsroom tab in the desk. Keep them below this line. */

/* The same rules as the rest of the desk, kept inside .nr: nothing scrolls
   sideways on a 390px phone, anything tapped is at least 44px tall, and every
   box is typed in at 16px or more. The layout changes at the one width, 720px.
   The article and its preview sit side by side when the editor shows both of
   them at once (useWide in src/crm/newsroom/parts.tsx decides that); these
   styles follow whatever it shows and ask no width of their own. */

.nr { overflow-wrap: break-word; }
/* Two boxes side by side start level, even when only one of them has a hint under it. */
.nr .cols-2 { align-items: start; }
.nr .seg button { flex: 1 0 auto; }
.nr-wrap { overflow-wrap: anywhere; }
.nr-plain { list-style: none; margin: 0; padding: 0; }
/* The way back to the list: plain words, with the pink line when the pointer is on them. The deal's page and the
   Stop the Calls screens use the same one, so every way back on the desk looks and taps alike. */
.nr-back { display: inline-flex; align-items: center; justify-self: start; min-height: 44px; color: inherit; font-weight: 600; text-decoration: none; }
.nr-back:hover { text-decoration: underline; text-decoration-color: var(--pink); text-decoration-thickness: 2px; text-underline-offset: 0.3em; }

/* Posts, Series, Old addresses. The tab you are on has the pink line under it, as the site's own links do. */
.nr-tabs { display: flex; flex-wrap: wrap; gap: 4px; border-bottom: 1px solid var(--rule); }
.nr-tabs a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 14px; margin-bottom: -1px; border-bottom: 3px solid transparent; color: var(--text-soft); font-weight: 600; text-decoration: none; }
.nr-tabs a:hover { color: var(--text); border-bottom-color: var(--rule-strong); }
.nr-tabs a.active { color: var(--text); border-bottom-color: var(--pink); }

/* The post list */
/* The search box, the section and the status sit on one line where there is room, and fold onto a second where there is not. */
.nr-filters { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px; }
.nr-filters > * { flex: 1 1 200px; min-width: 0; }
.nr-filters > :first-child { flex: 1.6 1 260px; }
.nr-filters > :last-child { flex: 0 1 auto; }
.nr-posts { list-style: none; margin: 0; padding: 0; display: grid; }
.nr-posts > li + li { border-top: 1px solid var(--rule); }
.nr-post { display: grid; gap: 6px; min-height: 56px; padding: 14px 16px; color: inherit; text-decoration: none; }
a.nr-post:hover { background: var(--paper); }
a.nr-post:hover .nr-post-title { text-decoration: underline; text-decoration-color: var(--pink); text-decoration-thickness: 2px; text-underline-offset: 0.18em; }
/* The first and last rows follow the round corners of the card they are in. */
.card > .nr-posts > li:first-child > .nr-post { border-radius: 23px 23px 0 0; }
.card > .nr-posts > li:last-child > .nr-post { border-radius: 0 0 23px 23px; }
.card > .nr-posts > li:only-child > .nr-post { border-radius: 23px; }
.nr-post-title { font-weight: 600; font-size: 17px; line-height: 1.3; overflow-wrap: anywhere; }
.nr-post-tags { gap: 6px; }
.nr-post-tags .badge { white-space: normal; }

/* The editor */
.nr-headline { font-size: 20px; font-weight: 600; }
.nr-article-head { align-items: flex-start; flex-wrap: wrap; }
/* One column, or two equal ones when the editor shows the article and its preview together. */
.nr-write { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 16px; align-items: start; }
.nr-write > * { min-width: 0; }
/* The article is written as plain marked-up text, so its box keeps a typewriter face. */
.nr-md { min-height: 55vh; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 16px; line-height: 1.55; tab-size: 2; }
.nr-md-short { min-height: 160px; }
.nr-preview { min-width: 0; padding: 14px 16px; border: 1px solid var(--rule); border-radius: var(--r-12); background: var(--paper); }
.nr-preview > :first-child { margin-top: 0; }
.nr-preview-empty { min-height: 96px; }
/* Side by side, the two are the same height, and the preview scrolls inside itself. */
.nr-write:not(:has(> [hidden])) .nr-md { height: 70vh; min-height: 360px; }
.nr-write:not(:has(> [hidden])) .nr-preview-pane .nr-preview { max-height: 70vh; overflow-y: auto; }

/* The picture's boxes beside the picture itself, or above it where the two would be squeezed. */
.nr-cover { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 16px; }
.nr-cover > * { flex: 1 1 200px; min-width: 0; }
.nr-cover > :first-child { flex: 1.5 1 300px; }
.nr-cover-box { display: grid; place-items: center; min-height: 120px; padding: 10px; border: 2px dashed var(--rule-strong); border-radius: var(--r-12); background: var(--paper); text-align: center; }
.nr-cover-box img { display: block; max-width: 100%; max-height: 240px; height: auto; border-radius: 8px; }

.nr-count { text-align: right; }
/* Too long: said in the brown of a warning, which reads on white where mustard would not. */
.nr-over { color: var(--cocoa); font-weight: 600; }
.nr-keyword { display: inline-flex; align-items: center; gap: 8px; max-width: 100%; text-align: left; overflow-wrap: anywhere; }
/* A box and its Add button on one line; the button lines up with the box, not with the hint under it. */
.nr-add { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; align-items: end; }
.nr-add .btn { margin-bottom: 28px; }
.nr-faq { padding: 14px; border: 1px solid var(--rule-strong); border-radius: var(--r-12); }
.nr-check { min-height: 44px; }

/* Newsroom: the page type and the pre-publish checklist. The colours are the shared names. */
.nr-type-about { display: grid; gap: 8px; margin: 0; }
.nr-type-about dd { margin: 0; color: var(--text-soft); }
.nr-cl { list-style: none; margin: 0; padding: 0; display: grid; }
.nr-cl > li { display: grid; grid-template-columns: 30px minmax(0, 1fr); gap: 12px; padding: 14px 0; }
.nr-cl > li + li { border-top: 1px solid var(--rule); }
.nr-cl-n { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font-size: 13.5px; font-weight: 800; background: var(--paper-deep); color: var(--text-soft); }
.nr-cl > li[data-state='ok'] .nr-cl-n { background: var(--mustard); color: var(--espresso); }
.nr-cl > li[data-state='open'] .nr-cl-n { background: var(--peach); color: var(--espresso); }
.nr-cl-head { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
.nr-cl-head .badge { white-space: normal; }
.nr-cl-problem { color: var(--pink-ink); font-weight: 600; font-size: 14.5px; }
.nr-cl-twins { display: grid; gap: 4px; }
.nr-cl-twins li { padding: 4px 0; }
.nr-cl-twins a { display: inline-block; min-height: 24px; font-weight: 700; }

/* Save and Publish stay in reach however long the post is. On a phone the bar sits just above the desk's tab bar. */
.nr-bar { position: sticky; bottom: 12px; z-index: 30; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding: 10px 14px; border: 1px solid var(--rule-strong); border-radius: var(--r-16); background: var(--white); box-shadow: var(--lift); }
.nr-bar-actions { margin-left: auto; }

/* A "saved" message appears above the bar, not on top of its buttons. */
body:has(.nr-bar) .toast-wrap { bottom: 96px; }

.nr-modal-foot { position: sticky; bottom: 0; z-index: 1; justify-content: flex-end; padding: 12px 0 calc(12px + env(safe-area-inset-bottom)); border-top: 1px solid var(--rule); background: var(--white); }

@media (max-width: 720px) {
  .nr-filters > *, .nr-filters > :last-child, .nr-cover > *, .nr-cover > :first-child { flex: 1 1 100%; }
  .nr-add { grid-template-columns: minmax(0, 1fr); }
  .nr-add .btn { margin-bottom: 0; }
  .nr-bar { bottom: calc(64px + env(safe-area-inset-bottom)); }
  /* Save and Publish share the full width of the bar. */
  .nr-bar-actions { width: 100%; }
  .nr-bar-actions .btn { flex: 1 1 0; padding-left: 10px; padding-right: 10px; }
  /* So do Cancel and Save at the foot of a pop-up form. */
  .nr-modal-foot .btn { flex: 1 1 auto; }
  body:has(.nr-bar) .toast-wrap { bottom: calc(184px + env(safe-area-inset-bottom)); }
}

/* ── Standing pages ─────────────────────────────────────────────────────────
   The guides, the toolkit, the calculators, the About page, the grading scale
   and the two legal pages (server/notebook/standing.ts, calculator.ts and
   server/legal/pages.ts). The prompt library (prompts.ts) and the Stop the
   Calls letters borrow the letter box and its buttons from here.
   Keep it below this line.

   These pages are built from the shared pieces: the page top, the two page
   widths, cards, form boxes, buttons, the cast. The words of a guide or a
   policy are set by the Notebook's article styles (.nb-body). Only what is
   special to these pages is here.

   The phone rules, as everywhere: the layout changes at 720px and nowhere
   else, nothing scrolls sideways from 320px up, anything tapped is at least
   44px tall, anything typed in is 17px, and the text of a page is at least
   17px. Only the lines around it are smaller: the sentence on a card, a date,
   a label, a line of small print. Those match the Notebook's own cards. */

/* The page itself: as wide as the header (the shared .page-wide, written on the <main>), so whatever
   opens the page starts under the wordmark, with air under the last line before the footer.

   A page that is read (a guide, a tool, About, the grading scale, a prompt, a legal page) is framed as
   an article is, with the Notebook's own pieces: the words at the left at the reading width (.nb-main),
   and beside them the list of headings and Oscar's card (.nb-split, .nb-aside, .nb-toc, .nb-apply).
   Those are styled in the Notebook part and are not said again here, so the two can never differ. */
.sp-main { padding-bottom: 96px; }

/* ── The top of a page ──
   The shared page top (crumbs, the host's chip, the headline, the standfirst), then the lines these
   pages add under it: who wrote it and when, and the estimate button. */
.sp-head { display: grid; justify-items: start; gap: 16px; padding-bottom: 40px; }
.sp-head > * { min-width: 0; }
.sp-top { padding-bottom: 0; }
/* The opening lines of a list page (the shared .measure keeps them to a comfortable line, however wide the page). */
.sp-lede > p + p { margin-top: 0.6em; }
/* A link in the line under the headline takes a tap above and below its words without pushing the lines apart. */
.sp-byline a { display: inline-block; padding: 12px 0; margin: -12px 0; }
.sp-cta { margin-top: 8px; }
/* On a page that is read, the text starts as far under the byline as an article's does. */
.nb-main > .sp-head { padding-bottom: 32px; }
/* A legal page opens with its date and a sentence on what the page is: reading text, not small print. */
.sp-legal .sp-byline { max-width: 680px; font-size: var(--fs-body); line-height: var(--lh-body); }

/* ── The two list pages ──
   A heading for each group, a line under it, then the group's cards, spaced as the Notebook's own lists are. */
.sp-group-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 24px; margin-top: 72px; }
.sp-head + .sp-group-head { margin-top: 24px; }
.sp-group-note { max-width: 680px; margin-top: 8px; color: var(--text-soft); }
.sp-cards { margin-top: 24px; }
/* A card is one link. Its last line (the date) sits at the foot, with an arrow that says the card opens.
   It is drawn the same as a story's card on the Notebook's lists (.nb-card), size for size. */
.sp-card { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; min-width: 0; color: var(--espresso); text-decoration: none; transition: box-shadow 0.15s; }
.sp-card:hover { box-shadow: inset 0 0 0 2px var(--espresso); }
.sp-card > p { font-size: 16px; line-height: 1.5; color: var(--text-soft); }
.sp-card-meta { display: flex; align-items: center; justify-content: space-between; gap: 12px; align-self: stretch; margin-top: auto; padding-top: 10px; font-size: 14px; line-height: 1.4; color: var(--text-soft); }
.sp-card-meta::after { content: '\2192'; font-size: 17px; font-weight: 600; color: var(--espresso); transition: transform 0.15s; }
.sp-card:hover .sp-card-meta::after { transform: translateX(3px); }
/* The card that leads to a tool: the tools' host looks in from the corner, on his own colour. It takes
   the whole row (so its headline is written a size larger), and its words keep clear of the face. */
.sp-card-host { --cut-size: 230px; grid-column: 1 / -1; min-height: 232px; padding: 32px calc(var(--cut-size) * 0.9) 28px 32px; border-radius: var(--r-32); }
.sp-card-host > p { max-width: 560px; font-size: var(--fs-body); line-height: var(--lh-body); color: var(--espresso); }
.sp-card-host > .sp-card-meta { justify-content: flex-start; color: var(--espresso); }
/* The closing note of a list page. */
.sp-note { max-width: 680px; margin-top: 56px; padding-top: 20px; border-top: 1px solid var(--rule); font-size: 15px; line-height: 1.5; color: var(--text-soft); }

/* ── Text a reader copies: a letter, a template, a prompt ──
   A white sheet that keeps the text's own line breaks and wraps inside its box, so a long line never
   pushes the page wider than the phone. */
.nb-body pre.sp-doc, pre.sp-doc {
  margin: 0; padding: 24px 28px; overflow-x: visible; white-space: pre-wrap; overflow-wrap: anywhere;
  background: var(--white); border: 1px solid var(--rule); border-radius: var(--r-16); color: var(--espresso);
  font-family: ui-monospace, 'SF Mono', Menlo, Consolas, monospace; font-size: 17px; line-height: 1.55;
}
.nb-body pre.sp-doc { margin-top: 1em; }
/* A [PLACEHOLDER] the reader has to replace. Marked by weight as well as colour. */
.sp-fill { background: var(--peach-soft); border-radius: 4px; padding: 0 3px; font-weight: 700; }
/* The row of buttons under a block. It arrives hidden and /tools/page-tools.js shows it. */
.sp-actions { display: flex; flex-wrap: wrap; gap: 12px; }
.nb-body .sp-actions { margin-top: 12px; }
.sp-actions .btn { white-space: normal; }
.sp-prompt { display: grid; gap: 12px; margin: 8px 0 20px; }
.sp-prompt > * { min-width: 0; }

/* ── The list of sources under a guide ──
   The last part of the page, headed like the article's other parts and like the questions before it. */
.sp-sources { display: grid; gap: 12px; margin-top: 72px; font-size: var(--fs-body); line-height: 1.5; }
.sp-sources h2 { margin-bottom: 4px; font-size: var(--fs-h2); line-height: var(--lh-h2); text-wrap: balance; }
.sp-sources ol { margin: 0; padding-left: 1.4em; }
/* Each source is its own line to tap. */
.sp-sources li a { display: inline-block; padding: 10px 0; overflow-wrap: anywhere; }

/* ── The links to a long page's sections (the privacy policy) ──
   A quiet white card, one line for each section, two across where there is room. */
.sp-toc { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 32px; margin-bottom: 40px; padding: 10px 24px; background: var(--white); border: 1px solid var(--rule); border-radius: var(--r-24); }
.sp-toc a { display: flex; align-items: center; min-height: 52px; padding: 8px 0; border-bottom: 1px solid var(--rule); font-size: 16px; line-height: 1.3; text-decoration: none; }
.sp-toc a:hover { text-decoration: underline; text-decoration-color: var(--pink); text-decoration-thickness: 2px; text-underline-offset: 0.3em; }
.sp-toc a:nth-last-child(-n+2) { border-bottom: 0; }

/* ── The calculators ──
   Each is one white card: the boxes to type in, then the answer. The figure the calculator is really
   about is given room, in display type; on the first calculator it stands on Oscar's colour with Oscar
   beside it. The other figures follow in a quiet grid, then the sentence that says what they mean. */
.sp-tool { display: grid; gap: 28px; font-size: var(--fs-body); line-height: 1.5; }
.sp-tool > * { min-width: 0; }
.nb-body .sp-tool { margin-top: 1.4em; }
.sp-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.sp-fields + .sp-fields { margin-top: -8px; }
.sp-answer { display: grid; gap: 20px; }
.sp-answer > * { min-width: 0; }
/* One figure: what it is, in small capitals, and the number under it. */
.sp-stat { display: flex; flex-direction: column; justify-content: space-between; gap: 4px; min-width: 0; }
.sp-stat-value { font-family: var(--font-display); font-variation-settings: var(--fraunces); font-size: var(--fs-h3); font-weight: 800; line-height: var(--lh-h3); letter-spacing: -0.035em; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
/* A figure below zero. The minus sign says it too: never colour alone. */
.sp-stat-value.sp-short { color: var(--pink-ink); }
/* The figure the calculator is really about. */
.sp-hot { gap: 8px; justify-content: flex-start; }
.sp-hot .sp-stat-value { font-size: var(--fs-display); line-height: var(--lh-display); }
/* On its own (the second and third calculators) it opens the answer under a hairline. */
.sp-answer > .sp-hot { padding-top: 28px; border-top: 1px solid var(--rule); }
/* On the first calculator it stands on the host's colour, with the host at its right. A figure too long
   to stand beside him takes the row to itself, and he stands under it at the right, as he does on a phone:
   the number is never broken in two to make room for the face. */
.sp-result { flex-wrap: wrap; justify-content: space-between; min-height: 196px; padding: 24px 24px 0; }
.sp-result .stage-text { padding-bottom: 28px; }
/* He stands near the right-hand edge, which leaves room beside him for a rate of a thousand per cent or more. */
.sp-result > .cast-cut { margin-left: auto; margin-right: 12px; }
/* The other figures: as many across as fit at a width a seven-figure sum can be read in. That is four on
   a wide screen, two on most phones and one on the narrowest. */
.sp-out { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 130px), 1fr)); gap: 20px 16px; padding: 4px 0; }
.sp-verdict { padding-top: 20px; border-top: 1px solid var(--rule); color: var(--espresso); }

@media (max-width: 720px) {
  .sp-main { padding-bottom: 64px; }
  .sp-head { gap: 12px; padding-bottom: 28px; }
  .nb-main > .sp-head { gap: 16px; padding-bottom: 24px; }
  /* The list of headings is left out on a phone. A side column that holds nothing else goes with it. */
  .sp-aside-wide { display: none; }
  /* The estimate button takes the full width, as a form's main button does. */
  .sp-cta { justify-self: stretch; }
  .sp-group-head { margin-top: 48px; }
  .sp-head + .sp-group-head { margin-top: 20px; }
  .sp-cards { margin-top: 20px; }
  .sp-note { margin-top: 40px; }
  .sp-sources { margin-top: 48px; }
  /* On a phone the words of the tool's card run the full width and the host stands under them. */
  .sp-card-host { --cut-size: 148px; min-height: 0; padding: 22px 22px calc(var(--cut-size) * 0.62); border-radius: var(--r-24); }
  .sp-card-host > .sp-card-meta { max-width: calc(100% - var(--cut-size) * 0.8); }
  .nb-body pre.sp-doc, pre.sp-doc { padding: 18px 16px; }
  .sp-actions > .btn { width: 100%; }
  .sp-toc { grid-template-columns: minmax(0, 1fr); margin-bottom: 28px; padding: 6px 18px; }
  .sp-toc a:nth-last-child(2) { border-bottom: 1px solid var(--rule); }
  .sp-fields { grid-template-columns: minmax(0, 1fr); }
  .sp-answer > .sp-hot { padding-top: 22px; }
  /* The figure first, then the host under it at the right: a long figure never runs into him. */
  .sp-result { flex-flow: column nowrap; align-items: stretch; gap: 0; min-height: 0; padding: 20px 20px 0; }
  .sp-result .stage-text { align-self: stretch; padding-bottom: 0; }
  .sp-result > .cast-cut { --cut-size: 160px; align-self: flex-end; margin-right: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .sp-card, .sp-card-meta::after { transition: none; }
}

/* Printing a letter prints the letter: the menu, the trail, the buttons and the footer stay off the paper. */
@media print {
  body:has(.sp) .site-head, body:has(.sp) .site-foot, .sp .crumbs, .sp .cast-chip, .sp .nb-aside, .sp-actions { display: none !important; }
  /* With the cards beside the text left off the paper, the text takes the sheet's own width. */
  .sp .nb-split { display: block; }
  /* Named both ways, as above, so the sheet's edge and padding really are left off inside an article. */
  .nb-body pre.sp-doc, pre.sp-doc { border: 0; border-radius: 0; padding: 0; background: #fff; color: #000; font-size: 11pt; }
  .sp-fill { background: #fef9c3; color: #000; }
}

/* ── The prompt library ──
   The list of prompts and each prompt's own page (server/notebook/prompts.ts). The list is a page of
   cards like the list of guides, and a prompt is a page that is read, like a letter template, so
   nearly everything they need is above: the page top, the groups and their cards, the white sheet
   and its copy button. Only what a prompt page adds is here. */
/* The sheet starts straight under the top of the page. */
.sp-head + .sp-prompt { margin-top: 0; }
/* The quiet line under the copy button: which assistants the prompt works with. */
.sp-prompt-note { max-width: 680px; font-size: 15px; line-height: 1.5; color: var(--text-soft); }
/* "How to use it" opens the next part of the page, with the air a part of an article has above it. */
.sp-prompt + .nb-body { margin-top: 56px; }

@media (max-width: 720px) {
  .sp-prompt + .nb-body { margin-top: 40px; }
}

/* ── Stop the Calls: public pages ───────────────────────────────────────────
   Keep them between this line and the next marker. */

/* The lookup page, the list of businesses, a business's page, the change log,
   the two request forms and the sources page (server/stopcalls/pageParts.ts).
   The public tools (server/tools/pageParts.ts) are built from the same pieces.

   The pages are made of the shared look: the page top with Dwight on his chip,
   white cards on paper, the shared form boxes, buttons and chips, and the
   cast's own states. Only what those do not cover is here, and every name
   starts with "sc". The white sheet a letter is printed on (sp-doc) is the
   Toolkit's, styled with the standing pages, so a letter looks the same in
   both places.

   The owner's phone rules, and where each is kept:
   - nothing scrolls sideways from 320px up: long names, addresses and letters
     wrap inside their own box, and there are no tables on these pages;
   - anything meant to be tapped is at least 44px tall;
   - every box you type in is 17px (the shared .input, .select and .textarea);
   - the layout changes at 720px and nowhere else. */

/* ── The page ──
   These pages take one of the look's two widths (the shared .page-wide or .page-text) on the block
   inside the <main>, with air under the last line before the footer. */
.sc-page { padding-bottom: 96px; overflow-wrap: break-word; }
/* One block under another, with air between. The page top brings most of its own. */
.sc-page > * + * { margin-top: 24px; }
.sc-page > .page-top + * { margin-top: 8px; }
/* A part of a page: its title, then what is in it. Parts stand well apart. */
.sc-section { display: grid; gap: 20px; }
.sc-section > * { min-width: 0; }
.sc-page > .sc-section { margin-top: 80px; }
/* In the reading column a part's title is the size it has on a phone, as on the site's other reading pages, and parts stand a little closer. */
.sc-page.page-text { --fs-h2: 28px; --lh-h2: 1.1; }
.sc-page.page-text > .sc-section { margin-top: 56px; }
/* A note across the page (the lookup is not open yet, a limit was reached) keeps to the reading width on the wide pages too. */
.sc-page > .banner { max-width: var(--page-text); }
/* A long label on a button wraps instead of pushing the page wider than a phone. */
.sc .btn { white-space: normal; }
/* The example written inside a one-line box (the lookup box, two boxes of the report form) can be longer than
   the box. Where it is, it ends in "…" and is never cut through a letter. (The phone block below sets the
   examples smaller, so on most phones the whole example shows.) */
.sc .input { text-overflow: ellipsis; }

/* ── The lookup box ──
   On the front page the box and the section's host stand side by side: the box takes two thirds of the
   room, Dwight a third on his own colour. He stands as tall as the concept's large figure where there is
   room, and smaller in a narrower block, so the block's sides never cut into him. The button sits beside
   the field. */
.sc-hero { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 20px; }
.sc-hero > form { align-content: center; }
.sc-hero-art { padding-top: 24px; container-type: inline-size; }
.sc-hero-art > .cast-cut { --cut-size: min(300px, calc((33vw - 72px) / 0.9383)); }
@supports (width: 1cqw) { .sc-hero-art > .cast-cut { --cut-size: min(300px, calc(100cqw / 0.9383)); } }
.sc-lookup-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; }
/* What is wrong with what was typed runs under the field and the button. */
.sc-lookup-row > .error { grid-column: 1 / -1; margin-top: -4px; }
.sc .hint a, .sc .small a { overflow-wrap: anywhere; }

/* ── The front page's parts ── */
/* The four things to do, each on a white card with its number in a peach circle. Four across where there
   is room, two by two where there is not (a tablet), one under another on a phone. */
.sc-steps {
  display: grid; gap: 20px; margin: 0; padding: 0; list-style: none; counter-reset: sc-step;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, max(calc((100% - 60px) / 4), min(50% - 10px, (880px - 100%) * 999))), 1fr));
}
.sc-steps > li { counter-increment: sc-step; display: grid; align-content: start; gap: 10px; min-width: 0; }
.sc-steps > li::before {
  content: counter(sc-step); display: grid; place-items: center; width: 44px; height: 44px; margin-bottom: 6px; border-radius: 50%; background: var(--peach-soft);
  font-family: var(--font-display); font-variation-settings: var(--fraunces); font-size: 22px; font-weight: 800; line-height: 1;
}
.sc-steps > li > p { color: var(--text-soft); }
/* A list of plain sentences. In a wide card it runs down one column and then down a second. */
.sc-list { display: grid; gap: 10px; margin: 0; padding-left: 1.25em; }
.sc-list > li { min-width: 0; padding-left: 4px; }
.sc-list-2 { display: block; columns: 2; column-gap: 64px; }
.sc-list-2 > li { break-inside: avoid; }
.sc-list-2 > li + li { margin-top: 12px; }
/* Two columns: words on the left, the things they are about on the right. */
.sc-pair { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); align-items: start; gap: 24px 56px; }
/* One letter: a line that opens. Closed until asked for, so four long letters do not bury the page. */
.sc-letters { display: grid; border-bottom: 1px solid var(--rule); }
.sc-letter { min-width: 0; border-top: 1px solid var(--rule); }
.sc-letter > summary { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 56px; padding: 12px 0; font-weight: 600; line-height: 1.3; cursor: pointer; list-style: none; }
.sc-letter > summary::-webkit-details-marker { display: none; }
/* The small arrow at the end of the line: it points down while the line is closed and up while it is open. */
.sc-letter > summary::after { content: ''; flex: none; width: 10px; height: 10px; margin: 0 6px 4px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(45deg); transition: transform 0.15s; }
.sc-letter[open] > summary::after { margin-bottom: -4px; transform: rotate(-135deg); }
.sc-letter[open] { padding-bottom: 24px; }
.sc-letter > * + * { margin-top: 12px; }
.sc-letter > summary + * { margin-top: 0; }
/* The questions, and the links to further reading: two columns of lines under hairlines. */
.sc-faq, .sc-rows-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 56px; border-bottom: 1px solid var(--rule); }
.sc-faq-item { display: grid; align-content: start; gap: 8px; padding: 22px 0 24px; border-top: 1px solid var(--rule); }
.sc-faq-item > p { color: var(--text-soft); overflow-wrap: anywhere; }

/* ── A line that leads somewhere ──
   A further-reading link, or a business in the list: the words, then an arrow at the far end. The whole
   line is the thing to tap. */
.sc-rows { display: grid; }
.sc-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-width: 0; min-height: 60px; padding: 14px 0; border-top: 1px solid var(--rule); color: inherit; font-weight: 600; line-height: 1.35; text-decoration: none; }
.sc-row::after { content: '\2192'; flex: none; font-weight: 600; transition: transform 0.15s; }
.sc-row:hover::after { transform: translateX(3px); }
.sc-row:hover { text-decoration: underline; text-decoration-color: var(--pink); text-decoration-thickness: 2px; text-underline-offset: 0.3em; }
/* The list of businesses: every line inside one white card. The name on the left, the sentence about it on the right. */
.card.sc-rows { padding: 6px 28px; }
.card.sc-rows > .sc-row:first-child { border-top: 0; }
.sc-row-text { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 3fr); align-items: baseline; gap: 2px 32px; flex: 1 1 auto; min-width: 0; }
.sc-row-meta { font-size: 16px; font-weight: 400; line-height: 1.5; color: var(--text-soft); }
.sc-row:hover .sc-row-meta { text-decoration: none; }
/* Previous, where you are, next. */
.sc-pager { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 12px; font-size: 15px; color: var(--text-soft); }
.sc-pager > :first-child { justify-self: start; }
.sc-pager > :last-child { justify-self: end; }

/* ── A lookup's answer and a business's facts ──
   The sentence is the contract's, so after the headline it is the largest thing in the card. The facts
   follow as quiet lines: what each is, in small capitals, then the fact. */
.sc-result > h2 { overflow-wrap: anywhere; }
.sc-summary { font-weight: 600; }
.sc-facts { grid-template-columns: minmax(0, 272px) minmax(0, 1fr); gap: 0; margin: 0; font-size: var(--fs-body); line-height: 1.5; }
.sc-facts > dt, .sc-facts > dd { padding: 13px 0; border-top: 1px solid var(--rule); }
/* The name is set on a line as tall as the fact's, so the two sit level and the hairline runs straight across both. */
.sc-facts > dt { padding-right: 24px; line-height: 25.5px; }
/* A fact that is a link (the business's name, its website) stands on a line of its own, so it is something to
   tap. The part of it that takes the tap reaches 13px above and below the words, 46px in all. That is padding
   on words in a line, which makes no row taller and lets a long name fold onto a second line as before. */
.sc-facts a { padding: 13px 0; }
/* The keyboard's ring goes round the words, not round the room left for a finger: on a phone that room
   reaches up into the label above, and a ring drawn there would run through it. */
.sc-facts a:focus-visible { padding: 0; }

/* ── The change log, and the words on the sources page ── */
.sc-log { display: grid; margin: 0; padding: 8px 28px; list-style: none; }
.sc-log > li { min-width: 0; padding: 18px 0; border-top: 1px solid var(--rule); }
.sc-log > li:first-child { border-top: 0; }
.sc-log time { display: block; margin-bottom: 6px; }
.sc-terms { display: grid; gap: 12px; margin: 0; }
.sc-terms dd { margin: 8px 0 0; }

/* ── One of the cast's states standing on a page: not found, nothing here, received ──
   On a page that is nothing but the state, the card stands a little way down from the header. */
.sc-page > .sc-state:first-child { padding: 32px 0 8px; }
/* What follows the state's sentence inside its card: a line or two more, links, a button. */
.sc-state-more { display: grid; gap: 12px; margin-top: 12px; }
.sc-state-more > * { min-width: 0; }

/* ── The foot of every page ──
   Links that stand on their own line, the pills that tie the pages together, and the line that says this
   is not legal advice. */
.sc-links { display: flex; flex-wrap: wrap; gap: 0 28px; }
.sc-page > .sc-nav { margin-top: 80px; padding-top: 28px; border-top: 1px solid var(--rule); }
.sc-page > .sc-note { margin-top: 20px; font-size: 15px; line-height: 1.5; color: var(--text-soft); }
/* On a page that is nothing but a state, the foot keeps to the width of the state's card and stands under it. */
.sc-page > .sc-state:first-child ~ .sc-nav, .sc-page > .sc-state:first-child ~ .sc-note { max-width: 520px; margin-left: auto; margin-right: auto; }
.sc-page > .sc-state:first-child ~ .sc-nav { margin-top: 40px; }

@media (max-width: 720px) {
  .sc-page { padding-bottom: 64px; }
  .sc-page > .sc-section, .sc-page.page-text > .sc-section { margin-top: 48px; }
  /* The host stands under the lookup box, and the button under the field at full width. */
  .sc-hero, .sc-lookup-row, .sc-steps, .sc-pair, .sc-faq, .sc-rows-2, .sc-row-text { grid-template-columns: minmax(0, 1fr); }
  .sc-list-2 { columns: 1; }
  .sc-hero-art { min-height: 0; padding-top: 16px; }
  .sc-hero-art > .cast-cut { --cut-size: min(200px, calc((100vw - 72px) / 0.9383)); }
  /* On a phone the sentence about a mistake stays under the field, and the button follows it. */
  .sc-lookup-row > .btn { order: 1; }
  /* The example inside a box is set at the size of a hint, so it fits a phone's narrower box. What is typed
     stays 17px. The lookup box, which stands alone, also gives its words 4px more room on each side. With both,
     "(212) 555-0142 or name@example.com" shows whole from a 354px phone up; narrower, it ends in "…". */
  .sc .input::placeholder, .sc .textarea::placeholder { font-size: 14px; }
  .sc-lookup-row > .input { padding-left: 12px; padding-right: 12px; }
  .sc-faq-item { padding: 18px 0 20px; }
  .card.sc-rows { padding: 4px 18px; }
  .sc-log { padding: 4px 18px; }
  /* A fact's name sits above the fact, as a label sits above its box. */
  .sc-facts { grid-template-columns: minmax(0, 1fr); }
  .sc-facts > dt { padding: 12px 0 0; line-height: 1.4; }
  .sc-facts > dd { padding: 2px 0 12px; border-top: 0; }
  /* Where you are, then the two buttons side by side under it. */
  .sc-pager { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sc-pager > span:nth-child(2) { grid-column: 1 / -1; grid-row: 1; justify-self: center; }
  .sc-pager > .btn { width: 100%; }
  .sc-page > .sc-nav { margin-top: 48px; padding-top: 24px; }
  .sc-page > .sc-state:first-child { padding: 12px 0 0; }
}

/* A reader who has asked for less motion: the two small arrows do not slide or turn. */
@media (prefers-reduced-motion: reduce) {
  .sc-row::after, .sc-letter > summary::after { transition: none; }
}

/* Printing a lookup result that carries a letter prints the letter: the menu, the result and the buttons stay off the paper. */
@media print {
  body:has(.sc-print-letter) .site-head, body:has(.sc-print-letter) .site-foot, body:has(.sc-print-letter) .skip-link,
  .sc-print-letter .sc-noprint, .sc-print-letter .page-top { display: none !important; }
}

/* ── Stop the Calls: the desk ───────────────────────────────────────────────
   Keep them below this line. */

/* The same rules as the rest of the desk, kept inside .scd: nothing scrolls
   sideways on a 390px phone, anything tapped is at least 44px tall, and every
   box is typed in at 16px or more (.input, .select and .textarea already are).
   The layout changes at the one width, 720px. The lists and tabs reuse the
   Newsroom's classes (.nr-tabs, .nr-posts, .nr-post, .nr-wrap, .nr-back).
   Only what is new to these screens is here. */

.scd { overflow-wrap: break-word; }
/* A button here can carry a business's name, so its words wrap instead of pushing the page wider than the phone. */
.scd .btn { white-space: normal; text-align: center; padding-top: 6px; padding-bottom: 6px; }
.scd .seg button { flex: 1 0 auto; }
.scd .badge { white-space: normal; }
.scd .chip { max-width: 100%; padding-top: 6px; padding-bottom: 6px; text-align: left; }
.scd-link { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; font-weight: 600; overflow-wrap: anywhere; }
/* A bordered box inside a card: one switch in Settings, one choice on a sheet. */
.scd-box { border: 1px solid var(--rule-strong); border-radius: var(--r-12); padding: 12px; }
.scd-tall { min-height: 220px; }
.scd-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; }
/* The boxes that narrow a list: on one line where there is room, folding onto a second where there is not. */
.scd-filters { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px; }
.scd-filters > * { flex: 1 1 190px; min-width: 0; }
.scd-filters > :first-child { flex: 1.5 1 260px; }
.scd-actions { display: flex; flex-wrap: wrap; gap: 8px; }

/* The strip at the top: the four switches, then three numbers. On a phone the first number has a row to itself. */
.scd-switches { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; padding: 12px 16px; border-bottom: 1px solid var(--rule); border-radius: 23px 23px 0 0; color: inherit; text-decoration: none; }
.scd-switches:hover { background: var(--paper); }
/* "Change" and "Show more" read as the site's links do: espresso words on a pink line. */
.scd-change, .scd-req-toggle { color: var(--text); font-size: 14px; font-weight: 600; text-decoration: underline; text-decoration-color: var(--pink); text-decoration-thickness: 2px; text-underline-offset: 0.18em; }
.scd-change { margin-left: auto; }
/* One switch: quiet while it is off, the peach panel while it is on. */
.scd-switch { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: var(--r-pill); background: var(--paper-deep); color: var(--text-soft); font-size: 13.5px; font-weight: 500; }
.scd-switch strong { font-weight: 700; }
.scd-switch.on { background: var(--peach-soft); color: var(--text); }
.scd-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.scd-stat { display: grid; align-content: start; gap: 2px; min-width: 0; min-height: 56px; padding: 10px 16px; color: inherit; text-decoration: none; line-height: 1.25; }
.scd-stat + .scd-stat { border-left: 1px solid var(--rule); }
.scd-stat:hover { background: var(--paper); }
.scd-stat .v { font-size: 24px; font-weight: 700; line-height: 1.2; font-variant-numeric: tabular-nums; }
.scd-strip-note { padding: 10px 16px 12px; border-top: 1px solid var(--rule); }

/* Requests: one card each. The head is the whole tap target that opens it. */
.scd-reqs { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.scd-reqs > li { min-width: 0; }
.scd-req-head, .scd-decided > summary { display: grid; gap: 6px; width: 100%; min-height: 56px; padding: 14px 16px; border: 0; border-radius: 23px; background: none; color: inherit; text-align: left; cursor: pointer; }
.scd-req-head:hover, .scd-decided > summary:hover { background: var(--paper); }
/* Open, the head keeps only the card's two top corners. */
.scd-req-head[aria-expanded='true'], .scd-decided[open] > summary { border-radius: 23px 23px 0 0; }
.scd-decided > summary { list-style: none; }
.scd-decided > summary::-webkit-details-marker { display: none; }
.scd-req-about { font-weight: 600; font-size: 17px; line-height: 1.3; overflow-wrap: anywhere; }
/* Two lines of what they wrote, as a taste, while the card is closed. */
.scd-clip { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; }
.scd-req-body { padding: 14px 16px 16px; border-top: 1px solid var(--rule); }
/* What a person wrote, set apart on paper with a line down its left side. */
.scd-quote { margin: 0; padding: 8px 12px; border-left: 4px solid var(--rule-strong); border-radius: 0 var(--r-12) var(--r-12) 0; background: var(--paper); }
.scd-named { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.scd-named li { display: grid; padding: 8px 12px; border-radius: var(--r-12); background: var(--paper); }
/* A button, and under it what pressing it will do. Side by side where each has room, one under another where it does not. */
.scd-outcomes { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); gap: 16px; }
.scd-outcome { display: grid; gap: 6px; align-content: start; min-width: 0; padding-top: 12px; border-top: 1px solid var(--rule); }

/* Cancel and Save stay in reach at the bottom of a long pop-up form, flush with its bottom edge (the pop-up's own
   padding is 24px, 20px on a phone, and this reaches down through it so nothing shows underneath). */
.scd-foot { position: sticky; bottom: -24px; z-index: 1; display: flex; justify-content: flex-end; gap: 10px; margin-bottom: -24px; padding: 12px 0 24px; border-top: 1px solid var(--rule); background: var(--white); }

/* Facts about a business, and the audit trail: plain rows. */
.scd-facts, .scd-trail { list-style: none; margin: 0; padding: 0; display: grid; }
.scd-facts > li, .scd-trail > li { display: grid; gap: 4px; min-width: 0; padding: 12px 16px; }
.scd-facts > li + li, .scd-trail > li + li { border-top: 1px solid var(--rule); }
.modal .scd-trail > li { padding-left: 0; padding-right: 0; }

/* A row that opens a sheet instead of a page looks like the rows that are links. */
.scd-rowbtn { width: 100%; border: 0; background: none; color: inherit; text-align: left; cursor: pointer; }
.scd-rowbtn:hover { background: var(--paper); }
.scd-rowbtn:hover .nr-post-title { text-decoration: underline; text-decoration-color: var(--pink); text-decoration-thickness: 2px; text-underline-offset: 0.18em; }

/* The businesses found while choosing one. */
.scd-pick { list-style: none; margin: 0; padding: 0; display: grid; overflow: hidden; border: 1px solid var(--rule-strong); border-radius: var(--r-12); }
.scd-pick li + li { border-top: 1px solid var(--rule); }
.scd-pick button { display: grid; width: 100%; min-height: 48px; padding: 8px 12px; border: 0; background: var(--white); color: inherit; text-align: left; cursor: pointer; }
.scd-pick button:hover { background: var(--peach-soft); }

@media (max-width: 720px) {
  .scd-filters > *, .scd-filters > :first-child { flex: 1 1 100%; }
  .scd-outcomes { gap: 12px; }
  /* Two buttons to a row, so four actions are two rows and not four. */
  .scd-actions .btn { flex: 1 1 calc(50% - 4px); padding-left: 10px; padding-right: 10px; }
  .scd-bar > .row { width: 100%; }
  .scd-bar > .row .btn { flex: 1 1 auto; padding-left: 12px; padding-right: 12px; }
  .scd .seg button { padding: 0 10px; }
  /* Four tabs on one row of a phone. */
  .scd .nr-tabs { gap: 0; }
  .scd .nr-tabs a { padding: 0 9px; }
  .scd-stat { padding: 10px; }
  .scd-foot { bottom: calc(-20px - env(safe-area-inset-bottom)); margin-bottom: calc(-20px - env(safe-area-inset-bottom)); padding-bottom: calc(20px + env(safe-area-inset-bottom)); }
  /* Cancel and Save share the full width of a pop-up form. */
  .scd-foot .btn { flex: 1 1 auto; }
}

/* ── Public tools ───────────────────────────────────────────────────────────
   "Report a lender or broker", the broker rep lookup and "Who's behind this
   offer?" (server/tools/pageParts.ts). Keep them below this line. */

/* These pages are built from the shared look and from the pieces the Stop the
   Calls pages already have (the names starting "sc"), so the owner's phone
   rules come with them: nothing scrolls sideways from 320px up, anything
   tapped is at least 44px tall, and every box typed in is 17px. Only what
   those do not cover is here, under names starting "pt": a group of choices
   under one question, the part of the report form that opens, and the report
   line at the foot of a lender review. */

/* A group of choices under one question (the shared tick boxes and round choices, one to a line). The
   browser's own box around the group is taken off. The lines stand far enough apart that the part of
   each choice that takes a tap (44px) never reaches into the next. */
.pt-choices { display: grid; gap: 18px; min-width: 0; margin: 0; padding: 0; border: 0; }
.pt-choices > legend { padding: 0 0 14px; }
/* The optional part of the report form opens and closes. Open, its boxes stand apart as the form's others do. */
.pt .sc-letter[open] > .field + .field { margin-top: 20px; }
.pt .sc-letter[open] > summary + .field { margin-top: 8px; }
/* Inside a form the line that opens is the only one, so it closes with a hairline of its own. */
.pt form > .sc-letter { border-bottom: 1px solid var(--rule); }

/* The line at the foot of a lender review that invites a report. Its printed address wraps instead of widening the page. */
.pt-review-report { margin-top: 20px; overflow-wrap: anywhere; }

/* ── Missing pages: retired, not found, something went wrong ────────────────
   The pages a reader sees when an address is retired, leads nowhere, or the
   site could not put a page together (server/missing.ts, public/404.html).

   The card itself is the shared "error" state: Creed looking over the edge,
   a headline and one sentence. Nothing here restyles it. These rules only
   stand the card in the middle of the page with air round it, and set the
   short list of places that do exist underneath it, on the paper. */

/* The page: the card, then the list, in one centred column as wide as the card. */
.missing { display: grid; justify-items: center; align-content: start; gap: 32px; width: 100%; margin: 0 auto; padding: 56px var(--gutter) 96px; }

/* The wordmark alone above the card, where the site's full header would be:
   the same place and the same space, so the page does not jump between the two. */
.missing-top { display: flex; align-items: center; width: 100%; max-width: calc(var(--page-max) + 2 * var(--gutter)); margin: 0 auto; padding: 22px var(--gutter); }

/* The places that do exist: one sentence, then each place on its own line under
   a hairline. Each line is a sentence that starts with a link (the look's
   link: the words in espresso, the line under them in pink) and carries on in
   quieter words. The whole line answers to a finger, not just the link's few
   words, so every one is a tap of 52px or more. */
.missing-more { display: grid; gap: 10px; width: 100%; max-width: 520px; }
.missing-list { display: grid; margin: 0; padding: 0; list-style: none; border-bottom: 1px solid var(--rule); }
.missing-list li { position: relative; display: block; min-height: 52px; padding: 12px 0; border-top: 1px solid var(--rule); color: var(--text-soft); }
.missing-list a { color: var(--text); font-weight: 600; text-decoration-thickness: 3px; text-underline-offset: 0.3em; }
.missing-list a::after { content: ''; position: absolute; inset: 0; }

@media (max-width: 720px) {
  .missing { gap: 24px; padding-top: 24px; padding-bottom: 56px; }
  .missing-top { padding-top: 10px; padding-bottom: 10px; }
}
