/* ===========================================================================
   console.css — the staff console: admin + franchise.

   SECOND REBUILD, 22 October 2026, against the four reference screens the
   client sent on 20 and 22 October (dashboard, students, attendance, shop).
   The first rebuild of 21 October is replaced, not layered over: every rule
   from §1 to §33 below is written fresh.

   It remains the ONLY stylesheet on an admin or franchise page. Neither
   site.css nor panel.css is loaded there, so nothing of either previous
   design can leak in. panel.css stays on disk untouched because the STUDENT
   portal is built on it — layouts/student loads site.css + panel.css +
   student.css + student-play.css, and its twenty screens take their cards,
   tables and chips from the middle two. That portal was drawn from the
   client's own mockups and is not in this brief's scope.

   WHAT CHANGED, against the 21 October design this replaces
   ---------------------------------------------------------
   · ONE PRIMARY, AND IT IS BLUE. The franchise panel was amber-primary and
     the admin blue. The brief's §3 global rule is "bright blue for primary
     buttons and active navigation", with "yellow or orange for pending,
     late and warning". So amber stopped being a brand accent and became a
     STATE, on both panels, and #1769E8 is the one action colour. The two
     panels now differ by density alone.
   · THE RAIL'S CURRENT ITEM is a solid blue pill across the full width of
     the rail. It was a raised navy tile with a 3px bar at its left edge.
   · THE METRIC TILE is a pastel card, filled edge to edge in the metric's
     own tint, laid out HORIZONTALLY — a round icon chip at the left, label
     over figure at the right. It was a vertical tile with a white icon
     plate and a colour spine.
   · THE CARD lost its spine. White, 16px, a hairline and one soft shadow,
     with a tinted rounded-square icon against the heading and the overflow
     link at the far end of the head.
   · THE TABLE HEAD is a light blue band (#F0F6FF) in small caps; the
     identity cell carries a round avatar; a figure column is tabular; row
     actions are PERMANENT ghost buttons rather than appearing on hover —
     a touch screen has no hover and the client's reference shows them on.
   · PAGINATION gained its per-page control and numbered pages, with the
     current page a solid blue square. It was a count and two arrows.
   · NEW TYPE. Inter throughout, per the brief's §3 "modern typography, such
     as Inter" — in place of Outfit and Figtree. Display weights are tight
     and dark; the interface runs 400/500/600.
   · NEW GROUND. #F5F8FD, the brief's page background, lighter and bluer
     than #EDF1F8, so a white card separates on a tint rather than on grey.
   · BREADCRUMBS exist (§9), per brief §4B. The page title stays in the top
     bar, where Yogesh moved it on 21 October — mockups 3 and 4 disagree
     with each other about this and his instruction breaks the tie.

   WHAT IT KEEPS, deliberately
   ---------------------------
   · <x-icon>: one icon family across the platform is design standard §4.
   · The class vocabulary (.pcard, .ptable, .kpi, .field, .st …) as an API,
     so eight thousand lines of Blade keep their loops, their conditions,
     their CSRF fields and their data bindings. Every rule painting those
     names is newly written; none is carried over. Renaming them would mean
     editing data bindings to move a colour, which is how a redesign turns
     into a regression.
   · The token NAMES in §1. The bespoke module sheets further down (§34+:
     the masters, the certificate artboard, the gate) are written against
     those names, so they re-colour with the rest rather than needing a
     second pass.

   Ban list (standards §7.1), observed: no gradient surfaces, no frosted or
   translucent cards, no emoji as icons, no uniform big-radius-plus-shadow,
   no centred-everything, no gradient text. Separation is hairlines and
   tints; shadow is for things that genuinely float.
   test_gradients_on_a_panel_are_the_students_alone holds that.
   ======================================================================== */


/* ---------------------------------------------------------------------------
   1. Tokens

   The values are the brief's §3 palette. Where the brief gives one colour
   per role, this file gives three — a text-safe INK, a TINT to fill with,
   and an EDGE to draw the tint's border. The brief's own numbers are bright
   drawn colours: #FFC928 fills a chip beautifully and is unreadable as
   words on white. So each role carries both and the names say which is
   which, which is the whole of the accessibility requirement in §3.
   ------------------------------------------------------------------------ */
:root {
  /* --- ink ------------------------------------------------------------- */
  --ink:        #172B4D;   /* headings, figures   — brief "Main Text"      */
  --body:       #44536F;   /* body copy           — 8.0:1 on white         */
  --muted:      #64748B;   /* secondary, heads    — brief "Secondary Text" */
  --faint:      #94A3B8;   /* placeholders        — 2.9:1, never text      */

  /* --- ground & surface ------------------------------------------------ */
  --ground:     #F5F8FD;   /* the page behind the cards                    */
  --surface:    #FFFFFF;   /* a card                                       */
  --sunk:       #F0F6FF;   /* a well: table head, note, code               */
  --line:       #E2EAF4;   /* hairline, structural                         */
  --line-soft:  #EDF2FA;   /* hairline, between table rows                 */

  /* --- the rail -------------------------------------------------------- */
  --rail:       #0C2D59;   /* brief "Sidebar Navy"                         */
  --rail-up:    #163C70;   /* a hovered item inside the rail               */
  --rail-line:  #1E4578;
  --rail-ink:   #FFFFFF;
  --rail-dim:   #B4C6E2;   /* rail body copy      — 8.6:1 on --rail        */
  --rail-label: #7C96BF;   /* rail group labels   — 4.6:1, small caps      */

  /* --- the one accent ---------------------------------------------------
     Blue, on both panels. --accent paints, --accent-ink writes; they are
     the same hue here because blue carries white AND reads on white, which
     amber never did. Both names stay so the module sheets below keep
     working, and so a future brand accent has somewhere to go.           */
  --accent:      #1769E8;  /* brief "Primary Blue"                         */
  --accent-deep: #1257C4;  /* pressed, and the hovered fill                */
  --accent-lit:  #2584F4;  /* brief "Bright Blue" — the lit edge           */
  --accent-ink:  #1559C4;  /* blue as TEXT on white — 5.4:1                */
  --accent-tint: #F0F6FF;  /* brief "Light Blue Background"                */
  --accent-edge: #CCE0FB;
  --accent-on:   #FFFFFF;  /* text that sits on --accent                   */

  /* --- metric colours ---------------------------------------------------
     Nine roles. A metric keeps ONE colour everywhere it appears — the tile
     on the dashboard, the bar in the report, the chip in the table — so a
     reader learns it once. Never assigned by position: there is no
     ".kpi--third" in this file, by design.

     -t is the fill, -e its edge, and the bare name is the text-safe ink.  */
  --c-blue:   #1769E8;  --c-blue-t:   #F0F6FF;  --c-blue-e:   #CCE0FB;
  --c-green:  #0E7A4D;  --c-green-t:  #E3F8EC;  --c-green-e:  #BDEBD3;
  --c-amber:  #8A6100;  --c-amber-t:  #FFF5D9;  --c-amber-e:  #F6DFA4;
  --c-violet: #6A3FC4;  --c-violet-t: #F1E9FF;  --c-violet-e: #DCCAFA;
  --c-pink:   #C32C63;  --c-pink-t:   #FFF0F5;  --c-pink-e:   #FACFDF;
  --c-teal:   #0B7285;  --c-teal-t:   #DFF6FF;  --c-teal-e:   #B6E6F3;
  --c-orange: #B45A09;  --c-orange-t: #FFF0DD;  --c-orange-e: #F8D5AC;
  --c-slate:  #51607A;  --c-slate-t:  #EFF3F9;  --c-slate-e:  #DCE4EF;
  --c-red:    #C3353A;  --c-red-t:    #FEECEC;  --c-red-e:    #F7CBCC;

  /* --- the bright set ---------------------------------------------------
     The brief's drawn colours, unmodified, for FILLS ONLY — a donut arc, a
     bar, a legend dot, a 10px status dot. Never for words.               */
  --d-blue:   #2584F4;
  --d-green:  #16A56A;
  --d-amber:  #FFC928;
  --d-violet: #8557E8;
  --d-pink:   #F45D91;
  --d-teal:   #35C3E8;
  --d-orange: #F49A38;
  --d-red:    #E5484D;
  --d-slate:  #8597B4;

  /* --- the eight levels, as eight colours ------------------------------
     Ordered so no two adjacent levels sit close in hue: adjacent donut
     segments are exactly the pair a reader has to tell apart. These are
     DRAWN colours. Where a level is READ as words the chip takes the
     text-safe ink instead — see .st--lvN in §16.                        */
  --lv1: #2584F4;
  --lv2: #16A56A;
  --lv3: #FFC928;
  --lv4: #8557E8;
  --lv5: #F45D91;
  --lv6: #35C3E8;
  --lv7: #F49A38;
  --lv8: #8597B4;

  /* --- radius ----------------------------------------------------------
     Four steps, each meaning something: controls, wells, cards, panels.
     Not one value on everything — §7.1 item 6.                          */
  --r1: 10px; --r2: 13px; --r3: 16px; --r4: 20px; --rp: 999px;

  /* --- elevation --------------------------------------------------------
     A card gets a hairline AND one soft shadow in this design — the ground
     is a pale tint now rather than a grey, and a hairline alone on #F5F8FD
     does not separate. Everything heavier is for things that float.     */
  --sh-card: 0 1px 2px rgba(23, 43, 77, .04), 0 2px 10px -4px rgba(23, 43, 77, .06);
  --sh-rest: 0 1px 2px rgba(23, 43, 77, .05);
  --sh-pop:  0 20px 44px -16px rgba(16, 47, 94, .30), 0 2px 6px rgba(16, 47, 94, .06);
  --sh-lift: 0 10px 24px -12px rgba(16, 47, 94, .26);
  --sh-blue: 0 4px 12px -4px rgba(23, 105, 232, .40);

  /* --- metrics ---------------------------------------------------------- */
  --rail-w: 256px;         /* the rail, desktop                            */
  --bar-h:  68px;          /* the top bar: title, centre, year, account    */
  --gut:    clamp(16px, 2.1vw, 28px);   /* content gutter                  */
  --gap:    clamp(14px, 1.5vw, 20px);   /* gap between cards IN a grid     */
  --stack:  clamp(16px, 1.9vw, 24px);   /* gap between blocks ON a page    */
  --wrap:   1560px;        /* content cap — §7.1 item 13, never full-bleed */
  --row-y:  13px;          /* table cell padding, vertical                 */

  /* --- type -------------------------------------------------------------
     Inter, per brief §3. One family, two roles: --display runs tight and
     dark for headings and figures, --ui runs normal for the interface.
     A dashboard is mostly numbers and Inter's tabular figures are even.  */
  --display: Inter, "Segoe UI", system-ui, -apple-system, sans-serif;
  --ui:      Inter, "Segoe UI", system-ui, -apple-system, sans-serif;

  --focus: #1769E8;
  --z-stuck: 20; --z-drop: 40; --z-rail: 60; --z-modal: 80; --z-toast: 90;
}

/* ---------------------------------------------------------------------------
   2. The two surfaces

   One system, two densities. Admin is the dense one — it is a console
   somebody works in all day, so its rows are tighter. Franchise breathes a
   little more: a partner opens it a few times a day, not continuously.

   It used to be two ACCENTS as well, amber for the franchise. The brief's
   §3 makes blue the one primary and amber a warning state, so the accent
   tokens no longer fork here. layouts/gate reads the same attribute.
   ------------------------------------------------------------------------ */
[data-panel="admin"]     { --row-y: 11px; }
[data-panel="franchise"],
[data-panel="teacher"]   { --row-y: 14px; }

/* ---------------------------------------------------------------------------
   3. Reset & base
   ------------------------------------------------------------------------ */
*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--ground);
  color: var(--body);
  font: 400 15px/1.55 var(--ui);
  font-feature-settings: "cv05", "ss03";
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4, h5 {
  margin: 0;
  font-family: var(--display);
  color: var(--ink);
  letter-spacing: -.018em;
}
p  { margin: 0; }
ul, ol { margin: 0; padding: 0; }
li { list-style: none; }

a { color: var(--accent-ink); text-decoration-thickness: 1.5px; text-underline-offset: 2px; }
a:hover { color: var(--accent-deep); }

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

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

/* A bare <button> keeps the platform's grey 3D chrome unless it is told
   otherwise. Every button in this file is drawn from scratch. */
button {
  margin: 0;
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
  color: inherit;
}

/* A visible focus ring on everything, always — standards §8. Two colours so
   the ring reads on a white card and on the navy rail alike. */
:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
  border-radius: 4px;
}
.paside :focus-visible { outline-color: #8FC0FF; }

/* panel.js sets this on <body> while a drawer or a modal is open. */
body.is-locked { overflow: hidden; }

/* Honour the system setting — §7.2, "micro-interaction, not animation". */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    transition-duration: .001ms !important;
    scroll-behavior: auto !important;
  }
}

.sr-only {
  position: absolute !important;
  width: 1px; height: 1px;
  margin: -1px; padding: 0; border: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

/* ---------------------------------------------------------------------------
   4. Type helpers

   Figures are tabular so a column of numbers lines up and does not shimmer
   as it counts. Every figure on a dashboard goes through .num or a rule
   that sets the same two properties.
   ------------------------------------------------------------------------ */
.num {
  font-family: var(--display);
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1, "cv05" 1;
  letter-spacing: -.02em;
}

/* A small-caps label above a group: the one typographic device this design
   uses to mark a heading that is NOT a heading. */
.t-eyebrow {
  font: 600 11px/1 var(--ui);
  letter-spacing: .09em;
  text-transform: uppercase;
  color: var(--muted);
}

.t-fine { font: 400 13px/1.5 var(--ui); color: var(--muted); }

/* ---------------------------------------------------------------------------
   5. The shell

   A two-column frame: a fixed rail and a scrolling main column. The rail
   leaves the flow at 1023px and becomes a drawer (§31).
   ------------------------------------------------------------------------ */
.panel {
  display: grid;
  grid-template-columns: var(--rail-w) minmax(0, 1fr);
  min-height: 100vh;
}

.panel__main {
  min-width: 0;          /* load-bearing: see §32, min-width:auto          */
  display: flex;
  flex-direction: column;
}

.pbody {
  flex: 1;
  padding: var(--stack) var(--gut) calc(var(--stack) * 2.2);
}

.pwrap {
  max-width: var(--wrap);
  margin-inline: auto;
}

/* THE PAGE RHYTHM.

   Nearly every screen drops several top-level blocks straight into the body
   as plain siblings, and a .grid spaces what is INSIDE it — nothing was
   spacing the grids themselves until this rule existed (21 October: "design
   chipakte aahe ekmeka la"). --stack is a separate token from --gap because
   "between blocks on a page" and "between cards in a grid" are different
   jobs and want different numbers. */
.pwrap > * + * { margin-top: var(--stack); }

/* A screen wired to the API wraps its blocks in one Alpine root
   (<div data-api x-data=…>), which would otherwise swallow the rhythm. */
.pwrap > [data-api] > * + * { margin-top: var(--stack); }

/* A section head belongs to the block under it, so it sits closer to that
   block than to whatever it follows. */
.pwrap > .phead + *,
.pwrap > [data-api] > .phead + * { margin-top: 12px; }

/* The preview strip. Said plainly, once, at the very top: the numbers on
   this screen are invented. It is not a toast and it does not dismiss —
   a design review should never stop seeing it. */
.pdemo {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 8px 16px;
  background: var(--navy);
  color: #FFD98A;
  font: 500 12.5px/1.4 var(--ui);
  text-align: center;
}
.pdemo b { color: #FFC928; font-weight: 700; }
.pdemo svg { flex: 0 0 auto; }

/* ---------------------------------------------------------------------------
   6. The rail

   Navy, full height, its own scroll. Brand tile at the top, then groups of
   links under small-caps labels, and nothing at the foot — the account and
   the way out are in the bar's right corner and were taken off the rail on
   21 October rather than being written twice on one screen.
   ------------------------------------------------------------------------ */
.paside {
  position: sticky;
  top: 0;
  align-self: start;
  height: 100vh;
  z-index: var(--z-rail);
  display: flex;
  flex-direction: column;
  background: var(--rail);
  color: var(--rail-dim);
}

/* The brand tile. Logo, centre name, and the franchise code under it — the
   code is what head office asks for on every call, every order query and
   every ticket, so it is on screen permanently rather than filed away in
   Settings. */
.paside__brand {
  flex: 0 0 auto;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 11px;
  padding: 16px 16px 15px;
  margin: 10px 12px 6px;
  border-radius: var(--r2);
  background: rgba(255, 255, 255, .06);
  color: var(--rail-ink);
  text-decoration: none;
}
.paside__brand:hover { background: rgba(255, 255, 255, .10); color: var(--rail-ink); }
.paside__brand img { flex: 0 0 auto; }

.paside__wm { min-width: 0; display: grid; gap: 1px; }
.paside__wm b {
  display: block;
  font: 700 14.5px/1.25 var(--display);
  letter-spacing: -.015em;
  color: var(--rail-ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.paside__wm span,
.paside__code {
  display: block;
  font: 500 11.5px/1.3 var(--ui);
  letter-spacing: .04em;
  color: var(--rail-label);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.paside__scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 6px 12px 22px;
  scrollbar-width: thin;
  scrollbar-color: var(--rail-line) transparent;
}
.paside__scroll::-webkit-scrollbar { width: 8px; }
.paside__scroll::-webkit-scrollbar-thumb {
  background: var(--rail-line);
  border-radius: var(--rp);
}

/* A group label. Small caps, generously spaced, with room above it — the
   space is what separates one group from the last, not a rule. */
.pnav__label {
  margin: 20px 10px 7px;
  font: 600 10.5px/1 var(--ui);
  letter-spacing: .11em;
  text-transform: uppercase;
  color: var(--rail-label);
}
.paside__scroll > .pnav:first-child + .pnav__label,
.paside__scroll > .pnav__label:first-child { margin-top: 6px; }

.pnav { display: grid; gap: 2px; }

.pnav__link {
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: var(--r1);
  color: var(--rail-dim);
  font: 500 14.5px/1.3 var(--ui);
  text-decoration: none;
  transition: background .14s ease, color .14s ease;
}
.pnav__link > span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* The leading glyph. Targeted by position because <x-icon> renders a bare
   <svg> with no class of its own — standards §4 keeps one icon family and
   this is the cost of that. */
.pnav__link > svg {
  flex: 0 0 auto;
  color: #90A9CE;
  transition: color .14s ease;
}

.pnav__link:hover {
  background: var(--rail-up);
  color: var(--rail-ink);
}
.pnav__link:hover > svg { color: var(--rail-ink); }

/* CURRENT: a solid blue pill, the full width of the rail.

   This is the brief's §4A "bright blue active menu state" and it is the
   single most visible change from the 21 October design, which used a
   raised navy tile with a 3px bar at its left edge. A fill reads as "you
   are here" from across a room; a bar reads as "something about this row". */
.pnav__link[aria-current="page"] {
  background: var(--accent);
  color: #FFFFFF;
  font-weight: 600;
  box-shadow: var(--sh-blue);
}
.pnav__link[aria-current="page"] > svg { color: #FFFFFF; }
.pnav__link[aria-current="page"]:hover { background: var(--accent-deep); }

/* A count on a nav item: how many are waiting. On the current item it has
   to invert, or a blue badge disappears into a blue pill. */
.pnav__n {
  flex: 0 0 auto;
  min-width: 20px;
  padding: 0 6px;
  border-radius: var(--rp);
  background: var(--d-amber);
  color: #3A2A00;
  font: 700 11.5px/20px var(--ui);
  font-variant-numeric: tabular-nums;
  text-align: center;
}
.pnav__link[aria-current="page"] .pnav__n { background: #FFFFFF; color: var(--accent-deep); }

/* Not built yet, or not yours yet. Dimmed rather than hidden: a partner
   reading this navigation should see the shape of the whole portal, not
   watch items appear one week at a time. The word says which it is. */
.pnav__link--soon {
  color: #6E85AB;
  cursor: default;
}
.pnav__link--soon > svg { color: #4F678F; }
.pnav__link--soon:hover { background: none; color: #6E85AB; }
.pnav__link--soon:hover > svg { color: #4F678F; }

.pnav__soon {
  flex: 0 0 auto;
  padding: 2px 7px;
  border: 1px solid var(--rail-line);
  border-radius: var(--rp);
  font: 600 9.5px/1.4 var(--ui);
  letter-spacing: .08em;
  text-transform: uppercase;
  font-style: normal;
  color: #7C96BF;
}

/* The scrim behind the rail when it is a drawer. Not shown above 1023px. */
.paside__scrim {
  display: none;
  position: fixed;
  inset: 0;
  z-index: calc(var(--z-rail) - 1);
  background: rgba(10, 25, 50, .52);
}

/* ---------------------------------------------------------------------------
   7. The top bar

   One bar, 68px: the page title and its line of context at the left, then
   the centre switcher, the academic year, the counted bell and the account.
   No search field — it was never wired to anything, it held the widest slot
   on the bar, and the title wanted the room (21 October).
   ------------------------------------------------------------------------ */
.ptop {
  position: sticky;
  top: 0;
  z-index: var(--z-stuck);
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: var(--bar-h);
  padding: 10px var(--gut);
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}

.ptop__burger { display: none; }

.ptop__title { min-width: 0; flex: 1 1 auto; }
.ptop__title h1 {
  font: 700 clamp(19px, 2vw, 23px)/1.2 var(--display);
  letter-spacing: -.022em;
  color: var(--ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ptop__title p {
  margin-top: 2px;
  font: 400 13px/1.35 var(--ui);
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* flex: 0 0 auto, deliberately. Left to shrink, this group compresses past
   the point where the account name is readable while the title still has
   room it is not using. */
.ptop__right {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 10px;
}

/* --- the centre switcher, and its single-centre form -------------------- */
.pswap__btn,
.pswap--one {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 12px 7px 9px;
  border: 1px solid var(--line);
  border-radius: var(--r2);
  background: var(--surface);
  text-align: left;
}
.pswap__btn:hover { border-color: var(--accent-edge); background: var(--accent-tint); }

.pswap__ico {
  display: grid;
  place-items: center;
  width: 32px; height: 32px;
  flex: 0 0 auto;
  border-radius: var(--r1);
  background: var(--accent-tint);
  color: var(--accent);
}

.pswap__text,
.pswap__item-text { min-width: 0; display: grid; gap: 0; }
.pswap__text b,
.pswap__item-text b {
  font: 600 13.5px/1.25 var(--ui);
  color: var(--ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.pswap__text span,
.pswap__item-text span {
  font: 500 11.5px/1.3 var(--ui);
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.pswap__btn > svg:last-child { flex: 0 0 auto; color: var(--faint); }

/* --- the academic year --------------------------------------------------- */
.pyear__btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: var(--r2);
  background: var(--surface);
  font: 600 13.5px/1.2 var(--ui);
  color: var(--ink);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.pyear__btn:hover { border-color: var(--accent-edge); background: var(--accent-tint); }
.pyear__btn > svg { flex: 0 0 auto; color: var(--accent); }
.pyear__btn > svg:last-of-type { color: var(--faint); }

/* --- the bell, with its count -------------------------------------------
   A count, not a dot. The brief's §4B asks for an unread COUNT and the
   reference screens all show a number: "3 waiting" and "something is
   waiting" are different messages and the second one is not actionable. */
.pbell { position: relative; }
.pbell__dot {
  position: absolute;
  top: 2px; right: 1px;
  min-width: 18px; height: 18px;
  padding: 0 4px;
  border: 2px solid var(--surface);
  border-radius: var(--rp);
  background: var(--d-red);
  color: #FFFFFF;
  font: 700 10.5px/14px var(--ui);
  font-variant-numeric: tabular-nums;
  text-align: center;
}

/* --- the account block, and every pop-over menu in the console ----------- */
.pmenu { position: relative; }

.pmenu__btn {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 5px 10px 5px 5px;
  border: 1px solid transparent;
  border-radius: var(--rp);
  text-align: left;
}
.pmenu__btn:hover { background: var(--sunk); border-color: var(--line); }
.pmenu__btn > svg:last-child { flex: 0 0 auto; color: var(--faint); }

/* inline-grid, not grid: an avatar lands inside a table cell beside a name
   as often as it lands in the bar, and a block there would break the row. */
.pmenu__av,
.pav {
  display: inline-grid;
  place-items: center;
  width: 38px; height: 38px;
  flex: 0 0 auto;
  border-radius: var(--rp);
  background: var(--accent);
  color: #FFFFFF;
  font: 700 13.5px/1 var(--ui);
  letter-spacing: .02em;
  text-transform: uppercase;
}
.pav { width: 34px; height: 34px; font-size: 12.5px; }

.pmenu__who { min-width: 0; display: grid; }
.pmenu__who b {
  font: 600 13.5px/1.25 var(--ui);
  color: var(--ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.pmenu__who span {
  font: 400 11.5px/1.3 var(--ui);
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pmenu__pop {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: var(--z-drop);
  min-width: 248px;
  padding: 6px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r3);
  box-shadow: var(--sh-pop);
}
.pmenu__pop[hidden] { display: none; }

.pmenu__head {
  display: grid;
  gap: 2px;
  padding: 10px 12px 11px;
  margin-bottom: 4px;
  border-bottom: 1px solid var(--line);
}
.pmenu__head b { font: 600 14px/1.3 var(--ui); color: var(--ink); }
.pmenu__head span { font: 400 12px/1.4 var(--ui); color: var(--muted); }

.pmenu__item {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 10px 12px;
  border-radius: var(--r1);
  color: var(--body);
  font: 500 14px/1.3 var(--ui);
  text-decoration: none;
}
.pmenu__item > svg { flex: 0 0 auto; color: var(--faint); }
.pmenu__item:hover { background: var(--accent-tint); color: var(--accent-deep); }
.pmenu__item:hover > svg { color: var(--accent); }
.pmenu__item[aria-current="true"] { background: var(--accent-tint); color: var(--accent-deep); font-weight: 600; }
.pmenu__item[aria-current="true"] > svg { color: var(--accent); }
.pmenu__item--danger { color: var(--c-red); }
.pmenu__item--danger > svg { color: var(--c-red); }
.pmenu__item--danger:hover { background: var(--c-red-t); color: var(--c-red); }
.pmenu__item--danger:hover > svg { color: var(--c-red); }

/* ---------------------------------------------------------------------------
   8. Who — a name and a role, as a block

   Used where a person has to be identified outside the bar: a document's
   owner, a ticket's author, a batch's teacher.
   ------------------------------------------------------------------------ */
.pwho {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 10px;
}
.pwho__text { min-width: 0; display: grid; }
.pwho__text b { font: 600 14px/1.3 var(--ui); color: var(--ink); }
.pwho__text span { font: 400 12.5px/1.35 var(--ui); color: var(--muted); }

/* ---------------------------------------------------------------------------
   9. Breadcrumbs — brief §4B

   NEW in this rebuild. The trail sits at the top of the content column, not
   in the bar: the bar already carries the title and the context line, and a
   third row of text in it would crowd the one thing it is for.

   It is a <nav> with an ordered list. The separator is drawn with ::before
   so it is never read out, and the current page is marked aria-current and
   is not a link — a link to the page you are on is a dead control.
   ------------------------------------------------------------------------ */
.pcrumb {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 2px 4px;
  font: 500 13px/1.4 var(--ui);
}
.pcrumb ol { display: contents; }
.pcrumb li { display: flex; align-items: center; gap: 4px; }
.pcrumb li + li::before {
  content: "";
  width: 5px; height: 5px;
  margin-inline: 3px;
  border-top: 1.5px solid var(--faint);
  border-right: 1.5px solid var(--faint);
  transform: rotate(45deg);
}
.pcrumb a { color: var(--muted); text-decoration: none; }
.pcrumb a:hover { color: var(--accent-ink); text-decoration: underline; }
.pcrumb [aria-current="page"] { color: var(--ink); font-weight: 600; }

/* ---------------------------------------------------------------------------
   10. Buttons

   One shape, four weights: primary (filled blue), secondary (white,
   bordered), ghost (no chrome until hovered) and the semantic set, which
   says what will happen and therefore does not take the accent.
   ------------------------------------------------------------------------ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 17px;
  border: 1px solid transparent;
  border-radius: var(--r1);
  background: var(--accent);
  color: var(--accent-on);
  font: 600 14px/1.25 var(--ui);
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: background .14s ease, border-color .14s ease, color .14s ease;
}
.btn:hover { background: var(--accent-deep); color: var(--accent-on); }
.btn > svg { flex: 0 0 auto; }
.btn[disabled], .btn[aria-disabled="true"] {
  background: var(--line);
  color: var(--faint);
  cursor: default;
  box-shadow: none;
}

/* Secondary: the page's other actions. White, bordered, quiet. */
.btn--ghost {
  background: var(--surface);
  border-color: var(--line);
  color: var(--ink);
}
.btn--ghost:hover {
  background: var(--accent-tint);
  border-color: var(--accent-edge);
  color: var(--accent-deep);
}

.btn--sm { padding: 7px 12px; font-size: 13px; border-radius: 9px; }
.btn--block { display: flex; width: 100%; }

/* Semantic buttons. These say what will happen, so they do not take the
   accent — a reader should not have to read the label to know that one of
   two adjacent buttons destroys something. */
.btn--green  { background: var(--d-green);  color: #FFFFFF; }
.btn--green:hover  { background: #0E8B59; }
.btn--red    { background: var(--d-red);    color: #FFFFFF; }
.btn--red:hover    { background: #CE3A3F; }
.btn--orange { background: var(--d-orange); color: #4A2800; }
.btn--orange:hover { background: #E88C27; color: #4A2800; }
.btn--yellow { background: var(--d-amber);  color: #3A2A00; }
.btn--yellow:hover { background: #F0BC1A; color: #3A2A00; }
.btn--blue   { background: var(--accent);   color: #FFFFFF; }
.btn--blue:hover   { background: var(--accent-deep); }

/* On the navy rail or a navy band, where a white button is the readable one. */
.btn--on-navy {
  background: rgba(255, 255, 255, .12);
  border-color: rgba(255, 255, 255, .26);
  color: #FFFFFF;
}
.btn--on-navy:hover { background: rgba(255, 255, 255, .2); color: #FFFFFF; }

.btn-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
/* A row of block buttons fills its card. .pcard__foot is a flex row, so the
   .btn-row inside it was only as wide as its widest label and the "block"
   buttons stopped short of the card's edge (F5, 23 Oct). */
.btn-row:has(> .btn--block) { flex: 1 1 100%; width: 100%; }
.btn-row > .btn--block { justify-content: center; }

/* An icon on its own. 40px of hit area around a 20px glyph — §2.4. */
.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 40px; height: 40px;
  flex: 0 0 auto;
  border: 1px solid transparent;
  border-radius: var(--r1);
  background: none;
  color: var(--muted);
}
.icon-btn:hover { background: var(--sunk); border-color: var(--line); color: var(--ink); }

/* Row actions.

   PERMANENT, as of this rebuild. They used to appear on hover and on focus,
   which is elegant on a desktop and invisible on the tablet a centre owner
   actually marks attendance on — there is no hover there, so the column
   read as empty. The client's reference screens show them on. They are
   quiet instead: faint until the row is wanted, never absent. */
.acts { display: inline-flex; align-items: center; gap: 2px; }

/* .acts also lands on a <th> and a <td> as the actions COLUMN — the Blade
   writes class="acts" on both the group and the cell. A table cell that is
   told to be inline-flex leaves the table's layout and takes the column
   width with it, so the cell form is restored to a cell here. */
th.acts, td.acts {
  display: table-cell;
  width: 1%;
  white-space: nowrap;
  text-align: right;
}

.ract {
  display: inline-grid;
  place-items: center;
  width: 32px; height: 32px;
  border-radius: 9px;
  color: var(--faint);
  transition: background .14s ease, color .14s ease;
}
.ract:hover { background: var(--accent-tint); color: var(--accent); }
.ract--danger:hover { background: var(--c-red-t); color: var(--c-red); }

/* .acts__row is the SPAN that wraps the buttons inside the cell — all 34
   uses in the Blade are spans, none is a cell. It was given `width: 1%` on
   the assumption it was the column, which squeezed it to two pixels and let
   its buttons hang out of the page: 102px of sideways scroll on the content
   master, invisible on a desktop. The column is `.acts` on the th and td,
   handled above. */
.acts__row {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  white-space: nowrap;
}
.ptable tr:hover .ract { color: var(--muted); }
.ptable tr:hover .ract:hover { color: var(--accent); }

/* Compact row actions (client, 26 Oct 2026: "action buttons take too much
   space"). In a table the buttons are 28px with 16px icons and no gap, and
   their cell keeps only a little air — three actions went from ~130px of
   column to ~96px on every register. */
.ptable .ract { width: 28px; height: 28px; border-radius: 8px; }
.ptable .ract svg { width: 16px; height: 16px; }
.ptable .acts__row { gap: 0; }
.ptable thead th.acts, .ptable tbody td.acts,
.ptable thead th.acts:last-child, .ptable tbody td.acts:last-child { padding-inline: 6px; }

/* ---------------------------------------------------------------------------
   11. The card

   White, 16px, a hairline and one soft shadow. The 21 October card wore a
   3px colour spine at its top edge; this one does not — with a dozen cards
   on an admin screen the spines read as a barcode, and the brief's
   reference cards are plain.

   The head carries a tinted rounded-square icon, the title, and the
   overflow link at the far end ("View All" in the reference).
   ------------------------------------------------------------------------ */
.pcard {
  display: flex;
  flex-direction: column;
  min-width: 0;                      /* §32 — load-bearing in a grid      */
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r3);
  box-shadow: var(--sh-card);
}

.pcard__head {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 15px 17px;
  border-bottom: 1px solid var(--line-soft);
}
.pcard__head h2,
.pcard__head h3 {
  flex: 1 1 auto;
  min-width: 0;
  font: 600 15.5px/1.3 var(--display);
  letter-spacing: -.012em;
  color: var(--ink);
}
.pcard__head p {
  flex-basis: 100%;
  order: 9;
  font: 400 12.5px/1.45 var(--ui);
  color: var(--muted);
}

.pcard__tools {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 8px;
  font: 500 13px/1.3 var(--ui);
}
.pcard__tools a { color: var(--accent-ink); text-decoration: none; font-weight: 600; }
.pcard__tools a:hover { text-decoration: underline; }

/* The tinted square against a card heading. Thirty-two pixels of colour in
   the one place a card can carry colour without becoming a coloured card. */
.pcard__ico {
  display: grid;
  place-items: center;
  width: 34px; height: 34px;
  flex: 0 0 auto;
  border-radius: var(--r1);
  background: var(--accent-tint);
  color: var(--accent);
}

.pcard__body { padding: 17px; flex: 1 1 auto; min-width: 0; }
.pcard__body > * + * { margin-top: 14px; }

.pcard__foot {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 13px 17px;
  border-top: 1px solid var(--line-soft);
  background: var(--sunk);
  border-radius: 0 0 var(--r3) var(--r3);
  font: 400 13px/1.4 var(--ui);
  color: var(--muted);
}

/* A table fills its card edge to edge, so the body padding gets out of its
   way when the body is nothing but the table. */
.pcard__body > .ptable__scroll:only-child,
.pcard__body > .ptable:only-child { margin: -17px; width: calc(100% + 34px); }

/* ---------------------------------------------------------------------------
   12. Grids
   ------------------------------------------------------------------------ */
.grid { display: grid; gap: var(--gap); min-width: 0; }
.grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid--top { align-items: start; }

.wrap { max-width: var(--wrap); margin-inline: auto; }

/* ---------------------------------------------------------------------------
   13. The metric tile

   REBUILT. A pastel card, filled edge to edge in the metric's own tint,
   laid out horizontally: a round icon chip at the left, then the label over
   the figure. The 21 October tile was vertical, with a white icon plate and
   a colour spine on a white ground.

   This is the brief's §3 "colourful pastel backgrounds for dashboard
   statistics" and the reference screens' stat row.
   ------------------------------------------------------------------------ */
.kpi {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 14px;
  min-width: 0;
  padding: 16px;
  border: 1px solid var(--c-slate-e);
  border-radius: var(--r3);
  background: var(--c-slate-t);
  text-decoration: none;
  transition: transform .14s ease, box-shadow .14s ease;
}
a.kpi:hover { transform: translateY(-2px); box-shadow: var(--sh-lift); }

.kpi__ico {
  display: grid;
  place-items: center;
  width: 52px; height: 52px;
  flex: 0 0 auto;
  border-radius: var(--rp);
  background: rgba(255, 255, 255, .72);
  color: var(--c-slate);
}

.kpi__top { min-width: 0; display: grid; gap: 3px; }

.kpi__label {
  font: 600 12.5px/1.3 var(--ui);
  color: var(--c-slate);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* The figure is the tile, but a tile is a glance and not a headline — it is
   capped at 30px however wide the screen gets. */
.kpi__num {
  font: 700 clamp(24px, 2.4vw, 30px)/1.1 var(--display);
  font-variant-numeric: tabular-nums;
  letter-spacing: -.03em;
  color: var(--ink);
}

.kpi__foot {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  font: 400 12px/1.35 var(--ui);
  color: var(--c-slate);
}

.kpi__delta {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font: 600 12px/1.3 var(--ui);
  font-variant-numeric: tabular-nums;
}
.kpi__delta--up   { color: var(--c-green); }
.kpi__delta--down { color: var(--c-red); }

/* Colour by WHAT IT COUNTS, never by position. There is no ".kpi--third" in
   this file, so a colour cannot drift when a tile is inserted. */
.kpi--students     { background: var(--c-blue-t);   border-color: var(--c-blue-e); }
.kpi--students     .kpi__ico, .kpi--students .kpi__label, .kpi--students .kpi__foot { color: var(--c-blue); }
.kpi--batches      { background: var(--c-green-t);  border-color: var(--c-green-e); }
.kpi--batches      .kpi__ico, .kpi--batches .kpi__label, .kpi--batches .kpi__foot { color: var(--c-green); }
.kpi--fees         { background: var(--c-amber-t);  border-color: var(--c-amber-e); }
.kpi--fees         .kpi__ico, .kpi--fees .kpi__label, .kpi--fees .kpi__foot { color: var(--c-amber); }
.kpi--staff        { background: var(--c-orange-t); border-color: var(--c-orange-e); }
.kpi--staff        .kpi__ico, .kpi--staff .kpi__label, .kpi--staff .kpi__foot { color: var(--c-orange); }
.kpi--certificates { background: var(--c-violet-t); border-color: var(--c-violet-e); }
.kpi--certificates .kpi__ico, .kpi--certificates .kpi__label, .kpi--certificates .kpi__foot { color: var(--c-violet); }
.kpi--attendance   { background: var(--c-teal-t);   border-color: var(--c-teal-e); }
.kpi--attendance   .kpi__ico, .kpi--attendance .kpi__label, .kpi--attendance .kpi__foot { color: var(--c-teal); }
.kpi--orders       { background: var(--c-pink-t);   border-color: var(--c-pink-e); }
.kpi--orders       .kpi__ico, .kpi--orders .kpi__label, .kpi--orders .kpi__foot { color: var(--c-pink); }

/* Sheets solved and accuracy are two facts about practice and they are not
   the same fact, so they are not the same colour. */
.kpi--practice     { background: var(--c-violet-t); border-color: var(--c-violet-e); }
.kpi--practice     .kpi__ico, .kpi--practice .kpi__label, .kpi--practice .kpi__foot { color: var(--c-violet); }
.kpi--accuracy     { background: var(--c-teal-t);   border-color: var(--c-teal-e); }
.kpi--accuracy     .kpi__ico, .kpi--accuracy .kpi__label, .kpi--accuracy .kpi__foot { color: var(--c-teal); }

/* Admin counts different things from a centre, so it has its own roles. */
.kpi--centres      { background: var(--c-blue-t);   border-color: var(--c-blue-e); }
.kpi--centres      .kpi__ico, .kpi--centres .kpi__label, .kpi--centres .kpi__foot { color: var(--c-blue); }
.kpi--leads        { background: var(--c-violet-t); border-color: var(--c-violet-e); }
.kpi--leads        .kpi__ico, .kpi--leads .kpi__label, .kpi--leads .kpi__foot { color: var(--c-violet); }
.kpi--tickets      { background: var(--c-orange-t); border-color: var(--c-orange-e); }
.kpi--tickets      .kpi__ico, .kpi--tickets .kpi__label, .kpi--tickets .kpi__foot { color: var(--c-orange); }
.kpi--attention    { background: var(--c-red-t);    border-color: var(--c-red-e); }
.kpi--attention    .kpi__ico, .kpi--attention .kpi__label, .kpi--attention .kpi__foot { color: var(--c-red); }

/* The three that genuinely are a verdict rather than a subject. */
.kpi--good { background: var(--c-green-t); border-color: var(--c-green-e); }
.kpi--good .kpi__ico, .kpi--good .kpi__label, .kpi--good .kpi__foot { color: var(--c-green); }
.kpi--warn { background: var(--c-amber-t); border-color: var(--c-amber-e); }
.kpi--warn .kpi__ico, .kpi--warn .kpi__label, .kpi--warn .kpi__foot { color: var(--c-amber); }
.kpi--bad  { background: var(--c-red-t);   border-color: var(--c-red-e); }
.kpi--bad  .kpi__ico, .kpi--bad .kpi__label, .kpi--bad .kpi__foot { color: var(--c-red); }

/* --- aliases and the icon-plate form ------------------------------------
   .kpi--revenue is the same role as .kpi--fees — money the centre has taken
   in. Both names are in the Blade and renaming one would mean editing a
   data binding to move a colour, so both are painted.

   And a .pcard__ico can CARRY a role class (<span class="pcard__ico
   kpi--revenue">). There the element is both things at once, so the
   descendant rules above never fire: these set the plate itself. */
.kpi--revenue { background: var(--c-amber-t); border-color: var(--c-amber-e); }
.kpi--revenue .kpi__ico, .kpi--revenue .kpi__label, .kpi--revenue .kpi__foot { color: var(--c-amber); }

.pcard__ico.kpi--students, .pcard__ico.kpi--centres     { background: var(--c-blue-t);   color: var(--c-blue); }
.pcard__ico.kpi--batches                                { background: var(--c-green-t);  color: var(--c-green); }
.pcard__ico.kpi--fees, .pcard__ico.kpi--revenue         { background: var(--c-amber-t);  color: var(--c-amber); }
.pcard__ico.kpi--staff, .pcard__ico.kpi--tickets        { background: var(--c-orange-t); color: var(--c-orange); }
.pcard__ico.kpi--certificates, .pcard__ico.kpi--leads,
.pcard__ico.kpi--practice                               { background: var(--c-violet-t); color: var(--c-violet); }
.pcard__ico.kpi--attendance, .pcard__ico.kpi--accuracy  { background: var(--c-teal-t);   color: var(--c-teal); }
.pcard__ico.kpi--orders                                 { background: var(--c-pink-t);   color: var(--c-pink); }
.pcard__ico.kpi--good                                   { background: var(--c-green-t);  color: var(--c-green); }
.pcard__ico.kpi--warn                                   { background: var(--c-amber-t);  color: var(--c-amber); }
.pcard__ico.kpi--bad, .pcard__ico.kpi--attention        { background: var(--c-red-t);    color: var(--c-red); }

/* The same colour roles, for anything that is not a tile: a card's icon, a
   bar's fill, a legend dot. One name, one hue, everywhere. */
.m--students     { --m: var(--c-blue);   --m-t: var(--c-blue-t);   --m-e: var(--c-blue-e);   --m-d: var(--d-blue); }
.m--batches      { --m: var(--c-green);  --m-t: var(--c-green-t);  --m-e: var(--c-green-e);  --m-d: var(--d-green); }
.m--revenue      { --m: var(--c-amber);  --m-t: var(--c-amber-t);  --m-e: var(--c-amber-e);  --m-d: var(--d-amber); }
.m--staff        { --m: var(--c-orange); --m-t: var(--c-orange-t); --m-e: var(--c-orange-e); --m-d: var(--d-orange); }
.m--certificates { --m: var(--c-violet); --m-t: var(--c-violet-t); --m-e: var(--c-violet-e); --m-d: var(--d-violet); }
.m--attendance   { --m: var(--c-teal);   --m-t: var(--c-teal-t);   --m-e: var(--c-teal-e);   --m-d: var(--d-teal); }
.m--orders       { --m: var(--c-pink);   --m-t: var(--c-pink-t);   --m-e: var(--c-pink-e);   --m-d: var(--d-pink); }
.m--support      { --m: var(--c-slate);  --m-t: var(--c-slate-t);  --m-e: var(--c-slate-e);  --m-d: var(--d-slate); }

.m--students .pcard__ico, .m--batches .pcard__ico, .m--revenue .pcard__ico,
.m--staff .pcard__ico, .m--certificates .pcard__ico, .m--attendance .pcard__ico,
.m--orders .pcard__ico, .m--support .pcard__ico {
  background: var(--m-t);
  color: var(--m);
}

/* ---------------------------------------------------------------------------
   14. Page heads and tool bars

   A .phead names a block and carries the buttons that act on it. It is not
   the page title — that is in the bar — it is the heading above a table, a
   grid of cards or a section of a long screen.
   ------------------------------------------------------------------------ */
.phead {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px 16px;
}
.phead__text { min-width: 0; display: grid; gap: 3px; }
.phead__text h2 {
  font: 700 clamp(17px, 1.8vw, 20px)/1.25 var(--display);
  letter-spacing: -.02em;
  color: var(--ink);
}
.phead__text p { font: 400 13.5px/1.45 var(--ui); color: var(--muted); }
.phead__actions { flex: 0 0 auto; display: flex; align-items: center; flex-wrap: wrap; gap: 10px; }

/* A standfirst under a page heading. */
.ppri { font: 400 14px/1.55 var(--ui); color: var(--muted); max-width: 72ch; }

/* The tool bar above a table: a search field that grows, then the filters,
   then the exports. It is a white card of its own in this design, matching
   the reference screens, rather than a bare row on the ground. */
.ptools {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  padding: 13px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r3);
  box-shadow: var(--sh-card);
}
.ptools__grow { flex: 1 1 260px; min-width: 0; }

/* A .select is width:100% by default, which is right in a form grid and
   wrong in a tool bar: with no flex-basis of its own each filter claimed
   the whole row and the bar became a stack of four. In the bar they size
   to their content and share what is left. */
.ptools > .select,
.ptools > .input:not(.ptools__grow .input) { flex: 0 1 auto; width: auto; min-width: 140px; }
.ptools > .btn, .ptools > .btn-row { flex: 0 0 auto; }
/* A button in a toolbar or picker row stands beside 44px boxes, so it is
   44px too — a 33px "Export CSV" next to a row of filters reads as a
   different row (sweep of every form, 23 Oct). Bottom-aligned so a button
   beside a labelled field lines up with the box, not the label. */
:is(.ptools, .mswitch) > .btn, .mswitch ~ .btn { min-height: 44px; align-self: flex-end; }
.ptools > .btn-row { margin-left: auto; }

/* A card that is nothing but a table puts its tool bar inside, where it
   reads as the table's own controls and not as a separate block. */
.pcard > .ptools {
  border: 0;
  border-bottom: 1px solid var(--line-soft);
  border-radius: var(--r3) var(--r3) 0 0;
  box-shadow: none;
  padding: 13px 17px;
}

/* A search field: the glyph sits INSIDE the box, so the box is the whole
   control and the glyph is not a separate thing to aim at. */
.pfind { position: relative; display: flex; align-items: center; }
.pfind > svg {
  position: absolute;
  left: 12px;
  color: var(--faint);
  pointer-events: none;
}
.pfind .input { padding-left: 40px; }

/* The bulk bar above a selectable table: how many are picked, and what can
   be done to them. */
.pbulk {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px 14px;
  padding: 11px 15px;
  border: 1px solid var(--accent-edge);
  border-radius: var(--r2);
  background: var(--accent-tint);
  font: 500 13.5px/1.4 var(--ui);
  color: var(--accent-deep);
}
.pbulk__acts { margin-left: auto; display: flex; flex-wrap: wrap; gap: 8px; }

/* The checkbox column at the head of a selectable table. */
.check-row { width: 1%; }

/* ---------------------------------------------------------------------------
   15. Tables

   No outer box: the card is the box. The head is a light blue band in small
   caps, rows are separated by hairlines only, the identity cell carries a
   round avatar, and a figure column is tabular and right-aligned.
   ------------------------------------------------------------------------ */

/* position: relative is load-bearing, not decoration.

   Every cell of a wide table carries a .sr-only, and .sr-only is
   position:absolute. Without a positioned ancestor those resolve against
   .pcard, which puts them OUTSIDE this scrolling box — so they dodge its
   clipping and stretch the document to the table's full width. The month
   view had 336px of empty horizontal page scroll on a phone because of it. */
.ptable__scroll {
  position: relative;
  min-width: 0;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  -webkit-overflow-scrolling: touch;
}

.ptable {
  width: 100%;
  border-collapse: collapse;
  font: 400 14px/1.45 var(--ui);
}

.ptable thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  padding: 11px 14px;
  background: var(--sunk);
  border-bottom: 1px solid var(--line);
  font: 600 11px/1.3 var(--ui);
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--muted);
  text-align: left;
  white-space: nowrap;
}

.ptable tbody td {
  padding: var(--row-y) 14px;
  border-bottom: 1px solid var(--line-soft);
  color: var(--body);
  vertical-align: middle;
}
.ptable tbody tr:last-child td { border-bottom: 0; }
.ptable tbody tr { transition: background .12s ease; }
.ptable tbody tr:hover { background: var(--accent-tint); }

.ptable td b, .ptable td strong { color: var(--ink); font-weight: 600; }

/* Figures line up. A column of rupees that shimmers as it is read is a
   column that gets re-read. */
.ptable td.num, .ptable th.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

/* A sortable column header is a button and has to look like the header it
   replaces, not like a button sitting in one. */
.ptable thead th button,
.ptable thead th a {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font: inherit;
  letter-spacing: inherit;
  text-transform: inherit;
  color: inherit;
  text-decoration: none;
}
.ptable thead th button:hover,
.ptable thead th a:hover { color: var(--accent-ink); }
.ptable thead th svg { color: var(--faint); }

/* A second line inside a cell — a renewal date under a centre name, a code
   under a title. */
.ptable td span.t-fine,
.ptable td small {
  display: block;
  margin-top: 2px;
  font: 400 12.5px/1.35 var(--ui);
  color: var(--muted);
}

/* A row the data itself has flagged: a spine at the left edge, because the
   row's own cells are already carrying their own colours. */
.ptable tbody tr.is-flagged td:first-child,
.ptable tbody tr[data-flag] td:first-child {
  box-shadow: inset 3px 0 0 var(--d-amber);
}

/* The identity cell: a round avatar and a name, which is how every
   reference screen opens a row. */
.ptable__who {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 11px;
  min-width: 0;
}
.ptable__who-text { min-width: 0; display: grid; }
.ptable__who-text b {
  font: 600 14px/1.3 var(--ui);
  color: var(--ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ptable__who-text span {
  font: 400 12.5px/1.35 var(--ui);
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ptable--slim tbody td { padding-top: 9px; padding-bottom: 9px; }
.ptable--wide { min-width: 860px; }

/* A table that IS the whole card keeps the card's bottom corners. */
.pcard > .ptable__scroll:last-child,
.pcard > .ptable__scroll:last-child .ptable tbody tr:last-child td:first-child { border-bottom-left-radius: var(--r3); }
.pcard > .ptable__scroll:last-child .ptable tbody tr:last-child td:last-child { border-bottom-right-radius: var(--r3); }

/* ---------------------------------------------------------------------------
   16. Pagination

   REBUILT: a per-page control at the left, the range in the middle, and
   numbered pages at the right with the current one a solid blue square.
   It used to be a count and two arrows.
   ------------------------------------------------------------------------ */
.ppage {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px 16px;
  padding: 13px 17px;
  border-top: 1px solid var(--line-soft);
}
.pcard > .ppage:last-child { border-radius: 0 0 var(--r3) var(--r3); }

.ppage__count {
  font: 400 13px/1.4 var(--ui);
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

/* "Show [10] per page" — a label, a small select, a word. */
.ppage__per {
  display: flex;
  align-items: center;
  gap: 8px;
  font: 400 13px/1.4 var(--ui);
  color: var(--muted);
}
.ppage__per .select { width: auto; min-width: 72px; }

.ppage__nav { display: flex; align-items: center; gap: 4px; }
.ppage__nav a,
.ppage__nav span {
  display: grid;
  place-items: center;
  min-width: 34px; height: 34px;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface);
  color: var(--body);
  font: 600 13.5px/1 var(--ui);
  font-variant-numeric: tabular-nums;
  text-decoration: none;
}
.ppage__nav a:hover {
  border-color: var(--accent-edge);
  background: var(--accent-tint);
  color: var(--accent-deep);
}
.ppage__nav a[aria-current="page"] {
  background: var(--accent);
  border-color: var(--accent);
  color: #FFFFFF;
  box-shadow: var(--sh-blue);
}
.ppage__nav [aria-disabled="true"] { color: var(--faint); background: var(--sunk); }
/* The ellipsis between page runs is not a control. */
.ppage__nav > span:not([aria-disabled]) { border: 0; background: none; color: var(--faint); min-width: 20px; }

/* ---------------------------------------------------------------------------
   17. Status chips

   A soft pastel pill with a dot and text in the role's own text-safe ink.
   Colour is NEVER the only signal — the chip always carries the word.
   ------------------------------------------------------------------------ */
.st {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 11px 4px 9px;
  border-radius: var(--rp);
  background: var(--c-slate-t);
  color: var(--c-slate);
  font: 600 12.5px/1.45 var(--ui);
  white-space: nowrap;
}
.st::before {
  content: "";
  width: 7px; height: 7px;
  flex: 0 0 auto;
  border-radius: var(--rp);
  background: currentColor;
}
/* Many chips in the Blade already carry a glyph of their own. A dot AND a
   tick is two marks saying one thing, so the dot stands down wherever the
   chip brought its own. */
.st:has(> svg)::before { display: none; }
.st > svg { flex: 0 0 auto; }

/* Brief §3: green for paid/active/present/success, red or pink for
   unpaid/overdue/absent/inactive, yellow or orange for pending/late/warning,
   blue for upcoming, purple and cyan for secondary modules. */
.st--good,
.st--active   { background: var(--c-green-t);  color: var(--c-green); }
.st--bad,
.st--rejected { background: var(--c-red-t);    color: var(--c-red); }
.st--warn,
.st--pending  { background: var(--c-amber-t);  color: var(--c-amber); }
.st--info     { background: var(--c-blue-t);   color: var(--c-blue); }
.st--muted    { background: var(--c-slate-t);  color: var(--c-slate); }
.st--locked   { background: var(--c-slate-t);  color: var(--c-slate); }
.st--locked::before { display: none; }

/* A level IS a category, so its chip is tinted from its own level colour —
   and takes the TEXT-SAFE ink of that hue, not the drawn one, because a
   chip carries words. */
.st--lv1 { background: var(--c-blue-t);   color: var(--c-blue); }
.st--lv2 { background: var(--c-green-t);  color: var(--c-green); }
.st--lv3 { background: var(--c-amber-t);  color: var(--c-amber); }
.st--lv4 { background: var(--c-violet-t); color: var(--c-violet); }
.st--lv5 { background: var(--c-pink-t);   color: var(--c-pink); }
.st--lv6 { background: var(--c-teal-t);   color: var(--c-teal); }
.st--lv7 { background: var(--c-orange-t); color: var(--c-orange); }
.st--lv8 { background: var(--c-slate-t);  color: var(--c-slate); }

/* ---------------------------------------------------------------------------
   18. Forms

   Labels above the control in small caps, 44px controls, and a focus ring
   that does not move anything — a border swap on focus shifts the layout by
   a pixel and the whole row twitches.
   ------------------------------------------------------------------------ */
.form-grid { display: grid; gap: 16px; }
.form-grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }

.field { display: grid; gap: 6px; min-width: 0; }
/* In a row, a field without a hint is as tall as its neighbour with one, and
   grid stretched its box to fill the difference (F5's Full name, 23 Oct). A
   column instead, with the hint moved UNDER the box: every box then sits
   straight below its label, and the boxes in a row line up because the labels
   do. (Pushing the box down to its neighbour's left a gap under the label.) */
.form-grid > .field { display: flex; flex-direction: column; }
.form-grid > .field > .field__hint { order: 1; }

.field__label {
  font: 600 11.5px/1.3 var(--ui);
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--muted);
}
.field__label--lock { display: flex; align-items: center; gap: 6px; }
.field__label--lock svg { color: var(--faint); }

.field__hint { font: 400 12.5px/1.45 var(--ui); color: var(--muted); }

.input, .select, .textarea {
  width: 100%;
  min-width: 0;
  padding: 11px 13px;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: var(--r1);
  background: var(--surface);
  color: var(--ink);
  font: 400 14.5px/1.4 var(--ui);
  transition: border-color .14s ease, box-shadow .14s ease;
}
.input::placeholder, .textarea::placeholder { color: var(--faint); }
.input:hover, .select:hover, .textarea:hover { border-color: var(--accent-edge); }

.input:focus, .select:focus, .textarea:focus {
  outline: 0;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-tint);
}
.input[disabled], .select[disabled], .textarea[disabled] {
  background: var(--sunk);
  color: var(--muted);
  cursor: default;
}
.textarea { min-height: 108px; resize: vertical; line-height: 1.55; }

/* The chevron is drawn here rather than left to the platform, because a
   native select arrow is a different shape in every browser and this one
   has to match the chevrons in the bar. */
/* The chevron is drawn here rather than left to the platform, because a
   native select arrow is a different shape in every browser and this one has
   to match the chevrons in the top bar.

   It is an inline SVG data URI, NOT the two-linear-gradient trick that draws
   the same shape. Standards §7.1 bans gradient surfaces outright and
   test_gradients_on_a_panel_are_the_students_alone enforces it by searching
   the file for the word — a chevron made of gradients is not a gradient
   surface, but a ban you argue your way around once stops being a ban. */
.select {
  appearance: none;
  padding-right: 38px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8' fill='none' stroke='%2364748B' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M1 1.5 6 6.5l5-5'/%3E%3C/svg%3E");
  background-position: calc(100% - 13px) 50%;
  background-size: 12px 8px;
  background-repeat: no-repeat;
  cursor: pointer;
}
.select--sm { min-height: 38px; padding-top: 7px; padding-bottom: 7px; font-size: 13.5px; }

/* Checks and radios. accent-color keeps the native control — which stays
   accessible, keyboard-operable and familiar — and only recolours it.

   `.check` is the LABEL, not the box: 48 of its 51 uses in the Blade are
   <label class="check"><input><span>…</span></label>. Sizing the class
   itself to 19px square collapsed every one of those labels, which is what
   put the form builder's "Required" text outside the page. The three bare
   <input class="check"> uses are covered separately below. */
.check {
  display: inline-flex;
  align-items: flex-start;
  gap: 9px;
  min-height: 24px;
  cursor: pointer;
  font: 400 14.5px/1.5 var(--ui);
  color: var(--body);
}
.check > span { min-width: 0; }

.check input,
input.check,
.radio-row input {
  width: 19px; height: 19px;
  margin: 1px 0 0;
  flex: 0 0 auto;
  accent-color: var(--accent);
  cursor: pointer;
}

/* The containers that lay several of them out. They WRAP — seven day-of-week
   checkboxes do not fit across a phone. */
.check-row, .radio-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px 20px;
  font: 400 14px/1.4 var(--ui);
}

/* …except as a table's select-all column, where it is a cell. */
th.check-row, td.check-row { display: table-cell; width: 1%; }

/* A switch. */
.pswitch { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; }
.pswitch input { position: absolute; opacity: 0; width: 0; height: 0; }
.pswitch__track {
  position: relative;
  width: 44px; height: 25px;
  flex: 0 0 auto;
  border-radius: var(--rp);
  background: var(--line);
  transition: background .16s ease;
}
.pswitch__track::after {
  content: "";
  position: absolute;
  top: 3px; left: 3px;
  width: 19px; height: 19px;
  border-radius: var(--rp);
  background: #FFFFFF;
  box-shadow: var(--sh-rest);
  transition: transform .16s ease;
}
.pswitch input:checked + .pswitch__track { background: var(--d-green); }
.pswitch input:checked + .pswitch__track::after { transform: translateX(19px); }
.pswitch input:focus-visible + .pswitch__track { outline: 3px solid var(--focus); outline-offset: 2px; }
.pswitch__label { font: 500 14px/1.4 var(--ui); color: var(--ink); }

/* A file drop zone. */
.file-drop {
  display: grid;
  place-items: center;
  gap: 8px;
  padding: 24px 18px;
  border: 1.5px dashed var(--accent-edge);
  border-radius: var(--r2);
  background: var(--accent-tint);
  text-align: center;
  font: 400 13.5px/1.5 var(--ui);
  color: var(--muted);
}
/* The whole zone is the <label>, so a click anywhere opens the picker and the
   browser's own "Choose File / No file chosen" is a second button saying the
   same thing. It stays in the form, focusable, just not drawn. */
.file-drop { position: relative; }
.file-drop input[type="file"] {
  position: absolute; inset: 0;
  opacity: 0; cursor: pointer;
}
.file-drop:focus-within { outline: 3px solid var(--focus); outline-offset: 2px; }
.file-drop__btn {
  padding: 8px 15px;
  border: 1px solid var(--line);
  border-radius: var(--r1);
  background: var(--surface);
  font: 600 13.5px/1.25 var(--ui);
  color: var(--accent-ink);
}

/* ---------------------------------------------------------------------------
   19. Tabs and toggles
   ------------------------------------------------------------------------ */

/* An underline, broken by the current tab. */
.ptabs {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
  border-bottom: 1px solid var(--line);
}
.ptabs a, .ptabs button {
  padding: 11px 14px;
  margin-bottom: -1px;
  border-bottom: 2.5px solid transparent;
  font: 600 14px/1.3 var(--ui);
  color: var(--muted);
  text-decoration: none;
  white-space: nowrap;
}
.ptabs a:hover, .ptabs button:hover { color: var(--ink); }
.ptabs [aria-current="page"],
.ptabs [aria-selected="true"] {
  border-bottom-color: var(--accent);
  color: var(--accent-deep);
}

/* A segmented control, where two or three views swap in place. */
.ptoggle {
  display: inline-flex;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: var(--r1);
  background: var(--sunk);
}
.ptoggle a, .ptoggle button {
  padding: 7px 14px;
  border-radius: 7px;
  font: 600 13.5px/1.3 var(--ui);
  color: var(--muted);
  text-decoration: none;
  white-space: nowrap;
}
.ptoggle [aria-current="page"],
.ptoggle [aria-selected="true"],
.ptoggle .is-on {
  background: var(--surface);
  color: var(--accent-deep);
  box-shadow: var(--sh-rest);
}

/* ---------------------------------------------------------------------------
   20. Notes — a sentence the screen needs to say

   Four moods, each a tint and an ink. The glyph is in a plate so the text
   block starts at one left edge whatever the glyph's shape.
   ------------------------------------------------------------------------ */
.pnote {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: start;
  gap: 13px;
  padding: 15px 17px;
  border: 1px solid var(--c-blue-e);
  border-left-width: 4px;
  border-radius: var(--r2);
  background: var(--c-blue-t);
}
.pnote b {
  display: block;
  font: 600 14.5px/1.4 var(--ui);
  color: var(--ink);
}
.pnote p {
  margin-top: 3px;
  font: 400 13.5px/1.5 var(--ui);
  color: var(--body);
}
.pnote__ico {
  display: grid;
  place-items: center;
  width: 36px; height: 36px;
  flex: 0 0 auto;
  border-radius: var(--r1);
  background: rgba(255, 255, 255, .7);
  color: var(--c-blue);
}
.pnote__act {
  grid-column: 2;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 11px;
}

.pnote--info { border-color: var(--c-blue-e);   background: var(--c-blue-t); }
.pnote--info .pnote__ico { color: var(--c-blue); }
.pnote--good { border-color: var(--c-green-e);  background: var(--c-green-t); }
.pnote--good .pnote__ico { color: var(--c-green); }
.pnote--warn { border-color: var(--c-amber-e);  background: var(--c-amber-t); }
.pnote--warn .pnote__ico { color: var(--c-amber); }
.pnote--bad  { border-color: var(--c-red-e);    background: var(--c-red-t); }
.pnote--bad  .pnote__ico { color: var(--c-red); }

/* A quieter aside inside a card. */
.note {
  padding: 12px 14px;
  border-radius: var(--r2);
  background: var(--sunk);
  font: 400 13px/1.5 var(--ui);
  color: var(--muted);
}
.note--yellow { background: var(--c-amber-t); color: var(--c-amber); }
.note--red    { background: var(--c-red-t);   color: var(--c-red); }
.note--red a  { color: inherit; font-weight: 600; text-decoration: underline; }
.note--green  { background: var(--c-green-t); color: var(--c-green); }

/* ---------------------------------------------------------------------------
   21. The welcome band

   A tinted band across the top of a dashboard: a greeting, a line of
   context, and the client's own photograph at the right. Flat, not a
   gradient — standards §7.1 and the gradient test both.
   ------------------------------------------------------------------------ */
.pwelcome {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 20px;
  overflow: hidden;
  padding: 22px 24px;
  border: 1px solid var(--c-amber-e);
  border-radius: var(--r3);
  background: var(--c-amber-t);
}
.pwelcome__text { min-width: 0; }
.pwelcome__text h2 {
  font: 700 clamp(21px, 2.4vw, 27px)/1.2 var(--display);
  letter-spacing: -.025em;
  color: var(--ink);
}
.pwelcome__text p {
  margin-top: 6px;
  max-width: 64ch;
  font: 400 14px/1.55 var(--ui);
  color: var(--body);
}

/* The artwork is the <img> itself and the client's photographs are tall, so
   it is cropped to a band rather than scaled to fit — scaled, a 327x496
   portrait sets the height of the whole greeting. */
.pwelcome__art {
  flex: 0 0 auto;
  width: 168px;
  height: 118px;
  object-fit: cover;
  object-position: 50% 28%;
  border-radius: var(--r2);
}

/* ---------------------------------------------------------------------------
   22. Quick actions — brief §4C, and the reference attendance screen

   NEW. A pastel tile that is a LINK, not a statistic: an icon plate, a
   headline and a line saying what it does. Four of them sit in a 2x2.
   ------------------------------------------------------------------------ */
.pquick { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 11px; }

.pquick__item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  padding: 13px;
  border: 1px solid var(--c-blue-e);
  border-radius: var(--r2);
  background: var(--c-blue-t);
  text-decoration: none;
  transition: transform .14s ease, box-shadow .14s ease;
}
.pquick__item:hover { transform: translateY(-2px); box-shadow: var(--sh-lift); }
.pquick__ico {
  display: grid;
  place-items: center;
  width: 40px; height: 40px;
  flex: 0 0 auto;
  border-radius: var(--r1);
  background: rgba(255, 255, 255, .78);
  color: var(--c-blue);
}
.pquick__text { min-width: 0; display: grid; gap: 1px; }
.pquick__text b { font: 600 13.5px/1.3 var(--ui); color: var(--ink); }
.pquick__text span { font: 400 12px/1.35 var(--ui); color: var(--muted); }

.pquick__item--green  { background: var(--c-green-t);  border-color: var(--c-green-e); }
.pquick__item--green  .pquick__ico { color: var(--c-green); }
.pquick__item--amber  { background: var(--c-amber-t);  border-color: var(--c-amber-e); }
.pquick__item--amber  .pquick__ico { color: var(--c-amber); }
.pquick__item--violet { background: var(--c-violet-t); border-color: var(--c-violet-e); }
.pquick__item--violet .pquick__ico { color: var(--c-violet); }
.pquick__item--pink   { background: var(--c-pink-t);   border-color: var(--c-pink-e); }
.pquick__item--pink   .pquick__ico { color: var(--c-pink); }
.pquick__item--red    { background: var(--c-red-t);    border-color: var(--c-red-e); }
.pquick__item--red    .pquick__ico { color: var(--c-red); }

/* ---------------------------------------------------------------------------
   23. Charts

   A chart's viewBox is 660x290 and its aspect ratio is fixed, so WIDTH IS
   THE ONLY THING that decides its height. The container has to be allowed
   to shrink or one chart sets the width of everything above it (§32).
   ------------------------------------------------------------------------ */
.pchart { min-width: 0; width: 100%; }
.pchart svg { width: 100%; height: auto; }

/* Two charts side by side need more room than two cards of prose. */
.grid--charts { grid-template-columns: repeat(2, minmax(0, 1fr)); }

/* A grid, not a wrapping flex row. As a flex row the legend needed 210px of
   its own and dropped underneath the moment a card got narrower than
   ~430px, which is every card in a two-up chart row — and the card then ran
   half as tall again as the bar chart beside it, so one wrap put white
   space in both. Two tracks cannot wrap. */
.pdonut {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 18px;
  min-width: 0;
}
.pdonut__chart { flex: 0 0 auto; width: 180px; max-width: 42vw; }

.plegend { display: grid; gap: 7px; min-width: 0; }
.plegend__row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px;
  font: 400 13px/1.4 var(--ui);
}
.plegend__dot {
  width: 10px; height: 10px;
  flex: 0 0 auto;
  border-radius: var(--rp);
  background: var(--muted);
}
.plegend__name {
  min-width: 0;
  color: var(--body);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.plegend__val {
  font-weight: 600;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

/* --- progress bars -------------------------------------------------------
   An attendance percentage, a level's share, a fee collected against a
   total. The figure is always beside the bar: colour and length are not
   enough on their own (§8). */
.pbars { display: grid; gap: 13px; }

/* Placed explicitly rather than left to source order. The Blade writes a bar
   as label, track, value — and a track that spans both columns pushes the
   value onto a third row, so every figure sat UNDER its bar instead of
   beside it. Explicit areas make the three parts land correctly whatever
   order a screen writes them in. */
.pbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 4px 10px;
  min-width: 0;
}
.pbar__label { grid-column: 1; grid-row: 1; }
.pbar__value { grid-column: 2; grid-row: 1; text-align: right; }
.pbar__track { grid-row: 2; }

.pbar__label {
  min-width: 0;
  font: 500 13.5px/1.4 var(--ui);
  color: var(--body);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.pbar__value {
  font: 600 13.5px/1.4 var(--ui);
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}
/* display:block on both, and it is load-bearing. The Blade writes a bar as
   nested <span>s so one can sit inside a table cell; an inline element
   ignores height, so the fill had its width set and no height to show it
   in, and every bar on the students table read as empty. */
.pbar__track {
  display: block;
  grid-column: 1 / -1;
  height: 8px;
  border-radius: var(--rp);
  background: var(--line-soft);
  overflow: hidden;
}
.pbar__fill {
  display: block;
  height: 100%;
  border-radius: var(--rp);
  background: var(--m-d, var(--accent));
}

/* A bar that is a LEVEL takes its level's colour from the ramp. */
.pbars--lv .pbar:nth-child(1) .pbar__fill { background: var(--lv1); }
.pbars--lv .pbar:nth-child(2) .pbar__fill { background: var(--lv2); }
.pbars--lv .pbar:nth-child(3) .pbar__fill { background: var(--lv3); }
.pbars--lv .pbar:nth-child(4) .pbar__fill { background: var(--lv4); }
.pbars--lv .pbar:nth-child(5) .pbar__fill { background: var(--lv5); }
.pbars--lv .pbar:nth-child(6) .pbar__fill { background: var(--lv6); }
.pbars--lv .pbar:nth-child(7) .pbar__fill { background: var(--lv7); }
.pbars--lv .pbar:nth-child(8) .pbar__fill { background: var(--lv8); }

/* A bar inside a table cell: no label row — the track and the figure share
   one row, because a cell has no room for a caption the column already has. */
.ptable .pbar { grid-template-columns: minmax(60px, 1fr) auto; align-items: center; gap: 9px; }
.ptable .pbar__track { grid-column: 1; grid-row: 1; margin: 0; }
.ptable .pbar__value { grid-column: 2; grid-row: 1; font-size: 13px; }

/* --- the ring ------------------------------------------------------------ */
.pring { position: relative; display: inline-grid; place-items: center; flex: 0 0 auto; }
.pring__cap {
  position: absolute;
  font: 700 13px/1 var(--display);
  font-variant-numeric: tabular-nums;
  color: var(--ink);
}

/* ---------------------------------------------------------------------------
   24. Empty, not-yet, and loading states — brief §4C
   ------------------------------------------------------------------------ */
.pempty {
  display: grid;
  justify-items: center;
  gap: 9px;
  padding: 46px 24px;
  text-align: center;
}
.pempty__ico {
  display: grid;
  place-items: center;
  width: 60px; height: 60px;
  border-radius: var(--rp);
  background: var(--accent-tint);
  color: var(--accent);
  margin-bottom: 4px;
}
.pempty b { font: 600 17px/1.3 var(--display); color: var(--ink); }
.pempty p { max-width: 46ch; font: 400 14px/1.55 var(--ui); color: var(--muted); }
.pempty .btn { margin-top: 6px; }

/* Not built yet. The screen says so plainly instead of pretending.

   The glyph is pinned to column one and everything else sent to column two,
   for the same reason .plog does it: most screens pass a glyph and one
   block, but the competition screen passes five, and with auto-placement
   the third child lands back in the `auto` column — so a paragraph set the
   width of the icon's column and pushed the rest of the panel 282px to the
   right, off a 320px page. */
.psoon {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 10px 14px;
  padding: 20px;
  border: 1px dashed var(--line);
  border-radius: var(--r3);
  background: var(--surface);
}
.psoon__ico { grid-column: 1; grid-row: 1 / -1; align-self: start; }
.psoon > :not(.psoon__ico) { grid-column: 2; min-width: 0; }
.psoon__ico {
  display: grid;
  place-items: center;
  width: 42px; height: 42px;
  border-radius: var(--r1);
  background: var(--sunk);
  color: var(--muted);
}
.psoon b { display: block; font: 600 15px/1.35 var(--display); color: var(--ink); }
.psoon p { margin-top: 4px; font: 400 13.5px/1.5 var(--ui); color: var(--muted); }
.psoon__list { margin-top: 10px; display: grid; gap: 6px; }
.psoon__list li {
  display: flex;
  gap: 8px;
  font: 400 13px/1.5 var(--ui);
  color: var(--muted);
}
.psoon__list li::before { content: "—"; color: var(--faint); }

/* A loading skeleton. Flat tints, no shimmer sweep: a sweep is an animation
   and §7.2 allows micro-interaction only. */
.pskel {
  border-radius: var(--r1);
  background: var(--line-soft);
}
.pskel--line { height: 12px; }
.pskel--num  { height: 26px; width: 60%; }

/* The same three states, live (Phase 0, 30 Oct 2026): x-state.loading,
   x-state.empty and x-state.error, driven by remote() in resources/js. */
.pstate { display: grid; gap: 12px; padding: 22px 20px; }
.pstate__sr {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}
.pempty--error .pempty__ico { background: var(--c-red-t); color: var(--c-red); }
.pempty--error .btn { display: inline-flex; align-items: center; gap: 6px; }

/* ---------------------------------------------------------------------------
   25. Modals

   A centred sheet on a desktop, a bottom sheet on a phone. The body
   scrolls; the whole thing never exceeds the viewport.
   ------------------------------------------------------------------------ */
.pmodal {
  position: fixed;
  inset: 0;
  z-index: var(--z-modal);
  display: grid;
  place-items: center;
  padding: var(--gut);
  background: rgba(10, 25, 50, .5);
}
.pmodal[hidden] { display: none; }

.pmodal__box {
  display: flex;
  flex-direction: column;
  width: min(560px, 100%);
  max-height: calc(100vh - var(--gut) * 2);
  background: var(--surface);
  border-radius: var(--r4);
  box-shadow: var(--sh-pop);
  overflow: hidden;
}
.pmodal--sm .pmodal__box { width: min(420px, 100%); }
.pmodal--lg .pmodal__box { width: min(840px, 100%); }

.pmodal__head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 17px 20px;
  border-bottom: 1px solid var(--line);
}
.pmodal__head h2, .pmodal__head h3 {
  flex: 1 1 auto;
  min-width: 0;
  font: 600 17px/1.3 var(--display);
  color: var(--ink);
}
.pmodal__x { flex: 0 0 auto; }

.pmodal__body { flex: 1 1 auto; min-height: 0; overflow-y: auto; padding: 20px; }
.pmodal__body > * + * { margin-top: 14px; }

.pmodal__foot {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 10px;
  padding: 15px 20px;
  border-top: 1px solid var(--line);
  background: var(--sunk);
}

/* ---------------------------------------------------------------------------
   26. Lists that are not tables
   ------------------------------------------------------------------------ */

/* A row: an icon, a block of text, and something at the end. */
.srows { display: grid; gap: 10px; }
.srow {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 13px;
  padding: 13px 15px;
  border: 1px solid var(--line);
  border-radius: var(--r2);
  background: var(--surface);
}
.srow__ico {
  display: grid;
  place-items: center;
  width: 38px; height: 38px;
  flex: 0 0 auto;
  border-radius: var(--r1);
  background: var(--accent-tint);
  color: var(--accent);
}
.srow__ico--green  { background: var(--c-green-t); color: var(--c-green); }
.srow__ico--yellow { background: var(--c-amber-t); color: var(--c-amber); }
.srow__text { min-width: 0; }
.srow__text b { display: block; font: 600 14.5px/1.35 var(--ui); color: var(--ink); }
.srow__text p { font: 400 13px/1.45 var(--ui); color: var(--muted); }
.srow__end { flex: 0 0 auto; display: flex; align-items: center; gap: 10px; }
.srow--locked { background: var(--sunk); opacity: .75; }

/* Facts: a label and a value, repeated. The console's definition list. */
.pfacts { display: grid; gap: 1px; background: var(--line-soft); border-radius: var(--r2); overflow: hidden; }
/* The same list written as <dl><div><dt><dd>, which four screens use. It had
   no row rule at all, so it fell back to the browser's own: every label and
   value in one grey block with a 40px indent (centre settings, 23 Oct). The
   label is the TOPIC here and is set bold so a row is found by it. */
.pfacts { margin: 0; border: 1px solid var(--line-soft); }
.pfacts > div:not(.pdl) {
  display: grid;
  grid-template-columns: minmax(120px, 34%) minmax(0, 1fr);
  gap: 12px;
  padding: 11px 14px;
  background: var(--surface);
  font: 400 14px/1.5 var(--ui);
}
.pfacts > div:not(.pdl):nth-child(odd) { background: var(--sunk); }
.pfacts dt { font-weight: 600; color: var(--navy); }
.pfacts dd { margin: 0; color: var(--ink); min-width: 0; }
.pdl {
  display: grid;
  grid-template-columns: minmax(120px, 38%) minmax(0, 1fr);
  gap: 12px;
  padding: 11px 14px;
  background: var(--surface);
  font: 400 14px/1.5 var(--ui);
}
.pdl > :first-child { color: var(--muted); font-weight: 500; }
.pdl > :last-child { color: var(--ink); min-width: 0; }
/* The same thing as a whole <dl>: each <div> inside is one row, so the list
   itself stacks them and the rows take the label|value columns. Without this
   the rows paired off two to a line and the browser's 40px <dd> indent pushed
   every value inward (F6 Details, 23 Oct). */
dl.pdl { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0; padding: 0; margin: 0; }
dl.pdl > div {
  display: grid;
  grid-template-columns: minmax(110px, 38%) minmax(0, 1fr);
  gap: 12px;
  padding: 10px 0;
  border-top: 1px solid var(--line-soft);
}
dl.pdl > div:first-child { border-top: 0; padding-top: 0; }
dl.pdl > div:last-child { padding-bottom: 0; }
dl.pdl dt { color: var(--muted); font-weight: 500; }
dl.pdl dd { margin: 0; color: var(--ink); font-weight: 400; min-width: 0; }

/* A detail screen: the record at the left, its side matter at the right. */
.pdetail { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: var(--gap); align-items: start; }
.pdetail__main { min-width: 0; display: grid; gap: var(--stack); }
.pdetail__rail { min-width: 0; display: grid; gap: var(--gap); position: sticky; top: calc(var(--bar-h) + 16px); }

/* ---------------------------------------------------------------------------
   27. A timeline — an audit trail, a student's history, a ticket thread
   ------------------------------------------------------------------------ */
.plog { display: grid; gap: 0; }

/* An entry is a dot and then HOWEVER MANY blocks the screen writes — the
   audit log writes four (dot, headline, detail, time), the application
   screen five. So the dot is pinned to column one and spans the whole
   entry, and everything else is sent to column two explicitly.

   Left to auto-placement with two tracks, the third child lands back in
   column ONE — which is sized `auto`, so a paragraph of detail set the
   width of the dot's column and the page gained 77px of sideways scroll on
   a phone. It is invisible on a desktop and it broke three screens. */
.plog > li {
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 2px 13px;
  padding: 0 0 18px 0;
}
.plog__dot { grid-column: 1; grid-row: 1 / -1; }
.plog > li > :not(.plog__dot) { grid-column: 2; min-width: 0; }
/* The thread that makes a list of entries read as one sequence. */
.plog > li:not(:last-child)::before {
  content: "";
  position: absolute;
  left: 12px;          /* the plate's centre: 1px margin + 26 / 2 */
  top: 30px;           /* just under it */
  bottom: 0;
  width: 2px;
  background: var(--line);
}
/* The marker is a PLATE, not a bare dot: every screen that uses the
   timeline puts an <x-icon> inside it, and a 12px dot cannot hold one.
   align-self keeps it at the top of the entry it spans. */
.plog__dot {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  align-self: start;
  width: 26px; height: 26px;
  margin-top: 1px;
  border-radius: var(--rp);
  background: var(--c-slate-t);
  color: var(--c-slate);
  box-shadow: 0 0 0 3px var(--surface);
}
.plog__dot--good { background: var(--c-green-t); color: var(--c-green); }
.plog__dot--warn { background: var(--c-amber-t); color: var(--c-amber); }
.plog__dot--bad  { background: var(--c-red-t);   color: var(--c-red); }
.plog b { display: block; font: 600 14px/1.4 var(--ui); color: var(--ink); }
.plog p { font: 400 13px/1.5 var(--ui); color: var(--muted); }
.plog time {
  display: block;
  margin-top: 3px;
  font: 500 12px/1.4 var(--ui);
  color: var(--faint);
}

.pthread { display: grid; gap: 14px; }
.pmsg {
  display: grid;
  gap: 5px;
  padding: 13px 15px;
  border: 1px solid var(--line);
  border-radius: var(--r2);
  background: var(--surface);
  max-width: 76ch;
}
.pmsg--ours { background: var(--accent-tint); border-color: var(--accent-edge); margin-left: auto; }
.pmsg__who { font: 600 12.5px/1.3 var(--ui); color: var(--muted); }
.pmsg__body { font: 400 14px/1.55 var(--ui); color: var(--body); }

/* ---------------------------------------------------------------------------
   28. Documents and uploads
   ------------------------------------------------------------------------ */
.pdocs { display: grid; gap: 11px; }
.pdoc {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 13px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--r2);
  background: var(--surface);
}
.pdoc__thumb {
  display: grid;
  place-items: center;
  width: 42px; height: 42px;
  flex: 0 0 auto;
  border-radius: var(--r1);
  background: var(--c-blue-t);
  color: var(--c-blue);
}
.pdoc__name { min-width: 0; font: 600 14px/1.35 var(--ui); color: var(--ink); overflow: hidden; text-overflow: ellipsis; }
.pdoc__meta { font: 400 12.5px/1.4 var(--ui); color: var(--muted); }
.pdoc--missing { border-style: dashed; background: var(--sunk); }
.pdoc--missing .pdoc__thumb { background: var(--c-amber-t); color: var(--c-amber); }

.cupload { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 13px; }
.cupload__thumb {
  width: 64px; height: 64px;
  flex: 0 0 auto;
  border-radius: var(--r2);
  background: var(--sunk);
  object-fit: cover;
}
.cupload__text { min-width: 0; font: 400 13px/1.5 var(--ui); color: var(--muted); }

/* ---------------------------------------------------------------------------
   29. Money: an order summary, and the steps through a checkout
   ------------------------------------------------------------------------ */
.ptotal { display: grid; gap: 1px; }
.ptotal > div,
.ptotal__row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  padding: 9px 0;
  font: 400 14px/1.45 var(--ui);
  color: var(--body);
  border-bottom: 1px solid var(--line-soft);
}
.ptotal > div:last-child, .ptotal__row:last-child { border-bottom: 0; }
.ptotal b { color: var(--ink); font-variant-numeric: tabular-nums; }

.ptotal__sum {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin-top: 6px;
  padding-top: 13px;
  border-top: 2px solid var(--line);
  font: 600 15px/1.4 var(--ui);
  color: var(--ink);
}
.ptotal__sum b {
  font: 700 21px/1.2 var(--display);
  font-variant-numeric: tabular-nums;
  letter-spacing: -.02em;
  color: var(--ink);
}

/* A stepper. Pills rather than a connected rail, because the steps wrap on
   a phone and a rail that wraps draws a line to nowhere. */
.psteps { display: flex; flex-wrap: wrap; gap: 8px; }
.psteps li {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 14px 7px 9px;
  border: 1px solid var(--line);
  border-radius: var(--rp);
  background: var(--surface);
  font: 500 13.5px/1.3 var(--ui);
  color: var(--muted);
}
.psteps li::before {
  content: counter(step);
  counter-increment: step;
  display: grid;
  place-items: center;
  width: 22px; height: 22px;
  border-radius: var(--rp);
  background: var(--line-soft);
  font: 700 12px/1 var(--ui);
  color: var(--muted);
}
.psteps { counter-reset: step; }
.psteps li[aria-current="step"] {
  border-color: var(--accent);
  background: var(--accent-tint);
  color: var(--accent-deep);
  font-weight: 600;
}
.psteps li[aria-current="step"]::before { background: var(--accent); color: #FFFFFF; }
.psteps li.is-done { border-color: var(--c-green-e); background: var(--c-green-t); color: var(--c-green); }
.psteps li.is-done::before { background: var(--d-green); color: #FFFFFF; }

/* ---------------------------------------------------------------------------
   30. The shop — brief §9

   NEW. A product grid and a cart, as the reference screen draws them: a
   pastel plate carrying the cover, the name, the price, a stepper and an
   outline Add-to-cart button; the cart a sticky card at the right.
   ------------------------------------------------------------------------ */
.pshop { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--gap); }

.pprod {
  display: flex;
  flex-direction: column;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: var(--r3);
  background: var(--surface);
  box-shadow: var(--sh-card);
  overflow: hidden;
}
/* A fixed height, not an aspect ratio. An aspect-ratio box still grows to
   fit its content, so "SR KG level books" set three lines deep made one
   plate taller than the others — and because grid rows stretch, every card
   beside it grew a band of white space. A height the content cannot beat
   keeps a row of cards the same card. */
.pprod__plate {
  display: grid;
  place-items: center;
  height: 152px;
  overflow: hidden;
  padding: 14px;
  background: var(--c-blue-t);
}
.pprod__plate img { max-height: 100%; width: auto; object-fit: contain; border-radius: 6px; }

/* The TYPOGRAPHIC cover. There are no photographed book covers for this
   project and the standing instruction is to ask for a clean render rather
   than draw or fake one — so a product plate sets the level's name in the
   level's own colour instead. It reads as a deliberate cover rather than as
   a broken image, and it is replaced by an <img> without touching anything
   else on the card. */
.pprod__cover {
  display: grid;
  gap: 6px;
  justify-items: center;
  width: 78%;
  padding: 16px 12px;
  border-radius: 8px;
  background: rgba(255, 255, 255, .82);
  text-align: center;
}
.pprod__cover small {
  font: 600 8.5px/1.25 var(--ui);
  letter-spacing: .09em;
  text-transform: uppercase;
  color: var(--muted);
}
.pprod__cover b {
  font: 800 clamp(15px, 1.7vw, 20px)/1.15 var(--display);
  letter-spacing: -.03em;
  color: var(--ink);
  /* Three lines at most. A four-word product name is a cover, not an essay,
     and the full name is spelled out under the plate anyway. */
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.pprod__plate--lv1 { background: var(--c-blue-t); }
.pprod__plate--lv2 { background: var(--c-amber-t); }
.pprod__plate--lv3 { background: var(--c-teal-t); }
.pprod__plate--lv4 { background: var(--c-green-t); }
.pprod__plate--lv5 { background: var(--c-violet-t); }
.pprod__plate--lv6 { background: var(--c-orange-t); }
.pprod__plate--lv7 { background: var(--c-teal-t); }
.pprod__plate--lv8 { background: var(--c-pink-t); }

.pprod__body { flex: 1 1 auto; display: grid; gap: 9px; align-content: start; padding: 13px 14px 14px; }
.pprod__name { font: 600 14.5px/1.3 var(--ui); color: var(--ink); }
.pprod__meta { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.pprod__cat { font: 400 12.5px/1.4 var(--ui); color: var(--muted); }
.pprod__price {
  font: 700 16px/1.2 var(--display);
  font-variant-numeric: tabular-nums;
  color: var(--ink);
}

/* A quantity stepper: minus, a figure, plus. The figure is an <input> so it
   can be typed into — a parent ordering thirty books should not tap plus
   thirty times. */
.pstep {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: var(--r1);
  overflow: hidden;
}
.pstep button {
  display: grid;
  place-items: center;
  width: 34px; height: 34px;
  color: var(--muted);
  font: 600 16px/1 var(--ui);
}
.pstep button:hover { background: var(--accent-tint); color: var(--accent); }
.pstep input {
  width: 44px; height: 34px;
  min-height: 0;
  border: 0;
  border-inline: 1px solid var(--line);
  border-radius: 0;
  text-align: center;
  font: 600 14px/1 var(--ui);
  font-variant-numeric: tabular-nums;
  color: var(--ink);
  background: var(--surface);
}
.pstep input:focus { outline: 0; box-shadow: inset 0 0 0 2px var(--accent); }
/* On a product card the stepper is stretched to the card's width, and the
   spare width all landed behind the plus, so it read as one big "+" box
   beside a small minus. Three equal thirds instead. */
.pprod__body .pstep { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.pprod__body .pstep button,
.pprod__body .pstep input { width: 100%; }

/* The cart. A line per item, then the totals and the way out. */
.pcart { display: grid; gap: 13px; }
.pcart__line {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 11px;
  padding-bottom: 13px;
  border-bottom: 1px solid var(--line-soft);
}
.pcart__line:last-of-type { border-bottom: 0; padding-bottom: 0; }
.pcart__thumb {
  width: 46px; height: 46px;
  flex: 0 0 auto;
  border-radius: var(--r1);
  background: var(--c-blue-t);
  object-fit: contain;
  padding: 4px;
}
.pcart__text { min-width: 0; display: grid; gap: 5px; }
.pcart__text b { font: 600 13.5px/1.3 var(--ui); color: var(--ink); }
.pcart__end {
  flex: 0 0 auto;
  display: grid;
  justify-items: end;
  gap: 4px;
  font: 700 14px/1.2 var(--display);
  font-variant-numeric: tabular-nums;
  color: var(--ink);
}

/* ---------------------------------------------------------------------------
   31. Odds and ends the screens ask for
   ------------------------------------------------------------------------ */

/* A button that is really a link inside a sentence. */
.link-plain {
  background: none;
  border: 0;
  padding: 0;
  color: var(--accent-ink);
  font: inherit;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
}

/* A row of chips that add something. */
.mchips { display: flex; flex-wrap: wrap; gap: 7px; }
.mchip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 11px;
  border: 1px solid var(--line);
  border-radius: var(--rp);
  background: var(--surface);
  font: 500 13px/1.4 var(--ui);
  color: var(--body);
}
.mchip--add { border-style: dashed; color: var(--accent-ink); cursor: pointer; }
.mchip--add:hover { background: var(--accent-tint); border-color: var(--accent-edge); }

/* The four grants on the roles matrix, as four distinguishable chips. */
.pgrant {
  display: inline-grid;
  place-items: center;
  min-width: 30px; height: 26px;
  padding: 0 8px;
  border-radius: 7px;
  background: var(--c-slate-t);
  color: var(--c-slate);
  font: 600 12px/1 var(--ui);
}

/* ---------------------------------------------------------------------------
   32. The attendance register

   REBUILT 22 October against the client's reference screen. A row per child
   carrying everything the reference's table carries: number, identity,
   level, the parent's number, the three-state picker and a remark.

   IT IS NOT A <table>, and that is the point. Design plan assumption A5
   makes this the one mobile-critical screen — it is marked standing up, at
   the start of a class, on a phone. So the rows are a GRID that lays out as
   columns from 1100px up (the reference's table, exactly) and collapses to a
   stacked card below it. A real table cannot do the second half: it can
   scroll sideways, which on a phone means a teacher swipes left to find the
   Absent button and loses sight of whose row they are on.
   ------------------------------------------------------------------------ */
.proster { display: grid; gap: 9px; }

/* The column captions. Same track list as a row, so they line up with it,
   and gone entirely once the rows stop being columns. */
.proster__caption {
  display: none;
  padding: 0 13px 2px;
  font: 600 10.5px/1.3 var(--ui);
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--muted);
}

.proster__row {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 11px 14px;
  padding: 12px 13px;
  border: 1px solid var(--line);
  border-radius: var(--r2);
  background: var(--surface);
  align-items: center;
}
.proster__row:hover { border-color: var(--accent-edge); background: var(--accent-tint); }

/* A row the register itself has flagged. The spine repeats what the picker
   already says, which is the point: down a column of twenty, the eye finds
   the three that are not present without reading any of them. */
.proster__row[data-state="absent"] { box-shadow: inset 3px 0 0 var(--d-red); }
.proster__row[data-state="late"]   { box-shadow: inset 3px 0 0 var(--d-amber); }

.proster__n { font: 600 13px/1 var(--ui); color: var(--faint); }

.proster__who {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 11px;
  min-width: 0;
}
.proster__who b {
  display: block;
  font: 600 14.5px/1.3 var(--ui);
  color: var(--ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.proster__who small {
  font: 400 12.5px/1.35 var(--ui);
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.proster__lv { min-width: 0; }

/* The parent's number, as a tel: link — on the phone this screen is marked
   on, that is a tap to call rather than a number to copy out by hand. */
.proster__tel {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  font: 500 13px/1.4 var(--ui);
  font-variant-numeric: tabular-nums;
  color: var(--body);
  text-decoration: none;
  white-space: nowrap;
}
.proster__tel svg { flex: 0 0 auto; color: var(--faint); }
a.proster__tel:hover { color: var(--accent-ink); }
a.proster__tel:hover svg { color: var(--accent); }

.proster__note { min-width: 0; }
.proster__note .input { min-height: 38px; padding: 8px 11px; font-size: 13.5px; }

/* A quiet disclosure: it opens the class-work field and should read as a
   control, not as a second action competing with Save. */
.proster__more {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  justify-self: start;
  padding: 7px 12px;
  border: 1px solid var(--c-amber-e);
  border-radius: var(--r1);
  background: var(--c-amber-t);
  font: 600 13px/1.25 var(--ui);
  color: var(--c-amber);
}
.proster__more:hover { background: #FDEEC4; }
.proster__more[aria-expanded="false"] {
  border-color: var(--line);
  background: var(--surface);
  color: var(--muted);
}

.proster__work { min-width: 0; display: grid; gap: 9px; }
.proster__work[hidden] { display: none; }

/* --- the reference's table, from 1100px up -------------------------------
   Seven tracks: number, identity, level, parent, picker, remark, and the
   class-work disclosure which drops to a second line of its own because it
   is an action on the row rather than a field of it. */
@media (min-width: 1100px) {
  .proster__caption,
  .proster__row {
    display: grid;
    grid-template-columns:
      28px                      /* #                                     */
      minmax(150px, 1.4fr)      /* student                               */
      minmax(104px, auto)       /* level — wide enough for its caption   */
      minmax(152px, auto)       /* parent contact — ditto                */
      auto                      /* the picker, at its natural width      */
      minmax(150px, 1fr);       /* remarks                               */
    align-items: center;
  }
  .proster__caption { display: grid; }

  /* The caption cells must not push their own column wider than the data
     under them, or every heading slides one track to the right. */
  .proster__caption > span {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  /* Class work is an action ON the row and its field belongs beside it, not
     under the whole row — a full-width field makes every marked row three
     times the height of an unmarked one and the register stops scanning. */
  .proster__more { grid-column: 2 / 4; justify-self: start; }
  .proster__work { grid-column: 4 / -1; }
}

/* ---------------------------------------------------------------------------
   33. Attendance: a month of small squares

   One square per day, coloured by what happened. The letter is in the
   square as well as the colour — §8, colour is never the only signal.
   ------------------------------------------------------------------------ */
.pmonth { width: 100%; border-collapse: separate; border-spacing: 4px; }
.pmonth th {
  padding: 4px;
  font: 600 10.5px/1.3 var(--ui);
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--muted);
}
.pmonth td { padding: 0; }

.pday {
  display: grid;
  place-items: center;
  aspect-ratio: 1;
  min-width: 30px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface);
  font: 600 12.5px/1 var(--ui);
  font-variant-numeric: tabular-nums;
  color: var(--muted);
}
.pday--p { background: var(--c-green-t); border-color: var(--c-green-e); color: var(--c-green); }
.pday--a { background: var(--c-red-t);   border-color: var(--c-red-e);   color: var(--c-red); }
.pday--x { background: var(--sunk);      border-color: var(--line);      color: var(--faint); }
/* Late — the third state the reference screen adds (brief §7). */
.pday--l { background: var(--c-amber-t); border-color: var(--c-amber-e); color: var(--c-amber); }
/* Absent, then made up (F26): counted as attended, never as an extra class. */
.pday--m { background: var(--c-violet-t); border-color: var(--c-violet-e); color: var(--c-violet); }
/* A class day not marked yet — an empty box, not a zero. */
.pday--u { border-style: dashed; color: var(--faint); }
/* A child who moved batch this month: the tag under their name (plan 10 point 4). */
.pmonth__tag { display: block; margin-top: 3px; font: 500 11.5px/1.3 var(--ui); color: var(--c-blue); }

.pmonth__split { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: var(--gap); }

/* ---------------------------------------------------------------------------
   34. Token bridge

   Eight thousand lines of Blade carry inline colours — style="color:var(--red)"
   on a required-field star, fill="var(--navy)" inside a chart component, and
   <x-barchart> defaults to colour="var(--blue)". Those names came from
   site.css, which this console no longer loads. Rather than edit a thousand
   attributes and risk changing a FIGURE while moving a COLOUR, the old names
   are re-pointed at the new palette here, once.

   Nothing old is imported. These are aliases onto the tokens in §1, and the
   module sheets below (§35+) read them too.
   ------------------------------------------------------------------------ */
:root {
  --text:        var(--body);
  --navy:        var(--ink);
  --red:         var(--c-red);
  --green:       var(--c-green);
  --green-deep:  #0C6640;
  --green-tint:  var(--c-green-t);
  --blue:        var(--c-blue);
  --blue-tint:   var(--c-blue-t);
  --blue-chip:   var(--c-blue-t);

  /* Amber is a STATE now, not a brand accent (§1). The names stay because
     the Blade uses them; the values are the brief's yellow. */
  --yellow:      #FFC928;
  --yellow-deep: #EDB70E;
  --yellow-ink:  var(--c-amber);
  --yellow-chip: var(--c-amber-t);

  --icon-violet: var(--c-violet);
  --icon-teal:   var(--c-teal);
  --chip-violet: var(--c-violet-t);
  --chip-teal:   var(--c-teal-t);

  --mark:  var(--ui);
  --t-xs:  12px;
  --t-sm:  13.5px;
  --r-sm:  8px;
  --r-md:  var(--r2);
  --r-panel: var(--r3);
}
/* ---------------------------------------------------------------------------
   27. Responsive
   Fluid between breakpoints, per §2.1. The rail leaves the flow at 1024 and
   becomes a drawer; the header folds at 900; a table scrolls inside its own
   box at every width, so the page itself never does.
   ------------------------------------------------------------------------ */
/* HOW MANY COLUMNS — and why the numbers look odd.

   What decides whether four tiles fit is not the window, it is the CONTENT
   COLUMN: the window minus the 252px rail minus the gutters. A rule written
   against the window alone was dropping a 1366px laptop to two columns and
   giving each tile 520px to hold a four-digit number — which is what this is
   fixing.

   So the steps are set from the content width, and they step back UP at
   1023px because that is where the rail leaves the flow and hands back its
   252 pixels. A window that gets narrower there genuinely gets roomier, and
   pretending otherwise is what wastes the space.

       window   rail   content   .grid--4
       1920      252     1560     4  (390 a tile)
       1440      252     1132     4  (268)
       1366      252     1058     4  (249)
       1180      252      872     4  (203)
       1100      252      792     2  (386)  — the one tight band
       1024      252      716     2  (348)
       1000        0      968     4  (227)  — rail gone, four fit again
        880        0      848     4  (197)
        768        0      736     2  (358)
        390        0      358     2  (169)                                 */

@media (max-width: 1180px) {
  .grid--4, .grid--3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid--top, .grid--charts, .pdetail, .pmonth__split {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* The rail is a drawer from here down, so the dense rows go wide again. */
@media (max-width: 1023px) and (min-width: 880px) {
  .grid--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .grid--top, .pdetail { grid-template-columns: minmax(0, 1fr) 300px; }
}

@media (max-width: 1023px) {
  :root { --rail-w: 0px; }

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

  /* The drawer is driven by data-aside on #panelRoot — that is the attribute
     panel.js already sets, and matching it is what keeps the Escape key, the
     focus trap and the scrim click working without touching the script. */
  .paside {
    position: fixed; top: 0; left: 0; bottom: 0; width: 284px; height: auto;
    transform: translateX(-100%); transition: transform .22s ease;
    box-shadow: var(--sh-pop);
  }
  [data-aside="open"] .paside { transform: none; }

  .paside__scrim {
    display: block; position: fixed; inset: 0; z-index: calc(var(--z-rail) - 1);
    background: rgba(13, 22, 43, .5); opacity: 0; pointer-events: none;
    transition: opacity .22s ease;
  }
  [data-aside="open"] .paside__scrim { opacity: 1; pointer-events: auto; }

  .ptop .ptop__burger { display: grid; }
}

@media (max-width: 899px) {
  .pswap, .pyear { display: none; }
  .pmenu__who { display: none; }
  .pwelcome { flex-direction: column; align-items: flex-start; }
  .pwelcome__art { width: 92px; height: 100px; align-self: flex-end; margin-top: -6px; }
}

@media (max-width: 599px) {
  /* The context line goes before the heading does. A date or a batch name is
     the first thing you can do without when the bar runs out of room. */
  .ptop__title p { display: none; }
  .ptop { gap: 10px; }
}

@media (max-width: 879px) {
  .grid--4, .grid--3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid--top, .pdetail { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 767px) {
  .grid--2 { grid-template-columns: minmax(0, 1fr); }
  .form-grid--2 { grid-template-columns: minmax(0, 1fr); }

  /* A modal becomes a bottom sheet: it is where the thumb is. */
  .pmodal { place-items: end stretch; padding: 0; }
  .pmodal__box {
    width: 100%; max-height: 92dvh;
    border-radius: var(--r3) var(--r3) 0 0;
    padding-bottom: env(safe-area-inset-bottom);
  }
  .pmodal__foot { position: sticky; bottom: 0; }
  .pmodal__foot .btn { flex: 1 1 auto; }

  /* 16px minimum on every control, or iOS Safari zooms the page in on focus
     and never zooms back out — §2.3. */
  .input, .select, .textarea { font-size: 16px; }
  /* That makes a box 46px, except a date box, whose calendar glyph pushes it
     to 48 — one tall box in a stack of even ones. Pin it to its neighbours. */
  .input:is([type="date"], [type="month"], [type="time"], [type="week"]) { height: 46px; }
  /* ...and a toolbar button standing beside one grows with it. */
  :is(.ptools, .mswitch) > .btn, .mswitch ~ .btn { min-height: 46px; }
  /* Filters share each line evenly instead of leaving a ragged gap after
     whichever one happened to wrap. */
  .ptools > .select, .ptools > .input:not(.ptools__grow .input) { flex: 1 1 140px; }

  /* Row actions are always visible on touch: there is no hover to reveal them. */
  .ptable tbody .acts .ract { opacity: 1; }

  .pdemo { font-size: 11.5px; text-align: left; }
}

@media (max-width: 519px) {
  /* Tiles stay two-up on a phone. One-up turns eight metrics into eight
     screens of scrolling, and at 390px two columns still leave 169px a
     tile — enough for the label, the figure and the delta line. */
  .phead__actions { width: 100%; }
  .phead__actions .btn { flex: 1 1 auto; }
  .ptools { padding: 10px; }
  .ptools__grow { flex-basis: 100%; }
  .kpi { padding: 12px; }
  .kpi__top { gap: 8px; margin-bottom: 7px; }
  .kpi__ico { width: 30px; height: 30px; border-radius: 8px; }
  .kpi__label { font-size: 10px; letter-spacing: .05em; }
  .kpi__num { font-size: 23px; }
  .kpi__foot { font-size: 11.5px; }
  .pdonut { grid-template-columns: minmax(0, 1fr); justify-items: center; gap: 12px; }
}

@media (max-width: 359px) {
  /* Below an iPhone SE two columns stop being readable. */
  .grid--3, .grid--4 { grid-template-columns: minmax(0, 1fr); }
  .kpi__num { font-size: 28px; }
}

/* Print: a certificate or an invoice has to come out of a real printer, in
   Safari and in Chrome — §2.3. Drop the chrome, keep the document. */
@media print {
  .paside, .ptop, .pdemo, .phead__actions,
  .ptools, .ppage, .pbulk, .acts { display: none !important; }
  .panel { grid-template-columns: minmax(0, 1fr); }
  .pbody { padding: 0; }
  .pcard { border-color: #CCC; box-shadow: none; break-inside: avoid; }
  body { background: #FFF; }
}

/* ===========================================================================
   28. The masters — admin M1 to M14

   Ten of the admin screens are not lists at all. They are editors: a question
   composer, a form builder, a permission matrix, a certificate artboard. Each
   has its own small vocabulary, and each is written here in the same terms as
   the rest of the console — hairlines and tints for structure, one accent for
   the action, figures in the display face.
   ======================================================================== */

/* --- shared furniture ---------------------------------------------------- */

/* The master's reference, M3 or M11, beside its name. */
.mref {
  display: inline-flex; align-items: center;
  margin-left: 8px; padding: 3px 9px;
  background: var(--c-slate-t); color: var(--c-slate);
  border: 1px solid var(--c-slate-e); border-radius: var(--rp);
  font: 700 11px/1.3 var(--ui); letter-spacing: .06em; vertical-align: middle;
}

/* The drag handle on a reorderable row. It is decoration until the reorder is
   actually built, so it reads as a grip and does nothing else. */
.mdrag { flex: 0 0 auto; color: var(--faint); cursor: grab; }
.mdrag:active { cursor: grabbing; }

/* A button that is really a link inside a sentence. */
.mlink {
  padding: 0; color: var(--accent-ink);
  font: 600 inherit/inherit var(--ui); font-size: inherit;
  text-decoration: underline; text-underline-offset: 2px;
}
.mlink:hover { color: var(--ink); }

/* The one destructive action on an editor. Quiet until it is hovered: it is
   not the action anyone came to this screen for. */
.mdanger { color: var(--c-red); }
.mdanger:hover { background: var(--c-red-t); border-color: var(--c-red-e); color: var(--c-red); }

/* A unit welded onto an input — the rupee before it, "days" after it. */
.minput { display: flex; align-items: stretch; }
.minput .input { border-radius: var(--r1); position: relative; z-index: 1; }
.minput__pre, .minput__post {
  display: grid; place-items: center; flex: 0 0 auto;
  padding: 0 12px;
  background: var(--sunk); border: 1px solid var(--line);
  color: var(--muted); font: 600 14px/1 var(--ui); white-space: nowrap;
}
.minput__pre  { border-right: 0;  border-radius: var(--r1) 0 0 var(--r1); }
.minput__post { border-left: 0;   border-radius: 0 var(--r1) var(--r1) 0; }
.minput:has(.minput__pre) .input  { border-top-left-radius: 0;  border-bottom-left-radius: 0; }
.minput:has(.minput__post) .input { border-top-right-radius: 0; border-bottom-right-radius: 0; }

/* A count beside a field: how many of the thing exist already. */
.mcount {
  display: inline-flex; align-items: center; gap: 5px;
  font: 600 12.5px/1 var(--ui); color: var(--muted);
}

/* A difficulty, as stars. Colour is never the only signal — the figure is in
   the cell beside it and the stars carry a text label for a screen reader. */
.mstars { color: var(--c-amber); letter-spacing: .08em; font-size: 14px; }

/* A pattern or a merge field, shown as the literal token it is. */
.mpattern, .ptable code, .fbuild__text code {
  display: inline-block; padding: 2px 7px;
  background: var(--sunk); border: 1px solid var(--line-soft); border-radius: 6px;
  font: 500 12.5px/1.5 ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  color: var(--body);
}

/* The "which master am I editing" picker above an editor. */
.mswitch { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.mswitch .select { width: auto; min-width: 220px; }

/* A read-only reference field: the key the rest of the platform uses. */
.sref {
  background: var(--sunk); color: var(--muted);
  font: 500 14px/1.4 ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}

/* The checkbox column at the head of a selectable table. */
td.sel, th.sel { width: 44px; padding-right: 0; }
td.sel input, th.sel input { width: 18px; height: 18px; accent-color: var(--accent); }

/* A standfirst under a page heading. */
.lead { font-size: 15.5px; line-height: 1.6; color: var(--body); max-width: 72ch; }

/* --- M3, the question composer ------------------------------------------ */

/* A question is a column of terms in the real sheet, and it has to read that
   way here too — a row of pills is a sum, not a calculation. */
.qterms { display: inline-flex; align-items: center; gap: 5px; flex-wrap: wrap; }
.qterm {
  display: grid; place-items: center;
  min-width: 34px; padding: 4px 8px;
  background: var(--c-blue-t); color: var(--c-blue);
  border-radius: 7px;
  font: 700 13.5px/1.2 var(--display); font-variant-numeric: tabular-nums;
}
.qterm--minus { background: var(--c-red-t); color: var(--c-red); }

.qcompose { display: grid; gap: 7px; }
.qcompose > li {
  display: flex; align-items: center; gap: 12px;
  padding: 9px 12px;
  background: #FFF; border: 1px solid var(--line); border-radius: var(--r2);
}
.qcompose__n {
  display: grid; place-items: center;
  width: 26px; height: 26px; flex: 0 0 auto;
  background: var(--sunk); border-radius: 50%;
  font: 700 12px/1 var(--display); color: var(--muted);
}
.qcompose__a {
  margin-left: auto; font: 700 15px/1 var(--display); color: var(--ink);
  font-variant-numeric: tabular-nums; white-space: nowrap;
}
.qcompose__more {
  padding: 9px 12px; border: 1px dashed var(--line); border-radius: var(--r2);
  background: var(--sunk); color: var(--muted); font-size: 13.5px; text-align: center;
}

/* What the child will actually see. Drawn on paper, inside the console. */
.qpreview {
  padding: 0 0 14px; background: #FFF;
  border: 1px solid var(--line); border-radius: var(--r2); overflow: hidden;
}
.qpreview__bar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px 14px; margin-bottom: 12px;
  background: var(--rail); color: #FFF;
  font: 600 12.5px/1.3 var(--ui);
}
.qpreview__clock {
  padding: 3px 9px; background: rgba(255, 255, 255, .14); border-radius: var(--rp);
  font-variant-numeric: tabular-nums;
}
.qpreview__q {
  display: flex; align-items: center; gap: 12px;
  padding: 9px 14px;
}
.qpreview__q + .qpreview__q { border-top: 1px solid var(--line-soft); }
.qpreview__n {
  display: grid; place-items: center;
  width: 24px; height: 24px; flex: 0 0 auto;
  background: var(--sunk); border-radius: 50%;
  font: 700 12px/1 var(--display); color: var(--muted);
}
.qpreview__in {
  margin-left: auto; width: 86px; height: 34px; flex: 0 0 auto;
  background: var(--sunk); border: 1px solid var(--line); border-radius: var(--r1);
}

/* --- M8, the games matrix ------------------------------------------------ */

/* Eight levels down the side, two slots across. A real grid, because the
   question the screen answers is "which level is missing a game". */
.gmatrix {
  display: grid; grid-template-columns: minmax(118px, auto) repeat(2, minmax(0, 1fr));
  gap: 9px; align-items: stretch;
}
.gmatrix__head {
  padding: 0 2px 2px;
  font: 700 10.5px/1.3 var(--ui); letter-spacing: .1em; text-transform: uppercase;
  color: var(--muted);
}
.gmatrix__level {
  display: grid; align-content: center; gap: 2px;
  padding: 10px 12px;
  background: var(--sunk); border-radius: var(--r2);
}
.gmatrix__level b { font: 600 14px/1.2 var(--ui); color: var(--ink); }
.gmatrix__level small { font-size: 12px; color: var(--muted); }

.gslot {
  display: flex; align-items: center; gap: 11px;
  padding: 10px 12px; width: 100%; text-align: left;
  background: #FFF; border: 1px solid var(--line); border-radius: var(--r2);
  transition: border-color .15s ease, box-shadow .15s ease;
}
.gslot:hover { border-color: #C6D2E6; box-shadow: var(--sh-rest); }
.gslot--draft { background: var(--c-amber-t); border-color: var(--c-amber-e); }
.gslot--empty {
  justify-content: center;
  background: var(--sunk); border-style: dashed; color: var(--muted);
  font-size: 13.5px;
}
.gslot__art {
  display: grid; place-items: center;
  width: 42px; height: 42px; flex: 0 0 auto;
  background: var(--c-violet-t); color: var(--c-violet);
  border: 1px dashed var(--c-violet-e); border-radius: var(--r1);
}
.gslot__text { display: grid; gap: 1px; min-width: 0; }
.gslot__text b { font: 600 14px/1.25 var(--ui); color: var(--ink); }
.gslot__text small { font-size: 12px; color: var(--muted); }
.gslot .st { margin-left: auto; }

/* --- M10, roles and permissions ----------------------------------------- */

.pmatrix { min-width: 760px; }
.pmatrix thead th:last-child { text-align: left; }
.pmatrix__role { min-width: 118px; }
.pmatrix__role small {
  display: block; margin-top: 3px;
  font: 500 11px/1.3 var(--ui); letter-spacing: 0; text-transform: none;
  color: var(--faint);
}
.pmatrix tbody th {
  padding: var(--row-y) 14px var(--row-y) 18px; text-align: left;
  font: 600 14px/1.4 var(--ui); color: var(--ink);
  border-bottom: 1px solid var(--line-soft);
}
.pmatrix tbody th small {
  display: block; font: 500 12px/1.4 var(--ui); color: var(--muted);
}
.pmatrix__cell { text-align: center; }
.pmatrix tbody tr[data-flag] { background: var(--accent-tint); }

/* The four grants, as four distinguishable chips rather than four ticks. */
.pgrant {
  min-width: 68px; justify-content: center;
  background: var(--c-slate-t); color: var(--c-slate); border-color: var(--c-slate-e);
}
/* The grant is stored as 0–3 and the class carries the number, so these are
   named after the level rather than after the word: 0 nothing, 1 view,
   2 edit, 3 approve. Each is a word in the cell as well as a colour. */
.pgrant--0 { background: transparent;    color: var(--faint);   border-color: transparent; }
.pgrant--1 { background: var(--c-blue-t);  color: var(--c-blue);  border-color: var(--c-blue-e); }
.pgrant--2 { background: var(--c-amber-t); color: var(--c-amber); border-color: var(--c-amber-e); }
.pgrant--3 { background: var(--c-green-t); color: var(--c-green); border-color: var(--c-green-e); }

/* A priority, where one exists. */
.ppri { background: var(--c-slate-t); color: var(--c-slate); border-color: var(--c-slate-e); }
.ppri--high { background: var(--c-red-t);   color: var(--c-red);   border-color: var(--c-red-e); }
.ppri--med  { background: var(--c-amber-t); color: var(--c-amber); border-color: var(--c-amber-e); }
.ppri--low  { background: var(--c-slate-t); color: var(--c-slate); border-color: var(--c-slate-e); }

/* --- M12, notification templates ---------------------------------------- */

.nchan { border: 1px solid var(--line); border-radius: var(--r2); overflow: hidden; }
.nchan__head {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  padding: 11px 14px;
  background: var(--sunk); border-bottom: 1px solid var(--line);
}
.nchan__who { margin-left: auto; font-size: 12.5px; color: var(--muted); }
.nchan__body { padding: 14px; }

/* How long an SMS has become, and how many messages that will cost. */
.nlen {
  display: flex; align-items: center; gap: 11px; flex-wrap: wrap;
  margin-top: 10px; padding: 10px 12px;
  background: var(--sunk); border-radius: var(--r2);
  font-size: 13px; color: var(--body);
}
.nlen b { font: 600 13px/1.3 var(--ui); color: var(--ink); }
.nlen__bar {
  flex: 1 1 140px; height: 8px; min-width: 100px;
  background: #FFF; border: 1px solid var(--line);
  border-radius: var(--rp); overflow: hidden;
}
.nlen__bar > span { display: block; height: 100%; background: var(--c-blue); }

/* The trigger list: what sends, and down which channels. */
.ntrig { display: grid; gap: 2px; }
.ntrig > li {
  display: flex; align-items: center; gap: 14px;
  padding: 10px 12px; border-radius: var(--r1);
}
.ntrig > li:hover { background: var(--sunk); }
.ntrig > li[aria-current] { background: var(--accent-tint); }
.ntrig__text { display: grid; gap: 1px; min-width: 0; flex: 1 1 auto; }
.ntrig__text b { font: 600 14px/1.3 var(--ui); color: var(--ink); }
.ntrig__text small { font-size: 12.5px; color: var(--muted); }

.ntrig__ch { display: flex; gap: 5px; flex: 0 0 auto; }
.ntrig__ch i {
  display: grid; place-items: center;
  width: 26px; height: 26px;
  background: var(--sunk); border: 1px solid var(--line); border-radius: 7px;
  color: var(--faint); font: 700 11px/1 var(--display); font-style: normal;
}
.ntrig__ch i.is-on {
  background: var(--c-green-t); border-color: var(--c-green-e); color: var(--c-green);
}

/* --- M14, website content ----------------------------------------------- */

.cpages { display: grid; gap: 2px; }
.cpages > li > a {
  display: flex; align-items: center; gap: 11px;
  padding: 10px 12px; border-radius: var(--r1);
  color: inherit; text-decoration: none;
}
.cpages > li > a:hover { background: var(--sunk); }
.cpages > li[aria-current] > a {
  background: var(--accent-tint); box-shadow: inset 3px 0 0 var(--accent);
}
.cpages__text { display: grid; gap: 1px; min-width: 0; flex: 1 1 auto; }
.cpages__text b { font: 600 14px/1.3 var(--ui); color: var(--ink); }
.cpages__text small { font-size: 12px; color: var(--muted); }
.cpages .st { margin-left: auto; }

.cblocks { display: grid; gap: 8px; }
.cblocks > li {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px;
  background: #FFF; border: 1px solid var(--line); border-radius: var(--r2);
}
.cblock--draft { background: var(--c-amber-t); border-color: var(--c-amber-e); }
.cblock__kind {
  flex: 0 0 auto; padding: 4px 9px;
  background: var(--c-violet-t); color: var(--c-violet);
  border-radius: var(--rp);
  font: 700 10.5px/1.3 var(--ui); letter-spacing: .07em; text-transform: uppercase;
}
.cblock__text { display: grid; gap: 1px; min-width: 0; flex: 1 1 auto; }
.cblock__text b { font: 600 14px/1.3 var(--ui); color: var(--ink); }
.cblock__text small { font-size: 12.5px; color: var(--muted); }
.cblocks .acts__row { margin-left: auto; }

/* A text editor: a toolbar welded to the top of its textarea. */
.ceditor { border: 1px solid var(--line); border-radius: var(--r1); overflow: hidden; }
.ceditor:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-tint); }
.ceditor__bar {
  display: flex; align-items: center; gap: 2px;
  padding: 6px 8px;
  background: var(--sunk); border-bottom: 1px solid var(--line);
}
.ceditor__bar button {
  display: grid; place-items: center;
  width: 32px; height: 32px; border-radius: 7px; color: var(--muted);
  font: 700 14px/1 var(--display);
}
.ceditor__bar button:hover { background: #FFF; color: var(--ink); box-shadow: var(--sh-rest); }
.ceditor__area {
  border: 0; border-radius: 0;
}
.ceditor__area:focus { box-shadow: none; }

/* A row of chips that add something. */
.fadd {
  display: grid; gap: 9px;
  padding: 13px; margin-top: 12px;
  background: var(--sunk); border: 1px dashed #C8D2E4; border-radius: var(--r2);
}
.fadd > p {
  font: 700 11px/1.3 var(--ui); letter-spacing: .085em; text-transform: uppercase;
  color: var(--muted);
}

/* --- M13, the enquiry form builder --------------------------------------- */

.fbuild { display: grid; gap: 8px; }
.fbuild > li {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 10px 12px;
  background: #FFF; border: 1px solid var(--line); border-radius: var(--r2);
}
.fbuild__locked { background: var(--sunk); }
.fbuild__text { display: grid; gap: 2px; min-width: 0; flex: 1 1 180px; }
.fbuild__text b { font: 600 14px/1.3 var(--ui); color: var(--ink); }
.fbuild__type {
  flex: 0 0 auto; padding: 4px 10px;
  background: var(--c-blue-t); color: var(--c-blue);
  border-radius: var(--rp); font: 600 12px/1.3 var(--ui);
}
.fbuild__req { flex: 0 0 auto; font-size: 13px; }
.fbuild .acts__row { margin-left: auto; }

/* The form as the enquirer will meet it. Grey boxes, not live controls: this
   is a picture of a form, and a picture that can be typed into invites
   somebody to try. */
.fpreview {
  display: grid; gap: 12px;
  padding: 16px; background: var(--sunk);
  border: 1px solid var(--line); border-radius: var(--r2);
}
.fpreview__f { display: grid; gap: 5px; }
.fpreview__l { font: 600 12.5px/1.3 var(--ui); color: var(--body); }
.fpreview__l i { color: var(--c-red); font-style: normal; margin-left: 2px; }
.fpreview__box {
  display: block; height: 38px;
  background: #FFF; border: 1px solid var(--line); border-radius: var(--r1);
}
.fpreview__box--tall { height: 78px; }
.fpreview__box--select {
  display: flex; align-items: center; justify-content: flex-end;
  padding-right: 11px; color: var(--faint);
}
.fpreview__consent {
  display: flex; align-items: flex-start; gap: 9px;
  font-size: 12.5px; line-height: 1.5; color: var(--muted);
}
.fpreview__consent > span {
  width: 17px; height: 17px; flex: 0 0 auto; margin-top: 1px;
  background: #FFF; border: 1px solid var(--line); border-radius: 5px;
}
.fpreview__btn {
  display: grid; place-items: center;
  height: 40px; margin-top: 2px;
  background: var(--accent); color: var(--accent-on);
  border-radius: var(--r1); font: 600 14px/1 var(--ui);
}

/* --- M11, the certificate artboard --------------------------------------- */

/* The one place in the console that is a DOCUMENT rather than an interface.
   It is drawn at the proportions it prints at, with a rule inside the edge,
   and it deliberately does not look like a card. */
.cert {
  position: relative;
  display: grid; justify-items: center; gap: 0;
  padding: 30px 34px 26px; max-width: 560px; margin: 0 auto;
  background: #FFFDF8;
  border: 1px solid var(--c-amber-e);
  border-radius: var(--r2);
  text-align: center;
}
.cert::before {
  content: ""; position: absolute; inset: 9px;
  border: 1.5px solid var(--c-amber-e); border-radius: 10px; pointer-events: none;
}
.cert__top { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; }
.cert__wm { display: grid; gap: 1px; text-align: left; }
.cert__wm b { font: 800 14px/1.15 var(--display); color: var(--ink); letter-spacing: -.01em; }
.cert__wm span {
  font: 600 9px/1.2 var(--ui); letter-spacing: .14em; text-transform: uppercase;
  color: var(--muted);
}
.cert__kicker {
  font: 500 12px/1.3 var(--ui); letter-spacing: .12em; text-transform: uppercase;
  color: var(--muted);
}
.cert__name {
  margin: 8px 0 6px;
  font: 700 clamp(24px, 3vw, 32px)/1.15 var(--display);
  letter-spacing: -.02em; color: var(--ink);
  border-bottom: 1.5px solid var(--c-amber-e); padding-bottom: 8px;
  min-width: 60%;
}
.cert__line { max-width: 44ch; font-size: 14px; line-height: 1.6; color: var(--body); }

.cert__facts {
  display: flex; justify-content: center; gap: 28px; flex-wrap: wrap;
  margin: 18px 0 0; padding: 0;
}
.cert__facts > div { display: grid; gap: 2px; padding: 0; border: 0; }
.cert__facts dt {
  font: 600 9.5px/1.2 var(--ui); letter-spacing: .12em; text-transform: uppercase;
  color: var(--muted);
}
.cert__facts dd {
  margin: 0; font: 700 14px/1.2 var(--display); color: var(--ink);
  font-variant-numeric: tabular-nums;
}

.cert__sigs {
  display: flex; justify-content: center; gap: 44px; flex-wrap: wrap;
  margin-top: 26px;
}
.cert__sigs > span {
  display: grid; gap: 2px; min-width: 150px;
  font: 600 13px/1.3 var(--ui); color: var(--ink);
}
.cert__sigs i { display: block; height: 1.5px; background: var(--ink); margin-bottom: 7px; }
.cert__sigs small {
  font: 500 10.5px/1.2 var(--ui); letter-spacing: .1em; text-transform: uppercase;
  color: var(--muted);
}

@media (max-width: 519px) {
  .gmatrix { grid-template-columns: minmax(0, 1fr); }
  .gmatrix__head { display: none; }
  .cert { padding: 22px 18px 20px; }
  .cert__sigs { gap: 22px; }
}

/* ---------------------------------------------------------------------------
   29. Present or absent
   Two radios that behave as one control. The input stays in the markup and
   keeps the keyboard and the screen reader working; it is the label that is
   painted, and panel.js sets .is-on as the choice changes.
   ------------------------------------------------------------------------ */
/* --- the attendance picker ------------------------------------------------
   REBUILT 22 October against the reference screen: three states, each a
   RADIO with a drawn ring that fills when it is chosen, rather than a
   segmented pill. The ring is what the reference draws, and it reads at a
   glance down a column of twenty rows in a way a pill does not — a pill
   says "here are three buttons", a filled ring says "this one". */
.ppick {
  display: inline-flex;
  gap: 2px;
  flex: 0 0 auto;
  padding: 3px;
  background: var(--sunk);
  border: 1px solid var(--line);
  border-radius: var(--rp);
}
.ppick label {
  position: relative;
  display: inline-flex; align-items: center; gap: 7px;
  padding: 7px 13px; border-radius: var(--rp); cursor: pointer;
  font: 600 13px/1 var(--ui); color: var(--muted); white-space: nowrap;
  transition: background .15s ease, color .15s ease;
}
/* The drawn ring. A real <input type="radio"> is still underneath and still
   does all the work — this is its face, not a replacement for it. */
.ppick label::before {
  content: "";
  width: 14px; height: 14px;
  flex: 0 0 auto;
  border: 2px solid var(--faint);
  border-radius: var(--rp);
  transition: border-color .15s ease, box-shadow .15s ease;
}
.ppick input {
  position: absolute; inset: 0; width: 100%; height: 100%;
  margin: 0; opacity: 0; cursor: pointer;
}
.ppick label:hover { color: var(--ink); }
.ppick label.is-on { background: #FFF; box-shadow: var(--sh-rest); }

.ppick .is-present.is-on { color: var(--c-green); }
.ppick .is-present.is-on::before { border-color: var(--d-green); box-shadow: inset 0 0 0 3px var(--d-green); }
.ppick .is-absent.is-on  { color: var(--c-red); }
.ppick .is-absent.is-on::before  { border-color: var(--d-red);   box-shadow: inset 0 0 0 3px var(--d-red); }
.ppick .is-late.is-on    { color: var(--c-amber); }
.ppick .is-late.is-on::before    { border-color: var(--d-amber); box-shadow: inset 0 0 0 3px var(--d-amber); }
/* The same picker marks a fee or a book charge paid (F24, 26 Oct 2026). */
.ppick .is-paid.is-on   { color: var(--c-green); }
.ppick .is-paid.is-on::before   { border-color: var(--d-green); box-shadow: inset 0 0 0 3px var(--d-green); }
.ppick .is-unpaid.is-on { color: var(--c-red); }
.ppick .is-unpaid.is-on::before { border-color: var(--d-red);   box-shadow: inset 0 0 0 3px var(--d-red); }
/* In the fee register it sits under the status badge, a size smaller. */
.pfee__mark { display: flex; width: max-content; margin-top: 7px; }
.pfee__mark label { padding: 6px 7px; gap: 4px; font-size: 12px; }
.pfee__mark label::before { width: 12px; height: 12px; }
.pfee__tel { margin: 6px 0 0 44px; font-size: 12.5px; white-space: nowrap; }
@media (max-width: 767px) { .pfee__tel { margin-left: 0; } }
/* At 1280 the register ran 58px over its card and the marks slid under the
   pinned actions. Tighter cells on this one table between 1025 and 1366. */
@media (min-width: 1025px) and (max-width: 1366px) {
  .ptable:has(.pfee__mark) thead th, .ptable:has(.pfee__mark) tbody td { padding-inline: 6px; }
}

.ppick label:has(input:focus-visible) { outline: 3px solid var(--focus); outline-offset: 2px; }
.ppick label:has(input:disabled) { cursor: default; opacity: .7; }

/* ---------------------------------------------------------------------------
   30. The min-width rule
   A grid or flex CHILD defaults to min-width:auto, which means "never smaller
   than my content". One 660-unit chart or one unbreakable filename inside such
   a child then sets the width of everything above it and the page scrolls
   sideways — the §10 failure, and it is almost never visible until a phone
   is measured. Several of these screens build their own grids with an inline
   style, so the rule is applied to the containers rather than waiting for each
   one to be given a class.
   ------------------------------------------------------------------------ */
.grid > *,
.form-grid > *,
.pdetail > *,
.pdetail > * > *,
.pdetail__main > *,
.pdetail__rail > *,
.pcard > *,
.pcard__body > *,
.pcard__body > * > * { min-width: 0; }

/* The scrolling box itself, wherever it lands. .pcard is a flex column, so
   without this the table's own width becomes the card's width and the page
   scrolls instead of the table. */
.ptable__scroll { min-width: 0; max-width: 100%; }

/* A file input reports an intrinsic width of its shadow button plus the file
   name, which at 320px is wider than the screen. */
.file-drop input[type="file"], .cupload input[type="file"] { width: 100%; min-width: 0; }

@media (max-width: 420px) {
  .file-drop, .cupload { padding: 18px 12px; }
  .file-drop input[type="file"]::file-selector-button,
  .cupload input[type="file"]::file-selector-button {
    margin-right: 7px; padding: 7px 10px; font-size: 12.5px;
  }
  /* A long button label wraps rather than setting the width of its row. */
  .btn { white-space: normal; text-wrap: balance; }
}

/* ---------------------------------------------------------------------------
   31. Long words
   An email address, a pin-code list, a merge field or a route name has no
   space in it to break at, and on a 320px screen one of them is wider than
   the column it sits in. These are the places this console puts such values.
   ------------------------------------------------------------------------ */
.pfacts dd, .pdl dd,
.psoon__list li,
.pnote p, .pnote b,
.ptable td, .ptable th,
.pmsg__body { overflow-wrap: anywhere; }

/* ...but a FIGURE is one word and must never break. `anywhere` above is right
   for an email address and wrong for money: it split ₹20,000 across three
   lines in the fees register, where "₹20,0 / 00" reads as two numbers.
   `normal` still breaks at spaces, so "₹19,000 after ₹1,000 discount" wraps
   between its words while each figure stays whole. Every .ptable is inside a
   .ptable__scroll (42 of 42, checked), so a figure that will not break scrolls
   its table rather than widening the page. */
.ptable td.num, .ptable th.num { overflow-wrap: normal; }

.psoon__list { min-width: 0; }
.psoon__list li { min-width: 0; }

/* A token is shown whole where it fits and broken where it does not — it is
   still copied correctly either way. */
.mpattern, .ptable code, .fbuild__text code { overflow-wrap: anywhere; max-width: 100%; }

@media (max-width: 519px) {
  /* The label column of a fact list gives way first: the value is the thing
     somebody came to read. */
  .pfacts > div, .pdl > div { grid-template-columns: minmax(0, 1fr); gap: 2px; }
}

/* --- narrow-screen repairs to the editor rows -------------------------- */

/* The master picker sits above an editor and must not set a floor wider than
   a phone. */
.mswitch .select { width: 100%; min-width: 0; flex: 1 1 190px; }
.mswitch .btn { flex: 0 0 auto; }

/* An editor row carries a handle, a kind, a name, a type and its actions.
   That is more than fits across 320px, so the row wraps rather than pushing
   the page sideways. */
.cblocks > li,
.qcompose > li,
.ntrig > li { flex-wrap: wrap; }
.cblocks .acts__row,
.fbuild .acts__row,
.qcompose__a { margin-left: auto; }


/* ===========================================================================
   32. The two staff doors — /admin/login and /franchise/login

   Added 21 October 2026, the same day as the rest of this file. The two
   sign-in screens were deliberately left on the marketing stylesheet that
   morning (plan 11 §5, "open question for Yogesh") because they shared
   layouts/auth with the STUDENT door, which the client drew himself. His
   answer that evening was to redesign them as well, so they came here: a
   staff door is painted in the console it opens onto, and the child's door
   keeps its castle and its abacus on site.css.

   One shell, two doors. The anatomy is shared — a navy plate on the left
   saying what the place is, a white card on the right doing the work — and
   what separates them is the accent (§2 gives admin blue and a centre the
   brand's amber), the headline, and what each one lists. Nothing here is a
   gradient, a frosted panel or a centred stack of three identical cards;
   §7.1 applies to a door as much as to a dashboard.

   Laid out against the viewport's HEIGHT on desktop, so the card lands in the
   middle of the screen and the plate's own block is centred beside it. The
   CARD always fits. On a short laptop the last line of the plate can fall
   below the fold and the page scrolls — that is the right thing to give up,
   and the ornament goes before it does. Below 1024 the two columns cannot
   stand side by side and this becomes an ordinary page.
   ======================================================================== */

.gate {
  /* The glyph colour on the navy plate — bright enough to read as an icon at
     3:1 against #0F1D3A, and the one place each door says which it is. */
  --gate-ico: #93B4FF;

  display: grid;
  grid-template-columns: min(46%, 620px) minmax(0, 1fr);
  grid-template-rows: auto minmax(0, 1fr);
  min-height: 100dvh;
}
@supports not (height: 100dvh) { .gate { min-height: 100vh; } }

[data-panel="franchise"] .gate { --gate-ico: #F7B733; }

/* The plate is one navy column drawn as two rows, because on a phone its
   second half belongs UNDER the form: nobody scrolls past four bullet points
   to reach the field they came to type in. */
.gate__plate { grid-column: 1; grid-row: 1; }
.gate__more  { grid-column: 1; grid-row: 2; }
.gate__door  { grid-column: 2; grid-row: 1 / span 2; }

.gate__plate,
.gate__more {
  background: var(--rail); color: #FFF;
  padding-inline: clamp(24px, 3.4vw, 60px);
}
.gate__plate { padding-top: clamp(26px, 3.4vh, 52px); }
.gate__more {
  display: flex; flex-direction: column; justify-content: center;
  padding-bottom: calc(clamp(26px, 3vh, 48px) + env(safe-area-inset-bottom));
}

/* The focus ring that reads on white is not the one that reads on navy — the
   same problem the rail has, and the same answer. */
.gate__plate :focus-visible,
.gate__more :focus-visible { outline-color: #8FB4FF; }

/* ---- the plate: whose door this is ------------------------------------- */

.gate__brand {
  display: inline-flex; align-items: center; gap: 12px;
  color: inherit; text-decoration: none;
}
.gate__brand img { width: 42px; height: 42px; flex: 0 0 auto; }
.gate__wm { display: grid; gap: 1px; min-width: 0; }
.gate__wm-top {
  font: 700 10px/1 var(--ui); letter-spacing: .2em;
  text-transform: uppercase; color: var(--rail-label);
}
.gate__wm b {
  font: 800 17px/1.1 var(--display); letter-spacing: -.01em; color: #FFF;
}
.gate__brand:hover .gate__wm-top { color: var(--gate-ico); }

/* Eyebrow, headline, standfirst. The eyebrow carries a short rule in the
   door's own colour — the one piece of decoration on the plate, and it is
   also the thing saying which of the two doors you are standing in. */
.gate__eyebrow {
  display: flex; align-items: center; gap: 11px;
  margin-top: clamp(26px, 4.4vh, 58px);
  font: 700 11px/1 var(--ui); letter-spacing: .17em; text-transform: uppercase;
  color: var(--gate-ico);
}
.gate__eyebrow::after {
  content: ""; width: clamp(28px, 4vw, 54px); height: 2px;
  background: var(--gate-ico); opacity: .55;
}

.gate__h1 {
  margin-top: 15px; max-width: 19ch;
  font: 800 clamp(29px, 3.2vw, 46px)/1.06 var(--display);
  letter-spacing: -.025em; color: #FFF;
}
.gate__lead {
  margin-top: 15px; max-width: 48ch;
  font-size: clamp(14.5px, 1.05vw, 16.5px); line-height: 1.6;
  color: var(--rail-dim);
}

/* ---- the plate's foot: what is behind the door ------------------------- */

/* Hairlines, not cards. Four rules and four glyphs separate perfectly well on
   a navy column, and §7.2 asks for exactly that instead of a tinted box per
   item. */
.gate__what { margin-top: clamp(20px, 3vh, 34px); }
.gate__what li {
  display: grid; grid-template-columns: 34px minmax(0, 1fr); gap: 13px;
  padding: 13px 0;
  border-top: 1px solid var(--rail-line);
}
.gate__what li:last-child { border-bottom: 1px solid var(--rail-line); }

.gate__ico {
  display: grid; place-items: center;
  width: 34px; height: 34px;
  background: var(--rail-up); border-radius: var(--r1);
  color: var(--gate-ico);
}
.gate__what b { display: block; font: 600 14.5px/1.3 var(--ui); color: #FFF; }
.gate__what b + span {
  display: block; margin-top: 3px;
  font-size: 13px; line-height: 1.5; color: var(--rail-dim);
}

/* A state the reader is in, or is about to be in, rather than a feature: the
   centre's Pending Verification. A raised block with the door's colour down
   its left edge — the anatomy of .pnote inside the console, in the one
   palette that works on navy. */
.gate__flag {
  margin-top: clamp(18px, 2.6vh, 28px);
  padding: 14px 16px;
  background: var(--rail-up);
  border-left: 3px solid var(--gate-ico);
  border-radius: 0 var(--r1) var(--r1) 0;
}
.gate__flag b { display: block; font: 600 13.5px/1.35 var(--ui); color: #FFF; }
.gate__flag p { margin-top: 6px; font-size: 12.5px; line-height: 1.55; color: var(--rail-dim); }
.gate__flag a { color: #FFF; font-weight: 600; }
.gate__flag a:hover { color: var(--gate-ico); }

/* THE ABACUS. The one ornament on either door, and it is the product: four
   rods with their beads at four different counts, the way a frame looks
   part-way through a sum. Drawn rather than photographed, in the plate's own
   two greys plus the door's colour, and pushed to the foot of the column by
   the auto margin so the plate keeps air in its middle.

   aria-hidden in the markup: it says nothing a reader needs. */
.gate__rod {
  width: 100%; max-width: 352px; height: auto;
  margin-top: clamp(22px, 3.4vh, 44px);
  color: var(--rail-line);
}
.gate__bead { fill: var(--rail-up); stroke: #35496F; stroke-width: 1.5; }
.gate__bead--on { fill: var(--gate-ico); stroke: none; }

.gate__fine {
  display: grid; grid-template-columns: 18px minmax(0, 1fr); gap: 10px;
  margin-top: clamp(18px, 2.6vh, 28px);
  font-size: 12.5px; line-height: 1.55; color: var(--rail-label);
}
.gate__fine svg { color: var(--gate-ico); margin-top: 1px; }

/* ---- the door: the card, and what stands around it --------------------- */

.gate__door {
  min-width: 0;
  display: flex; flex-direction: column;
  background: var(--ground);
  padding: clamp(14px, 1.8vw, 24px) clamp(20px, 3.2vw, 56px)
           calc(clamp(14px, 1.8vw, 22px) + env(safe-area-inset-bottom));
}

.gate__out {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end;
  gap: 4px 20px;
}
.gate__out a {
  display: inline-flex; align-items: center; gap: 7px;
  min-height: 36px;
  font: 600 13.5px/1 var(--ui); color: var(--muted); text-decoration: none;
}
.gate__out a:hover { color: var(--accent-ink); }
.gate__out svg { color: var(--faint); }
.gate__out a:hover svg { color: var(--accent-ink); }

.gate__mid {
  flex: 1 1 auto; min-height: 0;
  display: flex; align-items: center; justify-content: center;
  padding-block: clamp(18px, 3vh, 44px);
}
.gate__stack { width: 100%; max-width: 472px; }

/* The card is the one thing on this screen that genuinely floats, which is
   what the shadow is for — §7.1 item 6 is about putting one on everything.
   The spine at its top edge is the console's card spine, in the door's
   accent. */
.gate__card {
  position: relative; overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--r4);
  padding: clamp(22px, 2.4vw, 34px);
  box-shadow: var(--sh-lift);
}
.gate__card::before {
  content: ""; position: absolute; top: 0; left: 0; right: 0; height: 3px;
  background: var(--accent);
}

.gate__h2 {
  font: 700 clamp(21px, 1.9vw, 26px)/1.18 var(--display);
  letter-spacing: -.015em; color: var(--ink);
}
.gate__sub { margin-top: 8px; font-size: 14px; line-height: 1.55; color: var(--body); }
.gate__sub a { font-weight: 600; }

.gate__form { margin-top: clamp(18px, 2.2vw, 26px); display: grid; gap: 15px; }

/* A field is a box with its glyph INSIDE it rather than beside it, so the
   label, the icon and the value read as one control. Focus is a 3px ring and
   the border is not swapped — nothing moves by a pixel, which is the rule
   §18 sets for every other field in this console. */
.gfield { display: grid; gap: 7px; min-width: 0; }
.gfield__label {
  font: 700 11px/1.3 var(--ui); letter-spacing: .085em; text-transform: uppercase;
  color: var(--muted);
}
.gfield__box {
  display: flex; align-items: center; gap: 11px;
  min-height: 50px; padding: 0 13px;
  background: #FFF; border: 1px solid var(--line); border-radius: var(--r1);
  transition: border-color .15s ease, box-shadow .15s ease;
}
.gfield__box:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-tint); }
.gfield__box > svg:first-child { flex: 0 0 auto; color: var(--faint); }
.gfield__box:focus-within > svg:first-child { color: var(--accent-ink); }

.gfield__in {
  flex: 1 1 auto; min-width: 0;
  padding: 0; border: 0; background: none;
  font: 400 15.5px/1.4 var(--ui); color: var(--ink);
  text-overflow: ellipsis;
}
.gfield__in:focus { outline: none; }
.gfield__in::placeholder { color: var(--faint); }

/* The show/hide control is a real button and keeps a focus ring of its own;
   the box's ring belongs to the box. */
.gfield__eye {
  flex: 0 0 auto; display: grid; place-items: center;
  width: 36px; height: 36px; margin-right: -7px;
  border-radius: 8px; color: var(--muted);
  transition: background .14s ease, color .14s ease;
}
.gfield__eye:hover { background: var(--sunk); color: var(--ink); }
/* Hidden is the resting state, so the eye starts struck through and the
   stroke comes off while the characters are showing — see gate.js. */
.gfield__eye[aria-pressed="true"] .gfield__slash { display: none; }

.gate__row {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: 8px 16px;
}
.gate__forgot { font: 600 13.5px/1 var(--ui); color: var(--accent-ink); text-decoration: none; }
.gate__forgot:hover { color: var(--ink); text-decoration: underline; }

/* The one primary action on the screen, at the size a primary action takes on
   a door rather than in a toolbar. */
.gate__go {
  min-height: 50px;
  font: 700 16px/1 var(--display); letter-spacing: -.01em;
}

.gate__feet {
  display: grid; gap: 8px;
  margin-top: 20px; padding-top: 17px;
  border-top: 1px solid var(--line);
  font-size: 13px; line-height: 1.5; color: var(--muted);
}
.gate__feet a { font-weight: 600; }

/* Small print under the card: what the account does when it is used wrongly.
   A row of plain lines with a glyph each, not three tinted cards. */
.gate__trust {
  display: flex; flex-wrap: wrap; gap: 7px 18px;
  margin-top: 16px; padding-inline: 4px;
}
.gate__trust li {
  display: flex; align-items: center; gap: 7px;
  font-size: 12.5px; color: var(--muted);
}
.gate__trust svg { flex: 0 0 auto; color: var(--faint); }

.gate__foot {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: 6px 20px;
  padding-top: 14px; border-top: 1px solid var(--line);
  font-size: 12.5px; line-height: 1.5; color: var(--muted);
}
.gate__foot a { color: var(--muted); text-decoration: none; }
.gate__foot a:hover { color: var(--accent-ink); }
.gate__legal { display: flex; flex-wrap: wrap; gap: 4px 16px; }

/* ---- stacked -----------------------------------------------------------
   Below 1024 the plate cannot stand beside the card and still hold a 46px
   headline, so the screen becomes one column and the page scrolls like any
   other. The order is deliberate: the plate's head, then the FORM, then what
   is behind the door. A door that puts four bullet points between the reader
   and the password field is a worse door on a phone than on a desktop.
   ---------------------------------------------------------------------- */
@media (max-width: 1023px) {
  .gate {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto auto auto;
    min-height: 0;
  }
  .gate__plate { grid-column: 1; grid-row: 1; padding-bottom: clamp(24px, 4.4vw, 34px); }
  .gate__door  { grid-column: 1; grid-row: 2; }
  .gate__more  { grid-column: 1; grid-row: 3; padding-top: clamp(24px, 4.4vw, 34px); }

  /* Every size on the plate was tied to the viewport's HEIGHT so the desktop
     screen could hold still without a scrollbar. Once the page scrolls that
     is the wrong measure — a short landscape phone would shrink the headline
     for no reason — so the plate goes back to width-based sizes here. */
  .gate__eyebrow { margin-top: clamp(22px, 5vw, 32px); }
  .gate__h1 { font-size: clamp(27px, 6.4vw, 38px); max-width: 24ch; }
  .gate__lead { font-size: clamp(14.5px, 3.6vw, 16px); }
  .gate__what { margin-top: clamp(18px, 4vw, 26px); }
  .gate__rod { margin-top: clamp(22px, 4.4vw, 32px); align-self: center; }
  .gate__mid { padding-block: clamp(20px, 5vw, 34px); }
  .gate__stack { max-width: 520px; }
}

@media (max-width: 767px) {
  /* 16px minimum on a control, or iOS Safari zooms the page in on focus and
     never zooms back out — §2.3. */
  .gfield__in { font-size: 16px; }
  .gate__out { justify-content: flex-start; }
  .gate__foot, .gate__legal { font-size: 12px; }
}

@media (max-width: 420px) {
  .gate__card { padding: 20px 16px; border-radius: var(--r3); }
  .gate__brand img { width: 36px; height: 36px; }
  .gate__wm b { font-size: 15.5px; }
}

/* The preview note at the top of the card. Said once, plainly, before the
   fields: nothing on either door signs anybody in yet (standards §5.3). */
.gate__demo { margin-bottom: clamp(16px, 2vw, 22px); }
.gate__demo b { display: block; margin-bottom: 3px; font-weight: 700; color: var(--ink); }

/* ---- short screens ------------------------------------------------------
   The two columns are laid out against the viewport's HEIGHT above 1024, and
   a laptop is a short screen: 768px of height, minus nothing, is what has to
   hold a plate with a headline, four items and a state note on it.

   So the ornament is the first thing to go — it is decoration, and the list,
   the flag and the fine print are not — and then the list tightens. Below
   that the page simply scrolls, which is the honest end of the sequence: a
   door that shrinks its own type to avoid a scrollbar is a worse door.
   ---------------------------------------------------------------------- */
@media (min-width: 1024px) and (max-height: 900px) {
  .gate__rod { display: none; }
}
@media (min-width: 1024px) and (max-height: 780px) {
  .gate__what li { padding: 10px 0; }
  .gate__what b + span { margin-top: 2px; }
  .gate__flag { padding: 12px 14px; }
  .gate__eyebrow { margin-top: clamp(20px, 3vh, 34px); }
}

/* ---------------------------------------------------------------------------
   39. Late corrections — rules that have to win on source order

   Three rules whose selectors tie with an earlier one on specificity, so
   they are collected here rather than given an artificial extra class.
   ------------------------------------------------------------------------ */

/* The burger carries .icon-btn as well, and .icon-btn is declared after §7.
   Same specificity, later wins — so the bar's hidden burger came back at
   every width. It is a drawer control and belongs to §36's breakpoint. */
.ptop .ptop__burger { display: none; }
@media (max-width: 1023px) {
  .ptop .ptop__burger { display: inline-grid; }
}

/* The metric tile reads LABEL then FIGURE, which is the order the reference
   screens use and the order a person says it in ("total students: 128").
   The Blade writes the figure first — .kpi__num is a sibling of .kpi__top,
   not a child of it — so the label is lifted out of .kpi__top and the two
   are re-ordered here rather than by editing forty-eight screens. */
.kpi { grid-template-areas: "ico label" "ico num" "foot foot"; align-content: center; }
.kpi__top   { display: contents; }
.kpi__ico   { grid-area: ico; align-self: center; }
.kpi__label { grid-area: label; align-self: end; }
.kpi__num   { grid-area: num; align-self: start; }
.kpi__foot  { grid-area: foot; margin-top: 10px; }

/* Tiles in one row read at one height. Centring the content let a tile with
   no foot line drop its figure lower than its neighbours' (F fee-student,
   23 Oct) — so the figure sits at the top and the foot at the bottom. */
.kpi { align-content: stretch; grid-template-rows: auto auto 1fr; }
.kpi__foot { align-self: end; }

/* And the figure is sized by the TILE, not the window. Four tiles beside a
   rail are half as wide as four across the page, and a 30px "₹18,000" ran
   out of its tile there. */
.kpi { container-type: inline-size; }
.kpi__num { font-size: clamp(19px, 13cqi, 30px); }
/* A link inside a fact list — a phone number, an email — is a value first.
   The browser's blue underline made it the loudest thing in the card. */
:is(.pfacts, .pdl) a { color: var(--accent-ink); font-weight: 600; text-decoration: none; }
:is(.pfacts, .pdl) a:hover { text-decoration: underline; }

/* A rail card's single footer action fills the footer, as the block buttons
   in the rail's other cards do. */
.pdetail__rail .pcard__foot > .btn:only-child { flex: 1 1 100%; justify-content: center; }

@container (max-width: 190px) {
  .kpi__ico { width: 40px; height: 40px; }
  .kpi__ico svg { width: 18px; height: 18px; }
  .kpi__label { white-space: normal; text-overflow: clip; }
}

/* ---------------------------------------------------------------------------
   40. Narrow-screen repairs, 22 October

   Standards §10: no horizontal scroll at any width from 320 to 2560. These
   are the four places the rebuild broke that, found by measuring 58 staff
   routes at six widths in a same-origin iframe rather than by reading the
   markup — none of them is visible on a desktop.

   The pattern in three of the four is the same: a group of buttons told
   `flex: 0 0 auto` so it would sit at the end of its bar, which also
   forbids it to SHRINK. A 427px row of three buttons then sets a floor the
   320px viewport cannot meet, and the whole page scrolls sideways.
   `flex: 0 1 auto` with `min-width: 0` keeps the alignment and lets the row
   wrap, which is what .btn-row's own `flex-wrap` was always for.
   ------------------------------------------------------------------------ */
.ptools > .btn-row {
  flex: 0 1 auto;
  min-width: 0;
  justify-content: flex-end;
}

.pcard__tools {
  flex: 0 1 auto;
  min-width: 0;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.srow__end { flex-wrap: wrap; justify-content: flex-end; min-width: 0; }

/* A row of three — glyph, text, actions — has to be allowed to become a row
   of two and a wrapped third below 520px, or the actions push the text out. */
@media (max-width: 520px) {
  .srow { grid-template-columns: auto minmax(0, 1fr); }
  .srow__end { grid-column: 1 / -1; justify-content: flex-start; }
}

/* The shop and the quick-action grid are the two new grids with a fixed
   column count. Cut from the CONTENT column, the same way §27 cuts the
   others: window minus the rail minus the gutters, with a step back up at
   1023px where the rail leaves the flow and hands back its 256 pixels. */
@media (max-width: 1400px) { .pshop { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 1180px) { .pshop { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 1023px) { .pshop { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 860px)  { .pshop { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 460px)  { .pshop, .pquick { grid-template-columns: minmax(0, 1fr); } }

/* The filter fields in a tool bar carry a .field wrapper with an inline
   flex-basis, which on a phone is a floor rather than a preference. */
@media (max-width: 560px) {
  .ptools > .field { flex: 1 1 100% !important; }
  .ptools > .btn   { width: 100%; }
}

/* A breadcrumb with four steps and long labels is wider than 320px, and it
   is a trail rather than a sentence — it may wrap. */
.pcrumb, .pcrumb li { min-width: 0; }
.pcrumb a, .pcrumb [aria-current="page"] { overflow-wrap: anywhere; }

/* ---------------------------------------------------------------------------
   41. The student's avatar in a staff list

   22 October: "student che avtar use kara list madhe show hoil tevha."

   The child's own character, drawn by the client, in place of the two grey
   initials the console had been using. A list of twenty children reads as a
   list of children rather than a list of rows, and the character is the one
   thing on these screens a parent would recognise.

   It takes the SAME footprint as .pav — same diameter, same place in the
   identity cell — so swapping one for the other changes no layout. A ring
   rather than a border: the artwork runs to the edge of its square and a
   hard 1px line against it reads as a crop.
   ------------------------------------------------------------------------ */
.savatar {
  display: block;
  flex: 0 0 auto;
  width: 34px; height: 34px;
  border-radius: var(--rp);
  object-fit: cover;
  background: var(--accent-tint);
  box-shadow: 0 0 0 1px var(--line) inset, 0 0 0 2px var(--surface);
}

/* The register rows and the identity cell both set their own size. */
.proster__who .savatar { width: 38px; height: 38px; }
.ptable__who .savatar,
.pwho .savatar { width: 34px; height: 34px; }

/* An inline token in prose — a merge field, a pin code, a URL — set so it
   breaks rather than widening the page. The §38 rule names three specific
   places; the competition screen puts them in a plain <p> and <li>, which
   is how 88px of sideways scroll got onto a phone. */
code {
  overflow-wrap: anywhere;
  max-width: 100%;
}

/* ---------------------------------------------------------------------------
   42. Phone repairs from the all-pages sweep, 23 October

   Found by measuring every staff route at 320–1440 for anything standing
   outside its card. Both are fixed-width things that cannot give way.
   ------------------------------------------------------------------------ */

/* A status chip with a sentence in it ("Approve includes edit, edit includes
   view") wraps rather than pushing out of its card on a small phone. NOT in
   a table cell: there a chip is a word or two and the cell is narrow, and
   letting it wrap printed "Level 2" one letter per line. */
@media (max-width: 519px) {
  .st:not(td .st) { white-space: normal; max-width: 100%; }
}

/* The Present / Absent / Late picker is three pills that never wrap; at 320
   their padding alone was 13px wider than the card. */
@media (max-width: 380px) {
  .ppick { max-width: 100%; }
  .ppick label { padding: 7px 8px; gap: 5px; }
}

/* The cart rail (F10, 23 Oct). .pcart__text is a grid, so the stepper took
   the width left over beside the price and every line's stepper was a
   different length — ₹2,200 and ₹350 do not leave the same room. It keeps its
   own width now. The thumb centres its glyph, and the price sits level with
   the item's name and the bin level with the stepper. */
.pcart__line { align-items: stretch; }
.pcart__text .pstep { justify-self: start; }
.pcart__thumb {
  display: grid; place-items: center;
  align-self: center;
  padding: 0;
  color: var(--c-blue);
}
.pcart__end { align-content: space-between; }
.pcart__end .ract { width: 34px; height: 34px; }

/* A date box is 44px like its neighbours; its calendar glyph made it 46. */
.input:is([type="date"], [type="month"], [type="time"], [type="week"]) { height: 44px; }
@media (max-width: 767px) {
  .input:is([type="date"], [type="month"], [type="time"], [type="week"]) { height: 46px; }
}

/* Tabs are one row. Wrapping dropped "Flash cards" onto a second line under
   the shop's other six, where it read as a heading. They scroll sideways
   instead, and the rule under them is drawn inside the box so the scroll
   container does not clip the selected tab's underline. */
.ptabs {
  flex-wrap: nowrap;
  overflow-x: auto;
  scrollbar-width: none;
  border-bottom: 0;
  box-shadow: inset 0 -1px 0 var(--line);
}
.ptabs::-webkit-scrollbar { display: none; }
.ptabs { gap: 0; }
.ptabs a, .ptabs button { flex: 0 0 auto; white-space: nowrap; margin-bottom: 0; padding-inline: 12px; }

/* ---------------------------------------------------------------------------
   43. The all-pages visual review, 23 October

   Fifty-seven staff screens photographed at 1366 and 390 and looked at. Most
   of what was wrong came from a handful of shared rules, fixed here once.
   ------------------------------------------------------------------------ */

/* A bulk bar is hidden until something is ticked. It is display:flex, which
   beats the [hidden] attribute, so "0 selected" sat on four screens all the
   time. And it is a pale bar: its actions were white-on-navy buttons, nearly
   invisible on it. */
.pbulk[hidden] { display: none; }
.pbulk .btn--on-navy {
  background: var(--accent);
  border-color: var(--accent);
  color: #FFFFFF;
}
.pbulk .btn--on-navy:hover { background: var(--accent-deep); }
.pbulk .btn[disabled] { opacity: .55; }

/* A note's TITLE is a block <b>; a <b> inside its sentence is just bold.
   The block rule reached both and broke "…appears in both Navi Mumbai —
   Thane and a pending…" into five stacked lines (regions). */
.pnote p b, .pnote p strong { display: inline; font: inherit; font-weight: 600; color: var(--ink); }

/* A card footer holding a sentence — text with a link or a bold word in it —
   is prose, not a flex row. As a row, each text run and link was its own
   item: "…lives in / M6 , capped…" (games, forms, notifications, content). */
.pcard__foot:not(:has(> .btn, > .btn-row, > button, > a.btn, > form, > .pager, > .ppage)) {
  display: block;
  font: 400 13px/1.55 var(--ui);
  color: var(--muted);
}

/* A card head wraps its tools under the title when there is no room beside
   it, instead of the badge or toggle being drawn over the title on a phone
   (masters/edit, masters/roles, the admin enrolment chart). */
.pcard__head { flex-wrap: wrap; row-gap: 8px; }
.pcard__head h2, .pcard__head h3 { flex: 1 1 160px; }

/* Tables: a cell breaks between words, never inside one. `anywhere` let the
   browser squeeze a column down to ONE character, so on a phone a table fit
   its card by making every row 150px tall ("Competitio / n", "Attendan / ce",
   an email in three pieces). With break-word a cell is at least its longest
   word wide, and a table that does not fit scrolls inside its .ptable__scroll
   — which is what that box is for. */
.ptable td, .ptable th { overflow-wrap: break-word; }
.ptable td a[href^="mailto:"] { white-space: nowrap; }


/* A row that IS a link (the masters index) is a row, not underlined blue
   text from end to end. */
a.srow { color: inherit; text-decoration: none; }
a.srow:hover { border-color: var(--accent-edge); }

/* An em-dash list: the dash is the marker and the line is text. As a flex
   row, every word and <code> in it became an item and broke apart on a phone
   ("T / he competit / ions"). */
.psoon__list li { display: block; padding-left: 20px; text-indent: -20px; }
.psoon__list li::before { display: inline-block; width: 20px; text-indent: 0; }

/* A document row is a <button>, which centres its text. Its name sits by its
   icon like the missing-document row beside it does. */
.pdoc { text-align: left; }

/* A step bar written with its own number in a <b> — or a tick for a done
   step — showed that AND the CSS counter: "① 1 Student details". The <b>
   becomes the badge and the counter steps aside. */
.psteps li:has(> b)::before { display: none; }
.psteps li > b {
  display: grid; place-items: center;
  width: 22px; height: 22px; flex: 0 0 auto;
  border-radius: var(--rp);
  background: var(--line-soft);
  font: 700 12px/1 var(--ui);
  color: var(--muted);
}
.psteps li[aria-current="step"] > b { background: var(--accent); color: #FFFFFF; }
.psteps li.is-done > b { background: var(--d-green); color: #FFFFFF; }
.psteps .link-plain { color: inherit; text-decoration: none; }
.psteps .link-plain:hover { text-decoration: underline; }

/* The upload tile holds an <img> in a <span>; centre it. */
.cupload__thumb { display: grid; place-items: center; }

/* Content blocks: the kind pill is one width, so the titles after it start
   on one line down the page. */
.cblock__kind { min-width: 92px; text-align: center; white-space: nowrap; }

/* A column of figures is right-aligned, and so is its heading — whether or
   not the <th> was given .num by hand (games, questions and others were not,
   so "SECONDS" sat left over numbers that sat right). */
.ptable:has(tbody tr:first-child > td.num:nth-child(1)) thead th:nth-child(1),
.ptable:has(tbody tr:first-child > td.num:nth-child(2)) thead th:nth-child(2),
.ptable:has(tbody tr:first-child > td.num:nth-child(3)) thead th:nth-child(3),
.ptable:has(tbody tr:first-child > td.num:nth-child(4)) thead th:nth-child(4),
.ptable:has(tbody tr:first-child > td.num:nth-child(5)) thead th:nth-child(5),
.ptable:has(tbody tr:first-child > td.num:nth-child(6)) thead th:nth-child(6),
.ptable:has(tbody tr:first-child > td.num:nth-child(7)) thead th:nth-child(7),
.ptable:has(tbody tr:first-child > td.num:nth-child(8)) thead th:nth-child(8),
.ptable:has(tbody tr:first-child > td.num:nth-child(9)) thead th:nth-child(9),
.ptable:has(tbody tr:first-child > td.num:nth-child(10)) thead th:nth-child(10),
.ptable:has(tbody tr:first-child > td.num:nth-child(11)) thead th:nth-child(11),
.ptable:has(tbody tr:first-child > td.num:nth-child(12)) thead th:nth-child(12),
.ptable:has(tbody tr:first-child > td.num:nth-child(13)) thead th:nth-child(13),
.ptable:has(tbody tr:first-child > td.num:nth-child(14)) thead th:nth-child(14) { text-align: right; }

/* The period toggle on Performance marks its choice with aria-pressed. */
.ptoggle [aria-pressed="true"] { background: var(--surface); color: var(--accent-deep); box-shadow: var(--sh-rest); }

/* On a laptop the panel's tables were a column too wide for their card at
   1366 — the franchises' "Review" button and the leads' Owner sat half
   behind the edge. A little less air between columns there fits them. */
@media (max-width: 1440px) {
  .ptable thead th, .ptable tbody td { padding-inline: 10px; }
  .ptable thead th:first-child, .ptable tbody td:first-child { padding-left: 15px; }
  .ptable thead th:last-child, .ptable tbody td:last-child { padding-right: 15px; }
}

/* An email or link in a table row is a value, not the loudest thing in it. */
.ptable .link-plain { text-decoration: none; }
.ptable .link-plain:hover { text-decoration: underline; }

/* (Tablet and up: on a phone the pinned column covered most of the table.)
   A wide table scrolls, but its row actions stay in reach: the actions column
   is pinned to the right edge, over a soft edge so it reads as lifted. Ten
   tables are wider than their card at 1366 by design (their columns carry
   minimum widths); this is what kept "Review" half behind the card edge. */
@media (min-width: 768px) {
  .ptable th.acts, .ptable td.acts {
    position: sticky;
    right: 0;
    background: var(--surface);
    box-shadow: -10px 0 12px -10px rgba(16, 32, 64, .18);
    border-left: 1px solid var(--line-soft);
  }
  .ptable thead th.acts { background: var(--sunk); z-index: 2; }
  .ptable tbody tr:hover td.acts { background: var(--accent-tint); }
  .ptable thead th.acts { box-shadow: none; }
}

/* Mark attendance: the caption row and each student row are SEPARATE grids,
   so their two `auto` tracks resolved to different widths and the captions
   drifted — "LEVEL / BATCH" 100px right of the pills, "ATTENDANCEREMARKS"
   run together. Fixed tracks are the same in both. The caption also takes
   the row's border into its padding and the row's column gap. */
@media (min-width: 1100px) {
  .proster__caption,
  .proster__row {
    grid-template-columns: 28px minmax(150px, 1.4fr) 104px 160px 252px minmax(150px, 1fr);
    column-gap: 14px;
  }
  .proster__caption { padding: 0 14px 2px; }
  .proster__row .ppick { justify-self: start; }
}

/* Monthly view: a student's name is the row's heading but reads as a name,
   not as a column caption; the day numbers sit over the chips they head. */
.pmonth tbody th {
  text-align: left;
  font: 600 13.5px/1.35 var(--ui);
  letter-spacing: 0;
  text-transform: none;
  color: var(--ink);
  white-space: nowrap;
}
.pmonth thead th:not(:first-child) { text-align: center; }

/* A checkbox row used as a LABEL (checkout's "send it somewhere else") is
   not a table's checkbox column, which is all the 1% width was for. */
label.check-row { width: auto; }

/* Pills beside a page title sit on one line. */
.phead__text:has(> .st) { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.phead__text > .st { margin-left: 0 !important; }

/* Timeline glyphs are readable at 26px, not 8px. */
.plog__dot svg { width: 14px; height: 14px; }

/* On a phone a document row and a notice put their buttons UNDER the text
   instead of squeezing it into a 50px column beside them. */
@media (max-width: 519px) {
  .pdoc { grid-template-columns: auto minmax(0, 1fr); }
  .pdoc > :nth-child(n+3) { grid-column: 1 / -1; justify-self: start; }
}
.pdoc__name, .pdoc__meta { display: block; }
@media (max-width: 519px) {
  /* A notification's button drops under its text on a phone. */
  .nitem > .btn { grid-column: 2; justify-self: start; }
}

/* A plain link in running text ("the issue register", "Open level
   completion") is the accent and semibold, underlined on hover only — the
   same as every other link the console draws, instead of a browser link. */
.pbody a:not([class]) { font-weight: 600; text-decoration: none; }
.pbody a:not([class]):hover { text-decoration: underline; }
.kpi__foot a:not([class]) { color: inherit; }

/* Quick-action tiles are <button>s and centred their text; it reads from the
   left like the link tiles beside them. */
.pquick__item { text-align: left; }

/* A support message: the avatar sits beside the name and text, not above. */
.pmsg:has(> .pav) { grid-template-columns: auto minmax(0, 1fr); column-gap: 11px; align-items: start; }
.pmsg__who { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px; }
.pmsg__who b { color: var(--ink); }

/* Priority words are chips, with room inside them. */
.ppri { display: inline-flex; align-items: center; padding: 3px 10px; border-radius: var(--rp); font: 600 12.5px/1.4 var(--ui); white-space: nowrap; }

/* Where four or three tiles fall into two columns, an odd last tile takes the
   whole row instead of sitting alone at half width (certificates, former
   students). One column below 360px, where this does not arise. */
@media (min-width: 1024px) and (max-width: 1180px), (min-width: 360px) and (max-width: 879px) {
  :is(.grid--4, .grid--3) > :last-child:nth-child(odd) { grid-column: 1 / -1; }
}

/* Chart labels are read at ~12px whatever width the chart is drawn at. The
   SVG is 660 units wide and scales to its card, and its text scaled with it:
   6px in a dashboard half-card and on a phone, 20px across a full-width
   report. The scale is undone here — 660px over the drawn width, worked out
   with atan2 because CSS cannot divide one length by another. */
.pchart { container-type: inline-size; }
.pchart svg { overflow: visible; }
.pchart svg text { font-size: calc(12px * tan(atan2(660px, 100cqi))); }

/* Cards in a row whose last thing is a full-width button keep that button
   on one line across the row (level certificates: "Download PDF" sat higher
   in a card with a shorter sentence above it). Not a metric tile that is
   also a .pcard — it is a grid of its own, and flex broke it (leads, 23 Oct). */
.grid > .pcard:not(.kpi) { display: flex; flex-direction: column; }
.grid > .pcard > .pcard__body:has(> .btn--block:last-child) {
  flex: 1 1 auto;
  display: flex; flex-direction: column; align-items: flex-start;
}
.grid > .pcard > .pcard__body > .btn--block:last-child { margin-top: auto; }

/* A row ending in a status chip and then an action: the action gets a
   fixed slot so the chips line up down the list whether the row ends in a
   button or an arrow (centre partnerships). */
@media (min-width: 520px) {
  .srow__end:has(> .st + :is(.btn, .icon-btn)) {
    display: grid;
    grid-template-columns: auto 168px;
    align-items: center;
    justify-items: end;
    gap: 12px;
  }
}

/* The form builder on a phone: a wrapping flex row put each field's type chip
   somewhere different depending on how long its name was. Two fixed lines
   instead — handle, name, actions; then type and Required under the name. */
@media (max-width: 519px) {
  .fbuild > li {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    grid-template-areas: "drag text acts" ". meta meta";
    align-items: center;
    column-gap: 10px; row-gap: 6px;
  }
  .fbuild > li > .mdrag { grid-area: drag; }
  .fbuild > li > .fbuild__text { grid-area: text; }
  .fbuild > li > .acts__row { grid-area: acts; margin-left: 0; }
  .fbuild > li > .fbuild__type { grid-area: meta; justify-self: start; }
  .fbuild > li > .fbuild__req { grid-area: meta; justify-self: end; }
}

/* ---------------------------------------------------------------------------
   44. Section banners — colour and pictures on staff screens, 23 October

   The client asked for the staff panels to carry the colour and imagery the
   student portal and the website have. One component, <x-pbanner>: a flat
   tinted card, a heading, and a picture standing on a flat blob with two
   dots — shapes, not gradients, which this sheet does not use.
   ------------------------------------------------------------------------ */
.pbanner {
  --bn-t: var(--c-blue-t); --bn-e: var(--c-blue-e); --bn-c: var(--c-blue); --bn-d: var(--d-blue);
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 260px;
  align-items: center;
  gap: 18px;
  min-height: 150px;
  padding: 22px 0 22px 26px;
  overflow: hidden;
  border: 1px solid var(--bn-e);
  border-radius: var(--r3);
  background: var(--bn-t);
}
.pbanner--green  { --bn-t: var(--c-green-t);  --bn-e: var(--c-green-e);  --bn-c: var(--c-green);  --bn-d: var(--d-green); }
.pbanner--amber  { --bn-t: var(--c-amber-t);  --bn-e: var(--c-amber-e);  --bn-c: var(--c-amber);  --bn-d: var(--d-amber); }
.pbanner--violet { --bn-t: var(--c-violet-t); --bn-e: var(--c-violet-e); --bn-c: var(--c-violet); --bn-d: var(--d-violet); }
.pbanner--pink   { --bn-t: var(--c-pink-t);   --bn-e: var(--c-pink-e);   --bn-c: var(--c-pink);   --bn-d: var(--d-pink); }
.pbanner--teal   { --bn-t: var(--c-teal-t);   --bn-e: var(--c-teal-e);   --bn-c: var(--c-teal);   --bn-d: var(--d-teal); }
.pbanner--orange { --bn-t: var(--c-orange-t); --bn-e: var(--c-orange-e); --bn-c: var(--c-orange); --bn-d: var(--d-orange); }

.pbanner__text { position: relative; z-index: 1; min-width: 0; display: grid; gap: 6px; justify-items: start; }
.pbanner__eyebrow {
  display: inline-flex; padding: 3px 10px;
  border-radius: var(--rp);
  background: #FFFFFF;
  font: 700 11px/1.4 var(--ui); letter-spacing: .08em; text-transform: uppercase;
  color: var(--bn-c);
}
.pbanner__text h2 { font: 700 clamp(20px, 2vw, 25px)/1.2 var(--display); letter-spacing: -.02em; color: var(--ink); }
.pbanner__text p { max-width: 62ch; font: 400 14px/1.55 var(--ui); color: var(--body); }
.pbanner__acts { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 6px; }
.pbanner__text .pbanner__quote { font: italic 600 14px/1.45 var(--display); color: var(--bn-c); }

.pbanner__art { position: relative; align-self: stretch; min-height: 130px; }
.pbanner__blob {
  position: absolute; right: -46px; top: 50%;
  width: 230px; height: 230px;
  border-radius: 50%;
  background: var(--bn-d);
  opacity: .22;
  transform: translateY(-50%);
}
.pbanner__dot { position: absolute; border-radius: 50%; background: var(--bn-d); }
.pbanner__dot--a { width: 14px; height: 14px; left: 18px; top: 14px; opacity: .55; }
.pbanner__dot--b { width: 9px; height: 9px; left: 46px; bottom: 16px; opacity: .8; }

/* A photograph is a print, tilted a little, with a white border. */
.pbanner__photo {
  position: absolute; right: 26px; top: 50%;
  width: 190px; height: 126px;
  object-fit: cover;
  border: 5px solid #FFFFFF;
  border-radius: 16px;
  box-shadow: var(--sh-lift);
  transform: translateY(-50%) rotate(2.5deg);
}
/* Faces are the children's own avatars, overlapping, each ringed in white. */
.pbanner__faces {
  position: absolute; right: 22px; top: 50%;
  display: flex;
  transform: translateY(-50%);
}
.pbanner__faces img {
  width: 76px; height: 76px;
  margin-left: -18px;
  border: 4px solid #FFFFFF;
  border-radius: 50%;
  object-fit: cover;
  box-shadow: var(--sh-rest);
}
.pbanner__faces img:nth-child(even) { transform: translateY(14px); }

@media (max-width: 767px) {
  .pbanner { grid-template-columns: minmax(0, 1fr); padding: 20px 20px 0; min-height: 0; }
  .pbanner__art { min-height: 120px; margin: 0 -20px; }
  .pbanner__photo { right: 50%; transform: translate(50%, -50%) rotate(2.5deg); width: 200px; height: 104px; }
  .pbanner__faces { right: 50%; transform: translate(50%, -50%); }
  .pbanner__faces img { width: 62px; height: 62px; }
  .pbanner__blob { right: 50%; transform: translate(50%, -10%); width: 260px; height: 260px; }
}

/* On a laptop the hand-set minimum column widths (Student 190px, Batch
   130px …) added up to more than the card, so ten tables ran under their
   pinned action column and showed "28 Sep 20", "Needs a", "₹1,". Below 1440
   those minimums give way and the columns fit by wrapping between words. */
@media (max-width: 1440px) {
  .ptable th[style*="min-width"] { min-width: 0 !important; }
}
/* Same for a table declared .ptable--wide (860px): beside a rail its card is
   ~690px, so cart and issue register always ran under the pinned column. On
   a phone it keeps the 860 and scrolls, which is what it was for. */
@media (min-width: 768px) and (max-width: 1440px) {
  .ptable--wide { min-width: 0; }
}

/* ── §45  Scorecard and stock movements (27 Oct 2026) ──────────────────
   A21's six-month sparkline and score pill, and A20's +/− quantities.
   Colour carries direction here, so each also has a sign or a word beside
   it: −12 and "Students falling" say the same thing without the red. */
.pspark { display: inline-flex; align-items: center; gap: 10px; }
.pspark svg { flex: 0 0 auto; overflow: visible; }
.pspark polyline { fill: none; stroke-width: 2.25; stroke-linecap: round; stroke-linejoin: round; }
.pspark--up   { color: var(--c-green); }
.pspark--down { color: var(--c-red); }
.pspark polyline { stroke: currentColor; }
.pspark circle { fill: currentColor; stroke: var(--surface, #FFFFFF); stroke-width: 1.5; }
.pspark b { color: var(--ink); font-variant-numeric: tabular-nums; }

.pdelta { font-variant-numeric: tabular-nums; }
.pdelta--up   { color: var(--c-green); }
.pdelta--down { color: var(--c-red); }
.pdelta--flat { color: var(--muted); }

.pscore {
  display: inline-grid; place-items: center;
  min-width: 42px; height: 30px; padding: 0 8px;
  border-radius: 999px; border: 1px solid;
  font: 700 14px/1 var(--ui); font-variant-numeric: tabular-nums;
}
.pscore--good { background: var(--c-green-t); border-color: var(--c-green-e); color: var(--c-green); }
.pscore--warn { background: var(--c-amber-t); border-color: var(--c-amber-e); color: var(--c-amber); }
.pscore--bad  { background: var(--c-red-t);   border-color: var(--c-red-e);   color: var(--c-red); }

.pflags { display: inline-flex; flex-wrap: wrap; gap: 6px; }

.pmove { font-variant-numeric: tabular-nums; }
.pmove--in  { color: var(--c-green); }
.pmove--out { color: var(--c-red); }

/* A21 asks for its flagged centres to be HIGHLIGHTED, not just marked — so
   on .ptable--score the whole row takes a tint, and red (both signals) is
   told apart from amber (one). Scoped to the scorecard: on other tables a
   spine is all a flag has ever been. */
.ptable tbody tr[data-flag="bad"] td:first-child { box-shadow: inset 3px 0 0 var(--d-red); }
.ptable--score tbody tr[data-flag="warn"] td { background: var(--c-amber-t); }
.ptable--score tbody tr[data-flag="bad"] td  { background: var(--c-red-t); }

/* ── §46  The admin dashboard, rebuilt to the client's reference ───────
   27 Oct 2026. Six tiles in one row where there is room for them, then
   rows of three cards. Every row steps down to two and then one; a card
   that is the first of a wide row takes the full width when it is two. */
.grid--6 { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.grid--6 .kpi__num { font-size: clamp(20px, 1.45vw, 26px); }
@media (max-width: 1499px) { .grid--6 { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 767px)  { .grid--6 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

.gdash { display: grid; gap: var(--gap, 20px); grid-template-columns: repeat(3, minmax(0, 1fr)); align-items: stretch; }
.gdash--wide { grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr) minmax(0, 1fr); }
@media (max-width: 1440px) { .gdash--wide { grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr) minmax(0, 1fr); } }
.gdash > .pcard { min-width: 0; margin: 0; }
/* The rows of tables need more room per card than the row of charts does:
   below 1500 they go two-and-one, the third card taking the full width. */
@media (max-width: 1499px) {
  .gdash:not(.gdash--wide) { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .gdash:not(.gdash--wide) > .pcard:last-child { grid-column: 1 / -1; }
}
@media (max-width: 1180px) {
  .gdash--wide { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .gdash--wide > .pcard:first-child { grid-column: 1 / -1; }
}
@media (max-width: 879px) {
  .gdash, .gdash--wide { grid-template-columns: minmax(0, 1fr); }
}

/* A donut in a third of a row: chart above, legend below. */
.gdash .pdonut { grid-template-columns: minmax(0, 1fr); justify-items: center; gap: 14px; }
.gdash .pdonut__chart { width: 168px; }
.gdash .plegend { width: 100%; max-width: 300px; }
.plegend__val small { margin-left: 6px; font-weight: 500; color: var(--muted); }

/* The series key under a grouped chart. */
.pkey { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 18px; margin: 10px 0 0; padding: 0; list-style: none; font: 500 13px/1.3 var(--ui); color: var(--body); }
.pkey li { display: inline-flex; align-items: center; gap: 7px; }
.pkey span { width: 10px; height: 10px; border-radius: 50%; }

/* The period picker sits in the welcome banner. */
.pdash__range { width: auto; min-width: 230px; background-color: var(--surface); }

/* Pending actions: one row per queue, the count big, the whole row a link. */
.pacts { list-style: none; margin: 0; padding: 4px 12px 12px; display: grid; gap: 6px; }
.pacts a {
  display: grid; grid-template-columns: auto auto minmax(0, 1fr) auto; align-items: center; gap: 12px;
  padding: 9px 10px; border: 1px solid var(--line); border-radius: 12px;
  color: var(--body); text-decoration: none; font: 500 13.5px/1.35 var(--ui);
}
.pacts a:hover { background: var(--accent-tint); border-color: var(--accent-tint); }
.pacts .pcard__ico { width: 32px; height: 32px; margin: 0; }
.pacts b { min-width: 22px; font: 700 18px/1 var(--display); color: var(--ink); font-variant-numeric: tabular-nums; }
.pacts .ico:last-child { color: var(--muted); }

/* A table inside a third of a row: tighter cells, never stacked into
   label/value cards and never scrolling — five columns is the ceiling. */
.ptable--mini { width: 100%; min-width: 0; }
.ptable--mini th, .ptable--mini td { padding: 9px 12px; font-size: 13px; }
.ptable--mini td small { display: block; }
@media (max-width: 767px) {
  .ptable--mini thead { display: table-header-group; }
  .ptable--mini tr { display: table-row; }
  .ptable--mini td, .ptable--mini th { display: table-cell; }
  .ptable--mini td::before { content: none; }
}

.pdate { font-weight: 600; font-variant-numeric: tabular-nums; }
.pdate--warn { color: var(--c-amber); }
.pdate--bad  { color: var(--c-red); }

/* ── §47  Teacher logins (F25, 28 Oct 2026) ─────────────────────────────
   The centre creates a login per teacher. Design only — M1 auth is not
   built — so these are the shapes: the login cell, the permissions list,
   the generated password, and the details card shown once after. */
.plogin { display: grid; gap: 3px; justify-items: start; }
.plogin code, .pcreds b, .pgen code {
  font: 600 13px/1.3 var(--mark); color: var(--ink);
  background: var(--sunk); border: 1px solid var(--line); border-radius: 6px; padding: 2px 7px;
}
.plogin small { color: var(--muted); font-size: 12px; }

.pperms { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.pperms li { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 12px; }
.pperms li small { display: block; color: var(--muted); font-size: 12.5px; margin-top: 2px; }
.pperms__ico { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; }
.pperms__ico--yes { background: var(--c-green-t); color: var(--c-green); }
.pperms__ico--opt { background: var(--c-blue-t);  color: var(--c-blue); }
.pperms__ico--no  { background: var(--c-slate-t); color: var(--c-slate); }
@media (max-width: 599px) { .pperms li { grid-template-columns: auto minmax(0, 1fr); } .pperms li > .st { grid-column: 2; justify-self: start; } }

.pflow { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; counter-reset: flow; }
.pflow li { display: grid; grid-template-columns: 30px minmax(0, 1fr); column-gap: 12px; }
.pflow li::before {
  counter-increment: flow; content: counter(flow); grid-row: span 2;
  display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%;
  background: var(--c-orange-t); color: var(--c-orange); font: 700 13px/1 var(--ui);
}
.pflow b { color: var(--ink); font-size: 14px; }
.pflow span { color: var(--muted); font-size: 13px; }

.plogin-box { margin-top: 18px; padding: 16px; border: 1px solid var(--c-green-e); border-radius: 14px; background: var(--c-green-t); display: grid; gap: 14px; }
.pgen { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.pgen code { font-size: 15px; padding: 7px 10px; background: var(--surface); }

.pperms-pick { border: 0; margin: 0; padding: 0; display: grid; gap: 8px; min-width: 0; }
.pperms-pick .check small { display: block; color: var(--muted); font-size: 12.5px; font-weight: 400; }
.pperms-pick .check:has(input:disabled) { opacity: .6; }

.pcreds { display: grid; gap: 8px; padding: 14px; border-radius: 12px; background: var(--sunk); border: 1px solid var(--line); }
.pcreds div { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 6px 12px; }
.pcreds span { color: var(--muted); font-size: 13px; }
.pcreds b { background: var(--surface); }

.field__opt { font-style: normal; font-weight: 400; color: var(--muted); margin-left: 4px; }

/* ── §48  Add a teacher (F25b) and the teacher panel (28 Oct 2026) ──────
   One page in three parts; the access grid is a table of ticks, one row
   per form or list, with presets above so most owners never touch a box. */
.pform { display: grid; gap: 20px; }
.pform > .pcard { margin: 0; }
.pformsteps { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.pformsteps li { display: inline-flex; align-items: center; gap: 8px; padding: 7px 14px 7px 8px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); font: 600 13.5px/1 var(--ui); color: var(--ink); }
.pformsteps span { display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--c-orange-t); color: var(--c-orange); font-size: 12px; }
.pformbar {
  position: sticky; bottom: 0; z-index: 3;
  display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 10px;
  padding: 14px 16px; border: 1px solid var(--line); border-radius: 14px;
  background: var(--surface); box-shadow: var(--sh-pop);
}
.pchecks { display: flex; flex-wrap: wrap; gap: 8px 20px; }

.paccess { display: grid; gap: 16px; }
.paccess__presets { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.paccess__preset {
  display: grid; gap: 3px; text-align: left; cursor: pointer;
  padding: 12px 14px; border: 1.5px solid var(--line); border-radius: 12px; background: var(--surface);
  font: 400 12.5px/1.4 var(--ui); color: var(--muted);
}
.paccess__preset b { font: 600 14px/1.3 var(--ui); color: var(--ink); }
.paccess__preset[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-tint); }
@media (max-width: 767px) { .paccess__presets { grid-template-columns: minmax(0, 1fr); } }

.paccess__grid { min-width: 520px; }
.paccess__grid th[scope="row"] { font-weight: 400; text-align: left; }
.paccess__col { width: 76px; text-align: center !important; }
.paccess__group th { background: var(--sunk); font: 700 11px/1 var(--ui); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); padding-top: 10px !important; padding-bottom: 10px !important; text-align: left; }
.paccess__name { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 10px; }
.paccess__name b { display: block; color: var(--ink); font-size: 14px; }
.paccess__name small { display: block; color: var(--muted); font-size: 12.5px; }
.paccess__ico { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 9px; background: var(--c-blue-t); color: var(--c-blue); flex: 0 0 auto; }
.paccess__box { display: inline-grid; place-items: center; width: 34px; height: 34px; cursor: pointer; }
.paccess__box input { width: 20px; height: 20px; accent-color: var(--d-green); cursor: pointer; }
.paccess__na { color: var(--line); }
.paccess__on { color: var(--c-green); }
.paccess__owner .paccess__ico { background: var(--c-slate-t); color: var(--c-slate); }
.paccess__owner th, .paccess__owner td { opacity: .75; }
/* The grid stays a grid on a phone: it scrolls sideways inside its card
   rather than turning each row into a stacked card of three ticks. */
.paccess__grid thead { display: table-header-group !important; }
.paccess__grid tr { display: table-row !important; }
.paccess__grid th, .paccess__grid td { display: table-cell !important; }
.paccess__grid td::before { content: none !important; }

.paccess__scope { border: 0; margin: 0; padding: 0; display: grid; gap: 8px; }
.paccess__scope .check small { display: block; color: var(--muted); font-size: 12.5px; font-weight: 400; }

.pmyaccess { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 10px; }
.pmyaccess__item { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--c-green-e); border-radius: 12px; background: var(--c-green-t); }
.pmyaccess__item .paccess__ico { background: var(--surface); color: var(--c-green); }
.pmyaccess__item b { display: block; font-size: 14px; color: var(--ink); }
.pmyaccess__item small { display: block; font-size: 12.5px; color: var(--c-green); }
.pmyaccess__item.is-off { border-color: var(--line); background: var(--sunk); }
.pmyaccess__item.is-off .paccess__ico, .pmyaccess__item.is-off small { color: var(--muted); }
.pmyaccess__item.is-off b { color: var(--muted); }
.pchecks--stack { display: grid; gap: 8px; }
/* On a phone the grid must fit: three narrow tick columns and a name
   column that wraps, never a sideways scroll that hides the ticks. The
   save bar stops being sticky there — two rows of buttons would cover a
   third of the screen. */
@media (max-width: 599px) {
  .paccess__grid { min-width: 0; }
  .paccess__col { width: 44px; padding-left: 2px !important; padding-right: 2px !important; }
  .paccess__grid th[scope="row"] { padding-right: 4px !important; }
  .paccess__name { grid-template-columns: minmax(0, 1fr); }
  .paccess__name .paccess__ico { display: none; }
  .pformbar { position: static; box-shadow: none; }
  .pformbar .btn { flex: 1 1 100%; justify-content: center; }
}

/* One class in the teacher report: batch and time, then its register state. */
.ptoday { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
.ptoday + .ptoday { margin-top: 8px; }
.ptoday > span:first-child { color: var(--body); font-size: 13.5px; }

/* F9's day columns say the weekday and the date — "Thu / 3 Sep" — not a
   bare number (client, 28 Oct: the numbers alone did not read as dates). */
.pmonth__d { text-align: center; white-space: nowrap; line-height: 1.25; }
.pmonth__d small { display: block; font-size: 10.5px; font-weight: 600; color: var(--muted); letter-spacing: .04em; }
.pmonth__key { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; margin: 0; padding: 12px 18px 4px; font: 400 13px/1.5 var(--ui); color: var(--muted); }
.pmonth__key .pday { width: 24px; height: 24px; font-size: 11px; }

/* The generated password reads as an input, not a chip beside a button:
   same 44px height, border and radius as the username field next to it,
   with "New" / "Reset it" inside at the right — the two columns of the
   login card now line up (client screenshot, 28 Oct). */
.pgen {
  flex-wrap: nowrap; min-height: 44px; width: 100%;
  padding: 4px 4px 4px 13px;
  border: 1px solid var(--line); border-radius: var(--r1);
  background: var(--surface);
}
.pgen > :first-child { margin-right: auto; }
.pgen code { padding: 0; border: 0; background: none; font-size: 15px; }
.pgen .btn { flex: 0 0 auto; }
