/* ==========================================================================
   LearnIt Portal v2 — Design System
   Brand: white surfaces + LearnIt blue (#4272B4) on ink navy (#0A1F33).
   Every colour in this file comes from Jordan's LearnIt palette — the logo
   core plus the extended family already in daily use on learnit.net.au.
   NOTHING below may hardcode a colour: add a token here instead, so the
   portal and the website can never drift apart.
   Owned by: core agent. Do not add one-off styles in view files — extend here.
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. TOKENS
   -------------------------------------------------------------------------- */
:root {
  /* ---- CORE (straight off the logo) -------------------------------------
     #151515 ink · #4272B4 blue · #0A1F33 ink navy · #9299A1 grey · #F7F8FA paper */
  --ink:     #151515;        /* the wordmark black — primary text  17.2:1     */
  --brand:   #4272B4;        /* the italic "It" — actions, links    4.9:1     */
  --navy:    #0A1F33;        /* ink navy — the rail and dark grounds          */
  --bg:      #F7F8FA;        /* paper                                         */
  --white:   #FFFFFF;
  --surface: var(--white);

  /* ---- BLUE FAMILY (learnit.net.au) ------------------------------------- */
  --brand-mid:     #5A8AC8;  /* blue tint                                     */
  --brand-soft:    #7FA6D4;  /* light blue — soft borders, rail glyphs        */
  --brand-light:   #CFE3F2;  /* pale blue — chip / badge / today fills        */
  --brand-light-2: #B7D4EB;  /* one step deeper — hover on a pale-blue fill   */
  --brand-tint:    #F1F7FB;  /* faintest wash — row hovers, table heads       */
  --brand-dark:    #2F5D80;  /* mid blue — links, icon hovers       7.0:1     */
  --brand-darker:  #12354C;  /* navy step — text on pale blue       9.7:1     */

  /* ---- NAVY FAMILY (dark grounds) --------------------------------------- */
  --navy-deep: #06253B;
  --navy-2:    #12354C;
  --navy-3:    #24405E;

  /* ---- INK + NEUTRALS ----------------------------------------------------
     #9299A1 is Jordan's grey but only 2.9:1 on paper, so it is DECORATIVE
     only. Readable secondary copy uses --muted-ink, a navy⊕grey blend. */
  --ink-2:      #24405E;     /* navy step — secondary text        10.7:1     */
  --muted-ink:  #52627A;     /* readable muted copy   6.2:1 white, 4.7:1 pale */
  --muted:      #9299A1;     /* the brand grey — decorative / disabled       */
  --muted-2:    #A6ADB6;     /* lightest decorative step (scrollbar thumb)   */
  --line:       #DDE3EA;     /* hairlines: cards, dividers, table rules      */
  --line-2:     #EDF1F5;     /* fainter hairline                             */
  /* control borders — inputs, checkboxes, radios. An empty field's ONLY
     identifying shape, so it owes 3:1 (WCAG 1.4.11) on the ground it actually
     sits on — not on white. #8794A2 was picked against white (3.09) and then
     measured 2.91 on --bg paper, 2.86 on --brand-tint and 2.67 on --danger-bg,
     i.e. it failed everywhere a form is actually drawn. One step darker in the
     same navy-grey ramp clears every ground in the app:
     white 3.66 · paper 3.45 · tint 3.39 · ok-bg 3.23 · warn-bg 3.26 · danger-bg 3.17 */
  --line-strong:#7A8796;

  /* ---- STATUS (retuned to sit beside #4272B4) ---------------------------- */
  --ok:          #1E8E62;
  --ok-soft:     #58C39A;
  --ok-ink:      #146B4A;
  --ok-deep:     #0F5439;
  --ok-bg:       #E6F4EE;
  --ok-line:     #B3DCC9;
  --warn:        #E8B04A;    /* Jordan's gold                                */
  --warn-soft:   #E8C07A;    /* Jordan's light gold                          */
  --warn-ink:    #7A5410;    /* gold is 2:1 — text/glyphs use this  6.8:1    */
  --warn-bg:     #FBF1DC;
  --warn-line:   #F0DCAF;
  --danger:      #C93F3F;
  --danger-dark: #A83535;
  --danger-soft: #E08A8A;
  --danger-ink:  #9A2F2F;
  --danger-bg:   #FAEBEB;
  --danger-line: #EEC4C4;
  --info:        var(--brand);
  --info-bg:     var(--brand-light);
  --info-line:   #A7C4E3;
  --purple:      #6C5FB0;
  --purple-ink:  #4A3F86;
  --purple-bg:   #EDEAF7;
  --purple-line: #D2CBEC;

  /* radii */
  --r-2xs: 4px;              /* status flags, tags — crisp, not bubbly        */
  --r-xs: 6px;
  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 16px;
  --r-xl: 22px;
  --r-pill: 999px;

  /* elevation — all cast in ink navy (10, 31, 51) */
  --shadow-1: 0 1px 2px rgba(10, 31, 51, .05), 0 2px 8px rgba(10, 31, 51, .05);
  --shadow-2: 0 4px 14px rgba(10, 31, 51, .09), 0 1px 3px rgba(10, 31, 51, .06);
  --shadow-3: 0 18px 48px rgba(10, 31, 51, .20), 0 4px 12px rgba(10, 31, 51, .08);
  /* ⚠ RETIRED, deliberately left defined so nothing breaks if a view still
     names it. A coloured shadow under a coloured button is a glow: it makes the
     control look like it is lit from inside rather than like it is the one
     thing to press. Primary buttons are flat. */
  --shadow-brand: none;
  /* focus ring — every rule that uses this also sets `outline:none`, so it is
     the ONLY indicator and must clear 3:1 (WCAG 1.4.11 / 2.4.7). A 28%-alpha
     brand wash composited only 1.4:1 on every ground in the app. Two solid
     bands instead: on light grounds the white band is invisible and --brand
     carries it (4.9:1 on white, 4.6:1 on paper, 4.5:1 on --brand-tint); on a
     dark ground the white band itself carries it (19:1 on --navy). */
  --ring:      0 0 0 2px var(--white), 0 0 0 4px var(--brand);
  --ring-dark: 0 0 0 2px var(--navy),  0 0 0 4px var(--brand-light);

  /* typography */
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue",
               Arial, "Noto Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji";
  --font-serif: "Playfair Display", "Iowan Old Style", "Palatino Linotype", Palatino,
                Georgia, "Times New Roman", serif;
  --font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;

  /* ---- TYPE SCALE ---------------------------------------------------------
     An audit of the RENDERED portal counted 27 distinct sizes — 46 40 30 28 26
     25 23 22 21 20 19 18 17 16 15.5 15 14.5 14 13.5 13 12.5 12 11.5 11 10.5 10
     — and five weights (500 550 600 650 700). Sixteen of those sizes sit inside
     a 2px band of a neighbour, so the reader cannot tell them apart: the
     difference does not register as hierarchy, it registers as sloppiness. That
     drift is most of what reads as "a template", and it is why a 13.5px label
     beside a 14px one looks like a mistake nobody caught.

     EIGHT sizes, each a step the eye can actually see, and FOUR weights. If a
     new piece of text does not fit one of these, the answer is to decide which
     level it belongs to — not to add a half-pixel.

     Three of them are display steps (serif, one per screen at most), five are
     text steps. Each gap is at least 2px and at least 7%.                   */
  --fs-display: 26px;   /* page H1 — serif, ONE per screen                   */
  --fs-heading: 20px;   /* an overlay or profile heading: slide-over, modal,
                           a person's name on their own record — serif       */
  --fs-title:   17px;   /* card + panel titles — serif                       */
  --fs-lead:    15px;   /* a lead line, a large list title, prose to read    */
  --fs-body:    14px;   /* THE default: table cells, inputs, buttons, rows   */
  --fs-sm:      13px;   /* secondary copy, hints, metadata                   */
  --fs-xs:      12px;   /* the sub-line under a name, counts                 */
  --fs-micro:   11px;   /* uppercase eyebrows + table column headings        */

  /* A figure is not text. One size for every headline number in the app — the
     stat tiles and the dashboard metric strip were at 28 and 22, which read as
     two different kinds of fact rather than the same kind in two places.     */
  --fs-figure:  24px;

  /* The only px font-sizes left in this file are the four that are NOT type:
       · `.avatar*`   initials sized to fit their own disc (10/11/18/26)
       · `.empty-icon`, `.close-x`, `.toast-x`, `.chip-x` — glyph dimensions
       · `.dh-num` / `.dh-quiet` — the dashboard hero, the one element the page
         is explicitly allowed to shout with, and the only display exception.
     Anything else that wants a number instead of a token is drift.           */

  --fw-regular: 400;
  --fw-medium:  500;    /* a quiet emphasis — nav, secondary buttons         */
  --fw-semi:    600;    /* a name, a value, a heading                        */
  --fw-bold:    700;    /* display numbers and the serif headings only       */

  /* Tracking: only ever on the small uppercase labels, where it is legibility
     rather than decoration — and ALWAYS this value. The portal was running six
     different trackings (.02 .05 .06 .07 .08 .1 .12 .13em) on the same
     typographic job, which is drift the eye reads even when it cannot name it. */
  --tracking-caps: .07em;

  /* ---- SPACE SCALE --------------------------------------------------------
     Most of what reads as cheap is inconsistent padding. One 4px-based ladder;
     components pick a rung rather than inventing 11px or 13px.              */
  --s-1: 4px;
  --s-2: 8px;
  --s-3: 12px;
  --s-4: 16px;
  --s-5: 20px;
  --s-6: 24px;
  --s-7: 32px;
  --s-8: 40px;

  /* metrics */
  --sidebar-w: 250px;
  --topbar-h: 64px;
  --tap: 44px;
  --gutter: 24px;

  --sidebar-bg: linear-gradient(180deg, var(--brand-tint) 0%, var(--brand-light) 100%);
}

/* --------------------------------------------------------------------------
   2. RESET / BASE
   -------------------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: var(--fs-body);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4, h5, h6 { margin: 0; font-weight: var(--fw-semi); letter-spacing: -.01em; }
h1 { font-size: var(--fs-heading); }
h2 { font-size: var(--fs-title); }
h3 { font-size: var(--fs-lead); }
p  { margin: 0 0 10px; }
p:last-child { margin-bottom: 0; }

a { color: var(--brand-dark); text-decoration: none; }
a:hover { text-decoration: underline; }

button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }

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

hr { border: 0; border-top: 1px solid var(--line); margin: 16px 0; }

[hidden] { display: none !important; }

::selection { background: var(--brand-light); color: var(--brand-darker); }

/* thin, tidy scrollbars */
* { scrollbar-width: thin; scrollbar-color: var(--line-strong) transparent; }
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb { background: var(--line-strong); border-radius: var(--r-pill); border: 3px solid transparent; background-clip: content-box; }
*::-webkit-scrollbar-thumb:hover { background: var(--muted-ink); background-clip: content-box; }

/* --------------------------------------------------------------------------
   3. UTILITIES
   -------------------------------------------------------------------------- */
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.muted     { color: var(--muted-ink); }
.ink-2     { color: var(--ink-2); }
.serif     { font-family: var(--font-serif); }
.mono      { font-family: var(--font-mono); font-size: .92em; }
.nowrap    { white-space: nowrap; }
.truncate  { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.text-right  { text-align: right; }
.text-center { text-align: center; }
.strong    { font-weight: var(--fw-semi); }
.small     { font-size: var(--fs-sm); }
.tiny      { font-size: var(--fs-xs); }
.spacer    { flex: 1 1 auto; }
.row       { display: flex; align-items: center; gap: var(--s-2); }
.row-wrap  { display: flex; align-items: center; gap: var(--s-2); flex-wrap: wrap; }
.col       { display: flex; flex-direction: column; gap: var(--s-2); }
/* ⚠ `.input` is `display:block; width:100%` — right in a form, wrong in an
   inline cluster, where a date picker ate the whole line and squeezed its own
   label to one word per row ("As" / "of") on the Tutors payroll tile, the
   Families balance strip and the family ledger. A date field has an intrinsic
   width and never wanted the other 200 pixels. */
.row > .input[type="date"], .row-wrap > .input[type="date"] { width: auto; flex: 0 0 auto; }
/* ⚠ scoped with `:has()` on purpose. A blanket `.row > .small { nowrap }` would
   have stopped every muted sentence in a flex row from wrapping, anywhere in
   the portal; this keeps the label of a date picker on one line and touches
   nothing else. Where `:has()` is unsupported the rule is simply dropped, and
   the auto-width above already does most of the work. */
.row:has(> .input[type="date"]) > .small,
.row:has(> .input[type="date"]) > .tiny,
.row-wrap:has(> .input[type="date"]) > .small,
.row-wrap:has(> .input[type="date"]) > .tiny { white-space: nowrap; }
.stack-4   { display: flex; flex-direction: column; gap: 4px; }
.stack-8   { display: flex; flex-direction: column; gap: 8px; }
.stack-16  { display: flex; flex-direction: column; gap: 16px; }
.stack-24  { display: flex; flex-direction: column; gap: 24px; }
.mt-0 { margin-top: 0; }   .mt-8  { margin-top: 8px; }   .mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mb-0 { margin-bottom: 0; } .mb-8 { margin-bottom: 8px; } .mb-16 { margin-bottom: 16px; }
.divider { height: 1px; background: var(--line); margin: 16px 0; border: 0; }
.divider-v { width: 1px; align-self: stretch; background: var(--line); }
.clickable { cursor: pointer; }
.money-hidden { color: var(--muted-ink); }

/* MONEY IS A NUMBER, NOT A PILL. A balance boxed in a red or green lozenge
   shouted at the same volume as every other balance, and a pill breaks the one
   thing a money column is for — comparing figures down it. Weight, colour and
   tabular figures carry it instead. The CALLER appends the word ("credit",
   "discount") so the sign never depends on colour alone. */
.money-figure, .money-owing, .money-credit {
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.money-owing  { color: var(--danger-ink); font-weight: var(--fw-semi); }   /* 6.3:1 */
.money-credit { color: var(--ok-ink);     font-weight: var(--fw-semi); }   /* 5.6:1 */

/* --------------------------------------------------------------------------
   4. APP SHELL
   -------------------------------------------------------------------------- */
.app {
  display: grid;
  grid-template-columns: var(--sidebar-w) minmax(0, 1fr);
  min-height: 100vh;
  min-height: 100dvh;
}

.app-main {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 100vh;
  min-height: 100dvh;
}

/* Mobile drawer scrim.
   MUST be out of flow at every viewport size: with no base rule it defaulted to
   `display:block; position:static`, became the second grid item, took the main
   column and pushed the whole app below the sidebar on desktop. */
.drawer-backdrop {
  display: none;
  position: fixed;
  inset: 0;
}

/* ---- sidebar ---- */
.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--sidebar-bg);
  border-right: 1px solid var(--line);
  z-index: 60;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  height: var(--topbar-h);
  flex: 0 0 var(--topbar-h);
  padding: 0 18px;
  border-bottom: 1px solid var(--line);
}
.sidebar-brand .logo-img { height: 26px; width: auto; display: block; }
.sidebar-brand .brand-sub {
  font-size: var(--fs-micro);
  letter-spacing: var(--tracking-caps);
  text-transform: uppercase;
  color: var(--brand-dark);
  font-weight: var(--fw-bold);
  opacity: .75;
  padding-top: 4px;
}

.sidebar-nav {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 14px 12px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.sidebar-section-label {
  font-size: var(--fs-micro);
  font-weight: var(--fw-semi);
  letter-spacing: var(--tracking-caps);
  text-transform: uppercase;
  color: var(--muted-ink);
  padding: 14px 10px 6px;
}

.sidebar-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 11px;
  min-height: var(--tap);
  padding: 10px 12px;
  border-radius: var(--r-md);
  color: var(--ink-2);
  font-weight: var(--fw-medium);
  font-size: var(--fs-body);
  text-decoration: none;
  transition: background .16s ease, color .16s ease, box-shadow .16s ease;
  -webkit-tap-highlight-color: transparent;
}
.sidebar-item:hover { background: rgba(255, 255, 255, .72); color: var(--ink); text-decoration: none; }
.sidebar-item:focus-visible { outline: none; box-shadow: var(--ring); }
.sidebar-item svg { width: 19px; height: 19px; flex: 0 0 19px; stroke: currentColor; opacity: .82; }
.sidebar-item .sidebar-label { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-item .sidebar-count {
  font-size: var(--fs-micro); font-weight: var(--fw-bold); color: var(--brand-dark);
  background: var(--white); border: 1px solid var(--info-line);
  border-radius: var(--r-pill); padding: 1px 7px;
}
.sidebar-item.active {
  background: var(--white);
  color: var(--brand-darker);
  font-weight: var(--fw-semi);
  box-shadow: var(--shadow-1);
}
.sidebar-item.active svg { opacity: 1; stroke: var(--brand); }
.sidebar-item.active::before {
  content: "";
  position: absolute;
  left: -12px;
  top: 50%;
  transform: translateY(-50%);
  width: 4px;
  height: 22px;
  border-radius: 0 4px 4px 0;
  background: var(--brand);
}

.sidebar-foot {
  flex: 0 0 auto;
  padding: 12px;
  border-top: 1px solid var(--line);
}
.sidebar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px;
  border-radius: var(--r-md);
  background: rgba(255, 255, 255, .7);
  min-height: var(--tap);
}
.sidebar-user .su-meta { min-width: 0; flex: 1 1 auto; }
.sidebar-user .su-name {
  font-weight: var(--fw-semi); font-size: var(--fs-sm); color: var(--ink);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.sidebar-user .su-role { font-size: var(--fs-xs); color: var(--muted-ink); }

/* ---- topbar ---- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 12px;
  height: var(--topbar-h);
  flex: 0 0 var(--topbar-h);
  padding: 0 var(--gutter);
  background: rgba(255, 255, 255, .88);
  backdrop-filter: saturate(180%) blur(12px);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--line);
}
.topbar-title {
  font-family: var(--font-serif);
  font-size: var(--fs-heading);
  font-weight: var(--fw-bold);
  letter-spacing: -.015em;
  color: var(--ink);
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.topbar-actions { display: flex; align-items: center; gap: 8px; margin-left: auto; }

.hamburger {
  display: none;
  align-items: center;
  justify-content: center;
  width: var(--tap);
  height: var(--tap);
  margin-left: -8px;
  border: 1px solid transparent;
  border-radius: var(--r-md);
  background: transparent;
  color: var(--ink-2);
}
.hamburger:hover { background: var(--bg); }
.hamburger svg { width: 22px; height: 22px; stroke: currentColor; }

.user-chip {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 5px 12px 5px 5px;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-pill);
  background: var(--white);
  min-height: 38px;
  max-width: 260px;
}
.user-chip .uc-meta { min-width: 0; line-height: 1.15; }
.user-chip .uc-name {
  font-size: var(--fs-sm); font-weight: var(--fw-semi);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.user-chip .uc-role { font-size: var(--fs-micro); color: var(--muted-ink); }

/* ---- page ---- */
.page {
  flex: 1 1 auto;
  min-width: 0;
  padding: var(--gutter);
  max-width: 1560px;
  width: 100%;
  margin: 0 auto;
}

.page-head {
  display: flex;
  align-items: flex-start;
  gap: var(--s-4);
  flex-wrap: wrap;
  margin-bottom: var(--s-6);
}
.page-head .ph-text { min-width: 0; flex: 1 1 320px; }
.page-head h1 {
  font-family: var(--font-serif);
  font-size: var(--fs-display);
  font-weight: var(--fw-bold);
  letter-spacing: -.02em;
  line-height: 1.2;
}
.page-head .ph-sub { color: var(--muted-ink); font-size: var(--fs-sm); margin-top: var(--s-1); }
.page-head .ph-actions { display: flex; align-items: center; gap: var(--s-2); flex-wrap: wrap; margin-left: auto; }

/* ⚠ `align-self` is load-bearing, not tidying. An `inline-flex` child of a
   `display:flex; flex-direction:column` parent (`.stack-16`) is BLOCKIFIED and
   then stretched to the column's full width: the Families record mounted its
   crumb that way and got a 1328px-wide anchor over 192px of content — a
   full-page-width invisible strip where a click navigates away. */
.breadcrumb {
  display: inline-flex;
  align-self: flex-start;
  align-items: center;
  gap: 6px;
  font-size: var(--fs-sm);
  font-weight: var(--fw-semi);
  color: var(--brand-dark);
  margin-bottom: 10px;
  min-height: 32px;
}
.breadcrumb:hover { text-decoration: none; color: var(--brand-darker); }
.breadcrumb svg { width: 15px; height: 15px; stroke: currentColor; }

.section-title {
  font-size: var(--fs-micro);
  font-weight: var(--fw-semi);
  letter-spacing: var(--tracking-caps);
  text-transform: uppercase;
  color: var(--muted-ink);
  margin: 0 0 var(--s-3);
}

/* two-column detail layout (student / tutor / family detail pages) */
.detail-layout {
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  gap: var(--s-5);
  align-items: start;
}
.detail-aside { display: flex; flex-direction: column; gap: var(--s-4); position: sticky; top: calc(var(--topbar-h) + 16px); }
.detail-main  { min-width: 0; display: flex; flex-direction: column; gap: var(--s-4); }

/* --------------------------------------------------------------------------
   5. CARDS
   -------------------------------------------------------------------------- */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-1);
}
.card + .card { margin-top: var(--s-4); }
.card-head {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  padding: var(--s-4) var(--s-5);
  border-bottom: 1px solid var(--line-2);
  min-height: 56px;
}
/* The serif on a card title is the same pairing as the wordmark, and it is
   what separates a titled panel from the rows inside it without a second
   rule, a tint or a weight bump. */
.card-head h2, .card-head h3 {
  font-family: var(--font-serif);
  font-size: var(--fs-title);
  font-weight: var(--fw-bold);
  letter-spacing: -.01em;
}
.card-head .card-actions { margin-left: auto; display: flex; align-items: center; gap: var(--s-2); }
.card-body { padding: var(--s-5); }
.card-body.tight { padding: var(--s-3); }
.card-body.flush { padding: 0; }
/* A card foot washed in pale blue put a coloured band at the bottom of every
   panel in the portal — decoration repeated often enough to stop meaning
   anything. One hairline is the whole separation it needs. */
.card-foot {
  padding: var(--s-3) var(--s-5);
  border-top: 1px solid var(--line-2);
  display: flex;
  align-items: center;
  gap: var(--s-2);
  background: var(--surface);
  border-radius: 0 0 var(--r-lg) var(--r-lg);
}
.card-hover { transition: box-shadow .18s ease, transform .18s ease, border-color .18s ease; }
.card-hover:hover { box-shadow: var(--shadow-2); border-color: var(--info-line); }

/* profile card (detail sidebars) */
.profile-card { text-align: center; padding: var(--s-6) var(--s-5); }
/* ⚠ `.avatar-xl`, NOT `.avatar`. This rule centres the PORTRAIT at the top of
   the card — and both profile cards draw that portrait at `xl` (student
   profileCard, tutor buildAside). Written as `.profile-card .avatar` it also
   caught every 24/30px avatar further down the card: the household rows had
   `margin: 0 auto` applied to the person's face, so each one floated to the
   middle of its own row and the name sat wherever the leftover space put it —
   the parent, the student and each sibling all starting at a different x. */
.profile-card .avatar-xl { margin: 0 auto var(--s-3); }
.profile-card .pc-name {
  font-size: var(--fs-heading); font-weight: var(--fw-bold); font-family: var(--font-serif);
  letter-spacing: -.01em;
}
.profile-card .pc-badges { display: flex; gap: var(--s-1) var(--s-4); justify-content: center; flex-wrap: wrap; margin-top: var(--s-2); }
.profile-card .pc-links { margin-top: var(--s-3); font-size: var(--fs-sm); }
/* the parent ↔ student relation reads as rows, so it opts out of the card's
   centring and gets a rule above it to separate it from the profile proper */
.profile-card .relation-block {
  text-align: left;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--line-2);
}

/* stat tiles */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: var(--s-4);
}
.stat {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: var(--s-5);
  box-shadow: none;              /* a hairline OR a shadow, never both       */
  min-width: 0;
}
.stat .stat-label {
  font-size: var(--fs-micro);
  font-weight: var(--fw-semi);
  letter-spacing: var(--tracking-caps);
  text-transform: uppercase;
  color: var(--muted-ink);
  display: flex;
  align-items: center;
  gap: var(--s-2);
}
.stat .stat-value {
  font-size: var(--fs-figure);
  font-weight: var(--fw-bold);
  letter-spacing: -.02em;
  margin-top: var(--s-2);
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
}
.stat .stat-sub { font-size: var(--fs-sm); color: var(--muted-ink); margin-top: var(--s-1); }
/* A gradient wash over a tile is ornament pretending to be emphasis. The tile
   that matters is marked by one hairline in the accent, which is a decision;
   a fade is just a texture.
   ⚠ --brand-mid, not --brand-soft: the soft step measured 2.38:1 against the
   tile's own ground, so the one hairline carrying the emphasis was fainter
   than the thing it was meant to single out. 3.35:1 reads as a decision. */
.stat.stat-brand  { background: var(--surface); border-color: var(--brand-mid); }
.stat.stat-ok     .stat-value { color: var(--ok); }
.stat.stat-warn   .stat-value { color: var(--warn-ink); }
.stat.stat-danger .stat-value { color: var(--danger); }

.progress {
  height: 8px;
  background: var(--line-2);
  border-radius: var(--r-pill);
  overflow: hidden;
  margin-top: 10px;
}
/* A bar is a measurement. A gradient along it implies the value changes across
   its own length, which is false — flat fills, one hue each. */
.progress > span {
  display: block;
  height: 100%;
  background: var(--brand);
  border-radius: var(--r-pill);
  transition: width .4s cubic-bezier(.4, 0, .2, 1);
}
.progress.ok > span     { background: var(--ok); }
.progress.warn > span   { background: var(--warn-ink); }
.progress.danger > span { background: var(--danger); }

/* key/value list */
.kv { display: grid; grid-template-columns: minmax(90px, 40%) minmax(0, 1fr); gap: var(--s-2) var(--s-4); font-size: var(--fs-body); }
.kv dt { color: var(--muted-ink); font-weight: var(--fw-regular); }
.kv dd { margin: 0; color: var(--ink); min-width: 0; overflow-wrap: anywhere; }
/* ⚠ In a 320px detail rail a two-column kv leaves about 170px for the value,
   and `overflow-wrap: anywhere` then broke every contact into nonsense —
   "sarah.harper@example" / ".com", an address over four lines. The label stacks
   over its value instead, which gives the value the full width of the rail and
   is how a contact block is read anyway: name of thing, then thing. */
.detail-aside .kv { grid-template-columns: minmax(0, 1fr); gap: 0; }
.detail-aside .kv dt {
  font-size: var(--fs-micro);
  font-weight: var(--fw-semi);
  letter-spacing: var(--tracking-caps);
  text-transform: uppercase;
}
.detail-aside .kv dt + dd { margin-bottom: var(--s-3); }
.detail-aside .kv dd:last-child { margin-bottom: 0; }

/* generic list rows */
.list-row {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  padding: var(--s-3) var(--s-5);
  border-bottom: 1px solid var(--line-2);
  min-height: 60px;
  text-decoration: none;
  color: inherit;
}
.list-row:last-child { border-bottom: 0; }
.list-row:hover { background: var(--bg); text-decoration: none; }
.list-row .lr-main { min-width: 0; flex: 1 1 auto; }
.list-row .lr-title { font-weight: var(--fw-semi); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list-row .lr-sub { font-size: var(--fs-sm); color: var(--muted-ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Waiting-for-approval rows (Tutors & Staff — a signed-in person with no portal
   account; see js/signin-requests.js). Two buttons live on the row, and Jordan's
   tutors run this on a phone, so the actions drop to their own full-width line
   rather than squeezing the name off the end. The sub-line wraps because it
   carries the match note ("Matches your tutor profile: …"), which is the whole
   reason the row is readable at a glance. */
.approval-note { padding: 14px 18px 2px; margin: 0; }
.approval-row { flex-wrap: wrap; row-gap: 10px; }
.approval-row .lr-main { flex: 1 1 170px; }
/* The name carries a Matched / New badge, so it has to be allowed to wrap
   rather than clip the badge off the end on a phone. */
.approval-row .lr-title {
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
  white-space: normal; overflow: visible; text-overflow: clip;
}
.approval-row .lr-sub { white-space: normal; overflow: visible; text-overflow: clip; }
.approval-row .lr-actions { display: flex; gap: 8px; flex: 0 0 auto; margin-left: auto; }
@media (max-width: 560px) {
  .approval-row .lr-actions { flex: 1 1 100%; margin-left: 0; }
  .approval-row .lr-actions .btn { flex: 1 1 0; min-height: var(--tap); }
}

/* Collapsed disclosure ("Advanced: …"). Same shape as .sched-help further down,
   but named for the PATTERN rather than one page, so any view can reach for it:
   js/view-tutors.js hides the rarely-needed "link an existing account UID"
   field behind one so the normal path — add the tutor by email — is the only
   thing on screen. */
details.disclosure {
  background: var(--surface);
  border: 1px solid var(--tb-line);
  border-radius: var(--r-md);
}
details.disclosure > summary {
  list-style: none;
  cursor: pointer;
  padding: var(--s-3) var(--s-4);
  min-height: var(--tap);
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: var(--fs-body);
  font-weight: var(--fw-semi);
  color: var(--brand-dark);
}
details.disclosure > summary::-webkit-details-marker { display: none; }
details.disclosure > summary::after {
  content: "";
  margin-left: auto;
  width: 9px; height: 9px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg) translate(-2px, -2px);
  transition: transform .16s ease;
}
details.disclosure[open] > summary::after { transform: rotate(-135deg) translate(-2px, -2px); }
details.disclosure[open] > summary { border-bottom: 1px solid var(--line-2); }
details.disclosure > .disclosure-body { padding: var(--s-4); }

/* --------------------------------------------------------------------------
   6. BUTTONS
   -------------------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 40px;
  padding: 0 15px;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-sm);
  background: var(--white);
  /* A secondary button is a door, not an announcement: ink-2 at medium weight
     sits clearly below the one primary on the page. The border stays
     --line-strong because white-on-paper gives the shape no other edge and a
     control boundary owes 3:1 (WCAG 1.4.11). */
  color: var(--ink-2);
  font-size: var(--fs-sm);
  font-weight: var(--fw-medium);
  line-height: 1;
  white-space: nowrap;
  text-decoration: none;
  transition: background .15s ease, border-color .15s ease, box-shadow .15s ease,
              color .15s ease, transform .06s ease;
  -webkit-tap-highlight-color: transparent;
}
/* Neutral, not blue. Blue is the accent, and the accent belongs to the one
   primary action — if every button in the toolbar turns blue under the cursor
   the primary stops being the loudest thing on the page. */
.btn:hover { background: var(--bg); border-color: var(--muted-ink); color: var(--ink); text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn:focus-visible { outline: none; box-shadow: var(--ring); }
/* Fading the whole element faded the label WITH the fill — white on brand at
   50% over white came out 1.45:1, so a disabled "Save" was a blank blue slab.
   State the disabled look instead of dimming it: 5.5:1 and unmistakably off. */
.btn[disabled], .btn.disabled {
  opacity: 1; pointer-events: none; cursor: not-allowed;
  background: var(--line-2);
  border-color: var(--line);
  color: var(--muted-ink);
  box-shadow: none;
}
.btn[disabled] svg, .btn.disabled svg { opacity: .75; }
.btn svg { width: 16px; height: 16px; stroke: currentColor; flex: 0 0 16px; }

/* Flat. A vertical fade down a 40px button is a 2006 bevel in disguise, and the
   coloured shadow under it was a glow — both were ornament standing in for
   importance that the colour alone already carries. (The TUTORBIRD layer flat-
   tened this at the end of the file; stating it here too stops the source
   claiming a gradient the app has not rendered for months.) */
.btn-primary {
  background: var(--brand);
  border-color: var(--brand);
  color: var(--white);
  box-shadow: none;
}
.btn-primary:hover { background: var(--brand-dark); border-color: var(--brand-dark); }

/* A pale-blue slab was a second filled button competing with the primary.
   White with brand ink says "also a real action" without the second fill. */
.btn-secondary {
  background: var(--white);
  border-color: var(--brand-soft);
  color: var(--brand-dark);
  font-weight: var(--fw-semi);
}
.btn-secondary:hover { background: var(--brand-tint); border-color: var(--brand); color: var(--brand-darker); }

.btn-ghost { background: transparent; border-color: transparent; color: var(--ink-2); }
.btn-ghost:hover { background: var(--bg); border-color: transparent; color: var(--ink); }

.btn-danger { background: var(--white); border-color: var(--danger-line); color: var(--danger); }
.btn-danger:hover { background: var(--danger-bg); border-color: var(--danger); }
.btn-danger-solid { background: var(--danger); border-color: var(--danger-dark); color: var(--white); }
.btn-danger-solid:hover { background: var(--danger-dark); }

.btn-sm  { min-height: 32px; padding: 0 11px; font-size: var(--fs-sm); border-radius: var(--r-sm); gap: 5px; }
.btn-sm svg { width: 14px; height: 14px; flex: 0 0 14px; }
.btn-lg  { min-height: 46px; padding: 0 20px; font-size: var(--fs-lead); border-radius: var(--r-md); }
.btn-block { display: flex; width: 100%; }

.btn-icon {
  width: 36px; min-height: 36px; padding: 0;
  border-radius: var(--r-sm);
  color: var(--ink-2);
  background: transparent;
  border-color: transparent;
}
.btn-icon:hover { background: var(--bg); color: var(--ink); }
.btn-icon.btn-sm { width: 30px; min-height: 30px; }

/* split button (+ Add New ▾) */
.btn-split { display: inline-flex; }
.btn-split > .btn:first-child { border-top-right-radius: 0; border-bottom-right-radius: 0; }
.btn-split > .btn:last-child {
  border-top-left-radius: 0; border-bottom-left-radius: 0;
  margin-left: -1px; padding: 0 9px;
}

.btn-group { display: inline-flex; border: 1px solid var(--line-strong); border-radius: var(--r-sm); overflow: hidden; background: var(--white); }
.btn-group > button {
  border: 0; background: transparent; padding: 0 13px; min-height: 38px;
  font-size: var(--fs-sm); font-weight: var(--fw-medium); color: var(--ink-2);
}
.btn-group > button + button { border-left: 1px solid var(--line); }
.btn-group > button:hover { background: var(--bg); color: var(--ink); }
/* the selected segment is a STATE, so it earns weight and ink — not a fill */
.btn-group > button.active { background: var(--bg); color: var(--ink); font-weight: var(--fw-semi); box-shadow: inset 0 -2px 0 var(--brand); }

/* dropdown menu */
.menu {
  position: absolute;
  z-index: 200;
  min-width: 200px;
  max-height: 60vh;
  overflow: auto;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-3);
  padding: 6px;
  animation: menuIn .13s ease-out;
}
@keyframes menuIn { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
.menu-item {
  display: flex; align-items: center; gap: 9px;
  width: 100%; min-height: 38px; padding: 8px 10px;
  border: 0; background: transparent; border-radius: var(--r-sm);
  font-size: var(--fs-body); text-align: left; color: var(--ink);
}
.menu-item:hover { background: var(--bg); }
.menu-item.danger { color: var(--danger); }
.menu-item.danger:hover { background: var(--danger-bg); }
.menu-item svg { width: 16px; height: 16px; stroke: currentColor; opacity: .75; }
.menu-sep { height: 1px; background: var(--line-2); margin: 5px 2px; }
.menu-label {
  font-size: var(--fs-micro); font-weight: var(--fw-semi); letter-spacing: var(--tracking-caps);
  text-transform: uppercase;
  color: var(--muted-ink); padding: var(--s-2) 10px var(--s-1);
}

/* --------------------------------------------------------------------------
   7. FORMS
   -------------------------------------------------------------------------- */
.label {
  display: block;
  font-size: var(--fs-sm);
  font-weight: var(--fw-medium);
  color: var(--ink-2);
  margin-bottom: var(--s-2);
}
.label .req { color: var(--danger); margin-left: 2px; }
.hint { font-size: var(--fs-xs); color: var(--muted-ink); margin-top: var(--s-1); line-height: 1.45; }
.error-text { font-size: var(--fs-xs); color: var(--danger); margin-top: var(--s-1); font-weight: var(--fw-medium); }

.input, .select, .textarea {
  display: block;
  width: 100%;
  min-height: 40px;
  padding: 9px 12px;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-sm);
  background: var(--white);
  color: var(--ink);
  font-size: var(--fs-body);
  transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
  appearance: none;
  -webkit-appearance: none;
}
.input::placeholder, .textarea::placeholder { color: var(--muted-ink); }
/* ⚠ hover must not LOWER the border's contrast. --brand-soft is 2.53:1 on
   white and 2.38:1 on paper — below the resting --line-strong — so pointing at
   a field made its only identifying shape harder to see. --brand-mid is the
   first blue step that clears 3:1 (3.56 white / 3.35 paper / 3.29 tint); it is
   the same correction `.pv-next-card` already carries further down this file. */
.input:hover, .select:hover, .textarea:hover { border-color: var(--brand-mid); }
.input:focus, .select:focus, .textarea:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: var(--ring);
}
/* A disabled field still has to be READ — a parent's own name/email sit here
   until they press Edit. --muted is 2.7:1 on --bg, and Chrome layers its own
   opacity:.7 on a disabled <select>, taking it to 1.9:1. Hence --muted-ink
   (5.8:1) and an explicit opacity:1 so the UA alpha cannot reassert. */
.input:disabled, .select:disabled, .textarea:disabled {
  background: var(--bg); color: var(--muted-ink); opacity: 1; cursor: not-allowed;
}
.input.invalid, .select.invalid, .textarea.invalid { border-color: var(--danger); }
.input.invalid:focus { box-shadow: 0 0 0 3px rgba(201, 63, 63, .20); }

.textarea { min-height: 96px; resize: vertical; line-height: 1.55; }

.select {
  padding-right: 34px;
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%235B6D80' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 11px center;
  cursor: pointer;
}
.select[multiple] { background-image: none; padding-right: 12px; min-height: 120px; }

.input-sm, .select-sm { min-height: 32px; padding: 5px 10px; font-size: var(--fs-sm); border-radius: var(--r-sm); }
.select-sm { padding-right: 28px; background-position: right 8px center; }

/* search input */
.search-wrap { position: relative; display: inline-flex; align-items: center; min-width: 210px; flex: 0 1 280px; }
.search-wrap svg {
  position: absolute; left: 11px; width: 16px; height: 16px;
  stroke: var(--muted-ink); pointer-events: none;
}
.search-wrap .input { padding-left: 34px; }
.search-wrap .search-clear {
  position: absolute; right: 6px; width: 26px; height: 26px;
  border: 0; background: transparent; border-radius: var(--r-pill);
  color: var(--muted-ink); display: none; align-items: center; justify-content: center;
}
.search-wrap .search-clear:hover { background: var(--line-2); color: var(--ink); }
.search-wrap.has-value .search-clear { display: inline-flex; }

/* input with leading symbol (money) */
.input-affix { position: relative; display: block; }
.input-affix .affix {
  position: absolute; left: 12px; top: 50%; transform: translateY(-50%);
  color: var(--muted-ink); font-size: var(--fs-body); pointer-events: none;
}
.input-affix .input { padding-left: 26px; }

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: var(--s-4) var(--s-5);
}
.form-grid.cols-1 { grid-template-columns: minmax(0, 1fr); }
.form-grid.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.form-grid.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.form-grid .span-2 { grid-column: span 2; }
.form-grid .span-all { grid-column: 1 / -1; }

.form-row { margin-bottom: 16px; }
.form-row:last-child { margin-bottom: 0; }
.form-row.inline { display: flex; align-items: center; gap: 12px; }
.form-row.inline .label { margin-bottom: 0; flex: 0 0 auto; }

.fieldset {
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 16px;
  margin: 0 0 16px;
}
.fieldset > legend {
  font-size: var(--fs-micro); font-weight: var(--fw-semi); letter-spacing: var(--tracking-caps);
  text-transform: uppercase;
  color: var(--muted-ink); padding: 0 6px;
}

/* switch */
.switch { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; min-height: var(--tap); user-select: none; }
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch .switch-track {
  position: relative;
  width: 44px; height: 26px; flex: 0 0 44px;
  background: var(--line-strong);
  border-radius: var(--r-pill);
  transition: background .18s ease;
}
.switch .switch-track::after {
  content: "";
  position: absolute; top: 3px; left: 3px;
  width: 20px; height: 20px;
  background: var(--white); border-radius: 50%;
  box-shadow: 0 1px 3px rgba(10, 31, 51, .26);
  transition: transform .18s cubic-bezier(.4, 0, .2, 1);
}
.switch input:checked + .switch-track { background: var(--brand); }
.switch input:checked + .switch-track::after { transform: translateX(18px); }
.switch input:focus-visible + .switch-track { box-shadow: var(--ring); }
/* .5 left no visible track edge at all (1.7:1) — grey it, don't dissolve it */
.switch input:disabled + .switch-track { opacity: 1; background: var(--line); border-color: var(--line-strong); }
.switch input:disabled:checked + .switch-track { background: var(--brand-soft); border-color: var(--brand-soft); }
.switch .switch-label { font-size: var(--fs-body); }
.switch .switch-label small { display: block; color: var(--muted-ink); font-size: var(--fs-sm); }

/* checkbox + radio rows */
.checkbox-row, .radio-row {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  padding: 9px 0;
  min-height: var(--tap);
  cursor: pointer;
  user-select: none;
}
.checkbox-row input[type="checkbox"], .radio-row input[type="radio"] {
  appearance: none; -webkit-appearance: none;
  width: 19px; height: 19px; flex: 0 0 19px;
  margin: 1px 0 0;
  border: 1.5px solid var(--line-strong);
  background: var(--white);
  cursor: pointer;
  transition: border-color .14s ease, background .14s ease;
}
.checkbox-row input[type="checkbox"] { border-radius: var(--r-2xs); }
.radio-row input[type="radio"] { border-radius: 50%; }
.checkbox-row input[type="checkbox"]:checked, .radio-row input[type="radio"]:checked {
  border-color: var(--brand); background: var(--brand);
}
.checkbox-row input[type="checkbox"]:checked {
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'/%3E%3C/svg%3E");
  background-size: 13px; background-position: center; background-repeat: no-repeat;
}
.radio-row input[type="radio"]:checked {
  box-shadow: inset 0 0 0 3.5px var(--white);
}
.checkbox-row input:focus-visible, .radio-row input:focus-visible { outline: none; box-shadow: var(--ring); }
.checkbox-row input:disabled, .radio-row input:disabled {
  opacity: 1; cursor: not-allowed; background: var(--line-2); border-color: var(--line-strong);
}
.checkbox-row input:disabled:checked, .radio-row input:disabled:checked {
  background-color: var(--brand-soft); border-color: var(--brand-soft);
}
.checkbox-row .cr-text, .radio-row .cr-text { min-width: 0; line-height: 1.45; }
.checkbox-row .cr-text strong, .radio-row .cr-text strong { font-weight: var(--fw-semi); font-size: var(--fs-body); display: block; }
.checkbox-row .cr-text small, .radio-row .cr-text small { color: var(--muted-ink); font-size: var(--fs-sm); display: block; margin-top: 1px; }

/* boxed radio/checkbox cards */
.choice-card {
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: var(--s-3) var(--s-4);
  margin-bottom: var(--s-2);
  transition: border-color .15s ease, background .15s ease;
}
.choice-card:hover { border-color: var(--line-strong); background: var(--bg); }
/* chosen = a brand edge and a white ground, not a blue slab */
.choice-card.selected { border-color: var(--brand); background: var(--surface); box-shadow: inset 2px 0 0 var(--brand); }

/* privilege tree indentation */
.priv-child { margin-left: 30px; padding-left: 14px; border-left: 2px solid var(--line); }

/* --------------------------------------------------------------------------
   8. STATUS, METADATA, FLAGS — then chips, avatars, tags

   THE STATUS SYSTEM. Three levels and only three. A filled coloured pill is a
   shout; a screen where everything shouts has no hierarchy, which is exactly
   why a staff row stacking [Inactive][Tutor][No login][Awaiting sign-in] read
   as clutter taller than the name it described.

     .state       a small mark + quiet text. ORDINARY STATE (active/inactive/
                  paid/sent). Colour and type carry it — there is no container.
     .meta-text   plain muted text. METADATA (role, lesson type, duration,
                  counts). No mark, no colour, no container at all.
     .flag        the ONE filled badge in the whole portal. Reserved for
                  something a human must act on today. Used sparingly enough
                  that seeing one means something.

   `.badge` is kept as a working alias of `.state` so that `UI.badge()` — which
   the BUILD CONTRACT pins as a required API, and which ~150 call sites use —
   quietens everywhere at once instead of leaving half the portal on the old
   look. `.badge-<variant>` names survive as tone aliases.

   ⛔ WCAG: never colour alone. Each tone draws a DIFFERENT SHAPE (disc, target,
   half-disc, diamond, hollow diamond, ring), so the six states stay apart for a
   colour-blind reader, and @media print swaps the drawn mark for a real glyph
   because printers drop backgrounds and box-shadows.
   -------------------------------------------------------------------------- */
.state,
.badge {
  --state-c: var(--muted-ink);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  font-size: var(--fs-sm);
  font-weight: var(--fw-medium);
  line-height: 1.5;
  color: var(--ink-2);                    /* 10.7:1 on paper — readable copy  */
  white-space: nowrap;
  background: none;
  border: 0;
  padding: 0;
  border-radius: 0;
}
.state .state-tx, .badge .state-tx { overflow: hidden; text-overflow: ellipsis; }
.state svg, .badge svg { width: 12px; height: 12px; stroke: currentColor; }

/* the mark. 9px, drawn, never the only channel. */
.state::before,
.badge::before {
  content: '';
  box-sizing: border-box;
  flex: 0 0 auto;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--state-c);
}
/* a glyph the caller supplied (attendance icons) stands in for the mark */
.state-glyph::before, .state-nomark::before { display: none; }
.state-glyph .state-mk {
  flex: 0 0 auto; color: var(--state-c); font-size: var(--fs-xs); line-height: 1;
  font-variant-emoji: text;
}

/* ---- the six tones. Ratios below are MEASURED IN THE BROWSER against the
   ground the mark is actually drawn on (--bg paper), not against white — the
   file used to quote the on-white figures, which ran up to half a point high.
   Every one clears the 3:1 a UI graphic owes (WCAG 1.4.11). ---------------- */
.state-ok,      .badge-ok      { --state-c: var(--ok); }         /* 3.87:1 ●  */
.state-info,    .badge-info,
.state-brand,   .badge-brand   { --state-c: var(--brand); }      /* 4.60:1 ◉  */
.state-warn,    .badge-warn    { --state-c: var(--warn-ink); }   /* 6.37:1 ◐
   Jordan's gold #E8B04A is only 2:1 on paper, so the MARK uses the deep gold
   step. The bright gold stays for large fills, never for a 9px dot. */
.state-danger,  .badge-danger  { --state-c: var(--danger); }     /* 4.63:1 ◆  */
.state-purple,  .badge-purple  { --state-c: var(--purple); }     /* 5.07:1 ◇  */
.state-neutral, .badge-neutral,
.state-outline, .badge-outline { --state-c: var(--muted-ink); }  /* 5.83:1 ○
   NOT --line-strong: a hairline token is tuned to disappear, and even after
   that token was raised to 3.45:1 it stays the quietest thing that passes.
   The navy-grey step reads as deliberately-off rather than as a faded rule. */

/* ---- the six SHAPES. This is the non-colour channel. -------------------- */
/* ◉ target — a ring with a centre dot */
.state-info::before, .badge-info::before,
.state-brand::before, .badge-brand::before {
  background: radial-gradient(circle at 50% 50%,
              var(--state-c) 0 1.7px, var(--white) 1.9px 100%);
  border: 2px solid var(--state-c);
  width: 10px; height: 10px;
}
/* ◐ half disc */
.state-warn::before, .badge-warn::before {
  background: linear-gradient(90deg, var(--state-c) 0 50%, var(--white) 50% 100%);
  border: 1.5px solid var(--state-c);
}
/* ◆ diamond */
.state-danger::before, .badge-danger::before {
  border-radius: 1px; transform: rotate(45deg); width: 8px; height: 8px;
}
/* ◇ hollow diamond */
.state-purple::before, .badge-purple::before {
  border-radius: 1px; transform: rotate(45deg); width: 8px; height: 8px;
  background: var(--white); border: 2px solid var(--state-c);
}
/* ○ ring */
.state-neutral::before, .badge-neutral::before,
.state-outline::before, .badge-outline::before {
  background: var(--white); border: 2px solid var(--state-c);
}

.state-lg, .badge-lg { font-size: var(--fs-body); gap: 7px; }
.state-lg::before, .badge-lg::before { width: 10px; height: 10px; }

/* a row of states / metadata, separated by air rather than by boxes */
.state-row { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 14px; min-width: 0; }

/* ---- LEVEL 2: metadata. Type does the work; no mark, no colour. --------- */
.meta-text {
  font-size: var(--fs-sm);
  font-weight: var(--fw-regular);
  color: var(--muted-ink);                /* 6.2:1 — readable, NOT --muted    */
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}

/* ---- LEVEL 3: the one filled badge. Act-on-this-today, nothing else. ----
   Ink navy rather than a semantic hue: it is not "a green thing" or "a red
   thing", it is the system asking for a decision, and the words say which. */
.flag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 8px;
  border-radius: var(--r-2xs);
  background: var(--navy);
  color: var(--white);                    /* 18:1                             */
  font-size: var(--fs-micro);
  font-weight: var(--fw-semi);
  line-height: 1.45;
  letter-spacing: .03em;
  white-space: nowrap;
}
.flag svg { width: 12px; height: 12px; stroke: currentColor; }
.flag::before {
  content: '';
  flex: 0 0 auto;
  width: 4px; height: 4px; border-radius: 50%;
  background: var(--warn-soft);           /* the one spark of gold in the app  */
}
a.flag:hover, button.flag:hover { background: var(--navy-2); color: var(--white); }

@media print {
  /* printers drop backgrounds and box-shadows — hand the reader the glyph */
  .state::before, .badge::before {
    content: attr(data-mark);
    width: auto; height: auto; border: 0; background: none;
    transform: none; border-radius: 0;
    color: var(--ink); font-size: var(--fs-micro); line-height: 1;
  }
  .flag {
    background: none; color: var(--ink);
    border: 1px solid var(--ink); padding: 1px 6px;
  }
  .flag::before { display: none; }
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 11px;
  border-radius: var(--r-pill);
  background: var(--surface);
  border: 1px solid var(--line);
  font-size: var(--fs-sm);
  font-weight: var(--fw-medium);
  color: var(--ink-2);
  white-space: nowrap;
  max-width: 100%;
}
.chip svg { width: 14px; height: 14px; stroke: currentColor; opacity: .7; flex: 0 0 14px; }
.chip .chip-x {
  border: 0; background: transparent; padding: 0; margin-right: -4px;
  width: 18px; height: 18px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--muted-ink); font-size: 14px; line-height: 1;
}
.chip .chip-x:hover { background: var(--line); color: var(--ink); }
.chip-active { background: var(--brand-light); border-color: var(--info-line); color: var(--brand-darker); }
.chip-row { display: flex; flex-wrap: wrap; gap: 6px; }

/* A tag is METADATA that happens to come in sets, so it keeps the faintest
   possible container — a hairline, no fill — purely so two adjacent tags do
   not read as one phrase. A pale-blue fill on every subject on every row was
   the other half of what made the lists feel like a template. */
.tag {
  display: inline-flex;
  padding: 1px 7px;
  border-radius: var(--r-2xs);
  background: none;
  border: 1px solid var(--line);
  color: var(--muted-ink);
  font-size: var(--fs-xs);
  font-weight: var(--fw-regular);
  white-space: nowrap;
}

.avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  flex: 0 0 36px;
  border-radius: 50%;
  background: var(--brand);
  color: var(--white);
  font-size: var(--fs-sm);
  font-weight: var(--fw-bold);
  letter-spacing: .02em;
  text-transform: uppercase;
  user-select: none;
  overflow: hidden;
}
.avatar-xs { width: 24px; height: 24px; flex-basis: 24px; font-size: 10px; }
.avatar-sm { width: 30px; height: 30px; flex-basis: 30px; font-size: 11px; }
.avatar-lg { width: 52px; height: 52px; flex-basis: 52px; font-size: 18px; }
.avatar-xl { width: 76px; height: 76px; flex-basis: 76px; font-size: 26px; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar-stack { display: inline-flex; }
.avatar-stack .avatar { border: 2px solid var(--white); margin-left: -9px; }
.avatar-stack .avatar:first-child { margin-left: 0; }

.name-cell { display: flex; align-items: center; gap: var(--s-3); min-width: 0; }
/* ⚠ .nc-text must be a BLOCK formatting context: .nc-name and .nc-sub are
   spans, and `overflow:hidden` / `text-overflow` are both ignored on an inline
   box — which is why a family cell rendered "Sarah HarperHarper" on one line
   instead of the name over the account, and why neither ever ellipsised. */
.name-cell .nc-text { min-width: 0; display: flex; flex-direction: column; }
/* A name is the only thing in the cell set in ink at full body size; everything
   under it steps DOWN in both size and colour. That two-step is what makes the
   cell read as "a person, described" instead of a row of equal-weight words —
   it is type doing the work a border used to be asked to do. */
.name-cell .nc-name {
  font-size: var(--fs-body);
  font-weight: var(--fw-semi);
  color: var(--ink);
  letter-spacing: -.005em;
  line-height: 1.35;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.name-cell .nc-sub { font-size: var(--fs-xs); color: var(--muted-ink); line-height: 1.4; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* One quiet line under the name, never a tower of pills beside it. It does not
   wrap: if a row has more to say than fits, the detail page is where it says
   it. `gap` is wide because the items no longer have edges of their own. */
.name-cell .nc-badges {
  display: flex; align-items: center; gap: 4px 12px;
  margin-top: 2px; min-width: 0; overflow: hidden; flex-wrap: nowrap;
}
.name-cell .nc-badges > * { min-width: 0; }

/* --------------------------------------------------------------------------
   THE PARENT ↔ STUDENT CONNECTION

   A student and the adult who pays for them were linked only by a "View Family
   Account" text link, which is a navigation instruction, not a relationship.
   `.relation` draws the relationship instead: the person at the top, and the
   children hanging off ONE hairline that physically connects them. A single
   line, no boxes, no second colour — the indent and the rule say "these belong
   to that" far more plainly than two cards sitting next to each other.
   -------------------------------------------------------------------------- */
.relation { min-width: 0; }
/* The trunk drops out of the parent's avatar — 15px in, half of the 30px `sm`
   avatar — so the line leaves the person it belongs to rather than floating in
   the margin beside them. It is drawn PER CHILD rather than as one border on
   the container, so the last segment can stop at that child's own elbow
   instead of running on into nothing, with no masking rectangle that would
   show through on a hovered row. */
.relation-kids {
  margin: 0 0 0 15px;
  padding: 0 0 0 var(--s-4);
}
/* ⚠ `.person-link` pulls itself 6px left so its hover ground sits under the
   avatar rather than beside it. That pull is KEPT — cancelling it cost ten
   pixels of name and started clipping "Oliver Bennett" to "Oliver Benn…" in a
   320px aside — so the connectors add the 6px back instead: each one is
   positioned off the child, and the child starts (16 − 6) = 10px in. */
.relation-kids > * { position: relative; }
/* the trunk through this row */
.relation-kids > *::after {
  content: "";
  position: absolute;
  left: calc((var(--s-4) - 6px) * -1);
  top: 0;
  width: 1px;
  height: 100%;
  background: var(--line-strong);
  pointer-events: none;
}
/* the last segment stops at its own elbow instead of running on into nothing */
.relation-kids > *:last-child::after { height: 50%; }
/* …and the elbow that reaches from the trunk to the child. Indentation alone
   only IMPLIES the relationship; a drawn connector states it. It costs one
   hairline and no colour, which is the point — the cheapest mark on the
   screen, and still the clearest thing on it. */
.relation-kids > *::before {
  content: "";
  position: absolute;
  left: calc((var(--s-4) - 6px) * -1);
  top: 50%;
  width: var(--s-3);
  height: 1px;
  background: var(--line-strong);
  pointer-events: none;
}

/* one person, one row — used on both sides of the link so a parent and a
   student are presented as the same kind of thing. */
.person-link {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  padding: 5px 8px 5px 6px;
  margin-left: -6px;
  border-radius: var(--r-xs);
  color: inherit;
  text-decoration: none;
  min-height: 38px;
}
a.person-link:hover { background: var(--bg); text-decoration: none; }
a.person-link:focus-visible { outline: none; box-shadow: var(--ring); }
/* "you are here" inside the household. A faint tint and a weighted name —
   no extra word, no extra shape, and it still reads with colour switched off
   because the name is the only bold one in the group. */
.person-link.is-current { background: var(--brand-tint); }
.person-link.is-current .pl-name { font-weight: var(--fw-bold); }
.person-link .pl-text {
  min-width: 0; display: flex; flex-direction: column; gap: 1px;
  margin-right: auto;                      /* trailing items sit right-aligned */
}
.person-link .pl-name {
  font-weight: var(--fw-semi); font-size: var(--fs-body); color: var(--ink);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.person-link .pl-meta {
  font-size: var(--fs-xs); color: var(--muted-ink);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.person-link .pl-end { flex: 0 0 auto; }
/* the relationship word itself — "Parent", "Sibling" — set small and quiet so
   it labels the row without competing with the name on it. */
.person-link .pl-role {
  flex: 0 0 auto; font-size: var(--fs-micro); font-weight: var(--fw-semi);
  letter-spacing: var(--tracking-caps);
  text-transform: uppercase; color: var(--muted-ink);
}

/* one child, named inside a table cell — too tight for a full .person-link,
   so it is the same idea at list density: the name, then its year, quietly. */
.kid-line {
  display: flex; align-items: baseline; gap: var(--s-2); min-width: 0;
  font-size: var(--fs-sm); color: var(--ink); text-decoration: none;
  min-height: 22px;
}
.kid-line:hover { color: var(--brand-dark); text-decoration: underline; }

/* THE NUMBER ITSELF, under the person it belongs to.
   The question actually asked at a student record is "who is Otto's mum and
   what's her number" — so the answer is not a link to a Contacts tab, it is
   the number, on the record, dialable. These are anchors (`tel:` / `mailto:`)
   rather than text for exactly that reason.

   No container, no fill, no second colour: a 13px glyph, the value in ink, and
   the KIND of number only when it is not the mobile — the mobile is the one
   anyone rings, so it is the one that needs no label. Indented to 40px, which
   is where `.person-link`'s name sits (−6 pull + 6 pad + 30 avatar + 10 gap),
   so the details line up under the name they belong to. */
.cl-list {
  display: flex; flex-direction: column; gap: 1px;
  margin: var(--s-1) 0 var(--s-2) 40px;
  min-width: 0;
}
.cl-row {
  display: flex; align-items: center; gap: var(--s-2); min-width: 0;
  min-height: 26px;
  font-size: var(--fs-sm); color: var(--ink); text-decoration: none;
}
.cl-row svg { width: 13px; height: 13px; flex: 0 0 13px; stroke: var(--muted-ink); }
.cl-row .cl-val { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
a.cl-row:hover { color: var(--brand-dark); text-decoration: none; }
a.cl-row:hover .cl-val { text-decoration: underline; }
a.cl-row:hover svg { stroke: var(--brand-dark); }
a.cl-row:focus-visible { outline: none; box-shadow: var(--ring); border-radius: var(--r-xs); }
/* On a touch screen a phone number is a thumb target like everything else —
   and so is the child's name on the Families list (`.kid-line`, 22px), which
   was built for the same job in the same pass and missed the same rule. A
   `.chip` only grows when it is actually pressable: the expenses summary
   toggles are buttons, a subject tag is not. */
@media (hover: none) {
  .cl-row, .kid-line { min-height: var(--tap); }
  /* a baseline-aligned row pins its text to the TOP of a taller box, so the
     name would float off the target it just grew into */
  .kid-line { align-items: center; }
  button.chip, a.chip { min-height: var(--tap); }
  /* the parent/sibling rows and the back-link: both are navigation, both were
     under 44 on a phone (38 and 32) */
  a.person-link { min-height: var(--tap); }
  a.breadcrumb  { min-height: var(--tap); }
  a.name-cell   { min-height: var(--tap); }
}

/* THE HOUSEHOLD ON THE FAMILY RECORD — the same structure as the student page,
   at the width the main column can afford, so each child carries the four
   facts a family record is actually opened for: year, subjects, who teaches
   them, when they are next in. Name and year on the left, teaching on the
   right. Type separates the two, nothing else does — no rule, no tint, no
   second column border. */
.hh-side {
  display: flex; flex-direction: column; align-items: flex-end;
  gap: 1px; text-align: right; min-width: 0;
}
.hh-side .hh-when {
  font-size: var(--fs-xs); font-weight: var(--fw-medium); color: var(--ink-2);
  white-space: nowrap;
}
.hh-side .hh-who {
  font-size: var(--fs-xs); color: var(--muted-ink);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 210px;
}
/* Under 700px the right-hand column has nowhere to be, so the row becomes two
   lines — the person, then what we teach them — rather than two ellipses.
   Scoped to `.hh-block` so the student page's tighter aside is untouched. */
@media (max-width: 700px) {
  .hh-block .person-link { flex-wrap: wrap; }
  /* ⚠ `calc(100% - 40px)`, never `100%`. A flex-basis resolves against the
     CONTAINER's content box and the margin is then added on top, so `100%` +
     40px pushed the wrapped line 40px past the right edge and gave the family
     record a horizontal scrollbar at 375px. */
  .hh-block .person-link .pl-end { flex: 0 0 calc(100% - 40px); margin-left: 40px; }
  .hh-block .hh-side { align-items: flex-start; text-align: left; }
  .hh-block .hh-side .hh-who { max-width: none; }
  /* Once the row wraps, its vertical centre is no longer where the person is,
     and an elbow drawn at 50% met the empty space under the avatar instead of
     the avatar. 25px = 5px of row padding + half the first flex line (name 21px
     + 1px gap + meta 18px), which is where a 30px avatar centres on it. */
  .hh-block .relation-kids > *::before { top: 25px; }
  .hh-block .relation-kids > *:last-child::after { height: 25px; }
}

/* colour dot (calendar colours) — the ring is load-bearing: the palette holds
   pale hues (Amber #E8B04A is 1.96:1 on white) that would otherwise vanish. */
.dot {
  width: 10px; height: 10px; border-radius: 50%; display: inline-block; flex: 0 0 10px;
  background: var(--brand);
  box-shadow: inset 0 0 0 1px rgba(10, 31, 51, .28);
}

/* --------------------------------------------------------------------------
   9. TABS
   -------------------------------------------------------------------------- */
.tabs {
  display: flex;
  align-items: stretch;
  gap: 2px;
  border-bottom: 1px solid var(--line);
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.tabs::-webkit-scrollbar { display: none; }
.tab {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 11px 14px;
  min-height: var(--tap);
  border: 0;
  background: transparent;
  color: var(--ink-2);
  font-size: var(--fs-body);
  font-weight: var(--fw-semi);
  white-space: nowrap;
  border-radius: var(--r-sm) var(--r-sm) 0 0;
  transition: color .15s ease, background .15s ease;
}
.tab:hover { color: var(--ink); background: var(--brand-tint); }
.tab.active { color: var(--brand-darker); }
.tab.active::after {
  content: "";
  position: absolute;
  left: 10px; right: 10px; bottom: -1px;
  height: 2.5px;
  border-radius: 3px 3px 0 0;
  background: var(--brand);
}
/* A count, not a notification. Three filled blue bubbles across every tab bar
   in the portal was pure decoration — the number alone says it, set in the
   tabular figures so the columns of digits line up as the counts change. */
.tab .tab-badge {
  display: inline-block;
  margin-left: 2px;
  background: none;
  color: var(--muted-ink);
  font-size: var(--fs-xs); font-weight: var(--fw-medium);
  font-variant-numeric: tabular-nums;
}
.tab.active .tab-badge { color: var(--brand-dark); font-weight: var(--fw-semi); }

/* pill-style segmented tabs (note audience switch: Student|Parent|Private) */
.tabs-pill { border-bottom: 0; gap: 4px; background: var(--line-2); padding: 4px; border-radius: var(--r-md); display: inline-flex; }
.tabs-pill .tab { border-radius: var(--r-sm); min-height: 34px; padding: 6px 14px; }
.tabs-pill .tab::after { display: none; }
.tabs-pill .tab.active { background: var(--white); color: var(--brand-darker); box-shadow: var(--shadow-1); }

/* --------------------------------------------------------------------------
   10. TABLES + DATATABLE
   -------------------------------------------------------------------------- */
.table-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-1);
  overflow: hidden;
}

.table-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  background: var(--white);
  min-height: 60px;
}
.table-toolbar .tt-left  { display: flex; align-items: center; gap: var(--s-2); flex-wrap: wrap; }
/* ⚠ `.select` is `display:block; width:100%` — correct in a form, wrong in a
   toolbar, where it took a whole line to itself and pushed the Students
   toolbar to three stacked rows before the first student. A filter sits beside
   the buttons it filters.
   `.cal-toolbar` (js/view-calendar.js) is the same kind of bar and had the same
   problem: the "All tutors" filter was a 1,300px-wide dropdown on a line of its
   own under the month controls, which is the single most template-looking thing
   on that page. Named here rather than in the view, per this file's header. */
.table-toolbar .select, .cal-toolbar .select,
.table-toolbar .input:not([type="search"]),
.cal-toolbar .input:not([type="search"]) { width: auto; min-width: 140px; max-width: 240px; }
/* ⚠ `.tt-right` sized itself to max-content and then wrapped INSIDE that box,
   so on a 1440px screen with 250px of slack to spare the Columns button dropped
   under Sort and the toolbar stood 108px tall in two ragged rows — on Students,
   Families, Tutors, every list in the portal. Nothing says "unfinished" faster
   than a control bar that cannot decide how many rows it is. It takes the
   remaining width and right-aligns inside it; wrapping is then a real
   last resort rather than the default. */
.table-toolbar .tt-right {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: var(--s-2);
  flex: 1 1 auto;
  flex-wrap: wrap;
  margin-left: auto;
}
/* the count is a fact about the table, not a control — it sits at the quiet
   step with a little air so it stops reading as another button label */
.table-toolbar .tt-count {
  font-size: var(--fs-sm); color: var(--muted-ink); font-weight: var(--fw-regular);
  padding-left: var(--s-1); white-space: nowrap;
}

.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }

.table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: var(--fs-body);
}
.table thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--brand-tint);
  padding: 10px 14px;
  text-align: left;
  font-size: var(--fs-xs);
  font-weight: var(--fw-semi);
  letter-spacing: var(--tracking-caps);
  text-transform: uppercase;
  color: var(--muted-ink);
  white-space: nowrap;
  border-bottom: 1px solid var(--line);
  user-select: none;
}
.table thead th.sortable { cursor: pointer; }
.table thead th.sortable:hover { color: var(--brand-dark); background: var(--brand-light); }
.table thead th .th-inner { display: inline-flex; align-items: center; gap: 5px; }
.table thead th .sort-ind { opacity: 0; font-size: var(--fs-micro); transition: opacity .15s ease; }
.table thead th.sortable:hover .sort-ind { opacity: .45; }
.table thead th.sorted { color: var(--brand-darker); }
.table thead th.sorted .sort-ind { opacity: 1; }

.table tbody td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--line-2);
  vertical-align: middle;
  color: var(--ink);
}
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr.clickable { cursor: pointer; }
.table tbody tr:hover td { background: var(--brand-tint); }
.table tbody tr.selected td { background: var(--brand-light); }
.table tbody tr.row-muted td { color: var(--muted-ink); }

.table td.num, .table th.num { text-align: right; font-variant-numeric: tabular-nums; }
.table td.center, .table th.center { text-align: center; }
.table td.col-check, .table th.col-check { width: 44px; padding-left: 14px; padding-right: 0; }
.table td.col-actions, .table th.col-actions { width: 52px; text-align: right; }

.table.dense tbody td { padding: 8px 12px; }
.table.dense thead th { padding: 8px 12px; }

.table-check {
  appearance: none; -webkit-appearance: none;
  width: 18px; height: 18px;
  border: 1.5px solid var(--line-strong); border-radius: var(--r-2xs);
  background: var(--white); cursor: pointer; vertical-align: middle;
  transition: border-color .14s ease, background .14s ease;
}
.table-check:checked {
  background: var(--brand); border-color: var(--brand);
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'/%3E%3C/svg%3E");
  background-size: 12px; background-position: center; background-repeat: no-repeat;
}
.table-check:indeterminate {
  background: var(--brand); border-color: var(--brand);
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3.4' stroke-linecap='round'%3E%3Cline x1='5' y1='12' x2='19' y2='12'/%3E%3C/svg%3E");
  background-size: 12px; background-position: center; background-repeat: no-repeat;
}
.table-check:focus-visible { outline: none; box-shadow: var(--ring); }

/* pagination */
.pagination {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  padding: 11px 14px;
  border-top: 1px solid var(--line);
  background: var(--white);
  font-size: var(--fs-sm);
  color: var(--ink-2);
  min-height: 56px;
}
.pagination .pg-group { display: flex; align-items: center; gap: 7px; }
.pagination .pg-group.pg-right { margin-left: auto; }
.pagination label { color: var(--muted-ink); font-weight: var(--fw-regular); white-space: nowrap; }
.pagination .pg-range { color: var(--muted-ink); font-weight: var(--fw-regular); font-variant-numeric: tabular-nums; white-space: nowrap; }
.pagination .select-sm { min-width: 68px; }
.pagination .pg-pages { display: flex; align-items: center; gap: 3px; }
.pagination .pg-btn {
  min-width: 32px; height: 32px; padding: 0 8px;
  border: 1px solid var(--line-strong); background: var(--white);
  border-radius: var(--r-sm);
  font-size: var(--fs-sm); font-weight: var(--fw-semi); color: var(--ink-2);
  display: inline-flex; align-items: center; justify-content: center;
}
.pagination .pg-btn:hover:not([disabled]) { background: var(--bg); border-color: var(--muted-ink); }
.pagination .pg-btn[disabled] {
  opacity: 1; cursor: not-allowed;
  background: var(--line-2); border-color: var(--line); color: var(--muted-ink);
}
.pagination .pg-btn.active { background: var(--brand); border-color: var(--brand-dark); color: var(--white); }
.pagination .pg-btn svg { width: 14px; height: 14px; stroke: currentColor; }
.pagination .pg-ellipsis { padding: 0 3px; color: var(--muted-ink); }

/* column chooser popover */
.col-config { padding: 8px; min-width: 230px; }
.col-config .cc-item {
  display: flex; align-items: center; gap: 9px;
  padding: 7px 9px; border-radius: var(--r-sm);
  font-size: var(--fs-sm); cursor: pointer;
}
.col-config .cc-item:hover { background: var(--bg); }
.col-config .cc-item input { width: 16px; height: 16px; accent-color: var(--brand); }

/* --------------------------------------------------------------------------
   11. EMPTY / LOADING STATES
   -------------------------------------------------------------------------- */
/* An empty table is the NORMAL state of a new account, and the portal was
   meeting it with a 62px filled blue disc — the loudest single shape on any
   screen, spent on the moment there is nothing to say. Calm, not apologetic:
   the glyph alone at the muted step, the sentence doing the work, and the
   action still obvious because it is the only button in the block. */
.empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: var(--s-8) var(--s-6);
  gap: var(--s-1);
}
.empty .empty-icon {
  display: flex; align-items: center; justify-content: center;
  width: auto; height: auto;
  border-radius: 0;
  background: none;
  color: var(--muted);
  font-size: 26px;   /* an ICON dimension, not a type step — it matches the svg beside it */
  line-height: 1;
  margin-bottom: var(--s-4);
}
.empty .empty-icon svg { width: 26px; height: 26px; stroke: currentColor; stroke-width: 1.4; }
.empty .empty-title { font-size: var(--fs-lead); font-weight: var(--fw-semi); color: var(--ink); }
.empty .empty-hint { font-size: var(--fs-sm); color: var(--muted-ink); max-width: 400px; line-height: 1.6; }
.empty .btn { margin-top: var(--s-5); }
.empty.compact { padding: var(--s-7) var(--s-5); }
.empty.compact .empty-icon { font-size: 21px; margin-bottom: var(--s-3); }
.empty.compact .empty-icon svg { width: 21px; height: 21px; }

.spinner {
  display: inline-block;
  width: 20px; height: 20px;
  border: 2.5px solid var(--line);   /* --brand-light was 1.2:1 on paper: only the arc showed */
  border-top-color: var(--brand);
  border-radius: 50%;
  animation: spin .7s linear infinite;
}
.spinner.lg { width: 34px; height: 34px; border-width: 3px; }
@keyframes spin { to { transform: rotate(360deg); } }

.loading-block {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 12px; padding: 60px 20px; color: var(--muted-ink); font-size: var(--fs-body);
}

.skeleton {
  background: linear-gradient(90deg, var(--line-2) 25%, var(--bg) 37%, var(--line-2) 63%);
  background-size: 400% 100%;
  animation: shimmer 1.3s ease-in-out infinite;
  border-radius: var(--r-sm);
  height: 14px;
}
@keyframes shimmer { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }

.boot {
  position: fixed; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 16px; background: var(--bg); z-index: 900;
}
.boot .logo-img { height: 30px; opacity: .9; }

/* --------------------------------------------------------------------------
   12. OVERLAY / SLIDEOVER / MODAL
   -------------------------------------------------------------------------- */
.overlay {
  position: fixed;
  inset: 0;
  background: rgba(10, 31, 51, .42);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  z-index: 400;
  opacity: 0;
  transition: opacity .22s ease;
}
.overlay.show { opacity: 1; }

.slideover {
  position: fixed;
  top: 0; right: 0; bottom: 0;
  z-index: 420;
  width: min(560px, 100vw);
  max-width: 100vw;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  box-shadow: var(--shadow-3);
  transform: translateX(100%);
  transition: transform .3s cubic-bezier(.32, .72, 0, 1);
  will-change: transform;
}
.slideover.open { transform: translateX(0); }

/* No gradient. A fade behind a panel title is texture standing in for
   hierarchy; the serif title and the rule under it already provide it. */
.slideover-head {
  flex: 0 0 auto;
  padding: var(--s-5) var(--s-5) var(--s-3);
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}
.slideover-head .so-top { display: flex; align-items: flex-start; gap: 10px; }
.slideover-head .so-title {
  font-family: var(--font-serif);
  font-size: var(--fs-heading); font-weight: var(--fw-bold); letter-spacing: -.015em;
  min-width: 0; flex: 1 1 auto;
}
.slideover-head .so-sub { font-size: var(--fs-sm); color: var(--muted-ink); margin-top: var(--s-1); }
.slideover-head .so-chips { display: flex; flex-wrap: wrap; gap: var(--s-2); margin-top: var(--s-3); }
.slideover-head .tabs { margin: 12px -20px -12px; padding: 0 20px; border-bottom: 0; }

.slideover-body {
  flex: 1 1 auto;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 20px;
}
.slideover-foot {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: var(--s-2);
  padding: var(--s-4) var(--s-5);
  border-top: 1px solid var(--line);
  background: var(--surface);
  padding-bottom: max(var(--s-4), env(safe-area-inset-bottom));
}
.slideover-foot .spacer { flex: 1 1 auto; }
.slideover.wide { width: min(820px, 100vw); }
.slideover.narrow { width: min(420px, 100vw); }

.modal-layer {
  position: fixed;
  inset: 0;
  z-index: 440;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  pointer-events: none;
}
.modal {
  position: relative;
  width: min(520px, 100%);
  max-height: calc(100vh - 48px);
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-3);
  pointer-events: auto;
  opacity: 0;
  transform: translateY(10px) scale(.97);
  transition: opacity .18s ease, transform .18s cubic-bezier(.32, .72, 0, 1);
}
.modal.open { opacity: 1; transform: none; }
.modal.wide { width: min(760px, 100%); }
.modal-head {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 18px 20px 12px;
}
.modal-head .modal-title { font-size: var(--fs-heading); font-weight: var(--fw-bold); font-family: var(--font-serif); letter-spacing: -.015em; flex: 1 1 auto; min-width: 0; }
.modal-body { padding: 0 var(--s-5) var(--s-5); overflow-y: auto; font-size: var(--fs-body); line-height: 1.6; color: var(--ink-2); }
.modal-foot {
  display: flex; align-items: center; gap: var(--s-2); justify-content: flex-end;
  padding: var(--s-4) var(--s-5);
  border-top: 1px solid var(--line-2);
  background: var(--surface);
  border-radius: 0 0 var(--r-lg) var(--r-lg);
  flex-wrap: wrap;
}
.modal-foot .spacer { flex: 1 1 auto; }

.close-x {
  flex: 0 0 auto;
  width: 34px; height: 34px;
  border: 0; background: transparent;
  border-radius: var(--r-sm);
  color: var(--muted-ink);
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 20px; line-height: 1;
}
.close-x:hover { background: var(--line-2); color: var(--ink); }
.close-x svg { width: 18px; height: 18px; stroke: currentColor; }

body.no-scroll { overflow: hidden; }

/* --------------------------------------------------------------------------
   13. TOASTS
   -------------------------------------------------------------------------- */
#toastRoot {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 800;
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: flex-end;
  pointer-events: none;
  max-width: min(400px, calc(100vw - 40px));
}
.toast {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  min-width: 240px;
  max-width: 100%;
  padding: 12px 14px;
  background: var(--white);
  border: 1px solid var(--line);
  border-left: 4px solid var(--brand);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-3);
  font-size: var(--fs-body);
  color: var(--ink);
  pointer-events: auto;
  animation: toastIn .26s cubic-bezier(.32, .72, 0, 1);
}
.toast.leaving { animation: toastOut .2s ease forwards; }
.toast .toast-icon {
  flex: 0 0 20px; width: 20px; height: 20px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 50%; font-size: var(--fs-xs); font-weight: var(--fw-bold); color: var(--white);
  background: var(--brand); margin-top: 1px;
}
.toast .toast-msg { flex: 1 1 auto; min-width: 0; overflow-wrap: anywhere; line-height: 1.45; }
.toast .toast-x { border: 0; background: transparent; color: var(--muted-ink); padding: 0 2px; font-size: 16px; line-height: 1; }
.toast .toast-x:hover { color: var(--ink); }
.toast-success { border-left-color: var(--ok); }
.toast-success .toast-icon { background: var(--ok-ink); }
.toast-error   { border-left-color: var(--danger); }
.toast-error   .toast-icon { background: var(--danger); }
.toast-warning { border-left-color: var(--warn); }
.toast-warning .toast-icon { background: var(--warn-ink); }
.toast-info    { border-left-color: var(--brand); }

@keyframes toastIn  { from { opacity: 0; transform: translateY(14px) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes toastOut { to { opacity: 0; transform: translateX(20px); } }

/* --------------------------------------------------------------------------
   14. AUTH SCREEN
   -------------------------------------------------------------------------- */
.auth-screen {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background:
    radial-gradient(900px 500px at 15% -10%, var(--brand-light) 0%, rgba(207, 227, 242, 0) 60%),
    radial-gradient(700px 500px at 100% 110%, var(--brand-tint) 0%, rgba(241, 247, 251, 0) 55%),
    var(--bg);
}
.auth-card {
  width: min(420px, 100%);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-2);
  padding: 34px 30px 28px;
}
.auth-card .auth-logo { display: block; height: 34px; margin: 0 auto 22px; }
.auth-card h1 { font-family: var(--font-serif); font-size: var(--fs-heading); text-align: center; }
.auth-card .auth-sub { text-align: center; color: var(--muted-ink); font-size: var(--fs-body); margin: 6px 0 22px; }
.auth-card .form-row { margin-bottom: 14px; }
.auth-card .btn-block { margin-top: 6px; }
.auth-links { display: flex; justify-content: center; margin-top: 16px; }
.auth-links button {
  border: 0; background: transparent; color: var(--brand-dark);
  font-size: var(--fs-sm); font-weight: var(--fw-semi); padding: 8px; min-height: 36px;
}
.auth-links button:hover { text-decoration: underline; }
.auth-msg {
  display: none;
  padding: 10px 12px;
  border-radius: var(--r-md);
  font-size: var(--fs-sm);
  margin-bottom: 14px;
  line-height: 1.45;
}
.auth-msg.show { display: block; }
.auth-msg.error   { background: var(--danger-bg); color: var(--danger-ink); border: 1px solid var(--danger-line); }
.auth-msg.success { background: var(--ok-bg); color: var(--ok-ink); border: 1px solid var(--ok-line); }
.auth-msg.info    { background: var(--brand-light); color: var(--brand-darker); border: 1px solid var(--info-line); }
.auth-foot { text-align: center; margin-top: 22px; font-size: var(--fs-xs); color: var(--muted-ink); }

/* blocked / no-account screen */
.notice-screen {
  min-height: 100vh; min-height: 100dvh;
  display: flex; align-items: center; justify-content: center; padding: 24px;
  background: var(--bg);
}
.notice-card {
  width: min(460px, 100%);
  background: var(--white); border: 1px solid var(--line); border-radius: var(--r-xl);
  box-shadow: var(--shadow-2); padding: 32px 28px; text-align: center;
}
/* The circle + glyph sizing lives on `.empty .empty-icon`, and the notice card
   is not an `.empty` — so this icon had no width at all and the lock rendered
   at the full width of the card. It was only ever seen on "No account", which
   nobody was meant to reach; admin-approved sign-in makes this screen the front
   door for every new tutor, so it has to look like the rest of the app.

   ⚠ `.empty .empty-icon` gave up its 62px filled blue disc in the same pass
   that de-bubbled the rest of the portal; this one kept it, which left the
   front door louder than every screen behind it. Same treatment: the glyph
   alone, at the muted step. */
.notice-card .empty-icon {
  display: flex; align-items: center; justify-content: center;
  width: auto; height: auto;
  border-radius: 0;
  background: none;
  color: var(--muted);
  margin: 0 auto var(--s-4);
}
.notice-card .empty-icon svg { width: 26px; height: 26px; stroke: currentColor; stroke-width: 1.4; }

/* --------------------------------------------------------------------------
   15. MISC COMPONENTS
   -------------------------------------------------------------------------- */
/* Callers append an action to a banner (UI.banner(...) then .appendChild(btn) —
   js/view-tutors.js "Link an account UID…" is one). Without wrapping, the text
   squeezed the button off the right-hand edge on a phone, which is where
   Jordan's tutors read this. The action drops to its own line instead. */
.banner {
  display: flex; align-items: flex-start; gap: 10px; flex-wrap: wrap;
  padding: 12px 14px;
  border-radius: var(--r-md);
  border: 1px solid var(--info-line);
  background: var(--brand-light);
  color: var(--brand-darker);
  font-size: var(--fs-sm);
  line-height: 1.5;
}
.banner.warn   { background: var(--warn-bg);   border-color: var(--warn-line);   color: var(--warn-ink); }
.banner.danger { background: var(--danger-bg); border-color: var(--danger-line); color: var(--danger-ink); }
.banner.ok     { background: var(--ok-bg);     border-color: var(--ok-line);     color: var(--ok-ink); }
.banner svg { width: 17px; height: 17px; flex: 0 0 17px; stroke: currentColor; margin-top: 1px; }
/* The message itself — the only child UI.banner() creates besides the icon. */
.banner > div { flex: 1 1 220px; min-width: 0; }

/* ATTENDANCE — the last of the filled bubbles, and the worst offender, because
   it was the only one that repeated. A month view drew FORTY-ONE 20px filled
   discs in four tints: the exact shape §8 gave up, on the one screen a tutor is
   in all day, so the calendar still spoke the old vocabulary after every list
   had stopped. Section 8's rule applies here unchanged — the glyph IS the mark
   (✓ ◕ ✕ ♻ ⊘ ?), so colour is already the second channel and a container is a
   third solution to a solved problem. The box stays 20px wide so the glyphs
   still form a column down a list; only the fill goes.
   Contrast on paper: ok-ink 6.12 · danger-ink 7.00 · brand-dark 6.59 ·
   muted-ink 5.83 — all well clear of 3:1 as bare marks. */
.attendance-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 20px; height: 20px; flex: 0 0 20px;
  font-size: var(--fs-xs); line-height: 1;
  background: none; color: var(--muted-ink);
  font-variant-emoji: text;
}
.attendance-icon.present   { color: var(--ok-ink); }
.attendance-icon.absent    { color: var(--danger-ink); }
.attendance-icon.cancelled { color: var(--muted-ink); }
.attendance-icon.makeup    { color: var(--brand-dark); }

/* calendar primitives (view-calendar.js builds on these) */
.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  border-left: 1px solid var(--line);
  border-top: 1px solid var(--line);
  background: var(--white);
  border-radius: var(--r-lg);
  overflow: hidden;
}
/* The same judgement the table head got: a pale-blue band across the one row
   that carries no information is colour spent on nothing. White, with the rule
   under it doing the separating — and the column headings of the calendar and
   of every table in the portal are now the same piece of typography. */
.cal-dow {
  padding: var(--s-2) var(--s-3);
  font-size: var(--fs-micro); font-weight: var(--fw-semi); letter-spacing: var(--tracking-caps); text-transform: uppercase;
  color: var(--muted-ink); background: var(--white);
  border-right: 1px solid var(--line); border-bottom: 1px solid var(--line);
  text-align: center;
}
.cal-cell {
  min-height: 118px;
  padding: 6px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: var(--white);
  cursor: pointer;
  transition: background .12s ease;
  display: flex; flex-direction: column; gap: 4px;
}
.cal-cell:hover { background: var(--bg); }
.cal-cell.other-month { background: var(--bg); }
.cal-cell.other-month .cal-daynum { color: var(--muted-ink); }
.cal-daynum {
  align-self: flex-start;
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 26px; height: 26px; padding: 0 7px;
  border-radius: var(--r-pill);
  font-size: var(--fs-sm); font-weight: var(--fw-semi); color: var(--ink-2);
}
.cal-cell.today .cal-daynum { background: var(--brand-light); color: var(--brand-darker); }
.cal-cell.selected .cal-daynum { background: var(--brand); color: var(--white); }
/* ⚠ WHITE CARD, COLOURED RAIL.
   Every lesson was a pale-blue slab, so an ordinary month was forty identical
   blue rectangles — wallpaper rather than information, and by a distance the
   loudest page in the portal. Worse, `js/view-calendar.js eventBlock()` already
   paints each block's left border with that TUTOR'S OWN calendar colour
   (`tutorColour()`), and a 3px rail against a blue fill is invisible: the one
   piece of real colour on the page was being drowned by decoration.

   White ground, one hairline, the tutor's colour on the rail. The grid breathes
   and the colour that is left means something — who is teaching what, readable
   at a glance, which is the whole job of a month view. `.hold` and
   `.nontutoring` keep their tints (declared later, in the view's own
   stylesheet), so a tint now marks the exception instead of the rule. */
.cal-event {
  border: 1px solid var(--line);
  background: var(--surface);
  border-left: 3px solid var(--brand);
  border-radius: var(--r-xs);
  padding: var(--s-1) 6px;
  font-size: var(--fs-xs);
  line-height: 1.35;
  cursor: pointer;
  overflow: hidden;
}
.cal-event:hover { background: var(--bg); border-color: var(--line-strong); }
.cal-event .ce-time { font-weight: var(--fw-semi); color: var(--ink-2); font-variant-numeric: tabular-nums; }
.cal-event .ce-name { font-weight: var(--fw-semi); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cal-event .ce-sub  { color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* line-through already says "cancelled"; .55 dropped the time to 3.0:1 as well */
.cal-event.cancelled { opacity: .7; text-decoration: line-through; }
.cal-more { font-size: var(--fs-micro); font-weight: var(--fw-semi); color: var(--brand-dark); padding: 1px 6px; }

/* mini calendar (date pickers) */
.minical { width: 268px; padding: 10px; }
.minical-head { display: flex; align-items: center; gap: 6px; margin-bottom: 8px; }
.minical-head .mc-label { flex: 1 1 auto; text-align: center; font-weight: var(--fw-semi); font-size: var(--fs-body); }
.minical-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.minical-grid .mc-dow { text-align: center; font-size: var(--fs-micro); font-weight: var(--fw-semi); color: var(--muted-ink); padding: 4px 0; }
.minical-grid button {
  height: 32px; border: 0; background: transparent; border-radius: var(--r-sm);
  font-size: var(--fs-sm); color: var(--ink-2);
}
.minical-grid button:hover { background: var(--bg); }
.minical-grid button.other { color: var(--muted-ink); }
.minical-grid button.today { box-shadow: inset 0 0 0 1.5px var(--brand-dark); font-weight: var(--fw-semi); }  /* --info-line was 1.8:1 */
.minical-grid button.selected { background: var(--brand); color: var(--white); font-weight: var(--fw-semi); }

/* --------------------------------------------------------------------------
   16. RESPONSIVE
   -------------------------------------------------------------------------- */
@media (max-width: 1180px) {
  .detail-layout { grid-template-columns: 280px minmax(0, 1fr); }
}

@media (max-width: 980px) {
  .detail-layout { grid-template-columns: minmax(0, 1fr); }
  .detail-aside { position: static; }
  .form-grid.cols-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 900px) {
  :root { --gutter: 16px; }

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

  .sidebar {
    position: fixed;
    top: 0; left: 0; bottom: 0;
    width: 282px;
    max-width: 86vw;
    transform: translateX(-100%);
    transition: transform .28s cubic-bezier(.32, .72, 0, 1);
    box-shadow: none;
    z-index: 460;
  }
  body.drawer-open .sidebar { transform: translateX(0); box-shadow: var(--shadow-3); }

  .drawer-backdrop {
    display: block;
    position: fixed; inset: 0;
    background: rgba(10, 31, 51, .45);
    z-index: 450;
    opacity: 0; pointer-events: none;
    transition: opacity .22s ease;
  }
  body.drawer-open .drawer-backdrop { opacity: 1; pointer-events: auto; }

  .hamburger { display: inline-flex; }

  .topbar-title { font-size: var(--fs-sm); }
  .user-chip .uc-meta { display: none; }
  .user-chip { padding: 4px; }

  .page-head h1 { font-size: var(--fs-heading); }
  .page-head .ph-actions { margin-left: 0; width: 100%; }

  .table-toolbar { padding: 10px; }
  .table-toolbar .tt-right { margin-left: 0; width: 100%; }
  .search-wrap { flex: 1 1 100%; min-width: 0; }

  .pagination { gap: 10px; justify-content: space-between; }
  .pagination .pg-group.pg-right { margin-left: 0; }
  .pagination .pg-goto { display: none; }

  .slideover, .slideover.wide, .slideover.narrow { width: 100vw; }
  .slideover-body { padding: 16px; }
  .modal-layer { padding: 12px; align-items: flex-end; }
  .modal { max-height: calc(100dvh - 24px); }

  #toastRoot { left: 12px; right: 12px; bottom: 12px; max-width: none; align-items: stretch; }
  .toast { min-width: 0; }

  .form-grid, .form-grid.cols-2, .form-grid.cols-3 { grid-template-columns: minmax(0, 1fr); }
  .form-grid .span-2 { grid-column: span 1; }

  .btn, .input, .select { min-height: var(--tap); }
  /* ⚠ `.btn-sm` is not a small button on a phone — it is Sort, Columns,
     Actions, Approve, Decline, Add Transaction and Invite a parent, i.e. most
     of what anyone presses on most screens. 36px was a desktop compromise that
     leaked onto touch; the contract says 44 and there is no second size. */
  .btn-sm { min-height: var(--tap); }
  .btn-icon { width: var(--tap); min-height: var(--tap); }
  /* Pagination never got the touch pass at all — 32px squares, and the only
     way to reach page 2 of a student list on a phone. */
  .pagination .pg-btn { min-width: var(--tap); height: var(--tap); }
  /* `.topbar-icon` is NOT here: it is declared later in this file, so a rule
     written at this point loses the cascade. See its own block below. */
  /* ⚠ Both of these beat the rules above on specificity and so stayed at their
     desktop size on a phone: the row ⋯ menu at 30px and the calendar's
     Month/Week/Day/List switch at 38px. They are the two controls a tutor
     actually presses on a phone, and the contract says 44px. */
  .btn-icon.btn-sm { width: var(--tap); min-height: var(--tap); }
  .btn-group > button { min-height: var(--tap); }
  /* The slide-over's close button was left at its desktop 34px here, which on
     a phone is the ONLY dismiss control besides the backdrop — and on the
     parent portal's invoice sheet it is the only control on the panel at all.
     44px, like every other touch target (contract). */
  .close-x { width: var(--tap); height: var(--tap); }

  .cal-cell { min-height: 84px; padding: 3px; }
  .cal-event { font-size: var(--fs-micro); padding: 3px 4px; }
  .stat .stat-value { font-size: var(--fs-heading); }
}

@media (max-width: 560px) {
  .stat-grid { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
  .card-body { padding: 14px; }
  .card-head { padding: 12px 14px; }
  .kv { grid-template-columns: minmax(0, 1fr); gap: 2px 0; }
  .kv dt { margin-top: 8px; }
  .page-head .ph-actions .btn { flex: 1 1 auto; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
}

/* --------------------------------------------------------------------------
   17. PRINT (invoices, calendars, reports)
   -------------------------------------------------------------------------- */
@media print {
  .sidebar, .topbar, .drawer-backdrop, #toastRoot, .table-toolbar, .pagination,
  .btn, .ph-actions, .close-x { display: none !important; }
  body { background: var(--white); }
  .app { grid-template-columns: minmax(0, 1fr); }
  .page { padding: 0; max-width: none; }
  .card, .table-card { box-shadow: none; border-color: var(--line); break-inside: avoid; }
  .table thead th { background: var(--line-2); color: var(--ink-2); }
  .print-only { display: block !important; }
  a { color: inherit; text-decoration: none; }
}
.print-only { display: none; }

/* ==========================================================================
   TUTORBIRD-MATCH LAYER
   Jordan asked for the interface to mirror TutorBird exactly, in LearnIt's
   own palette: paper + LearnIt blue over an ink-navy rail. This layer restyles the shared chrome and
   component classes, so every view picks it up without touching view code.
   Loaded last so it wins on equal specificity.
   ========================================================================== */

:root {
  --rail-w: 64px;
  --rail-bg: var(--navy);            /* ink navy — Jordan's dark ground */
  --rail-fg: var(--brand-soft);      /* light blue on navy      6.6:1   */
  --rail-fg-active: var(--white);
  --rail-active-bg: rgba(255, 255, 255, .16);
  --tb-line: var(--line);
  --tb-head: var(--brand-tint);
  --tb-title: var(--ink);
}

/* ---------- shell : narrow icon rail ---------- */
.app { grid-template-columns: var(--rail-w) minmax(0, 1fr); }

.sidebar {
  background: var(--rail-bg);
  border-right: 0;
  align-items: center;
  padding: 0;
  gap: 0;
}

.sidebar-brand {
  height: 56px;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border-bottom: 1px solid rgba(255,255,255,.14);
}
.brand-mark {
  display: inline-flex;
  align-items: baseline;
  text-decoration: none;
  font-family: var(--font-serif);
  font-size: var(--fs-heading);
  font-weight: var(--fw-bold);
  letter-spacing: -.5px;
  line-height: 1;
}
.brand-mark-l { color: var(--white); }
.brand-mark-i { color: var(--rail-fg); font-style: italic; }

.sidebar-nav {
  width: 100%;
  padding: 8px 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  overflow: visible;
}

.sidebar-item {
  position: relative;
  width: 44px;
  height: 44px;
  padding: 0;
  margin: 0;
  border-radius: var(--r-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--rail-fg);
  background: transparent;
  box-shadow: none;
  transition: background .15s ease, color .15s ease;
}
.sidebar-item svg { width: 21px; height: 21px; }
.sidebar-item .sidebar-label { display: none; }        /* icon rail — labels via tooltip */
.sidebar-item:hover { background: rgba(255,255,255,.10); color: var(--white); }
.sidebar-item.active {
  background: var(--rail-active-bg);
  color: var(--rail-fg-active);
}
.sidebar-item.active::before {
  content: "";
  position: absolute;
  left: -10px; top: 50%;
  transform: translateY(-50%);
  width: 3px; height: 26px;
  border-radius: 0 3px 3px 0;
  background: var(--white);
}
/* tooltip on hover */
.sidebar-item::after {
  content: attr(title);
  position: absolute;
  left: calc(100% + 10px);
  top: 50%;
  transform: translateY(-50%);
  background: var(--navy);
  color: var(--white);
  font-size: var(--fs-xs);
  font-weight: var(--fw-semi);
  white-space: nowrap;
  padding: 5px 9px;
  border-radius: var(--r-xs);
  opacity: 0;
  pointer-events: none;
  transition: opacity .12s ease;
  z-index: 200;
}
.sidebar-item:hover::after { opacity: 1; }

/* Waiting-for-approval count on the Tutors & Staff item (js/signin-requests.js
   paintNavCount). On desktop the sidebar is an icon RAIL — .sidebar-label is
   display:none up there — so a text count beside the label would be invisible;
   the number rides as a corner pip on the glyph instead, ringed in the rail's
   own navy so it reads against the icon. In the drawer (under 900px) the labels
   come back and it sits inline at the end of the row. .sidebar-item is
   position:relative in both layouts, which is what makes this work. */
.sidebar-item .nav-pip {
  position: absolute;
  top: 1px;
  right: 1px;
  min-width: 17px;
  height: 17px;
  padding: 0 4px;
  border-radius: var(--r-pill);
  background: var(--danger);
  color: var(--white);
  font-size: var(--fs-micro);
  font-weight: var(--fw-bold);
  line-height: 17px;
  text-align: center;
  box-shadow: 0 0 0 2px var(--navy);
  pointer-events: none;
}
@media (max-width: 900px) {
  .sidebar-item .nav-pip {
    position: static;
    margin-left: auto;
    box-shadow: none;
  }
}

.sidebar-foot { width: 100%; padding: 8px 0 12px; display: flex; justify-content: center; }
.sidebar-foot .su-meta { display: none; }
.sidebar-user { padding: 0; background: transparent; box-shadow: none; border: 0; }

/* ---------- topbar ---------- */
.topbar {
  height: 56px;
  background: var(--white);
  border-bottom: 1px solid var(--tb-line);
  padding: 0 20px;
  gap: 12px;
  box-shadow: none;
}
/* ⚠ THE SAME WORD, TWICE, ON EVERY PAGE.
   The sticky bar and the page head both carried the section name, both in
   22–26px Playfair, forty pixels apart. Two identical serif headings stacked
   do not read as "bar + title" — they read as a bug, and on a phone the top
   one truncated to "Dashbo…" while the real one sat whole underneath it.

   The bar is wayfinding, not a heading. Setting it small, sans and muted makes
   the relationship legible at a glance — where you are, then what this is —
   and leaves exactly one display-weight line per screen. */
.topbar-title {
  font-family: var(--font-sans);
  font-size: var(--fs-sm);
  font-weight: var(--fw-semi);
  color: var(--muted-ink);
  letter-spacing: var(--tracking-caps);
  text-transform: uppercase;
}
.topbar-actions { display: flex; align-items: center; gap: 6px; margin-left: auto; }
.topbar-icon {
  width: 36px; height: 36px;
  display: inline-flex; align-items: center; justify-content: center;
  border: 0; background: transparent; border-radius: 50%;
  color: var(--muted-ink); cursor: pointer;
  transition: background .15s ease, color .15s ease;
}
.topbar-icon svg { width: 19px; height: 19px; }
.topbar-icon:hover { background: var(--bg); color: var(--ink); }
/* ⚠ This rule lives HERE, immediately after the base, and not up in the 900px
   responsive layer with the other touch fixes — because `.topbar-icon` is
   declared at this point in the file, which is LATER in source than that layer,
   so an identical-specificity override written there is silently dead. Exactly
   the cascade trap `.detail-layout` fell into. Notifications, help and sign-out
   are the three controls in reach of a thumb on every single screen. */
@media (hover: none) {
  .topbar-icon { width: var(--tap); height: var(--tap); }
}

.user-chip {
  display: inline-flex; align-items: center; gap: 9px;
  padding: 4px 12px 4px 4px;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-pill);
  background: var(--white);
}
.user-chip .uc-name { font-size: var(--fs-body); font-weight: var(--fw-semi); color: var(--tb-title); }
.user-chip .uc-role { font-size: var(--fs-xs); color: var(--muted-ink); }

/* ---------- page canvas ---------- */
.page { padding: 20px 24px 40px; max-width: none; background: var(--bg); }

/* ---------- tab bar ----------
   Tabs were a white card with its own border and a 10px radius, sitting on a
   white page above another white card — a box drawn around something that was
   never leaving the page. One rule and the selected underline carry it; the
   container was the third solution to a problem the first two had solved. */
.tabs {
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  padding: 0;
  gap: var(--s-1);
  margin-bottom: var(--s-6);
  overflow-x: auto;
}
.tab {
  border: 0;
  background: transparent;
  border-radius: 0;
  padding: var(--s-3) var(--s-3);
  font-size: var(--fs-body);
  font-weight: var(--fw-medium);
  color: var(--muted-ink);
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  white-space: nowrap;
}
.tab:hover { color: var(--ink); background: transparent; }
.tab.active {
  color: var(--ink);
  font-weight: var(--fw-semi);
  border-bottom-color: var(--brand);
  background: transparent;
}
/* §9 also draws an ::after bar under the active tab. Two indicators for one
   state, at two different insets, is what made the underline look smudged. */
.tab.active::after { display: none; }

/* ⚠ `.tabs-pill` (§9) is the segmented switch — the note audience toggle on a
   lesson, Student|Parent|Private. It is ALSO a `.tabs`, same specificity, and
   this layer is declared later, so every property it set was being overwritten
   and the switch has been rendering as a full-width underline bar. Restated
   here, after the override, so the segmented control is a segmented control
   again. */
.tabs-pill {
  display: inline-flex;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 3px;
  gap: 2px;
  margin-bottom: var(--s-4);
}
.tabs-pill .tab {
  border: 0;
  margin-bottom: 0;
  border-radius: var(--r-sm);
  padding: var(--s-2) var(--s-4);
  min-height: 34px;
}
.tabs-pill .tab.active {
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--shadow-1);
}

/* ---------- tables ----------
   The table is the densest surface in the portal and the one that most looked
   like a bought template. Four things were doing it:

     1. a pale-blue band across every column heading on every page — colour
        spent on the one row that carries no information;
     2. headings set at 12.5px/700, nearly the weight and size of the data
        beneath them, so the head read as a first row rather than as a label;
     3. a blue wash on row hover, which spent the accent on a mouse position;
     4. 14px of padding all round, which is a square — rows need more air
        vertically than horizontally or they read as a grid of boxes.

   The replacement is restraint: a white head, one real rule under it, the
   labels dropped to the micro step in muted ink with the uppercase tracking,
   rows breathing at 16px/18px, and the hover a neutral paper tint so that
   blue still belongs to the primary action alone.                          */
.table-card, .card {
  border: 1px solid var(--tb-line);
  border-radius: var(--r-md);
  box-shadow: none;
}
.table-toolbar {
  padding: var(--s-3) var(--s-4);
  border-bottom: 1px solid var(--line-2);
  gap: var(--s-2);
  background: var(--white);
}
.table thead th {
  background: var(--white);
  color: var(--muted-ink);
  font-size: var(--fs-micro);
  font-weight: var(--fw-semi);
  letter-spacing: var(--tracking-caps);
  border-bottom: 1px solid var(--line);
  padding: var(--s-3) var(--s-4);
  white-space: nowrap;
}
.table thead th.sortable:hover { color: var(--ink-2); background: var(--bg); }
.table thead th.sorted { color: var(--ink-2); }
.table tbody td {
  padding: var(--s-4);
  border-bottom: 1px solid var(--line-2);
  font-size: var(--fs-body);
  line-height: 1.45;
  color: var(--ink);
}
/* ⚠ §10 tints the CELLS (`tr:hover td`, `tr.selected td`). Moving both to the
   row and clearing the cell keeps one source of truth for a row's ground —
   otherwise hovering a selected row fought with its own selection colour. */
.table tbody tr:hover { background: var(--bg); }
.table tbody tr.selected, .table tbody tr.selected:hover { background: var(--brand-tint); }
.table tbody tr:hover td, .table tbody tr.selected td { background: transparent; }
/* Every row stands the same height until its own content says otherwise. On a
   table row `height` behaves as a minimum, which is exactly what is wanted:
   a steady rhythm that a wrapped cell can still push open. */
.table tbody tr { height: 60px; }
.table.dense tbody tr { height: 44px; }

/* ---- free text in a cell ----
   A note is prose, and prose in an 87px column wrapped a staff row to 191px
   while its neighbours sat at 74px — one tutor's paragraph setting the rhythm
   of the whole table. Two lines, then the full text on hover and on the record
   itself. A column is a glance; the page behind it is the read. */
.table td .cell-clamp {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  white-space: normal;
  overflow-wrap: anywhere;
  /* ⚠ A `width` on the <th> is only a PREFERENCE under `table-layout: auto`.
     Every other column here is `white-space: nowrap`, so when eleven columns
     ask for more than the viewport, prose is the only thing that can give —
     and the Notes column collapsed to about forty pixels, breaking words
     mid-syllable ("Excellen / t with…"). A real min-width is a floor the table
     algorithm has to honour; past that the wrapper scrolls, which is the
     correct answer for an eleven-column table. */
  min-width: 180px;
}
/* a date must never wrap mid-value, and figures line up only when tabular */
.table td.cell-date, .table th.cell-date { white-space: nowrap; font-variant-numeric: tabular-nums; }

.pagination {
  padding: var(--s-3) var(--s-4);
  border-top: 1px solid var(--line-2);
  font-size: var(--fs-sm);
  color: var(--muted-ink);
  gap: var(--s-4);
  flex-wrap: wrap;
}
/* ---- one page of results ----
   A page-size selector, a first/prev/1/next/last rig and a "Go to page 1 of 1
   page" under a two-row table is a control panel for a machine that has
   nothing to do. When everything fits, the only true statement is the count —
   so that is all that is said, and the pager stops being furniture. */
.pagination.is-single .pg-group:not(.pg-count) { display: none; }
.pagination.is-single { justify-content: flex-start; }
.pagination .page-btn {
  min-width: 30px; height: 30px;
  border-radius: var(--r-sm);
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted-ink);
}
.pagination .page-btn.active {
  background: var(--brand-light);
  color: var(--brand-darker);
  border-color: var(--brand-light-2);
  font-weight: var(--fw-semi);
}

/* ---------- buttons ---------- */
.btn {
  border-radius: var(--r-sm);
  font-weight: var(--fw-semi);
  font-size: var(--fs-body);
  padding: 9px 15px;
  box-shadow: none;
}
/* ⚠ `.btn` above re-declares padding AFTER `.btn-icon { padding: 0 }` in the
   design system, and both are one class — later won, so every icon-only button
   in the app collapsed its content box to 0–4px and `img,svg{max-width:100%}`
   then clamped the glyph to nothing. Edit/Delete/⋯/calendar-nav all rendered as
   empty boxes. Restore it here, after the override that broke it. */
.btn-icon { padding: 0; }
.btn-icon[disabled], .btn-icon.disabled { background: transparent; border-color: transparent; }

.btn-primary { background: var(--brand); border: 1px solid var(--brand); color: var(--white); }
.btn-primary:hover { background: var(--brand-dark); border-color: var(--brand-dark); }
.btn-ghost {
  background: var(--white);
  border: 1px solid var(--line-strong);
  color: var(--ink-2);
}
.btn-ghost:hover { background: var(--bg); border-color: var(--muted-ink); color: var(--ink); }

/* ---------- slide-over : TutorBird right panel ---------- */
.slideover {
  border-radius: 0;
  box-shadow: -8px 0 32px rgba(10, 31, 51, .16);
}
.slideover-head {
  padding: 18px 22px;
  border-bottom: 1px solid var(--tb-line);
}
.slideover-head h2, .slideover-title {
  font-family: var(--font-serif);
  font-size: var(--fs-heading);
  font-weight: var(--fw-bold);
  color: var(--tb-title);
}
.slideover-foot, .slideover-footer {
  border-top: 1px solid var(--tb-line);
  padding: 14px 22px;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  background: var(--white);
}

/* ---------- detail pages : left card + right tabs ---------- */
.detail-layout { grid-template-columns: 320px minmax(0, 1fr); gap: var(--s-5); }

/* ⚠ CASCADE — the collapse for this grid is declared up at §4 (`@media
   (max-width: 1180px)` → 280px, `@media (max-width: 980px)` → one column).
   Both sit ABOVE this layer in the file, so the unconditional line directly
   above beat them at EVERY width and the 320px aside stayed 320px on a 390px
   phone: the student and family records had a squeezed sidebar and a 60px main
   column, with no horizontal scroll to rescue them. Restated here, after the
   rule that overrode them, so the detail pages stack again. Anything added
   later that sets `.detail-layout` columns has to come before these two. */
@media (max-width: 1180px) {
  .detail-layout { grid-template-columns: 280px minmax(0, 1fr); }
}
@media (max-width: 980px) {
  .detail-layout { grid-template-columns: minmax(0, 1fr); }
  .detail-aside { position: static; }
  /* Once the two columns stack, source order decides what is read first — and
     on most detail pages that is right, because the aside IS the headline (the
     student's profile card carries the name, the status and the household).
     The FAMILY record is the exception: its headline is the Household card in
     the main column, so on a phone the aside's reference material would sit on
     top of it. `.detail-main-first` flips those two, and nothing else. */
  .detail-main-first .detail-main  { order: 1; }
  .detail-main-first .detail-aside { order: 2; }
}

/* ---------- mobile : rail becomes a drawer ---------- */
@media (max-width: 900px) {
  .app { grid-template-columns: minmax(0, 1fr); }
  /* ⚠ do NOT clamp .sidebar to --rail-w here. The rail is an icon strip only on
     desktop, where the hover tooltip supplies the name. Under 900px it becomes
     the slide-out drawer (282px, §16) and the tooltip is switched off below —
     clamping it to 64px shipped tutors a column of 11 unlabelled glyphs with no
     text and no tooltip. Jordan's tutors run this on a phone. */
  .sidebar { align-items: stretch; padding: 0 10px 14px; }
  .sidebar-item { justify-content: flex-start; width: auto; padding: 10px 12px; gap: 12px; }
  .sidebar-item .sidebar-label { display: block; }   /* labels come back in the drawer */
  .sidebar-item::after { display: none; }            /* tooltip off — the label is right there */
  .topbar { padding: 0 12px; }
  .page { padding: 14px 12px 32px; }
}

/* ---------- SETTINGS : the classes the page was already asking for ----------
   js/view-settings.js builds eight panels out of `.settings-grid`,
   `.card-title` and `.form-row-full`. NONE of those three existed in this
   file, so the page rendered as:

     • `.card` with `padding: 0` — every panel's heading, fields and Save
       button pressed flat against the 1px border, because padding in this
       system lives on `.card-body` and these cards have none;
     • a bare `<h2>` at 18px with no margin — larger than any other card title
       in the portal and touching the field under it;
     • a 1326px-wide "invoice footer note" textarea, because `.form-row-full`
       was never told to span the grid and nothing capped the measure.

   It is the one screen that still looked unfinished, and it looked unfinished
   because a quarter of its vocabulary was missing. Defining it here rather
   than in the view keeps the rule in the design system (file header), and
   gives the Settings panels the same padding, title and rhythm as every other
   card in the app. */
.settings-grid { display: flex; flex-direction: column; gap: var(--s-4); }
.settings-grid > .card { padding: var(--s-5); }
.settings-grid > .card + .card { margin-top: 0; }
.settings-grid > .card > .card-title {
  font-family: var(--font-serif);
  font-size: var(--fs-title);
  font-weight: var(--fw-bold);
  letter-spacing: -.01em;
  margin: 0 0 var(--s-5);
}
/* a field that wants the whole row — the address, the footer note */
.settings-grid .form-row-full { grid-column: 1 / -1; }
/* ⚠ a settings panel is as wide as the page, and a single-line input or a note
   stretched to 1300px has no readable measure. Forms get a sane one; the cards
   themselves stay full width so the page does not look half-built.

   ⚠ Four fields on one row only sit on one baseline if their LABELS are one
   line each. "Default lesson rate (what families are charged)" wrapped to two
   and dropped its own input half a row below its three neighbours, which is the
   kind of thing that reads as nobody having looked at the page. Fixed at the
   source — the label is now a label and the clarification is a hint under the
   field (js/view-settings.js) — rather than by bottom-aligning the cells, which
   would only have moved the problem onto any field that carries a hint. */
.settings-grid .form-grid { max-width: 1080px; }
.settings-grid .form-row-full > .input,
.settings-grid .form-row-full > .textarea { max-width: 720px; }
/* `.card-actions` is defined in `.card-head` as a flex end-cap; used here as a
   plain block it needs its own separation from the fields above it. */
.settings-grid > .card > .card-actions {
  display: flex;
  align-items: center;
  gap: var(--s-2);
  flex-wrap: wrap;
  margin-top: var(--s-5);
  padding-top: var(--s-5);
  border-top: 1px solid var(--line-2);
}

/* ---------- demo-mode switcher (only present with ?demo=1) ---------- */
.demo-switch {
  position: fixed;
  right: 18px; bottom: 18px;
  z-index: 900;
  display: flex; align-items: center; gap: 10px;
  background: var(--white);
  border: 1px solid var(--tb-line);
  box-shadow: 0 8px 28px rgba(10, 31, 51, .18);
  border-radius: var(--r-pill);
  padding: 8px 16px 8px 12px;
  font-size: var(--fs-sm);
}
.demo-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); }
.demo-label { font-weight: var(--fw-bold); color: var(--tb-title); letter-spacing: .02em; }
.demo-sel { display: flex; align-items: center; gap: 7px; color: var(--muted-ink); }
.demo-sel select {
  border: 1px solid var(--line-strong); border-radius: var(--r-sm);
  padding: 5px 8px; font-size: var(--fs-sm); font-weight: var(--fw-semi);
  color: var(--tb-title); background: var(--white); cursor: pointer;
}
.demo-hint { font-weight: var(--fw-semi); }
.demo-hint.is-admin { color: var(--brand); }
.demo-hint.is-tutor { color: var(--warn-ink); }
@media (max-width: 700px) {
  .demo-switch { left: 12px; right: 12px; bottom: 12px; justify-content: center; flex-wrap: wrap; }
  .demo-hint { width: 100%; text-align: center; }
}

/* ---------- Google sign-in + divider ---------- */
.btn-google {
  background: var(--white);
  color: var(--ink);
  border: 1px solid var(--line-strong);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-weight: var(--fw-semi);
}
.btn-google:hover { background: var(--bg); border-color: var(--muted-ink); }  /* --muted made the edge fainter on hover */
.btn-google:disabled { opacity: .65; cursor: default; }

.auth-or {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 18px 0 14px;
  color: var(--muted-ink);
  font-size: var(--fs-xs);
}
.auth-or::before, .auth-or::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--tb-line);
}

/* password strength meter */
.pw-meter { margin-top: 8px; }
.pw-bar { height: 5px; border-radius: var(--r-pill); background: var(--line-2); overflow: hidden; }
.pw-bar i { display: block; height: 100%; width: 0; border-radius: var(--r-pill); transition: width .2s ease, background .2s ease; }
.pw-note { font-size: var(--fs-xs); margin-top: 5px; color: var(--muted-ink); }
.pw-weak   i { width: 33%; background: var(--danger); }
.pw-ok     i { width: 66%; background: var(--warn-ink); }   /* gold on the track was 1.7:1 */
.pw-strong i { width: 100%; background: var(--ok); }
.pw-weak   .pw-note { color: var(--danger); }
.pw-strong .pw-note { color: var(--ok-ink); }

/* ---------- address autocomplete ---------- */
.addr-field { position: relative; }
.addr-manual {
  align-self: flex-start;
  margin-top: 6px;
  background: none;
  border: 0;
  padding: 0;
  color: var(--brand);
  font-size: var(--fs-sm);
  font-weight: var(--fw-semi);
  cursor: pointer;
}
.addr-manual:hover { text-decoration: underline; }

/* In-flow (not absolute) so a scrolling modal can never clip it. */
.addr-panel {
  margin-top: 6px;
  border: 1px solid var(--tb-line);
  border-radius: var(--r-md);
  background: var(--white);
  box-shadow: 0 8px 24px rgba(10, 31, 51, .12);
  max-height: 260px;
  overflow-y: auto;
  overscroll-behavior: contain;
}
.addr-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
  width: 100%;
  text-align: left;
  background: none;
  border: 0;
  border-bottom: 1px solid var(--line-2);
  padding: 10px 12px;
  cursor: pointer;
  min-height: 44px;
}
.addr-item:last-child { border-bottom: 0; }
.addr-item:hover, .addr-item.active { background: var(--bg); }
.addr-line1 { font-size: var(--fs-body); font-weight: var(--fw-semi); color: var(--ink); }
.addr-sub   { font-size: var(--fs-xs); color: var(--muted-ink); }
.addr-msg   { padding: 11px 12px; font-size: var(--fs-sm); color: var(--muted-ink); }

.addr-manual-fields { margin-top: 8px; }
.addr-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.addr-grid .input:first-child { grid-column: 1 / -1; }
.addr-grid .addr-sm { grid-column: auto; }
@media (max-width: 560px) {
  .addr-grid { grid-template-columns: 1fr; }
  .addr-grid .input:first-child { grid-column: auto; }
}

/* ---------- subject picker (fixed catalogue, scrollable) ---------- */
.subject-picker .subj-summary {
  display: flex; flex-wrap: wrap; gap: 6px; align-items: center;
  min-height: 30px; margin-bottom: 8px;
}
.subject-picker .chip-x {
  background: none; border: 0; cursor: pointer; margin-left: 6px;
  color: inherit; font-size: 14px; line-height: 1; padding: 0;
}
.subj-search { margin-bottom: 8px; }
.subj-list {
  max-height: 260px; overflow-y: auto; overscroll-behavior: contain;
  border: 1px solid var(--tb-line); border-radius: var(--r-md); background: var(--white);
}
.subj-group { border-bottom: 1px solid var(--line-2); }
.subj-group:last-child { border-bottom: 0; }
.subj-group-label {
  position: sticky; top: 0; z-index: 1;
  background: var(--tb-head);
  padding: 7px 12px; font-size: var(--fs-micro); font-weight: var(--fw-semi);
  letter-spacing: var(--tracking-caps); text-transform: uppercase; color: var(--muted-ink);
}
.subj-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px; cursor: pointer; min-height: 40px; font-size: var(--fs-body);
}
.subj-item:hover { background: var(--bg); }
.subj-item input { width: 17px; height: 17px; accent-color: var(--brand); }

/* ---------- family picker ---------- */
.fam-chosen {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  margin-top: 8px; padding: 10px 12px;
  background: var(--brand-tint);
  border: 1px solid var(--tb-line); border-radius: var(--r-md);
}
.fam-chosen-name { font-weight: var(--fw-semi); color: var(--ink); }
.fam-chosen .btn { margin-left: auto; }
.fam-list {
  margin-top: 8px; max-height: 240px; overflow-y: auto; overscroll-behavior: contain;
  border: 1px solid var(--tb-line); border-radius: var(--r-md); background: var(--white);
}
.fam-item {
  display: flex; flex-direction: column; gap: 2px; width: 100%; text-align: left;
  background: none; border: 0; border-bottom: 1px solid var(--line-2);
  padding: 10px 12px; cursor: pointer; min-height: 44px;
}
.fam-item:last-child { border-bottom: 0; }
.fam-item:hover { background: var(--bg); }
.fam-name { font-size: var(--fs-body); font-weight: var(--fw-semi); color: var(--ink); }
.fam-sub  { font-size: var(--fs-xs); color: var(--muted-ink); }
.fam-msg  { padding: 12px; font-size: var(--fs-sm); color: var(--muted-ink); }

/* ---------- My Pay export buttons ----------------------------------------
   ⚠ These were a green Excel button and a purple Mail button beside the blue
   primary and a white ghost: FOUR filled hues in one row, two of them
   (--ok-ink, --purple) used as a button nowhere else in the portal, copied
   across from the v1 portal's chrome. Four equally loud buttons are not four
   emphases, they are none — and a palette that appears on exactly one screen
   is what makes an app look assembled rather than designed.

   They are four ALTERNATIVES: pick a format. So one is promoted (PDF, already
   the primary) and the rest are ordinary buttons. The icons still tell them
   apart, which is what icons are for.
   `.btn-excel` / `.btn-mail` are RETIRED — grep confirms no other file names
   them, and the two call sites in js/view-mypay.js now ask for `.btn`. */
.mp-picker-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.mp-picker-actions .btn { flex: 1 1 auto; min-width: 140px; justify-content: center; }
@media (max-width: 560px) {
  .mp-picker-actions .btn { flex: 1 1 100%; }
}

/* ==========================================================================
   MY SCHEDULE — phone-calendar export (js/view-schedule.js)
   Mobile first: assume a 375px-wide phone held in one hand. Every control is
   at least the 44px tap target, and the primary action is deliberately the
   largest thing on the page.
   ========================================================================== */

.sched { display: flex; flex-direction: column; gap: var(--s-4); }

/* ---------- the explainer ---------- */
.sched-why-title { font-family: var(--font-serif); font-size: var(--fs-title); font-weight: var(--fw-bold); color: var(--ink); margin-bottom: 6px; }
.sched-why-lead  { font-size: var(--fs-body); color: var(--ink-2); line-height: 1.55; margin-bottom: 12px; }
.sched-why-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: var(--s-2);
}
.sched-why-list li {
  position: relative;
  padding-left: 26px;
  font-size: var(--fs-sm);
  color: var(--ink-2);
  line-height: 1.5;
}
.sched-why-list li::before {
  content: "";
  position: absolute;
  left: 0; top: 3px;
  width: 17px; height: 17px;
  border-radius: 50%;
  background: var(--ok-bg) url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23146B4A' stroke-width='3.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'/%3E%3C/svg%3E") center / 11px no-repeat;
}
.sched-why-list strong { color: var(--ink); font-weight: var(--fw-semi); }

/* ---------- the controls ---------- */
.sched-field { margin-bottom: var(--s-5); }
.sched-field > .label { font-size: var(--fs-sm); font-weight: var(--fw-medium); margin-bottom: 9px; }
.sched-picker { margin-bottom: var(--s-5); }

/* the range options reuse .choice-card; just make them breathe on a phone */
.sched-field .radio-group .choice-card:last-child { margin-bottom: 0; }

/* alert timing — full width, three equal targets */
.sched-alarm { display: flex; width: 100%; }
.sched-alarm > button { flex: 1 1 0; min-height: var(--tap); font-size: var(--fs-body); }

.sched-notes-toggle { margin-bottom: 4px; }

/* ---------- the action block ---------- */
.sched-action {
  margin-top: var(--s-5);
  padding-top: var(--s-5);
  border-top: 1px solid var(--line);
}
.sched-summary {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 10px;
  margin-bottom: 12px;
}
.sched-summary strong {
  font-size: var(--fs-heading);
  font-weight: var(--fw-bold);
  color: var(--ink);
  letter-spacing: -.01em;
}
.sched-summary span {
  font-size: var(--fs-sm);
  color: var(--muted-ink);
  font-variant-numeric: tabular-nums;
}
.sched-summary.is-empty strong { color: var(--ink-2); font-size: var(--fs-lead); }

/* the one thing on the page you cannot miss — carried by size and by being the
   only filled control in view, not by a coloured glow underneath it */
.sched-go {
  min-height: 54px;
  font-size: var(--fs-lead);
  font-weight: var(--fw-semi);
  gap: var(--s-2);
  box-shadow: none;
}
.sched-go svg { width: 20px; height: 20px; flex: 0 0 20px; }
.sched-share { margin-top: 8px; min-height: var(--tap); justify-content: center; }

.sched-note {
  margin: 14px 0 0;
  font-size: var(--fs-sm);
  line-height: 1.6;
  color: var(--ink-2);
  background: var(--warn-bg);
  border: 1px solid var(--warn-line);
  border-radius: var(--r-md);
  padding: 11px 13px;
}
.sched-note strong { color: var(--warn-ink); }
.sched-note-soon { display: block; margin-top: 6px; color: var(--muted-ink); }

/* ---------- platform instructions ---------- */
.sched-help-wrap { display: flex; flex-direction: column; gap: 10px; }
.sched-help {
  background: var(--surface);
  border: 1px solid var(--tb-line);
  border-radius: var(--r-md);
}
.sched-help > summary {
  list-style: none;
  cursor: pointer;
  padding: var(--s-3) var(--s-4);
  min-height: var(--tap);
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: var(--fs-body);
  font-weight: var(--fw-semi);
  color: var(--brand-dark);
}
.sched-help > summary::-webkit-details-marker { display: none; }
.sched-help > summary::after {
  content: "";
  margin-left: auto;
  width: 9px; height: 9px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg) translate(-2px, -2px);
  transition: transform .16s ease;
}
.sched-help[open] > summary::after { transform: rotate(-135deg) translate(-2px, -2px); }
.sched-help[open] > summary { border-bottom: 1px solid var(--line-2); }

.sched-steps {
  list-style: none;
  margin: 0;
  padding: var(--s-4) var(--s-4) var(--s-1);
  display: flex;
  flex-direction: column;
  gap: var(--s-3);
  counter-reset: none;
}
.sched-steps li {
  display: flex;
  gap: var(--s-3);
  font-size: var(--fs-sm);
  line-height: 1.55;
  color: var(--ink-2);
}
/* A step number is a list marker, not a state. Filled pale-blue discs put eight
   coloured dots down a page of instructions, which spends the accent on
   counting. A hairline ring at the muted step counts just as well. */
.sched-steps .sched-step-n {
  flex: 0 0 22px;
  width: 22px; height: 22px;
  border-radius: 50%;
  background: none;
  border: 1px solid var(--line);
  color: var(--muted-ink);
  font-size: var(--fs-xs);
  font-weight: var(--fw-semi);
  font-variant-numeric: tabular-nums;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: 1px;
}
.sched-steps strong { color: var(--ink); font-weight: var(--fw-semi); }
.sched-help-foot {
  margin: 0;
  padding: var(--s-2) var(--s-4) var(--s-4);
  font-size: var(--fs-sm);
  color: var(--muted-ink);
  line-height: 1.55;
}
/* nested "other devices" blocks sit inside a parent details */
.sched-help-other .sched-help { margin: 0 10px 10px; background: var(--brand-tint); }
.sched-help-other .sched-help:first-of-type { margin-top: 10px; }

/* ---------- preview list ---------- */
.sched-list { list-style: none; margin: 0; padding: 0; }
.sched-row {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr) auto;
  align-items: center;
  gap: var(--s-3);
  padding: var(--s-3) var(--s-5);
  border-bottom: 1px solid var(--line-2);
  min-height: 56px;
}
.sched-row:last-child { border-bottom: 0; }
.sched-when { line-height: 1.3; font-variant-numeric: tabular-nums; }
.sched-day {
  display: block;
  font-size: var(--fs-xs);
  font-weight: var(--fw-semi);
  color: var(--ink);
}
.sched-day:empty { display: none; }
.sched-time { display: block; font-size: var(--fs-xs); color: var(--muted-ink); }
.sched-who { min-width: 0; }
.sched-name {
  display: block;
  font-weight: var(--fw-semi);
  font-size: var(--fs-sm);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.sched-meta {
  display: block;
  font-size: var(--fs-xs);
  color: var(--muted-ink);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.sched-flag { flex: 0 0 auto; }

@media (max-width: 560px) {
  .sched { gap: 12px; }
  .sched-action { margin-top: 16px; padding-top: 16px; }
  .sched-go { min-height: 56px; }
  .sched-row { grid-template-columns: 84px minmax(0, 1fr) auto; gap: 10px; padding: 11px 14px; }
  .sched-steps { padding: 12px 14px 4px; }
  .sched-help > summary { padding: 13px 14px; }
  .sched-help-foot { padding: 10px 14px 14px; }
}

/* ==========================================================================
   MY FAMILY — the parent's page (js/view-parent.js)
   Mobile first: designed at 375px, one column, cards not tables. A table of
   lesson summaries is unreadable on a phone, and the phone is the primary
   target here — most parents will only ever open this on one.
   ========================================================================== */

.pv { display: flex; flex-direction: column; gap: var(--s-4); }

/* On a wide screen the cards would otherwise stretch to a 1400px measure and
   a lesson summary becomes unreadable. Phone-first, but desktop must work.
   ⚠ `margin-inline: auto` — capped at 760px and left-aligned, the page sat in
   the top-left corner of a 1440px screen with half a metre of empty paper to
   its right, which reads as a layout that was never finished rather than as a
   deliberate measure. Centred, the same measure reads as a document. */
@media (min-width: 900px) { .pv { max-width: 760px; margin-inline: auto; } }

/* ---------- child switcher ---------- */
/* Scrolls sideways rather than wrapping: three children at 375px would
   otherwise push the page into a second row of controls before any content. */
.pv-seg {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 2px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.pv-seg::-webkit-scrollbar { display: none; }
.pv-seg-btn {
  flex: 0 0 auto;
  min-height: var(--tap);
  padding: 0 16px;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-pill);
  background: var(--surface);
  color: var(--ink-2);
  font-size: var(--fs-body);
  font-weight: var(--fw-semi);
  white-space: nowrap;
}
.pv-seg-btn:hover { background: var(--brand-tint); }
/* The selected child. Everywhere else in the portal a chosen segment is carried
   by weight and ink (`.btn-group > button.active`, `.tabs-pill .tab.active`);
   this one was a filled blue slab with a coloured shadow under it, which made
   the filter louder than the lessons it filters. Same answer as the rest of the
   app: a brand edge, brand ink, and the only semibold label in the row. */
.pv-seg-btn.active {
  background: var(--brand-tint);             /* the faintest wash in the set  */
  border-color: var(--brand);
  color: var(--brand-darker);                /* 9.7:1 on the tint             */
  font-weight: var(--fw-semi);
  box-shadow: none;
}

/* ---------- next lesson ----------
   A tint AND a coloured border AND the card's own hairline were three solutions
   to one problem. The border alone says "this one is different". */
/* `--brand-mid`, not `--brand-soft`: measured, the soft step is 2.53:1 on white
   and the border is now the only shape marking this card out, so it owes the
   3:1 a UI boundary owes (WCAG 1.4.11). --brand-mid is 3.63:1 and still reads
   as a soft blue edge rather than as a frame. */
.pv-next-card { border-color: var(--brand-mid); background: var(--surface); }
.pv-next { display: flex; flex-direction: column; gap: 3px; }
.pv-next-label {
  font-size: var(--fs-micro);
  font-weight: var(--fw-semi);
  letter-spacing: var(--tracking-caps);
  text-transform: uppercase;
  color: var(--brand-dark);
}
.pv-next-when {
  font-family: var(--font-serif);
  font-size: var(--fs-heading);
  font-weight: var(--fw-bold);
  color: var(--ink);
  letter-spacing: -.01em;
  line-height: 1.25;
}
.pv-next-who { font-size: var(--fs-body); color: var(--ink-2); }
.pv-next-rel { font-size: var(--fs-xs); color: var(--muted-ink); margin-top: 2px; }
.pv-next-none { font-size: var(--fs-body); color: var(--ink-2); line-height: 1.55; margin-top: 2px; }

/* ---------- filter + count ---------- */
.pv-filter { margin: 0; }
/* a 760px-wide dropdown holding the words "Last 3 months" is a control that has
   been stretched rather than placed */
.pv-filter .select { min-height: var(--tap); max-width: 280px; }
.pv-count {
  font-size: var(--fs-micro);
  font-weight: var(--fw-semi);
  color: var(--muted-ink);
  letter-spacing: var(--tracking-caps);
  text-transform: uppercase;
}

/* ---------- session cards ---------- */
.pv-list { display: flex; flex-direction: column; gap: var(--s-3); }
.pv-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-md);                /* the app's card radius         */
  box-shadow: none;                          /* a hairline OR a shadow        */
  padding: var(--s-4) var(--s-5);
  display: flex;
  flex-direction: column;
}
/* ⚠ WHOSE LESSON, FIRST. A parent with three children reads this list to find
   out what happened to a particular child, and the child's name was the LAST
   thing on the card — under the date, under the time, under the tutor. Ordered
   first it becomes the card's subject line, and the card reads the way the
   question is asked: who, then when, then what. One flex `order`, no markup
   change (js/view-parent.js still emits date → meta → child). */
.pv-flags { order: -1; }
.pv-flags:empty { display: none; }
.pv-card-head { margin-bottom: var(--s-1); }
.pv-date {
  font-size: var(--fs-lead);
  font-weight: var(--fw-semi);
  color: var(--ink);
  letter-spacing: -.01em;
}
.pv-meta { font-size: var(--fs-sm); color: var(--muted-ink); font-variant-numeric: tabular-nums; }

.pv-flags { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-1) var(--s-3); margin: 0 0 var(--s-1); }
/* WHOSE LESSON THIS WAS — the one fact on the card that ties the parent to the
   child, repeated down thirty-three cards. As a filled pale-blue lozenge it was
   thirty-three bubbles and the loudest thing in the list; as the child's name
   set in the brand at semibold it is still the only coloured thing on the card
   and it now reads as a NAME rather than as a tag. Status is type and colour;
   the container was doing nothing the type could not. */
.pv-child {
  display: inline-flex;
  align-items: center;
  background: none;
  border-radius: 0;
  padding: 0;
  height: auto;
  color: var(--brand-dark);                /* 7.0:1 on white                  */
  font-size: var(--fs-sm);
  font-weight: var(--fw-semi);
}

.pv-block { margin-top: var(--s-3); }
.pv-label {
  font-size: var(--fs-micro);
  font-weight: var(--fw-semi);
  letter-spacing: var(--tracking-caps);
  text-transform: uppercase;
  color: var(--muted-ink);
  margin-bottom: 4px;
}
/* white-space: pre-wrap because the note text arrives as plain text with real
   newlines — js/view-parent.js never puts stored HTML into the page */
.pv-body {
  font-size: var(--fs-lead);
  line-height: 1.6;
  color: var(--ink);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.pv-none { font-size: var(--fs-sm); line-height: 1.55; color: var(--muted-ink); font-style: italic; }

.pv-more { min-height: var(--tap); margin-top: 12px; }

@media (max-width: 560px) {
  .pv { gap: 12px; }
  .pv-card { padding: 14px; border-radius: var(--r-md); }
  .pv-next-when { font-size: var(--fs-title); }
  .pv-body { font-size: var(--fs-body); }
}

/* ==========================================================================
   BRAND — Jordan's real LearnIt logo (assets/ copied from the live website,
   so the portal and learnit.net.au carry the identical mark).
   - logo.png       the wordmark: "Learn" black + "It" blue italic, transparent
   - mark-192.png   the square "It" mark, for spaces too small for the wordmark
   ========================================================================== */

/* Boot + login: the wordmark, on white, where it can actually be read. */
.boot .logo-img { height: auto; width: 190px; max-width: 60vw; }
.auth-logo      { height: auto; width: 210px; max-width: 64vw; display: block;
                  margin: 0 auto 18px; }

/* The 56px rail is ink navy (#0A1F33) and the mark is a blue tile — on its own
   it would sink into that ground. A white rounded tile lifts it off the rail
   and echoes the circular lockup used on the website and socials. */
.brand-mark { padding: 0; }
.brand-mark-img {
  width: 34px;
  height: 34px;
  display: block;
  border-radius: var(--r-sm);
  background: var(--white);
  padding: 2px;
  box-shadow: 0 1px 3px rgba(10, 31, 51, .30);
}

/* ==========================================================================
   DASHBOARD — the home page (js/view-dashboard.js)

   Appended last on purpose: this layer sits after the TUTORBIRD-MATCH LAYER
   and therefore wins on equal specificity. Everything here is scoped under
   `.dash` so no other view is touched.

   The page has ONE loud element (the hero) and everything else is graded down
   from it: hero 46px → card titles 17px → metric values 22px in a flat strip
   → rows. That grading IS the hierarchy — today and anything needing action
   outrank a running revenue total, which is the quietest tile in the strip.

   Palette: Jordan's ink navy for the hero ground, the blue family for accent
   and state, gold/red only where something is actually wrong. Playfair-family
   serif (--font-serif) on the hero number and every card title — that pairing
   with the wordmark is the brand.
   ========================================================================== */

.dash {
  display: flex;
  flex-direction: column;
  gap: var(--s-5);
  max-width: 1440px;
  margin-inline: auto;
  width: 100%;
}
.dash .page-head { margin-bottom: 0; }

/* ⚠ A HAIRLINE OR A SHADOW, NEVER BOTH — the rule `.stat` already states. The
   dashboard was the one page running both, so its cards sat a millimetre above
   every other page's cards and the app looked like two products. Nothing on the
   dashboard floats, so nothing on it casts. */
.dash .card {
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  box-shadow: none;
}
.dash .card-head {
  padding: var(--s-4) var(--s-5);
  border-bottom: 1px solid var(--line-2);
  min-height: 54px;
}
.dash .card-head h2 {
  font-family: var(--font-serif);
  font-size: var(--fs-title);
  font-weight: var(--fw-bold);
  letter-spacing: -.01em;
  color: var(--ink);
}
.dash .card-foot { background: var(--white); border-top: 1px solid var(--line-2); }

.dash-foot-link {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  font-size: var(--fs-sm);
  font-weight: var(--fw-semi);
  color: var(--brand-dark);
  background: none;
  border: 0;
  padding: 0 2px;
  cursor: pointer;
  font-family: inherit;
  border-radius: var(--r-xs);
}
.dash-foot-link:hover { text-decoration: underline; color: var(--brand-darker); }
.dash-foot-link:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }

/* --------------------------------------------------------------------------
   1. HERO — ink navy, the only element allowed to shout
   -------------------------------------------------------------------------- */
/* ⚠ FLAT INK NAVY. This was a radial blue wash over a navy→navy-2 fade with a
   30px drop shadow under it — three effects stacked to make one block feel
   important, which is what ornament always is. A solid field of Jordan's ink
   navy is the single most expensive-looking thing the palette can do: it is the
   same ground as the rail, it needs no shadow because nothing is pretending to
   float, and the serif number on it is then the only event in the rectangle. */
.dash-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(258px, 336px);
  gap: var(--s-6);
  align-items: center;
  padding: var(--s-6) var(--s-7);
  border-radius: var(--r-lg);
  background: var(--navy);
  color: var(--white);
  box-shadow: none;
}

.dh-main { min-width: 0; }

.dh-eyebrow {
  font-size: var(--fs-micro);
  font-weight: var(--fw-bold);
  letter-spacing: var(--tracking-caps);
  text-transform: uppercase;
  /* --brand-light, not --brand-soft: when the hero stacks on a phone this
     label spans the full width and its right end lands in the brightest corner
     of the gradient, where the softer blue measures 4.3:1. Pale blue clears
     4.5:1 everywhere on this ground, at every breakpoint. */
  color: var(--brand-light);
}

.dh-headline {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 4px 12px;
  margin-top: 8px;
}
.dh-num {
  font-family: var(--font-serif);
  font-size: 46px;
  font-weight: var(--fw-bold);
  line-height: 1;
  letter-spacing: -.02em;
  font-variant-numeric: tabular-nums;
}
.dh-unit {
  font-size: var(--fs-title);
  font-weight: var(--fw-medium);
  color: rgba(255, 255, 255, .88);
}
.dh-quiet {
  font-family: var(--font-serif);
  font-size: 30px;
  font-weight: var(--fw-bold);
  line-height: 1.1;
  letter-spacing: -.02em;
}

.dh-sub {
  margin-top: 9px;
  font-size: var(--fs-lead);
  color: rgba(255, 255, 255, .84);
}
.dh-week {
  margin-top: 14px;
  padding-top: 13px;
  border-top: 1px solid rgba(255, 255, 255, .16);
  font-size: var(--fs-sm);
  font-weight: var(--fw-medium);
  color: var(--brand-light);   /* same full-width/bright-corner reason */
  font-variant-numeric: tabular-nums;
}

/* ---- the "up next" panel ---- */
.dh-next {
  background: rgba(255, 255, 255, .08);
  border: 1px solid rgba(255, 255, 255, .17);
  border-radius: var(--r-md);
  padding: var(--s-4) var(--s-5);
  min-width: 0;
  transition: background .16s ease, border-color .16s ease;
}
.dh-next.clickable:hover { background: rgba(255, 255, 255, .14); border-color: rgba(255, 255, 255, .3); }
.dh-next:focus-visible { outline: 2px solid var(--white); outline-offset: 2px; }

.dh-next-label {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: var(--fs-micro);
  font-weight: var(--fw-bold);
  letter-spacing: var(--tracking-caps);
  text-transform: uppercase;
  /* NOT --brand-soft: measured against the composited gradient inside this
     translucent panel it lands at 3.4:1. Jordan's pale blue is 5.7:1 there,
     still unmistakably blue, and still clearly below white in the hierarchy. */
  color: var(--brand-light);
}
/* the green lives in the dot; a green LABEL is only 4.2:1 on this ground */
.dh-next-label.is-live { color: var(--white); }
.dh-live-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--ok-soft);
  box-shadow: 0 0 0 0 rgba(88, 195, 154, .7);
  animation: dashPulse 1.9s ease-out infinite;
  flex: 0 0 8px;
}
@keyframes dashPulse {
  70%  { box-shadow: 0 0 0 8px rgba(88, 195, 154, 0); }
  100% { box-shadow: 0 0 0 0 rgba(88, 195, 154, 0); }
}

.dh-next-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 11px;
  min-width: 0;
}
.dh-next-row .avatar { border: 1px solid rgba(255, 255, 255, .28); }
.dh-next-who {
  font-size: var(--fs-lead);
  font-weight: var(--fw-semi);
  color: var(--white);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}
.dh-next-when {
  margin-top: 9px;
  font-family: var(--font-serif);
  font-size: var(--fs-title);
  font-weight: var(--fw-bold);
  color: var(--white);
  letter-spacing: -.01em;
  font-variant-numeric: tabular-nums;
}
.dh-next-meta {
  margin-top: 3px;
  font-size: var(--fs-sm);
  color: var(--brand-light);   /* same reason as .dh-next-label */
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.dh-next-empty {
  margin-top: 9px;
  font-size: var(--fs-sm);
  line-height: 1.55;
  color: rgba(255, 255, 255, .84);
}
.dh-next-btn {
  margin-top: 13px;
  background: rgba(255, 255, 255, .95);
  border-color: transparent;
  color: var(--navy);
}
.dh-next-btn:hover { background: var(--white); border-color: transparent; color: var(--navy-2); }

/* --------------------------------------------------------------------------
   2. ALERTS — one row per decision, each carrying the button that ends it.
   The 1px grid gap doubles as the hairline, so rows can be added or removed
   without a first/last-child rule ever going stale.
   -------------------------------------------------------------------------- */
.dash-alerts {
  display: flex;
  flex-direction: column;
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  overflow: hidden;
  box-shadow: none;
}
.dash-alert {
  display: flex;
  align-items: center;
  gap: var(--s-4);
  padding: var(--s-4) var(--s-5);
  background: var(--white);
  min-height: 62px;
}
.dash-alert-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px; height: 34px;
  flex: 0 0 34px;
  border-radius: 50%;
}
.dash-alert-icon svg { width: 17px; height: 17px; stroke: currentColor; }
.dash-alert-text { min-width: 0; flex: 1 1 auto; }
.dash-alert-title {
  font-size: var(--fs-body);
  font-weight: var(--fw-semi);
  color: var(--ink);
  letter-spacing: -.005em;
}
.dash-alert-hint { font-size: var(--fs-xs); color: var(--muted-ink); margin-top: 2px; }
.dash-alert-btn { margin-left: auto; flex: 0 0 auto; }

/* The rail is the ONLY thing separating a warn row from a done row, so it is a
   meaningful UI component and owes 3:1 (WCAG 1.4.11). The soft/pale steps sat
   at 1.5–2.2:1 on white; each drops to its readable sibling. Jordan's gold
   stays as the icon FILL behind --warn-ink, which already passes at 6.8:1. */
.dash-alert-warn   { box-shadow: inset 3px 0 0 var(--warn-ink); }
.dash-alert-warn   .dash-alert-icon { background: var(--warn-bg); color: var(--warn-ink); }
.dash-alert-danger { box-shadow: inset 3px 0 0 var(--danger); }
.dash-alert-danger .dash-alert-icon { background: var(--danger-bg); color: var(--danger-ink); }
.dash-alert-ok     { box-shadow: inset 3px 0 0 var(--ok-ink); }
.dash-alert-ok     .dash-alert-icon { background: var(--ok-bg); color: var(--ok-ink); }
.dash-alert-info   { box-shadow: inset 3px 0 0 var(--brand); }
.dash-alert-info   .dash-alert-icon { background: var(--brand-light); color: var(--brand-dark); }

/* --------------------------------------------------------------------------
   3. METRICS — the running totals, one flat strip. Same 1px-gap hairline
   trick, so 3 tiles (tutor) and 4 (admin) both come out right, wrapped or not.
   -------------------------------------------------------------------------- */
.dash-metrics {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(0, 1fr);
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  overflow: hidden;
  box-shadow: none;
}
.dash-metric {
  background: var(--white);
  padding: var(--s-4) var(--s-5);
  min-width: 0;
  color: inherit;
  text-decoration: none;
  transition: background .14s ease;
}
a.dash-metric:hover { background: var(--brand-tint); text-decoration: none; }
a.dash-metric:focus-visible { outline: 2px solid var(--brand); outline-offset: -2px; }
.dm-label {
  font-size: var(--fs-micro);
  font-weight: var(--fw-semi);
  letter-spacing: var(--tracking-caps);
  text-transform: uppercase;
  color: var(--muted-ink);
}
.dm-value {
  margin-top: 6px;
  font-size: var(--fs-figure);
  font-weight: var(--fw-bold);
  letter-spacing: -.02em;
  line-height: 1.15;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}
.dm-sub {
  margin-top: 3px;
  font-size: var(--fs-xs);
  color: var(--muted-ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.dash-metric-danger .dm-value { color: var(--danger-ink); }
.dash-metric-ok     .dm-value { color: var(--ok-ink); }

/* --------------------------------------------------------------------------
   4. COLUMNS + ROWS
   -------------------------------------------------------------------------- */
.dash-cols {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr);
  gap: var(--s-5);
  align-items: start;
}
.dash-col { display: flex; flex-direction: column; gap: var(--s-5); min-width: 0; }
.dash-col .card + .card { margin-top: 0; }

.dash-list { display: flex; flex-direction: column; }

.dash-row { position: relative; }
.dash-row:focus-visible { outline: 2px solid var(--brand); outline-offset: -2px; }
.dash-row-audit { cursor: default; }
.dash-row-audit:hover { background: transparent; }
.dash-row-audit .lr-title { font-weight: var(--fw-medium); white-space: normal; }

/* the time gutter */
.dash-when {
  flex: 0 0 82px;
  min-width: 0;
  line-height: 1.25;
  font-size: var(--fs-sm);
  font-weight: var(--fw-semi);
  color: var(--ink-2);
  font-variant-numeric: tabular-nums;
}
.dash-when small { display: block; font-size: var(--fs-micro); font-weight: var(--fw-medium); color: var(--muted-ink); }
.dash-when-lg { font-size: var(--fs-lead); font-weight: var(--fw-bold); color: var(--ink); }

.dash-act { flex: 0 0 auto; display: flex; align-items: center; gap: 8px; }
/* a future lesson carries neither badge nor button — an empty flex child would
   still open a wrapped row on mobile and push a 4px gap into the layout */
.dash-act:empty { display: none; }

/* state rail — reads the row's status at a glance without another badge */
.dash-accent-now  { box-shadow: inset 3px 0 0 var(--brand); background: var(--brand-tint); }
.dash-accent-next { box-shadow: inset 3px 0 0 var(--brand-mid); }    /* was --brand-light-2, 1.5:1 → 3.6:1 */
.dash-accent-todo { box-shadow: inset 3px 0 0 var(--warn-ink); }     /* was --warn, 2.0:1        */
.dash-accent-done { box-shadow: inset 3px 0 0 var(--ok-ink); }       /* was --ok-soft, 2.2:1     */
.dash-now { box-shadow: inset 3px 0 0 var(--brand); background: var(--brand-tint); }

/* the "now" rule dropped into today's timeline */
.dash-nowline {
  display: flex;
  align-items: center;
  gap: var(--s-2);
  padding: 0 var(--s-5);
  height: 28px;
  background: var(--white);
  border-bottom: 1px solid var(--line-2);
}
.dash-nowline-dot {
  width: 7px; height: 7px; flex: 0 0 7px;
  border-radius: 50%;
  background: var(--brand);
}
.dash-nowline-label {
  font-size: var(--fs-micro);
  font-weight: var(--fw-semi);
  letter-spacing: var(--tracking-caps);
  text-transform: uppercase;
  color: var(--brand-dark);
  font-variant-numeric: tabular-nums;
}
.dash-nowline-rule {
  flex: 1 1 auto;
  height: 1px;
  background: linear-gradient(90deg, var(--brand-soft), transparent);
}

/* A card living in the narrow right column cannot fit gutter + avatar + name
   + a button on one line at any realistic width, and the name is what loses.
   The action drops to its own line instead. (The explicit .lr-main basis is
   what stops flex line-breaking from choosing per-row — see the 560px block.) */
.dash-card-stack .list-row { flex-wrap: wrap; row-gap: 6px; }
.dash-card-stack .list-row .lr-main { flex: 1 1 110px; }
.dash-card-stack .dash-act { width: 100%; justify-content: flex-end; }

/* notes */
.dash-note { font-size: var(--fs-xs); color: var(--ink-2); margin-top: 4px; overflow-wrap: anywhere; }

.dash-last {
  display: flex;
  align-items: baseline;
  gap: 7px;
  margin-top: 5px;
  font-size: var(--fs-xs);
  color: var(--muted-ink);
  min-width: 0;
}
.dash-last > span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* The category of the last lesson ("LESSON", "TRIAL"). It is metadata — it says
   what kind of thing happened, not that anything needs doing — so it loses the
   pale-blue pill and joins `.meta-text`'s level: an uppercase eyebrow in muted
   ink. One of these sat on every row of the dashboard's busiest list, which is
   the definition of colour spent until it stops meaning anything. */
.dash-last-tag {
  flex: 0 0 auto;
  padding: 0;
  border-radius: 0;
  background: none;
  color: var(--muted-ink);
  font-size: var(--fs-micro);
  font-weight: var(--fw-semi);
  letter-spacing: var(--tracking-caps);
  text-transform: uppercase;
}

/* --------------------------------------------------------------------------
   5. QUICK LINKS — a tutor's three most-opened pages.
   ⛔ RULE ZERO: "My Pay" is the own-pay exception and carries NO figure here.
   -------------------------------------------------------------------------- */
.dash-links { display: flex; flex-direction: column; }
.dash-link {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  padding: var(--s-3) 2px;
  min-height: 58px;
  border-bottom: 1px solid var(--line-2);
  color: inherit;
  text-decoration: none;
}
.dash-link:last-child { border-bottom: 0; }
.dash-link:hover { text-decoration: none; }
.dash-link:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; border-radius: var(--r-sm); }
.dash-link-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px; height: 38px;
  flex: 0 0 38px;
  border-radius: var(--r-sm);
  background: var(--brand-light);
  color: var(--brand-dark);
  transition: background .15s ease, color .15s ease;
}
.dash-link-icon svg { width: 18px; height: 18px; stroke: currentColor; }
.dash-link:hover .dash-link-icon { background: var(--brand); color: var(--white); }
.dash-link-text { min-width: 0; flex: 1 1 auto; }
.dash-link-title { display: block; font-size: var(--fs-body); font-weight: var(--fw-semi); color: var(--ink); }
.dash-link:hover .dash-link-title { color: var(--brand-dark); }
.dash-link-hint {
  display: block;
  font-size: var(--fs-xs);
  color: var(--muted-ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.dash-link-chev { margin-left: auto; display: flex; color: var(--muted-ink); flex: 0 0 auto; }
.dash-link-chev svg { width: 16px; height: 16px; stroke: currentColor; }

/* --------------------------------------------------------------------------
   6. RESPONSIVE — Jordan's tutors run this on a phone, so 375px is a first
   class layout, not a fallback. Everything stays in ONE column, the time
   gutter stays a gutter (a full-width time line wastes a third of the screen),
   and every control is a 44px target.
   -------------------------------------------------------------------------- */
@media (max-width: 1080px) {
  .dash-cols { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 900px) {
  .dash-hero {
    grid-template-columns: minmax(0, 1fr);
    gap: 18px;
    padding: 22px 20px;
  }
  .dash-metrics {
    grid-auto-flow: row;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  /* three tiles (a tutor) in a two-column grid leaves a hole where the
     container's hairline colour shows through — the odd one out spans */
  .dash-metric:last-child:nth-child(odd) { grid-column: 1 / -1; }
}

@media (max-width: 560px) {
  .dash { gap: 14px; }
  .dash-cols, .dash-col { gap: 14px; }

  .dash-hero { padding: 20px 18px; border-radius: var(--r-md); }
  .dh-num { font-size: 40px; }
  .dh-quiet { font-size: 25px; }
  .dh-unit { font-size: var(--fs-lead); }
  .dh-sub { font-size: var(--fs-sm); }
  .dh-next { padding: 14px; }
  .dh-next-when { font-size: var(--fs-title); }
  .dh-next-btn { min-height: var(--tap); width: 100%; }

  .dash .card-head { padding: 13px 14px; }
  .dash .card-head h2 { font-size: var(--fs-lead); }

  /* alerts: the button drops to its own full-width line rather than squeezing
     the sentence into two words a line */
  .dash-alert { flex-wrap: wrap; padding: 13px 14px; gap: 12px; }
  .dash-alert-text { flex: 1 1 60%; }
  .dash-alert-btn { margin-left: 0; width: 100%; min-height: var(--tap); }

  .dash-metric { padding: 13px 14px; }
  .dm-value { font-size: var(--fs-heading); }
  .dm-sub { white-space: normal; }   /* a date range beats an ellipsis */

  .dash .list-row { flex-wrap: wrap; padding: 12px 14px; row-gap: 4px; }
  .dash-when { flex: 0 0 66px; font-size: var(--fs-xs); }
  .dash-when-lg { font-size: var(--fs-body); }
  .dash-when small { font-size: var(--fs-micro); }
  /* A wrapped flex line is chosen from each item's HYPOTHETICAL size, which for
     flex-basis:auto is max-content — so a row carrying a long "Last time…"
     note would break onto its own line while its neighbours stayed inline, and
     the list lost its gutter at random. A small explicit basis pins every row
     to the same shape; flex-grow still fills the width. */
  .dash .list-row .lr-main { flex: 1 1 110px; }
  /* "Lesson · wi…" hides the one fact an admin is scanning for. Two short
     lines beat an ellipsis on a phone. */
  .dash .list-row .lr-sub { white-space: normal; overflow: visible; }
  .dash-act { width: 100%; justify-content: flex-end; margin-left: 0; }
  /* an inline action inside a row is the smallest target on the page */
  .dash-act .btn { min-height: var(--tap); }

  .dash-nowline { padding: 0 14px; }
  .dash-last { font-size: var(--fs-xs); }

  .dash-link { padding: 10px 0; }
  .dash-link-hint { font-size: var(--fs-xs); }

  .dash .card-foot { flex-wrap: wrap; }
  /* every text link on a phone is a thumb target, wherever it sits */
  .dash .dash-foot-link { min-height: var(--tap); padding: 0 4px; }
}

/* On the very narrowest phones (SE-class, 320–360px) the avatar is the one
   element that earns its 42px least — the name is right beside it. */
@media (max-width: 360px) {
  .dash .list-row > .avatar { display: none; }
  .dash-when { flex: 0 0 62px; }
  .dash-metric { padding: 12px; }
}

/* --------------------------------------------------------------------------
   7. PRINT — a navy block would drink a print cartridge; keep the structure,
   drop the ground.
   -------------------------------------------------------------------------- */
@media print {
  .dash-hero {
    background: var(--white);
    color: var(--ink);
    border: 1px solid var(--line);
    box-shadow: none;
  }
  .dash-hero .dh-eyebrow,
  .dash-hero .dh-next-label,
  .dash-hero .dh-next-meta,
  .dash-hero .dh-week { color: var(--muted-ink); }
  .dash-hero .dh-sub,
  .dash-hero .dh-next-who,
  .dash-hero .dh-next-when,
  .dash-hero .dh-next-empty { color: var(--ink); }
  .dh-next { background: var(--bg); border-color: var(--line); }
  .dash-alerts, .dash-metrics, .dash .card { box-shadow: none; }
  .dash-cols { grid-template-columns: minmax(0, 1fr); }
}

