/* Sprout Up. One stylesheet. No web fonts (slow school wifi), no inline styles or scripts
   (strict CSP), no framework. Component names and usage: DESIGN.md in the repo root.

   Palette: moss ink on white paper, sprout green for action, sunflower only for the demo strip
   and the note button. Status is always said in words; colour and glyph only reinforce it.
   Every text pair below is measured (WCAG 2.x contrast ratio). */
:root {
  /* Ink */
  --ink: #16302B;          /* body text: 14.1:1 on paper, 13.1:1 on field, 12.4:1 on leaf, 8.4:1 on sun */
  --ink-soft: #4A5E58;     /* secondary text: 6.9:1 on paper, 6.4:1 on field, 6.1:1 on leaf, 6.2:1 on warn-bg */
  /* Sprout (action) */
  --sprout: #2A7247;       /* links, primary buttons: 5.8:1 on paper, 5.4:1 on field, 5.1:1 on leaf; paper on it 5.8:1 */
  --sprout-deep: #1F5C39;  /* hover, scope text: 7.9:1 on paper, 7.0:1 on leaf; paper on it 7.9:1 */
  --leaf: #E8F3EA;         /* light green wash (ok chips, flash, current row) */
  --leaf-2: #6DBA82;       /* decorative only (logo, leaf marks) */
  --track: #D3E6D8;        /* meter track; sprout fill on it 4.5:1 */
  /* Neutrals */
  --paper: #FFFFFF;
  --field: #F4F7F5;        /* quiet surfaces: cards at rest, table heads */
  --line: #D5DED9;         /* dividers only (decorative) */
  --edge: #5F746B;         /* control borders: 5.0:1 on paper, 4.6:1 on field (WCAG 1.4.11) */
  /* Sunflower */
  --sun: #F2C230;          /* backgrounds only; ink on it 8.4:1 */
  --sun-deep: #D9A60F;     /* note tab edge (decorative) */
  /* Status: text pairs (chips, flashes) */
  --ok-ink: #1F5C39;     --ok-bg: #E8F3EA;      /* 7.0:1 */
  --warn-ink: #6B4A00;   --warn-bg: #FFF1C7;    /* 7.2:1 */
  --danger-ink: #8C2A1B; --danger-bg: #FCE8E3;  /* 7.2:1 */
  --muted-ink: #3D4B55;  --muted-bg: #ECF0F3;   /* 7.8:1 */
  --info-ink: #1F4E79;   --info-bg: #E6EFF7;    /* 7.5:1 */
  /* Status: fills for meters and charts (non-text, >= 3:1 on paper; always shown with words).
     Validated with the dataviz palette checker: lightness, chroma, normal-vision pass; green vs
     amber is 6.0 under protanopia, legal only because every meter carries its state in text. */
  --fill-ok: #2E7D4B;      /* 5.1:1 on paper */
  --fill-warn: #A57800;    /* 4.0:1 on paper */
  --fill-danger: #B42318;  /* 6.6:1 on paper; paper on it 6.6:1 (danger buttons) */
  --fill-muted: #7F998C;   /* chart de-emphasis, 3.1:1 on paper */
  /* Type: a rounded system face for headings, the platform UI face for everything else. */
  --round: ui-rounded, "SF Pro Rounded", "Nunito", "Segoe UI Variable Display", "Segoe UI", system-ui, sans-serif;
  --body: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  /* Scale: major third (1.25) */
  --t-sm: .875rem; --t-md: 1rem; --t-lg: 1.25rem; --t-xl: 1.563rem; --t-2xl: 1.953rem; --t-3xl: 2.441rem;
  /* Shape: radius follows hierarchy (chips round, cards soft, controls tight) */
  --r-card: 14px; --r-ctl: 8px; --r-pill: 999px;
  /* Width (DESIGN.md "Width"): one frame for every page and every view of it. --page is the widest the content gets;
     --gutter the side space (wide enough from 76rem for the note tab in the right gutter). Prose is capped, not the frame. */
  --page: 90rem; --gutter: 1rem;
  --frame: calc(var(--page) + 2 * var(--gutter));
}
@media (min-width: 48rem) { :root { --gutter: 2rem; } }
@media (min-width: 76rem) { :root { --gutter: 4rem; } }

/* ===== Base ===== */
*, *::before, *::after { box-sizing: border-box; }
html { scrollbar-gutter: stable; -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-padding-top: 1rem; scroll-padding-bottom: 5rem; }
body { margin: 0; font: var(--t-md)/1.55 var(--body); color: var(--ink); background: var(--paper); overflow-wrap: break-word; } /* long pasted links or unbroken text wrap instead of widening the page */
h1, h2, h3, h4 { font-family: var(--round); line-height: 1.2; margin: 0 0 .5rem; color: var(--ink); text-wrap: balance; }
h1 { font-size: var(--t-3xl); font-weight: 800; letter-spacing: -.02em; }
h2 { font-size: var(--t-xl); font-weight: 750; letter-spacing: -.01em; }
h3 { font-size: var(--t-lg); font-weight: 700; margin-top: 2rem; }
h4 { font-size: var(--t-md); font-weight: 700; }
p { margin: 0 0 .75rem; max-width: 68ch; }
a { color: var(--sprout); text-underline-offset: .18em; text-decoration-thickness: 1px; }
a:hover { color: var(--sprout-deep); text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--ink); outline-offset: 2px; }
strong { font-weight: 700; }
abbr[title] { text-decoration: none; }
img, svg { max-width: 100%; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: .5rem; z-index: 20; background: var(--paper); color: var(--ink); padding: .6rem 1rem; border-radius: var(--r-ctl); font-weight: 700; }
.skip:focus { left: 1rem; }
.sub { color: var(--ink-soft); font-size: var(--t-sm); font-weight: 400; }
.hint { color: var(--ink-soft); font-size: var(--t-sm); }
.error { color: var(--danger-ink); font-weight: 650; }
.print-only { display: none; }

/* ===== Demo strip: the one loud thing, a safety feature. Never hide it on screen. ===== */
.demo-strip { background: var(--sun); color: var(--ink); border-bottom: 1px solid var(--sun-deep); }
.demo-strip p { margin: 0 auto; max-width: var(--frame); padding: .5rem var(--gutter); font-size: var(--t-sm); }
.demo-strip a { color: var(--ink); font-weight: 750; white-space: nowrap; margin-left: .25rem; text-decoration-thickness: 2px; }

/* ===== Header: brand, main nav, bell. Phones: nav becomes a sideways-scrolling strip. ===== */
.top { border-bottom: 1px solid var(--line); background: var(--paper); }
.top-inner { max-width: var(--frame); margin: 0 auto; padding: 0 var(--gutter); display: grid; grid-template-columns: auto 1fr auto; grid-template-areas: "brand nav tools"; align-items: center; column-gap: 1.75rem; min-height: 4rem; }
.brand { grid-area: brand; display: inline-flex; align-items: center; gap: .45rem; color: var(--ink); text-decoration: none; font: 800 var(--t-lg)/1 var(--round); letter-spacing: -.01em; padding: .5rem 0; }
.brand:hover { color: var(--ink); }
.brand svg { flex: none; }
.nav { grid-area: nav; min-width: 0; }
.nav-list { list-style: none; margin: 0; padding: 0; display: flex; align-items: center; gap: 0 1.25rem; }
.nav-list a, .nav-list button.link { display: inline-flex; align-items: center; min-height: 44px; padding: .25rem 0; color: var(--ink); text-decoration: none; font-weight: 500; white-space: nowrap; border-bottom: 3px solid transparent; border-top: 3px solid transparent; }
.nav-list a:hover, .nav-list button.link:hover { color: var(--sprout-deep); border-bottom-color: var(--line); }
.nav-list a[aria-current] { font-weight: 700; border-bottom-color: var(--sprout); }
.nav-out { margin-left: auto; }
.nav-out button.link { color: var(--ink-soft); font-weight: 500; text-decoration: none; }
.top-tools { grid-area: tools; display: flex; align-items: center; gap: .5rem; }
.bell { position: relative; display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; border-radius: var(--r-pill); color: var(--ink); }
.bell:hover { background: var(--field); color: var(--ink); }
.bell svg { width: 22px; height: 22px; }
.bell-count { position: absolute; top: 3px; right: 1px; min-width: 1.3rem; height: 1.3rem; padding: 0 .3rem; border-radius: var(--r-pill); background: var(--fill-danger); color: var(--paper); font: 700 .75rem/1.3rem var(--body); text-align: center; box-shadow: 0 0 0 2px var(--paper); }

@media (max-width: 47.99rem) {
  .top-inner { grid-template-columns: 1fr auto; grid-template-areas: "brand tools" "nav nav"; min-height: 0; }
  .nav { margin: 0 -1rem; }
  .nav-list { overflow-x: auto; scrollbar-width: none; padding: 0 1rem; gap: 0 1.1rem;
    /* A soft fade on the right says "more this way" without JS. */
    mask-image: linear-gradient(to right, #000 calc(100% - 2rem), transparent); }
  .nav-list::-webkit-scrollbar { display: none; }
  .nav-list li:has(+ .nav-out) { padding-right: 2rem; }   /* the last item shown can scroll clear of the fade (forms.js does it for the current page) */
  .nav-out { display: none; }   /* Sign out moves beside the bell (.top-out) */
}
.top-out { margin: 0; }
.top-out button.link { display: inline-flex; align-items: center; min-height: 44px; padding: 0 .25rem; color: var(--ink-soft); font-weight: 500; text-decoration: none; white-space: nowrap; }
.top-out button.link:hover { color: var(--sprout-deep); text-decoration: underline; }
@media (min-width: 48rem) { .top-tools form.top-out { display: none; } }

/* ===== Page shell ===== */
main { max-width: var(--frame); margin: 0 auto; padding: 2rem var(--gutter) 3rem; }
.page-head { margin-bottom: 2rem; }
.page-head > :last-child { margin-bottom: 0; }
.lede { color: var(--ink-soft); font-size: var(--t-lg); }
.crumb { margin-bottom: .35rem; font-size: var(--t-sm); font-weight: 600; }
.crumb a { text-decoration: none; }
.crumb a:hover { text-decoration: underline; }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem .75rem; margin: 1rem 0 0; }
.aside { margin-top: 1.75rem; padding-top: 1rem; border-top: 1px solid var(--line); }
.narrow { max-width: 30rem; margin: 2rem auto; }
.split { display: grid; gap: 0 3rem; }
@media (min-width: 52rem) { .split { grid-template-columns: 1fr 1fr; } }

/* ===== Bed: a planted section. A leaf at the heading, a stem down the side.
   The heading is the question this section answers for the person reading it. ===== */
.bed { position: relative; margin: 0 0 3rem; padding: 0 0 .25rem 2rem; }
.bed::before { content: ""; position: absolute; left: .56rem; top: 1.75rem; bottom: 0; width: 3px; border-radius: 3px; background: var(--sprout); }
.bed::after { content: ""; position: absolute; left: 0; top: .05rem; width: 1.3rem; height: 1.3rem; background: var(--svg-leaf) no-repeat center / contain; }
.bed > h2 { margin-bottom: .2rem; }
.bed > h3:first-child { margin-top: 0; }
.bed > h3 { padding-top: .25rem; }
.answer { font-size: var(--t-lg); font-weight: 600; line-height: 1.4; }
.page-head :is(.actions, .chapter-links, .tabs, .week-nav) + .answer { margin-top: 1rem; }   /* the count under the shared head's buttons (DESIGN.md "Width" rule 7) */
.roles-line { color: var(--ink-soft); margin-bottom: 1.25rem; }
.own-onboarding { margin-top: 1.75rem; padding: .75rem 1rem; background: var(--field); border-radius: var(--r-ctl); }
.chapter-links { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: 1.5rem; }
.chapter-links a { display: inline-flex; align-items: center; min-height: 44px; padding: .4rem 1rem; border-radius: var(--r-pill); background: var(--paper); box-shadow: inset 0 0 0 1.5px var(--edge); color: var(--ink); font-weight: 650; text-decoration: none; }
.chapter-links a:hover { background: var(--leaf); box-shadow: inset 0 0 0 2px var(--sprout); color: var(--ink); }
/* The Inbox's chapter pages: plain underlined links, so they do not read as the folders' pills below them. */
.chapter-links.is-plain { gap: 0 1.25rem; margin-top: 0; margin-bottom: .75rem; }
.chapter-links.is-plain a { padding: 0; border-radius: 0; background: none; box-shadow: none; color: var(--sprout-deep); text-decoration: underline; text-underline-offset: .18em; font-weight: 600; }
.chapter-links.is-plain a:hover { background: none; box-shadow: none; color: var(--ink); }
/* 0036: a file mailed to a role mailbox is a button in the same row, drawn as its pill (or as its link, .is-plain). */
.chapter-links .mail-export { display: inline-flex; margin: 0; }
.chapter-links .mail-export button { min-height: 44px; padding: .4rem 1rem; border-radius: var(--r-pill); background: var(--paper); box-shadow: inset 0 0 0 1.5px var(--edge); color: var(--ink); font-weight: 650; text-align: left; overflow-wrap: anywhere; }
.chapter-links .mail-export button:hover { background: var(--leaf); box-shadow: inset 0 0 0 2px var(--sprout); color: var(--ink); }
.chapter-links.is-plain .mail-export button { min-height: 0; padding: 0; border-radius: 0; background: none; box-shadow: none; color: var(--sprout-deep); text-decoration: underline; text-underline-offset: .18em; font-weight: 600; }
.chapter-links-h { display: inline-flex; align-items: center; min-height: 44px; color: var(--ink-soft); font-size: var(--t-sm); font-weight: 650; }

/* ===== Stat tiles: a big number that answers a question, a label, an optional sub-line. ===== */
.stats { list-style: none; margin: 1rem 0 1.5rem; padding: 0; display: grid; gap: .75rem; grid-template-columns: repeat(auto-fit, minmax(8.5rem, 1fr)); }
.stat { display: flex; flex-direction: column; gap: .15rem; min-width: 0; padding: 1rem 1.1rem; border-radius: var(--r-card); background: var(--field); }
.stat-value { font: 750 var(--t-3xl)/1.05 var(--body); letter-spacing: -.02em; color: var(--ink); }
.stat-label { font-weight: 600; color: var(--ink); }
.stat-label, .stat-sub { overflow-wrap: break-word; hyphens: auto; }
.stat-sub { font-size: var(--t-sm); color: var(--ink-soft); }
.stat-sub.is-good { color: var(--ok-ink); font-weight: 600; }
.stat-sub.is-bad { color: var(--danger-ink); font-weight: 600; }
.stat.is-warn { background: var(--warn-bg); box-shadow: inset 4px 0 0 var(--fill-warn); }
.stat.is-danger { background: var(--danger-bg); box-shadow: inset 4px 0 0 var(--fill-danger); }
.stat.is-warn .stat-sub, .stat.is-danger .stat-sub { color: var(--ink); }

/* ===== Cards and card grids ===== */
.card { background: var(--paper); border: 1px solid var(--line); border-radius: var(--r-card); padding: 1rem 1.1rem; }
.card > :last-child { margin-bottom: 0; }
.card h3 { margin-top: 0; }
.card.is-quiet { background: var(--field); border-color: transparent; }
.card-grid { list-style: none; margin: 1rem 0; padding: 0; display: grid; gap: .75rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 17rem), 1fr)); }

/* ===== Lessons as wrapping rows (they read on a 360 px phone) ===== */
.lessons, .assignments, .people, .quotes, .checklist, .can-list, .notes-list, .personas, .role-list { list-style: none; padding: 0; margin: 0; }
.lesson { display: flex; flex-wrap: wrap; gap: .4rem 1rem; align-items: center; padding: .85rem 0; border-bottom: 1px solid var(--line); }
.lessons > .lesson:first-child { border-top: 1px solid var(--line); }
.lesson-main { flex: 1 1 18rem; display: grid; gap: .05rem; text-decoration: none; color: var(--ink); }
.lesson-main:hover { color: var(--ink); }
.lesson-main .when { font-weight: 700; }
.lesson-main .what { color: var(--sprout); font-weight: 600; text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: .18em; }
.lesson-main:hover .what { color: var(--sprout-deep); text-decoration-thickness: 2px; }
.lesson-main .where { color: var(--ink-soft); font-size: var(--t-sm); }
.lesson.is-cancelled .lesson-main .what { text-decoration: line-through; color: var(--ink-soft); }
.facts { display: flex; flex-wrap: wrap; gap: .35rem; }

/* Assignments: the instructor's "where am I going, when, with whom". The next one leads. */
.assignments { display: grid; gap: .75rem; margin-top: .75rem; }
@media (min-width: 48rem) { .assignments { grid-template-columns: 1fr 1fr; } .assignments > li:first-child { grid-column: 1 / -1; } }
.assignment { padding: 1rem 1.1rem; background: var(--field); border-radius: var(--r-card); border: 1px solid transparent; }
.assignment p { margin: 0 0 .3rem; }
.assignment .when { font: 750 var(--t-lg)/1.3 var(--round); }
.assignment .what { font-weight: 600; }
.assignment .where, .assignment .team { color: var(--ink-soft); }
.assignments > li:first-child { background: var(--paper); border-color: var(--line); padding: 1.25rem 1.35rem; }
.assignments > li:first-child .when { font-size: var(--t-xl); }
.assignments > li:first-child .where { color: var(--ink); }
.assignment.status-invited { box-shadow: inset 4px 0 0 var(--fill-warn); }
.respond { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; margin-top: .75rem; }

/* People lists and quotes */
.people > li { padding: .8rem 0; border-bottom: 1px solid var(--line); }
.people p { margin: 0; }
.people .who { font-weight: 650; }
.people .contact { font-size: var(--t-sm); overflow-wrap: anywhere; }
a[href^="tel:"] { white-space: nowrap; }
.roster { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 18rem), 1fr)); column-gap: 2rem; }
.role-list li { display: flex; flex-wrap: wrap; gap: 0 .75rem; align-items: center; }
.quotes { display: grid; gap: 1rem; }
@media (min-width: 48rem) { .bed > .quotes { grid-template-columns: 1fr 1fr; } }
.quotes li { margin: 0; }
blockquote { margin: 0; padding: .15rem 0 .15rem 1rem; border-left: 3px solid var(--leaf-2); }
blockquote p { margin: 0; }
.cite { color: var(--ink-soft); font-size: var(--t-sm); margin-top: .3rem; }

.facts-list { display: grid; grid-template-columns: 7rem 1fr; gap: .5rem 1rem; margin: 0 0 1.25rem; }
.facts-list dt { color: var(--ink-soft); }
.facts-list dd { margin: 0; overflow-wrap: anywhere; }
.unpause-ask { margin: 0 0 1.25rem; }   /* 0037: a paused person's request, on the unpause page */
.unpause-ask figcaption { margin-top: .35rem; }

/* ===== Status chips: always words; the glyph and colour only back them up ===== */
.chip { display: inline-flex; align-items: center; gap: .3rem; max-width: 100%; font-size: var(--t-sm); font-weight: 650; line-height: 1.3; padding: .18rem .6rem; border-radius: var(--r-pill); background: var(--muted-bg); color: var(--muted-ink); white-space: nowrap; vertical-align: .08em; }   /* one line, always (Alignment): short words, not a wrap */
.chip::before { font-size: .8em; line-height: 1; }
.chip-ok, .chip-ready { background: var(--ok-bg); color: var(--ok-ink); }
.chip-ok::before, .chip-ready::before { content: "\2713" / ""; }
.chip-warn, .chip-partial, .chip-unknown { background: var(--warn-bg); color: var(--warn-ink); }
.chip-warn::before, .chip-partial::before, .chip-unknown::before { content: "!" / ""; font-weight: 900; font-size: .9em; }
.chip-danger, .chip-missing { background: var(--danger-bg); color: var(--danger-ink); }
.chip-danger::before, .chip-missing::before { content: "\2715" / ""; }
.chip-muted { background: var(--muted-bg); color: var(--muted-ink); }
.chip-info, .chip-proposed { background: var(--info-bg); color: var(--info-ink); }
.chip-lead { background: var(--ink); color: var(--paper); }          /* 14.1:1 */
.chip-role { background: var(--paper); color: var(--ink); box-shadow: inset 0 0 0 1px var(--edge); }

/* ===== Alignment (DESIGN.md "Alignment"): list-item anatomy, leading · headline · trailing =====
   A row in a list, drawer or card list: .row > .row-lead? .row-head .row-trail. The headline owns the leading edge; chips,
   counts, dates and the row's buttons sit in the trailing slot, flush to the row's right edge, so they form one straight
   column down the list. When the trailing slot doesn't fit beside the headline (which keeps 10rem), it wraps below it,
   still flush right: the column stays straight (on a phone: always below, left-aligned; see the media query). Never a
   per-page margin to line things up. */
.row { display: flex; flex-wrap: wrap; align-items: center; gap: .35rem .75rem; }
.row-lead { flex: none; }
.row-head { flex: 1 1 10rem; min-width: 0; }
.row-trail { flex: 0 1 auto; max-width: 100%; margin-inline-start: auto; display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: .4rem .5rem; text-align: right; }
.row-trail > form.inline, .row-acts > form.inline { margin: 0; }
.row > :is(.row-head, .row-trail) { margin-block: 0; max-width: none; }   /* the row's gap spaces them, whatever element they are */
.row > .row-trail { margin-inline-start: auto; max-width: 100%; }   /* beats a page's `.x p { margin: … }` */
div.row:not(:last-child) { margin-bottom: .3rem; }
/* A narrow list (a drawer) puts the row's buttons on their own line under it, at the same right edge, so the chips above stay one column. */
.row-acts { flex: 1 0 100%; display: flex; flex-wrap: wrap; justify-content: flex-end; gap: .4rem .5rem; }
.row-when { min-width: 5.5rem; color: var(--ink-soft); font-size: var(--t-sm); white-space: nowrap; text-align: right; }   /* a date column: one width, so the chips before it line up */
/* On a phone the trailing slot always takes the line under the headline, left-aligned under it: one rule, so a list never
   mixes rows whose chip fits beside the name with rows whose chip does not. */
@media (max-width: 30rem) {
  .row > .row-trail { flex-basis: 100%; margin-inline-start: 0; justify-content: flex-start; text-align: left; }
  .row-acts { justify-content: flex-start; }
  .row-when { min-width: 0; text-align: left; }
}
/* Numbers that stack are right-aligned in tabular figures (number columns: td.num / th.num under Tables). */
.stat-value, .meter-value, .inbox-n, .tl-n, .tl-drawer-n, .section-count, .pm-count, .bd-n, .tv-count, .ts-n, .ts-flag-n, .rating-n { font-variant-numeric: tabular-nums; }

/* ===== Meter: a count toward a target (clearance 7 of 9). Native <progress>, so no inline width. */
.meter { display: grid; gap: .35rem; margin: .75rem 0; max-width: 28rem; }
.meter-text { display: flex; justify-content: space-between; gap: 1rem; font-size: var(--t-sm); }
.meter-label { font-weight: 600; }
.meter-value { font-weight: 700; font-variant-numeric: tabular-nums; }
.meter progress { -webkit-appearance: none; appearance: none; display: block; width: 100%; height: .6rem; border: 0; border-radius: var(--r-pill); background: var(--track); overflow: hidden; color: var(--fill-ok); }
.meter progress::-webkit-progress-bar { background: var(--track); border-radius: var(--r-pill); }
.meter progress::-webkit-progress-value { background: var(--fill-ok); border-radius: var(--r-pill); }
.meter progress::-moz-progress-bar { background: var(--fill-ok); border-radius: var(--r-pill); }
.meter.is-warn progress { color: var(--fill-warn); background: var(--warn-bg); }
.meter.is-warn progress::-webkit-progress-bar { background: var(--warn-bg); }
.meter.is-warn progress::-webkit-progress-value { background: var(--fill-warn); }
.meter.is-warn progress::-moz-progress-bar { background: var(--fill-warn); }
.meter.is-danger progress { color: var(--fill-danger); background: var(--danger-bg); }
.meter.is-danger progress::-webkit-progress-bar { background: var(--danger-bg); }
.meter.is-danger progress::-webkit-progress-value { background: var(--fill-danger); }
.meter.is-danger progress::-moz-progress-bar { background: var(--fill-danger); }
/* An empty warn/danger bar on an amber or red panel still shows its outline (review: 0 of 7 was invisible). */
.meter.is-warn progress { box-shadow: inset 0 0 0 1px var(--fill-warn); }
.meter.is-danger progress { box-shadow: inset 0 0 0 1px var(--fill-danger); }

/* ===== Planner (views/board.php, views/team/seat.php, views/member.php): one row per classroom, a slot per column.
   A name opens that person's page; "+ ..." opens the chooser. A penciled-in person is dashed with the words
   "Penciled in"; an empty slot that matters carries a "!" and, for a short team, the words "Needs N more". ===== */
.planner-wrap { margin: 1rem 0 2rem; }
.planner { width: 100%; border-collapse: collapse; table-layout: fixed; }
.planner thead th { padding: .5rem .75rem; text-align: left; font-size: var(--t-sm); color: var(--ink-soft); border-bottom: 2px solid var(--line); }
.planner tbody { border-bottom: 1px solid var(--line); scroll-margin-top: 1rem; }
.planner tbody tr > * { padding: .65rem .75rem; vertical-align: top; text-align: left; min-width: 0; overflow-wrap: anywhere; }
.planner thead th:nth-child(1) { width: 25%; }
.planner thead th:nth-child(2) { width: 17%; }
.planner thead th:nth-child(3) { width: 28%; }
.planner thead th:nth-child(4) { width: 14%; }
.planner thead th:nth-child(5) { width: 16%; }
.plan-room > a { font-weight: 700; color: var(--ink); display: inline-block; border-radius: var(--r-ctl); }
.plan-room > a:focus, .plan-room > a:focus-visible { outline: none; background: var(--leaf); box-shadow: 0 0 0 .35rem var(--leaf); }   /* landing here after an action (board.js) */
.plan-room .sub { display: block; font-size: var(--t-sm); }
.plan-room .chip { margin-top: .35rem; }
.plan-place { display: flex; flex-wrap: wrap; align-items: center; gap: .3rem .6rem; margin-top: .5rem; }
.plan-place .hint { margin: 0; }
.seats { list-style: none; margin: 0; padding: 0; display: grid; gap: .35rem; justify-items: start; }
.seats > li { min-width: 0; }
.seat-name { display: inline-flex; align-items: center; min-height: 44px; font-weight: 650; color: var(--ink); text-decoration-color: var(--edge); text-underline-offset: .2em; overflow-wrap: anywhere; }
.seat-name:hover { color: var(--sprout-deep); }
.seat-marks { display: flex; flex-wrap: wrap; gap: .3rem; margin-top: -.25rem; }
.seat.is-pencil .seat-name { color: var(--ink-soft); }
.seat-add { display: inline-flex; align-items: center; gap: .35rem; min-height: 44px; padding: 0 .75rem; border: 1.5px dashed var(--edge); border-radius: var(--r-ctl); color: var(--sprout-deep); font-weight: 650; text-decoration: none; }
.seat-add:hover { background: var(--leaf); border-color: var(--sprout); }
.seat-add.is-need { border-color: var(--fill-danger); color: var(--danger-ink); background: var(--danger-bg); }
.seat-add.is-need::before { content: "!" / ""; font-weight: 900; }
.seat-add + .chip { margin-left: .35rem; }
.seat-none { color: var(--ink-soft); min-height: 44px; display: inline-flex; align-items: center; }
.plan-notes td, .plan-flash td { padding-top: 0; }
.plan-notes ul { list-style: none; margin: 0; padding: 0; display: grid; gap: .25rem; font-size: var(--t-sm); color: var(--warn-ink); }
.plan-notes li { position: relative; padding-left: 1.2rem; }
.plan-notes li::before { content: "!" / ""; position: absolute; left: .2rem; font-weight: 900; }
.plan-flash .card-flash { margin: 0; }
.seat-rest { margin-top: 1.5rem; }
.member-actions { list-style: none; margin: 0; padding: 0; display: grid; gap: .6rem; max-width: 24rem; }
.member-actions > li > button, .member-actions > li > .button { width: 100%; }
.member-actions .hint { display: block; margin: .25rem 0 0; }
.member-move { display: grid; gap: .4rem; max-width: 24rem; margin-top: 1.5rem; padding-top: 1rem; border-top: 1px solid var(--line); }
.member-move select { width: 100%; max-width: 100%; }
@media (max-width: 30rem) {   /* a phone: each classroom is a block, its slots stacked under their labels */
  .planner.stack-phone tbody tr { grid-template-columns: minmax(0, 1fr); gap: .15rem; padding: .85rem .25rem; }
  .planner.stack-phone tbody tr > * { padding: 0; }
  .planner.stack-phone tbody td[data-label] { display: grid; grid-template-columns: 5.5rem minmax(0, 1fr); align-items: start; column-gap: .5rem; }
  .planner.stack-phone td[data-label]::before { margin-top: .75rem; font-weight: 600; color: var(--ink-soft); font-size: var(--t-sm); }
  .planner.stack-phone .plan-room { margin-bottom: .35rem; }
  .planner.stack-phone .plan-flash td { display: block; }
}

/* ===== Steps / timeline: an ordered sequence (term timeline, onboarding checklist).
   State needs words too: a chip or a visually-hidden "Done:" in each item. ===== */
.steps { list-style: none; margin: 1rem 0; padding: 0; }
.step { position: relative; padding: 0 0 1.25rem 2.25rem; }
.step:last-child { padding-bottom: 0; }
.step::before { content: ""; position: absolute; left: .5rem; top: .35rem; width: 1rem; height: 1rem; border-radius: 50%; background: var(--paper); box-shadow: inset 0 0 0 2px var(--edge); }
.step::after { content: ""; position: absolute; left: .94rem; top: 1.55rem; bottom: .15rem; width: 2px; background: var(--line); }
.step:last-child::after { display: none; }
.step.is-done::before { background: var(--sprout) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M4 8.5l2.5 2.5L12 5.5' stroke='%23fff' stroke-width='2.2' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 100% no-repeat; box-shadow: none; }
.step.is-done::after { background: var(--sprout); }
.step.is-current::before { box-shadow: inset 0 0 0 2px var(--sprout), 0 0 0 4px var(--leaf); background: var(--leaf); }
.step.is-blocked::before { box-shadow: inset 0 0 0 2px var(--fill-danger); background: var(--danger-bg); }
.step-title { display: block; font-weight: 650; }
.step-meta { display: block; color: var(--ink-soft); font-size: var(--t-sm); }
.step .chip { margin-top: .25rem; }
.step > .row { display: flex; }   /* a span: the title and its chip on one line, the chip at the right edge */
.step > .row .chip { margin-top: 0; }
.step > p { margin: .2rem 0 0; }

/* ===== Empty states: say what's missing and what to do next ===== */
.empty { padding: 1.5rem 1.25rem 1.5rem 5.25rem; min-height: 5.5rem; border: 1.5px dashed var(--line); border-radius: var(--r-card); background: var(--svg-seedling) no-repeat 1.25rem 1.25rem / 3rem; }
.empty > :last-child { margin-bottom: 0; }
.empty h2, .empty h3, .empty h4 { margin: 0 0 .25rem; font-size: var(--t-lg); }
.empty p { color: var(--ink-soft); }

/* ===== Flash and toast (DESIGN.md "Flash and toast") =====
   Success (ok) is a TOAST: one overlay at the bottom of the viewport, out of the flow (nothing moves), pointer-events none (a tap or
   click goes to what is under it), gone on its own. Warn and danger are .flash: in the page, until the next page. */
.flash { display: block; background: var(--ok-bg); color: var(--ink); border-left: 4px solid var(--fill-ok); padding: .7rem 1rem; border-radius: 0 var(--r-ctl) var(--r-ctl) 0; font-weight: 550; max-width: 44rem; }
/* A flash takes focus on load (autofocus), so a screen reader reads it after a POST; it isn't a control, so no ring. */
.flash:focus { outline: none; }
.flash-warn { background: var(--warn-bg); border-left-color: var(--fill-warn); }
.flash-danger { background: var(--danger-bg); border-left-color: var(--fill-danger); }
.layout-flash { margin: 0 0 1.25rem; }   /* a flash the page had no place for (views/layout.php) */
.page-head .flash { margin-top: 1rem; }

/* The toast. Bottom centre on every width: nothing primary lives there (the header and the View switch are at the top, the note tab
   in the right gutter), and on a phone it clears the "Feedback on this page" button at the end of the page (4.5rem) and the safe area.
   It is visible --toast-t seconds in all: .25 s in, hold, .35 s out, then visibility hidden. */
.toast { --toast-t: 4s; position: fixed; z-index: 40; left: 0; right: 0; bottom: calc(5.25rem + env(safe-area-inset-bottom)); margin: 0 auto; width: fit-content;
  max-width: min(24rem, calc(100vw - 2rem)); display: flex; align-items: flex-start; gap: .55rem; padding: .65rem 1rem; border-radius: var(--r-ctl);
  background: var(--ink); color: var(--paper); font-size: var(--t-md); font-weight: 600; line-height: 1.35; box-shadow: 0 6px 24px rgba(22, 48, 43, .3);
  pointer-events: none; user-select: none; opacity: 0; visibility: hidden;
  animation: toast-in .25s ease-out both, toast-out .35s ease-in calc(var(--toast-t) - .35s) forwards, toast-hide 1s linear var(--toast-t) forwards; }
.toast svg { flex: none; width: 1.15rem; height: 1.15rem; margin-top: .15rem; color: var(--leaf-2); }   /* 6.6:1 on ink (non-text 3:1) */
.toast-text { min-width: 0; overflow-wrap: anywhere; }
.toast-3 { --toast-t: 3s; } .toast-4 { --toast-t: 4s; } .toast-5 { --toast-t: 5s; } .toast-6 { --toast-t: 6s; }
.toast.is-paused { animation-play-state: paused; }   /* toast.js: the page is in a background tab */
@keyframes toast-in { from { opacity: 0; visibility: visible; transform: translateY(.75rem); } to { opacity: 1; visibility: visible; transform: none; } }
@keyframes toast-out { from { opacity: 1; } to { opacity: 0; } }
@keyframes toast-hide { from, to { visibility: hidden; } }   /* constant, so the end state never depends on how an interpolation rounds */
@keyframes toast-fade-in { from { opacity: 0; visibility: visible; } to { opacity: 1; visibility: visible; } }
/* The item the redirect lands on: a brief wash. The marker .toast-at sits inside the item's box (where the in-page message used to be);
   a #fragment on the item itself works too, but only on a page that has a toast. Colour only: no size, no shift. */
.toast-at { position: absolute; width: 0; height: 0; overflow: hidden; scroll-margin-top: 1rem; }   /* out of the flow: no gap in a flex or grid parent */
:has(> .toast-at), body:has(.toast) :target { animation: landed 1.6s ease-out; }
@keyframes landed { from { background-color: var(--ok-bg); box-shadow: 0 0 0 .3rem var(--ok-bg); } }
@keyframes landed-rm { to { outline-color: transparent; } }
@media (prefers-reduced-motion: reduce) {
  /* The global rule below stops every animation; the toast needs its clock to leave, so it is overridden here: no slide, only a fade. */
  .toast { animation: toast-fade-in .15s linear both, toast-out .35s linear calc(var(--toast-t) - .35s) forwards, toast-hide 1s linear var(--toast-t) forwards !important; }
  :has(> .toast-at), body:has(.toast) :target { outline: 2px solid var(--fill-ok); outline-offset: 2px; animation: landed-rm 4s steps(1, end) forwards !important; }
}
@media print { .toast { display: none; } }
.error-jumps { margin: .5rem 0 0; padding-left: 1.25rem; max-width: 44rem; }
.error-jumps li { margin: .2rem 0; }

/* ===== Forms and buttons ===== */
label { display: block; font-weight: 600; margin: .5rem 0 .25rem; }
input[type=email], input[type=password], input[type=text], input[type=search], input[type=tel], input[type=date], input[type=time], input[type=number], select, textarea {
  font: inherit; color: var(--ink); width: 100%; min-height: 44px; padding: .55rem .7rem; border: 1.5px solid var(--edge); border-radius: var(--r-ctl); background: var(--paper); }
select { overflow: hidden; }   /* Safari counts a long option's width as page width: the page slid sideways */
input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 3px solid var(--sprout); outline-offset: 1px; border-color: var(--ink); }
textarea { resize: vertical; min-height: 6rem; }
input[aria-invalid=true], select[aria-invalid=true], textarea[aria-invalid=true] { border-color: var(--danger-ink); box-shadow: 0 0 0 1px var(--danger-ink); }
.field { margin: 0 0 1rem; }
.field .hint, .field .error { margin: .3rem 0 0; }
.stack > * + * { margin-top: .6rem; }
.stack > button, .stack > .button { margin-top: 1rem; }
.row-form { display: flex; flex-wrap: wrap; align-items: flex-end; gap: .5rem .75rem; margin: 1rem 0; }
.row-form > label { margin: 0; flex-basis: 100%; }
.row-form select, .row-form input { width: auto; min-width: min(100%, 12rem); flex: 0 1 auto; }
form.inline { display: inline-flex; flex-wrap: wrap; gap: .4rem; align-items: center; margin: 0; }

button, .button { display: inline-flex; align-items: center; justify-content: center; gap: .4rem; font: 650 var(--t-md)/1.2 var(--body); color: var(--paper); background: var(--sprout); border: 0; border-radius: var(--r-ctl); padding: .65rem 1.15rem; min-height: 44px; cursor: pointer; text-decoration: none; text-align: center; }
button:hover, .button:hover { background: var(--sprout-deep); color: var(--paper); text-decoration: none; }
button.secondary, .button.secondary { background: var(--paper); color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--edge); }
button.secondary:hover, .button.secondary:hover { background: var(--field); color: var(--ink); box-shadow: inset 0 0 0 2px var(--ink); }
button.danger, .button.danger { background: var(--fill-danger); color: var(--paper); }
button.danger:hover, .button.danger:hover { background: var(--danger-ink); }
button.small, .button.small { font-size: var(--t-sm); padding: .4rem .8rem; }
button.link { display: inline; background: none; color: var(--sprout); padding: 0; min-height: 0; border-radius: 0; font-weight: 400; text-decoration: underline; text-underline-offset: .18em; }
button.link:hover { background: none; color: var(--sprout-deep); }
.role-list button.link { display: inline-flex; min-height: 44px; padding: 0 .5rem; }
button:disabled, .button[aria-disabled=true] { background: var(--muted-bg); color: var(--muted-ink); box-shadow: none; cursor: not-allowed; }
/* Pressing things (forms.js; DESIGN.md "Pressing things"). The pressed button keeps its size, place
   and colours: at once its label fades; from 300 ms a spinner takes the label's place. From 300 ms a thin
   bar runs along the top of the screen. Nothing moves, and a quick page never shows either. */
button[data-busy], .button[data-busy] { position: relative; cursor: progress; -webkit-text-fill-color: color-mix(in srgb, currentColor 45%, transparent); text-decoration-color: color-mix(in srgb, currentColor 45%, transparent); animation: busy-label .2s ease-out .3s forwards; }
button[data-busy] svg, .button[data-busy] svg { opacity: .45; }
button[data-busy]::before, .button[data-busy]::before { content: ""; position: absolute; top: 50%; left: 50%; width: 1.1em; height: 1.1em; margin: -.55em 0 0 -.55em; border: .15em solid currentColor; border-right-color: transparent; border-radius: 50%; opacity: 0; animation: busy-show .2s ease-out .3s forwards, busy-spin .8s linear .3s infinite; }
/* A link-style button can run to several lines (a notification's title): it keeps its words, faded, and
   leaves the slow signal to the top bar. */
button.link[data-busy] { animation: none; }
button.link[data-busy]::before { content: none; }
.page-progress { position: fixed; top: 0; left: 0; right: 0; z-index: 30; height: 3px; overflow: hidden; pointer-events: none; background: var(--leaf); opacity: 0; animation: busy-show .2s ease-out .3s forwards; forced-color-adjust: none; }
.page-progress::before { content: ""; position: absolute; top: 0; bottom: 0; left: 0; width: 35%; border-radius: 0 3px 3px 0; background: var(--sprout); transform: translateX(-100%); animation: page-progress 1.4s cubic-bezier(.45, 0, .25, 1) .3s infinite; }
@keyframes busy-show { to { opacity: 1; } }
@keyframes busy-label { to { -webkit-text-fill-color: transparent; text-decoration-color: transparent; } }
@keyframes busy-spin { to { transform: rotate(1turn); } }
@keyframes busy-pulse { from { opacity: .35; } to { opacity: 1; } }
@keyframes page-progress { to { transform: translateX(290%); } }
/* Reduced motion: the same timing, no spinning or sliding; a gentle fade in and out instead. */
@media (prefers-reduced-motion: reduce) {
  button[data-busy], .button[data-busy] { animation: busy-label 0s .3s forwards !important; }
  button[data-busy]::before, .button[data-busy]::before { border-right-color: currentColor; border-style: dotted; animation: busy-pulse 1.2s ease-in-out .3s infinite alternate !important; }
  .page-progress { animation: busy-show 0s .3s forwards !important; }
  .page-progress::before { width: 100%; border-radius: 0; transform: none; animation: busy-pulse 1.2s ease-in-out .3s infinite alternate !important; }
}

/* ===== Tables: scroll inside their own region on phones; the first column stays put ===== */
.table-wrap { position: relative; overflow-x: auto; margin: 1rem 0; border: 1px solid var(--line); border-radius: var(--r-card); background: var(--paper); }
.table-wrap:focus-visible { outline-offset: 3px; }
table { border-collapse: collapse; width: 100%; font-size: var(--t-sm); }
caption { text-align: left; font-weight: 700; padding: .6rem .75rem; }
th, td { padding: .6rem .75rem; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line); font-variant-numeric: tabular-nums; }
tbody tr:last-child > * { border-bottom: 0; }
thead th { background: var(--field); font-weight: 700; white-space: nowrap; }
tbody th { font-weight: 600; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
td.warn { color: var(--danger-ink); font-weight: 700; }
.matrix th[scope=row], .matrix thead th:first-child { position: sticky; left: 0; background: var(--paper); z-index: 1; min-width: 13rem; box-shadow: 1px 0 0 var(--line); }
.matrix thead th:first-child { background: var(--field); }
.matrix td { min-width: 6.5rem; }
.matrix td.no { color: var(--ink-soft); text-align: center; }
.matrix td.yes { background: var(--leaf); color: var(--sprout-deep); font-weight: 600; }
.matrix td.scope-names, .matrix td.scope-self, .matrix td.scope-team, .matrix td.scope-assigned, .matrix td.scope-own_lessons { background: #F3F9F4; font-weight: 500; }  /* sprout-deep on it 7.6:1 */
.matrix .group th { background: var(--field); font-family: var(--round); font-size: var(--t-md); }
.matrix .is-mine { box-shadow: inset 0 -3px 0 var(--sprout); }

/* ===== Tabs: links that switch a view. The current one has aria-current. ===== */
.tabs { display: flex; gap: .25rem; margin: 0 0 1.5rem; border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; }
.tabs a { display: inline-flex; align-items: center; min-height: 44px; padding: .4rem .9rem; color: var(--ink-soft); font-weight: 600; text-decoration: none; white-space: nowrap; border-bottom: 3px solid transparent; margin-bottom: -1px; }
.tabs a:hover { color: var(--ink); border-bottom-color: var(--line); }
.tabs a[aria-current] { color: var(--ink); border-bottom-color: var(--sprout); }

/* ===== Role explorer (/roles) ===== */
.role-picker { display: flex; flex-wrap: wrap; gap: .5rem; margin: 0 0 2rem; }
.role-picker a { display: inline-flex; align-items: center; min-height: 44px; padding: .45rem 1rem; border-radius: var(--r-pill); background: var(--paper); box-shadow: inset 0 0 0 1.5px var(--line); color: var(--ink); text-decoration: none; font-weight: 600; }
.role-picker a:hover { box-shadow: inset 0 0 0 2px var(--sprout); color: var(--ink); }
.role-picker a.is-mine { box-shadow: inset 0 0 0 2px var(--sprout); }
.role-picker a[aria-current] { background: var(--ink); color: var(--paper); box-shadow: none; }
.can-list li { padding: .7rem 0; border-bottom: 1px solid var(--line); }
.can-list .can { font-weight: 650; }
.can-list .scope { color: var(--sprout-deep); font-weight: 600; margin-left: .35rem; }
.cannot { color: var(--ink-soft); }

/* ===== Persona picker (/demo): "Meet a Sprout Up chapter" ===== */
.cta-row { margin: 1.25rem 0 0; }
.promises { list-style: none; margin: 0 0 3rem; padding: 0; display: grid; gap: 1.25rem 2rem; }
@media (min-width: 48rem) { .promises { grid-template-columns: repeat(3, 1fr); } }
.promise { padding-top: .85rem; border-top: 3px solid var(--sprout); }
.promise h3 { margin: 0 0 .3rem; font-size: var(--t-lg); }
.promise p { margin: 0; color: var(--ink-soft); }
.persona-group > .sub { margin: 0 0 1rem; }
.personas { display: grid; gap: .75rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 17rem), 1fr)); }
.persona-card { position: relative; display: flex; flex-direction: column; gap: .25rem; height: 100%; padding: 1rem 1.1rem 1.1rem; background: var(--paper); border: 1px solid var(--line); border-radius: var(--r-card); }
.persona-card:hover { border-color: var(--sprout); box-shadow: inset 0 0 0 1px var(--sprout); background: #FAFDFB; }
.persona-card:has(button:focus-visible) { outline: 3px solid var(--ink); outline-offset: 2px; }
.persona-role { font-size: var(--t-sm); font-weight: 700; color: var(--sprout-deep); }
.persona-card h3 { margin: 0; font-size: var(--t-lg); }
.persona-q { flex: 1; margin: .2rem 0 .75rem; color: var(--ink-soft); font-size: var(--t-sm); }
.persona-card form { margin: 0; }
.persona-card button { font-size: var(--t-sm); padding: .5rem .9rem; background: var(--paper); color: var(--sprout-deep); box-shadow: inset 0 0 0 1.5px var(--sprout); }
.persona-card:hover button { background: var(--sprout); color: var(--paper); }
.persona-card button::after { content: ""; position: absolute; inset: 0; border-radius: var(--r-card); }  /* whole card is the tap target */
.persona-card button:focus-visible { outline: none; }
.persona-card.is-national { background: var(--leaf); border-color: transparent; }
.persona-card.is-national:hover { background: var(--leaf); border-color: var(--sprout); }

/* ===== Notes ===== */
.notes-list .note { padding: 1rem 0; border-bottom: 1px solid var(--line); }
.notes-list .note form.inline { margin-top: .5rem; }

/* Note widget: the client's feedback channel on every signed-in page.
   Phones to small laptops: an open panel at the end of the page (never over content).
   Wide screens (>= 76rem): a tab in the right gutter (--gutter is 4rem there), clear of the content. */
.note-widget { max-width: var(--frame); margin: 0 auto 2rem; padding: 0 var(--gutter); }
.note-widget summary { list-style: none; cursor: pointer; display: flex; align-items: center; justify-content: center; gap: .5rem; min-height: 48px; padding: .7rem 1.1rem; border-radius: var(--r-card); background: var(--sun); color: var(--ink); font-weight: 750; box-shadow: inset 0 -2px 0 var(--sun-deep); }
.note-widget summary::-webkit-details-marker { display: none; }
.note-widget summary::before { content: ""; width: 1.1rem; height: 1.1rem; flex: none; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='none' stroke='%2316302B' stroke-width='1.8' stroke-linejoin='round'%3E%3Cpath d='M3 3.5h14v10H8l-4 3v-3H3z'/%3E%3C/svg%3E") center / contain no-repeat; }
.note-widget summary:hover { background: #F5CB4A; }  /* ink on it 9.2:1 */
.note-widget[open] summary { border-radius: var(--r-card) var(--r-card) 0 0; }
.note-widget form { background: var(--paper); padding: 1rem 1.1rem 1.1rem; border: 2px solid var(--sun); border-top: 0; border-radius: 0 0 var(--r-card) var(--r-card); }
.note-widget label { font-weight: 600; margin-top: 0; }
.note-widget .hint { margin: .5rem 0 .75rem; }
/* Demo, private copies (src/Demo/Copies.php): the line shown where the note widget would be, at the end of
   the page at every width, for an account that exists only in the visitor's own copy. */
.note-closed { max-width: var(--frame); margin: 0 auto 2rem; padding: 0 var(--gutter); }
@media print { .note-closed { display: none; } }
@media (min-width: 76rem) {
  .note-widget { position: fixed; right: 0; top: 30vh; z-index: 5; margin: 0; padding: 0; max-width: none; }
  .note-widget summary { writing-mode: vertical-rl; transform: rotate(180deg); min-height: 0; width: 48px; padding: 1rem .5rem; border-radius: 0 var(--r-card) var(--r-card) 0; box-shadow: inset 2px 0 0 var(--sun-deep), 0 2px 10px rgba(22, 48, 43, .18); }
  .note-widget summary::before { transform: rotate(90deg); }
  .note-widget[open] summary { border-radius: 0 var(--r-card) var(--r-card) 0; }
  .note-widget form { position: absolute; right: calc(100% + .5rem); top: 0; width: 24rem; border: 2px solid var(--sun); border-radius: var(--r-card); box-shadow: 0 8px 28px rgba(22, 48, 43, .22); }
}

/* ===== Charts: server-rendered, CSP-safe (no inline style, no script). =====
   Horizontal bars: each row is HTML (label + value are real text), the bar is an SVG whose rect
   width is a percentage attribute, so nothing needs inline CSS. Partial: views/ui/bars.php. */
.bars { list-style: none; margin: 1rem 0; padding: 0; display: grid; gap: .6rem; }
.bar-row { display: grid; grid-template-columns: minmax(6rem, 11rem) 1fr auto; align-items: center; gap: .25rem .9rem; }
.bar-label { font-weight: 600; overflow-wrap: anywhere; }
.bar-value { font-weight: 700; font-variant-numeric: tabular-nums; min-width: 2.5rem; text-align: right; }
.bar-track { display: block; width: 100%; height: 20px; overflow: visible; }
.bar-bg { fill: var(--field); }
.bar-fill { fill: var(--fill-ok); }
.bar-row.is-muted .bar-fill { fill: var(--fill-muted); }
.bar-row.is-warn .bar-fill { fill: var(--fill-warn); }
.bar-note { grid-column: 2 / -1; color: var(--ink-soft); font-size: var(--t-sm); margin-top: -.25rem; }
@media (max-width: 30rem) {
  .bar-row { grid-template-columns: 1fr auto; }
  .bar-label { grid-column: 1; }
  .bar-value { grid-column: 2; grid-row: 1; }
  .bar-track { grid-column: 1 / -1; }
  .bar-note { grid-column: 1 / -1; }
}
.chart { margin: 1rem 0 1.5rem; }
.chart figcaption, .chart-title { font-weight: 700; margin-bottom: .25rem; }
/* Sparkline: 2px line in the de-emphasis hue, the latest point in the accent. Partial: views/ui/sparkline.php */
.spark { display: inline-block; vertical-align: middle; overflow: visible; }
.spark-line { fill: none; stroke: var(--fill-muted); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.spark-area { fill: var(--fill-ok); opacity: .1; stroke: none; }
.spark-dot { fill: var(--fill-ok); stroke: var(--paper); stroke-width: 2; }

/* ===== Error pages ===== */
.oops { max-width: 40rem; }
.oops .sub { margin-top: 1.5rem; }

/* ===== Sign-in pages ===== */
.auth { max-width: 28rem; margin: 1.5rem auto 3rem; }
.auth h1 { font-size: var(--t-2xl); }
.auth .card { padding: 1.25rem; margin-top: 1.25rem; }
.auth .stack button { width: 100%; }
.auth .after-card { margin-top: 1.25rem; }
.auth .code-input { font: 600 var(--t-xl)/1.2 ui-monospace, "SF Mono", Menlo, Consolas, monospace; letter-spacing: .15em; text-transform: uppercase; max-width: 12rem; }

/* ===== Small screens ===== */
@media (max-width: 30rem) {
  h1 { font-size: var(--t-2xl); }
  main { padding-top: 1.5rem; }
  .bed { padding-left: 1.6rem; }
  .bed::before { left: .45rem; }
  .bed::after { width: 1.1rem; height: 1.1rem; top: .1rem; }
  .facts-list { grid-template-columns: 1fr; gap: .1rem; }
  .facts-list dt { margin-top: .5rem; }
  .stat-value { font-size: var(--t-2xl); }
  .assignments > li:first-child { padding: 1rem 1.1rem; }
  .assignments > li:first-child .when { font-size: var(--t-lg); }
  .row-form select, .row-form input { width: 100%; }
}

/* ===== Print: the Classroom Information Sheet and any page, without the chrome ===== */
@media print {
  @page { margin: 1.5cm; }
  body { font-size: 11pt; color: #000; background: #fff; }
  .demo-strip, .nav, .top-tools, .note-widget, .skip, .chapter-links, .respond, form, button, .tabs, .role-picker, .no-print { display: none !important; }
  .print-only { display: block; }
  .top { border: 0; }
  .top-inner { display: block; min-height: 0; padding: 0; }
  .brand { font-size: 12pt; padding: 0 0 .5rem; }
  main { max-width: none; padding: 0; }
  a { color: #000; text-decoration: none; }
  .bed { padding-left: 0; margin-bottom: 1.25rem; }
  .bed::before, .bed::after { display: none; }
  .split { grid-template-columns: 1fr 1fr; gap: 0 1.5rem; }
  .card, .assignment, .stat, .table-wrap { background: #fff; border: 1px solid #999; box-shadow: none; break-inside: avoid; }
  .chip { border: 1px solid #666; background: #fff; color: #000; }
  .lesson, .people > li, .step { break-inside: avoid; }
  .table-wrap { overflow: visible; }
  .print-sheet h1 { font-size: 20pt; }
  .print-sheet .facts-list { grid-template-columns: 9rem 1fr; }
}

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; } }
/* Forced colours (Windows contrast themes): box-shadows and backgrounds vanish, so anything that
   relied on them gets a real border. A transparent border turns visible in this mode, which is why
   buttons carry one; padding gives back what the border takes, so nothing moves. */
@media (forced-colors: active) {
  .chip, .flash, .toast, .stat, .card, .persona-card { border: 1px solid CanvasText; }
  .bed::before { background: CanvasText; }
  .meter progress { border: 1px solid CanvasText; }
  button, .button { border: 2px solid transparent; padding: calc(.65rem - 2px) calc(1.15rem - 2px); }
  button.small, .button.small { padding: calc(.4rem - 2px) calc(.8rem - 2px); }
  button.secondary, .button.secondary { border: 1px solid ButtonText; padding: calc(.65rem - 1px) calc(1.15rem - 1px); }
  button.secondary.small, .button.secondary.small { padding: calc(.4rem - 1px) calc(.8rem - 1px); }
  button.link { border: 0; padding: 0; }
  .role-list button.link { padding: 0 .5rem; }
  .persona-card button { padding: calc(.5rem - 2px) calc(.9rem - 2px); }
  .chapter-links a { border: 1px solid ButtonText; padding: calc(.4rem - 1px) calc(1rem - 1px); }
  .role-picker a { border: 1px solid ButtonText; padding: calc(.45rem - 1px) calc(1rem - 1px); }
  /* Nav and tabs: the transparent edges would all show; the current page is underlined instead. */
  .nav-list a, .nav-list button.link, .tabs a { border-top: 0; border-bottom: 0; }
  .nav-list a[aria-current], .tabs a[aria-current] { text-decoration: underline; text-decoration-thickness: 3px; text-underline-offset: .3em; }
}

/* ==== Feature sections: each workstream appends below its own marker. Designer: don't edit below. ==== */
/* Terms and the team planner (term and classroom pages; the planner's own rules are in its section above) */
.privacy-note { margin-top: 1rem; padding: .8rem 1rem .8rem 3rem; max-width: 44rem; border-radius: var(--r-ctl); background: var(--field) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='none' stroke='%2316302B' stroke-width='1.7' stroke-linejoin='round'%3E%3Crect x='4' y='9' width='12' height='8' rx='1.5'/%3E%3Cpath d='M7 9V6.5a3 3 0 0 1 6 0V9'/%3E%3C/svg%3E") no-repeat 1rem .95rem / 1.2rem; }
.privacy-note p { margin: 0; font-size: var(--t-sm); }
.privacy-note p + p { margin-top: .4rem; color: var(--ink-soft); }

.term-class.is-plan { border-left-style: dashed; border-left-color: var(--edge); }

.card-chips { display: flex; flex-wrap: wrap; gap: .3rem; margin: 0; }
.card-chips .chip { margin-top: 0; }
.card-flash { margin: .25rem 0 .75rem; font-size: var(--t-sm); padding: .5rem .75rem; }

.pencil-chip { background: var(--paper); box-shadow: inset 0 0 0 1px var(--edge); }
.pencil-chip::before { content: ""; width: .8rem; height: .8rem; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%233D4B55' stroke-width='1.5' stroke-linejoin='round'%3E%3Cpath d='M3 13l.6-2.8L11 2.8l2.2 2.2-7.4 7.4z'/%3E%3Cpath d='M9.6 4.2l2.2 2.2'/%3E%3C/svg%3E") center / contain no-repeat; }

/* "Choose a driver" (/series/N/driver): one full-width button per person, the reason chip at its end */
.driver-choose { list-style: none; margin: .5rem 0 0; padding: 0; display: grid; gap: .45rem; max-width: 34rem; }
.driver-choose button { width: 100%; min-height: 48px; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .3rem .6rem; text-align: left; }
.driver-choose .chip { font-size: var(--t-sm); }
.driver-chips { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: .3rem; margin-inline-start: auto; }

.people-table th[scope=row] { min-width: 10rem; }
.people-table th[scope=row] .sub { display: block; font-weight: 400; font-size: var(--t-sm); }
.choices { margin: 0; padding-left: 1.2rem; min-width: 15rem; }
.people-table td:nth-child(5), .people-table td:nth-child(6) { min-width: 5rem; }   /* Leads, Drives */
.on-team { display: block; font-size: var(--t-sm); }
.over { color: var(--danger-ink); font-weight: 700; }
.clear-cell { min-width: 12rem; max-width: 20rem; }
.clear-cell .chip { margin: 0 .2rem .25rem 0; }
.clear-count, .clear-needs { display: block; margin-bottom: .25rem; }
.clear-needs { font-size: var(--t-sm); color: var(--ink-soft); }
.how { margin-top: 1rem; max-width: 44rem; }
.how > summary { cursor: pointer; min-height: 44px; display: flex; align-items: center; font-weight: 650; color: var(--sprout-deep); }

/* Terms list and term page */
.term-cards .card h3 a { color: var(--ink); }
.term-dates, .series-grid { display: grid; gap: 0 1rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 11rem), 1fr)); }
.term-form, .series-form { max-width: 40rem; }
.field.check { display: flex; align-items: center; gap: .6rem; }
.field.check input { width: 1.4rem; height: 1.4rem; margin: 0; accent-color: var(--sprout); }
.field.check label { margin: 0; }
.term-steps .chip { margin-right: .25rem; }
.term-steps .sub { margin: .2rem 0 0; }
.term-split > * { min-width: 0; }
.term-classes { list-style: none; margin: 1rem 0 0; padding: 0; display: grid; gap: .6rem; }
.term-class { padding: .75rem .9rem; border-radius: var(--r-ctl); background: var(--field); border-left: 4px solid var(--sprout); }
.term-class.is-warn { border-left-color: var(--fill-warn); }
.term-class.is-danger { border-left-color: var(--fill-danger); }
.term-class p { margin: 0 0 .3rem; }
.tc-head a { font-weight: 700; }
.tc-head .sub { display: block; }
.tc-when, .tc-team { font-size: var(--t-sm); }
.teacher-form { margin-top: .35rem; }
.teacher-form select { width: auto; font-size: var(--t-sm); }

/* One classroom's term */
.series-lessons { list-style: none; margin: 1rem 0 0; padding: 0; }
.series-lesson { padding: .8rem 0; border-bottom: 1px solid var(--line); }
.series-lessons > .series-lesson:first-child { border-top: 1px solid var(--line); }
.series-lesson p { margin: 0 0 .25rem; }
.sl-when { font-weight: 700; }
.sl-what .sub { display: block; }
.series-lesson.is-cancelled .sl-what a { text-decoration: line-through; color: var(--ink-soft); }
.lesson-cancel { margin-top: .4rem; }
.lesson-cancel > summary { cursor: pointer; min-height: 44px; display: inline-flex; align-items: center; color: var(--danger-ink); font-weight: 650; }
.lesson-cancel form { padding: .75rem .9rem; border-radius: var(--r-ctl); background: var(--danger-bg); }
.lesson-cancel form p { font-size: var(--t-sm); }
.makeup-form { margin: .5rem 0 0; }
.makeup-form .hint { flex-basis: 100%; margin: 0; }

/* Home: the 48-hour staffing alert and the term panel */
.short-alert { margin: 0 0 1.25rem; padding: .85rem 1rem; border-radius: var(--r-ctl); background: var(--danger-bg); border-left: 4px solid var(--fill-danger); max-width: 44rem; }
.short-title { font-weight: 750; margin-bottom: .4rem; }
.short-alert ul { margin: 0 0 .4rem; padding-left: 1.1rem; }
.short-alert li { margin-bottom: .35rem; }
.short-alert .short-actions { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: .35rem; }
.tell-pm { margin: .25rem 0 1rem; }
.short-alert .hint { margin: 0; color: var(--ink); }
.term-due { margin: 0 0 1rem; padding-left: 1.1rem; }
.next-term { margin-top: 1rem; padding: .9rem 1rem; border-radius: var(--r-card); background: var(--field); max-width: 36rem; }
.next-term p:last-child { margin-bottom: 0; }

@media print { .privacy-note, .plan-place, .seat-add { display: none !important; } }
@media (forced-colors: active) { .seat-add { border: 2px dashed CanvasText; } }

/* - */

/* Subs */
/* Sub swaps. The one bold thing is the date tag on each offer: a seed-packet stub with a punched
   hole, so "which day" reads before anything else on a phone. Its colour follows the verdict,
   which is always also written in a chip. */
.subs-offers { list-style: none; margin: .75rem 0 1rem; padding: 0; display: grid; gap: .75rem; }
@media (min-width: 52rem) { .bed > .subs-offers { grid-template-columns: 1fr 1fr; } }
.subs-offer { display: grid; grid-template-columns: auto 1fr; gap: 0 1rem; align-items: start; padding: 1rem 1.1rem; background: var(--paper); border: 1px solid var(--line); border-radius: var(--r-card); }
.subs-offer p { margin: 0 0 .3rem; }
.subs-stub { display: flex; flex-direction: column; align-items: center; width: 3.6rem; padding: .5rem 0 .55rem; border-radius: var(--r-ctl); font: 700 var(--t-sm)/1.15 var(--round); background: var(--muted-bg); color: var(--muted-ink); }
.subs-stub::before { content: ""; width: .45rem; height: .45rem; margin-bottom: .35rem; border-radius: var(--r-pill); background: var(--paper); box-shadow: inset 0 1px 1px rgba(22, 48, 43, .35); }
.subs-stub strong { font-size: var(--t-2xl); line-height: 1.05; font-weight: 800; letter-spacing: -.02em; }
.subs-offer.is-ok .subs-stub { background: var(--sprout-deep); color: var(--paper); }       /* 7.9:1 */
.subs-offer.is-ok { border-color: var(--sprout); box-shadow: inset 0 0 0 1px var(--sprout); }
.subs-offer.is-warn .subs-stub { background: var(--warn-bg); color: var(--warn-ink); }
.subs-offer.is-danger .subs-stub { background: var(--danger-bg); color: var(--danger-ink); }
.subs-offer.is-info .subs-stub { background: var(--info-bg); color: var(--info-ink); }
.subs-body { min-width: 0; }
.subs-offer.is-focus { box-shadow: 0 0 0 3px var(--info-ink), inset 0 0 0 1px var(--line); }   /* "From your notification": a pointer, not a verdict (the stub and chip carry that) */
.subs-focus { font-size: var(--t-sm); font-weight: 700; color: var(--ink-soft); }
.subs-title { margin: 0 0 .15rem; font-size: var(--t-lg); }
.subs-when { font-weight: 700; }
.subs-where, .subs-why { color: var(--ink-soft); }
.subs-why { font-size: var(--t-sm); }
.subs-verdict { display: flex; flex-wrap: wrap; align-items: center; gap: .35rem .5rem; margin: .6rem 0 .3rem !important; }
.subs-note { font-size: var(--t-sm); }
.subs-act { margin-top: .75rem; }
.subs-act .hint { margin: .4rem 0 0; }
.subs-history { list-style: none; margin: .5rem 0 0; padding: 0; }
.subs-history li { display: flex; flex-wrap: wrap; align-items: baseline; gap: .25rem .6rem; padding: .6rem 0; border-bottom: 1px solid var(--line); }
@media (max-width: 30rem) {
  .subs-offer { gap: 0 .75rem; padding: .9rem; }
  .subs-stub { width: 3.1rem; }
  .subs-stub strong { font-size: var(--t-xl); }
  .subs-act button { width: 100%; }
}

/* My lessons: the team, materials, the sheet, and "I can't make it" as a two-step disclosure
   (nothing happens until "Find me a sub" is pressed, so a stray tap never gives away a lesson). */
.assignment.is-off .when { color: var(--ink-soft); }
.subs-team { list-style: none; margin: .1rem 0 .5rem; padding: 0; display: flex; flex-wrap: wrap; gap: .35rem 1rem; }
.subs-team li { font-weight: 600; }
.subs-team .chip { font-size: var(--t-sm); padding: .1rem .45rem; }
.subs-facts { display: flex; flex-wrap: wrap; align-items: center; gap: 0 1rem; margin: .2rem 0 0 !important; }
.subs-facts a { display: inline-flex; align-items: center; min-height: 44px; font-weight: 600; }
.respond .subs-ask { flex: 1 1 100%; }
.subs-ask summary { list-style: none; display: inline-flex; align-items: center; gap: .45rem; min-height: 44px; padding: .65rem 1.15rem; border-radius: var(--r-ctl); background: var(--paper); color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--edge); font-weight: 650; cursor: pointer; }
.subs-ask summary::-webkit-details-marker { display: none; }
.subs-ask summary::after { content: "\25BE" / ""; font-size: .85em; transition: transform .15s ease; }
.subs-ask[open] summary::after { transform: rotate(180deg); }
.subs-ask summary:hover { background: var(--field); box-shadow: inset 0 0 0 2px var(--ink); }
.subs-ask-body { margin-top: .6rem; padding: .9rem 1rem 1rem; background: var(--paper); border: 1.5px solid var(--edge); border-radius: var(--r-ctl); max-width: 36rem; }
.subs-ask-body p { margin: 0 0 .75rem; }
.subs-ask-body form { margin: 0; }
@media (max-width: 30rem) { .subs-ask-body button { width: 100%; } }
@media (forced-colors: active) { .subs-ask summary { border: 1px solid ButtonText; padding: calc(.65rem - 1px) calc(1.15rem - 1px); } }

/* Notifications: newest first; unread ones carry a stem mark and say "Unread" to screen readers. */
.notifs { list-style: none; margin: .5rem 0 0; padding: 0; }
.notif { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem 1rem; padding: .7rem 0; border-bottom: 1px solid var(--line); }
.notif.is-unread { padding-left: .9rem; box-shadow: inset 4px 0 0 var(--sprout); }
.notif-main { flex: 1 1 16rem; min-width: 0; }
.notif-title { margin: 0; font-weight: 600; }
.notif-open { margin: 0; }
.notif-open button.link { display: block; min-height: 44px; padding: .55rem 0; text-align: left; font-weight: 650; line-height: 1.35; }
.notif-meta { display: flex; flex-wrap: wrap; align-items: center; gap: .25rem .5rem; margin: .1rem 0 0; }
@media print { .subs-stub::before { display: none; } }

/* - */

/* Invitations, profile, onboarding */
/* Welcome path: seed, sprout, leaf. The one bold element of the join flow; a real sequence. */
.join-path { list-style: none; margin: 0 0 1.75rem; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 .5rem; }
.join-step { position: relative; display: grid; align-content: start; justify-items: start; gap: .4rem; }
.join-step::after { content: ""; position: absolute; top: 1.2rem; left: 2.9rem; right: .1rem; height: 3px; border-radius: var(--r-pill); background: var(--line); }
.join-step:last-child::after { display: none; }
.join-step.is-done::after { background: var(--sprout); }
.join-mark { width: 2.4rem; height: 2.4rem; border-radius: var(--r-pill); background: var(--paper) no-repeat center / 1.45rem; box-shadow: inset 0 0 0 2px var(--line); }
.step-1 .join-mark { background-image: var(--svg-seedling); background-size: 1.9rem; }
.step-2 .join-mark { background-image: var(--svg-sprout); }
.step-3 .join-mark { background-image: var(--svg-leaf); }
.join-path:not(.is-preview) .join-step:not(.is-done):not(.is-current) .join-mark { filter: grayscale(1); opacity: .6; }
.join-path.is-preview .join-mark { background-color: var(--leaf); }
.join-step.is-done .join-mark { background-color: var(--leaf); box-shadow: inset 0 0 0 2px var(--sprout); }
.join-step.is-current .join-mark { background-color: var(--leaf); box-shadow: inset 0 0 0 2.5px var(--sprout), 0 0 0 5px var(--leaf); }
.join-label { font: 700 var(--t-md)/1.25 var(--round); color: var(--ink-soft); }
.join-step.is-current .join-label, .join-step.is-done .join-label { color: var(--ink); }
.join-text { color: var(--ink-soft); font-size: var(--t-sm); line-height: 1.4; }
.join-path:not(.has-text) .join-step.is-current .join-label { text-decoration: underline 3px var(--sprout); text-underline-offset: .3em; }
/* With descriptions (the invitation page): a vertical stem on phones, three columns from 40rem. */
.join-path.has-text { grid-template-columns: 1fr; margin: .75rem 0 1.5rem; }
.join-path.has-text .join-step { grid-template-columns: 2.4rem 1fr; column-gap: .85rem; padding-bottom: 1.1rem; }
.join-path.has-text .join-mark { grid-row: span 2; }
.join-path.has-text .join-label { color: var(--ink); align-self: end; }
.join-path.has-text .join-step::after { top: 2.6rem; bottom: .2rem; left: 1.1rem; right: auto; width: 3px; height: auto; }
@media (min-width: 40rem) {
  .join-path.has-text { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 1rem; }
  .join-path.has-text .join-step { grid-template-columns: 1fr; padding-bottom: 0; }
  .join-path.has-text .join-mark { grid-row: auto; }
  .join-path.has-text .join-step::after { top: 1.2rem; bottom: auto; left: 2.9rem; right: .1rem; width: auto; height: 3px; }
}

/* The invitation page */
.auth.join { max-width: 40rem; }
.join-hello { font: 700 var(--t-lg)/1.3 var(--round); color: var(--sprout-deep); margin-bottom: .35rem; }
.join h1 { font-size: var(--t-2xl); }
.join-next { font-size: var(--t-lg); margin-top: 1.75rem; }
.join-accept { border-color: var(--sprout); box-shadow: inset 4px 0 0 var(--sprout); }
.join-accept button { width: 100%; font-size: var(--t-md); min-height: 52px; }
.join-accept .sub { margin: .75rem 0 0; }
.join-accept.is-blocked { border-color: var(--line); box-shadow: inset 4px 0 0 var(--fill-warn); }
.join-accept.is-blocked button { width: auto; font-size: var(--t-md); min-height: 44px; }
.join-help { padding-left: 1.2rem; }
.join-help li { margin-bottom: .4rem; }

/* Forms shared by profile, scheduling form and checklist */
.narrow-form { max-width: 36rem; }
.field-group { border: 0; margin: 0 0 1.75rem; padding: 0; min-width: 0; }
.field-group > legend { font: 700 var(--t-lg)/1.3 var(--round); padding: 0; margin-bottom: .5rem; }
.field-label { font-weight: 600; margin: .5rem 0 .25rem; }
.tick { display: grid; grid-template-columns: 1.4rem 1fr; column-gap: .65rem; align-items: start; margin: .6rem 0; }
.tick input { width: 1.4rem; height: 1.4rem; margin: .7rem 0 0; accent-color: var(--sprout); }
.tick label { margin: 0; min-height: 44px; display: flex; align-items: center; }
.tick .hint { grid-column: 2; margin: -.3rem 0 0; }
.choice-row { display: flex; flex-wrap: wrap; gap: 0 1.5rem; }
.choice-row .tick { margin: .2rem 0; }

/* Invitations */
.join-form { max-width: 36rem; }
.invite-list, .invite-mini, .verify-list, .gap-list, .req-list, .school-list, .slot-list { list-style: none; margin: 0; padding: 0; }
.invite { padding: .85rem 0; border-bottom: 1px solid var(--line); }
.invite-list > .invite:first-child { border-top: 1px solid var(--line); }
.invite p { margin: 0 0 .25rem; }
.invite-who .who { font-weight: 650; margin-right: .25rem; }
.invite-actions { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .5rem; }
.invite-mini li { padding: .3rem 0; }
.invite-mini .who { font-weight: 650; }

/* Scheduling form: one row per class time, choice on the right (below on phones) */
.slot-list { display: grid; gap: .5rem; margin: .75rem 0 1rem; }
.slot-pick { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .5rem 1rem; padding: .8rem 1rem; border: 1px solid var(--line); border-radius: var(--r-card); background: var(--paper); }
.slot-pick.is-picked { border-color: var(--sprout); box-shadow: inset 4px 0 0 var(--sprout); background: #FAFDFB; }
.slot-what { flex: 1 1 16rem; }
.slot-what p { margin: 0; }
.slot-when { font: 700 var(--t-md)/1.3 var(--round); }
.slot-where { color: var(--ink-soft); }
.slot-what .chip { margin-top: .35rem; }
.slot-rank { flex: 0 1 12rem; }
.slot-rank label { margin: 0 0 .2rem; font-size: var(--t-sm); }
.avail-withdraw p { margin: 0 0 .6rem; }
@media (max-width: 30rem) { .slot-rank { flex-basis: 100%; } }
.slot-fit { margin: .35rem 0 0; }
.slot-fit[hidden] { display: none; }

/* When you're free (views/ui/free_week.php): the usual week. Days across, 30-minute blocks down; a free block is
   filled, and a run of them reads as one bar (the lines between blocks are the block's own top edge, which takes the
   fill's colour). Five days and the time column fit a 360 px phone; every block is at least 44 px tall. */
.fw { width: 100%; max-width: 40rem; table-layout: fixed; border-collapse: separate; border-spacing: 3px 0; margin: 0 0 0 -3px; }
.fw th, .fw td { padding: 0; border: 0; background: none; }
.fw thead th { padding: 0 0 .35rem; font: 650 var(--t-sm)/1.2 var(--round); color: var(--ink-soft); text-align: center; }
.fw abbr { text-decoration: none; }
.fw-corner { width: 3rem; }
.fw tbody th { position: relative; font-size: var(--t-sm); font-weight: 600; color: var(--ink-soft); text-align: right; white-space: nowrap; }
.fw tbody th > :not(.visually-hidden) { position: absolute; top: -.6em; right: .4rem; line-height: 1.2; }
.fw tbody tr.fw-on-hour th { vertical-align: top; }
.fw-cb { position: absolute; width: 1px; height: 1px; opacity: 0; margin: 0; }
.fw-b { display: block; height: 44px; margin: 0; border-top: 1px dashed var(--line); background: var(--field); cursor: pointer; }
.fw-on-hour .fw-b { border-top: 1px solid var(--edge); }
.fw tbody tr:last-child .fw-b { border-bottom: 1px solid var(--edge); height: 43px; }
@media (hover: hover) { .fw-b:hover { background: var(--leaf); } }   /* not on a phone: a tapped block would stay tinted */
.fw-cb:checked + .fw-b { background: var(--sprout); border-top-color: var(--sprout); }
@media (hover: hover) { .fw-cb:checked + .fw-b:hover { background: var(--sprout-deep); border-top-color: var(--sprout-deep); } }
.fw-cb:focus-visible + .fw-b { outline: 3px solid var(--ink); outline-offset: -3px; }
.fw-actions { margin-top: 1rem; }
.term-form { margin-top: 2.5rem; }
@media (forced-colors: active) {
  .fw-b { border: 1px solid CanvasText; }
  .fw-cb:checked + .fw-b { forced-color-adjust: none; background: Highlight; border-color: Highlight; }
}

/* My onboarding: schools first, then the steps */
.school-list { display: grid; gap: .6rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 15rem), 1fr)); margin: 1rem 0 .5rem; }
.school-card { padding: .85rem 1rem; border-radius: var(--r-card); background: var(--field); border-left: 4px solid var(--fill-ok); }
.school-card.is-blocked { background: var(--paper); border: 1px solid var(--line); border-left: 4px solid var(--fill-danger); }
.school-card p { margin: 0 0 .25rem; }
.school-name { font: 700 var(--t-md)/1.3 var(--round); }
.school-card .school-missing { margin-top: .4rem; font-size: var(--t-md); }
.clear-group { margin-top: 2rem; }
/* Before the checklist: the profile still to fill in (needs your action, so the warn edge). */
.profile-first { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem 1rem; margin: 0 0 1.5rem; padding: .75rem 1rem; background: var(--warn-bg); border-left: 4px solid var(--fill-warn); border-radius: 0 var(--r-ctl) var(--r-ctl) 0; }
.profile-first p { margin: 0; flex: 1 1 18rem; }
.step-how { color: var(--ink); font-size: var(--t-md); max-width: 60ch; }
.step-warn { color: var(--warn-ink); font-weight: 600; }
/* 0034: a mandated reporter step's certificate, sent from the step itself. */
.cert-form { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem .75rem; margin: .6rem 0 0; }
.cert-form label { flex-basis: 100%; font-size: var(--t-sm); font-weight: 600; }
.cert-form input[type=file] { min-width: 0; max-width: 100%; min-height: 44px; font-size: var(--t-md); }
.cert-form .hint { flex-basis: 100%; margin: 0; }
/* 0039: notes, photos and PDFs on a step (views/ui/step_files.php, views/ui/attach_form.php). Plain components: the
   page around them places them. */
.step-files { list-style: none; margin: .5rem 0 0; padding: 0; display: grid; gap: .5rem; }
.step-file { display: flex; gap: .65rem; align-items: flex-start; }
.step-file-thumb { flex: none; display: block; width: 72px; height: 72px; border-radius: var(--r-ctl); overflow: hidden; background: var(--line); }
.step-file-thumb img { display: block; width: 72px; height: 72px; object-fit: cover; }
.step-file-pdf { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 72px; height: 72px; border: 1px solid var(--line); border-radius: var(--r-ctl); font-weight: 600; }
.step-file-text { min-width: 0; }
.step-file-text p { margin: 0; }
.step-file-note { max-width: 60ch; overflow-wrap: anywhere; white-space: pre-line; }
.step-file-text form { margin: .15rem 0 0; }
details.attach { margin: .4rem 0 0; }
details.attach summary { display: inline-flex; align-items: center; min-height: 44px; color: var(--sprout); text-decoration: underline; cursor: pointer; }
.attach-form { display: grid; gap: .35rem; margin: .25rem 0 0; max-width: 26rem; }
.attach-form label { font-weight: 600; }
.attach-form .hint { margin: 0; }
.attach-form input[type=file] { min-width: 0; max-width: 100%; min-height: 44px; font-size: var(--t-md); }
.attach-do { display: flex; flex-wrap: wrap; gap: .5rem; margin: .25rem 0 0; }
.welcome-done { margin: 1rem 0 3rem; padding: 1.25rem 1.35rem; border-radius: var(--r-card); background: var(--leaf); }
.welcome-done h2 { font-size: var(--t-xl); }

/* Who needs clearing and the volunteer page (ws/obdesign; views/onboarding_chapter.php, views/ui/clear_steps.php): a card per person,
   a row per step with its own one-press button. Two columns of cards from 64rem (each 34rem at least), one on a phone. */
/* The head stays short, so a phone opened from "Check 3 steps" shows the first button on its first screen (crawl, round 3). */
.cl-page-head { margin-bottom: 1.25rem; }
.cl-page-head .lede { font-size: var(--t-md); }
.cl-bar { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem 1.5rem; margin: 0 0 1.25rem; }
.cl-pills { margin: 0; }
.cl-pills .tab-short { display: none; }
.cl-find { display: flex; gap: .5rem; margin: 0 0 0 auto; flex: 0 1 22rem; }
.cl-find input[type=search] { flex: 1 1 auto; min-width: 0; }
@media (max-width: 30rem) { .cl-find { flex-basis: 100%; margin: 0; } .cl-bar { gap: .6rem; } .tv-chips.cl-pills { gap: .4rem; } .tv-chips.cl-pills a { padding: 0 .7rem; } .cl-pills .tab-long { display: none; } .cl-pills .tab-short { display: inline; } }
.cl-n { margin-inline-start: .4rem; font-variant-numeric: tabular-nums; }
.cl-group { margin: 1.5rem 0 .75rem; }
.cl-bar + .cl-group, .cl-bar + .answer + .cl-group { margin-top: 0; }
.cl-people { list-style: none; margin: 0 0 1.5rem; padding: 0; display: grid; gap: 1rem; align-items: start; grid-template-columns: repeat(auto-fill, minmax(min(100%, 34rem), 1fr)); }
.cl-person { margin: 0; background: var(--paper); border: 1px solid var(--line); border-radius: var(--r-card); padding: .75rem 1rem .25rem; scroll-margin-top: 1rem; }
.cl-person:target { border-color: var(--sprout); box-shadow: 0 0 0 1px var(--sprout); }
.cl-head { padding-bottom: .6rem; border-bottom: 1px solid var(--line); }
.cl-head h3 { margin: 0; font-size: var(--t-lg); line-height: 1.3; }
.cl-head h3 a { color: var(--ink); text-decoration-color: var(--line); }
.cl-head h3 a:hover { text-decoration-color: currentColor; }
.cl-role { display: block; font: 400 var(--t-sm)/1.4 var(--body); color: var(--ink-soft); }
.cl-steps { list-style: none; margin: 0; padding: 0; }
.cl-step { position: relative; margin: 0; padding: .55rem 0; border-bottom: 1px solid var(--line); scroll-margin-top: 1rem; }
.cl-steps > .cl-step:last-child { border-bottom: 0; }
.cl-step:target { background: var(--leaf); box-shadow: 0 0 0 .5rem var(--leaf); border-radius: 1px; }
.cl-step > .row { margin: 0; }
.cl-name { display: block; font-weight: 600; overflow-wrap: anywhere; }
.cl-step.is-done .cl-name { font-weight: 500; }
.cl-facts { display: block; margin-top: .1rem; font-size: var(--t-sm); color: var(--ink-soft); overflow-wrap: anywhere; }
.cl-done { border-top: 1px solid var(--line); }
.cl-head + .cl-done { border-top: 0; }
.cl-done > summary { display: flex; align-items: center; min-height: 44px; cursor: pointer; font-size: var(--t-sm); font-weight: 650; color: var(--sprout-deep); }
/* The trailing slot is three columns with one width each (DESIGN.md "Alignment" 6): chip, press, More. A row without a press or a
   "More" keeps the empty slot, so every chip and every "Mark done" lines up down the card. On a phone the slots shrink to their content. */
.cl-press { min-width: 7.75rem; display: inline-flex; justify-content: flex-end; }
.cl-more-slot { min-width: 3.25rem; display: inline-flex; justify-content: flex-end; }
.cl-press:empty, .cl-more-slot:empty { visibility: hidden; }
@media (max-width: 30rem) { .cl-press, .cl-more-slot { min-width: 0; } .cl-press:empty, .cl-more-slot:empty { display: none; } }
/* "More" opens a small panel over the rows below (send back, waive, a photo or note), so opening it moves nothing. */
details.cl-more > summary { list-style: none; display: inline-flex; align-items: center; min-height: 44px; padding: 0 .5rem; font-size: var(--t-sm); font-weight: 650; color: var(--sprout); text-decoration: underline; text-underline-offset: .18em; cursor: pointer; }
details.cl-more > summary::-webkit-details-marker { display: none; }
details.cl-more[open] > summary { color: var(--ink); }
.cl-more-panel { position: absolute; z-index: 4; top: calc(100% - .25rem); right: 0; width: min(24rem, 100%); display: grid; padding: .25rem .75rem; text-align: left;
  background: var(--paper); border: 1px solid var(--edge); border-radius: var(--r-ctl); box-shadow: 0 8px 24px rgb(22 48 43 / .18); }
/* Three folded actions, one per line: Add a note or photo, Send back, Waive. Opening one shows its form in place, in the panel. */
details.cl-more .cl-more-panel > details, details.cl-more .cl-more-panel > details[open] { display: block; margin: 0; padding: 0; border-top: 1px solid var(--line); background: none; }
details.cl-more .cl-more-panel > details:first-child, details.cl-more .cl-more-panel > .cl-about + details { border-top: 0; }
details.cl-more .cl-more-panel > details > summary { display: flex; align-items: center; min-height: 44px; padding: 0; color: var(--sprout); font-weight: 600; text-decoration: underline; cursor: pointer; }
details.cl-more .cl-more-panel > details[open] { padding-bottom: .75rem; }
.cl-more-panel .send-back-form, .cl-more-panel .attach-form { max-width: none; margin: 0; }
.cl-more-panel .send-back-form textarea, .cl-more-panel .attach-form textarea { max-width: none; min-height: 4.5rem; }
.cl-about { margin: .5rem 0; font-size: var(--t-sm); color: var(--ink); }
.cl-waive-form { display: grid; gap: .35rem; margin: 0; }
.cl-waive-form .hint { margin: 0; color: var(--ink); }
.cl-waive-form button, .cl-more-panel .send-back-form button { justify-self: start; }
/* 0039 on a step row (views/ui/step_files.php, $strip): small thumbnails and the newest note on one line under the step's facts. */
.step-strip { display: flex; align-items: center; gap: .4rem; margin-top: .35rem; min-width: 0; }
.step-strip-thumb, .step-strip-pdf { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; border-radius: var(--r-ctl); overflow: hidden; background: var(--line); }
.step-strip-thumb img { display: block; width: 44px; height: 44px; object-fit: cover; }
.step-strip-pdf { background: var(--paper); border: 1px solid var(--line); font-size: var(--t-sm); font-weight: 650; }
.step-strip-more { flex: none; font-size: var(--t-sm); font-weight: 650; color: var(--ink-soft); }
.step-strip-note { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: var(--t-sm); }
@media (max-width: 30rem) {
  .cl-person { padding-inline: .75rem; }
  .cl-more-panel { width: 100%; }
}
@media (forced-colors: active) { .cl-step:target { outline: 2px solid CanvasText; } .cl-person:target { outline: 2px solid CanvasText; } }
.gap-list { margin: .25rem 0 .75rem; }
.gap-list li { display: flex; flex-wrap: wrap; align-items: center; gap: .35rem .6rem; padding: .3rem 0; }
.gap-name { font-weight: 600; }
details.waive { display: inline-block; }
details.waive summary { display: inline-flex; align-items: center; min-height: 44px; padding: 0 .5rem; color: var(--sprout); text-decoration: underline; cursor: pointer; }
details.waive[open] { display: block; flex-basis: 100%; padding: .5rem .75rem .75rem; border-radius: var(--r-ctl); background: var(--danger-bg); }
details.waive .hint { color: var(--ink); margin: .25rem 0 .5rem; }

/* Chapter roles: removing a role is a disclosure with its consequence, then a small danger button. */
.team-roles .role-list li { padding: .1rem 0; }
.team-roles .role-name { min-height: 44px; display: inline-flex; align-items: center; }
details.role-remove > summary { display: inline-flex; align-items: center; min-height: 44px; padding: 0 .25rem; color: var(--sprout); text-decoration: underline; text-underline-offset: .18em; cursor: pointer; }
details.role-remove[open] { flex-basis: 100%; padding: .6rem .75rem .75rem; margin: .25rem 0 .5rem; border-radius: var(--r-ctl); background: var(--danger-bg); }
details.role-remove[open] > summary { min-height: 0; margin-bottom: .35rem; }
details.role-remove .hint { color: var(--ink); margin: 0 0 .6rem; }
details.role-remove form { margin: 0; }
.team-roles > li { scroll-margin-top: 1rem; }
.team-roles .card-flash { margin: .4rem 0; }

/* Checklist editor */
.req-rule { max-width: 44rem; padding: .85rem 1rem; margin: 0 0 2.5rem; border-left: 4px solid var(--sprout); background: var(--leaf); border-radius: 0 var(--r-ctl) var(--r-ctl) 0; }
.req { padding: .9rem 0; border-bottom: 1px solid var(--line); }
.req-list > .req:first-child { border-top: 1px solid var(--line); }
.req p { margin: 0 0 .3rem; }
.req-name { font-weight: 650; }
.req-edit > summary { display: inline-flex; align-items: center; min-height: 44px; color: var(--sprout); font-weight: 600; cursor: pointer; }
.req-edit[open] { padding: 0 0 .75rem; }
.req-grid { display: grid; gap: 0 1rem; }
@media (min-width: 44rem) { .req-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } .req-wide { grid-column: 1 / -1; } }

/* Home panels */
.signup-panel.is-open { padding: 1rem 1.15rem; margin: 1.5rem 0; border-radius: var(--r-card); background: var(--leaf); }
.signup-panel.is-open h3 { margin-top: 0; }
.signup-panel.is-open > :last-child { margin-bottom: 0; }
.own-onboarding.is-blocked { background: var(--warn-bg); }
.own-onboarding .meter { margin-top: 0; }
.own-onboarding > p:last-child { margin-bottom: 0; }
.own-onboarding a { margin-left: .25rem; }
/* The home page: the greeting, the first thing to do, and the person's pages as pills right under it. */
.home-pills { margin-top: 1rem; }
.page-head .home-first { margin-top: .75rem; }
.bed > h2 + .answer { margin-top: .35rem; }
/* My lessons: the next one is the big card; the rest are compact rows; lessons you're off, one line each. */
.my-next { margin-top: .75rem; background: var(--paper); border-color: var(--line); padding: 1.25rem 1.35rem; }
.my-next .when { font-size: var(--t-xl); }
.my-next .where { color: var(--ink); }
.my-later-h { margin: 1.75rem 0 .25rem; font-size: var(--t-md); }
.my-rows { list-style: none; margin: 0; padding: 0; }
.my-row { padding: .75rem 0; border-bottom: 1px solid var(--line); }
.my-row p { margin: 0; }
.my-row-what { display: flex; flex-wrap: wrap; align-items: baseline; gap: .1rem .6rem; }
.my-row-when { font-weight: 700; flex: 1 1 100%; }
.my-row-what a { font-weight: 600; }
.my-row .respond { margin-top: .4rem; }
.my-rows.is-off .my-row { padding: .4rem 0; color: var(--ink-soft); }
.my-rows.is-off .my-row-when { flex: 0 0 auto; font-weight: 600; }
.my-rows.is-off .respond { margin-top: .15rem; }
@media (max-width: 30rem) { .my-next { padding: 1rem 1.1rem; } .my-next .when { font-size: var(--t-lg); } }
/* After "I'll be there" and the like, home comes back to the lesson (#lesson-<id>): the message sits on it, a little below the top edge. */
.my-next .card-flash, .my-row .card-flash, .page-head .flash[id] { scroll-margin-top: 1rem; }
.my-next .card-flash { margin-top: 0; }
/* Many unanswered lessons in a term that hasn't started: one row, answer all at once or open it to answer each. */
.my-group-list { flex: 1 1 100%; }
.my-group-list > summary { list-style: none; cursor: pointer; display: inline-flex; align-items: center; gap: .35rem; min-height: 44px; color: var(--sprout-deep); font-weight: 650; }
.my-group-list > summary::-webkit-details-marker { display: none; }
.my-group-list > summary::after { content: "\25BE" / ""; font-size: .85em; transition: transform .15s ease; }
.my-group-list[open] > summary::after { transform: rotate(180deg); }
.my-group-list > .my-rows { margin: .25rem 0 0 .35rem; padding-left: .9rem; border-left: 3px solid var(--line); }
.my-group-list > .hint { margin: .5rem 0 0; }
/* Several chapters on one home: a line each, with a jump to it. */
.home-jump ul { list-style: none; margin: .75rem 0 0; padding: 0; }
.home-jump li { padding: .35rem 0; }
.home-jump a { font-weight: 700; }
.bed[aria-labelledby^="ch-"], h3[id^="my-"] { scroll-margin-top: 1rem; }
.signup-placed { margin: .35rem 0 .5rem; padding-left: 1.2rem; }
.av-sent { margin: .5rem 0 0; padding-left: 1.4rem; }
.av-sent li { padding: .2rem 0; }
/* The Community Manager's people tiles, and removing a teacher comment (a disclosure, then the button). */
.home-people { grid-template-columns: repeat(auto-fit, minmax(7.5rem, 1fr)); }
.home-feedback:focus { outline: none; }
.fb-remove { margin-top: .25rem; }
.fb-remove summary { display: inline-flex; align-items: center; min-height: 44px; cursor: pointer; color: var(--ink-soft); font-size: var(--t-sm); font-weight: 600; text-decoration: underline; }
.fb-remove form { margin: .25rem 0 .5rem; padding: .75rem .9rem; border-radius: var(--r-ctl); background: var(--danger-bg); max-width: 32rem; }
.fb-remove .hint { margin: 0 0 .5rem; color: var(--ink); }

/* - */

/* The week: packing, Lead meeting, debriefs */
/* The week: lessons by day, the MC's bags as luggage tags, the EL's agenda, the Lead's debrief. */
.week-nav { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: 1rem; }
.week-lessons, .bags, .bag-items, .week-flags, .debrief-due, .curriculum { list-style: none; margin: 0; padding: 0; }
.week-lesson { display: grid; gap: .1rem 1.25rem; padding: 1rem 0; border-bottom: 1px solid var(--line); }
.week-lessons > .week-lesson:first-child { border-top: 1px solid var(--line); }
@media (min-width: 40rem) { .week-lesson { grid-template-columns: 9.5rem minmax(0, 1fr); } .week-time { white-space: nowrap; } }
.week-time { margin: 0; font: 700 var(--t-md)/1.4 var(--round); font-variant-numeric: tabular-nums; }
.week-lesson h3 { margin: 0 0 .15rem; font-size: var(--t-lg); }
.week-lesson.is-cancelled h3 a { text-decoration: line-through; color: var(--ink-soft); }
.week-where { color: var(--ink-soft); margin-bottom: .6rem; }
.week-facts { display: grid; grid-template-columns: 6.5rem minmax(0, 1fr); gap: .35rem 1rem; margin: 0 0 .75rem; }
.week-facts dt { color: var(--ink-soft); }
.week-facts dd { margin: 0; display: flex; flex-wrap: wrap; align-items: center; gap: .35rem; }
.week-label { display: block; font-size: var(--t-sm); font-weight: 700; color: var(--ink-soft); }
.week-note { margin: .6rem 0; padding: .55rem .8rem; background: var(--field); border-left: 3px solid var(--leaf-2); border-radius: 0 var(--r-ctl) var(--r-ctl) 0; max-width: 60ch; }
.week-last { margin-top: .6rem; }
.week-last > p { margin: 0 0 .35rem; display: flex; flex-wrap: wrap; align-items: center; gap: .3rem .4rem; }
.week-last .week-label { display: inline; font-size: inherit; color: var(--ink); }
.week-last .week-quote { display: block; padding-left: .8rem; border-left: 3px solid var(--line); color: var(--ink); }
.week-last .week-quote .week-label { display: block; font-size: var(--t-sm); color: var(--ink-soft); }
.week-flags > li { display: flex; flex-wrap: wrap; align-items: center; gap: .3rem .6rem; padding: .6rem 0; border-bottom: 1px solid var(--line); }
.week-flags > li:first-child { border-top: 1px solid var(--line); }
.week-flag-where { font-weight: 650; }
.week-flags .sub { flex-basis: 100%; }

/* A bag is a luggage tag: a punched eyelet, a string, and the classroom written on it. Packed
   tags turn leaf green and say "Packed" in words. */
.bags { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 21rem), 1fr)); align-items: start; margin-top: .75rem; }
.bag > article { position: relative; padding: 1.1rem 1.1rem 1rem 2.4rem; background: var(--paper); border: 1.5px solid var(--edge); border-radius: var(--r-ctl) var(--r-card) var(--r-card) var(--r-ctl); }
.bag > article::before { content: ""; position: absolute; left: .75rem; top: 1.35rem; width: .9rem; height: .9rem; border-radius: var(--r-pill); background: var(--field); box-shadow: inset 0 0 0 2px var(--edge), 0 0 0 3px var(--paper), 0 0 0 4.5px var(--line); }
.bag > article::after { content: ""; position: absolute; left: 1.19rem; top: 2.25rem; bottom: 1rem; border-left: 2px dashed var(--line); }
.bag.is-packed > article { background: var(--leaf); border-color: var(--sprout); }
.bag.is-packed > article::before { background: var(--leaf); box-shadow: inset 0 0 0 2px var(--sprout), 0 0 0 3px var(--leaf), 0 0 0 4.5px var(--leaf-2); }
.bag-head h3 { margin: 0; font-size: var(--t-lg); }
.bag-meta { color: var(--ink-soft); font-size: var(--t-sm); margin: .15rem 0 .35rem; }
.bag-lesson { font: 750 var(--t-lg)/1.25 var(--round); color: var(--sprout-deep); margin: 0 0 .5rem; }
.bag-head .facts { margin: 0 0 .5rem; }
.bag-twin { background: var(--warn-bg); color: var(--ink); padding: .55rem .75rem; border-radius: var(--r-ctl); font-size: var(--t-sm); margin: .5rem 0; }
.bag-items { margin: .75rem 0 .5rem; border-top: 1px solid var(--line); }
.bag-items > li { display: grid; grid-template-columns: 6.5rem minmax(0, 1fr) auto; gap: .6rem; align-items: baseline; padding: .4rem 0; border-bottom: 1px solid var(--line); }
.bag-qty { font: 750 var(--t-lg)/1.15 var(--body); font-variant-numeric: tabular-nums; }
.bag-unit { font-size: var(--t-sm); font-weight: 600; }
.bag-item { overflow-wrap: anywhere; }
.bag-items .chip { font-size: var(--t-sm); }
.bag-empty { color: var(--ink-soft); margin: .75rem 0; }
.bag-action { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem .75rem; margin-top: .9rem; }
.bag-action .hint { margin: 0; flex: 1 1 12rem; }
.shopping { margin-top: 1rem; }
.shopping td.num { white-space: nowrap; }   /* "22 pieces" on one line */
@media (max-width: 29.99rem) {
  .bag > article { padding: 1rem .85rem .9rem 2.1rem; }
  .bag > article::before { left: .6rem; }
  .bag > article::after { left: 1.04rem; }
  .bag-items > li { grid-template-columns: 5.5rem minmax(0, 1fr); row-gap: .15rem; }
  .bag-items .chip { grid-column: 2; justify-self: start; }
}

/* The EL's agenda: one bed per Lead, one block per classroom. */
.lm-agenda { margin-top: 1.25rem; max-width: 44rem; }
.lm-agenda summary, .cu-materials summary { cursor: pointer; font-weight: 650; color: var(--sprout); min-height: 44px; display: flex; align-items: center; }
.lm-agenda ol { margin: .25rem 0 .75rem; padding-left: 1.4rem; }
.lm-class { padding: 1rem 0 1.25rem; border-top: 1px solid var(--line); }
.lm-class:first-of-type { border-top: 0; padding-top: .5rem; }
.lm-class h3 { margin: 0 0 .15rem; }
.lm-class h4 { margin: 1rem 0 .3rem; }
.lm-class .week-where .chip { margin-left: .15rem; }
.lm-adapt { max-width: 44rem; margin: .5rem 0 .75rem; }
.lm-preview > summary, .lm-adapt-box > summary, details.week-note > summary { cursor: pointer; min-height: 44px; display: flex; flex-wrap: wrap; align-items: center; gap: 0 .5rem; font-weight: 650; color: var(--sprout-deep); }
.lm-preview > summary .sub { font-weight: 400; }
.lm-preview > p { margin: .25rem 0 .5rem; max-width: 60ch; }
.lm-adapt-box { margin-top: .5rem; }
details.week-note > summary { min-height: 0; color: var(--ink-soft); font-weight: 500; }
details.week-note > summary .week-label { display: inline; }
details.week-note > summary::after { content: "Show" / ""; color: var(--sprout); font-weight: 650; text-decoration: underline; text-underline-offset: .18em; }
details.week-note[open] > summary::after { content: "Hide" / ""; }
details.week-note > p { margin: .35rem 0 0; }
.bag-nofood { margin: .75rem 0 0; padding: .5rem .75rem; border-radius: var(--r-ctl); background: var(--field); font-size: var(--t-sm); }
.bag .card-flash { margin: .25rem 0 .5rem; }
.lm-adapt label { margin-top: 0; }

/* The Lead's debrief: big, thumb-sized choices. */
.debrief { max-width: 40rem; }
.debrief-q { border: 0; margin: 0 0 1.5rem; padding: 0; min-width: 0; }
.debrief-q legend { font: 700 var(--t-lg)/1.3 var(--round); padding: 0; margin-bottom: .5rem; }
.debrief-choices { display: flex; flex-wrap: wrap; gap: .5rem; }
.debrief-choice { display: inline-flex; align-items: center; gap: .5rem; min-height: 44px; margin: 0; padding: .45rem 1rem .45rem .8rem; border-radius: var(--r-pill); background: var(--paper); box-shadow: inset 0 0 0 1.5px var(--edge); font-weight: 600; cursor: pointer; }
.debrief-choice:hover { background: var(--field); }
.debrief-choice:has(input:checked) { background: var(--leaf); box-shadow: inset 0 0 0 2.5px var(--sprout); }
.debrief-choice:has(input:focus-visible) { outline: 3px solid var(--ink); outline-offset: 2px; }
.debrief-choice input, .debrief-cell input { width: 1.2rem; height: 1.2rem; margin: 0; accent-color: var(--sprout); }
.debrief-cell { display: inline-flex; align-items: center; gap: .5rem; min-height: 44px; margin: 0; font-weight: 500; cursor: pointer; }
.debrief-attendance .table-wrap { margin-top: .5rem; }
.debrief-due > li { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: .5rem 1rem; padding: .75rem 0; border-bottom: 1px solid var(--line); }
.debrief-due > li:first-child { border-top: 1px solid var(--line); }
@media (forced-colors: active) { .debrief-choice { border: 1px solid CanvasText; padding: calc(.45rem - 1px) calc(1rem - 1px) calc(.45rem - 1px) calc(.8rem - 1px); } }

.curriculum .bed { margin-bottom: 2.25rem; }
.cu-materials .bag-items { max-width: 36rem; }

@media print {
  .bags { grid-template-columns: 1fr 1fr; gap: .5rem; }
  .bag > article { break-inside: avoid; border: 1px solid #666; background: #fff; }
  .bag > article::after { display: none; }
  .bag-twin { border: 1px solid #666; background: #fff; }
  .week-note { background: #fff; }
  .lm-class { break-inside: avoid; }
  .lm-agenda { display: none; }
  .bed > h2 { break-after: avoid; }   /* a day heading never sits alone at the foot of a page */
}

/* - */

/* Lesson page, classroom sheet, teacher feedback */
/* Lesson page: the "ticket" answers when / where / how to get in, readable in a parking lot. */
.lesson-ticket { margin-top: 1.25rem; padding: 1rem 1.15rem 1.1rem; background: var(--field); border-radius: var(--r-card); border-left: 4px solid var(--sprout); max-width: 44rem; }
.lesson-ticket p { margin: 0 0 .35rem; }
.lesson-ticket > :last-child { margin-bottom: 0; }
.ticket-when { font: 750 var(--t-xl)/1.25 var(--round); color: var(--ink); }
.ticket-where { font-weight: 700; font-size: var(--t-lg); }
.ticket-address, .ticket-office { color: var(--ink-soft); }
.ticket-arrive { padding-top: .5rem; margin-top: .5rem !important; border-top: 1px solid var(--line); }   /* a divider, not an accent */
.ticket-actions { margin-top: .75rem !important; }
.ticket-actions .hint { display: block; margin: .3rem 0 0; }
.lesson-short { padding: .6rem .8rem; border-radius: var(--r-ctl); background: var(--warn-bg); max-width: 44rem; }
.lesson-ticket.is-cancelled { border-left-color: var(--fill-danger); }
.lesson-ticket.is-cancelled .ticket-when { text-decoration: line-through; color: var(--ink-soft); }
.ticket-cancelled { font-weight: 650; }
.people > li.is-out .who { color: var(--ink-soft); }
.lesson-adapt { margin: 1rem 0 0; padding: .85rem 1rem; background: var(--leaf); border-radius: var(--r-ctl); }
.lesson-adapt h3 { margin: 0 0 .4rem; font-size: var(--t-md); }
.lesson-adapt blockquote { border-left-color: var(--sprout); }
.lesson-materials th[scope=row] { font-weight: 600; }
.lesson-materials td.num { white-space: nowrap; }
.lesson-ask { margin-top: 1.25rem; }
.lesson-ask h3 { margin-top: 0; }

/* Classroom Information Sheet: the emergency box leads, then two columns of facts. */
.sheet-emergency { margin: 0 0 2.5rem; padding: 1.1rem 1.25rem .9rem; border: 2px solid var(--fill-danger); border-radius: var(--r-card); background: var(--danger-bg); }
.sheet-emergency h2 { color: var(--danger-ink); margin-bottom: .75rem; }
.sheet-emergency .facts-list { grid-template-columns: 9.5rem 1fr; margin-bottom: .9rem; }
.sheet-emergency .facts-list dt { color: var(--ink); font-weight: 650; }
.sheet-rules { margin: 0 0 .75rem; padding-left: 1.2rem; }
.sheet-emergency:has(+ .sheet-about) { margin-bottom: .6rem; }
.sheet-about { margin: 0 0 2.5rem; }
.sheet-about .hint { margin: .3rem 0 0; }
.sheet-office { font-size: var(--t-lg); font-weight: 800; }
.sheet-rules li { margin: .2rem 0; }
.sheet-lessons { list-style: none; padding: 0; margin: .5rem 0 0; }
.sheet-lessons li { display: flex; flex-wrap: wrap; gap: .1rem .75rem; align-items: baseline; padding: .45rem 0; border-bottom: 1px solid var(--line); }
.sheet-date { font-weight: 700; min-width: 7rem; }
.sheet-lessons li.is-cancelled a { text-decoration: line-through; color: var(--ink-soft); }
@media (max-width: 30rem) { .sheet-emergency .facts-list, .class-sheet .facts-list { grid-template-columns: 1fr; gap: 0 1rem; } .class-sheet .facts-list dd { margin-bottom: .5rem; } }
@media print {
  .sheet-emergency { background: #fff; border: 2px solid #000; padding: .5rem .75rem; margin-bottom: .75rem; break-inside: avoid; }
  .sheet-emergency h2, .class-sheet h2 { font-size: 13pt; margin-bottom: .25rem; }
  .class-sheet .page-head { margin-bottom: .75rem; }
  .class-sheet .facts-list { gap: .1rem .75rem; margin-bottom: .5rem; }
  .class-sheet .people > li, .sheet-lessons li { padding: .15rem 0; }
  .class-sheet .answer { font-size: 11pt; margin-bottom: .1rem; }
  .class-sheet .bed { margin-bottom: .5rem; }
  .sheet-printed { font-size: 9pt; }
  .class-sheet { font-size: 10pt; line-height: 1.35; }
  .class-sheet h1 { font-size: 17pt; margin-bottom: .1rem; }
  .class-sheet .lede { font-size: 10.5pt; margin-bottom: .1rem; }
  .class-sheet .people > li { border: 0; padding: .1rem 0; break-inside: avoid; }
  .class-sheet .people .who, .class-sheet .people .contact { display: inline; font-size: 10pt; }
  .class-sheet .people .contact::before { content: " "; }
  .class-sheet .split { gap: 0 1.25rem; }
  .sheet-rules li { margin: 0; }
  .sheet-lessons li { padding: .1rem 0; border: 0; }
}

/* The teacher's one-minute page: rating tiles where the sprout grows with the answer. */
.teacher-fb { max-width: 40rem; }
.teacher-fb h1 { font-size: var(--t-2xl); }
.sent-summary { margin: 0 0 1rem; }
.sent-summary dt { font-weight: 650; margin-top: .6rem; }
.sent-summary dd { margin: 0; overflow-wrap: anywhere; }
.sent-comments { white-space: pre-line; }
.rating-scale { border: 0; margin: 1.5rem 0 0; padding: 0; min-width: 0; }
.rating-scale legend { font: 700 var(--t-lg)/1.3 var(--round); padding: 0; margin-bottom: .75rem; }
.rating-options { position: relative; display: grid; gap: .5rem; }
.rating-options input { position: absolute; opacity: 0; width: 1px; height: 1px; margin: 0; }
.rating-options label { display: flex; align-items: center; gap: .9rem; margin: 0; min-height: 56px; padding: .5rem 1rem .5rem .75rem; border: 1.5px solid var(--edge); border-radius: var(--r-card); background: var(--paper); cursor: pointer; font-weight: 600; }
.rating-options label::before { content: ""; flex: none; width: 2.4rem; height: 2.4rem; background: var(--svg-sprout) no-repeat center bottom / var(--grow, 1rem); }
.rating-options .rating-1 { --grow: .9rem; } .rating-options .rating-2 { --grow: 1.3rem; } .rating-options .rating-3 { --grow: 1.7rem; }
.rating-options .rating-4 { --grow: 2.05rem; } .rating-options .rating-5 { --grow: 2.4rem; }
.rating-n { font: 800 var(--t-xl)/1 var(--round); min-width: 1.2rem; }
.rating-options label:hover { border-color: var(--sprout); background: var(--field); }
.rating-options input:checked + label { border: 2.5px solid var(--sprout); background: var(--leaf); box-shadow: inset 0 0 0 1px var(--sprout); }
.rating-options input:checked + label .rating-word::after { content: " (your answer)"; font-weight: 400; color: var(--ink-soft); }
.rating-options input:focus-visible + label { outline: 3px solid var(--ink); outline-offset: 2px; }
.rating-scale[aria-invalid=true] .rating-options label { border-color: var(--danger-ink); }
@media (min-width: 36rem) {
  .rating-options { grid-template-columns: repeat(5, 1fr); }
  .rating-options label { flex-direction: column; justify-content: flex-end; gap: .35rem; min-height: 8.5rem; padding: .75rem .5rem; text-align: center; }
  .rating-options label::before { width: 100%; height: 2.6rem; }
  .rating-options input:checked + label .rating-word::after { content: ""; }
  .rating-options input:checked + label::after { content: "Selected"; font-size: var(--t-sm); font-weight: 650; color: var(--sprout-deep); }
}
.teacher-form textarea { min-height: 8rem; }
.teacher-who { margin-top: 1.25rem; }

/* Home panel: lessons still waiting on their teacher. */
.fb-waiting-h { margin-top: 1.5rem; }
.fb-waiting { margin: .25rem 0 0; padding-left: 1.1rem; }
.fb-waiting li { margin: .3rem 0; }

/* - */

/* Impact and exports */
/* The impact sentence: the one bold thing on the page. Numbers carry a leaf highlighter wash. */
.impact-lede { font: 650 var(--t-lg)/1.35 var(--round); color: var(--ink); max-width: 36ch; margin: .75rem 0 1rem; letter-spacing: -.005em; text-wrap: pretty; }
.impact-lede strong { font-weight: 850; background: linear-gradient(transparent 58%, var(--leaf) 58%, var(--leaf) 92%, transparent 92%); padding: 0 .08em; }
@media (min-width: 40rem) { .impact-lede { font-size: var(--t-xl); } }
@media (min-width: 64rem) { .impact-lede { font-size: var(--t-2xl); } }
.impact-lede.is-small { font-size: var(--t-lg); max-width: 48ch; }
.impact-stats { grid-template-columns: repeat(2, 1fr); }
@media (min-width: 52rem) { .impact-stats { grid-template-columns: repeat(3, 1fr); } }
.impact-stats.is-compact { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 30rem) { .impact-stats .stat { padding: .85rem .9rem; } .impact-stats .stat-value { font-size: var(--t-xl); } .impact-stats.is-compact { gap: .5rem; } .impact-stats.is-compact .stat { padding: .75rem .7rem; } .impact-stats.is-compact .stat-value { font-size: var(--t-xl); } }
.impact-stats .stat-label { line-height: 1.3; }
.grant-copy textarea { field-sizing: content; min-height: 6rem; width: 100%; font: var(--t-md)/1.55 var(--body); color: var(--ink); background: var(--field); border: 1.5px solid var(--edge); border-radius: var(--r-ctl); padding: .75rem .9rem; resize: vertical; }
.grant-copy label { display: block; font-weight: 700; margin-bottom: .35rem; }
.health td, .health tbody th { vertical-align: middle; }
.health thead th { white-space: normal; vertical-align: bottom; }
.health td { font-size: var(--t-sm); }
.health td.num { min-width: 5.5rem; }
.matrix.health th[scope=row] { min-width: 10rem; }
.health tbody th .sub { display: block; font-size: var(--t-sm); }
@media (max-width: 30rem) { .matrix.health th[scope=row], .matrix.health thead th:first-child { min-width: 8.5rem; } }
.health td.num .sub, .programs td.num .sub { display: block; font-size: var(--t-sm); }
.health td.num .rating-count { display: inline; white-space: nowrap; }   /* "4.3 (9)" stays on one line */
.programs tbody th .sub { display: block; font-weight: 400; }
.health-chapter { display: inline-flex; align-items: center; min-height: 44px; font-weight: 700; }
.health-why { display: inline-flex; align-items: center; min-height: 44px; font-weight: 600; }
.impact-atleast { font-size: var(--t-md); font-weight: 650; letter-spacing: 0; }
.health-flags { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: .3rem; min-width: 12rem; }
.defs { display: grid; gap: .2rem 1.5rem; margin: 1rem 0 0; }
.defs dt { font-weight: 700; margin-top: .6rem; }
.defs dd { margin: 0; color: var(--ink-soft); max-width: 62ch; }
@media (min-width: 52rem) { .defs { grid-template-columns: 12rem 1fr; } .defs dt { margin-top: 0; } .defs dd { margin-bottom: .6rem; } }
/* Lessons-per-week columns (views/impact/weeks.php). Taught in sprout, still scheduled in the
   de-emphasis grey (3.1:1 on paper, so the numbers are also in a table), 2px surface gap between. */
.wk-chart { max-width: 46rem; }
.wk { display: block; overflow: visible; }
.wk-taught { fill: var(--fill-ok); }
.wk-planned { fill: var(--fill-muted); }
.wk-grid { stroke: var(--line); stroke-width: 1; }
.wk-base { stroke: var(--edge); stroke-width: 1; }
.wk-hit { fill: transparent; }
.wk-col:hover .wk-hit { fill: var(--field); opacity: .6; }
.wk-now { fill: none; stroke: var(--edge); stroke-width: 1; }   /* an outline, so the grey bar keeps its contrast on paper */
.wk-now-label { font: 700 var(--t-sm) var(--body); fill: var(--ink); }
.wk-axis { font: 500 var(--t-sm) var(--body); fill: var(--ink-soft); }
.wk-tick { font: 500 var(--t-sm) var(--body); fill: var(--ink-soft); paint-order: stroke; stroke: var(--paper); stroke-width: 3px; stroke-linejoin: round; }
.wk-legend { list-style: none; margin: .25rem 0 .5rem; padding: 0; display: flex; flex-wrap: wrap; gap: .25rem 1.25rem; font-size: var(--t-sm); color: var(--ink-soft); }
.wk-legend li { display: inline-flex; align-items: center; gap: .4rem; }
.wk-table { margin-top: .5rem; }
.wk-table summary { cursor: pointer; color: var(--sprout); font-weight: 600; min-height: 44px; display: inline-flex; align-items: center; }
.wk-table tr[aria-current] > * { background: var(--leaf); }
/* History: a day heading, then a quiet time column and the sentence. */
.history-day { margin: 0 0 2rem; }
.history-day h2 { font-size: var(--t-lg); margin-bottom: .5rem; }
.history { list-style: none; margin: 0; padding: 0; border-left: 3px solid var(--line); }
.history-item { display: grid; grid-template-columns: 5.5rem 1fr; gap: .1rem .75rem; padding: .45rem 0 .45rem 1rem; position: relative; }
.history-item::before { content: ""; position: absolute; left: -7px; top: .9rem; width: 11px; height: 11px; border-radius: var(--r-pill); background: var(--paper); box-shadow: inset 0 0 0 3px var(--fill-muted); }
.history-item.is-onboarding::before, .history-item.is-team::before { box-shadow: inset 0 0 0 3px var(--fill-ok); }
.history-item time { color: var(--ink-soft); font-size: var(--t-sm); font-variant-numeric: tabular-nums; padding-top: .1rem; }
@media (max-width: 30rem) { .history-item { grid-template-columns: 1fr; } }
@media print { .wk-table { display: none; } .impact-lede strong { background: none; } }
@media (forced-colors: active) { .wk-taught { fill: CanvasText; } .wk-planned { fill: GrayText; } .wk-now { fill: Canvas; stroke: CanvasText; } }

/* - */

/* Demo tour */
/* The guided tour bar (demo only), in place of the demo strip: a sunflower line carrying the strip's
   words, then the step on deep moss, so it never reads as part of the page. Paper on ink is 14.1:1;
   the soft greens below are 11:1 or better on ink. From 48rem it is one slim sticky block (step,
   title, "Try this", buttons) and the story folds behind "Show the story"; open, the bar keeps
   sticking, so the story shows on screen where the presenter is, and the story scrolls inside itself
   past 30% of the screen's height, so the bar never grows past about half of a 1024x640 projector
   (a 1280x800 laptop at 125%). On a phone it scrolls away and "Try this" folds too. */
.tour-bar { background: var(--ink); color: var(--paper); }
.tour-bar p { margin: 0; }
.tour-bar :focus-visible { outline-color: var(--paper); }
.tour-bar .tour-demo { max-width: none; background: var(--sun); color: var(--ink); font-size: var(--t-sm); }
.tour-bar .tour-demo :focus-visible { outline-color: var(--ink); }
.tour-demo-in { display: flex; flex-wrap: wrap; align-items: center; max-width: var(--frame); margin: 0 auto; padding: 0 var(--gutter); }
.tour-demo-in > * + *::before { content: "\00B7" / ""; display: inline-block; margin: 0 .5rem; font-weight: 700; }
.tour-demo a { display: inline-flex; align-items: center; min-height: 2rem; color: var(--ink); font-weight: 750; text-decoration-thickness: 2px; }
/* Switch person, Roles, Decisions: together, as in the demo strip; the page you're on is marked. */
.tour-links { display: inline-flex; flex-wrap: wrap; align-items: center; column-gap: 1rem; }
.tour-demo-in > .tour-links::before { margin: 0 -.5rem 0 .5rem; }   /* the dot before the group, spaced like the others */
.tour-demo a[aria-current] { text-decoration-thickness: 4px; }
.tour-inner { max-width: var(--frame); margin: 0 auto; padding: .45rem var(--gutter) .6rem; display: grid; gap: .5rem 2rem; }
.tour-step { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 .75rem; }
.tour-count { font-size: var(--t-sm); color: #CFE3D6; white-space: nowrap; }
.tour-title { font: 750 var(--t-lg)/1.25 var(--round); letter-spacing: -.01em; text-wrap: balance; }
.tour-bar .tour-try { margin-top: .15rem; max-width: 78ch; padding: .35rem .75rem; background: #253F39; border-left: 3px solid var(--leaf-2); border-radius: 0 var(--r-ctl) var(--r-ctl) 0; }
.tour-bar .tour-story { max-width: 78ch; padding: .1rem 0 .2rem; color: #E4EFE8; }
.tour-more > summary { display: inline-flex; align-items: center; min-height: 44px; list-style: none; color: #CFE3D6; font-weight: 600; white-space: nowrap; text-decoration: underline; text-underline-offset: .18em; cursor: pointer; }
.tour-more > summary::-webkit-details-marker { display: none; }
.tour-more > summary::after { content: "\25BE" / ""; margin-left: .35rem; }
.tour-more[open] > summary::after { content: "\25B4" / ""; }
.tour-more > summary:hover { color: var(--paper); }
.tour-more-open, .tour-more[open] .tour-more-closed { display: none; }
.tour-more[open] .tour-more-open { display: inline; }
.tour-nav { display: grid; grid-template-columns: 1fr 1fr; gap: .4rem; align-content: start; }
.tour-nav form { margin: 0; }
.tour-nav form:first-child, .tour-nav form:nth-child(2):last-child { grid-column: 1 / -1; }
.tour-nav button { width: 100%; }
.tour-bar button.tour-next { background: var(--paper); color: var(--ink); }
.tour-bar button.tour-next:hover { background: var(--leaf); color: var(--ink); }
.tour-bar button.tour-back { background: transparent; color: var(--paper); box-shadow: inset 0 0 0 1.5px #9DB8A9; }
.tour-bar button.tour-back:hover { background: #253F39; }
.tour-bar button.tour-exit { background: none; color: #CFE3D6; font-weight: 500; text-decoration: underline; text-underline-offset: .18em; padding: .4rem .5rem; }
.tour-bar button.tour-exit:hover { color: var(--paper); }
/* Progress along the bottom edge: decoration only, the words say "Step 3 of 16". */
.tour-progress { display: block; width: 100%; height: 4px; border: 0; appearance: none; background: #2F4A43; color: var(--leaf-2); }
.tour-progress::-webkit-progress-bar { background: #2F4A43; }
.tour-progress::-webkit-progress-value { background: var(--leaf-2); }
.tour-progress::-moz-progress-bar { background: var(--leaf-2); }
@media (min-width: 48rem) {
  .tour-bar { position: sticky; top: 0; z-index: 10; box-shadow: 0 2px 12px rgb(22 48 43 / .2); }
  .tour-bar .tour-story { max-height: 30vh; overflow-y: auto; overscroll-behavior: contain; }
  .tour-bar * { scroll-margin-top: calc(-16px - var(--tour-bar-h, 12rem)); }   /* focus in the bar never scrolls the page (tour.js) */
  html:has(.tour-bar) { scroll-padding-top: 12rem; }   /* tour.js replaces this with the bar's real height */
  .tour-inner { grid-template-columns: minmax(0, 1fr) 16rem; align-items: start; }
  .tour-main { display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: 1rem; align-items: center; }
  .tour-step { grid-area: 1 / 1; }
  .tour-more { grid-area: 1 / 2; }
  .tour-bar .tour-try { grid-area: 2 / 1 / 3 / 3; }
  .tour-more[open] { grid-area: 3 / 1 / 4 / 3; }
  .tour-phone { display: none; }
}
@media (max-width: 47.99rem) {
  .tour-long { display: none; }
  .tour-demo a { min-height: 44px; }
  /* Phones: the links get a line of their own, so no line starts with a stray dot. */
  .tour-demo-in { padding-top: .35rem; }
  .tour-demo-in > .tour-links { flex-basis: 100%; }
  .tour-demo-in > .tour-links::before { content: none; }
  .tour-main { display: flex; flex-direction: column; align-items: flex-start; }
  .tour-bar .tour-try { order: 2; margin-top: .25rem; }
  .tour-bar:not(:has(.tour-more[open])) .tour-try { display: none; }
  .tour-nav { grid-template-columns: 1fr auto auto; }
  .tour-nav form:first-child, .tour-nav form:nth-child(2):last-child { grid-column: auto; }
  .tour-next-title { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  .tour-bar button.tour-exit { padding: .4rem .25rem; font-size: var(--t-sm); }
}

/* The tour's Next at the end of the page (views/tour_foot.php): on phones only, where the bar scrolls
   away; from 48rem the bar always sticks, story open or not. Same moss and paper as the bar. */
.tour-foot { max-width: var(--frame); margin: 0 auto 1rem; padding: 0 var(--gutter); }
.tour-foot form { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem 1rem; margin: 0; padding: .75rem 1rem; background: var(--ink); color: var(--paper); border-radius: var(--r-card); }
.tour-foot-step { margin: 0; font-size: var(--t-sm); color: #CFE3D6; white-space: nowrap; }
.tour-foot button { flex: 1 1 14rem; background: var(--paper); color: var(--ink); white-space: normal; text-wrap: balance; }
.tour-foot button:hover { background: var(--leaf); color: var(--ink); }
.tour-foot :focus-visible { outline-color: var(--paper); }
@media (min-width: 48rem) { .tour-foot { display: none; } }
@media print { .tour-foot { display: none; } }
/* On the tour's "wall" step, the 404 page says the refusal is the point (views/error.php). */
.tour-wall { margin: 1rem 0 0; max-width: 44rem; padding: .7rem 1rem; background: var(--ok-bg); border-left: 4px solid var(--fill-ok); border-radius: 0 var(--r-ctl) var(--r-ctl) 0; }
.tour-wall > p { margin: 0; }

/* Tour start page: the week as a timeline, two columns when there's room. */
.tour-head .lede { max-width: 62ch; }
.tour-head button.tour-start { font-size: var(--t-lg); padding: .8rem 1.6rem; }
.tour-head .actions + .sub { margin-top: .75rem; }
.tour-real ul { margin: .5rem 0 0; padding-left: 1.2rem; }
.tour-real li { margin: .35rem 0; max-width: 70ch; }
.tour-steps .step form { margin-top: .1rem; }
.tour-steps button.link { display: inline-flex; align-items: center; min-height: 44px; }
@media (min-width: 60rem) { .tour-steps { columns: 2; column-gap: 3rem; } .tour-steps .step { break-inside: avoid; } }

/* /demo: the note-button line under the lede. */
.page-head .demo-note { margin: .6rem 0 0; max-width: 62ch; color: var(--ink-soft); }

/* /proof: each attempt, what the database answered, and the exact SQL. */
.proof-tally { grid-template-columns: minmax(0, 20rem); margin-bottom: .5rem; }
.proof-tally .stat:not(.is-danger) { background: var(--leaf); }
.proof-list { list-style: none; margin: 1.25rem 0 0; padding: 0; }
@media (min-width: 60rem) { .proof-list { display: grid; grid-template-columns: 1fr 1fr; column-gap: 2.5rem; align-items: start; } }
.probe { padding: 1rem 0 .5rem; border-top: 1px solid var(--line); min-width: 0; }
.probe.is-succeeded { background: var(--danger-bg); border: 2px solid var(--fill-danger); border-radius: var(--r-card); padding: 1rem; margin: .5rem 0; }
.probe .probe-attempt { margin: 0 0 .4rem; font-size: var(--t-md); }
.probe-result { margin: 0 0 .25rem; }
.probe-result .chip { margin-right: .3rem; }
.probe-sql summary { display: inline-flex; align-items: center; min-height: 44px; color: var(--sprout); font-weight: 600; cursor: pointer; }
.probe-sql summary:hover { color: var(--sprout-deep); text-decoration: underline; }
.probe-sql pre { margin: .25rem 0 .6rem; padding: .75rem .85rem; background: var(--field); border: 1px solid var(--line); border-radius: var(--r-ctl); white-space: pre-wrap; overflow-wrap: anywhere; font-size: var(--t-sm); line-height: 1.5; }
.probe-sql code, .probe-sql .sub code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.proof-alarm { color: var(--danger-ink); }

/* /decisions */
.decisions-answer { margin: -1rem 0 1.5rem; }
.decisions-toc { margin: 0 0 3rem; padding: 1rem 1.25rem .25rem; background: var(--field); border-radius: var(--r-card); }
@media (min-width: 52rem) { .decisions-toc { columns: 2; column-gap: 2.5rem; } .decisions-toc ul { break-inside: avoid; } }
.decisions-toc-group { font-weight: 700; margin: 0 0 .2rem; break-after: avoid; }
.decisions-toc ul { margin: 0 0 1rem; padding-left: 1.2rem; }
.decisions-toc li { margin: .15rem 0; }
.decision { padding: 1.25rem 0 1.5rem; border-top: 1px solid var(--line); }
.bed .decision h3 { margin: 0 0 .1rem; }
.decision-ref { color: var(--ink-soft); font-size: var(--t-sm); margin-bottom: .6rem; }
.decision-default { max-width: 68ch; margin: .9rem 0 .75rem; padding: .8rem 1rem; background: var(--leaf); border-left: 4px solid var(--sprout); border-radius: 0 var(--r-ctl) var(--r-ctl) 0; }
.decision-default p:last-child { margin-bottom: 0; }
.decision-default-head { display: flex; flex-wrap: wrap; align-items: center; gap: .35rem .75rem; margin-bottom: .35rem; }
.decision-see p { margin: .4rem 0; }
.decision-see form.inline { gap: .4rem .75rem; }

@media print { .tour-bar { display: none; } }
@media (forced-colors: active) { .tour-bar { border-bottom: 1px solid CanvasText; } .tour-progress { display: none; } .probe.is-succeeded, .decision-default { border: 1px solid CanvasText; } }

/* ==== Polish (shared fixes) ==== */
/* History: "3 days ago" beside each day; repeated clock times within a run are left blank. */
.history-day h2 .history-ago { font-family: var(--body); font-size: var(--t-md); font-weight: 500; color: var(--ink-soft); margin-left: .4rem; }
@media (max-width: 30rem) { .history-item time.is-repeat { display: none; } }
/* Classroom Information Sheet: the emergency order of calls, first and unmissable. */
.sheet-first { margin: 0 0 .9rem; padding: .6rem .8rem; background: var(--paper); border-left: 4px solid var(--fill-danger); border-radius: 0 var(--r-ctl) var(--r-ctl) 0; font-size: var(--t-md); }
@media print { .sheet-first { border-left: 4px solid #000; padding: .25rem .5rem; margin-bottom: .4rem; font-size: 11pt; } }
/* /demo "Everyone": every other person, one row each (DESIGN.md "Alignment"), one press signs in. */
.everyone-find { margin: 0 0 1rem; max-width: 24rem; }
.everyone-group { border-top: 1px solid var(--line); }
.everyone-group:last-of-type { border-bottom: 1px solid var(--line); }
.everyone-group > summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: .5rem; min-height: 44px; padding: .5rem 0; font-weight: 700; color: var(--sprout-deep); }
.everyone-group > summary::-webkit-details-marker { display: none; }
.everyone-group > summary::after { content: "\25BE" / ""; font-size: 1.15em; line-height: 1; transition: transform .15s ease; }
.everyone-group[open] > summary::after { transform: rotate(180deg); }
.everyone-group > summary:hover { text-decoration: underline; text-underline-offset: .18em; }
.everyone-n { margin-inline-start: auto; color: var(--ink-soft); font-weight: 600; font-size: var(--t-sm); font-variant-numeric: tabular-nums; }
.everyone-list { list-style: none; margin: 0 0 .75rem; padding: 0; }
.everyone-list > li + li { border-top: 1px solid var(--line); }
.everyone-pick { width: 100%; justify-content: flex-start; text-align: left; font-weight: 600; color: var(--ink); background: none; border-radius: var(--r-ctl); padding: .55rem .6rem; }
.everyone-pick:hover { background: var(--leaf); color: var(--ink); }
.everyone-pick .row-trail, .everyone-off .row-trail { font-weight: 500; font-size: var(--t-sm); color: var(--ink-soft); }
.everyone-off { min-height: 44px; padding: .55rem .6rem; color: var(--ink-soft); }
.everyone [hidden] { display: none; }
/* /demo: a one-line seed-story descriptor under the role, for people who share a role. */
.persona-story { margin: .15rem 0 0; font-size: var(--t-sm); font-weight: 600; color: var(--ink); }
/* Demo strip on phones: the short wording. (The tour bar's rules live in "Demo tour".) */
.demo-short { display: none; }
@media (max-width: 47.99rem) {
  .demo-strip p { padding: .35rem 1rem; font-size: var(--t-sm); }
  .demo-long { display: none; }
  .demo-short { display: inline; }
}
/* Forced colours: the note button is a <summary> drawn by its background, so it gets a real edge. */
@media (forced-colors: active) {
  .note-widget summary { border: 1px solid ButtonText; padding: calc(.7rem - 1px) calc(1.1rem - 1px); }
  @media (min-width: 76rem) { .note-widget summary { padding: calc(1rem - 1px) calc(.5rem - 1px); } }
}

/* ==== Roles page and demo-strip links (ws/roles) ==== */
/* "Our call": a row or default that Sprout Up's guides don't settle, so we chose. Calm on purpose:
   a question for the client, not a warning. Reused on other pages. muted-ink on paper 9.9:1; the
   dashed edge is --edge (5.0:1). */
.chip-ours { background: var(--paper); color: var(--muted-ink); box-shadow: none; border: 1px dashed var(--edge); padding: calc(.18rem - 1px) calc(.6rem - 1px); }
.chip-ours[title]:not([href]) { cursor: help; }
/* A linked "Our call" (to its question, or to the reason on /roles): a 44 px tall hit area around
   the chip without making the chip look bigger. */
a.chip-ours { position: relative; }
a.chip-ours::after { content: ""; position: absolute; left: -2px; right: -2px; top: 50%; height: 44px; transform: translateY(-50%); }
a.chip-ours:hover { background: var(--leaf); color: var(--sprout-deep); }
/* Demo strip: Roles and Decisions live here in the demo, set a little apart from "Switch person". */
.demo-strip .demo-links { display: inline-block; margin-left: .55rem; white-space: nowrap; }
.demo-strip .demo-links a + a { margin-left: .6rem; }
.demo-strip a[aria-current] { text-decoration-thickness: 3px; }

.roles-table { margin-bottom: 3rem; }
.matrix-key { display: flex; flex-wrap: wrap; gap: .35rem 1.1rem; max-width: none; margin: 0 0 .4rem; font-size: var(--t-sm); color: var(--ink-soft); }
.matrix-key strong { display: inline-block; margin-right: .2rem; padding: 0 .4rem; border-radius: 4px; background: var(--leaf); color: var(--sprout-deep); font-weight: 700; }
.matrix-key > span:last-child strong { background: none; color: var(--ink-soft); padding: 0 .1rem; }
.matrix-legend { max-width: none; margin: 0 0 .75rem; font-size: var(--t-sm); color: var(--ink-soft); }
.matrix-legend .chip { font-size: var(--t-sm); padding-block: 0; vertical-align: .05em; }
.row-cite { display: block; margin-top: .15rem; font-size: var(--t-sm); font-weight: 400; line-height: 1.3; color: var(--ink-soft); }
.matrix-legend .row-cite { display: inline; font-size: inherit; font-style: italic; }

/* Words never break: every role column is at least 6.75rem, the width of "Development" in bold
   plus its padding, so the table is never narrower than the capability column plus 9 of those.
   Where the screen can't give it that, it scrolls inside its box (below). */
.roles-table { --cap-w: 9rem; }
.matrix-roles { width: 100%; table-layout: fixed; min-width: calc(var(--cap-w) + 9 * 6.75rem); }
.matrix-roles .cap-col { width: var(--cap-w); }
.matrix-roles th, .matrix-roles td { font-size: var(--t-sm); line-height: 1.3; padding: .5rem .3rem; }
.matrix-roles th[scope=row], .matrix-roles thead th:first-child { min-width: 0; padding-left: .75rem; }
.matrix-roles th[scope=row] .chip { margin-top: .3rem; font-size: var(--t-sm); padding-block: 0; }
.matrix-roles th[scope=row] .chip-ours { padding-block: 0; }
/* Room under a linked chip for its 44 px hit area (the next row's sticky header would cover it). */
.matrix-roles th[scope=row]:has(a.chip-ours) { padding-bottom: .8rem; }
/* Header row: sticks to the top of the screen while the rows scroll under it. */
.matrix-roles thead th { position: sticky; top: 0; z-index: 2; white-space: normal; vertical-align: bottom; background: var(--field); box-shadow: inset 0 -1px 0 var(--line); }
.matrix-roles thead th:first-child { z-index: 3; vertical-align: bottom; color: var(--ink-soft); font-weight: 600; box-shadow: 1px 0 0 var(--line), inset 0 -1px 0 var(--line); }
.matrix-roles .role-name { display: block; font-weight: 750; color: var(--ink); }
.matrix-roles .role-what { display: block; margin-top: .15rem; font-size: var(--t-sm); font-weight: 400; color: var(--ink-soft); }
/* "You": the same small pill on the viewer's own column and on their own roles in the picker. */
.roles-table .you, .role-picker .you { display: inline-block; padding: 0 .45rem; border-radius: var(--r-pill); background: var(--sprout); color: var(--paper); font-size: var(--t-sm); font-weight: 700; line-height: 1.45; }
.matrix-roles .you { margin-top: .3rem; }
.role-picker .you { margin-left: .45rem; }
.role-picker a[aria-current] .you { background: var(--leaf); color: var(--ink); }
/* Group rows: the name stays in view while the table scrolls sideways. */
.matrix-roles .group th { padding: .55rem .75rem .4rem; background: var(--field); font-family: var(--round); font-size: var(--t-md); font-weight: 750; }
.matrix-roles .group th span { position: sticky; left: .75rem; }
.matrix-roles td { text-align: center; vertical-align: middle; }
.matrix-roles td.yes { background: var(--leaf); color: var(--sprout-deep); font-weight: 650; }
.matrix-roles td.s-own, .matrix-roles td.s-team, .matrix-roles td.s-names { background: #F3F9F4; font-weight: 550; }  /* sprout-deep on it 7.6:1 */
.matrix-roles .yes-mark { font-weight: 800; }
.matrix-roles .q { display: block; font-size: var(--t-sm); font-weight: 500; color: var(--ink-soft); }
.matrix-roles td.no { color: var(--ink-soft); }
/* The viewer's own column: outlined top to bottom, "You" under its name. */
.matrix-roles .is-mine { box-shadow: inset 2px 0 0 var(--sprout), inset -2px 0 0 var(--sprout); }
.matrix-roles thead th.is-mine { background: var(--leaf); box-shadow: inset 2px 0 0 var(--sprout), inset -2px 0 0 var(--sprout), inset 0 3px 0 var(--sprout); }
.matrix-roles tbody:last-of-type tr:last-child td.is-mine { box-shadow: inset 2px 0 0 var(--sprout), inset -2px 0 0 var(--sprout), inset 0 -2px 0 var(--sprout); }
.scroll-cue { display: none; }
/* Wide enough for all nine columns (from 80rem the frame's content box is at least 71rem, even with a
   classic scrollbar, and the table needs 70.75rem): no scrollbox (overflow: clip is not a scroll container), so the header
   row sticks to the window, below the guided tour's bar when there is one (tour.js measures it). */
@media (min-width: 80rem) {
  .roles-table { --cap-w: 10rem; }
  .matrix-wrap { overflow: clip; }
  html:has(.tour-bar) .matrix-roles thead th { top: var(--tour-bar-h, 9.5rem); }
  html:has(.tour-more[open]) .matrix-roles thead th { top: 0; }
}
@media (min-width: 84rem) { .roles-table { --cap-w: 12rem; } }   /* room to spare: shorter rows */
/* Narrower: the table scrolls inside its own box both ways, so the header row and the capability
   column both stay put; say so in words. */
@media (max-width: 79.99rem) {
  .matrix-wrap { max-height: min(78svh, 46rem); overflow: auto; overscroll-behavior-x: contain; }
  .scroll-cue { display: block; margin: 0 0 -.5rem; font-size: var(--t-sm); font-weight: 600; color: var(--sprout-deep); }
  .scroll-cue::after { content: " \2192"; }
}

/* One role at a time: compact, below the table. */
.role-card .role-picker { margin: .75rem 0 1.25rem; }
.rc-name { margin-top: 0; }
.rc-name .sub { font-family: var(--body); font-size: var(--t-md); margin-left: .35rem; }
.role-card .answer { font-size: var(--t-md); }
.can-groups { column-gap: 2.5rem; }
/* Two columns that pack (a short group doesn't leave a gap beside a long one); a group never splits. */
@media (min-width: 48rem) { .can-groups { columns: 2; } .can-group { break-inside: avoid; } }
.can-group:first-child h4 { margin-top: 0; }
.can-group h4 { margin: 1rem 0 .1rem; font-family: var(--round); }
.can-list li { padding: .45rem 0; font-size: var(--t-sm); scroll-margin-top: 1rem; }
/* Landed on from a row's "Our call" in the table: the entry that says why. */
.can-list li:target { margin-inline: -.6rem; padding-inline: .6rem; border-radius: var(--r-ctl); background: var(--leaf); box-shadow: inset 4px 0 0 var(--sprout); }
.can-list .scope { font-weight: 500; }
.can-list .scope::before { content: "· " / ""; color: var(--ink-soft); }
.can-list .why { display: block; margin-top: .15rem; color: var(--ink-soft); font-size: var(--t-sm); }
.can-list .why .chip { font-size: var(--t-sm); padding-block: 0; }
.cannot-more { margin-top: 1.25rem; }
/* A text fold-out, with the same caret as "Answer this" on /decisions and the tour's "Show the story". */
.cannot-more summary { list-style: none; cursor: pointer; display: inline-flex; align-items: center; gap: .45rem; min-height: 44px; font-weight: 650; color: var(--sprout); }
.cannot-more summary::-webkit-details-marker { display: none; }
.cannot-more summary::after { content: "\25BE" / ""; font-size: .85em; transition: transform .15s ease; }
.cannot-more[open] summary::after { transform: rotate(180deg); }
.cannot-more summary:hover { color: var(--sprout-deep); text-decoration: underline; text-underline-offset: .18em; }
.cannot-more .cannot { font-size: var(--t-sm); }
@media print { .roles-table .matrix-wrap { margin-inline: 0; } .matrix-roles { min-width: 0; } .matrix-roles thead th { position: static; } }
@media (forced-colors: active) { .chip-ours { border: 1px dashed CanvasText; } .matrix-roles .is-mine { border-inline: 2px solid CanvasText; } }

/* ==== /decisions: answers and the answer form (ws/decisions) ==== */
.decisions-toc-done { font-size: var(--t-sm); color: var(--ink-soft); }
.decision-answers { max-width: 68ch; margin: .9rem 0 .5rem; }
.bed .decision-answers h4 { margin: 0 0 .35rem; font-size: var(--t-md); }
.decision-answers ol { list-style: none; margin: 0; padding: 0; }
.decision-answers li { margin: 0 0 .5rem; padding: .55rem .8rem; border-radius: var(--r-ctl); background: var(--field); }
.decision-answers li.is-latest { background: var(--ok-bg); }
.decision-note { white-space: pre-line; overflow-wrap: anywhere; }
.decision-reply { max-width: 68ch; margin-top: .75rem; }
/* "Answer this" is the decision's main action: a primary button (DESIGN.md) that folds out, with
   the same caret as the other fold-outs; "Show me in the tour" above it stays small and outlined. */
.decision-reply > summary { list-style: none; cursor: pointer; display: inline-flex; align-items: center; gap: .45rem; min-height: 44px; padding: .65rem 1.15rem; border-radius: var(--r-ctl); background: var(--sprout); color: var(--paper); font-weight: 650; }
.decision-reply > summary::-webkit-details-marker { display: none; }
.decision-reply > summary::after { content: "\25BE" / ""; font-size: .85em; transition: transform .15s ease; }
.decision-reply[open] > summary::after { transform: rotate(180deg); }
.decision-reply > summary:hover { background: var(--sprout-deep); }
/* Open, or already answered ("Add another answer"): it steps back to secondary. */
.decision-reply[open] > summary { margin-bottom: .75rem; }
.decision-reply[open] > summary, .decision.is-answered .decision-reply > summary { background: var(--paper); color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--edge); }
.decision-reply[open] > summary:hover, .decision.is-answered .decision-reply > summary:hover { background: var(--field); box-shadow: inset 0 0 0 2px var(--ink); }
/* The message after "Save answer": right above the answers (saved) or the form (refused). */
.decision .decision-flash { margin: .9rem 0 .75rem; scroll-margin-top: 1rem; }
.decision-form { padding: 1rem 1rem .25rem; border-radius: var(--r-card); background: var(--field); }
.decision-form .field-group { margin-bottom: 1rem; }
.decision-form .field-group > legend { font-size: var(--t-md); }
.decision-choices .debrief-choice { text-align: left; border-radius: var(--r-ctl); }
.decision-form textarea, .decision-form input[type=text] { width: 100%; }
@media (forced-colors: active) { .decision-reply > summary { border: 2px solid ButtonText; padding: calc(.65rem - 2px) calc(1.15rem - 2px); } .decision-answers li { border: 1px solid CanvasText; } }

/* Profile: where you're signed in ("Keep me signed in on this device", 0008) */
.signed-in-devices { margin-top: 2.5rem; padding-top: 1.5rem; border-top: 1px solid var(--line); }
.signed-in-devices h2 { margin-top: 0; }

/* ---- Home-screen app: what shows only inside it, or only in the browser ---- */
.app-only { display: none; }
@media (display-mode: standalone) {
  .app-only { display: block; }
  .browser-only { display: none; }
}
.auth .app-only { padding: .75rem 1rem; background: var(--info-bg); color: var(--info-ink); border-radius: var(--r-ctl); }
.install-app { margin-top: 2.5rem; padding-top: 1.5rem; border-top: 1px solid var(--line); }
.install-app h2 { margin-top: 0; }
.install-app ul { padding-left: 1.25rem; }
.install-app li + li { margin-top: .5rem; }

/* ==== Tables and tabs on a phone (ws/phone-tables) ==== */
/* A scroll cue that shows only on phones, for a table that still scrolls sideways there (the team
   planner's people table, onboarding's everyone table). The roles table has its own, wider breakpoint above. */
.scroll-cue.is-phone { display: none; }
@media (max-width: 30rem) {
  .scroll-cue.is-phone { display: block; margin: 0 0 -.5rem; font-size: var(--t-sm); font-weight: 600; color: var(--sprout-deep); }
  .scroll-cue.is-phone::after { content: " \2192" / ""; }
}

/* Team planner, people who sent the scheduling form: a narrower sticky name column on phones, so
   "On teams" and the start of "Cleared for their picks" are in view (the columns are in that order). */
@media (max-width: 30rem) {
  .people-table th[scope=row], .people-table thead th:first-child { min-width: 7.5rem; width: 7.5rem; max-width: 7.5rem; padding-inline: .6rem; overflow-wrap: break-word; }
  .people-table td:nth-child(2) { min-width: 7rem; }
  .people-table .clear-cell { min-width: 10rem; }
}

/* .stack-phone: a table whose rows become cards on a phone, each value under its own label
   (td[data-label]), so nothing sits off-screen. The row header spans the card, .stack-wide cells too;
   the rest sit side by side. Changing a table's display drops its semantics in Safari, so these
   tables carry explicit ARIA roles (table, rowgroup, row, columnheader, rowheader, cell). */
@media (max-width: 30rem) {
  .stack-phone, .stack-phone tbody { display: block; }
  .stack-phone thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  .stack-phone tbody tr { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .5rem .75rem; padding: .75rem .85rem .85rem; border-bottom: 1px solid var(--line); }
  .stack-phone tbody tr:last-child { border-bottom: 0; }
  .stack-phone tbody th[scope=row], .matrix.stack-phone tbody th[scope=row] { grid-column: 1 / -1; position: static; min-width: 0; padding: 0; border: 0; box-shadow: none; background: none; }
  .stack-phone tbody td, .stack-phone tbody td[data-label] { min-width: 0; padding: 0; border: 0; text-align: left; }
  .stack-phone td.stack-wide { grid-column: 1 / -1; }
  .stack-phone td[data-label]::before { content: attr(data-label) / ""; display: block; color: var(--ink-soft); font-weight: 600; }
  .stack-phone td[data-label] .sub { display: inline; }
  /* Three numbers per classroom fit side by side. */
  .programs.stack-phone tbody tr { grid-template-columns: max-content max-content minmax(0, 1fr); column-gap: 1.25rem; }
  /* Chapter health: the chips use the card's full width and wrap inside it. */
  .health.stack-phone .health-flags { min-width: 0; }
}

/* Chapter health: room after the dot between "See the classrooms" and "See next week". */
.health .health-why + span[aria-hidden="true"] { margin-right: .35rem; }

/* Tabs on a phone: short labels (.tab-short) where a view has them, and a row that wraps rather
   than hides a tab off the edge. The current tab has a tinted background as well as its underline. */
.tabs .tab-short { display: none; }
.tabs a[aria-current] { background: var(--leaf); border-radius: var(--r-ctl) var(--r-ctl) 0 0; }
@media (max-width: 30rem) {
  .tabs { flex-wrap: wrap; gap: 0; }
  .tabs a { padding-inline: .45rem; }
  .tabs .tab-long { display: none; }
  .tabs .tab-short { display: inline; }
}

/* Term page, each classroom's teacher answer: a labelled setting on its own line, not a pending edit. */
.term-class .teacher-form { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem .5rem; margin-top: .6rem; padding-top: .6rem; border-top: 1px solid var(--line); }
.term-class .teacher-form label { margin: 0; font-size: var(--t-sm); font-weight: 600; color: var(--ink-soft); }
.term-class .teacher-form select { flex: 0 1 auto; min-width: 0; }
@media (max-width: 30rem) { .term-class .teacher-form label { flex-basis: 100%; } .term-class .teacher-form select { flex: 1 1 0; } }

/* Community: pictures and the chapter's Community page (views/ui/avatar.php, views/community.php) */
/* A picture is a chosen drawing or initials in a circle. Initials: ink on a light wash (7:1 or more on each). */
.avatar { display: inline-flex; align-items: center; justify-content: center; flex: none; width: 32px; height: 32px; border-radius: 50%; object-fit: cover; vertical-align: middle; font: 700 var(--t-sm)/1 var(--round); color: var(--ink); background: var(--field); letter-spacing: .02em; box-shadow: inset 0 0 0 1px rgba(22, 48, 43, .12); }
.avatar-md { width: 44px; height: 44px; }
.avatar-lg { width: 96px; height: 96px; font-size: var(--t-xl); }
.tint-0 { background: var(--ok-bg); } .tint-1 { background: var(--info-bg); } .tint-2 { background: var(--warn-bg); }
.tint-3 { background: var(--danger-bg); } .tint-4 { background: var(--muted-bg); } .tint-5 { background: #EEE8F7; }   /* ink on it 12.6:1 */
.people .who { display: flex; flex-wrap: wrap; align-items: center; gap: .3rem .6rem; }   /* wraps: name, pronouns and chips don't fit one phone line */
/* Pronouns: just after the name, quieter (views/ui/pronouns.php); on the Roster, a line under it. */
.pronouns { font-size: var(--t-sm); font-weight: 400; color: var(--ink-soft); }
.name-stack { display: flex; flex-direction: column; min-width: 0; }
.name-stack .pronouns { line-height: 1.3; }
.subs-team li { display: inline-flex; align-items: center; gap: .35rem; }

.composer { max-width: 40rem; margin: 1rem 0 1.75rem; padding: 1rem 1.1rem; background: var(--field); border-radius: var(--r-card); }
.composer .field-group { margin: 0; padding: 0; border: 0; }
.composer .choice-row { gap: .25rem 1.25rem; }
/* The thanks list and the announcement note show for their own kind (CSS only; without :has()
   both simply stay visible, and the server ignores a name chosen for a plain post). */
.composer:has(.kind-choice):not(:has(#cm-kind-thanks:checked)) .thanks-who,
.composer:not(:has(#cm-kind-announcement:checked)) .only-announcement { display: none; }
.composer textarea { min-height: 5rem; }

.posts { list-style: none; margin: 0; padding: 0; max-width: 40rem; display: grid; gap: 1rem; }
.post { padding: 1rem 1.1rem; background: var(--paper); border: 1px solid var(--line); border-radius: var(--r-card); scroll-margin-top: 5rem; }
.post-announcement { background: var(--leaf); border-color: #C5DECB; }
.post-head { display: flex; align-items: center; gap: .7rem; }
.post-who { margin: 0; display: flex; flex-wrap: wrap; align-items: baseline; gap: .15rem .5rem; }
.post-body, .reply-body { margin: .6rem 0 0; overflow-wrap: anywhere; }
.thanks-line { margin: .6rem 0 0; display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; }
.post-actions { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem 1rem; margin-top: .75rem; }
.cheer[aria-pressed="true"] { background: var(--leaf); border-color: var(--sprout); color: var(--sprout-deep); }
.replies { list-style: none; margin: .9rem 0 0; padding: 0 0 0 .9rem; border-left: 2px solid var(--line); display: grid; gap: .8rem; }
.replies > li { display: flex; align-items: flex-start; gap: .6rem; }
.replies > li > div { min-width: 0; }
.reply-form { display: flex; align-items: flex-start; gap: .5rem; margin-top: .9rem; }
.reply-form textarea { flex: 1; min-width: 0; min-height: 44px; }
details.remove > summary { list-style: none; cursor: pointer; display: inline-flex; align-items: center; min-height: 44px; font-size: var(--t-sm); color: var(--ink-soft); text-decoration: underline; text-underline-offset: .18em; }
details.remove > summary::-webkit-details-marker { display: none; }
details.remove[open] > summary { color: var(--ink); text-decoration: none; }
.replies details.remove > summary { min-height: 32px; }
.more-posts { margin-top: 1.25rem; }

.home-posts { list-style: none; margin: .5rem 0; padding: 0; display: grid; gap: .8rem; }
.home-posts > li { display: flex; align-items: flex-start; gap: .6rem; }
.home-posts > li > div { min-width: 0; }
.home-posts p { margin: 0; overflow-wrap: anywhere; }

.post.is-pinned { border: 2px solid var(--sprout); }
.cheerers { overflow-wrap: anywhere; }
.post-actions button.link { display: inline-flex; align-items: center; min-height: 44px; font-size: var(--t-sm); }

/* Profile: choose a picture. Each choice is a real radio (keyboard and screen readers as usual),
   drawn as a tile; the chosen one is outlined. */
.profile-picture { margin-bottom: 2rem; padding-bottom: 1.5rem; border-bottom: 1px solid var(--line); }
.profile-picture p { margin-top: 0; }
.picker { margin: 0 0 1rem; padding: 0; border: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(5.5rem, 1fr)); gap: .5rem; }
.pick { position: relative; display: flex; flex-direction: column; align-items: center; gap: .35rem; margin: 0; padding: .6rem .3rem .5rem; min-height: 44px; border: 1px solid var(--line); border-radius: var(--r-ctl); background: var(--paper); cursor: pointer; font-size: var(--t-sm); text-align: center; }
.pick input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.pick:hover { border-color: var(--edge); }
.pick:has(input:checked) { border: 2px solid var(--sprout); background: var(--leaf); padding: calc(.6rem - 1px) calc(.3rem - 1px) calc(.5rem - 1px); font-weight: 700; }
.pick:has(input:focus-visible) { outline: 3px solid var(--ink); outline-offset: 2px; }

/* The bell's dot: new replies or thank-yous, nothing that needs doing. */
.bell-dot { position: absolute; top: 9px; right: 9px; width: .6rem; height: .6rem; border-radius: 50%; background: var(--sprout); box-shadow: 0 0 0 2px var(--paper); }
@media (forced-colors: active) {
  .avatar, .post, .composer, .bell-dot { border: 1px solid CanvasText; }
  .pick:has(input:checked) { outline: 3px solid Highlight; }
}

/* Volunteer feedback after a lesson (0011): the form on the lesson page, the "waiting for your
   feedback" rows on home, and the teams' answers under the teachers'. */
.own-fb:focus { outline: none; }   /* a landing place after sending (#your-feedback), like .home-feedback */
.own-fb .rating-scale { margin-top: .75rem; }
.own-fb .rating-scale legend { font-size: var(--t-md); }
.own-fb-form textarea { min-height: 7rem; }
.own-fb-form { max-width: 44rem; }
.own-fb blockquote { margin-top: .5rem; }
.fb-due { list-style: none; margin: 0; padding: 0; }
.fb-due > li { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: .5rem 1rem; padding: .75rem 0; border-bottom: 1px solid var(--line); }
.fb-due > li:first-child { border-top: 1px solid var(--line); }
.fb-team-h { margin-top: 1.5rem; }

/* ==== Schools, teachers and classrooms (ws/places): /chapters/N/schools and /schools/N ==== */
.places-schools .card h3 { margin-bottom: 0; }
.places-schools .card h3 a { display: inline-flex; align-items: center; min-height: 44px; }   /* the way into the school's page: a full tap target */
.places-schools .card p { margin: 0 0 .35rem; }
.places-rooms { list-style: none; margin: .5rem 0 0; padding: .5rem 0 0; border-top: 1px solid var(--line); }
.places-rooms li { padding: .15rem 0; overflow-wrap: anywhere; }
.places-list { list-style: none; margin: 0 0 1.25rem; padding: 0; }
.places-list > li { padding: .8rem 0; border-bottom: 1px solid var(--line); overflow-wrap: anywhere; }
.places-list > li:first-child { border-top: 1px solid var(--line); }
.places-list p { margin: 0 0 .25rem; }
.places-name { font-weight: 650; }
.places-name .sub { font-weight: 400; }
.places-links { display: flex; flex-wrap: wrap; gap: 0 1.25rem; }
.places-links a { display: inline-flex; align-items: center; min-height: 44px; }
.places-notes { white-space: pre-line; }
.places-edit > summary, .places-more > summary, .places-remove > summary { display: inline-flex; align-items: center; min-height: 44px; color: var(--sprout); font-weight: 600; cursor: pointer; }
.places-edit[open] { padding: 0 0 .75rem; }
.places-more ul { margin: .25rem 0 1rem; padding-left: 1.25rem; }
.places-more li { padding: .1rem 0; }
.places-more a { display: inline-flex; align-items: center; min-height: 44px; }
.places-form { max-width: 46rem; }
.places-grid { display: grid; gap: 0 1rem; }
@media (min-width: 44rem) { .places-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } .places-wide { grid-column: 1 / -1; } }
.places-grid .tick { margin-top: 1.9rem; }
@media (max-width: 43.99rem) { .places-grid .tick { margin-top: 0; } }
/* What a district change will do, said before the save; and who stopped one. Left edge only (DESIGN rule 5). */
.places-warning, .places-refused { margin: .6rem 0 0; padding: .7rem .9rem; border-radius: 0 var(--r-ctl) var(--r-ctl) 0; font-size: var(--t-sm); }
.places-warning { border-left: 4px solid var(--fill-warn); background: var(--warn-bg); color: var(--warn-ink); }
.places-refused { border-left: 4px solid var(--fill-danger); background: var(--danger-bg); color: var(--danger-ink); }
.places-warning p, .places-refused p { margin: 0; }
.places-refused ul { margin: .4rem 0; padding-left: 1.25rem; }
.places-refused a { color: inherit; }
.places-status { margin-top: 1rem; padding-top: .75rem; border-top: 1px solid var(--line); }
.places-status .hint { margin: 0 0 .5rem; max-width: 46rem; }
.places-remove > summary { color: var(--danger-ink); }
.places-remove[open] { padding: 0 .75rem .75rem; margin: .25rem 0 .5rem; border-radius: var(--r-ctl); background: var(--danger-bg); }
.places-remove .hint { color: var(--ink); }
.places-status form + .places-remove, .places-edit .row-form + .hint { margin-top: .5rem; }
.ticket-school { font-size: var(--t-sm); }
.ticket-school a { display: inline-flex; align-items: center; min-height: 44px; }
/* A field in error takes focus after a refused save: leave room above it for its label. */
.places-form :is(input, select, textarea), .places-list .row-form input, #dnew-name { scroll-margin-top: 5rem; }
.places-status form + .hint { margin-top: .9rem; }
.bed > .places-status { border-top: 0; padding-top: 0; margin-top: 0; }
.places-list .card-flash, .bed > .card-flash { scroll-margin-top: 1rem; }
@media (forced-colors: active) { .places-warning, .places-refused { border: 1px solid CanvasText; border-left-width: 4px; } }
.places-owner { max-width: 46rem; margin: .25rem 0 1rem; padding: .7rem .9rem; border-left: 4px solid var(--sprout); border-radius: 0 var(--r-ctl) var(--r-ctl) 0; background: var(--leaf); font-size: var(--t-sm); }
.places-more .chip { margin: .25rem 0; }

/* ===== Calendar export (ws/calendar): /me/calendar, and its links on the profile and the home panel ===== */
.cal-what ul, .cal-how { padding-left: 1.25rem; }
.cal-what li + li, .cal-how li + li { margin-top: .5rem; }
.cal-part, .profile-calendar { margin-top: 2.5rem; padding-top: 1.5rem; border-top: 1px solid var(--line); }
.cal-part h2, .profile-calendar h2 { margin-top: 0; }
/* After a new address the address section leads, and "What goes in" follows it. */
.cal-part + .cal-what { margin-top: 2.5rem; padding-top: 1.5rem; border-top: 1px solid var(--line); }
.cal-part + .cal-what h2 { margin-top: 0; }
.cal-part h3 { margin-top: 1.5rem; }
/* The address is one long unbroken string: it must wrap inside a 360 px screen, never push it wide. */
.cal-address { width: 100%; min-height: 0; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: var(--t-sm); overflow-wrap: anywhere; word-break: break-all; }
.cal-demo { margin: 0 0 1rem; padding: .7rem .9rem; border-left: 4px solid var(--fill-warn); border-radius: 0 var(--r-ctl) var(--r-ctl) 0; background: var(--warn-bg); color: var(--warn-ink); font-size: var(--t-sm); }
details.cal-change { margin-top: .75rem; }
details.cal-change > summary { display: inline-flex; align-items: center; min-height: 44px; color: var(--sprout); text-decoration: underline; text-underline-offset: .18em; cursor: pointer; }
details.cal-change[open] { padding: 0 .75rem .75rem; border-radius: var(--r-ctl); background: var(--field); }
details.cal-change form { margin: 0; }
.my-calendar { margin: 1rem 0 0; font-size: var(--t-sm); }
.my-calendar a, .profile-calendar a { display: inline-flex; align-items: center; min-height: 44px; }
.cal-empty { padding: .7rem .9rem; border-radius: var(--r-ctl); background: var(--field); }
.cal-part form + .cal-change, .cal-part .hint + form { margin-top: .75rem; }
@media (forced-colors: active) { .cal-demo { border: 1px solid CanvasText; border-left-width: 4px; } }

/* ---- Two-step sign-in (ws/twostep): set-up, code and recovery-code pages ---- */
.two-step-steps { margin: 1.25rem 0 0; padding-left: 1.4rem; }
.two-step-steps > li { margin: 0 0 1.25rem; padding-left: .25rem; }
.two-step-steps > li > p { margin: 0 0 .5rem; }
.two-step-steps .card { margin-top: .5rem; }
/* The key, two ways. A phone can't scan its own screen: there the "open in the app" button and
   the key come first and the QR code follows for a second device. From tablet width up (someone
   at a computer, phone in hand) the QR code leads. Same markup, reordered. */
.two-step-ways { display: flex; flex-direction: column; gap: 1rem; }
.two-step-ways > div { padding: .85rem 1rem; border: 1px solid var(--line); border-radius: var(--r-card); background: var(--paper); }
.two-step-ways p { margin: 0 0 .5rem; }
.two-step-ways > div > :last-child { margin-bottom: 0; }
.two-step-here .button { width: 100%; }
@media (min-width: 44rem) { .two-step-scan { order: -1; } .two-step-here .button { width: auto; } }
/* The QR code is black on white whatever the theme: a reader needs the contrast and the white edge. */
.two-step-qr .qr { display: block; width: 13rem; max-width: 100%; height: auto; border: 1px solid var(--line); border-radius: var(--r-ctl); }
.two-step-key code, .recovery-codes code { font: 600 var(--t-md)/1.5 ui-monospace, "SF Mono", Menlo, Consolas, monospace; letter-spacing: .06em; }
.two-step-key { padding: .6rem .75rem; border-radius: var(--r-ctl); background: var(--field); overflow-wrap: anywhere; }
.auth .two-step-code { max-width: 100%; font-size: var(--t-md); letter-spacing: .03em; }   /* 19 characters must fit a 360 px screen */
.two-step .after-card button.link, .two-step-help > summary { display: inline-flex; align-items: center; min-height: 44px; padding: 0 .15rem; background: none; color: var(--sprout); font: inherit; text-decoration: underline; text-underline-offset: .18em; cursor: pointer; }
.two-step .after-card { margin-top: .75rem; }
.two-step .after-card p { margin: 0; }
.auth.two-step .after-card button.link { width: auto; }
.two-step-help[open] { padding: 0 .75rem .75rem; border-radius: var(--r-ctl); background: var(--field); }
.two-step-help .hint { margin: .25rem 0 .5rem; }
.two-step-why { margin: .75rem 0; padding: .7rem .9rem; border-left: 4px solid var(--fill-warn); border-radius: 0 var(--r-ctl) var(--r-ctl) 0; background: var(--warn-bg); color: var(--warn-ink); }
.recovery-codes { margin: 1rem 0; padding: .9rem 1rem .9rem 2.6rem; border: 1px solid var(--line); border-radius: var(--r-card); background: var(--paper); columns: 2 12rem; column-gap: 2rem; }
.recovery-codes li { padding: .1rem 0; break-inside: avoid; }
.two-step-link { margin: .15rem 0 .35rem; }
.two-step-link .button { min-height: 44px; }
.signed-in-devices .two-step-link { margin: .5rem 0 0; }
.signed-in-devices .two-step-link a { display: inline-flex; align-items: center; min-height: 44px; }
@media print { .two-step .actions, .two-step .flash { display: none; } }
@media (forced-colors: active) { .two-step-why { border: 1px solid CanvasText; border-left-width: 4px; } }

/* ===== Push alerts (ws/push): /me/alerts, and its links on the profile and the bell page ===== */
.alerts-part, .profile-alerts { margin-top: 2.5rem; padding-top: 1.5rem; border-top: 1px solid var(--line); }
.alerts-part h2, .profile-alerts h2, .alerts-this h2 { margin-top: 0; }
/* Each state of "This device" is in the page and alerts.js shows one: `hidden` must win over a component's own display. */
.alerts-this [hidden], .alerts-list [hidden] { display: none; }
.alerts-this .answer { margin-bottom: .5rem; }
.alerts-this form { margin: 0; }
.alerts-demo { margin: 0 0 1rem; padding: .7rem .9rem; border-left: 4px solid var(--fill-warn); border-radius: 0 var(--r-ctl) var(--r-ctl) 0; background: var(--warn-bg); color: var(--warn-ink); font-size: var(--t-sm); }
.alerts-list { margin: 0 0 1rem; padding: 0; list-style: none; }
.alerts-list > li { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .5rem 1rem; padding: .75rem 0; border-bottom: 1px solid var(--line); }
.alerts-list > li:first-child { border-top: 1px solid var(--line); }
.alerts-device { flex: 1 1 14rem; min-width: 0; }
.alerts-device p { margin: 0; }
.alerts-name .chip { margin-left: .35rem; }
.alerts-list form { margin: 0; }
.alerts-list button { min-height: 44px; }
.alerts-what { padding-left: 1.25rem; }
.alerts-what li + li { margin-top: .5rem; }
.alerts-link { margin: .25rem 0 0; font-size: var(--t-sm); }
.alerts-link a, .profile-alerts a { display: inline-flex; align-items: center; min-height: 44px; }
@media (forced-colors: active) { .alerts-demo { border: 1px solid CanvasText; border-left-width: 4px; } }

/* ===== Views: the View switch, and the Inbox view of Home (DESIGN.md, "Views") ===== */
/* The switch: a segmented row of links above the page's heading. The current one is bold and underlined, not only tinted. */
.view-switch { display: flex; width: fit-content; margin: 0 0 1rem auto; border: 1.5px solid var(--edge); border-radius: var(--r-ctl); overflow: hidden; }
.view-switch a { display: inline-flex; flex-direction: column; justify-content: center; align-items: center; min-height: 41px; padding: 0 1rem; color: var(--ink); font-size: var(--t-sm); font-weight: 600; text-decoration: none; }
.view-switch a + a { border-left: 1.5px solid var(--edge); }
.view-switch a:hover { background: var(--field); color: var(--ink); }
.view-switch a[aria-current] { background: var(--leaf); color: var(--sprout-deep); font-weight: 750; box-shadow: inset 0 -3px 0 var(--sprout); }
/* Each segment keeps the width of its bold label (a hidden copy, data-label), so the current one turning bold moves nothing. */
.view-switch a::after { content: attr(data-label) / ""; height: 0; overflow: hidden; visibility: hidden; font-weight: 750; pointer-events: none; }
/* A page whose Inbox is on Home: "Open in Inbox" is a plain link beside the switch (it leaves the page, which a switch must not do). */
.view-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 0 1.25rem; margin: 0 0 1rem; }
.view-bar .view-switch { margin: 0; }
.view-away { display: inline-flex; align-items: center; min-height: 44px; font-size: var(--t-sm); font-weight: 650; }
/* The Inbox: folders, the list, the open item. A phone shows one at a time: the list, or the item with a Back link. */
.inbox { display: grid; grid-template-columns: minmax(0, 1fr); gap: 1.25rem; align-items: start; }   /* minmax(0, ...): a long one-line title never widens the page */
.inbox ul, .inbox ol { list-style: none; margin: 0; padding: 0; }
.inbox-rail > ul { display: flex; flex-wrap: wrap; gap: .4rem; }
.inbox-rail > ul a { display: inline-flex; align-items: center; justify-content: space-between; gap: .5rem; min-height: 44px; padding: .3rem .75rem; border-radius: var(--r-pill); background: var(--paper); box-shadow: inset 0 0 0 1.5px var(--edge); color: var(--ink); font-weight: 600; text-decoration: none; white-space: nowrap; }
.inbox-rail > ul a:hover { background: var(--leaf); color: var(--ink); }
.inbox-rail > ul a[aria-current] { background: var(--leaf); box-shadow: inset 0 0 0 2px var(--sprout); color: var(--sprout-deep); font-weight: 750; }
.inbox-n { display: inline-grid; place-items: center; min-width: 1.6rem; height: 1.45rem; padding: 0 .4rem; border-radius: var(--r-pill); background: var(--muted-bg); color: var(--muted-ink); font-size: var(--t-sm); font-weight: 700; line-height: 1; }
[aria-current] > .inbox-n { background: var(--sprout); color: var(--paper); }
.inbox-pages { margin-top: .5rem; }
.inbox-pages summary { list-style: none; display: flex; align-items: center; gap: .4rem; min-height: 44px; padding: 0 .5rem; color: var(--ink-soft); font-weight: 600; cursor: pointer; }
.inbox-pages summary::-webkit-details-marker { display: none; }
.inbox-pages summary::after { content: "\25BE" / ""; font-size: .85em; transition: transform .15s ease; }   /* flex on a summary hides the native arrow: drawn here */
.inbox-pages[open] summary::after { transform: rotate(180deg); }
.inbox-pages li a { display: flex; align-items: center; min-height: 44px; padding: 0 .5rem; }
.inbox-pages-h { padding: .5rem .5rem 0; color: var(--ink-soft); font-size: var(--t-sm); font-weight: 650; }
.inbox-list h2 { display: flex; align-items: center; gap: .6rem; margin: 0 0 .6rem; font-size: var(--t-lg); }
.inbox-rows { border-top: 1px solid var(--line); }
.inbox-rows li { border-bottom: 1px solid var(--line); }
.inbox-rows a { min-height: 3.6rem; padding: .65rem .75rem; border-left: 4px solid transparent; color: var(--ink); text-decoration: none; }
.inbox-rows a:hover { background: var(--field); color: var(--ink); }
.inbox-rows .is-sel a { background: var(--leaf); border-left-color: var(--sprout); }
.inbox-title { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.inbox-rows .is-read .inbox-title { font-weight: 400; color: var(--ink-soft); }
.inbox-all { margin: .75rem 0 0; }
.inbox-all a { display: inline-flex; align-items: center; min-height: 44px; }
.inbox-item { padding: 1.25rem; border: 1px solid var(--line); border-radius: var(--r-card); background: var(--paper); }
.inbox-item h2 { margin: 0 0 .6rem; font-size: var(--t-xl); }
.inbox-issues { margin: 0 0 1rem; display: flex; flex-wrap: wrap; gap: .4rem; }
.inbox-acts { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem; margin: 0 0 1.25rem; }
.inbox-hint { margin: -.75rem 0 1.25rem; }
.inbox-back { margin: 0 0 .5rem; }
.inbox-back a { display: inline-flex; align-items: center; min-height: 44px; font-weight: 650; }
.inbox-back a::before { content: "\2039"; margin-right: .35rem; font-size: 1.4em; line-height: 1; }
.inbox-facts { display: grid; grid-template-columns: 5.5rem minmax(0, 1fr); margin: 0; border-top: 1px solid var(--line); }
.inbox-facts dt, .inbox-facts dd { margin: 0; padding: .7rem 0; border-bottom: 1px solid var(--line); }
.inbox-facts dt { color: var(--ink-soft); font-size: var(--t-sm); padding-top: .8rem; }
@media (min-width: 56rem) {
  .inbox { grid-template-columns: 15rem minmax(0, 1.2fr) minmax(0, 1fr); gap: 1.5rem; }   /* the rail fits its longest label on one line */
  .inbox-rail > ul { flex-direction: column; flex-wrap: nowrap; gap: .15rem; }
  .inbox-rail > ul a { display: flex; border-radius: var(--r-ctl); box-shadow: none; background: none; }   /* full width: the counts form one column at the rail's right edge */
  .inbox-rail > ul a[aria-current] { box-shadow: inset 3px 0 0 var(--sprout); }
  .inbox-back { display: none; }
  .inbox-item { position: sticky; top: 1rem; }
  .inbox-issues.is-repeat { display: none; }   /* the selected row beside it shows the same chip (audit 5) */
}
@media (max-width: 55.99rem) {
  .inbox:not(.is-open) .inbox-item { display: none; }
  /* The list is the screen: three rows, then "All 12". The rail's current folder names it, so the list's own heading goes. */
  .inbox-list h2 { display: none; }
  .inbox:not(.is-all) .inbox-rows li:nth-child(n+4) { display: none; }
  .inbox.is-open .inbox-rail, .inbox.is-open .inbox-list { display: none; }
  /* The open item is the screen: its buttons sit at the bottom, full width. */
  .inbox-item { display: flex; flex-direction: column; min-height: calc(100svh - 11rem); padding: 1rem; }
  .inbox-hint { order: 8; margin: 0 0 1rem; }
  .inbox-acts { order: 9; margin: auto -1rem -1rem; padding: .85rem 1rem 1rem; position: sticky; bottom: 0; flex-direction: column; align-items: stretch; background: var(--paper); border-top: 1px solid var(--line); }
  .inbox-acts form.inline, .inbox-acts .button, .inbox-acts button { width: 100%; }
  .inbox-facts { margin-bottom: 1.25rem; }
}
/* Four views on a phone (Home): the segments share the row's width instead of wrapping their words. */
@media (max-width: 30rem) {
  .view-switch { width: 100%; }
  .view-switch a { flex: 1 1 auto; justify-content: center; padding: 0 .4rem; white-space: nowrap; }
}
@media print { .view-switch, .view-bar { display: none; } }
@media (forced-colors: active) {
  .view-switch a[aria-current], .inbox-rail > ul a[aria-current] { text-decoration: underline; text-decoration-thickness: 3px; text-underline-offset: .3em; }
  .inbox-rail > ul a { border: 1px solid ButtonText; }
  .inbox-rows .is-sel a { border-left-color: Highlight; }
}

/* ===== Views: One at a time (src/Steps.php, views/ui/steps.php; DESIGN.md, "Views") ===== */
/* One big card per screen. Desktop: the card, with "Coming next" beside it. Phone: the card is the screen, its buttons at the bottom. */
.steps-count { display: flex; align-items: center; gap: 1rem; max-width: 38rem; min-height: 44px; }
.steps-n { margin: 0; font: 800 var(--t-lg)/1 var(--round); white-space: nowrap; }
.steps-pips { display: flex; flex: 1; gap: 5px; }
.steps-pips i { flex: 1; height: 10px; border-radius: 5px; background: var(--paper); box-shadow: inset 0 0 0 1.5px var(--edge); }
.steps-pips i.is-done { background: var(--sprout); box-shadow: inset 0 0 0 1.5px var(--sprout); }
.steps-pips i.is-skip { background: var(--muted-bg); box-shadow: inset 0 0 0 1.5px var(--edge); }
.steps-pips i.is-now { background: var(--sun); box-shadow: inset 0 0 0 1.5px var(--ink); }
.steps-bar { flex: 1; height: 10px; accent-color: var(--sprout); }
.steps-stage { display: grid; gap: 1.5rem; align-items: start; margin-top: .25rem; }
.step-card { display: flex; flex-direction: column; background: var(--paper); border: 1px solid var(--line); border-radius: 26px; overflow: hidden; box-shadow: 0 1px 0 rgba(22, 48, 43, .05), 0 30px 50px -30px rgba(22, 48, 43, .32); }
.step-flag { display: flex; align-items: center; gap: .75rem; margin: 0; max-width: none; padding: .9rem 1.5rem; font: 800 var(--t-lg)/1.2 var(--round); }
.step-flag svg { flex: none; }
.step-flag.is-warn { background: var(--warn-bg); color: var(--warn-ink); }
.step-flag.is-danger { background: var(--danger-bg); color: var(--danger-ink); }
.step-flag.is-ok { background: var(--ok-bg); color: var(--ok-ink); }
.step-flag.is-info { background: var(--info-bg); color: var(--info-ink); }
.step-flag.is-muted { background: var(--muted-bg); color: var(--muted-ink); }
.step-body { display: flex; flex-direction: column; flex: 1; padding: 1.5rem 1.5rem 1rem; }
.step-title { margin: 0; font: 800 clamp(1.9rem, 5vw, 2.6rem)/1.08 var(--round); letter-spacing: -.015em; }
.step-when { margin: .4rem 0 0; font: 700 var(--t-lg)/1.3 var(--round); }
.step-facts { display: grid; grid-template-columns: 5.5rem minmax(0, 1fr); margin: 1.25rem 0 0; border-top: 1px solid var(--line); }
.step-facts dt, .step-facts dd { margin: 0; padding: .55rem 0; border-bottom: 1px solid var(--line); }
.step-facts dt { color: var(--ink-soft); font-size: var(--t-sm); padding-top: .7rem; }
.step-zone { margin-top: 1.25rem; }
.step-hint { margin: 0 0 .75rem; color: var(--ink-soft); font-size: var(--t-sm); }
.step-acts { display: grid; grid-template-columns: 1fr 1fr; gap: .75rem; }
.step-acts:empty { display: none; }
.step-acts > :only-child, .step-acts > .step-form:only-child > button { grid-column: 1 / -1; }
.step-form { display: contents; }
.step-btn { min-height: 3.5rem; padding: .6rem 1rem; border-radius: 18px; font: 800 var(--t-lg)/1.15 var(--round); box-shadow: 0 4px 0 var(--sprout-deep); }
.step-btn:hover { box-shadow: 0 4px 0 var(--ink); }
button.step-btn.secondary, .button.step-btn.secondary { background: var(--paper); color: var(--ink); box-shadow: inset 0 0 0 2px var(--edge), 0 4px 0 var(--line); }
.step-foot { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-top: .75rem; }
.step-foot-end { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 0 1.25rem; margin-left: auto; }
.step-quiet { display: inline-flex; align-items: center; min-height: 44px; padding: 0 .25rem; color: var(--ink-soft); font-weight: 650; }
.step-quiet:hover { color: var(--ink); }
.step-end .step-title { margin-bottom: .5rem; }
.step-zone .step-foot:first-child { margin-top: 0; }
.steps-next h2 { margin: 0; padding: .55rem 0; font-size: var(--t-md); color: var(--ink-soft); }
.steps-next ol { list-style: none; margin: 0; padding: 0; }
.steps-next li { display: grid; grid-template-columns: 2.5rem minmax(0, 1fr); grid-template-areas: "n t" ". d"; column-gap: .75rem; padding: .5rem 0; border-top: 1px solid var(--line); }
.steps-next-n { grid-area: n; display: inline-grid; place-items: center; width: 2.25rem; height: 1.75rem; border-radius: var(--r-pill); box-shadow: inset 0 0 0 1.5px var(--edge); font: 700 var(--t-sm)/1 var(--round); }
.steps-next-t { grid-area: t; font-weight: 650; }
.steps-next-d { grid-area: d; color: var(--ink-soft); font-size: var(--t-sm); }
/* A card with its own form (Decisions): the question behind a toggle, the answer form under the title. */
.step-more { margin: .75rem 0 0; }
.step-more > summary { display: flex; align-items: center; min-height: 44px; font-weight: 650; color: var(--sprout-deep); cursor: pointer; }
.step-more > p { margin: 0 0 .75rem; }
.step-decision { margin: .75rem 0 0; }
.step-decision .step-btn { width: 100%; margin-top: 1rem; }
.step-decision .debrief-choice input { flex: none; }
@media (min-width: 56rem) {
  .steps-stage { grid-template-columns: minmax(0, 38rem) 18rem; column-gap: 3rem; }
  .steps-stage.is-end { grid-template-columns: minmax(0, 38rem); }
}
@media (max-width: 55.99rem) {
  .steps-next { display: none; }
  .steps-stage { margin-top: 0; }
  .steps-count { margin-bottom: .25rem; }
  /* The card is the screen: the buttons sit at the bottom, one per row, within the thumb's reach. */
  .step-card { min-height: calc(100svh - 14rem); border-radius: 22px; }
  .step-body { padding: 1.25rem 1.25rem .75rem; }
  .step-zone { margin-top: auto; padding-top: 1rem; }
  .step-acts { grid-template-columns: 1fr; }
  .step-facts { margin-top: 1rem; }
  .step-facts > :nth-child(n+5) { display: none; }
  .step-btn { min-height: 3.5rem; }
}
@media (forced-colors: active) {
  .step-card, .step-btn { border: 1px solid CanvasText; }
  .steps-pips i { border: 1px solid CanvasText; }
}
@media print { .steps-next { display: none; } }

/* Lead meeting, One at a time (views/lead_meeting_steps.php): presenter mode. Wide card, big type, the facts in one row,
   Reflect and Preview side by side; it has to read from the back of a room at 1280 x 720. */
.step-more.lm-adapt-box { margin-top: .5rem; }
.lm-h { margin: 1rem 0 .25rem; font-size: var(--t-xl); }
@media (min-width: 56rem) { .steps-present .lm-h { margin: .25rem 0 0; font-size: var(--t-lg); } }
.steps-present .lm-h:first-child { margin-top: 0; }
.steps-present .week-last > p { margin-bottom: .4rem; }
@media (min-width: 56rem) {
  /* The head is the Standard view's (crumb, h1, lede and buttons at the same place: DESIGN.md "Width" rule 7); on a projector it gives up only its gap to the card. */
  main:has(> .steps-present) > .page-head { margin-bottom: .5rem; }
  .steps-present .steps-count { max-width: none; min-height: 36px; }
  .steps-present .steps-stage { grid-template-columns: minmax(0, 1fr) 17rem; column-gap: 2rem; margin-top: 0; }
  .steps-present .steps-stage.is-end { grid-template-columns: minmax(0, 44rem); }
  .steps-present .step-flag { padding: .55rem 1.5rem; font-size: var(--t-xl); }
  .steps-present .step-body { padding: 1rem 1.75rem .75rem; font-size: 1.25rem; line-height: 1.4; }
  .steps-present .step-title { font-size: clamp(2.2rem, 3.2vw, 2.7rem); }
  .steps-present .step-when { margin-top: .1rem; font-size: 1.75rem; color: var(--sprout-deep); }
  .steps-present { display: grid; grid-template-columns: auto minmax(0, 1fr); column-gap: 1.5rem; align-items: center; }
  .steps-present > * { grid-column: 1 / -1; }
  .steps-present .week-where { margin: .6rem 0 0; }
  .steps-present .lm-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 0 2.5rem; margin-top: .5rem; }
  .steps-present .week-note { max-width: none; font-size: 1.125rem; }
  .steps-present .chip { font-size: 1rem; }
  .steps-present .step-more > summary { min-height: 36px; font-size: 1.125rem; }
  .steps-present .step-btn { min-height: 3.25rem; }
  /* Back sits beside Next and the bar sticks to the bottom of the screen, so both are always in reach at 720 px; "Coming next" is two titles, not three. */
  .steps-present .step-card { overflow: clip; }   /* not hidden: that would stop the bar below from sticking to the screen */
  .steps-present .step-zone { display: flex; align-items: center; gap: 1.5rem; margin-top: .75rem; position: sticky; bottom: 0; padding: .5rem 0 .25rem; background: var(--paper); }
  .steps-present .step-acts { flex: 1; }
  .steps-present .step-foot { order: -1; margin: 0; }
  .steps-present .step-foot:not(:has(a)) { display: none; }
  .steps-present .steps-next li:nth-child(n+3) { display: none; }
  .steps-present .steps-next-t { font-size: 1.125rem; }
}

/* ===== Views: Calendar (src/CalendarView.php; views/week_calendar.php, term_calendar.php, series_calendar.php, home_calendar.php; DESIGN.md, "Views") ===== */
/* The week grid. A block's place is in class names (no inline style): top and length in 15-minute slots written in base 8
   (cg-t-a3 cg-t-b5 = 3 x 8 + 5 slots from the first hour's line), the lane count and lane (cg-n2 cg-i1). */
.cg-wrap { --slot: 1rem; display: grid; gap: 1.25rem; align-items: start; }
.cg-need { margin: 0 0 1rem; }   /* the grid's own count, at the top of its body; the page head is the shared one (DESIGN.md "Width" rule 7) */
.cg { display: none; }
.cg-axis, .cg-day { display: flex; flex-direction: column; min-width: 0; }
.cg-corner, .cg-dh { height: 3rem; box-sizing: border-box; }
.cg-dh { display: flex; align-items: baseline; justify-content: center; gap: .4rem; margin: 0; padding-top: .6rem; border-left: 1px solid var(--line); border-bottom: 1px solid var(--line); font: 650 var(--t-sm)/1.2 var(--round); color: var(--ink-soft); }
.cg-dh b { font-size: var(--t-lg); color: var(--ink); }
.cg-dh[aria-current] b { padding: 0 .5rem; border-radius: var(--r-pill); background: var(--ink); color: var(--paper); }
.cg-hour { display: block; height: calc(4 * var(--slot)); box-sizing: border-box; padding: .1rem .4rem 0 0; text-align: right; font-size: .75rem; line-height: 1; color: var(--ink-soft); }
.cg-col { position: relative; border-left: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.cg-line { display: block; height: calc(4 * var(--slot)); box-sizing: border-box; border-top: 1px solid var(--line); }
.cg-b { position: absolute; display: flex; flex-direction: column; box-sizing: border-box; overflow: hidden; padding: 2px 5px; border-left: 4px solid var(--sprout); border-radius: 6px; background: var(--leaf); color: var(--ink); font-size: .75rem; line-height: 1.15; text-decoration: none;
  top: calc((var(--ta) * 8 + var(--tb)) * var(--slot)); height: calc((var(--la) * 8 + var(--lb)) * var(--slot) - 1px);
  width: calc(100% / var(--n) - 2px); left: calc(100% / var(--n) * var(--i) + 1px); }
.cg-b:hover { color: var(--ink); box-shadow: 0 2px 6px rgba(22, 48, 43, .25); }
.cg-b[aria-current] { z-index: 1; outline: 2px solid var(--ink); outline-offset: 1px; }
.cg-b > span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cg-s, .cg-w { font-weight: 700; }
.cg-b.is-needs { background: var(--sun); border-left-color: var(--ink); }
.cg-b.is-taught { background: var(--muted-bg); border-left-color: var(--fill-muted); color: var(--muted-ink); }
.cg-b.is-cancelled { background: var(--paper); border: 1px dashed var(--edge); color: var(--ink-soft); }
.cg-b.is-cancelled .cg-s, .cg-b.is-cancelled .cg-r { text-decoration: line-through; }
.cg-w::before, .cg-ag-s::before { margin-right: .25em; font-weight: 800; }
.is-ok .cg-w::before, .is-ok .cg-ag-s::before { content: "\2713"; }
.is-needs .cg-w::before, .is-needs .cg-ag-s::before { content: "\25B2"; }
.is-taught .cg-w::before, .is-taught .cg-ag-s::before { content: "\25CF"; }
.is-cancelled .cg-w::before, .is-cancelled .cg-ag-s::before { content: "\2715"; }
/* The agenda: a phone's week, day by day. */
.cg-date { display: flex; align-items: baseline; gap: .4rem; margin: 1.1rem 0 .4rem; font: 650 var(--t-sm)/1.2 var(--round); color: var(--ink-soft); }
.cg-date b { font-size: var(--t-xl); color: var(--ink); }
.cg-ag-rows { list-style: none; margin: 0; padding: 0; display: grid; gap: .4rem; }
.cg-ag { display: grid; grid-template-columns: 4.75rem minmax(0, 1fr); grid-template-areas: "t w" ". s"; gap: 0 .6rem; align-items: center; min-height: 44px; padding: .5rem .75rem; border-left: 4px solid var(--sprout); border-radius: var(--r-ctl); background: var(--leaf); color: var(--ink); text-decoration: none; }
.cg-ag:hover { color: var(--ink); }
.cg-ag.is-needs { background: var(--sun); border-left-color: var(--ink); }
.cg-ag.is-taught { background: var(--muted-bg); border-left-color: var(--fill-muted); color: var(--muted-ink); }
.cg-ag.is-cancelled { background: var(--paper); border: 1px dashed var(--edge); color: var(--ink-soft); }
.cg-ag-t { grid-area: t; font-weight: 700; }
.cg-ag.is-ok .cg-ag-t::after { content: " \2713"; color: var(--ok-ink); }
.cg-ag-w { grid-area: w; font-weight: 600; }
.cg-ag-s { grid-area: s; font-size: var(--t-sm); font-weight: 700; }
/* The side panel: the lesson's team and its main button. */
.cg-panel { position: relative; padding: 1.25rem; border: 1px solid var(--line); border-radius: var(--r-card); background: var(--paper); }
.cg-panel h2 { margin: 0 0 .4rem; font-size: var(--t-xl); }
.cg-panel p { margin: 0 0 .4rem; }
.cg-chips { display: flex; flex-wrap: wrap; gap: .4rem; margin-bottom: .6rem !important; padding-right: 2.5rem; }
.cg-when { font-weight: 650; }
.cg-where { color: var(--ink-soft); }
.cg-close { position: absolute; top: .4rem; right: .4rem; margin: 0 !important; }
.cg-close a { display: inline-grid; place-items: center; width: 44px; height: 44px; font-size: 1.6rem; line-height: 1; color: var(--ink-soft); text-decoration: none; }
.cg-close a:hover { color: var(--ink); }
.cg-back { display: none; }
.cg-back a { display: inline-flex; align-items: center; min-height: 44px; font-weight: 650; }
.cg-back a::before { content: "\2039"; margin-right: .35rem; font-size: 1.4em; line-height: 1; }
.cg-team { list-style: none; margin: 1rem 0 .5rem; padding: 0; border-top: 1px solid var(--line); }
.cg-team li { padding: .6rem 0; border-bottom: 1px solid var(--line); }
.cg-ok { color: var(--ok-ink); }
.cg-ok::before { content: "\2713"; font-weight: 800; }
.cg-n { color: var(--ink-soft); font-weight: 650; }
.cg-acts { display: grid; gap: .6rem; margin-top: 1rem; }
.cg-acts form.inline, .cg-acts .button, .cg-acts button { width: 100%; }
@media (min-width: 56rem) {
  .cg { display: grid; grid-template-columns: 3.25rem repeat(5, minmax(0, 1fr)); min-width: 38rem; }
  .cg-main { overflow-x: auto; }
  .cg-agenda { display: none; }
  .cg-wrap.has-panel .cg-panel { order: -1; }
}
@media (min-width: 64rem) {
  .cg-wrap.has-panel { grid-template-columns: minmax(0, 1fr) 19rem; }
  .cg-wrap.has-panel .cg-panel { order: 0; position: sticky; top: 1rem; }
}
@media (max-width: 55.99rem) {
  /* A phone's week is the agenda: the dates are in its day headings, the flags in its rows. */
  .cg-need { display: none; }
  .cg-wrap.has-panel .cg-main { display: none; }
  .cg-close { display: none; }
  .cg-back { display: block; }
  .cg-chips { padding-right: 0; }
}
@media print { .cg-panel { display: none; } }
@media (forced-colors: active) {
  .cg-b, .cg-ag { border: 1px solid CanvasText; }
  .cg-b[aria-current] { outline-color: Highlight; }
}
/* Radix classes for a block: top (a: 0-11, b: 0-7), length (a: 0-7, b: 0-7), lanes 1-8, lane 0-7. */
.cg-t-a0{--ta:0}.cg-t-a1{--ta:1}.cg-t-a2{--ta:2}.cg-t-a3{--ta:3}.cg-t-a4{--ta:4}.cg-t-a5{--ta:5}.cg-t-a6{--ta:6}.cg-t-a7{--ta:7}.cg-t-a8{--ta:8}.cg-t-a9{--ta:9}.cg-t-a10{--ta:10}.cg-t-a11{--ta:11}
.cg-t-b0{--tb:0}.cg-t-b1{--tb:1}.cg-t-b2{--tb:2}.cg-t-b3{--tb:3}.cg-t-b4{--tb:4}.cg-t-b5{--tb:5}.cg-t-b6{--tb:6}.cg-t-b7{--tb:7}
.cg-l-a0{--la:0}.cg-l-a1{--la:1}.cg-l-a2{--la:2}.cg-l-a3{--la:3}.cg-l-a4{--la:4}.cg-l-a5{--la:5}.cg-l-a6{--la:6}.cg-l-a7{--la:7}
.cg-l-b0{--lb:0}.cg-l-b1{--lb:1}.cg-l-b2{--lb:2}.cg-l-b3{--lb:3}.cg-l-b4{--lb:4}.cg-l-b5{--lb:5}.cg-l-b6{--lb:6}.cg-l-b7{--lb:7}
.cg-n1{--n:1}.cg-n2{--n:2}.cg-n3{--n:3}.cg-n4{--n:4}.cg-n5{--n:5}.cg-n6{--n:6}.cg-n7{--n:7}.cg-n8{--n:8}
.cg-i0{--i:0}.cg-i1{--i:1}.cg-i2{--i:2}.cg-i3{--i:3}.cg-i4{--i:4}.cg-i5{--i:5}.cg-i6{--i:6}.cg-i7{--i:7}

/* The term strip: a cell per week, a row of marks per classroom (views/ui/term_strip.php). The cells are equal columns without a count. */
.ts { margin: 0 0 1rem; }
.ts-row { display: grid; grid-template-columns: minmax(0, 1fr); gap: .15rem 1rem; align-items: center; padding: .35rem 0; }
.ts-head { padding-top: 0; }
.ts-label { margin: 0; font-weight: 650; overflow-wrap: anywhere; }
.ts-head > .ts-cells { min-width: 0; }
.ts-cells { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); border: 1.5px solid var(--edge); border-radius: var(--r-ctl); overflow: hidden; background: var(--paper); }
.ts-wk, .ts-cell { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .1rem; min-width: 0; box-sizing: border-box; }
.ts-wk { min-height: 44px; padding: .25rem 0; color: var(--ink); text-decoration: none; font-weight: 650; }
.ts-wk + .ts-wk, .ts-cell + .ts-cell { border-left: 1px solid var(--line); }
.ts-wk.is-lessons, .ts-cell.is-lessons { background: var(--leaf); box-shadow: inset 0 -3px 0 var(--leaf-2); }
.ts-wk.is-now, .ts-cell.is-now { box-shadow: inset 0 -3px 0 var(--ink); }
.ts-wk.is-now { background: var(--ink); color: var(--paper); }
a.ts-wk:hover { background: var(--track); color: var(--ink); }
a.ts-wk.is-now:hover { background: var(--ink); color: var(--paper); }
.ts-n { font: 750 var(--t-md)/1 var(--round); }
.ts-flag { display: inline-flex; align-items: center; gap: .15rem; padding: 0 .3rem; border-radius: var(--r-pill); background: var(--sun); color: var(--ink); font-size: .75rem; font-weight: 800; line-height: 1.3; }
.ts-flag::before { content: "\25B2"; font-size: .65rem; }
.ts-cell { min-height: 40px; gap: 3px; }
.ts-mk { display: inline-block; width: .8rem; height: .8rem; box-sizing: border-box; border-radius: 50%; border: 2px solid var(--sprout); background: var(--paper); }
.ts-mk.is-taught { background: var(--fill-ok); border-color: var(--fill-ok); }
.ts-mk.is-needs { width: 0; height: 0; border-radius: 0; border: 0; border-left: .45rem solid transparent; border-right: .45rem solid transparent; border-bottom: .8rem solid var(--fill-warn); background: none; }
.ts-mk.is-cancelled { border-radius: 0; border: 0; width: .8rem; height: .8rem; background: linear-gradient(45deg, transparent 43%, var(--ink-soft) 43% 57%, transparent 57%), linear-gradient(-45deg, transparent 43%, var(--ink-soft) 43% 57%, transparent 57%); }
.ts-key { display: flex; flex-wrap: wrap; gap: .25rem 1.25rem; margin: .25rem 0 1rem; padding: 0; list-style: none; color: var(--ink-soft); font-size: var(--t-sm); }
.ts-key .ts-mk { vertical-align: -.1rem; margin-right: .2rem; }
.ts-list { list-style: none; margin: 0 0 1rem; padding: 0; border-top: 1px solid var(--line); }
.ts-item { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .25rem 1rem; min-height: 44px; padding: .35rem .25rem; border-bottom: 1px solid var(--line); }
.ts-item a { display: inline-flex; align-items: center; min-height: 44px; font-weight: 650; }
.ts-item.is-needs { background: var(--warn-bg); box-shadow: inset 4px 0 0 var(--fill-warn); padding-left: .75rem; }
.ts-item.is-cancelled { color: var(--ink-soft); text-decoration: line-through; }
.ts-word { font-size: var(--t-sm); font-weight: 700; }
@media (min-width: 40rem) {
  .ts-row { grid-template-columns: 14rem minmax(0, 1fr); }   /* the room label on one line (DESIGN.md "Alignment") */
  .ts-head { grid-template-columns: 14rem minmax(0, 1fr); }
  .ts-row > .ts-cells:first-child { grid-column: 2; }   /* the head strip and a row with no label start under the labels */
}
.ts-short { display: none; }
@media (max-width: 39.99rem) {
  /* The phone reads the short label ("Banana Slug · 12", never initials) above its marks, and the full one is the link's aria-label. */
  .ts-abbr .ts-full { display: none; }
  .ts-abbr .ts-short { display: inline; }
  .ts-abbr .ts-row { gap: 0; }
  .ts-abbr .ts-label a { display: inline-flex; align-items: center; min-height: 44px; }
  .ts-flag-n { display: none; }
  .ts-n { font-size: var(--t-sm); }
}
@media (forced-colors: active) { .ts-mk { border-color: CanvasText; } .ts-mk.is-taught { background: CanvasText; } }
@media print { .ts-wk { border: 1px solid CanvasText; } }

/* Home's agenda: the signed-in volunteer's lessons, day by day (views/home_calendar.php). */
.ca-day { margin: 0 0 1rem; }
.ca-date { display: flex; align-items: baseline; gap: .4rem; margin: 1rem 0 .4rem; font: 650 var(--t-sm)/1.2 var(--round); color: var(--ink-soft); }
.ca-date b { font-size: var(--t-xl); color: var(--ink); }
.ca-lessons { list-style: none; margin: 0; padding: 0; display: grid; gap: .5rem; }
.ca-lesson { padding: .75rem 1rem; border-left: 4px solid var(--sprout); border-radius: var(--r-ctl); background: var(--leaf); }
.ca-lesson.status-invited { background: var(--warn-bg); border-left-color: var(--fill-warn); }
.ca-lesson p { margin: 0; }
.ca-when { font-weight: 750; }
.ca-what a { font-weight: 650; }
.ca-lesson .respond { margin-top: .5rem; }
@media (min-width: 40rem) { .ca { max-width: 44rem; } }

/* ==== How it works (/how-it-works): the page map for staff (src/PageMap, views/how_it_works.php, views/how/) ==== */
/* Area colours (mirrors PageMap\Spec::AREAS): --cw the area's panel, --c the edge of its cards (>= 3:1 on
   the panel; also --cl, an edge on white), --cd its label and a selected card's fill (>= 4.5:1 on the
   panel, white on it >= 4.9:1). Validated with the dataviz palette checker; every area is also named in text. */
.pm-a-you { --c: #2a78d6; --cd: #1d6dca; --cw: #f0f6fc; }
.pm-a-week { --c: #e6632f; --cd: #c34300; --cw: #fef4f1; }
.pm-a-terms { --c: #009f6b; --cd: #007f4d; --cw: #eff9f6; }
.pm-a-schools { --c: #c77d00; --cd: #a65e00; --cw: #fef8ed; }
.pm-a-people { --c: #d56a93; --cd: #b14a74; --cw: #fdf6f9; }
.pm-a-numbers { --c: #6250d6; --cd: #6250d6; --cw: #f4f3fc; }
.pm-a-doors { --c: #646e79; --cd: #646e79; --cw: #f6f6f7; }
[class*="pm-a-"] { --cl: var(--c); }
/* This page only: the whole width of the screen (up to 112rem), keeping the right gutter for the note tab. */
main:has(> .pm) { max-width: none; width: min(112rem, 100% - 2rem); padding: .6rem 0 3rem; }
@media (min-width: 76rem) { main:has(> .pm) { width: min(112rem, 100% - 4.5rem); margin-left: max(1rem, 50% - 56rem); } }
/* The first screen: the title and its facts on one line, the role chips on one, the tools on one, then the map. */
.pm .pm-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: .25rem 1.75rem; margin: 0 0 .4rem; }
.pm .pm-head h1 { margin: 0; }
.pm-facts { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; align-items: center; gap: .25rem 1rem; color: var(--ink-soft); }
.pm-facts strong { font: 800 var(--t-lg)/1 var(--round); color: var(--ink); margin-right: .15rem; }
.pm .role-picker { list-style: none; margin: 0 0 .3rem; padding: 0; gap: .35rem; }
@media (min-width: 60rem) {
  /* Compact, so the nine chips fit one row at 1280 px (a mouse, not a thumb, on a wide screen). */
  .pm .role-picker { gap: .25rem; }
  .pm .role-picker a { min-height: 34px; padding: .15rem .5rem; font-size: var(--t-sm); white-space: nowrap; }
}
.pm-tools { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 1.5rem; margin: 0 0 .5rem; }
.pm-count { font-weight: 650; margin: 0; min-height: 1.55em; }
.pm-all { font-size: var(--t-sm); font-weight: 650; }
.pm-tools .pm-jump { margin-left: auto; }

/* The stage: the drawing, and under it its details (never over it). The drawing's width is capped so its
   units stay near one pixel: pill labels 14 px at 1280, 16 px at 1920. A phone: lists instead. */
.pm-stage { position: relative; }
.pm-canvas { max-width: 86rem; margin: 0 auto; }
.pm-svg { display: block; width: 100%; height: auto; overflow: visible; }
.pm-focus-list { display: none; }
@media (min-width: 60rem) {
  .pm-list { display: none; }
  .pm-step:not(.is-current) { display: none; }
}
@media (max-width: 59.99rem) {
  .pm-canvas, .pm-crumbs .pm-arrow-key, .pm-hint { display: none; }
  .pm-focus-list { display: block; }
  .pm-step-nav { display: none; }
  .pm-step { padding: .9rem 1rem; border-radius: var(--r-ctl); background: var(--paper); }
  .pm-step.is-current { box-shadow: inset 0 0 0 2px var(--sprout); }
  .pm-steps { display: grid; gap: .75rem; }
  .pm-step .pm-told li { background: var(--field); }
  /* The role chips scroll sideways in one row, so the page starts sooner. */
  .pm-lens .role-picker { flex-wrap: nowrap; overflow-x: auto; padding-bottom: .25rem; scrollbar-width: thin; }
  .pm-lens .role-picker li { flex: none; }
}
/* Above the drawing in focus: back to the whole map, the walk so far, the key to the arrows. */
.pm-crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: .35rem 1.5rem; margin: .25rem 0 .5rem; }
.pm-whole { font-weight: 700; }
.pm-whole::before { content: "\2190\00a0"; }
.pm-crumb-story { margin: 0; font-size: var(--t-lg); }
.pm-crumb-story .pm-kicker { display: inline; margin-right: .35rem; }
.pm-walk { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; align-items: center; gap: .1rem .4rem; }
.pm-walk li + li::before { content: "\2192"; margin-right: .4rem; color: var(--ink-soft); }
.pm-walk a { display: inline-block; padding: .3rem 0; }
.pm-walk [aria-current] { font-weight: 700; }
.pm-arrow-key { list-style: none; margin: 0 0 0 auto; padding: 0; display: flex; flex-wrap: wrap; gap: .25rem 1.1rem; font-size: var(--t-sm); color: var(--ink-soft); }
.pm-arrow-key li { display: inline-flex; align-items: center; gap: .35rem; }
/* A phone in focus: the page, then where it comes from and leads to, as lists of links. */
.pm-focus-centre { margin: .5rem 0 0; padding-left: .6rem; border-left: 6px solid var(--cl); font-size: var(--t-lg); }
.pm-focus-centre .sub { display: block; font-size: var(--t-sm); }
.pm-focus-list h2 { font-size: var(--t-md); margin: 1rem 0 .25rem; }
.pm-focus-links { list-style: none; margin: 0; padding: 0; }
.pm-focus-links li { padding-left: .6rem; border-left: 4px solid var(--cl); margin-bottom: .2rem; }
.pm-focus-links a { display: inline-block; padding: .55rem 0; min-height: 44px; font-weight: 650; }
.pm-focus-links li.is-off a { color: var(--ink-soft); font-weight: 500; }

/* The drawings (views/how/overview.php, focus.php, pill.php): drawn on the server, sizes in the drawing's
   own units (px inside the viewBox, scaled with it), not rem: present mode scales rem. */
.pm-area rect { fill: var(--cw); stroke: color-mix(in srgb, var(--c) 35%, transparent); stroke-width: 1; }
.pm-area text { fill: var(--cd); font: 800 15px var(--round); letter-spacing: .05em; text-transform: uppercase; }
.pm-band-halo { fill: none; stroke: #FFFFFF; }
.pm-band-line { fill: none; stroke-linecap: butt; }
.pm-band:hover .pm-band-line { stroke-opacity: .8; }
.pm-svg [data-key] { transform-box: fill-box; transform-origin: center; }
.pm-pill { cursor: pointer; }
.pm-pill .pm-box { fill: color-mix(in srgb, var(--c) 9%, #FFFFFF); stroke: var(--c); stroke-width: 1.5; transition: fill .15s ease; }
.pm-pill text { fill: var(--ink); font: 600 14px var(--body); letter-spacing: -.005em; pointer-events: none; }
.pm-focus .pm-pill text { font-size: 15px; }
.pm-pill:hover .pm-box { fill: color-mix(in srgb, var(--c) 22%, #FFFFFF); stroke-width: 2.5; }
.pm-pill:focus { outline: none; }
.pm-pill:focus-visible .pm-box { stroke: var(--ink); stroke-width: 3; }
g.pm-pill { cursor: default; }
/* A page the lens role can't open: hatched, a dashed edge and softer text; never by fading alone (its
   accessible name and the details say so). Ink-soft on the hatch is above 5:1. */
.pm-pill.is-off .pm-box { fill: url(#pm-hatch); stroke-dasharray: 5 4; }
.pm-pill.is-off text { fill: var(--ink-soft); font-weight: 500; }
.pm-pill.is-off { opacity: .8; }
/* A story's next step: a green ring. */
.pm-pill.is-next .pm-box { stroke: var(--sprout); stroke-width: 3; }
/* Focus: the page in the centre, in its area's dark colour; white text on it is >= 4.9:1. */
.pm-centre .pm-box { fill: var(--cd); stroke: var(--cd); }
.pm-centre text { fill: #FFFFFF; }
.pm-centre-area { font: 700 13px var(--body); letter-spacing: .06em; text-transform: uppercase; }
.pm-centre-label { font-family: var(--round); font-weight: 800; }
.pm-centre-what { font: 500 15px var(--body); }
.pm-centre:focus { outline: none; }
.pm-centre.is-off .pm-box { fill: url(#pm-hatch); stroke: var(--cd); stroke-width: 2.5; stroke-dasharray: 8 5; }
.pm-centre.is-off text { fill: var(--ink); }
.pm-centre.is-off .pm-centre-area { fill: var(--ink-soft); }
.pm-col-h { fill: var(--ink-soft); font: 700 14px var(--body); letter-spacing: .06em; text-transform: uppercase; }
.pm-arrow { fill: none; stroke: var(--ink-soft); stroke-width: 1.75; marker-end: url(#pm-arrow); }
.pm-arrow.is-two { marker-start: url(#pm-arrow); }
.pm-arrow.is-after { stroke-dasharray: 5 4; }
.pm-arrow.is-next { stroke: var(--sprout); stroke-width: 3.5; marker-end: url(#pm-arrow-next); }
.pm-arrow.is-next.is-two { marker-start: url(#pm-arrow-next); }
.pm-arrow.is-story { stroke-dasharray: 7 5; }
.pm-arrow-label { fill: var(--ink-soft); font: italic 500 14px var(--body); paint-order: stroke; stroke: #FFFFFF; stroke-width: 5px; stroke-linejoin: round; }
.pm-arrow-label.is-next { fill: var(--sprout-deep); font-style: normal; font-weight: 700; }
/* Under the drawing: the hint and the stories (nothing picked); a page's details or the story's step. */
.pm-under { margin-top: .75rem; }
.pm-hint { margin: 0; max-width: none; font-size: var(--t-sm); color: var(--ink-soft); }
.pm-band-key { display: inline-block; width: 2.2rem; height: .5rem; margin-right: .5rem; vertical-align: middle; border-radius: 2px; background: linear-gradient(90deg, #e6632f, #2a78d6); }
.pm-stories { margin-top: .75rem; }
.pm-stories h2 { font-size: var(--t-lg); margin-bottom: .4rem; }

/* A page's details (views/how/detail.php): under the drawing in short columns, or in a phone's list. */
.pm-area-tag { display: inline-block; margin: 0 0 .25rem; padding-left: .5rem; border-left: 4px solid var(--cl); font-size: var(--t-sm); font-weight: 700; color: var(--ink-soft); }
.pm-detail-h { margin-bottom: .2rem; }
.pm-what { font-size: var(--t-lg); margin-bottom: .5rem; }
.pm-cant { margin: 0 0 .5rem; }
.pm-detail h3 { font-size: var(--t-md); margin: 1rem 0 .4rem; }
.pm-detail-wide { display: grid; grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr)); gap: .5rem 2rem; padding: 1rem 1.15rem; border-radius: var(--r-card); background: var(--paper); box-shadow: inset 0 0 0 1px var(--line); }
.pm-detail-wide h3 { margin: .2rem 0 .4rem; font-size: var(--t-sm); text-transform: uppercase; letter-spacing: .05em; color: var(--ink-soft); }
.pm-detail-wide .pm-detail-main { padding-left: .75rem; border-left: 6px solid var(--cl); }
.pm-detail-wide .pm-what { font-size: var(--t-md); }
.pm-roles { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: .35rem; }
.pm-roles .chip { font-size: var(--t-sm); }
.pm-roles .is-lens { box-shadow: inset 0 0 0 2px var(--sprout); font-weight: 700; }
.pm-flag { margin: .6rem 0 0; font-size: var(--t-sm); font-weight: 650; color: var(--ok-ink); }
.pm-actions, .pm-links { margin: 0; padding-left: 1.15rem; }
.pm-actions li + li, .pm-links li + li { margin-top: .15rem; }
.pm-links a { display: inline-block; padding: .2rem 0; }

/* The intro and the stories (views/how/story.php, views/how/told.php). */
.pm-story-list { list-style: none; margin: 0 0 1rem; padding: 0; display: grid; gap: .5rem; grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr)); }
.pm-story-card { display: block; padding: .65rem .9rem; min-height: 44px; border-radius: var(--r-ctl); background: var(--paper); box-shadow: inset 0 0 0 1.5px var(--line); color: var(--ink); text-decoration: none; }
.pm-story-card:hover { box-shadow: inset 0 0 0 2px var(--sprout); color: var(--ink); }
.pm-story-title { display: block; font-weight: 700; }
.pm-kicker { margin: 0; font-size: var(--t-sm); font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-soft); }
.pm-steps { list-style: none; margin: .5rem 0 0; padding: 0; }
.pm-step.is-current { animation: pm-in .35s ease-out; }
.pm-step-n { margin: 0 0 .25rem; font-size: var(--t-sm); color: var(--ink-soft); }
.pm-step-page { padding-left: .4rem; border-left: 4px solid var(--cl); font-weight: 700; color: var(--ink); }
.pm-do { font: 700 var(--t-lg)/1.3 var(--round); margin: .35rem 0 .75rem; }
.pm-told-h { font-size: var(--t-md); margin: 0 0 .4rem; }
.pm-told { list-style: none; margin: 0 0 .75rem; padding: 0; display: grid; gap: .5rem; }
.pm-told li { padding: .55rem .75rem; border-radius: var(--r-ctl); background: var(--paper); animation: pm-in .4s ease-out both; }
.pm-told li:nth-child(2) { animation-delay: .15s; }
.pm-told li:nth-child(3) { animation-delay: .3s; }
.pm-who { font-weight: 700; }
.pm-whorole { display: block; font-size: var(--t-sm); color: var(--ink-soft); }
.pm-how { display: flex; flex-wrap: wrap; gap: .3rem; margin-top: .35rem; }
.pm-ch { display: inline-flex; align-items: center; gap: .3rem; padding: .1rem .6rem .1rem .45rem; border-radius: var(--r-pill); font-size: var(--t-sm); font-weight: 650; background: var(--info-bg); color: var(--info-ink); }
.pm-ch svg { width: 1.1em; height: 1.1em; flex: none; }
.pm-ch-phone { background: var(--muted-bg); color: var(--muted-ink); }
.pm-ch-email { background: var(--ok-bg); color: var(--ok-ink); }
.pm-nobody { margin: 0 0 .5rem; }
.pm-note { margin: 0; color: var(--ink-soft); }
@keyframes pm-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.pm-step-nav { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .5rem; margin-top: 1rem; }
.pm-step-nav .pm-dots { order: -1; width: 100%; }
.pm .is-hidden { visibility: hidden; }
.pm-dots { display: flex; flex-wrap: wrap; justify-content: center; }
.pm-dot { display: inline-grid; place-items: center; width: 26px; height: 32px; }
.pm-dot::before { content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--fill-muted); transition: transform .2s ease, background .2s ease; }
.pm-dot.is-on::before { background: var(--sprout); transform: scale(1.35); }

/* A phone: every page as a list by area; the role lens fades the ones a role can't open, and says so. */
.pm-list-area { margin: 1.5rem 0 .25rem; padding-left: .6rem; border-left: 4px solid var(--cl); }
.pm-list-area .sub { display: block; }
.pm-items { list-style: none; margin: 0; padding: 0; }
.pm-item details { border-bottom: 1px solid var(--line); }
.pm-item summary { min-height: 44px; padding: .6rem 0; cursor: pointer; }
.pm-item-label { font-weight: 700; }
.pm-item .pm-detail { padding: 0 0 1rem; }
.pm-item .pm-area-tag, .pm-item .pm-what { display: none; }   /* the summary already says both */
.pm-item .pm-detail h3:first-of-type { margin-top: .25rem; }
.pm-item.is-off summary { opacity: .5; }
.pm-item.is-off .pm-item-label::after { content: " · can't open"; font-weight: 400; }

/* Round 2: jump links, comparing two roles, Open this page, ways to view, who hears what, words. */
.pm-jump { display: flex; flex-wrap: wrap; gap: .25rem 1.25rem; margin: 0; font-weight: 650; }
.pm-jump a { display: inline-block; padding: .35rem 0; }
/* "Compare two roles": closed by default; a <details>, so it works without JS. */
.pm-compare summary { display: inline-block; padding: .3rem 0; font-size: var(--t-sm); font-weight: 650; color: var(--sprout-deep); cursor: pointer; text-decoration: underline; text-underline-offset: .2em; }
.pm-compare[open] { flex-basis: 100%; }
.pm-compare-first { margin: .25rem 0 0; font-size: var(--t-sm); color: var(--ink-soft); }
.pm-compare .role-picker { margin: .35rem 0 0; gap: .3rem; }
.pm-compare .role-picker[hidden], .pm-compare li[hidden] { display: none; }
.pm-vs-key { flex-basis: 100%; list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: .35rem 1.25rem; font-size: var(--t-sm); }
.pm-vs-key li { display: inline-flex; align-items: center; gap: .4rem; }
.pm-vs-sw { display: inline-block; width: 1.4rem; height: .95rem; border-radius: 4px; border: 2px solid #2a78d6; background: var(--paper); }
.pm-vs-sw.is-none { border-style: dashed; border-color: var(--edge); background: repeating-linear-gradient(45deg, var(--paper) 0 3px, #E2E8E5 3px 6px); }
.pm-vs-tag { display: inline-block; padding: 0 .5rem; border-radius: var(--r-pill); font-size: var(--t-sm); font-weight: 700; line-height: 1.5; }
.pm-vs-tag.is-a { background: var(--ink); color: var(--paper); }
.pm-vs-tag.is-b { background: #F2C14E; color: #1A1A1A; }
.pm-vs-tag.is-both { background: var(--ok-bg); color: var(--ok-ink); }
.pm-vs-tag.is-none { background: var(--muted-bg); color: var(--muted-ink); }
/* Compare tags on the map: the same two looks as the key (ink, and yellow with an ink edge). */
.pm-tag rect { stroke: var(--paper); stroke-width: 2; }
.pm-svg .pm-pill .pm-tag text { font: 700 12px var(--body); pointer-events: none; }
.pm-tag.is-a rect { fill: var(--ink); }
.pm-tag.is-a text { fill: var(--paper); }
.pm-tag.is-b rect { fill: #F2C14E; stroke: var(--ink); stroke-width: 1.25; }
.pm-tag.is-b text { fill: #1A1A1A; }
.pm-item[class*="is-vs-"] .pm-vs-tag { margin-left: .25rem; vertical-align: .1em; }
.pm-item.is-vs-none summary { opacity: .55; }
.pm-open { margin: 0 0 .5rem; }
.pm-views { margin: 1rem 0 0; font-size: var(--t-sm); }
.pm-opens { margin: .2rem 0 0; font-size: var(--t-sm); color: var(--ink-soft); }

.pm-told-sec, .pm-words-sec { margin-top: 2.5rem; scroll-margin-top: 1rem; }
.pm-key { list-style: none; margin: 0 0 .75rem; padding: 0; display: flex; flex-wrap: wrap; gap: .4rem 1.25rem; font-size: var(--t-sm); color: var(--ink-soft); }
.pm-key li { display: inline-flex; align-items: center; gap: .4rem; }
.pm-key .pm-key-own { font-weight: 650; color: var(--ink); }
.pm-grid { background: var(--paper); border-radius: var(--r-card); }
.pm-grid thead th { position: sticky; top: 0; z-index: 1; white-space: normal; font-size: var(--t-sm); line-height: 1.25; }
.pm-grid th[scope="row"] { font-weight: 400; }
.pm-grid-what { font-weight: 700; }
.pm-grid th .sub { display: block; }
.pm-grid-group th { padding-top: 1.1rem; background: var(--paper); font: 750 var(--t-md)/1.2 var(--round); border-bottom: 2px solid var(--ink); }
.pm-grid-how { display: flex; flex-wrap: wrap; gap: .25rem; }
@media (min-width: 60rem) {
  /* Seven columns: in a cell each channel is a short word (App, Email, Phone) with its icon. */
  .pm-grid { table-layout: fixed; }
  .pm-grid .pm-ch { padding: .1rem .5rem .1rem .35rem; }
  .pm-grid thead th:first-child { width: 26%; }
  .pm-grid td { text-align: center; }
  .pm-grid .pm-grid-how { justify-content: center; }
  .pm-grid thead th:not(:first-child) { text-align: center; }
  .pm-grid td.pm-grid-none { text-align: left; }
}
.pm-grid-note { display: block; margin-top: .2rem; font-size: var(--t-sm); color: var(--ink-soft); }
.pm-grid th .pm-grid-also { margin-top: .2rem; color: var(--ink); font-weight: 600; }
.pm-grid-none { vertical-align: middle; }
.pm-grid-row:hover > * { background: var(--field); }
.pm-grid-row:target > * { background: var(--ok-bg); }
@media (max-width: 59.99rem) {
  /* A phone: each event is a card that lists only who is told, each with their name. */
  .pm-grid, .pm-grid tbody, .pm-grid tr, .pm-grid th, .pm-grid td { display: block; width: auto; }
  .pm-grid { background: none; }
  .pm-grid thead { display: none; }
  .pm-grid-row { margin: 0 0 .6rem; padding: .7rem .9rem; border-radius: var(--r-ctl); background: var(--paper); }
  .pm-grid-row:hover > * { background: none; }
  .pm-grid th, .pm-grid td { padding: .15rem 0; border: 0; }
  .pm-grid th[scope="row"] { width: auto; margin-bottom: .25rem; }
  .pm-grid-group th { padding: 1rem 0 .4rem; background: none; }
  .pm-grid td.is-blank[data-who] { display: none; }
  .pm-grid td[data-who] { display: flex; flex-wrap: wrap; align-items: center; gap: .25rem .5rem; }
  .pm-grid td[data-who]::before { content: attr(data-who); min-width: 8.5rem; font-weight: 650; }
  .pm-grid-note { margin: 0; flex-basis: 100%; padding-left: 9rem; }
}

.pm-words { display: grid; grid-template-columns: repeat(auto-fill, minmax(16rem, 1fr)); gap: .75rem 2rem; margin: 0; }
.pm-words div { padding-left: .75rem; border-left: 3px solid var(--sprout); }
.pm-words dt { font: 750 var(--t-md)/1.3 var(--round); }
.pm-words dd { margin: .1rem 0 0; color: var(--ink-soft); }

/* Present mode (?present=1): for a projector. Type scales with the screen (the tokens are rem). */
html:has(.pm-present) { font-size: clamp(100%, 1.4vw, 200%); }
/* The demo strip too, on a projector only: the slides show no data, and the page itself keeps the strip. */
body:has(.pm-present) .top, body:has(.pm-present) .note-widget, body:has(.pm-present) .note-closed, body:has(.pm-present) .demo-strip { display: none; }
main:has(> .pm-present) { max-width: none; width: auto; margin: 0; padding: .5rem 1.5rem .75rem; }
/* The whole screen: the title row, the stage, the Back/Next row. The stage takes what is left. */
.pm-present { display: flex; flex-direction: column; height: calc(100vh - 1.25rem); height: calc(100dvh - 1.25rem); }
.pm-pres-head { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem 1rem; margin-bottom: .5rem; }
.pm-pres-title { margin: 0; font: 800 var(--t-lg)/1.2 var(--round); }
.pm-pres-parts { display: flex; flex-wrap: wrap; gap: .15rem; flex: 1; }
.pm-pres-parts a { padding: .1rem .5rem; border-radius: var(--r-pill); font-size: .75rem; color: var(--ink-soft); text-decoration: none; }
.pm-pres-parts a[aria-current] { background: var(--ink); color: var(--paper); }
.pm-pres-exit { font-size: var(--t-sm); white-space: nowrap; }
/* The drawing on top, as large as the screen leaves room for; the words in a band under it. */
.pm-pres-stage { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; gap: .75rem; }
.pm-pres-canvas { flex: 1 1 auto; min-height: 0; }
.pm-pres-canvas .pm-svg { height: 100%; }
.pm-pres-panel { flex: none; max-height: 100%; overflow: auto; }
.pm-slide-is-intro .pm-pres-panel, .pm-slide-is-areas .pm-pres-panel { font-size: var(--t-md); }
.pm-slide-is-intro .pm-pres-panel h2, .pm-slide-is-areas .pm-pres-panel h2 { font-size: var(--t-xl); margin-bottom: .35rem; }
.pm-slide-intro { display: flex; flex-wrap: wrap; align-items: baseline; gap: .25rem 2.5rem; }
.pm-slide-intro h2, .pm-slide-intro .pm-big-facts { margin: 0; }
.pm-slide-intro p { flex-basis: 100%; margin: 0; max-width: none; }
.pm-slide-intro .pm-big-facts strong { display: inline; margin-right: .3rem; font-size: var(--t-2xl); }
.pm-slide-areas .pm-pres-areas { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .35rem 1.5rem; }
/* A story step: what happens on the left, who is told on the right. */
.pm-slide-step { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: .5rem 2rem; align-items: start; }
.pm-slide-step .pm-told { grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr)); }
.pm-pres-panel { font-size: var(--t-lg); }
.pm-pres-panel h2 { font-size: var(--t-2xl); }
.pm-slide { animation: pm-in .45s ease-out; }
.pm-slide .pm-do { font-size: var(--t-xl); margin: .25rem 0 0; }
.pm-slide .pm-told { gap: .35rem; }
.pm-slide .pm-told li { font-size: var(--t-md); background: var(--field); padding: .4rem .75rem; }
.pm-slide .pm-step-page { display: inline-block; margin: .5rem 0 0; font-size: var(--t-md); }
.pm-area-h { padding-left: .6rem; border-left: 6px solid var(--cl); }
.pm-pres-what { color: var(--ink-soft); }
.pm-pres-pages { list-style: none; margin: 0; padding: 0; display: grid; gap: .35rem; font-size: var(--t-md); }
.pm-pres-pages span { color: var(--ink-soft); }
.pm-pres-areas { list-style: none; margin: 0; padding: 0; display: grid; gap: .45rem; font-size: var(--t-md); }
.pm-pres-areas li { padding-left: .6rem; border-left: 6px solid var(--cl); }
.pm-pres-areas span { color: var(--ink-soft); }
.pm-pres-big strong { font: 800 var(--t-3xl)/1 var(--round); color: var(--sprout); margin-right: .25rem; }
.pm-pres-groups { list-style: none; margin: 0 0 1.25rem; padding: 0; display: flex; flex-wrap: wrap; gap: .5rem; }
.pm-pres-groups li { padding: .2rem .9rem; border-radius: var(--r-pill); background: var(--field); font-weight: 650; }
.pm-present .pm-key-own { font-weight: 700; }
.pm-big-facts { list-style: none; margin: 0 0 1rem; padding: 0; display: flex; gap: 1.5rem; }
.pm-big-facts strong { display: block; font: 800 var(--t-3xl)/1 var(--round); color: var(--sprout); }
.pm-pres-tips { font-size: var(--t-xl); font-weight: 700; padding-left: 1.5rem; }
.pm-pres-foot { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-top: .5rem; }
/* The grid and the words take the whole stage. */
.pm-present.is-wide .pm-pres-panel { font-size: var(--t-md); }
.pm-present .pm-grid { font-size: var(--t-md); }
.pm-present .pm-grid thead th { font-size: var(--t-md); }
.pm-present .pm-grid th, .pm-present .pm-grid td { padding: .3rem .7rem; }
.pm-present .pm-grid .sub, .pm-present .pm-grid-note { font-size: var(--t-sm); }
.pm-present .pm-grid .pm-ch-word { display: inline; }
.pm-present .pm-grid { table-layout: fixed; }
.pm-present .pm-grid thead th:first-child { width: 36%; }
.pm-present .pm-key { margin-bottom: .4rem; }
.pm-part { font-size: var(--t-lg); font-weight: 600; color: var(--ink-soft); }
.pm-present .pm-grid .pm-ch { padding: .05rem .5rem; }
/* The summary slide: each channel as its word only, side by side, so six rows fit one screen. */
.pm-present .pm-grid .pm-ch svg { display: none; }
.pm-present .pm-grid-how { flex-wrap: nowrap; justify-content: center; }
.pm-present .pm-grid th, .pm-present .pm-grid td { vertical-align: middle; }
.pm-present .pm-words { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .6rem 2rem; }
.pm-present .pm-words dd { font-size: var(--t-sm); }
@media (max-width: 59.99rem) {
  .pm-present { height: auto; }
  .pm-pres-canvas .pm-svg { height: auto; max-height: 50vh; }
  .pm-slide-areas .pm-pres-areas { grid-template-columns: 1fr 1fr; }
  .pm-slide-step { grid-template-columns: 1fr; }
}
@media (max-width: 40rem) {
  /* A phone: the title and Exit on one line; the parts are the dots below. */
  .pm-pres-head { flex-wrap: nowrap; justify-content: space-between; }
  .pm-pres-parts, .pm-pres-esc { display: none; }
  .pm-pres-title { font-size: var(--t-md); }
}
@media (prefers-reduced-motion: reduce) {
  .pm-told li, .pm-step.is-current, .pm-slide { animation: none; }
  .pm-pill .pm-box { transition: none; }
}
@media (forced-colors: active) {
  .pm-story-card, .pm-ch, .pm-told li { border: 1px solid CanvasText; }
  .pm-pill .pm-box, .pm-centre .pm-box { stroke: CanvasText; }
  .pm-arrow, .pm-band-line { stroke: CanvasText; }
}
@media print { .pm-lens, .pm-tools, .pm-step-nav { display: none; } }

/* ===== Views: Table (src/TableView.php, src/Tables.php; views/table.php, views/ui/table.php; DESIGN.md, "Views") ===== */
/* A sticky header over rows, one action in the last column. Up to 700 px each row is a card of "label: value" and
   the sort is a row of links. */
.tv { display: grid; grid-template-columns: minmax(0, 1fr); gap: .75rem; }
.tv-chips { display: flex; flex-wrap: wrap; gap: .5rem; }
.tv-chips a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 1.1rem; border: 1.5px solid var(--edge); border-radius: var(--r-pill); background: var(--paper); color: var(--ink); font-size: var(--t-sm); font-weight: 650; text-decoration: none; }
.tv-chips a:hover { background: var(--field); }
.tv-chips a[aria-current] { background: var(--sprout-deep); border-color: var(--sprout-deep); color: var(--paper); }   /* paper on it 7.9:1 */
.tv-filters { display: flex; flex-wrap: wrap; align-items: flex-end; gap: .5rem .75rem; }
.tv-filters label { margin: 0; font-size: var(--t-sm); color: var(--ink-soft); }
.tv-filters select { width: auto; min-width: 9rem; max-width: 100%; }
.tv-count { display: flex; flex-wrap: wrap; align-items: center; gap: .1rem 1rem; margin: 0; font-weight: 650; }
.tv-count a { font-weight: 600; }
.tv-sort { display: none; }
.tv-wrap { position: relative; max-height: min(78svh, 46rem); overflow: auto; margin: 0; border: 1px solid var(--edge); border-radius: var(--r-card); background: var(--paper); }
.tv-wrap:focus-visible { outline-offset: 3px; }
.tv-table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: .95rem; }
.tv-table th, .tv-table td { padding: .55rem .85rem; text-align: left; vertical-align: middle; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.tv-table tr > :last-child { border-right: 0; }
.tv-table tbody tr:last-child > * { border-bottom: 0; }
.tv-table thead th { position: sticky; top: 0; z-index: 2; background: var(--field); font-size: var(--t-sm); font-weight: 650; color: var(--ink-soft); white-space: normal; vertical-align: bottom; box-shadow: inset 0 -1px 0 var(--edge); }
.tv-table thead th a { color: inherit; text-decoration: none; }
.tv-table thead th a:hover { color: var(--ink); text-decoration: underline; }
.tv-table thead th[aria-sort] { background: var(--leaf); color: var(--sprout-deep); }   /* 7.0:1 */
.tv-table thead th[aria-sort="ascending"] a::after { content: " \25B2" / ""; }
.tv-table thead th[aria-sort="descending"] a::after { content: " \25BC" / ""; }
.tv-table tbody th[scope=row] { font-weight: 650; }
.tv-table tbody th[scope=row], .tv-table thead th:first-child { position: sticky; left: 0; min-width: 11rem; background: var(--paper); box-shadow: 1px 0 0 var(--line); }
.tv-table thead th:first-child { z-index: 3; background: var(--field); box-shadow: 1px 0 0 var(--line), inset 0 -1px 0 var(--edge); }
.tv-table .num { text-align: right; font-variant-numeric: tabular-nums; }
.tv-table td.is-na { color: var(--ink-soft); text-align: center; }
.tv-table .tv-phone { display: none; }   /* only a phone's card has it (the wide table shows every step) */
.tv-table .sub { display: block; margin-top: .15rem; font-size: var(--t-sm); }
.tv-table th[scope=row] .sub { font-weight: 400; }
.tv-table .tv-act { white-space: nowrap; width: 1%; }
.tv-table td.tv-act .sub { max-width: 11rem; white-space: normal; }
.tv-table td.tv-act .tv-more { font-size: .85em; margin-left: .5rem; }
.tv-table tbody td.tv-act, .tv-table thead th.tv-act { position: sticky; right: 0; background: var(--paper); box-shadow: -1px 0 0 var(--line); }   /* the button stays in view when the steps scroll */
.tv-table thead th.tv-act { z-index: 3; background: var(--field); box-shadow: -1px 0 0 var(--line), inset 0 -1px 0 var(--edge); }
.tv-table td.tv-act form { display: flex; flex-direction: column; align-items: flex-start; }
@media (max-width: 43.75rem) {
  .tv-sort { display: flex; flex-wrap: wrap; align-items: center; gap: 0 .25rem; font-size: var(--t-sm); }
  .tv-sort span { margin-right: .25rem; font-weight: 650; color: var(--ink-soft); }
  .tv-sort a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 .45rem; font-weight: 600; white-space: nowrap; }
  .tv-sort a[aria-current] { color: var(--ink); text-decoration-thickness: 2px; }
  .tv-wrap { max-height: none; overflow: visible; border: 0; background: none; }
  .tv-table, .tv-table tbody { display: block; }
  .tv-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  .tv-table tbody tr { display: grid; grid-template-columns: minmax(0, 1fr); gap: .3rem; margin: 0 0 .75rem; padding: .8rem .9rem; border: 1px solid var(--edge); border-radius: var(--r-card); background: var(--paper); }
  .tv-table tbody tr:last-child > * { border-bottom: 0; }
  .tv-table tbody th[scope=row] { grid-column: 1 / -1; position: static; min-width: 0; padding: 0; border: 0; box-shadow: none; background: none; font-size: var(--t-md); display: flex; flex-wrap: wrap; align-items: center; gap: .2rem .5rem; }
  .tv-table tbody th[scope=row] > .chip { margin-inline-start: auto; }   /* the card's name leads, its chip trails */
  .tv-table tbody th[scope=row] > .sub { flex-basis: 100%; }
  .tv-table tbody td { min-width: 0; padding: 0; border: 0; text-align: left; overflow-wrap: anywhere; }
  /* A card's cell is a row (DESIGN.md "Alignment"): the column's name leads, the value or chip trails at the card's right edge;
     a sentence under it (.sub, Details) takes the full width. */
  .tv-table td[data-label] { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: .2rem .75rem; text-align: right; }
  .tv-table td[data-label]::before { content: attr(data-label) / ""; flex: 1 1 7rem; min-width: 0; color: var(--ink-soft); font-size: var(--t-sm); font-weight: 600; text-align: left; }
  .tv-table td[data-label] > :is(.sub, details, p, div, form) { flex-basis: 100%; text-align: left; }
  .tv-table td.tv-wide, .tv-table td.tv-act { grid-column: 1 / -1; }
  .tv-table td:empty, .tv-table td.is-na, .tv-table td.is-done { display: none; }   /* a card leaves out what is finished or does not apply */
  .tv-table td.tv-phone { display: flex; grid-column: 1 / -1; }
  .tv-table .sub { display: inline; }
  .tv-table td.tv-act { width: auto; position: static; box-shadow: none; background: none; }
  .tv-table td.tv-act form { flex-direction: row; align-items: center; gap: .5rem; flex-wrap: wrap; }
  .tv-table td.tv-act .sub { max-width: none; }
  .tv-table td.tv-act .button, .tv-table td.tv-act button { min-width: 8rem; }
}
@media print { .tv-chips, .tv-filters, .tv-sort { display: none; } .tv-wrap { max-height: none; overflow: visible; } }
@media (forced-colors: active) {
  .tv-chips a[aria-current] { text-decoration: underline; text-decoration-thickness: 3px; text-underline-offset: .3em; }
  .tv-table thead th[aria-sort] { text-decoration: underline; }
}

/* ===== Views: Tiles (src/TileView.php, src/Tiles.php; views/tiles.php, views/ui/tile_drawer.php; DESIGN.md, "Views") ===== */
/* A wall of tiles: a number, a label, a status mark. Need is dark, wait is yellow, fine is white; the mark (!, a dotted circle, a tick) says it too, the word is for a screen reader (fix3-home). A tile with a list is a link and opens a drawer. */
.tl { display: grid; gap: 1.25rem; align-items: start; }
.tl-page .view-body > .bed { margin-top: 2rem; }
.tl-wall { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .75rem; }
@media (min-width: 40rem) { .tl-wall { grid-template-columns: repeat(auto-fill, minmax(14.5rem, 1fr)); } }
.tl-tile { position: relative; display: flex; flex-direction: column; gap: .15rem; height: 100%; min-height: 10.5rem; padding: 1rem 1.1rem 1.1rem; border: 1px solid var(--edge); border-radius: 1.25rem; background: var(--paper); color: var(--ink); text-decoration: none; }
.tl-tile.is-need { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.tl-tile.is-wait { background: var(--warn-bg); border-color: var(--fill-warn); }
a.tl-tile:hover { border-color: var(--ink); color: inherit; box-shadow: 0 2px 0 var(--ink); }
a.tl-tile.is-need:hover { background: #1D3D36; color: var(--paper); }
a.tl-tile::after { content: "\203A" / ""; position: absolute; top: .55rem; right: .9rem; font: 700 1.5rem/1 var(--round); opacity: .7; }
a.tl-tile[aria-current] { box-shadow: 0 0 0 3px var(--paper), 0 0 0 6px var(--sun-deep); }
.tl-n { font: 800 3.25rem/1 var(--round); letter-spacing: -.02em; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.tl-label { margin-top: .35rem; font: 700 var(--t-lg)/1.2 var(--round); }
.tl-sub { font-size: var(--t-sm); color: var(--ink-soft); }
.tl-tile.is-need .tl-sub { color: #DCEBE0; }   /* 11.6:1 on ink */
.tl-tile.is-wait .tl-sub { color: var(--ink); }
.tl-status { display: inline-flex; align-items: center; gap: .35rem; align-self: flex-start; margin-top: auto; padding: .18rem .65rem .18rem .5rem; border-radius: var(--r-pill); background: var(--ok-bg); color: var(--ok-ink); font-size: var(--t-sm); font-weight: 700; line-height: 1.3; }
.tl-status::before { font-size: .85em; line-height: 1; }
.tl-tile.is-fine .tl-status::before { content: "\2713" / ""; }
.tl-tile.is-wait .tl-status { background: var(--paper); color: var(--warn-ink); }
.tl-tile.is-wait .tl-status::before { content: "\25CC" / ""; font-weight: 900; }   /* a dotted circle: not yet */
.tl-tile.is-need .tl-status { background: var(--danger-bg); color: var(--danger-ink); }
.tl-tile.is-need .tl-status::before { content: "!" / ""; font-weight: 900; }
/* The drawer: from 56rem beside the wall, which narrows to make room; a phone shows the drawer in place of the wall. */
.tl-drawer { padding: 1rem 1.1rem 1.1rem; border: 1.5px solid var(--edge); border-radius: 1.25rem; background: var(--paper); scroll-margin-top: 1rem; }
.tl-drawer:focus { outline: none; }
.tl-drawer-head { display: flex; align-items: center; justify-content: space-between; gap: .75rem; }
.tl-drawer h2 { display: flex; align-items: baseline; gap: .55rem; margin: 0; font-size: var(--t-lg); }
.tl-drawer-n { font: 800 var(--t-2xl)/1 var(--round); font-variant-numeric: tabular-nums; }
.tl-close { display: inline-flex; align-items: center; min-height: 44px; padding: 0 .85rem; border-radius: var(--r-ctl); box-shadow: inset 0 0 0 1.5px var(--edge); color: var(--ink); font-weight: 650; text-decoration: none; }
.tl-close:hover { background: var(--field); color: var(--ink); }
.tl-drawer .flash { margin: .75rem 0 0; }
.tl-rows { list-style: none; margin: .6rem 0 0; padding: 0; border-top: 1px solid var(--line); }
.tl-rows li { padding: .7rem 0; border-bottom: 1px solid var(--line); }
.tl-what { display: flex; flex-direction: column; align-items: flex-start; gap: .2rem; }
.tl-what strong { font-weight: 700; }
.tl-none { margin: 1rem 0 .25rem; color: var(--ink-soft); font-weight: 600; }
.tl-all { margin: .5rem 0 0; }
.tl-all a { display: inline-flex; align-items: center; min-height: 44px; font-weight: 600; }
@media (min-width: 56rem) {
  .tl-all-phone { display: none; }
  .tl.has-drawer { grid-template-columns: minmax(0, 1fr) minmax(0, 26rem); }
  .tl.has-drawer .tl-wall { grid-template-columns: repeat(auto-fill, minmax(9.5rem, 1fr)); }
  .tl.has-drawer .tl-tile { min-height: 8rem; }
  .tl.has-drawer .tl-n { font-size: var(--t-2xl); }
  .tl.has-drawer .tl-label { font-size: var(--t-md); }
}
@media (max-width: 55.99rem) {
  .tl.has-drawer .tl-wall { display: none; }
  .tl-page:has(.tl-drawer) .page-head :is(.lede, .crumb) { display: none; }   /* the drawer is the screen: heading, then its rows */
  .tl-drawer:not(.is-all) .tl-rows li:nth-child(n+3) { display: none; }       /* two rows on a phone; "All N" lists the rest */
}
@media (max-width: 30rem) { .tl-sub { display: none; } .tl-tile { min-height: 8.5rem; padding: .85rem .9rem; } .tl-n { font-size: 2.6rem; } .tl-label { font-size: var(--t-md); } .tl-rows .tl-sub { display: block; } }
@media (forced-colors: active) {
  .tl-tile, .tl-status { border: 1px solid CanvasText; }
  a.tl-tile[aria-current] { outline: 3px solid Highlight; }
}

/* ===== Views: Board (src/BoardView.php; views/stage_board.php, views/ui/stage_board.php; DESIGN.md, "Views") ===== */
/* One column per stage, a card per item. From 56rem every column shows; a phone shows the one its stage tab (a link) names.
   The leftmost column that needs the viewer (.bd-now) is wider and tinted. Tones: now, soon (needs someone), wait (someone else's move), ready, done. */
.bd-page .page-head { margin-bottom: 1.25rem; }
.bd-n { display: inline-grid; place-items: center; min-width: 1.6rem; height: 1.45rem; padding: 0 .4rem; border-radius: var(--r-pill); background: var(--paper); box-shadow: inset 0 0 0 1px var(--line); color: var(--ink); font-size: var(--t-sm); font-weight: 700; line-height: 1; vertical-align: middle; }
.bd-tabs { display: flex; gap: .35rem; margin: 0 0 1rem; }
.bd-tabs a { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .2rem; min-height: 56px; padding: .35rem .15rem; border-radius: var(--r-ctl); background: var(--paper); box-shadow: inset 0 0 0 1.5px var(--edge); color: var(--ink); font-size: var(--t-sm); font-weight: 600; text-decoration: none; }
.bd-tabs a:hover { background: var(--field); color: var(--ink); }
.bd-tabs a[aria-current] { background: var(--leaf); box-shadow: inset 0 0 0 2px var(--sprout), inset 0 -4px 0 var(--sprout); color: var(--sprout-deep); font-weight: 750; }
.bd-tab-w { max-width: 100%; overflow-wrap: anywhere; }
.bd-col { display: none; padding: 0 .65rem .75rem; border-radius: 10px; background: var(--field); }
.bd-col.is-current { display: block; }
.bd-col h2 { display: flex; align-items: center; gap: .5rem; margin: 0; padding: .8rem .25rem .65rem; font-size: 1.1rem; }
.bd-now { background: var(--warn-bg); box-shadow: inset 0 0 0 2px var(--sun); }
.bd-now h2 { margin: 0 -.65rem .75rem; padding: .8rem .9rem; border-radius: 10px 10px 0 0; background: var(--sun); font-size: 1.3rem; }
.bd-now h2 .bd-n { background: var(--ink); box-shadow: none; color: var(--paper); }
.bd-soon { background: var(--warn-bg); }
.bd-wait { background: var(--info-bg); }
.bd-ready { background: var(--leaf); }
.bd-done { background: var(--muted-bg); }
.bd-cards { list-style: none; margin: 0; padding: 0; }
.bd-card { margin: 0 0 .65rem; padding: .7rem .8rem .8rem; border: 1px solid var(--line); border-radius: 6px; background: var(--paper); box-shadow: 0 1px 1px rgba(22, 48, 43, .10), 0 6px 10px -7px rgba(22, 48, 43, .45); }
.bd-now .bd-card { border-top: 5px solid var(--sun); }
.bd-done .bd-card { border: 1px dashed var(--edge); background: transparent; box-shadow: none; }
.bd-card h3 { display: flex; justify-content: space-between; align-items: flex-start; gap: .5rem; margin: 0; font-size: var(--t-md); line-height: 1.25; }
.bd-card h3 a { color: var(--ink); text-decoration: none; }
.bd-card h3 a:hover { text-decoration: underline; }
.bd-done .bd-card h3, .bd-done .bd-card h3 a { color: var(--muted-ink); }
.bd-day { flex: none; padding: .1rem .4rem; border-radius: 4px; background: var(--field); box-shadow: inset 0 0 0 1px var(--line); color: var(--ink); font-family: var(--body); font-size: var(--t-sm); font-weight: 700; white-space: nowrap; }
.bd-line { margin: .2rem 0 0; color: var(--ink-soft); font-size: var(--t-sm); }
.bd-done .bd-line { color: var(--muted-ink); }
.bd-chip { margin: .5rem 0 0; }
.bd-act { margin: .6rem 0 0; }
form.bd-act { display: block; }
.bd-act button, a.bd-act { width: 100%; min-height: 44px; }
.bd-empty { margin: .25rem .25rem .5rem; color: var(--ink-soft); font-size: var(--t-sm); }
.bd-more { margin: 0; }
.bd-more summary { display: flex; align-items: center; justify-content: center; min-height: 44px; border: 1px dashed var(--edge); border-radius: 6px; font-weight: 700; cursor: pointer; list-style: none; }
.bd-more summary::-webkit-details-marker { display: none; }
.bd-more[open] summary { margin-bottom: .65rem; }
@media (min-width: 56rem) {
  .bd-tabs { display: none; }
  .bd-cols { display: grid; gap: .9rem; align-items: stretch; }
  .bd-col { display: block; }
  .bd-lessons .bd-cols { grid-template-columns: minmax(0, 1.35fr) minmax(0, 1.1fr) minmax(0, 1fr) minmax(0, .8fr); }
  .bd-people .bd-cols { grid-template-columns: minmax(0, .85fr) minmax(0, 1.35fr) minmax(0, 1fr) minmax(0, .85fr); }
  .bd-bags .bd-cols { grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); }
}
@media print { .bd-tabs, .bd-act { display: none; } .bd-col { display: block; } }
@media (forced-colors: active) {
  .bd-tabs a[aria-current] { text-decoration: underline; text-decoration-thickness: 3px; text-underline-offset: .3em; }
  .bd-now { outline: 2px solid; }
}

/* ===== Views: Calendar on /me/availability (src/AvailabilityGrid.php; views/ui/availability_grid.php; DESIGN.md, "Views") ===== */
/* The scheduling form's class times as a week grid, inside the Standard form. Each cell is a hidden checkbox (.av-cb) and its label
   (.av-b); a cell's place uses the Calendar's class names (cg-t-a3 ...) and its column, hour and line classes. Ticked: green, solid, a
   filled box and the rank; not ticked: white, dashed, an empty box. Up to 700 px the cells are a list by day. */
.avg { --slot: 1rem; display: grid; grid-template-columns: 3.25rem repeat(5, minmax(0, 1fr)); min-width: 36rem; margin: .5rem 0 1rem; }
.av-cb { position: absolute; opacity: 0; width: 1px; height: 1px; margin: 0; }
.avg .av-b { cursor: pointer; background: var(--paper); border: 1px dashed var(--edge); border-left: 4px solid var(--edge); }
.avg .av-cb:checked + .av-b { background: var(--leaf); border: 1px solid var(--sprout); border-left: 4px solid var(--sprout); }
.avg .av-b:hover { background: var(--field); }
.avg .av-cb:checked + .av-b:hover { background: var(--leaf); }
.avg .av-cb:focus-visible + .av-b { z-index: 2; outline: 3px solid var(--ink); outline-offset: 2px; }
.av-t { font-weight: 700; }
.av-box { display: inline-grid; place-items: center; width: .95em; height: .95em; margin-right: .3em; vertical-align: -.12em; border: 1.5px solid var(--edge); border-radius: 3px; background: var(--paper); }
.av-cb:checked + .av-b .av-box { border-color: var(--sprout); background: var(--sprout); }
.av-cb:checked + .av-b .av-box::after { content: "\2713"; font-size: .75em; font-weight: 800; line-height: 1; color: var(--paper); }
.av-rank { display: none; }
.av-rank::before { content: " \00B7  "; }
.av-cb:checked + .av-b .av-rank { display: inline; }
@media (max-width: 43.75rem) {
  .avg { display: block; min-width: 0; margin-top: 0; }
  .avg .cg-axis, .avg .cg-line, .avg .cg-day.av-none { display: none; }
  .avg .cg-dh { height: auto; justify-content: flex-start; padding: .9rem 0 .3rem; border: 0; font-size: var(--t-md); }
  .avg .cg-col { display: grid; gap: .4rem; border: 0; }
  .avg .av-b { position: static; width: auto; height: auto; min-height: 44px; display: grid; grid-template-columns: 5.5rem minmax(0, 1fr); grid-template-areas: "t s" "t r"; gap: 0 .6rem; align-items: center; padding: .45rem .75rem; font-size: var(--t-md); line-height: 1.25; }
  .avg .av-b > span { white-space: normal; }
  .avg .av-t { grid-area: t; }
  .avg .av-cb:checked + .av-b .av-rank { display: block; font-size: var(--t-sm); font-weight: 600; color: var(--ink-soft); }
  .avg .av-rank::before { content: none; }
  .avg .av-s { grid-area: s; font-weight: 650; }
  .avg .av-r { grid-area: r; font-size: var(--t-sm); color: var(--ink-soft); }
}
@media (forced-colors: active) {
  .avg .av-b { border-color: CanvasText; }
  .avg .av-cb:focus-visible + .av-b { outline-color: Highlight; }
}

/* ===== Views: Calendar on /me/calendar (views/calendar.php, views/ui/my_agenda.php): the agenda sits above the address part ===== */
.cal-agenda { margin-bottom: 2rem; }

/* ===== Views: Table on /roles (src/RolesView.php; views/roles_table.php; DESIGN.md, "Views") ===== */
/* One row per right, one column per role; a tick is the whole reach, a small word a narrower one. The header row and the first column
   stay put. Up to 700 px the grid is hidden and each role is a card (a <details>; the viewer's own open) listing its rights. */
.rv-key { margin: 0 0 .75rem; font-size: var(--t-sm); color: var(--ink-soft); }
.rv-key b { color: var(--ink); }
.rv-wrap { position: relative; max-height: min(78svh, 46rem); overflow: auto; border: 1px solid var(--edge); border-radius: var(--r-card); background: var(--paper); }
.rv-wrap:focus-visible { outline-offset: 3px; }
.rv-table { width: 100%; min-width: 62rem; table-layout: fixed; border-collapse: separate; border-spacing: 0; font-size: var(--t-sm); line-height: 1.3; }
.rv-table th, .rv-table td { padding: .45rem .4rem; text-align: center; vertical-align: middle; border-bottom: 1px solid var(--line); }
.rv-table thead th { position: sticky; top: 0; z-index: 2; white-space: normal; background: var(--field); font-weight: 650; vertical-align: bottom; box-shadow: inset 0 -1px 0 var(--edge); }
.rv-table th.rv-right { width: 12rem; }
.rv-table th.rv-right, .rv-table tbody th[scope=row] { position: sticky; left: 0; padding-left: .75rem; text-align: left; background: var(--paper); box-shadow: 1px 0 0 var(--line); }
.rv-table tbody th[scope=row] { font-weight: 600; }
.rv-table thead th.rv-right { z-index: 3; background: var(--field); color: var(--ink-soft); box-shadow: 1px 0 0 var(--line), inset 0 -1px 0 var(--edge); }
.rv-table .rv-group th { padding: .55rem .75rem .4rem; text-align: left; background: var(--field); font-family: var(--round); font-size: var(--t-md); font-weight: 750; }
.rv-table .rv-group th span { position: sticky; left: .75rem; }
.rv-table .chip { margin-left: .3rem; font-size: var(--t-sm); padding-block: 0; }
.rv-yes { color: var(--sprout-deep); font-size: var(--t-md); font-weight: 800; }
.rv-limit { display: inline-block; white-space: nowrap; padding: 0 .4rem; border: 1px solid var(--edge); border-radius: var(--r-pill); background: var(--field); color: var(--ink); font-size: var(--t-sm); font-weight: 600; line-height: 1.5; }
.rv-table th.is-mine, .rv-table td.is-mine { background: var(--leaf); box-shadow: inset 2px 0 0 var(--sprout), inset -2px 0 0 var(--sprout); }
.rv-table thead th.is-mine { box-shadow: inset 2px 0 0 var(--sprout), inset -2px 0 0 var(--sprout), inset 0 -1px 0 var(--edge); }
.rv-page .you { display: inline-block; padding: 0 .45rem; border-radius: var(--r-pill); background: var(--sprout); color: var(--paper); font-size: var(--t-sm); font-weight: 700; line-height: 1.45; }
.rv-cards { display: none; gap: .6rem; }
.rv-card { border: 1px solid var(--edge); border-radius: var(--r-card); background: var(--paper); padding: 0 .9rem .3rem; }
.rv-card summary { display: flex; flex-wrap: wrap; align-items: baseline; gap: .1rem .6rem; min-height: 44px; padding: .6rem 0; cursor: pointer; list-style: none; }
.rv-card summary::-webkit-details-marker { display: none; }
.rv-card summary::after { content: "\25BE" / ""; margin-left: auto; transition: transform .15s ease; }
.rv-card[open] summary::after { transform: rotate(180deg); }
.rv-name { font: 700 var(--t-lg)/1.2 var(--round); }
.rv-area { margin: .8rem 0 .15rem; font: 650 var(--t-sm)/1.3 var(--round); color: var(--ink-soft); }
.rv-rights { list-style: none; margin: 0; padding: 0; }
.rv-rights li { padding: .4rem 0; border-top: 1px solid var(--line); }
.rv-rights .rv-limit { margin-left: .3rem; }
@media (max-width: 43.75rem) {
  .rv-key, .rv-wrap { display: none; }
  .rv-cards { display: grid; }
}
@media print { .rv-wrap { max-height: none; overflow: visible; } }
@media (forced-colors: active) { .rv-limit { border-color: CanvasText; } .rv-table td.is-mine, .rv-table th.is-mine { border-inline: 2px solid CanvasText; } }

/* ---- Stay in touch and Get the app (ws/network-welcome): the network links, the install button ---- */
.stay-in-touch { margin-top: 1.5rem; }
.stay-in-touch > h2, .stay-in-touch > h3 { margin-top: 0; }
.net-links { margin: 0; }
.net-links dt { margin: .9rem 0 .15rem; font: 650 var(--t-sm)/1.3 var(--round); color: var(--ink-soft); }
.net-links dt:first-child { margin-top: 0; }
.net-links dd { margin: 0; }
.net-links dd a { display: inline-block; padding: .15rem 0; }
@media (pointer: coarse) { .net-links dd a { padding: .45rem 0; } }
.install-app [data-install] { margin: 0; }
.install-app.is-panel, .welcome-done .install-app { margin-top: 1.25rem; padding-top: 1rem; }
.welcome-done .stay-in-touch { margin-top: 1rem; }
.network-section { margin-top: 1.5rem; }

/* ===== Orientation QR codes (ws/join-links): the leader's page, the code, the join pages ===== */
.join-link-form { max-width: 36rem; }
.join-link-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 11rem), 1fr)); gap: 0 1rem; }
.join-link-row input { width: 100%; }
.join-link-list { list-style: none; margin: 0; padding: 0; display: grid; gap: .75rem; max-width: 44rem; }
.join-link p { margin: 0 0 .3rem; }
.join-link-head .who { font: 700 var(--t-md)/1.3 var(--round); margin-right: .25rem; }
.join-link-actions { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; margin: .6rem 0 .25rem; }
.join-link-actions form { margin: 0; }
.join-link-people { margin-top: .5rem; }
.join-link-people > summary { display: inline-flex; align-items: center; min-height: 44px; cursor: pointer; font-weight: 600; color: var(--sprout); }
.join-link-people ul { list-style: none; margin: 0; padding: 0; }
.join-link-people li { display: flex; flex-wrap: wrap; align-items: baseline; gap: .1rem .6rem; padding: .45rem 0; border-top: 1px solid var(--line); }
.join-link-people .who { font-weight: 650; }
.join-qr { max-width: 30rem; margin: 0 auto 2rem; padding: 1.5rem 1rem; text-align: center; background: var(--paper); border: 1px solid var(--line); border-radius: var(--r-card); }
.join-qr-title { margin: 0 0 .2rem; font-size: var(--t-2xl); }
.join-qr-event { margin: 0 0 1rem; color: var(--ink-soft); font-size: var(--t-lg); }
.join-qr-code .qr { display: block; width: min(100%, 22rem); height: auto; margin: 0 auto; }
.join-qr-how { margin: .75rem 0 .25rem; font-weight: 600; }
.join-qr-url { margin: 0; font: var(--t-sm)/1.4 ui-monospace, "SF Mono", Menlo, Consolas, monospace; overflow-wrap: anywhere; color: var(--ink-soft); }
.join-qr-more { margin: 0 auto 2rem; }
.join-qr-more input { width: 100%; font: var(--t-sm)/1.4 ui-monospace, "SF Mono", Menlo, Consolas, monospace; }
.join-qr-facts { padding-left: 1.2rem; }
.join-qr-facts li { margin-bottom: .3rem; }
.demo-code { padding: .6rem .8rem; border-radius: var(--r-ctl); background: var(--info-bg); color: var(--info-ink); }
.code-show { font: 700 var(--t-lg)/1.2 ui-monospace, "SF Mono", Menlo, Consolas, monospace; letter-spacing: .1em; white-space: nowrap; }
@media print {
  .join-qr { max-width: none; border: 0; padding: 0; }
  .join-qr-title { font-size: 28pt; }
  .join-qr-event { font-size: 16pt; color: #000; }
  .join-qr-code .qr { width: 12cm; }
  .join-qr-how { font-size: 14pt; }
  .join-qr-url { font-size: 11pt; color: #000; }
}

/* ===== The onboarding form (ws/onboarding-form; views/onboarding_form.php, views/onboarding_form_leader.php) ===== */
.onboarding-form-head .form-description { max-width: 52rem; }
.form-who { margin: .25rem 0 .75rem; font-weight: 650; color: var(--sprout); }
.onboarding-form-head .demo-note { margin-top: 1rem; }
.q-req { color: var(--danger-ink); font-weight: 700; }
.req-key { font-size: var(--t-sm); color: var(--ink-soft); }
.onboarding-form .q { margin-bottom: 1.5rem; }
.onboarding-form .field-group.q > legend { font: 600 var(--t-md)/1.4 var(--body); }
.form-section { border-top: 1px solid var(--line); margin-top: 2rem; padding-top: 1.25rem; }
.form-section > h2 { margin: 0 0 .5rem; }
/* Sections as blocks: on a wide page the heading sits left and the questions fill the right, in a 12-column grid (a phone: one column, one section per screen). */
.of-grid > * { min-width: 0; }
.of-consent { margin-top: -.5rem; }
.of-checks { display: grid; grid-template-columns: repeat(auto-fill, minmax(13rem, 1fr)); gap: 0 1.25rem; }
.of-checks .tick { margin: .1rem 0; }
.onboarding-form .tick label { display: block; min-height: 0; padding-block: .6rem; }   /* the * stays beside the words when they wrap */
.onboarding-form .tick-other label { padding-block: 0; }
.form-who + .form-description { margin-top: 0; }
@media (min-width: 721px) {
  .of-grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 0 1.5rem; align-items: start; }
  .of-grid > * { grid-column: span 12; }
  .of-grid > .of-span-2 { grid-column: span 2; }
  .of-grid > .of-span-3 { grid-column: span 3; }
  .of-grid > .of-span-4 { grid-column: span 4; }
  .of-grid > .of-span-5 { grid-column: span 5; }
  .of-grid > .of-span-6 { grid-column: span 6; }
  .of-grid > .of-span-8 { grid-column: span 8; }
  .of-grid > .tick.of-span-6 { margin-block: .25rem; }
  .of-grid .consent-words { max-width: 60rem; }
  .onboarding-form:not(.is-stepper) .section-count { display: none; }
}
@media (min-width: 64rem) {
  .form-section { display: grid; grid-template-columns: 13rem minmax(0, 1fr); column-gap: 2.5rem; align-items: start; }
  .form-section > h2 { grid-column: 1; grid-row: 1; }
  .form-section > :not(h2) { grid-column: 2; max-width: 68rem; }
  .onboarding-form > .actions { margin-left: 15.5rem; }
}
.form-section .section-text { color: var(--ink-soft); }
.text-block { margin: 1.5rem 0 1rem; }
.text-block h3 { margin: 0 0 .35rem; font-size: var(--t-md); }
.text-block p { margin: 0; }
.consent-words { font-weight: 600; margin: 0 0 .5rem; overflow-wrap: anywhere; }
div.consent-words { font-weight: 400; border: 1px solid var(--line); border-radius: var(--r-ctl); padding: .75rem 1rem; max-height: 15rem; overflow-y: auto; overscroll-behavior: contain;
  /* shadows at the top and foot show there is more to scroll */
  background: linear-gradient(var(--field) 30%, transparent) top / 100% 2rem no-repeat local, linear-gradient(transparent, var(--field) 70%) bottom / 100% 2rem no-repeat local,
              linear-gradient(rgba(0, 0, 0, .16), transparent) top / 100% .5rem no-repeat scroll, linear-gradient(transparent, rgba(0, 0, 0, .16)) bottom / 100% .5rem no-repeat scroll var(--field); }
div.consent-words:focus-visible { outline: 3px solid var(--sprout); outline-offset: 2px; }
div.consent-words p { margin: 0 0 .75rem; }
div.consent-words p:last-child { margin-bottom: 0; }
.tick-other { grid-template-columns: 1.4rem auto 1fr; align-items: center; }
.tick .other-text { width: 100%; min-width: 0; height: auto; margin: 0; }
.minor-note { color: var(--warn-ink); background: var(--warn-bg); padding: .4rem .6rem; border-radius: var(--r-ctl); }
.form-read { margin: 0 0 2rem; max-width: 44rem; }
.form-answers { margin: 0; }
.form-answers > div { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 3fr); gap: .25rem 1rem; padding: .5rem 0; border-bottom: 1px solid var(--line); }
.form-answers dt { font-weight: 600; }
.form-answers dd { margin: 0; overflow-wrap: anywhere; }
@media (max-width: 40rem) {
  .form-answers > div { grid-template-columns: 1fr; }
}
@media (min-width: 64rem) {   /* a wide page: two columns of answers */
  .form-read { max-width: none; }
  .form-answers { display: grid; grid-template-columns: 1fr 1fr; column-gap: 3rem; }
  .form-answers > div { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
}
.coc-words h3 { font-size: var(--t-md); margin: 1rem 0 .35rem; }
.coc-words ul { margin: 0 0 .75rem; padding-left: 1.25rem; }
.coc-words li { margin: .2rem 0; }

/* ---- Feedback forms (ws/feedback): EV's teacher and instructor forms, the QR page, the answers ---- */
.fb-page { max-width: 44rem; }
.fb-who { margin: 1rem 0; padding: .7rem .9rem; border-left: 4px solid var(--sprout); background: var(--leaf); border-radius: 0 var(--r-ctl) var(--r-ctl) 0; }
.fb-intro p { margin: .5rem 0; }
.fb-form { margin-top: 1.25rem; }
.fb-sec { margin: 0 0 1.5rem; }
.fb-sec > h2 { margin: 2rem 0 .5rem; font-size: var(--t-xl); }
.fb-sec-main > h2, .fb-sec:first-child > h2 { margin-top: 0; }
.fb-text { margin: .4rem 0; color: var(--ink-soft); }
.fb-q { margin: 0 0 1.4rem; }
fieldset.fb-q { border: 0; padding: 0; min-width: 0; }
.fb-q legend, .fb-q > label { display: block; padding: 0; margin-bottom: .45rem; font-weight: 650; line-height: 1.4; }
.fb-req { font-weight: 400; color: var(--ink-soft); white-space: nowrap; }
.fb-q textarea, .fb-q input[type=text], .fb-q select { width: 100%; }
/* A choice: the box, then its words beside it (a long option wraps under its own words); "Other:" gets its text box under it. */
.fb-option { display: grid; grid-template-columns: 1.25rem minmax(0, 1fr); column-gap: .6rem; align-items: start; }
.fb-option label { margin: 0; padding: .55rem 0; font-weight: 400; line-height: 1.35; cursor: pointer; }
.fb-option input[type=radio], .fb-option input[type=checkbox] { width: 1.25rem; height: 1.25rem; margin: .6rem 0 0; accent-color: var(--sprout); }
.fb-option .fb-other { grid-column: 2; width: 100%; margin-bottom: .4rem; }
.fb-form-pick .fb-option { display: inline-grid; }
/* A 1-5 scale: five big targets in a row, the two ends' words under them. */
.fb-scale-row { display: grid; grid-template-columns: repeat(5, minmax(2.75rem, 1fr)); gap: .4rem; max-width: 26rem; }
.fb-scale-pick { position: relative; }
.fb-scale-pick input { position: absolute; opacity: 0; width: 1px; height: 1px; margin: 0; }
.fb-scale-pick label { display: flex; align-items: center; justify-content: center; min-height: 48px; margin: 0; border: 1.5px solid var(--edge);
  border-radius: var(--r-ctl); background: var(--paper); font: 700 var(--t-lg)/1 var(--round); cursor: pointer; }
.fb-scale-pick label:hover { border-color: var(--sprout); background: var(--field); }
.fb-scale-pick input:checked + label { border: 2.5px solid var(--sprout); background: var(--sprout); color: var(--paper); }
.fb-scale-pick input:focus-visible + label { outline: 3px solid var(--ink); outline-offset: 2px; }
.fb-scale[aria-invalid=true] .fb-scale-pick label { border-color: var(--danger-ink); }
.fb-scale-ends { display: flex; justify-content: space-between; gap: 1rem; max-width: 26rem; margin: .35rem 0 0; font-size: var(--t-sm); color: var(--ink-soft); }
@media (forced-colors: active) { .fb-scale-pick input:checked + label { border-width: 4px; } }
/* Branching with no script: a section an answer skips is hidden (EV's "go to section"). Without :has, every
   section shows with its "If you answered ..." line, and the server keeps only the sections reached. */
@supports selector(:has(*)) {
  .fb-form .fb-when, .fb-form .fb-if { display: none; }
  .fb-form:has(input[data-goes~="scheduling"]:checked) .fb-sec-scheduling,
  .fb-form:has(input[data-goes~="constructive"]:checked) .fb-sec-constructive,
  .fb-form:has(input[data-goes~="testimonial"]:checked) .fb-sec-testimonial { display: block; }
}
.fb-known { margin: 1rem 0; }
.fb-thanks { margin-bottom: 1.5rem; }
/* The QR code for the teacher, on the sender's phone and on the printed sheet. */
.fb-qr { text-align: center; }
.fb-qr .qr { display: block; width: min(18rem, 80vw); height: auto; margin: 1rem auto; border: 1px solid var(--line); border-radius: var(--r-ctl); }
.fb-url { font-size: var(--t-sm); word-break: break-all; }
.fb-sheet { max-width: 40rem; }
@media print { .fb-sheet .qr { width: 8cm; border: 0; } }
/* Answers, on a classroom's page and the results. */
.fb-series .fb-mine { margin-bottom: 1rem; }
.fb-send { margin-top: .75rem; }
.fb-form-pick { border: 0; padding: 0; margin: 0 0 .5rem; min-width: 0; display: flex; flex-wrap: wrap; gap: 0 1.25rem; }
.fb-form-pick legend { padding: 0; font-weight: 650; }
.fb-links { margin: .25rem 0 .75rem; padding-left: 1.1rem; font-size: var(--t-sm); color: var(--ink-soft); }
.fb-answer-card { margin: .5rem 0; padding: 0 .9rem; border: 1px solid var(--line); border-radius: var(--r-card); background: var(--paper); }
.fb-answer-card > summary { display: flex; flex-wrap: wrap; align-items: center; gap: .3rem .6rem; min-height: 44px; padding: .5rem 0; cursor: pointer; }
.fb-answer { margin: 0 0 .75rem; }
.fb-answer dt { margin-top: .7rem; font-size: var(--t-sm); color: var(--ink-soft); }
.fb-answer dd { margin: .15rem 0 0; white-space: normal; overflow-wrap: anywhere; }
.fb-answer-card .fb-remove { margin: 0 0 .75rem; }
.fb-answer-card .fb-remove form { margin: .5rem 0; }
.fb-avg td.num .sub { font-size: var(--t-sm); }
.fb-total th, .fb-total td { font-weight: 700; border-top: 2px solid var(--line); }
.fb-words { margin: .5rem 0; }
.fb-words > summary { min-height: 44px; padding: .5rem 0; cursor: pointer; font-weight: 650; }
.fb-leads { padding-left: 1.1rem; }
.fb-testimonial { margin: 1rem 0; padding: .75rem 1rem; border-left: 4px solid var(--leaf-2); background: var(--field); border-radius: 0 var(--r-ctl) var(--r-ctl) 0; }
.fb-testimonial blockquote { margin: 0 0 .6rem; }
.fb-testimonial blockquote p { margin: .15rem 0; }
.fb-testimonial figcaption { font-size: var(--t-sm); color: var(--ink-soft); }
.fb-remove-inline { margin-top: .5rem; }
.fb-scale-ends span:last-child { text-align: right; }

/* ---- Exports for EV's staff sheets (ws/exports): National's Operations Overview links, Student experiences ---- */
.ops-links { list-style: none; margin: .75rem 0 0; padding: 0; display: grid; gap: .5rem; }
.experiences .se-total th, .experiences .se-total td { font-weight: 700; border-top: 2px solid var(--line); }
.matrix.experiences th[scope=row], .matrix.experiences thead th:first-child { min-width: 10rem; }
.matrix.experiences td { min-width: 4.5rem; }

/* ---- Scheduling forms (ws/sched-forms): clearance per class time, the form's extra answers,
        the teacher outreach link and its requests (0022) ---- */
.slot-what .slot-clear, .slot-what .slot-needs { margin-top: .35rem; }
.slot-needs { color: var(--ink-soft); overflow-wrap: anywhere; }
.slot-what .slot-clear .chip, .slot-what .slot-needs .chip { margin-top: 0; }
.av-school-needs { list-style: none; padding: 0; margin: .75rem 0 0; display: grid; gap: .35rem; overflow-wrap: anywhere; }
.choice-col .tick { margin: .2rem 0; }
.form-due { margin: .25rem 0 0; }
.people-table th[scope=row] .chip { margin-left: .35rem; }
.people-table th[scope=row] .sub, .people-table .clear-cell > .sub { display: block; font-weight: 400; }
.people-table .note-cell { min-width: 14rem; white-space: pre-line; overflow-wrap: anywhere; }
.outreach-form .slot-pref-row { display: grid; grid-template-columns: minmax(8rem, 1.4fr) 1fr 1fr; gap: .5rem .75rem; }
.outreach-form .slot-pref-row .field { margin: 0; }
.outreach-form input.short, .narrow-form input.short { max-width: 8rem; }
@media (max-width: 30rem) { .outreach-form .slot-pref-row { grid-template-columns: 1fr 1fr; } .outreach-form .slot-pref-row .field:first-child { grid-column: 1 / -1; } }
.outreach-url input { width: 100%; font-family: var(--mono, monospace); font-size: var(--t-sm, .9rem); }
.outreach-qr .join-qr-code { max-width: 16rem; margin-top: .5rem; }
.tr-week { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: .75rem; }
.tr-day h3 { margin: 0 0 .4rem; font-size: var(--t-md); }
.tr-day ul { list-style: none; margin: 0; padding: 0; display: grid; gap: .4rem; }
.tr-slot { border: 1px solid var(--line); border-left: 4px solid var(--sprout); border-radius: var(--r-ctl); padding: .45rem .6rem; background: var(--paper); overflow-wrap: anywhere; }
.tr-slot > span { display: block; }
.tr-slot.is-set { border-left-color: var(--edge); background: var(--field); color: var(--ink-soft); }
.tr-slot .tr-time { font-weight: 600; color: var(--ink); }
.tr-slot a { display: inline-flex; align-items: center; min-height: 44px; }
@media (max-width: 56rem) { .tr-week { grid-template-columns: 1fr; } }
.tr-list { list-style: none; padding: 0; margin: 0; display: grid; gap: .75rem; }
.tr-req h3 { margin: 0; }
.tr-req h3 .sub { font-weight: 400; display: block; }
.tr-req.is-done { opacity: .85; }
.tr-prefs { margin: .25rem 0; padding-left: 1.25rem; }
.tr-comments { white-space: pre-line; overflow-wrap: anywhere; background: var(--field); padding: .5rem .75rem; border-radius: var(--r-ctl); }
.tr-req .actions form.inline { display: inline-block; margin-right: .5rem; }

/* ===== r3-usage: /national/usage, "How Sprout Up is used" ===== */
.usage-table th[scope=col] a { color: inherit; text-decoration: none; white-space: normal; display: inline-block; min-width: 5rem; }
.usage-table th[scope=col] a:hover, .usage-table th[scope=col] a:focus-visible { text-decoration: underline; }
.usage-table td { min-width: 7rem; }
.usage-table td .sub, .usage-features td .sub { display: block; }
.usage-table td.is-na { color: var(--ink-soft); }
.usage-table th[scope=row] .sub { display: block; font-weight: 400; }
.usage-features td.is-zero { font-weight: 700; color: var(--danger-ink); }
.usage-features td:last-child { min-width: 14rem; }
.usage-who { margin-top: .25rem; }
.usage-who summary { cursor: pointer; color: var(--sprout); font-weight: 600; min-height: 44px; display: inline-flex; align-items: center; }
.usage-who ul { margin: 0 0 .5rem; padding-left: 1.25rem; }
.usage-rule, .usage-not-counted { max-width: 68ch; }
.usage-not-counted { padding-left: 1.25rem; }
.usage-pick { display: flex; flex-wrap: wrap; align-items: end; gap: .5rem .75rem; margin: .75rem 0 0; }
.usage-pick label { display: grid; gap: .25rem; font-weight: 600; }
.usage-pick select { min-height: 44px; max-width: 100%; }
.usage-weekly { display: grid; gap: .5rem 1.5rem; grid-template-columns: repeat(3, minmax(0, 1fr)); align-items: start; }
.usage-weekly .usage-wk { margin: .5rem 0; min-width: 0; }
.usage-weekly .usage-wk figcaption .sub { display: block; font-weight: 400; }
.usage-weekly > .wk-table { grid-column: 1 / -1; }
@media (max-width: 52rem) { .usage-weekly { grid-template-columns: 1fr; } }
.matrix.usage-features th[scope=row], .matrix.usage-features thead th:first-child { min-width: 7.5rem; }
.matrix.usage-table th[scope=row], .matrix.usage-table thead th:first-child { min-width: 9rem; }
.usage-features td.num { min-width: 5.5rem; }
/* ===== end r3-usage ===== */
/* ---- r3-volunteer: round 3, volunteer side ---- */
/* My onboarding's step titles are body text; the big .step-title above is the One at a time card's. */
.clear-bed ol.steps .step-title { font-family: inherit; font-size: var(--t-md, 1rem); font-weight: 650; line-height: 1.3; letter-spacing: normal; }
.form-time { margin: .25rem 0 .75rem; }

/* ---- Round 3, leaders (ws/r3-leaders): Mark verified apart from the status, behind a second press when a wrong press clears someone too soon ---- */
.verify-act { display: block; margin-top: .4rem; padding-top: .4rem; border-top: 1px dashed var(--line); }
details.verify-box { display: inline-block; }
details.verify-box summary { display: inline-flex; align-items: center; min-height: 44px; padding: 0 .75rem; border: 1px solid var(--edge); border-radius: var(--r-ctl); background: var(--paper); color: var(--ink); cursor: pointer; }
details.verify-box[open] { display: block; flex-basis: 100%; padding: .5rem .75rem .75rem; border-radius: var(--r-ctl); background: var(--field); }
details.verify-box[open] summary { border: 0; padding: 0; min-height: 0; background: none; font-weight: 700; margin-bottom: .25rem; }
details.verify-box .hint { color: var(--ink); margin: .25rem 0 .5rem; }
td[data-label="Phone"], td[data-label="Grad year"] { white-space: nowrap; }
td[data-label="Emergency contact"], td[data-label="Releases"] { min-width: 9rem; }

/* ---- Round 3, guarded (ws/r3-guarded, 0024): decline reason, send back, form sections and drafts, days that don't work ---- */
.decline-why { border: 0; padding: 0; margin: 0 0 .5rem; min-width: 0; }
.decline-why legend { padding: 0; font-weight: 650; }
.decline-why .choice-row { gap: 0 1.25rem; }
.decline-why .tick-other { margin-top: .2rem; }
.decline-form .hint { margin: 0 0 .75rem; }
.decline-why-text { color: var(--ink-soft); font-size: var(--t-sm); font-weight: 400; }
details.send-back[open] { background: var(--warn-bg); }
.send-back-form { display: grid; gap: .35rem; margin: .25rem 0 0; max-width: 26rem; }
.send-back-form label { font-weight: 600; }
.send-back-form .hint { margin: 0; }
.send-back-form button { justify-self: start; }
.step-note { margin: .35rem 0 .5rem; padding: .45rem .65rem; border-left: 4px solid var(--fill-warn); background: var(--warn-bg); color: var(--ink); max-width: 60ch; overflow-wrap: anywhere; }
.section-count { display: block; font-family: var(--body); font-size: var(--t-sm); font-weight: 600; color: var(--ink-soft); letter-spacing: .01em; }
.tr-slot.is-no { border-left-color: var(--line); background: var(--muted-bg); color: var(--ink-soft); }
.tr-slot.is-no > span { display: inline; }
.tv-table td.tv-act details.send-back { display: block; white-space: normal; margin-top: .25rem; }
.tv-table td.tv-act form.send-back-form { display: grid; align-items: stretch; min-width: 14rem; }

/* ---- Round 4, volunteers and teachers (ws/r4-volunteer) ---- */
/* The onboarding form on a phone: one section per screen (public/assets/onboarding-form.js adds .is-stepper) */
.onboarding-form.is-stepper .form-section { display: none; }
.onboarding-form.is-stepper .form-section.is-current { display: block; border-top: 0; margin-top: 0; padding-top: 0; }
.onboarding-form.is-stepper > .actions { display: none; }
.onboarding-form.is-stepper.on-last > .actions { display: flex; }
.onboarding-form.is-stepper.on-last .step-nav [data-step="later"] { display: none; }
.step-nav { margin-top: 1.5rem; border-top: 1px solid var(--line); padding-top: .75rem; }
.step-nav-status { margin: 0; min-height: 1.4em; font-size: var(--t-sm); color: var(--ink-soft); }
.step-nav [hidden] { display: none; }
/* Writing boxes grow with their content (public/assets/grow.js does the same where field-sizing is missing) */
.fb-form textarea, .outreach-form textarea { field-sizing: content; min-height: 6rem; max-height: 70vh; }

/* ---- Round 4, National (ws/r4-national): a totals row under the Table view, the usage detail tables ---- */
.tv-table tfoot th, .tv-table tfoot td { padding: .55rem .85rem; text-align: left; vertical-align: middle; border-top: 2px solid var(--edge); border-right: 1px solid var(--line); background: var(--field); font-weight: 700; }
.tv-table tfoot th[scope=row] { position: sticky; left: 0; min-width: 11rem; box-shadow: 1px 0 0 var(--line); }
.tv-table tfoot th, .tv-table tfoot td { position: sticky; bottom: 0; z-index: 2; }   /* the total stays in view when the rows scroll */
.tv-table tfoot th[scope=row] { z-index: 3; }
.tv-table tfoot tr > :last-child { border-right: 0; }
.tv-table tfoot .num { text-align: right; font-variant-numeric: tabular-nums; }
.tv-table tfoot .sub { display: block; margin-top: .15rem; font-size: var(--t-sm); font-weight: 400; }
@media (max-width: 43.75rem) {
  .tv-table tfoot { display: block; }
  .tv-table tfoot tr { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .45rem .75rem; margin: 0 0 .75rem; padding: .8rem .9rem; border: 2px solid var(--edge); border-radius: var(--r-card); background: var(--field); }
  .tv-table tfoot th[scope=row] { grid-column: 1 / -1; position: static; min-width: 0; padding: 0; border: 0; box-shadow: none; background: none; font-size: var(--t-md); }
  .tv-table tfoot td { position: static; min-width: 0; padding: 0; border: 0; background: none; text-align: left; overflow-wrap: anywhere; }
  .tv-table tfoot td[data-label]::before { content: attr(data-label) ": " / ""; color: var(--ink-soft); font-size: var(--t-sm); font-weight: 600; }
  .tv-table tfoot td:empty, .tv-table tfoot .tv-act { display: none; }
  .tv-table tfoot .sub { display: inline; }
}
.usage-detail td { min-width: 5.5rem; }
.usage-detail th[scope=col] { white-space: normal; }

/* ---- Round 4, leaders (ws/r4-leaders): land on the step being checked, placement words, school and planner ---- */
.verify-item:target, .verify-item:has(:target), .matrix tr:target, .tv-table tr:target { background: var(--warn-bg); outline: 3px solid var(--fill-warn); outline-offset: -3px; scroll-margin-top: 4.5rem; }
.matrix tr:target > th[scope=row] { background: var(--warn-bg); }
.matrix td.placement { min-width: 12rem; max-width: 18rem; }
.tv-table td[data-label="Placement"] { min-width: 12rem; max-width: 18rem; }
details.cell-more { margin-top: .2rem; }
details.cell-more summary { cursor: pointer; font-size: var(--t-sm); color: var(--sprout); text-decoration: underline; }
details.cell-more p { margin: .2rem 0 0; white-space: normal; }
.matrix td.placement .sub, .tv-table td[data-label="Placement"] .sub { display: block; margin-top: .2rem; }
.tv-foot { margin: .5rem 0 0; max-width: 60ch; }

/* ---- Round 4, guarded (ws/r4-guarded, 0025): mark a teammate out, Remind them ---- */
.people .mark-out { margin-top: .35rem; }
.people .mark-out summary { min-height: 36px; padding: .3rem .8rem; font-size: var(--t-sm); font-weight: 600; box-shadow: inset 0 0 0 1px var(--edge); }

/* ---- Round 5, leaders (ws/r5-leaders): planner reasons, waive under More, send-back count, "National Team only" columns ---- */
.fit-near { list-style: none; margin: .25rem 0 .75rem; padding: 0; display: grid; gap: .35rem; font-size: var(--t-sm); }
.fit-near li { color: var(--warn-ink); }
.fit-near strong { color: var(--ink); }
.fit-cost { font-size: var(--t-sm); color: var(--danger-ink); font-weight: 600; margin-top: .15rem !important; }
.char-count { margin: .15rem 0 .5rem; }
.char-count.is-full { color: var(--danger-ink); font-weight: 650; }
.send-back-form textarea { width: 100%; max-width: 32rem; }
.read-out { margin: .5rem 0 0; padding: .6rem .8rem; border-left: 4px solid var(--sprout); background: var(--field); border-radius: var(--r-ctl); max-width: 40rem; }
@media (max-width: 43.75rem) { .tv-table td[data-label="Placement"] { min-width: 0; max-width: none; overflow-wrap: anywhere; } }

/* ---- Round 6, volunteers and National (ws/r6-volunteer) ---- */
/* Teacher form: a section an answer opens sits below every question already on the page and never anchors the scroll, so the tapped area stays put. */
.fb-form .fb-when { overflow-anchor: none; scroll-margin-top: 1rem; }
.fb-form .fb-q { overflow-anchor: auto; }

/* ---- Round 6, leaders A (ws/r6-leaders): one-person clearing page, Not cleared tab, Move to…, lesson staffing line ---- */
.verify-item .who a { color: inherit; }
.verify-item p .chip + .chip, .verify-item p .chip + .sub { margin-left: .25rem; }

/* ---- Round 7, fast (ws/r7-fast): teacher form "N more questions below", Send kept apart ---- */
.fb-form .fb-more { display: none; margin: -.6rem 0 1.4rem; font-weight: 600; }
@supports selector(:has(*)) {
  .fb-form:has(input[data-goes~="scheduling"]:checked) .fb-more[data-goes="scheduling"],
  .fb-form:has(input[data-goes~="constructive"]:checked) .fb-more[data-goes="constructive"],
  .fb-form:has(input[data-goes~="testimonial"]:checked) .fb-more[data-goes="testimonial"] { display: block; }
}
.fb-form > button[type=submit] { display: block; margin-top: 3rem; }

/* ---- Round 7, guarded B (ws/r7-guarded): reach your leaders (ui/leaders) ---- */
/* A long address breaks inside itself at 360 px instead of pushing the page sideways. */
.leader-mail { overflow-wrap: anywhere; }

/* ---- Round 8, fast (ws/r8-fast) ---- */
/* Who needs clearing, Table: no inner scroll box. The table grows with the page and its header sticks to the screen. Up to 70 rem it still scrolls sideways (no sticky header there); from 70 rem its columns fit. */
.tv-wrap.is-fit { max-height: none; }
@media (min-width: 70rem) {
  .tv-wrap.is-fit { overflow: visible; }
  .tv-wrap.is-fit .tv-table { font-size: .9rem; }
  .tv-wrap.is-fit .tv-table th, .tv-wrap.is-fit .tv-table td { padding: .5rem .45rem; }
  .tv-wrap.is-fit .tv-table tbody th[scope=row], .tv-wrap.is-fit .tv-table thead th:first-child { min-width: 7rem; }
  .tv-wrap.is-fit .tv-table thead th { font-size: .78rem; line-height: 1.2; padding-block: .4rem; }
  .tv-wrap.is-fit .tv-table td.tv-act .sub { max-width: 7.5rem; }
  .tv-wrap.is-fit .tv-table td .chip { padding-inline: .4rem; gap: .2rem; }   /* one-line chips in a dense grid still fit (DESIGN.md "Alignment") */
}

/* National tiles: one short line under the status word says why it has that status. */
.tl-state { display: flex; flex-direction: column; align-items: flex-start; gap: .3rem; margin-top: auto; }
.tl-why { font-size: var(--t-sm); line-height: 1.3; }
.tl-tile.is-need .tl-why { color: #DCEBE0; }   /* 11.6:1 on ink */
.tl-tile.is-wait .tl-why { color: var(--ink); }
.tl-tile.is-fine .tl-why { color: var(--ink-soft); }

/* Onboarding form: section 1 is two screens on a phone ("part 1 of 2"); on a wide page it stays one section. */
.part-of { font-weight: 600; }
.onboarding-form:not(.is-stepper) .part-of, .onboarding-form:not(.is-stepper) .form-section.is-part > h2 { display: none; }
.onboarding-form:not(.is-stepper) .form-section.is-part { border-top: 0; margin-top: 0; padding-top: 0; }

/* ---- Round 9, National dashboard and Get the app (ws/r9-national) ---- */
/* Get the app: a link beside the bell on every page. Icon and words from a tablet up; on a phone the words shrink to fit beside the logo. */
.top-tools .top-app { display: inline-flex; align-items: center; gap: .3rem; min-height: 44px; padding: 0 .4rem; color: var(--sprout-deep); font-weight: 600; font-size: .9rem; text-decoration: none; white-space: nowrap; border-radius: var(--r-pill); }
.top-tools .top-app:hover { background: var(--field); text-decoration: underline; }
.top-tools .top-app[aria-current] { text-decoration: underline; text-underline-offset: .25em; }
.top-app svg { width: 20px; height: 20px; flex: none; }
@media (display-mode: standalone) { .top-tools .top-app { display: none; } }
@media (max-width: 47.99rem) {   /* icon above two short lines of words: it fits beside the logo, the bell and Sign out at 360 px */
  .top-inner { column-gap: .5rem; }
  .top-tools { gap: .25rem; }
  .top-tools .top-app { flex-direction: column; justify-content: center; gap: .1rem; padding: 0 .2rem; font-size: .66rem; line-height: 1.05; font-weight: 600; text-align: center; }
  .top-tools .top-app:hover { text-decoration: none; }
  .top-app .top-app-text { display: block; max-width: 3rem; white-space: normal; }
}
.app-how { display: grid; gap: 1.5rem; grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr)); }
.app-how h3 { margin: 0 0 .4rem; }
.app-how ol { margin: 0; padding-left: 1.25rem; }
.app-how li + li { margin-top: .6rem; }
.app-ico { display: inline-block; width: 1.3em; height: 1.3em; vertical-align: -.3em; padding: .1em; border: 1px solid var(--line); border-radius: .35em; background: var(--field); }
.app-steps [data-install] { margin: 0 0 1rem; }
.app-qr-code .qr { display: block; width: 12rem; max-width: 100%; height: auto; border: 1px solid var(--line); border-radius: var(--r-ctl); }
@media (max-width: 47.99rem) { .app-qr { display: none; } }   /* on a phone the code is no use: the steps above are the way */

/* National dashboard (Home\National, views/panels/national.php). */
.nat-dash .lede { margin: .25rem 0 0; }
.nat-stats { grid-template-columns: repeat(auto-fit, minmax(8.5rem, 1fr)); }
.nat-stats .stat { padding: 0; }
.nat-stats .stat-link { display: flex; flex-direction: column; gap: .15rem; height: 100%; padding: 1rem 1.1rem; border-radius: var(--r-card); color: inherit; text-decoration: none; }
.nat-stats .stat-link:hover { background: var(--paper); box-shadow: inset 0 0 0 2px var(--sprout); }
.nat-stats .stat-value { overflow-wrap: anywhere; }
@media (max-width: 30rem) { .nat-stats .stat-link { padding: .8rem .85rem; } }
.nat-defs { margin-top: .5rem; }
.nat-defs summary { cursor: pointer; font-weight: 600; min-height: 44px; display: flex; align-items: center; }
.nat-need { list-style: none; margin: .75rem 0 0; padding: 0; }
.nat-need-row { display: flex; align-items: center; justify-content: space-between; gap: .5rem 1rem; padding: .6rem 0 .6rem .75rem; border-bottom: 1px solid var(--line); border-left: 4px solid var(--line); flex-wrap: wrap; }
.nat-need-row.is-danger { border-left-color: var(--fill-danger); }
.nat-need-row.is-warn { border-left-color: #B7791F; }
.nat-need-row.is-info { border-left-color: var(--sprout); }
.nat-need-what { flex: 1 1 18rem; min-width: 0; }
.nat-need-what strong { margin-right: .35rem; }
.nat-more summary { cursor: pointer; font-weight: 600; min-height: 44px; display: flex; align-items: center; }
.nat-sub-h { margin: 1.25rem 0 .25rem; font-size: var(--t-md); }
.nat-named { margin-top: .75rem; }
.nat-named summary { cursor: pointer; font-weight: 600; min-height: 44px; display: flex; align-items: center; }
.nat-table .nat-why { display: block; margin-top: .25rem; }
.nat-table thead th a { color: inherit; text-decoration: none; }
.nat-table thead th a:hover { text-decoration: underline; }
@media (max-width: 47.99rem) { .stack-wide-only { display: none; } }

/* ---- Round 9, fast (ws/r9-fast) ---- */

/* Round 9, subs: "I can't make it" opens "Find me a sub", then "or", then "Just tell my team" (views/ui/cant_make_it.php). */
.cant-sub { margin: 0; }
.cant-sub .hint { margin: .5rem 0 0; }
.cant-or { margin: .9rem 0 .7rem; padding-top: .8rem; border-top: 1px solid var(--edge); color: var(--ink-soft); font-weight: 650; }

/* Round 10, fast (ws/r10-final): Form answers, an email stays on one line at 1280 px; anything else wraps in its cell. */
@media (min-width: 70rem) {
  .tv-wrap.is-fit .tv-table td[data-label="School email"] { white-space: nowrap; }
}

/* ---- One-press actions, leaders (ws/fix-leaders, 2026-10-22) ---- */
.decision-who { max-width: 28rem; }
.decision-options { display: grid; gap: .5rem; margin: .25rem 0 1rem; }
.decision-options button { width: 100%; text-align: left; justify-content: flex-start; min-height: 48px; }
.decision-form details.step-more { margin-bottom: 1rem; }
.tr-prefs form.inline { display: inline; }
.tr-slot form.inline { margin-top: .35rem; }

/* ws/fix-guarded (audit F10): "Choose a sub" on a sub card sits above "Close request", the same width on a phone */
.subs-act a.button { margin: 0 .4rem .45rem 0; }
@media (max-width: 30rem) { .subs-act a.button { display: block; text-align: center; margin-right: 0; } }

/* ---- Action fixes, clearing and your own steps (ws/fix-clear, 2026-10-22) ---- */
/* Profile: "Finish your profile" lands on the one answer or the details to confirm, and Save, above everything else. */
.profile-finish { margin: 0 0 2rem; padding: 1rem 1.15rem; border-left: 4px solid var(--fill-warn); border-radius: 0 var(--r-ctl) var(--r-ctl) 0; background: var(--warn-bg); }
.profile-finish h2 { margin-top: 0; }
.profile-finish .field-group { margin: 0 0 .75rem; }
.profile-finish .actions { margin: .5rem 0 .25rem; }
.profile-finish > .hint { margin: .25rem 0 0; }
.profile-finish-facts { display: grid; gap: .15rem; margin: 0 0 .5rem; }
.profile-finish-facts div { display: flex; gap: .75rem; }
.profile-finish-facts dt { flex: 0 0 6.5rem; color: var(--ink-soft); }
.profile-finish-facts dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
/* Who needs clearing: the counts and what the words mean, under a list to act on. */
/* Inbox on a phone: the open item's buttons right under its title, in the first screen (they sat at the bottom of a
   screen-tall card, and a two-line title pushed them below). */
@media (max-width: 55.99rem) {
  .inbox-item { min-height: 0; }
  .inbox-acts { order: 0; margin: 0 0 1rem; padding: 0; position: static; border-top: 0; background: none; }
  .inbox-hint { order: 0; margin: -.5rem 0 1rem; }
}

/* ---- Home, fewer labels (ws/fix3-home, 2026-10-22: "Let the layout do the explaining") ---- */
/* The chapter's pages under one "More" on the Full view, not 9-10 pills above the work. */
.home-more { margin-top: .5rem; }
.home-more summary { list-style: none; display: inline-flex; align-items: center; gap: .4rem; min-height: 44px; color: var(--ink-soft); font-weight: 600; cursor: pointer; }
.home-more summary::-webkit-details-marker { display: none; }
.home-more summary::after { content: "\25BE" / ""; font-size: .85em; transition: transform .15s ease; }
.home-more[open] summary::after { transform: rotate(180deg); }
.home-more .home-pills { margin-top: .25rem; }
/* Tiles: the mark alone (!, a dotted circle, a tick); the word is for a screen reader. */
.tl-status { justify-content: center; width: 1.75rem; height: 1.75rem; padding: 0; gap: 0; }
/* Invitations on Home: each person with "Send a new link" and "Cancel". */
.invite-acts li { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .35rem .75rem; padding: .45rem 0; border-bottom: 1px solid var(--line); }
.invite-btns { display: inline-flex; flex-wrap: wrap; gap: .4rem; }
/* Needs attention: "Ask the sub list to cover <name>" reads as the row's other fix links. */
.lesson .facts form.inline button.link { font: inherit; }
/* National's Chapters table on a phone: the four column names once, above the cards, not under every number
   (8 chapters x 4 labels); the chapter and its status share the card's first line. */
@media (max-width: 30rem) {
  .nat-table.stack-phone thead { position: static; width: auto; height: auto; overflow: visible; clip-path: none; white-space: normal; display: block; }
  .nat-table.stack-phone thead tr { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .5rem .6rem; padding: .6rem .85rem; border-bottom: 1px solid var(--line); }
  .nat-table.stack-phone thead th { padding: 0; border: 0; background: none; text-align: left; font-size: .8rem; line-height: 1.25; color: var(--ink-soft); overflow-wrap: normal; word-break: normal; hyphens: manual; }
  .nat-table.stack-phone thead th:nth-child(-n+2) { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  .nat-table.stack-phone tbody tr { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .4rem .6rem; }
  .nat-table.stack-phone tbody th[scope=row] { grid-column: 1 / 3; }
  .nat-table.stack-phone td.stack-wide { grid-column: 3 / 5; justify-self: end; }
  .nat-table.stack-phone td[data-label]::before { content: none; }
  .nat-table.stack-phone td.num { font-variant-numeric: tabular-nums; font-weight: 650; }
}
.nat-table td.num .sub { display: inline; white-space: nowrap; }
.tl-status::before { font-size: 1rem; }
/* ---- ws/fix4 (audit 4, 2026-10-22) ---- */
/* Nothing left to add to a term: each school without a classroom there, with its "Add a classroom". */
.add-rooms { list-style: none; margin: .5rem 0; padding: 0; max-width: 34rem; }
.add-rooms li { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .35rem .75rem; padding: .45rem 0; border-bottom: 1px solid var(--line); }
/* An Inbox / One at a time item's facts as one line under its title. */
.inbox-line, .step-line { margin: .15rem 0 .5rem; color: var(--ink-soft); }
/* Home's sub card: no date stub (the date line says it once). */
.subs-offer.is-brief { grid-template-columns: 1fr; }
/* ---- ws/fix5-nat (National round, 2026-10-22) ---- */
/* This week, Calendar: "Next week: 3 need action" shows on a phone too (this week's own count is in the agenda's rows). */
.cg-need a.chip { text-decoration: none; }
@media (max-width: 55.99rem) {
  .cg-need:has(a.chip) { display: block; }
  .cg-need-now { display: none; }
}
.verify-item:target { padding-inline: .75rem; }
/* ---- Clearing (2026-10-27): the Roster's Clearing cell and the volunteer page (views/ui/clearing_cell.php, views/volunteer.php) ---- */
.clear-cell { display: grid; gap: .4rem; justify-items: start; }
.clear-cell { width: 100%; }
@media (min-width: 44rem) { .tv-table td:has(> .clear-cell) { min-width: 19rem; } }
.clear-step { margin: 0; max-width: none; width: 100%; display: flex; flex-wrap: wrap; align-items: center; gap: .25rem .5rem; }
.clear-name { font-weight: 500; flex: 1 1 8rem; min-width: 0; }
.clear-step > :is(form, .sub, a) { margin-inline-start: auto; }
.clear-step form.inline { margin: 0; }
.clear-step .sub, .tv-table .clear-step .sub { display: inline; margin: 0; }
.people .clear-cell { margin-top: .4rem; }
.vol-facts { display: flex; flex-wrap: wrap; gap: .5rem 2.5rem; margin: 0 0 1.5rem; }
.vol-facts > div { min-width: 0; }
.vol-facts dt { font-size: var(--t-sm); font-weight: 600; color: var(--ink-soft); }
.vol-facts dd { margin: 0; overflow-wrap: anywhere; }
.clear-list { list-style: none; margin: 0; padding: 0; }
.clear-row { padding: .75rem 0; border-top: 1px solid var(--line); }
.clear-row:first-child { border-top: 0; }
.clear-row .row-head > .sub { display: block; }
.clear-row details.send-back { margin-top: .35rem; }

/* National's Role emails (0036): an address box per chapter and role; on a phone each chapter is a card, one box a line. */
.role-emails-table td { min-width: 15rem; vertical-align: top; }
.role-emails-table input, .role-emails-table select { width: 100%; }
.role-emails-table .error { margin: .25rem 0 0; }
@media (max-width: 30rem) {
  .role-emails-table.stack-phone tbody tr { grid-template-columns: minmax(0, 1fr); }
  .role-emails-table td { min-width: 0; }
}

/* A chapter's National Team contact (0036): one line, name strong, email and phone as links; long addresses break. */
.nat-contact { overflow-wrap: anywhere; }
.inbox-contact { margin-top: 1rem; font-size: var(--t-sm); }
.inbox-contact .nat-contact { margin: 0; }
.team-roles .role-mailbox { order: 3; flex-basis: 100%; margin-top: -.5rem; font-size: var(--t-sm); overflow-wrap: anywhere; }

/* planner notes 2026-11-09 */
.plan-room .button { margin-top: .5rem; display: inline-flex; align-items: center; min-height: 44px; padding: 0 .9rem; }
.plan-room .button.is-need { background: var(--danger-bg); border-color: var(--fill-danger); color: var(--danger-ink); }
.plan-room .button.is-need::before { content: "!" / ""; font-weight: 900; margin-right: .3rem; }
.seat-pick { white-space: nowrap; min-height: 44px; padding: 0 .75rem; border: 1.5px dashed var(--edge); border-radius: var(--r-ctl); background: transparent; color: var(--sprout-deep); font-weight: 650; }
.seat-pick:hover { background: var(--leaf); border-color: var(--sprout); }
a.chip-danger { text-decoration: none; }
.team-rows { list-style: none; margin: .5rem 0; padding: 0; display: grid; gap: .5rem; }
.team-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .3rem 1rem; max-width: 34rem; }
.team-acts { display: flex; flex-wrap: wrap; gap: .4rem; }
.team-edit { scroll-margin-top: 1rem; }
.team-edit:target { outline: 2px solid var(--sprout); outline-offset: 2px; }
.team-edit h3 { margin-top: 1rem; }
/* inbox/back/roles notes 2026-11-09 */
/* The way back: a left arrow before the parent link (the last link of a crumb), a 44 px target. */
.crumb { display: flex; flex-wrap: wrap; align-items: center; column-gap: .4rem; }
.crumb a { display: inline-flex; align-items: center; min-height: 44px; }
.crumb a:last-of-type::before { content: "\2190"; margin-right: .35rem; font-size: 1.25em; line-height: 1; font-weight: 400; }
/* The Inbox rail as a tree: "Needs you" is the whole, the folders under it are its parts, Notifications stand apart. */
.inbox-rail > ul.inbox-tree { flex-direction: column; flex-wrap: nowrap; gap: .75rem; }
.inbox-rail ul.inbox-parts { display: flex; flex-wrap: wrap; gap: .3rem; margin: .3rem 0 0 1rem; padding-left: .6rem; border-left: 2px solid var(--edge); }
.inbox-rail ul.inbox-parts a { min-height: 44px; font-size: var(--t-sm); font-weight: 550; }
.inbox-rail .inbox-apart { padding-top: .75rem; border-top: 1px solid var(--line); }
@media (min-width: 56rem) {
  .inbox-rail ul.inbox-parts { flex-direction: column; flex-wrap: nowrap; gap: .1rem; }
  .inbox-rail ul.inbox-parts a { display: flex; min-height: 40px; }
  .inbox-rail > ul.inbox-tree { gap: .5rem; }
}
/* Roles table: folding groups and the role filter (roles-table.js; without it the whole table shows). */
.rv-filter { display: flex; flex-wrap: wrap; gap: .4rem; margin: 0 0 .75rem; }
.rv-filter[hidden] { display: none; }
.rv-filter button { min-height: 36px; padding: .1rem .65rem; border: 0; border-radius: var(--r-pill); background: var(--paper); box-shadow: inset 0 0 0 1.5px var(--edge); color: var(--ink); font: inherit; font-size: var(--t-sm); font-weight: 600; cursor: pointer; }
.rv-filter button[aria-pressed=true] { background: var(--leaf); box-shadow: inset 0 0 0 2px var(--sprout); color: var(--sprout-deep); }
.rv-table .is-off { display: none; }
.rv-table .rv-toggle, .rv-table .rv-toggle:hover, .rv-table .rv-toggle:focus-visible { box-shadow: none; background: none; color: inherit; }
.rv-toggle { display: inline-flex; align-items: center; gap: .5rem; min-height: 44px; margin: -.55rem 0 -.4rem; padding: 0; border: 0; background: none; color: inherit; font: inherit; cursor: pointer; position: sticky; left: .75rem; }
.rv-toggle::before { content: "\25BE" / ""; transition: transform .15s ease; }
.rv-toggle[aria-expanded=false]::before { transform: rotate(-90deg); }
.rv-count { display: inline-grid; place-items: center; min-width: 1.6rem; padding: 0 .4rem; border-radius: var(--r-pill); background: var(--muted-bg); color: var(--muted-ink); font-size: var(--t-sm); font-weight: 700; }
.rv-table tbody.is-closed tr:not(.rv-group) { display: none; }
@media (max-width: 43.75rem) { .rv-filter { display: none; } }

/* responsiveness 2026-11-10 */
/* The three drawings as data URIs: a url("/assets/x.svg") carries no ?v= stamp, so the server revalidated it on every page view.
   Keep in step with leaf.svg, seedling.svg and sprout.svg (the files stay for the favicon and anything outside this sheet). */
:root {
  --svg-leaf: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 23V12' stroke='%232A7247' stroke-width='3' stroke-linecap='round' fill='none'/%3E%3Cpath d='M12 13C12 7 8.5 3 2 3c0 6.5 3.5 10 10 10z' fill='%232A7247'/%3E%3Cpath d='M12 10.5C12 6 15 3 21.5 2.5 21.5 8 18 10.5 12 10.5z' fill='%236DBA82'/%3E%3C/svg%3E");
  --svg-seedling: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 64 64' fill='none' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M8 54h48' stroke='%239DB3A7' stroke-width='2.5'/%3E%3Cpath d='M18 54c2-5 6-7 14-7s12 2 14 7' stroke='%239DB3A7' stroke-width='2.5'/%3E%3Cpath d='M32 47V30' stroke='%232A7247' stroke-width='3'/%3E%3Cpath d='M32 31c0-9-6-15-16-15 0 10 6 15 16 15z' fill='%23E8F3EA' stroke='%232A7247' stroke-width='2.5'/%3E%3Cpath d='M32 27c0-8 5-13 15-13 0 9-5 13-15 13z' fill='%23E8F3EA' stroke='%232A7247' stroke-width='2.5'/%3E%3C/svg%3E");
  --svg-sprout: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Cpath d='M16 29V15' stroke='%2316302B' stroke-width='2.5' stroke-linecap='round' fill='none'/%3E%3Cpath d='M16 16c0-6-4-10-11-10 0 7 4 10 11 10z' fill='%232A7247'/%3E%3Cpath d='M16 13c0-5 3-8 10-8 0 6-3 8-10 8z' fill='%236DBA82'/%3E%3C/svg%3E");
}
/* Pressed state: shown when the finger or button goes down, not when it comes up (the busy state from forms.js follows on release).
   Same colours as :hover, which on a touch screen only appears after the tap. */
a, button, summary, label { touch-action: manipulation; }
button:not(:disabled):active, .button:not([aria-disabled=true]):active { background: var(--sprout-deep); color: var(--paper); }
button.secondary:not(:disabled):active, .button.secondary:not([aria-disabled=true]):active { background: var(--field); color: var(--ink); box-shadow: inset 0 0 0 2px var(--ink); }
button.danger:not(:disabled):active, .button.danger:not([aria-disabled=true]):active { background: var(--danger-ink); color: var(--paper); }
button.link:not(:disabled):active { background: none; color: var(--sprout-deep); }
.inbox-rows a:active { background: var(--field); }

/* 0044: "The teacher cancelled" on the lesson page (views/lesson.php) */
.teacher-cancel { margin: .75rem 0 0; }
.teacher-cancelled { margin: 1rem 0 0; }
.teacher-cancelled .short-actions { margin: .5rem 0; }
