/* ─────────────────────────────────────────────────────────────────────────────────────────────
   ScrubGrid public website — the one style sheet every page loads.

   WHAT THIS FILE IS
   The public site (scrubgrid.ai) is plain HTML with no build step. Every page links this file, so
   a change here changes every page. The pages carry no styles of their own: the site's security
   policy (public/_headers) allows style sheets from our own address only, which also forbids a
   style="" attribute on an element. Where a size must be set from data (the bars in the live
   schedule), the script sets it on the element, which the policy allows.

   WHERE THE COLOURS COME FROM
   The names and values below are the application's own "Scrubs" theme, copied from
   apps/web/src/theme.css (sections 1b and 2). One colour means one thing, here as there:
     chrome    the deep teal bar across the top (the application's sidebar and top bar)
     brand     the one main button on a screen, links, focus
     call      nights and weekends (indigo)         block   daytime operating rooms (orange)
     attention amber notes                          done    green confirmations
   tests/site.test.mjs compares these values with theme.css and fails if the two drift apart.

   LIGHT AND DARK
   The application lets each person choose a theme. A public page has no account to remember a
   choice, so it follows the visitor's device ("prefers-color-scheme"). The dark values are the
   application's dark values, not the light ones inverted.

   SPACING
   Every gap, margin and padding is one of the design system's eight steps (--space-1 to
   --space-12, a 4 px to 64 px scale). No other spacing value is written in this file.

   CONTENTS
     1  Names: colours, spacing, type          6  The live schedule (home page)
     2  Page basics                             7  Pieces of the product drawn in HTML
     3  The top bar and navigation              8  Long-form pages (terms, privacy, security)
     4  Buttons, links, chips                   9  The request form
     5  Page sections and layouts              10  The footer, small screens, motion, print
   ───────────────────────────────────────────────────────────────────────────────────────────── */

/* 1 ── Names ─────────────────────────────────────────────────────────────────────────────────── */
:root {
  color-scheme: light dark;

  /* Spacing: the design system's scale (frontend-design-system skill, "8px exponential grid"). */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.5rem;
  --space-6: 2rem;
  --space-8: 3rem;
  --space-12: 4rem;

  /* Neutrals: the application's teal-tinted greys, named here by the job each one does. */
  --page: #f7faf9; /* the page behind everything            (theme: stone-50)  */
  --card: #ffffff; /* a card, a field                       (theme: white)     */
  --raised: #f1f6f5; /* a raised or quiet surface           (theme: stone-100) */
  --line: #dbe5e3; /* dividers and quiet borders            (theme: stone-200) */
  --edge: #94a5a3; /* the edge of a field or a button       (theme: stone-400; 3:1 on a card) */
  --quiet: #5e706d; /* the quietest text                    (theme: stone-500) */
  --muted: #4b5d5a; /* secondary text                       (theme: stone-600) */
  --text: #344542; /* body text                             (theme: stone-700) */
  --ink: #10201e; /* headings                               (theme: stone-900) */

  /* The Scrubs meanings (theme.css section 1b). */
  --chrome: #12403c;
  --chrome-well: #0c302d;
  --chrome-active: #21615a;
  --on-chrome: #e6f2f0;
  --on-chrome-muted: #a9cbc5;
  --brand: #0f766e;
  --brand-hover: #115e59;
  --on-brand: #ffffff;
  --call: #4338ca;
  --call-soft: #eef0ff;
  --call-ink: #3730a3;
  --block: #c2410c;
  --block-soft: #fff1e8;
  --block-ink: #9a3412;
  --draft-edge: #93a5a1;
  --attn-soft: #fef6e0;
  --attn-ink: #8a4b06;
  --attn-edge: #f2c46b;
  --danger-soft: #fdecec;
  --danger-ink: #a11d1d;
  --danger-edge: #f5b5b5;
  --success-soft: #e8f6ec;
  --success-ink: #17643a;
  --info-soft: #e8f1fb;
  --info-ink: #1d4f86;

  /* People. In the application every person on a roster has a colour of their own, and a schedule
     cell is always that person's colour (apps/web/src/schedule/colors.ts: background = the hue's
     100 shade, text = its 900 shade, dot = its 500 shade). The six invented people in the pictures
     on this site use six of those hues. They are not meaning colours and never mark a status. */
  --p1-bg: #e0f2fe; --p1-ink: #0c4a6e; --p1-dot: #0ea5e9; /* sky     */
  --p2-bg: #fef3c7; --p2-ink: #78350f; --p2-dot: #f59e0b; /* amber   */
  --p3-bg: #d1fae5; --p3-ink: #064e3b; --p3-dot: #10b981; /* emerald */
  --p4-bg: #ffe4e6; --p4-ink: #881337; --p4-dot: #f43f5e; /* rose    */
  --p5-bg: #ede9fe; --p5-ink: #4c1d95; --p5-dot: #8b5cf6; /* violet  */
  --p6-bg: #ecfccb; --p6-ink: #365314; --p6-dot: #84cc16; /* lime    */

  /* Type. Architects Daughter is the brand's own face (wordmark and large titles, one weight);
     Inter is for reading; JetBrains Mono is for a provider's code and nothing else. */
  --font-display: "Architects Daughter", "Segoe Print", "Bradley Hand", cursive;
  --font-body: Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-code: "JetBrains Mono", ui-monospace, Consolas, monospace;

  /* Corners: a chip, a control, a card. */
  --round-chip: 0.375rem;
  --round-control: 0.625rem;
  --round-card: 1rem;

  /* The widest a page's content grows, and the widest a paragraph should be to read easily. */
  --wide: 72rem;
  --measure: 40rem;

  --shadow: 0 1px 2px rgb(16 32 30 / 0.06), 0 8px 24px rgb(16 32 30 / 0.08);
}

@media (prefers-color-scheme: dark) {
  :root {
    /* theme.css section 2: the page is darker than a card, a card darker than its border. */
    --page: #0b1312;
    --card: #111c1b;
    --raised: #1b2725;
    --line: #22312f;
    --edge: #61716e;
    --quiet: #9ab0ac;
    --muted: #b2c2bf;
    --text: #c7d4d2;
    --ink: #e4efed;

    --chrome: #071d1b;
    --chrome-well: #04120f;
    --chrome-active: #14443f;
    --on-chrome: #cfe6e2;
    --on-chrome-muted: #86aaa4;
    --brand: #2dd4bf;
    --brand-hover: #5eead4;
    --on-brand: #04201d;
    --call: #a5b4fc;
    --call-soft: #1a1b3d;
    --call-ink: #c7d2fe;
    --block: #fb923c;
    --block-soft: #2a1608;
    --block-ink: #fdba74;
    --draft-edge: #4b5e5b;
    --attn-soft: #2e2208;
    --attn-ink: #fcd34d;
    --attn-edge: #6b5213;
    --danger-soft: #3a1010;
    --danger-ink: #fca5a5;
    --danger-edge: #7f1d1d;
    --success-soft: #0c2a18;
    --success-ink: #86efac;
    --info-soft: #0d2236;
    --info-ink: #93c5fd;

    /* A person's colour in dark: the two ends of the hue change places (theme.css section 2). */
    --p1-bg: #024a70; --p1-ink: #dff2fe; --p1-dot: #00a6f4;
    --p2-bg: #7b3306; --p2-ink: #fef3c6; --p2-dot: #fe9a00;
    --p3-bg: #004f3b; --p3-ink: #d0fae5; --p3-dot: #00bc7d;
    --p4-bg: #8b0836; --p4-ink: #ffe4e6; --p4-dot: #ff2056;
    --p5-bg: #4d179a; --p5-ink: #ede9fe; --p5-dot: #8e51ff;
    --p6-bg: #35530e; --p6-ink: #ecfcca; --p6-dot: #7ccf00;

    --shadow: 0 1px 2px rgb(0 0 0 / 0.4), 0 8px 24px rgb(0 0 0 / 0.45);
  }
}

/* 2 ── Page basics ───────────────────────────────────────────────────────────────────────────── */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  /* A link to a part of a page (for example /terms#sms) stops below the fixed top bar, not under it. */
  scroll-padding-top: var(--space-12);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  /* The page is at least as tall as the window and the content takes the spare height, so on a
     short page (the not-found page) the footer sits at the bottom, not half-way up. */
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--page);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3,
h4,
p,
ul,
ol,
dl,
dd,
figure,
fieldset {
  margin: 0;
  padding: 0;
}

h1,
h2,
h3,
h4 {
  color: var(--ink);
  line-height: 1.2;
  /* A heading never ends with one word alone on its last line. */
  text-wrap: balance;
}

p {
  text-wrap: pretty;
}

img,
svg {
  max-width: 100%;
  height: auto;
}

a {
  color: var(--brand);
  text-underline-offset: 0.2em;
}

a:hover {
  color: var(--brand-hover);
}

/* One focus ring for everything a keyboard can reach: the brand colour with a gap, so it is
   visible on a card, on the page and (lightened below) on the top bar. */
:focus-visible {
  outline: 3px solid var(--brand);
  outline-offset: 2px;
  border-radius: var(--round-chip);
}

/* "Skip to the content": the first thing a keyboard reaches, out of sight until it has focus. */
.skip {
  position: absolute;
  left: var(--space-4);
  top: var(--space-2);
  z-index: 30;
  padding: var(--space-2) var(--space-4);
  background: var(--card);
  color: var(--ink);
  border-radius: var(--round-control);
  transform: translateY(-200%);
}

.skip:focus {
  transform: none;
}

/* Text for a screen reader only. */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

main {
  flex: 1;
}

.wrap {
  width: 100%;
  max-width: var(--wide);
  margin-inline: auto;
  padding-inline: var(--space-5);
}

/* The brand face, for the wordmark and the large titles. It has one weight. */
.display {
  font-family: var(--font-display);
  font-weight: 400;
  letter-spacing: 0;
}

/* A provider's code (AVA, BEN) is always in the code face, as in the application. */
.code {
  font-family: var(--font-code);
  font-weight: 500;
  font-size: 0.9em;
}

/* 3 ── The top bar and navigation ────────────────────────────────────────────────────────────── */
.bar {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--chrome);
  color: var(--on-chrome);
}

.bar-inner {
  display: flex;
  align-items: center;
  gap: var(--space-5);
  min-height: var(--space-12);
}

.wordmark {
  display: inline-flex;
  align-items: center;
  gap: var(--space-3);
  color: #ffffff;
  text-decoration: none;
  font-size: 1.625rem;
  line-height: 1;
  /* A 44 px target for a finger, though the letters are smaller. */
  min-height: 2.75rem;
}

.wordmark:hover {
  color: #ffffff;
}

.wordmark svg {
  width: var(--space-6);
  height: var(--space-6);
  flex: none;
}

.nav {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  margin-left: auto;
}

.nav a {
  display: inline-flex;
  align-items: center;
  min-height: 2.75rem;
  padding: var(--space-2) var(--space-3);
  border-radius: var(--round-control);
  color: var(--on-chrome);
  font-size: 0.9375rem;
  font-weight: 500;
  text-decoration: none;
}

.nav a:hover {
  background: var(--chrome-well);
  color: #ffffff;
}

/* The page you are on. aria-current is set in each page's HTML, so it is also announced. */
.nav a[aria-current="page"] {
  background: var(--chrome-active);
  color: #ffffff;
}

.nav .nav-gap {
  margin-left: var(--space-4);
}

/* The button in the navigation. ".nav a" above is the stronger rule, so the button's own colours
   are stated again here; without this its words would be light on a light button. */
.nav a.btn {
  margin-left: var(--space-2);
  padding-inline: var(--space-4);
  background: #ffffff;
  color: #12403c;
  font-weight: 600;
}

.nav a.btn:hover {
  background: #e6f2f0;
  color: #12403c;
}

/* On the deep bar the brand teal is too close to the background to see, so focus is light. */
.bar :focus-visible {
  outline-color: #ffffff;
}

/* The menu button: phones only (section 10 shows it). */
.menu-button {
  display: none;
  margin-left: auto;
  min-width: 2.75rem;
  min-height: 2.75rem;
  padding: var(--space-2) var(--space-3);
  border: 1px solid var(--on-chrome-muted);
  border-radius: var(--round-control);
  background: transparent;
  color: var(--on-chrome);
  font: inherit;
  font-size: 0.9375rem;
  font-weight: 500;
  cursor: pointer;
}

/* 4 ── Buttons, links, chips ─────────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  min-height: 2.75rem;
  padding: var(--space-2) var(--space-5);
  border: 1px solid transparent;
  border-radius: var(--round-control);
  font: inherit;
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
}

/* The one main action on a screen. */
.btn-primary {
  background: var(--brand);
  color: var(--on-brand);
}

.btn-primary:hover {
  background: var(--brand-hover);
  color: var(--on-brand);
}

/* A second action beside it. */
.btn-quiet {
  background: var(--card);
  border-color: var(--edge);
  color: var(--ink);
}

.btn-quiet:hover {
  background: var(--raised);
  color: var(--ink);
}

/* The main action when it sits ON the deep bar or a deep band: light, so it stands out there. */
.btn-on-chrome {
  background: #ffffff;
  color: #12403c;
}

.btn-on-chrome:hover {
  background: #e6f2f0;
  color: #12403c;
}

.btn[disabled] {
  opacity: 0.6;
  cursor: progress;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-3);
}

/* A small label with a meaning: the track, a schedule's state, a notice. Every one keeps its
   WORD; the colour is the second signal, never the only one (WCAG 1.4.1). */
.chip {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: var(--space-1) var(--space-2);
  border: 1px solid transparent;
  border-radius: var(--round-chip);
  background: var(--raised);
  color: var(--muted);
  font-size: 0.8125rem;
  font-weight: 600;
  line-height: 1.2;
  white-space: nowrap;
}

.chip-call {
  background: var(--call-soft);
  color: var(--call-ink);
}

.chip-block {
  background: var(--block-soft);
  color: var(--block-ink);
}

.chip-draft {
  background: var(--card);
  border: 1px dashed var(--draft-edge);
  color: var(--muted);
}

.chip-published {
  background: var(--brand);
  color: var(--on-brand);
}

.chip-attn {
  background: var(--attn-soft);
  border-color: var(--attn-edge);
  color: var(--attn-ink);
}

.chip-done {
  background: var(--success-soft);
  color: var(--success-ink);
}

.chip-info {
  background: var(--info-soft);
  color: var(--info-ink);
}

/* A person's code in that person's colour: the cell of a schedule. */
.person {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-1) var(--space-2);
  border-radius: var(--round-chip);
  font-family: var(--font-code);
  font-size: 0.75rem;
  font-weight: 500;
  line-height: 1.2;
}

.p1 { background: var(--p1-bg); color: var(--p1-ink); }
.p2 { background: var(--p2-bg); color: var(--p2-ink); }
.p3 { background: var(--p3-bg); color: var(--p3-ink); }
.p4 { background: var(--p4-bg); color: var(--p4-ink); }
.p5 { background: var(--p5-bg); color: var(--p5-ink); }
.p6 { background: var(--p6-bg); color: var(--p6-ink); }

/* 5 ── Page sections and layouts ─────────────────────────────────────────────────────────────── */
.section {
  padding-block: var(--space-12);
}

.section + .section {
  border-top: 1px solid var(--line);
}

/* A section on the raised tone, to set a group of pieces apart without a box around each. */
.section-raised {
  background: var(--raised);
}

/* A deep band: the same teal as the top bar. Used once on a page, for what matters most. */
.section-deep {
  background: var(--chrome);
  color: var(--on-chrome);
  border-top: 0;
}

.section-deep + .section {
  border-top: 0;
}

.section-deep h2,
.section-deep h3 {
  color: #ffffff;
}

.section-deep a:not(.btn) {
  color: #ffffff;
}

.section-deep :focus-visible {
  outline-color: #ffffff;
}

.section-title {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(1.875rem, 1.2rem + 2.4vw, 2.75rem);
  line-height: 1.15;
  max-width: 22ch;
}

.section-intro {
  max-width: var(--measure);
  margin-top: var(--space-4);
  font-size: 1.125rem;
  color: var(--muted);
}

.section-deep .section-intro {
  color: var(--on-chrome);
}

.section-head {
  margin-bottom: var(--space-8);
}

/* Space above a block that follows another inside one section. Named for what they do, so a
   page never borrows a text class (and its width) just to get a margin. */
.gap-top {
  margin-top: var(--space-8);
}

.gap-top-small {
  margin-top: var(--space-5);
}

/* A smaller title inside a section (the list of roles on the product page). */
.sub-title {
  font-size: 1.5rem;
  margin-bottom: var(--space-4);
}

/* The first screen of the home page: words on the left, the live schedule on the right. */
.hero {
  padding-block: var(--space-12);
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
  gap: var(--space-8);
  align-items: start;
}

.hero h1 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(2.5rem, 1.4rem + 4.2vw, 4.25rem);
  line-height: 1.08;
}

.lead {
  margin-top: var(--space-5);
  max-width: 34rem;
  font-size: 1.1875rem;
  color: var(--muted);
}

.hero .actions {
  margin-top: var(--space-6);
}

.hero-note {
  margin-top: var(--space-5);
  max-width: 34rem;
  font-size: 0.9375rem;
  color: var(--quiet);
}

/* The first screen of every other page: a title and one paragraph. */
.page-head {
  padding-block: var(--space-12) var(--space-8);
}

.page-head h1 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(2.25rem, 1.4rem + 3vw, 3.5rem);
  line-height: 1.1;
  max-width: 20ch;
}

/* Words beside a piece of the product. The picture changes sides with "flip". */
.split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: var(--space-8);
  align-items: center;
}

.split + .split {
  margin-top: var(--space-12);
}

.split.flip > :first-child {
  order: 2;
}

.split h3 {
  font-size: 1.5rem;
  line-height: 1.25;
}

.split .section-title {
  margin-top: var(--space-3);
}

.split p {
  margin-top: var(--space-3);
  max-width: var(--measure);
}

/* A plain list with a tick: what a feature does, one line each. */
.ticks {
  list-style: none;
  margin-top: var(--space-4);
  display: grid;
  gap: var(--space-2);
}

.ticks li {
  position: relative;
  padding-left: var(--space-5);
}

.ticks li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.55em;
  width: 0.7em;
  height: 0.4em;
  border-left: 2px solid var(--brand);
  border-bottom: 2px solid var(--brand);
  transform: rotate(-45deg);
}

.section-deep .ticks li::before {
  border-color: #5eead4;
}

/* Steps that really are a sequence (enter the rules, generate, publish). The number is the
   order; it is drawn in the brand face like a number on a wall calendar. */
.steps {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-6);
  counter-reset: step;
}

.steps > li {
  counter-increment: step;
  padding-top: var(--space-4);
  border-top: 2px solid var(--ink);
}

.steps > li::before {
  content: counter(step);
  display: block;
  font-family: var(--font-display);
  font-size: 2.5rem;
  line-height: 1;
  color: var(--brand);
  margin-bottom: var(--space-3);
}

.steps h3 {
  font-size: 1.25rem;
}

.steps p {
  margin-top: var(--space-2);
  color: var(--muted);
}

/* The longer sequence on "How it works": one step under another, each with room for detail. */
.steps-tall {
  grid-template-columns: minmax(0, 1fr);
  max-width: 48rem;
  gap: var(--space-5);
}

.steps-tall > li {
  display: grid;
  grid-template-columns: var(--space-8) minmax(0, 1fr);
  column-gap: var(--space-4);
  padding-top: var(--space-5);
  border-top: 1px solid var(--line);
}

.steps-tall > li::before {
  grid-row: span 3;
}

/* Two or three columns of short entries with no boxes: a heading and a paragraph each. */
.columns {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-6) var(--space-8);
}

.columns.two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.columns h3 {
  font-size: 1.125rem;
}

.columns p {
  margin-top: var(--space-2);
  color: var(--muted);
  font-size: 1rem;
}

.section-deep .columns p {
  color: var(--on-chrome);
}

/* A card: used where a thing really is a separate object (a role, a contact route), not as the
   wrapper for every paragraph. */
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--round-card);
  padding: var(--space-5);
}

.card h3 {
  font-size: 1.125rem;
}

.card p {
  margin-top: var(--space-2);
  color: var(--muted);
  font-size: 1rem;
}

.card .actions {
  margin-top: var(--space-4);
}

/* A note that asks for attention (amber) or states a plain fact (blue-grey). */
.note {
  padding: var(--space-4);
  border: 1px solid var(--attn-edge);
  border-radius: var(--round-control);
  background: var(--attn-soft);
  color: var(--attn-ink);
  max-width: var(--measure);
}

.note-info {
  border-color: transparent;
  background: var(--info-soft);
  color: var(--info-ink);
}

/* The kinds of group, each with a small strip of a week that shows the pattern (home page). */
.shapes {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-5) var(--space-8);
}

.shapes li {
  display: grid;
  grid-template-columns: minmax(0, 11rem) minmax(0, 1fr);
  gap: var(--space-4);
  align-items: center;
}

.shapes h3 {
  font-size: 1.0625rem;
}

.shapes p {
  margin-top: var(--space-1);
  color: var(--muted);
  font-size: 0.9375rem;
}

/* The strip itself: seven days, one or two rows. Each cell is a person's colour. The days are
   named in the list item's text, so the strip is decoration for a screen reader (aria-hidden). */
.week {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: var(--space-1);
}

/* Two rows in one strip (a day shift over a night shift) keep a small gap between them. */
.week + .week {
  margin-top: var(--space-1);
}

.week span {
  height: var(--space-4);
  border-radius: 0.1875rem;
  background: var(--line);
}

.week .p1 { background: var(--p1-dot); }
.week .p2 { background: var(--p2-dot); }
.week .p3 { background: var(--p3-dot); }
.week .p4 { background: var(--p4-dot); }
.week .p5 { background: var(--p5-dot); }
.week .p6 { background: var(--p6-dot); }

.week-days {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: var(--space-1);
  margin-bottom: var(--space-1);
  font-size: 0.6875rem;
  color: var(--quiet);
  text-align: center;
}

/* Questions and answers. <details> opens and closes without any script. */
.faq {
  max-width: 48rem;
  border-top: 1px solid var(--line);
}

.faq details {
  border-bottom: 1px solid var(--line);
}

.faq summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  min-height: 2.75rem;
  padding-block: var(--space-4);
  color: var(--ink);
  font-weight: 600;
  cursor: pointer;
  list-style: none;
}

.faq summary::-webkit-details-marker {
  display: none;
}

/* A plus that turns into a minus when the answer is open. */
.faq summary::after {
  content: "+";
  flex: none;
  font-size: 1.5rem;
  font-weight: 400;
  line-height: 1;
  color: var(--brand);
}

.faq details[open] summary::after {
  content: "\2212";
}

.faq details > p {
  padding-bottom: var(--space-4);
  max-width: var(--measure);
  color: var(--muted);
}

.faq details > p + p {
  margin-top: calc(-1 * var(--space-2));
}

/* The closing invitation at the foot of a page. */
.closing {
  display: grid;
  grid-template-columns: minmax(0, 3fr) minmax(0, 2fr);
  gap: var(--space-8);
  align-items: center;
}

.closing .actions {
  justify-content: flex-end;
}

/* 6 ── The live schedule (home page) ─────────────────────────────────────────────────────────
   A small month that the visitor can build: tick or untick a rule, press Generate, and the nights
   fill in. assets/demo.js does the work and explains it. Everything here is drawn to look like
   the application's own schedule: person-coloured cells, codes in the code face, a dashed Draft
   chip. It is a picture of the idea, with six invented people. */
.demo {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--round-card);
  box-shadow: var(--shadow);
  padding: var(--space-5);
}

.demo-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2) var(--space-3);
}

.demo-month {
  font-family: var(--font-display);
  font-size: 1.5rem;
  line-height: 1.1;
  color: var(--ink);
  margin-right: auto;
}

.demo-rules {
  margin-top: var(--space-4);
  padding: var(--space-3) var(--space-4);
  border: 1px solid var(--line);
  border-radius: var(--round-control);
  background: var(--raised);
}

.demo-rules legend {
  padding-inline: var(--space-2);
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--muted);
}

.demo-rules label {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  min-height: 2.75rem;
  font-size: 0.9375rem;
  color: var(--ink);
  cursor: pointer;
}

.demo-rules input {
  width: 1.25rem;
  height: 1.25rem;
  flex: none;
  accent-color: var(--brand);
}

.demo-cal {
  width: 100%;
  margin-top: var(--space-4);
  border-collapse: separate;
  border-spacing: var(--space-1);
  table-layout: fixed;
}

.demo-cal th {
  padding-bottom: var(--space-1);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--quiet);
  text-align: left;
}

.demo-cal td {
  height: 3.25rem;
  padding: var(--space-1);
  border-radius: var(--round-chip);
  background: var(--raised);
  vertical-align: top;
}

/* A day outside the month: the cell stays in the grid so the columns line up, and is empty. */
.demo-cal td.out {
  background: transparent;
}

/* Saturday and Sunday are a shade apart, as on the application's calendar. */
.demo-cal td.weekend {
  background: var(--line);
}

.demo-day {
  display: block;
  font-size: 0.6875rem;
  line-height: 1.2;
  color: var(--quiet);
}

.demo-cal .person {
  width: 100%;
  margin-top: var(--space-1);
  /* The code appears with a short rise when the night is filled (section 10 removes the
     movement for people who ask their device for less motion). */
  animation: fill-in 220ms ease-out both;
}

/* A day the person on vacation is away: marked in words, so it does not rely on a colour. */
.demo-away {
  display: block;
  font-size: 0.625rem;
  line-height: 1.1;
  color: var(--attn-ink);
}

@keyframes fill-in {
  from {
    opacity: 0;
    transform: translateY(4px);
  }
}

.demo-foot {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--space-3);
  margin-top: var(--space-4);
  padding-top: var(--space-4);
  border-top: 1px solid var(--line);
}

/* The count: one row a person, weeknights as a bar and weekends as a number. */
.tally {
  display: grid;
  gap: var(--space-2);
  list-style: none;
}

.tally li {
  display: grid;
  grid-template-columns: 2.75rem minmax(0, 1fr) 11rem;
  align-items: center;
  gap: var(--space-2);
  font-size: 0.8125rem;
  color: var(--muted);
}

.tally-track {
  height: var(--space-2);
  border-radius: var(--space-1);
  background: var(--raised);
  overflow: hidden;
}

.tally-fill {
  display: block;
  height: 100%;
  width: 0;
  border-radius: var(--space-1);
  background: var(--call);
  transition: width 400ms ease-out;
}

.demo-result {
  font-size: 0.9375rem;
  color: var(--ink);
}

.demo-result.problem {
  color: var(--danger-ink);
}

.demo-small {
  font-size: 0.8125rem;
  color: var(--quiet);
}

/* The handwritten nudge beside the schedule. One note, in the brand face, with a drawn arrow. */
.scribble {
  display: flex;
  align-items: flex-start;
  gap: var(--space-2);
  margin-top: var(--space-4);
  font-family: var(--font-display);
  font-size: 1.125rem;
  line-height: 1.3;
  color: var(--brand);
}

.scribble svg {
  flex: none;
  width: var(--space-8);
  height: var(--space-6);
}

/* 7 ── Pieces of the product drawn in HTML ───────────────────────────────────────────────────
   Small, true-to-the-screen drawings used beside the feature text: a count against the group, a
   request and its approval, the On call box, a text message. They use invented people and are
   marked as pictures for a screen reader (role="img" with a full description). */
.piece {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--round-card);
  box-shadow: var(--shadow);
  padding: var(--space-5);
}

.piece-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  margin-bottom: var(--space-4);
  font-size: 1.0625rem;
  font-weight: 600;
  color: var(--ink);
}

/* "My call": a bar for the person, a tick mark for the group's average. */
.bars {
  display: grid;
  gap: var(--space-3);
}

.bars-row {
  display: grid;
  grid-template-columns: 5.5rem minmax(0, 1fr) 4.5rem;
  align-items: center;
  gap: var(--space-3);
  font-size: 0.9375rem;
}

.bars-track {
  position: relative;
  height: var(--space-2);
  border-radius: var(--space-1);
  background: var(--raised);
}

.bars-fill {
  position: absolute;
  inset: 0 auto 0 0;
  border-radius: var(--space-1);
  background: var(--call);
}

.bars-avg {
  position: absolute;
  top: calc(-1 * var(--space-1));
  bottom: calc(-1 * var(--space-1));
  width: 2px;
  background: var(--ink);
}

.bars-num {
  text-align: right;
  line-height: 1.2;
}

.bars-num strong {
  display: block;
  color: var(--ink);
}

.bars-num span {
  font-size: 0.75rem;
  color: var(--quiet);
}

/* Widths and positions for those bars. A style="" attribute is not allowed by the site's
   security policy, so the few values the pictures need are named here. */
.w-20 { width: 20%; }
.w-45 { width: 45%; }
.w-55 { width: 55%; }
.w-60 { width: 60%; }
.w-70 { width: 70%; }
.at-25 { left: 25%; }
.at-50 { left: 50%; }
.at-55 { left: 55%; }
.at-65 { left: 65%; }

.piece-key {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2) var(--space-4);
  margin-top: var(--space-4);
  font-size: 0.8125rem;
  color: var(--quiet);
}

.key-you::before,
.key-avg::before {
  content: "";
  display: inline-block;
  vertical-align: middle;
  margin-right: var(--space-2);
  background: var(--call);
  width: var(--space-4);
  height: var(--space-2);
  border-radius: var(--space-1);
}

.key-avg::before {
  width: 2px;
  height: var(--space-4);
  border-radius: 0;
  background: var(--ink);
}

/* A request moving through its steps: who asked, who must answer, what happened. */
.flow {
  list-style: none;
  display: grid;
  gap: var(--space-3);
}

.flow li {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: var(--space-3);
  padding-bottom: var(--space-3);
  border-bottom: 1px solid var(--line);
  font-size: 0.9375rem;
}

.flow li:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.flow small {
  display: block;
  font-size: 0.8125rem;
  color: var(--quiet);
}

/* The On call box: the search field from the application's top bar, and what it answers. */
.lookup {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-3);
  border-radius: var(--round-control);
  background: var(--chrome);
  color: var(--on-chrome);
  font-size: 0.875rem;
  font-weight: 600;
}

.lookup-field {
  flex: 1;
  min-width: 0;
  padding: var(--space-2) var(--space-3);
  border-radius: var(--round-chip);
  background: #ffffff;
  color: #10201e;
  font-weight: 400;
}

.lookup-list {
  list-style: none;
  margin-top: var(--space-3);
  display: grid;
  gap: var(--space-2);
  font-size: 0.9375rem;
}

.lookup-list li {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: var(--space-3);
}

.lookup-list small {
  color: var(--quiet);
  font-size: 0.8125rem;
}

/* A phone's text thread: what ScrubGrid sent on the left, the person's reply on the right. */
.thread {
  display: grid;
  gap: var(--space-2);
  max-width: 22rem;
  margin-inline: auto;
  padding: var(--space-5) var(--space-4);
  border: 1px solid var(--line);
  border-radius: var(--space-6);
  background: var(--card);
  box-shadow: var(--shadow);
  font-size: 0.9375rem;
  line-height: 1.4;
}

.thread p {
  max-width: 85%;
  padding: var(--space-2) var(--space-3);
  border-radius: var(--round-card);
  background: var(--raised);
  color: var(--ink);
}

.thread .mine {
  justify-self: end;
  background: var(--brand);
  color: var(--on-brand);
}

.thread small {
  justify-self: center;
  font-size: 0.75rem;
  color: var(--quiet);
}

/* The time-off month: one row a person, a bar for each stretch away, coloured by its kind. */
.board {
  display: grid;
  gap: var(--space-1);
  font-size: 0.8125rem;
}

.board-row {
  display: grid;
  grid-template-columns: 2.75rem repeat(14, minmax(0, 1fr));
  gap: var(--space-1);
  align-items: center;
}

.board-row > span {
  height: var(--space-5);
  border-radius: 0.1875rem;
  background: var(--raised);
}

.board-row > .code {
  background: transparent;
  height: auto;
  color: var(--ink);
}

.board-row > .k1 { background: var(--p1-dot); }
.board-row > .k2 { background: var(--p2-dot); }
.board-row > .k3 { background: var(--p3-dot); }

.key-k1::before,
.key-k2::before,
.key-k3::before {
  content: "";
  display: inline-block;
  vertical-align: middle;
  margin-right: var(--space-2);
  width: var(--space-3);
  height: var(--space-3);
  border-radius: 50%;
  background: var(--p1-dot);
}

.key-k2::before { background: var(--p2-dot); }
.key-k3::before { background: var(--p3-dot); }

/* 8 ── Long-form pages (terms, privacy, the opt-in record, security) ─────────────────────────
   The words of the three legal pages were reviewed for the text-message programme and are kept
   exactly; only how they look is set here. */
.prose {
  max-width: 45rem;
  padding-block: var(--space-12);
}

.prose h1 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(2rem, 1.4rem + 2.4vw, 2.75rem);
  line-height: 1.15;
  margin-bottom: var(--space-2);
}

.prose .updated {
  color: var(--quiet);
  font-size: 0.875rem;
  margin-bottom: var(--space-6);
}

.prose h2 {
  font-size: 1.3125rem;
  margin: var(--space-8) 0 var(--space-3);
}

.prose h3 {
  font-size: 1.0625rem;
  margin: var(--space-5) 0 var(--space-2);
}

.prose p,
.prose li {
  font-size: 1rem;
  margin-bottom: var(--space-3);
}

.prose ul,
.prose ol {
  padding-left: var(--space-5);
}

.prose li {
  margin-bottom: var(--space-2);
}

.prose strong {
  color: var(--ink);
  font-weight: 600;
}

.callout,
.sample,
.shot {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--round-control);
  padding: var(--space-4);
  margin: var(--space-4) 0;
}

.sample {
  padding: var(--space-3) var(--space-4);
  margin: var(--space-2) 0 var(--space-3);
  font-size: 0.9375rem;
  color: var(--muted);
}

.shot {
  text-align: center;
}

/* The written-out request on the contact page: kept line by line, in the reading face. */
pre.sample {
  white-space: pre-wrap;
  font: inherit;
  font-size: 0.9375rem;
  color: var(--ink);
}

.shot img {
  border-radius: var(--round-chip);
}

.shot .cap {
  font-size: 0.8125rem;
  color: var(--quiet);
  margin: var(--space-3) 0 0;
}

/* A two-column list of facts on the security page: the question on the left, the answer beside it. */
.facts {
  display: grid;
  gap: 0;
  max-width: 56rem;
  border-top: 1px solid var(--line);
}

.facts > div {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 2fr);
  gap: var(--space-5);
  padding-block: var(--space-5);
  border-bottom: 1px solid var(--line);
}

.facts dt {
  color: var(--ink);
  font-weight: 600;
}

.facts dd {
  color: var(--text);
}

.facts dd p + p {
  margin-top: var(--space-3);
}

/* 9 ── The request form ──────────────────────────────────────────────────────────────────────── */
.form-layout {
  display: grid;
  grid-template-columns: minmax(0, 3fr) minmax(0, 2fr);
  gap: var(--space-8);
  align-items: start;
  padding-bottom: var(--space-12);
}

.form {
  display: grid;
  gap: var(--space-5);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--round-card);
  padding: var(--space-6);
}

.field {
  display: grid;
  gap: var(--space-2);
}

.field label,
.field legend {
  color: var(--ink);
  font-size: 0.9375rem;
  font-weight: 600;
}

.field .hint {
  font-size: 0.875rem;
  color: var(--quiet);
}

.field input[type="text"],
.field input[type="email"],
.field select {
  width: 100%;
  min-height: 2.75rem;
  padding: var(--space-2) var(--space-3);
  border: 1px solid var(--edge);
  border-radius: var(--round-control);
  background: var(--card);
  color: var(--ink);
  font: inherit;
}

/* A field the person has left with a mistake in it: a red edge AND a sentence under it. */
.field input[aria-invalid="true"],
.field select[aria-invalid="true"] {
  border-color: var(--danger-ink);
}

.field .error {
  font-size: 0.875rem;
  color: var(--danger-ink);
}

.field .error:empty {
  display: none;
}

.pair {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-5);
}

.choices {
  display: grid;
  gap: var(--space-1);
  border: 0;
}

.choices label {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  min-height: 2.75rem;
  font-weight: 400;
  color: var(--text);
  cursor: pointer;
}

.choices input {
  width: 1.25rem;
  height: 1.25rem;
  flex: none;
  accent-color: var(--brand);
}

/* What happens after the button is pressed: said in words under the form. */
.form-status {
  padding: var(--space-4);
  border-radius: var(--round-control);
  background: var(--success-soft);
  color: var(--success-ink);
}

.form-status[hidden] {
  display: none;
}

.aside {
  display: grid;
  gap: var(--space-5);
}

/* 10 ── The footer, small screens, motion, print ─────────────────────────────────────────────── */
.footer {
  background: var(--chrome);
  color: var(--on-chrome);
  padding-block: var(--space-8);
  font-size: 0.9375rem;
}

.footer a {
  color: var(--on-chrome);
  text-decoration: none;
}

.footer a:hover {
  color: #ffffff;
  text-decoration: underline;
}

.footer :focus-visible {
  outline-color: #ffffff;
}

.footer-grid {
  display: grid;
  grid-template-columns: minmax(0, 2fr) repeat(3, minmax(0, 1fr));
  gap: var(--space-6);
}

.footer h2 {
  color: var(--on-chrome-muted);
  font-size: 0.8125rem;
  font-weight: 600;
  margin-bottom: var(--space-2);
}

.footer ul {
  list-style: none;
  display: grid;
}

.footer li a {
  display: inline-flex;
  align-items: center;
  min-height: 2.75rem;
}

.footer-about p {
  max-width: 24rem;
  margin-top: var(--space-3);
  color: var(--on-chrome-muted);
}

.footer-base {
  margin-top: var(--space-6);
  padding-top: var(--space-5);
  border-top: 1px solid var(--chrome-active);
  color: var(--on-chrome-muted);
  font-size: 0.875rem;
}

/* A tablet held upright, and narrower: one column, and the navigation behind a Menu button. */
@media (max-width: 60rem) {
  .hero-grid,
  .split,
  .closing,
  .form-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .split.flip > :first-child {
    order: 0;
  }

  .closing .actions {
    justify-content: flex-start;
  }

  .steps,
  .columns,
  .columns.two,
  .shapes {
    grid-template-columns: minmax(0, 1fr);
  }

  .footer-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .facts > div {
    grid-template-columns: minmax(0, 1fr);
    gap: var(--space-2);
  }

  /* The Menu button appears only when the script is running (the "js" class is put on <html> by
     assets/site.js). Without the script the links simply wrap under the wordmark, so the
     navigation is never out of reach. */
  .bar-inner {
    flex-wrap: wrap;
    padding-block: var(--space-2);
  }

  .nav {
    flex-wrap: wrap;
    width: 100%;
    margin-left: 0;
  }

  .nav .nav-gap {
    margin-left: 0;
  }

  .js .menu-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .js .nav {
    display: none;
    flex-direction: column;
    align-items: stretch;
    padding-bottom: var(--space-3);
  }

  .js .nav.open {
    display: flex;
  }

  .js .nav a {
    padding-inline: var(--space-3);
  }

  .js .nav a.btn {
    margin: var(--space-2) 0 0;
  }
}

/* A phone. */
@media (max-width: 36rem) {
  .wrap {
    padding-inline: var(--space-4);
  }

  .section,
  .hero {
    padding-block: var(--space-8);
  }

  .page-head {
    padding-block: var(--space-8) var(--space-6);
  }

  .demo,
  .piece,
  .form {
    padding: var(--space-4);
  }

  .demo-cal td {
    height: 3rem;
    padding: var(--space-1) 0 0;
    text-align: center;
  }

  .demo-cal .person {
    padding-inline: 0;
    font-size: 0.625rem;
  }

  .demo-away {
    font-size: 0.5625rem;
  }

  .pair {
    grid-template-columns: minmax(0, 1fr);
  }

  .tally li {
    grid-template-columns: 2.75rem minmax(0, 1fr) 9.5rem;
  }

  .shapes li {
    grid-template-columns: minmax(0, 1fr);
    gap: var(--space-2);
  }

  .footer-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* People who ask their device for less motion get none: the nights and bars simply appear. */
@media (prefers-reduced-motion: reduce) {
  .demo-cal .person {
    animation: none;
  }

  .tally-fill {
    transition: none;
  }

  html {
    scroll-behavior: auto;
  }
}

/* On paper: black on white, no bar, no buttons (a terms or security page may be printed for a
   review). */
@media print {
  .bar,
  .footer,
  .skip,
  .actions,
  .menu-button {
    display: none;
  }

  body {
    background: #ffffff;
    color: #000000;
  }
}
