/* Rhodes360 and its Fair Haven fork. Hand written: no framework, no web font, no CDN.
   Shared layers: a 16 px type scale, a 4 px spacing scale, phone tables, the bottom bar,
   focus and print. Fair Haven's look is the `school` layer. docs/fairhaven/DESIGN_SYSTEM.md */
@layer reset,base,layout,components,pages;
.sr-only,.visually-hidden{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}

@layer reset{
*{box-sizing:border-box}
body,h1,h2,h3,h4,p,figure,dl,dd{margin:0}
button,input,select,textarea{font:inherit}
a{color:inherit}
button,a,input,select,textarea{touch-action:manipulation}
table{border-collapse:collapse;width:100%}
ul,ol{margin:0}
fieldset{border:0;padding:0;margin:0;min-width:0}
legend{padding:0}
}

@layer base{
:root{
  --ink:#152233;--muted:#5b6b7e;--line:#e1e6ec;--paper:#f4f6f9;--surface:#fff;
  /* Navy: --nav for structure, --nav-deep for the full-height sidebar. */
  --nav:#1b3058;--nav-deep:#202851;--nav-line:#33496d;--nav-text:#c3d3e2;
  /* The crest's royal blue (13.9:1) for links and buttons. */
  --accent:#001e80;--accent-strong:#00155c;--soft:#e6e8f2;
  /* Gold on navy only (8.5:1); on white use --gold-ink (rules) or --gold-ink-deep (words). */
  --gold:#f5ce09;--gold-ink:#b9972f;--gold-ink-deep:#7e620f;--gold-soft:#fdf8e4;
  --red:#a3282f;
  --present:#198754;--absent:#dc3545;--late:#ffc107;--excused:#0dcaf0;--inactive:#adb5bd;
  --display:"Iowan Old Style","Palatino Linotype",Palatino,"Noto Serif",Georgia,serif;
  --sans:system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,sans-serif;
  /* Type: nothing anyone reads to do the job is under 16 px; 14 px is for notes that sit
     beside 16 px text (a date under a name, a help line, a column heading), never smaller. */
  --text-small:14px;--text:16px;--text-lead:18px;--text-h3:17px;--text-h2:20px;
  --text-h1:clamp(26px,1.6vw + 18px,34px);--text-figure:clamp(40px,3vw + 26px,60px);
  /* Space: a 4 px grid. Page gutter 16 px on a phone, 32 px from a laptop up. */
  --space-1:4px;--space-2:8px;--space-3:12px;--space-4:16px;--space-5:24px;--space-6:32px;--space-7:48px;
  --measure:68ch;--radius:6px;--bar:64px;
  /* A field's edge is 3.6:1 on white (WCAG 1.4.11); status marks are 3:1 or better. */
  --field-line:#7b879c;--rule-strong:#c3ccd8;--ok:#1f7a4d;--wait:#b7791f;--stop:#c0392b;--none:#7b879c;
}
html{-webkit-text-size-adjust:100%;text-size-adjust:100%}
body{font:var(--text)/1.5 var(--sans);background:var(--paper);color:var(--ink)}
h1{font-family:var(--display);font-size:var(--text-h1);font-weight:600;letter-spacing:-.01em;line-height:1.15;text-wrap:balance}
h2{font-size:var(--text-h2);font-weight:650;letter-spacing:-.005em;line-height:1.3}
h3{font-size:var(--text-h3);font-weight:650;line-height:1.35}
p{max-width:var(--measure)}
a{text-underline-offset:3px;text-decoration-thickness:1px}
.content a:not([class]){color:var(--accent)}
button{cursor:pointer}
small,.muted{color:var(--muted)}
small{font-size:var(--text-small)}
:focus-visible{outline:3px solid #2d6da3;outline-offset:2px}
label{display:block;font-size:var(--text);font-weight:600;margin-bottom:6px}
input,select,textarea{border:1px solid var(--field-line);border-radius:var(--radius);background:#fff;color:var(--ink);padding:11px 12px;width:100%;min-height:48px;font-size:var(--text)}
input[type=checkbox],input[type=radio]{width:22px;height:22px;min-height:22px;accent-color:var(--accent)}
textarea{min-height:120px}
th{text-align:left;font-size:var(--text-small);font-weight:650;line-height:1.35;color:var(--muted);background:#f7f9fb}
td,th{padding:12px 14px;border-bottom:1px solid var(--line);vertical-align:top}
thead th{position:sticky;top:0;z-index:1;border-bottom-color:var(--rule-strong)}
td{font-size:var(--text)}
td small{display:block;color:var(--muted);font-size:var(--text-small);margin-top:2px}
tbody tr:hover{background:#fafcfd}
tr:last-child td{border-bottom:0}
.numeric{white-space:nowrap}
/* Figures line up in a column wherever they appear. */
td,.numeric,.num,.money,time,.count-line strong,.metric .value,.stat-card > strong,.stat > strong{font-variant-numeric:tabular-nums lining-nums}
td.num,td.money,th.num,th.money{text-align:right;white-space:nowrap}
dt{font-size:var(--text-small);color:var(--muted)}
dd{margin:2px 0 16px;font-weight:550}
.icon{width:20px;height:20px;flex:none;display:inline-block;vertical-align:-4px}
.icon-sprite{position:absolute;width:0;height:0;overflow:hidden}
}

@layer layout{
.app-shell{display:grid;grid-template-columns:248px minmax(0,1fr);min-height:100vh}
.sidebar{background:var(--nav);color:var(--nav-text);padding:26px 16px 20px;position:sticky;top:0;height:100vh;display:flex;flex-direction:column}
.brand{display:flex;align-items:center;gap:10px;font-family:var(--display);font-size:22px;color:#fff;text-decoration:none;font-weight:600;letter-spacing:-.3px}
.brand-mark{display:grid;place-items:center;background:var(--gold);color:#22190a;width:34px;height:36px;border-radius:5px;font-size:21px;font-weight:700}
.brand-number{font-weight:400;color:var(--gold)}
/* The school's crest on a white plate: every mark was drawn for paper and muddies on navy. */
.sidebar-crest{display:block;box-sizing:border-box;align-self:start;width:auto;height:auto;
  max-height:54px;max-width:100%;margin:20px 8px 0;background:#fff;border-radius:6px;padding:6px 9px}
.sidebar-caption{font-size:var(--text-small);color:#8fa8be;margin:18px 8px 14px;padding-bottom:14px;border-bottom:1px solid var(--nav-line);max-width:none}
.sidebar-crest + .sidebar-caption{margin-top:10px}
.sidebar nav{display:grid;gap:2px}
.sidebar nav a{display:flex;gap:12px;align-items:center;padding:10px 12px;text-decoration:none;border-radius:6px;font-size:var(--text);line-height:1.3;min-height:44px}
.sidebar nav a .icon{color:#8aa6c0}
.sidebar nav a:hover{background:#26406b;color:#fff}
.sidebar nav a:hover .icon{color:var(--gold)}
.sidebar nav a.active{background:#26406b;color:#fff;box-shadow:inset 3px 0 var(--gold)}
.sidebar nav a.active .icon{color:var(--gold)}
.sidebar-bottom{margin-top:auto;padding-top:18px;border-top:1px solid var(--nav-line);display:flex;gap:10px;align-items:center;font-size:var(--text-small)}
.sidebar-bottom small{display:block;color:#9ab0c3;max-width:130px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.sidebar-bottom form{margin-left:auto}
.main-shell{min-width:0;display:flex;flex-direction:column}
.topbar{min-height:68px;background:#fff;border-bottom:1px solid var(--line);display:flex;align-items:center;justify-content:space-between;padding:10px 32px;gap:20px}
.topbar-meta{display:flex;align-items:center;gap:16px;flex-wrap:wrap;justify-content:flex-end}
/* The one search: a learner, a parent's phone, a pay code or a receipt, from every page. */
.topbar-search{display:flex;align-items:center;gap:8px;position:relative;flex:1;max-width:560px}
.topbar-search .search-icon{position:absolute;left:13px;color:var(--muted);pointer-events:none}
.topbar-search input{padding-left:42px;font-size:var(--text);background:#f7f9fb}
.topbar-search input:focus{background:#fff}
.topbar-search button{flex:none}
.workspace-label{font-size:var(--text);font-weight:600}
.topbar-date{font-size:var(--text-small);color:var(--muted)}
.demo-mark{font-size:var(--text-small);font-weight:600;color:var(--gold-ink-deep);background:var(--gold-soft);border:1px solid #efdfa0;border-radius:4px;padding:3px 10px;white-space:nowrap}
.demo-mark-band{display:none}
.content{padding:32px 32px 48px;max-width:1500px;width:100%;margin:0 auto}
.app-footer{margin-top:auto;padding:16px 32px;border-top:1px solid var(--line);font-size:var(--text-small);color:var(--muted);display:flex;justify-content:space-between;gap:16px;flex-wrap:wrap}
.auth-content{max-width:440px;margin:8vh auto;padding:0 16px}
.auth-content .brand{color:var(--ink);justify-content:center;margin-bottom:30px}
/* On white the numeral takes the dark gold (the livery gold is 1.5:1). */
.auth-content .brand-number{color:var(--gold-ink-deep)}
/* Sign in: one column, the fields full width, the button the width of the fields. */
.sign-in h1{margin-bottom:6px}
.sign-in form{margin:24px 0}
.sign-in .helptext{margin:8px 0 0}
.sign-in .helptext a{font-size:var(--text)}
.sign-in button[type=submit]{width:100%;margin-top:4px}
.workspace-switch{display:flex;align-items:center;gap:8px}
.workspace-switch label{margin:0;font-size:var(--text-small);color:var(--muted)}
.workspace-switch select{max-width:190px;min-height:44px;font-size:var(--text)}
.workspace-switch button{min-height:44px;padding:7px 12px}
.skip-link{position:fixed;top:-70px;left:20px;background:#fff;z-index:50;padding:12px;border-radius:0 0 6px 6px}
.skip-link:focus{top:0}
.print-note,.print-head{display:none}
.bottom-bar{display:none}
/* The page opening: a title that says what this is, then the work. */
.page-lead{margin:0 0 22px;padding-bottom:16px;border-bottom:1px solid var(--line)}
.page-lead h1{margin-bottom:4px}
.page-lead .lead-sub{color:var(--muted);font-size:var(--text)}
.page-lead .lead-line{margin-top:10px;font-size:var(--text);color:#33465c}
.page-lead .crumb{font-size:var(--text-small);margin-bottom:8px}
.page-lead .crumb a{color:var(--accent);text-decoration:none;font-weight:600}
.section-head{margin:32px 0 14px}
.section-head h2{font-family:var(--display);font-size:20px;font-weight:600;letter-spacing:-.2px}
.section-head p{color:var(--muted);font-size:var(--text);margin-top:3px}
:is(.page-header,.page-heading){display:flex;justify-content:space-between;gap:22px;align-items:flex-end;margin-bottom:24px;padding-bottom:16px;border-bottom:1px solid var(--line)}
:is(.page-header,.page-heading) p{margin-top:7px;color:var(--muted);font-size:var(--text)}
.actions{display:flex;gap:9px;flex-wrap:wrap}
.grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(230px,1fr));gap:16px}
.grid-two{display:grid;grid-template-columns:1.35fr 1fr;gap:20px}
}

@layer components{
.button,.button-secondary,button[type=submit]{display:inline-flex;align-items:center;justify-content:center;gap:8px;border:1px solid transparent;border-radius:var(--radius);padding:11px 18px;font-size:var(--text);font-weight:600;line-height:1.25;text-decoration:none;min-height:48px;background:var(--accent);color:#fff}
.button:hover,button[type=submit]:hover{background:var(--accent-strong)}
/* A secondary button stays secondary when it is also a form's submit button. */
.button-secondary,.button-secondary[type]{background:#fff;border-color:var(--field-line);color:var(--ink)}
.button-secondary:hover,.button-secondary[type]:hover{background:#eef2f6}
/* A quiet action: reads as a link, behaves as a button (Cancel, Print, Show more). */
.button-quiet,.button-quiet[type]{display:inline-flex;align-items:center;min-height:44px;padding:8px 4px;border:0;background:none;color:var(--accent);font-weight:600;text-decoration:underline;text-underline-offset:3px}
.button:disabled,button:disabled{opacity:.5;cursor:default}
.panel{background:var(--surface);border:1px solid var(--line);border-radius:8px;overflow:hidden;overflow:clip;margin-bottom:20px}
:is(.panel-header,.panel-heading){padding:14px 18px;display:flex;justify-content:space-between;gap:14px;align-items:center;border-bottom:1px solid var(--line);background:#fcfdfe}
:is(.panel-header,.panel-heading) h2,:is(.panel-header,.panel-heading) h3{font-size:var(--text);font-weight:700;letter-spacing:0}
.panel-body{--pad:18px;padding:var(--pad)}
/* A list or ledger inside a panel's body runs to the panel's edges, as a ledger's rules do. */
.panel-body > :is(.fact-list,table.ledger,.table-wrap){margin-inline:calc(-1 * var(--pad));width:calc(100% + 2 * var(--pad))}
.panel-body > :is(.fact-list,table.ledger,.table-wrap):first-child{margin-top:calc(-1 * var(--pad))}
.panel-body > :is(.fact-list,table.ledger,.table-wrap):last-child{margin-bottom:calc(-1 * var(--pad))}
.metric{padding:18px 20px;margin-bottom:18px}
.metric .label{font-size:var(--text-small);font-weight:700;color:var(--muted);text-transform:uppercase;letter-spacing:.06em}
.metric .value{font-family:var(--display);font-size:32px;font-weight:600;letter-spacing:-.5px;margin-top:6px;line-height:1.1}
.metric .description{font-size:var(--text-small);color:var(--muted);margin-top:7px}
.metric-accent{border-top:3px solid var(--gold-ink)}
.eyebrow{font-size:var(--text-small);font-weight:700;letter-spacing:.08em;text-transform:uppercase;color:var(--gold-ink-deep);margin-bottom:7px}
.badge{display:inline-flex;align-items:center;padding:3px 9px;border-radius:4px;background:var(--soft);color:var(--accent);font-size:var(--text-small);font-weight:700}
.badge-neutral{background:#eef1f5;color:#556575}
.badge-error{background:#fbe9ea;color:var(--red)}
.pill{display:inline-flex;align-items:center;padding:3px 9px;border-radius:20px;background:var(--soft);color:var(--accent);font-size:var(--text-small);font-weight:650}
.avatar{display:inline-grid;place-items:center;width:32px;height:32px;border-radius:6px;background:var(--soft);color:var(--accent);font-size:var(--text);font-weight:650;flex-shrink:0}
.person{display:flex;align-items:center;gap:11px}
.person a{font-weight:650;text-decoration:none}
.person small{display:block;font-size:var(--text-small)}
.table-wrap{overflow-x:auto}
.toolbar{display:flex;align-items:center;gap:10px;padding:14px 18px;border-bottom:1px solid var(--line);flex-wrap:wrap}
.toolbar input{max-width:340px;font-size:var(--text)}
/* An empty state says what is missing and what to do next, left-aligned like the rest. */
.empty{padding:24px 20px;color:var(--muted)}
.empty h2{color:var(--ink);margin-bottom:4px;font-size:var(--text-h3)}
.empty p{margin:0 0 16px;max-width:60ch}
/* A field: the label above, the box full width, help and errors in words beside it. */
.field{margin-bottom:20px}
.field .helptext,.helptext{display:block;font-size:var(--text-small);font-weight:400;color:var(--muted);margin:-2px 0 6px}
.errorlist{list-style:none;padding:0;color:var(--red);font-size:var(--text);font-weight:600;margin:4px 0 6px}
.form-panel{max-width:760px}
.notice{padding:12px 16px;border-radius:6px;margin-bottom:20px;background:#e9f2ec;color:#1d5540;border:1px solid #c7e0d3;font-size:var(--text);max-width:none}
.notice.error{background:#fdf0f1;color:var(--red);border-color:#eec9cc}
.logout{background:none;border:0;color:#9ab0c3;padding:6px;min-height:44px;min-width:44px;display:grid;place-items:center}
.logout:hover{color:#fff}
.detail-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(150px,1fr));gap:8px 22px}
.link-list a{display:flex;justify-content:space-between;gap:12px;padding:13px 18px;text-decoration:none;border-bottom:1px solid var(--line);font-size:var(--text);min-height:44px;align-items:center}
ul.link-list{list-style:none;padding:0;margin:0}
.link-list a:last-child{border:0}
.link-list a:hover{background:#f6f9fc}
.intro-panel{background:linear-gradient(102deg,#eef3f8,#f7f3e9);padding:20px 24px;border:1px solid #dfe6ee;border-radius:8px;margin-bottom:24px}
.intro-panel p{color:#48586a;font-size:var(--text);margin-top:6px}
.more{font-size:var(--text);font-weight:650;color:var(--accent);text-decoration:none}
.more:hover{text-decoration:underline}
.stats-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(170px,1fr));gap:14px;margin-bottom:20px}
.stat-card{background:var(--surface);border:1px solid var(--line);border-radius:8px;padding:18px 20px}
.stat-card > span{display:block;font-size:var(--text-small);color:var(--muted);text-transform:uppercase;letter-spacing:.05em;font-weight:650}
.stat-card > strong{display:block;font-family:var(--display);font-size:29px;font-weight:600;margin-top:8px;line-height:1.1}
.work-item{padding:13px 18px;border-bottom:1px solid var(--line)}
.work-item:last-child{border-bottom:0}
.work-item a{font-weight:650;font-size:var(--text)}
.work-item p{font-size:var(--text-small);margin-top:3px;color:#3f4f61}
.work-item small{display:block;font-size:var(--text-small);margin-top:4px}
.queue-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(310px,1fr));gap:18px}
/* A status is a small mark and a word: `<span class="status status-ok">Cleared</span>`.
   The word carries the meaning; the mark only helps the eye down a column. */
.status{display:inline-flex;align-items:center;gap:8px;font-weight:600;color:var(--ink);white-space:nowrap}
.status::before{content:"";flex:none;width:8px;height:8px;border-radius:50%;background:var(--status-mark,var(--none))}
.status-ok{--status-mark:var(--ok)}.status-wait{--status-mark:var(--wait)}.status-stop{--status-mark:var(--stop)}.status-info{--status-mark:var(--nav)}
/* Status colours carried over from the registers teachers already use. */
.s-present,.dot.mark-submitted{--status:var(--present)}
.s-absent,.dot.mark-not_started{--status:var(--absent)}
.s-late,.dot.mark-in_progress{--status:var(--late)}
.s-excused{--status:var(--excused)}
.dot{display:inline-block;width:10px;height:10px;border-radius:50%;background:var(--status,var(--inactive));margin-right:6px;vertical-align:-1px}
.dot.mark-unassigned{--status:var(--inactive)}
.band-distinction{color:#146c43}.band-merit{color:#0a58ca}.band-credit{color:#087990}.band-pass{color:#8a6100}.band-fail{color:var(--red)}
/* Shared spacing for record panels, including confidential and planning workflows. */
.panel > h2{padding:15px 18px;border-bottom:1px solid var(--line);font-size:var(--text)}
.panel > :is(p,h3,article,.actions,.actions-row,ul:not([class])){margin:16px 18px}
.panel > ul:not([class]){padding-left:20px}
/* A section heading used as a panel's heading reads as one. */
.panel > .section-head{margin:0;padding:14px 18px;border-bottom:1px solid var(--line)}
.panel > .section-head h2{font-family:var(--sans);font-size:var(--text);font-weight:700;letter-spacing:0}
.link-list a small{display:block;font-size:var(--text-small);color:var(--muted);font-weight:400}
.link-list a > .num{font-weight:650;color:var(--ink)}
.link-list a.quiet,.link-list a.quiet > .num{color:var(--muted);font-weight:500}
.notice > p{margin:0;max-width:none}.notice > p + p{margin-top:8px}
/* The one figure a record is about, under its title: a request's amount, a month's pay. */
.lead-figure{display:flex;flex-wrap:wrap;align-items:baseline;gap:4px 14px}
.lead-figure > strong:first-child{font-size:28px;font-weight:650;line-height:1.2;color:var(--nav);font-variant-numeric:tabular-nums lining-nums}
/* The rarer actions, one line under the main button until they are wanted. */
details.more-actions{margin-top:16px;border-top:1px solid var(--line)}
details.more-actions > summary{min-height:48px;display:flex;align-items:center;font-weight:600;color:var(--accent);cursor:pointer}
details.more-actions[open] > summary{margin-bottom:8px}
/* A feed of sentences: what happened, when, and the way in. */
.feed{list-style:none;margin:0;padding:0}
.feed > li{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:2px 16px;align-items:baseline;padding:14px 18px;border-bottom:1px solid var(--line)}
.feed > li:last-child{border-bottom:0}
.feed p{margin:0}
.feed .when{color:var(--muted);font-size:var(--text-small);white-space:nowrap}
.feed .seen p{color:var(--muted)}
.feed-actions{grid-column:1/-1;display:flex;flex-wrap:wrap;gap:0 20px;align-items:center}
.feed-actions a{display:inline-flex;align-items:center;min-height:44px;font-weight:600}
@media(max-width:720px){.feed > li{grid-template-columns:minmax(0,1fr);padding:12px 16px}}
/* A panel's section folded behind its own heading: <details class="panel-fold"><summary class="panel-header">. */
.panel-fold > summary{list-style:none;cursor:pointer;min-height:48px}
.panel-fold > summary::-webkit-details-marker{display:none}
.panel-fold > summary::after{content:"";flex:none;width:8px;height:8px;margin:0 4px 4px auto;border-right:2px solid var(--muted);border-bottom:2px solid var(--muted);transform:rotate(45deg)}
.panel-fold[open] > summary::after{transform:rotate(-135deg);margin-bottom:-4px}
.panel-fold:not([open]) > summary{border-bottom:0}
.panel > .panel-fold:not(:first-child) > summary{border-top:1px solid var(--line)}
.panel > article p + p{margin-top:9px}
.panel > form:not(.panel-body){padding:18px}
.panel > form:not(.panel-body) > p{margin-bottom:18px}
.panel > a{display:inline-block;margin:0 18px 16px}
.panel form > p{margin-bottom:18px}
.panel-body > p{margin-bottom:14px}
.nav-group summary{list-style:none;cursor:pointer;padding:10px 12px;font-size:var(--text-small);font-weight:700;letter-spacing:.07em;text-transform:uppercase;color:#8fa8be;border-radius:6px;display:flex;justify-content:space-between;align-items:center;gap:12px;min-height:44px}
.nav-group summary::-webkit-details-marker{display:none}
.nav-group summary::after{content:'';width:7px;height:7px;border-right:2px solid currentColor;border-bottom:2px solid currentColor;transform:rotate(-45deg);margin-right:3px}
.nav-group[open] summary::after{transform:rotate(45deg)}
.nav-group summary:hover{background:#1b3c5e;color:#fff}
.nav-group > div{margin-left:11px;border-left:1px solid var(--nav-line);padding-left:4px}
.sidebar .nav-group a{font-size:var(--text);padding:9px 10px;min-height:44px}
.nav-group[open] > summary{color:#a9bfd3}
.sidebar-brand-row{display:flex;align-items:center;justify-content:space-between;gap:14px}
.menu-toggle{display:none;border:1px solid #4d6a85;background:transparent;border-radius:6px;color:#fff;padding:8px 12px;min-height:44px;font-size:var(--text)}
/* Account forms share the staff interface without clipping codes or QR images. */
.account-content h1{margin-bottom:16px}
.account-content p{margin:14px 0}
.account-content form{margin:22px 0}
.account-content img{max-width:100%;height:auto}
.account-content ul{padding-left:22px}
.account-content pre{overflow:auto}
}

@layer pages{
/* --- The teacher's classes ------------------------------------------- */
.class-cards{display:grid;grid-template-columns:repeat(auto-fill,minmax(290px,1fr));gap:16px;margin-bottom:26px}
.class-card{background:var(--surface);border:1px solid var(--line);border-top:3px solid var(--inactive);border-radius:8px;padding:16px 18px 18px;display:flex;flex-direction:column;gap:10px}
.class-card.mark-submitted{border-top-color:var(--present)}
.class-card.mark-in_progress{border-top-color:var(--late)}
.class-card.mark-not_started{border-top-color:var(--absent)}
.class-card-head{display:flex;justify-content:space-between;align-items:flex-start;gap:10px}
.class-card h2{font-family:var(--display);font-size:19px;font-weight:600;letter-spacing:-.2px}
.class-card h2 span{color:var(--muted);font-weight:400}
.class-card-meta{font-size:var(--text-small);color:var(--muted)}
.state-chip{font-size:var(--text-small);font-weight:700;padding:4px 9px;border-radius:4px;white-space:nowrap;background:#eef1f5;color:#556575}
.state-chip.mark-submitted{background:var(--present);color:#fff}
.state-chip.mark-in_progress{background:var(--late);color:#3d2f00}
.state-chip.mark-not_started{background:var(--absent);color:#fff}
.tally{list-style:none;padding:0;display:flex;flex-wrap:wrap;gap:6px;font-size:var(--text-small)}
.tally li{padding:3px 8px;border-radius:4px;background:#f1f4f7;color:#46566a}
.tally b{font-weight:700}
.tally .t-present{background:#e4f2ea;color:#14653b}
.tally .t-absent{background:#fbe9ea;color:#8f2028}
.tally .t-late{background:#fdf3d6;color:#6b5000}
.tally .t-excused{background:#def4fa;color:#0a5c70}
.lesson-list{list-style:none;padding:0;font-size:var(--text-small);color:#3f4f61;display:grid;gap:3px}
.lesson-list time{font-variant-numeric:tabular-nums;font-weight:650;color:var(--ink);margin-right:6px}
.class-card-actions{margin-top:auto;display:flex;gap:8px;flex-wrap:wrap;padding-top:4px}
.class-card-actions .button,.class-card-actions .button-secondary{flex:1 1 auto}
/* --- The head's marking grid ----------------------------------------- */
.legend{list-style:none;padding:0;display:flex;gap:14px;flex-wrap:wrap;font-size:var(--text-small);color:var(--muted)}
.tile-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(180px,1fr));gap:10px;padding:16px 18px}
.tile{display:block;padding:11px 13px;border-radius:6px;border:1px solid var(--line);border-left:4px solid var(--inactive);background:#fbfcfd;text-decoration:none;min-height:66px}
.tile b{display:block;font-size:var(--text);font-weight:650}
.tile-state{display:block;font-size:var(--text-small);font-weight:700;margin-top:3px}
.tile-meta{display:block;font-size:var(--text-small);color:var(--muted);margin-top:3px}
.tile.mark-submitted{border-left-color:var(--present);background:#f2f9f5}
.tile.mark-submitted .tile-state{color:#14653b}
.tile.mark-in_progress{border-left-color:var(--late);background:#fefaf0}
.tile.mark-in_progress .tile-state{color:#6b5000}
.tile.mark-not_started{border-left-color:var(--absent);background:#fdf5f5}
.tile.mark-not_started .tile-state{color:#8f2028}
.tile.mark-unassigned .tile-state{color:var(--muted)}
a.tile:hover{border-color:#b9c8d6;background:#fff}
.bar-chart{list-style:none;padding:0;display:flex;align-items:stretch;gap:12px;height:180px}
.bar-chart li{flex:1;display:grid;grid-template-rows:auto minmax(0,1fr) auto;justify-items:center;gap:6px}
.bar-chart .bar{display:block;width:100%;max-width:46px;background:var(--accent);border-radius:3px 3px 0 0;min-height:3px;align-self:end}
.bar-chart li.future .bar{background:#dde4ec}
.bar-chart .bar-value{font-size:var(--text-small);font-weight:650;font-variant-numeric:tabular-nums}
.bar-chart .bar-label{font-size:var(--text-small);color:var(--muted)}
/* --- The group executive --------------------------------------------- */
.school-cards{display:grid;grid-template-columns:repeat(auto-fit,minmax(280px,1fr));gap:18px;margin-bottom:26px}
.school-card{background:var(--surface);border:1px solid var(--line);border-radius:8px;padding:20px 22px;display:flex;flex-direction:column;gap:12px}
.school-card h2{font-family:var(--display);font-size:21px;font-weight:600}
.school-card h2 a{text-decoration:none}
.school-card h2 a:hover{color:var(--accent)}
.school-card-meta{font-size:var(--text-small);color:var(--muted);letter-spacing:.06em;text-transform:uppercase;font-weight:650;margin-top:-8px}
.school-figures{display:grid;grid-template-columns:1fr 1fr;gap:12px 16px;margin:0}
.school-figures dd{font-family:var(--display);font-size:24px;font-weight:600;margin:2px 0 0}
.school-figures .of{font-family:var(--sans);font-size:var(--text);color:var(--muted);font-weight:400}
.school-figures .is-exception{color:var(--red)}
.meter{height:7px;border-radius:4px;background:#e6ebf1;overflow:hidden;margin:0}
.meter span{display:block;height:100%;background:var(--present)}
.school-card-note{font-size:var(--text-small);color:var(--muted)}
.school-card .button-secondary{margin-top:auto;align-self:flex-start}
/* --- The generic record form ----------------------------------------- */
.form-page{max-width:760px}
.field-group{border:0;padding:0;margin:0 0 6px}
.field-group legend{font-family:var(--display);font-size:17px;font-weight:600;padding:18px 18px 0;margin-bottom:12px}
.field-group .field{padding:0 18px}
.field-check{display:flex;align-items:flex-start;gap:10px;flex-wrap:wrap}
.field-check input{width:20px;flex:none;margin-top:3px}
.field-check label{margin:0;font-weight:550}
.field-check .helptext{flex-basis:100%;margin-left:30px}
.optional{font-weight:400;color:var(--muted);font-size:var(--text-small)}
.field-message{color:var(--red);font-size:var(--text-small);font-weight:600;margin:0 0 6px}
.field-error input,.field-error select,.field-error textarea{border-color:var(--red);border-width:2px}
.error-summary{border:2px solid var(--red);border-radius:8px;padding:16px 18px;margin-bottom:20px;background:#fdf6f6}
.error-summary h2{color:var(--red);font-size:var(--text);margin-bottom:8px}
.error-summary ul{margin:0;padding-left:18px;font-size:var(--text)}
.error-summary li{margin-bottom:4px}
.error-summary a{color:var(--red);font-weight:650}
.form-actions{border-top:1px solid var(--line);margin-top:18px;padding:16px 18px}
.submit-help{font-size:var(--text-small);color:var(--muted);margin-top:10px}
}

@media(max-width:1050px){
.app-shell{grid-template-columns:208px minmax(0,1fr)}
.content{padding:24px 20px}
.topbar{padding:10px 20px}
.grid-two{grid-template-columns:1fr}
.topbar-date{display:none}
.topbar-search{max-width:none}
}

@media screen and (max-width:720px){
/* A phone: the navy band, the one search, the page, the bottom bar; the rest behind More. */
.app-shell{display:block;padding-bottom:calc(var(--bar) + env(safe-area-inset-bottom))}
.sidebar{height:auto;position:static;padding:10px 16px}
.sidebar-brand-row{min-height:44px;gap:12px}
.brand{font-size:19px}
.sidebar-crest,.sidebar-caption{display:none}
.demo-mark-band{display:inline-flex;margin-left:auto;background:none;border:0;padding:0;color:var(--nav-text)}
.topbar .demo-mark{display:none}
.sidebar nav,.sidebar-bottom{display:none}
.sidebar[data-menu-open="true"] nav,.sidebar #main-navigation:target{display:block;position:fixed;inset:0 0 calc(var(--bar) + 68px + env(safe-area-inset-bottom));z-index:40;overflow-y:auto;overscroll-behavior:contain;background:var(--nav);padding:16px 16px 8px}
.sidebar[data-menu-open="true"] .sidebar-bottom,.sidebar:has(#main-navigation:target) .sidebar-bottom{display:flex;position:fixed;left:0;right:0;bottom:calc(var(--bar) + env(safe-area-inset-bottom));height:68px;z-index:40;margin:0;padding:12px 16px;background:var(--nav)}
.bottom-bar{display:grid;grid-auto-flow:column;grid-auto-columns:minmax(0,1fr);position:fixed;left:0;right:0;bottom:0;z-index:45;background:#fff;border-top:1px solid var(--rule-strong);padding:0 4px env(safe-area-inset-bottom)}
.bottom-bar a{position:relative;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:3px;min-height:var(--bar);padding:6px 2px;color:var(--muted);text-decoration:none;font-size:var(--text-small);font-weight:600;line-height:1.2;text-align:center}
.bottom-bar .icon{width:24px;height:24px}
.bottom-bar a[aria-current=page],.bottom-bar a[aria-expanded=true]{color:var(--nav)}
.bottom-bar a[aria-current=page]::before{content:"";position:absolute;top:0;left:24%;right:24%;height:3px;border-radius:0 0 2px 2px;background:var(--nav)}
.bottom-count{position:absolute;top:5px;left:calc(50% + 7px);min-width:22px;height:22px;padding:0 6px;border-radius:11px;background:var(--nav);color:#fff;font-size:var(--text-small);line-height:22px;font-weight:700}
.topbar{min-height:0;padding:10px 16px;gap:8px}
.topbar-search{flex:1;max-width:none}
.topbar-search .search-icon{display:none}
.topbar-search input{padding-left:12px}
.topbar-search button{width:48px;padding:0}
.search-word{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0,0,0,0)}
.topbar-meta{display:none}
.topbar-meta:has(.workspace-switch){display:flex;flex:1 1 100%;order:2}
.topbar:has(.workspace-switch){flex-wrap:wrap}
.module-nav,[data-school="fhs"] .record-nav{flex-wrap:nowrap;overflow-x:auto;scrollbar-width:none;margin-left:-16px;margin-right:-16px;padding:0 12px}
.panel > .module-nav{margin-left:0;margin-right:0;padding:0 4px}
/* A ledger on a phone stacks: first cell as title, then label and value (data-label). */
table:is(.ledger,.stack) thead{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0,0,0,0)}
table:is(.ledger,.stack),table:is(.ledger,.stack) tbody,table:is(.ledger,.stack) tfoot{display:block}
table:is(.ledger,.stack) tr{display:block;padding:12px 16px;border-bottom:1px solid var(--line)}
table:is(.ledger,.stack) tr:last-child{border-bottom:0}
table:is(.ledger,.stack) :is(td,tbody th){display:flex;justify-content:space-between;align-items:baseline;gap:16px;padding:3px 0;border:0;text-align:right;white-space:normal}
table:is(.ledger,.stack) :is(td,tbody th)::before{content:attr(data-label);flex:none;max-width:45%;color:var(--muted);font-size:var(--text-small);font-weight:500;text-align:left}
table:is(.ledger,.stack) :is(td,tbody th):first-child{display:block;text-align:left;font-weight:600;padding-bottom:6px}
table:is(.ledger,.stack) :is(td,tbody th):first-child::before,table:is(.ledger,.stack) td:not([data-label])::before{content:none}
table:is(.ledger,.stack) td:empty{display:none}
/* A wide row (six cells or more) sets its figures two to a line; words keep the full width. */
table:is(.ledger,.stack) tr:has(> :nth-child(6)){display:grid;grid-template-columns:repeat(2,minmax(0,1fr));grid-auto-flow:row dense;column-gap:20px}
table:is(.ledger,.stack) tr:has(> :nth-child(6)) > :is(:first-child,:not(.num,.money)){grid-column:1/-1}
.table-wrap:has(> table.stack){overflow:visible}
}

@media(max-width:720px){
.content{padding:20px 16px 32px}
:is(.page-header,.page-heading){display:block}
:is(.page-header,.page-heading) .actions{margin-top:15px}
.grid{grid-template-columns:1fr 1fr;gap:10px}
.metric{margin-bottom:10px;padding:15px}
.metric .value{font-size:27px}
.app-footer{padding:16px}
:is(.panel-header,.panel-heading){padding:13px 15px;flex-wrap:wrap}
.panel-body{--pad:15px}
td,th{padding:11px 12px}
.workspace-switch label{display:none}
.workspace-switch{flex:1}
.workspace-switch select{flex:1;max-width:none}
.menu-toggle:not([hidden]){display:block}
.sidebar[data-menu-ready="true"]:not([data-menu-open="true"]) nav{display:none}
.nav-group summary{padding:9px 12px}
.nav-group > div{margin-bottom:8px}
.panel > h2{padding:15px 16px}
.panel > :is(p,h3,article,.actions,.actions-row,ul:not([class])){margin:15px 16px}
.panel > .section-head{padding:13px 16px}
.panel > p.count-line{margin:0}
.panel > form:not(.panel-body){padding:16px}
.tile-grid{padding:14px;grid-template-columns:repeat(auto-fill,minmax(150px,1fr))}
.field-group legend,.field-group .field,.form-actions{padding-left:16px;padding-right:16px}
}

@media(min-width:721px){
.sidebar{background:var(--nav-deep)}
.sidebar nav{flex:1;min-height:0;overflow-y:auto;align-content:start}
.sidebar-bottom{flex-shrink:0}
}

@media(max-width:430px){
.class-cards,.school-cards,.queue-grid{grid-template-columns:1fr}
.grid{grid-template-columns:1fr}
.tile-grid{grid-template-columns:1fr 1fr;gap:8px}
.school-figures{grid-template-columns:1fr 1fr}
.bar-chart{height:140px;gap:7px}
.class-card-actions{flex-direction:column}
.class-card-actions .button,.class-card-actions .button-secondary,.class-card-actions form,.class-card-actions form button{width:100%}
.demo-mark{font-size:var(--text-small);padding:3px 8px}
}

@media(prefers-reduced-motion:reduce){*{scroll-behavior:auto!important;animation:none!important;transition:none!important}}
/* Between pages, a short cross-fade where the browser can do it on the compositor. */
@media(prefers-reduced-motion:no-preference){@view-transition{navigation:auto}::view-transition-group(root){animation-duration:.16s}}

/* The shared page patterns: a title and a scope line, then the work. */

@layer components{
/* --- The module bar: where a module has more than one working screen. */
/* Tabs: one row, scrolled sideways on a phone rather than wrapped into three. */
.module-nav{display:flex;flex-wrap:wrap;gap:4px;margin:0 0 24px;border-bottom:1px solid var(--line);padding-bottom:0}
.module-nav a{display:inline-flex;align-items:center;gap:7px;min-height:44px;padding:10px 14px;font-size:var(--text);font-weight:600;white-space:nowrap;color:var(--muted);text-decoration:none;border-bottom:3px solid transparent;border-radius:6px 6px 0 0}
.module-nav a:hover{color:var(--ink);background:#eef3f7}
.module-nav a[aria-current=page]{color:var(--accent);border-bottom-color:var(--gold-ink-deep)}
/* A table's own view (all, need attention, ready) sits in its panel, above the rows. */
.panel > .module-nav{margin:0;padding:0 8px;flex-wrap:nowrap;overflow-x:auto;scrollbar-width:none}
td.charges > span{display:block;font-size:var(--text-small)}
/* A search inside a page: the field and its button on one line. */
.find-row{margin:0 0 16px}
.find-row > div{display:flex;gap:8px}
.find-row input{flex:1;min-width:0}
/* A request for action is a sentence with a mark and the way to act, not a success notice. */
.next-step{margin:0 0 20px;max-width:none}
.next-step a{font-weight:600}
.count-line form{display:inline}
.panel > p.count-line{margin:0}
/* A month to look at: earlier, the month, later, on one line. */
.filter-form.month-form{display:flex;flex-wrap:wrap;gap:8px;align-items:center;margin:0 0 20px;padding:0;border:0;background:none}
.month-form input{flex:1 1 0;min-width:0;max-width:240px}
.month-form .button-secondary{min-width:48px;padding-inline:12px}
.pay-code{font-size:var(--text-lead);letter-spacing:.06em;color:var(--ink);white-space:nowrap}

/* --- The list page: filters, a count line, a dense table, quiet row actions. */
.filter-form{display:grid;grid-template-columns:repeat(auto-fit,minmax(170px,1fr));gap:12px 14px;padding:16px 18px;border-bottom:1px solid var(--line);align-items:end;background:#fcfdfe}
.filter-form label{margin-bottom:5px}
.filter-form input,.filter-form select{font-size:var(--text)}
.filter-form .filter-actions{display:flex;gap:9px;align-items:end}
.filter-form .filter-actions .button,.filter-form .filter-actions .button-secondary{flex:1;min-height:44px}
.count-line{padding:11px 18px;border-bottom:1px solid var(--line);font-size:var(--text-small);color:var(--muted);background:#fbfcfd;max-width:none;overflow:hidden}
.count-line strong{color:var(--ink);font-weight:700}
.count-line .count-note{float:right;margin-left:18px;text-align:right}
@media(max-width:620px){.count-line .count-note{float:none;display:block;margin:4px 0 0;text-align:left}}
.row-actions{display:flex;gap:7px;justify-content:flex-end;flex-wrap:wrap}
.row-actions a,.row-actions button{display:inline-flex;align-items:center;justify-content:center;min-height:40px;padding:6px 12px;border:1px solid var(--field-line);border-radius:6px;background:#fff;font-size:var(--text-small);font-weight:600;color:var(--ink);text-decoration:none;white-space:nowrap}
.row-actions a:hover,.row-actions button:hover{background:#edf3f7}
@media(pointer:coarse){.row-actions a,.row-actions button{min-height:44px}}
.pager{display:flex;gap:10px;align-items:center;justify-content:space-between;padding:14px 18px;flex-wrap:wrap;font-size:var(--text);color:var(--muted)}
.pager .steps{display:flex;gap:8px}
.pager a,.pager span.step{min-height:44px;display:inline-flex;align-items:center;padding:8px 16px;border:1px solid var(--field-line);border-radius:6px;font-size:var(--text);text-decoration:none;background:#fff;color:var(--ink);font-weight:600}
.pager span.step{opacity:.45;color:var(--muted)}
.table-note{font-size:var(--text-small);color:var(--muted);padding:11px 18px;border-top:1px dashed var(--line);background:#fbfcfd;max-width:none}

/* --- The record page: an identity header, then its sections. */
.record-header{display:flex;gap:18px;align-items:flex-start;flex-wrap:wrap;padding:20px 22px}
.record-avatar{width:56px;height:56px;border-radius:12px;font-size:20px;font-weight:650}
.record-identity{flex:1;min-width:220px}
.record-identity h1{font-size:clamp(21px,2.1vw,27px);margin-bottom:2px}
.record-identity .record-where{font-size:var(--text);color:var(--muted);margin-top:4px}
.record-identity .record-where strong{color:var(--ink);font-weight:650}
.record-badges{display:flex;flex-wrap:wrap;gap:7px;margin-top:10px}
.record-actions{display:flex;flex-wrap:wrap;gap:9px;align-items:flex-start}
.record-actions .button,.record-actions .button-secondary{min-height:44px}
.record-facts{display:grid;grid-template-columns:repeat(auto-fit,minmax(150px,1fr));gap:4px 22px;padding:14px 22px;border-top:1px solid var(--line);background:#fcfdfe;margin:0}
.record-facts > div{min-width:0}
.record-facts dt{font-size:var(--text-small);text-transform:uppercase;letter-spacing:.05em;font-weight:700}
.record-facts dd{margin:2px 0 10px;font-size:var(--text);font-weight:600}
.record-nav{display:flex;flex-wrap:wrap;gap:6px;padding:0 22px 14px}
.record-nav a{display:inline-flex;align-items:center;min-height:40px;padding:7px 13px;border:1px solid var(--line);border-radius:20px;background:#fff;font-size:var(--text);font-weight:600;color:var(--accent);text-decoration:none}
.record-nav a:hover{background:var(--soft)}
@media(pointer:coarse){.record-nav a{min-height:44px}}
.record-section{scroll-margin-top:84px}
.record-section > .panel-header h2{font-family:var(--display);font-size:16px;font-weight:600}

/* --- Small parts shared by several modules ------------------------- */
.stat,.stats-grid > section{background:var(--surface);border:1px solid var(--line);border-radius:8px;padding:16px 18px}
.stat > span,.stats-grid > section > span{display:block;font-size:var(--text-small);color:var(--muted);text-transform:uppercase;letter-spacing:.05em;font-weight:650}
.stat > strong,.stats-grid > section > strong{display:block;font-family:var(--display);font-size:27px;font-weight:600;margin-top:6px;line-height:1.1}
/* A breadcrumb back to the list this record came from. */
.crumb{font-size:var(--text-small);margin-bottom:6px;max-width:none}
.crumb a{color:var(--accent);text-decoration:none;font-weight:650}
.crumb a:hover{text-decoration:underline}
.actions-row{margin-bottom:20px}
.stat p{font-size:var(--text-small);margin-top:8px}
.stat p a{color:var(--accent);font-weight:650}
.chip{display:inline-flex;align-items:center;gap:6px;padding:3px 9px;border-radius:4px;background:#eef1f5;color:#4a5a6b;font-size:var(--text-small);font-weight:700}
.chip-open{background:#fdf3d6;color:#6b5000}
.chip-done{background:#e4f2ea;color:#14653b}
.chip-stop{background:#fbe9ea;color:#8f2028}
.chip-info{background:var(--soft);color:var(--accent)}
.fact-list{list-style:none;padding:0;margin:0}
.fact-list li,.fact-list > div{display:flex;justify-content:space-between;gap:14px;padding:11px 18px;border-bottom:1px solid var(--line);font-size:var(--text)}
.fact-list li:last-child,.fact-list > div:last-child{border-bottom:0}
/* As a definition list: <dl class="fact-list"><div><dt>Campus</dt><dd>Primary</dd></div></dl>. */
.fact-list dt{flex:none;max-width:45%;font-size:var(--text);color:var(--muted)}
.fact-list dd{margin:0;text-align:right;font-weight:600;overflow-wrap:anywhere}
.fact-list small{display:block;color:var(--muted);font-size:var(--text-small);margin-top:2px;font-weight:400}
.fact-list li > span:last-child{text-align:right;white-space:nowrap}
.print-only{display:none}
}

/* Print: black on white, the school's name on top, headings repeated on every page. */
@page{size:A4;margin:16mm 13mm 20mm}

@media print{
:root{--paper:#fff;--surface:#fff;--line:#b6bcc4}
.sidebar,.topbar,.app-footer,.skip-link,.menu-toggle,.actions,.record-actions,.row-actions,
.filter-form,.pager,.module-nav,.record-nav,.no-print,form.filter-form,.workspace-switch,.bottom-bar,.test-bar,
.home-cta,.home-find{display:none!important}
/* Black on white, the school's name at the top of the first page, hairlines for rules. */
.print-head{display:block;margin:0 0 10pt;padding-bottom:5pt;border-bottom:1.2pt solid #000;font:600 15pt/1.2 var(--display);color:#000;max-width:none}
*{color:#000!important;box-shadow:none!important;text-shadow:none!important}
.app-shell{display:block}
body{background:#fff;color:#000;font-size:10.5pt;padding-bottom:16mm}
.content{padding:0;max-width:none;margin:0}
h1{font-size:17pt}
h2{font-size:12pt}
p{max-width:none}
a{text-decoration:none;color:#000}
.panel,.home-panel,.home-owed{border:0;border-radius:0;margin-bottom:10pt;break-inside:auto;background:none}
:is(.panel-header,.panel-heading){background:#fff;padding:7pt 9pt}
.panel-body{padding:9pt}
thead{display:table-header-group}
tfoot{display:table-footer-group}
tr,.record-header,.stat,.stat-card,.class-card,.school-card{break-inside:avoid}
td,th{padding:4pt 6pt;font-size:9.5pt;border-bottom:1px solid #b6bcc4}
th{background:none;border-bottom:1pt solid #000;position:static}
td.num,td.money,.money{white-space:nowrap}
.table-wrap{overflow:visible}
.count-line{background:#fff;color:#000;border-bottom:1px solid #b6bcc4}
.badge,.pill,.chip,.state-chip,.tally li,.meter span,.tile,.status::before,.home-chip::before,.home-meter span{-webkit-print-color-adjust:exact;print-color-adjust:exact}
.print-only{display:revert}
/* The running footer: school, date, and the demonstration line. */
.print-note{display:block;position:fixed;bottom:0;left:0;right:0;margin:0;padding:3pt 0;border-top:1px solid #999;font-size:8pt;color:#333;max-width:none;background:#fff}
}

/* Fair Haven School (FHS): navy structure, royal blue only for the main button and links,
   status as a mark and a word. Contrast re-measured by fhs/tests/test_theme.py. */
@layer school{
[data-school="fhs"]{
  --paper:#eef2f8;--surface:#fff;--muted:#55657a;--line:#dde3ee;
  --nav:#0f1f5c;--nav-deep:#0f1f5c;--nav-line:#2a3a78;--nav-text:#c9d3f0;
  --accent:#1d4ed8;--accent-strong:#1e40af;--soft:#e3eafc;
  --gold:#a8bdf7;--gold-ink:#0f1f5c;--gold-ink-deep:#0f1f5c;--gold-soft:#e6ecf8;
}
[data-school="fhs"] :focus-visible{outline-color:#1d4ed8}
[data-school="fhs"] .sidebar :focus-visible{outline-color:#a8bdf7}
[data-school="fhs"] .brand-mark{color:#0f1f5c}
[data-school="fhs"] .sidebar nav a .icon{color:#a9b8e8}
[data-school="fhs"] .sidebar nav a:hover,[data-school="fhs"] .sidebar nav a.active,
[data-school="fhs"] .nav-group summary:hover{background:#1c2d78}
[data-school="fhs"] .sidebar-caption,[data-school="fhs"] .nav-group summary,
[data-school="fhs"] .sidebar-bottom small,[data-school="fhs"] .logout{color:#b8c4ea}
[data-school="fhs"] .nav-group[open] > summary{color:#d0d8f2}
[data-school="fhs"] .menu-toggle{border-color:#4a5c9e}
[data-school="fhs"] .demo-mark{border-color:#c9d5ef}
[data-school="fhs"] .avatar{color:var(--nav)}
[data-school="fhs"] .bar-chart .bar{background:var(--nav)}
[data-school="fhs"] .auth-content .brand{color:var(--nav)}
@media print{[data-school="fhs"]{--paper:#fff;--line:#b6bcc4}}
/* A product named with a phrase: no letter square; the sign-in page stands the crest over it. */
.brand-named{font-size:19px;line-height:1.15}
.sidebar .brand-named .brand-mark{display:none}
.auth-content .brand-named{flex-direction:column;gap:12px;font-size:24px;text-align:center}
.brand-crest{display:block;width:auto;height:72px}
/* The shell: the dove in a white roundel beside the name; groups in sentence case. */
[data-school="fhs"] .sidebar{display:grid;grid-template-columns:auto minmax(0,1fr);grid-template-rows:auto auto minmax(0,1fr) auto;column-gap:12px;padding:22px 16px 16px}
[data-school="fhs"] .sidebar > *{grid-column:1/-1}
[data-school="fhs"] .sidebar-brand-row{grid-area:1/2/2/3}
[data-school="fhs"] .sidebar-crest{grid-area:1/1/2/2;width:48px;height:48px;max-height:none;margin:0;padding:6px;border-radius:50%;object-fit:contain}
[data-school="fhs"] .sidebar .brand-named{font-size:18px}
[data-school="fhs"] .sidebar-caption{margin:16px 4px 12px}
[data-school="fhs"] .nav-group summary{text-transform:none;letter-spacing:0;font-size:var(--text);font-weight:600}
[data-school="fhs"] .demo-mark{position:relative;background:none;border:0;padding:0 0 0 16px;color:var(--nav)}
[data-school="fhs"] .demo-mark::before{content:"";position:absolute;left:0;top:50%;width:8px;height:8px;margin-top:-4px;border-radius:50%;background:var(--wait)}
[data-school="fhs"] .demo-mark-band{color:var(--nav-text)}
[data-school="fhs"] .content{max-width:1280px}
[data-school="fhs"] :is(h1,.section-head h2,.panel > h2,:is(.panel-header,.panel-heading) :is(h2,h3)){color:var(--nav)}
[data-school="fhs"] :is(.panel-header,.panel-heading){background:none;border-bottom-color:var(--rule-strong)}
[data-school="fhs"] .eyebrow{font-size:var(--text-small);font-weight:600;letter-spacing:0;text-transform:none;color:var(--muted)}
[data-school="fhs"] .intro-panel{background:var(--surface);border-color:var(--line)}
[data-school="fhs"] .metric-accent{border-top:1px solid var(--line)}
/* Figures in a row: one band divided by hairlines; sans, tabular. */
[data-school="fhs"] .stats-grid{gap:0;background:var(--surface);border:1px solid var(--line);border-radius:8px;overflow:hidden}
[data-school="fhs"] :is(.stats-grid > *,.stats-grid > section){border:0;border-radius:0;box-shadow:1px 0 var(--line),0 1px var(--line);margin:0}
[data-school="fhs"] :is(.stat,.stat-card,.metric) > span,[data-school="fhs"] .stats-grid > section > span,[data-school="fhs"] :is(.metric .label,.record-facts dt){text-transform:none;letter-spacing:0;font-size:var(--text-small);font-weight:500}
[data-school="fhs"] :is(.stat,.stat-card) > strong,[data-school="fhs"] .stats-grid > section > strong,[data-school="fhs"] .metric .value{font-family:var(--sans);font-size:26px;font-weight:650;letter-spacing:-.01em;color:var(--nav)}
/* Older chips, badges and pills become a mark and a word. */
[data-school="fhs"] :is(.chip,.badge,.pill,.state-chip,.tally li){gap:8px;padding:0;border-radius:0;background:none;color:var(--ink);font-size:var(--text);font-weight:600}
[data-school="fhs"] :is(.chip-done,.chip-ok,.chip-open,.chip-wait,.chip-stop,.chip-bad,.chip-info,.badge-error,.state-chip,.tally li)::before{content:"";flex:none;width:8px;height:8px;border-radius:50%;background:var(--none)}
[data-school="fhs"] :is(.chip-done,.chip-ok,.state-chip.mark-submitted,.tally .t-present)::before{background:var(--ok)}
[data-school="fhs"] :is(.chip-open,.chip-wait,.state-chip.mark-in_progress,.tally .t-late)::before{background:var(--wait)}
[data-school="fhs"] :is(.chip-stop,.chip-bad,.badge-error,.state-chip.mark-not_started,.tally .t-absent)::before{background:var(--stop)}
[data-school="fhs"] .chip-info::before{background:var(--nav)}
[data-school="fhs"] .tally{gap:4px 16px}
[data-school="fhs"] .class-card{border-top-width:1px;border-top-color:var(--line)}
[data-school="fhs"] .tile{border-left-width:1px;border-left-color:var(--line);background:var(--surface)}
[data-school="fhs"] .tile .tile-state::before{content:"";display:inline-block;width:8px;height:8px;margin-right:6px;border-radius:50%;background:var(--none)}
[data-school="fhs"] .tile.mark-submitted .tile-state::before{background:var(--ok)}
[data-school="fhs"] .tile.mark-in_progress .tile-state::before{background:var(--wait)}
[data-school="fhs"] .tile.mark-not_started .tile-state::before{background:var(--stop)}
[data-school="fhs"] .module-nav a[aria-current=page]{color:var(--nav);border-bottom-color:var(--nav)}
[data-school="fhs"] .record-nav{gap:0 4px;border-bottom:1px solid var(--line);padding-bottom:0}
[data-school="fhs"] .record-nav a{border:0;border-radius:0;border-bottom:3px solid transparent;background:none}
[data-school="fhs"] .link-list a:not(.quiet){color:var(--accent);font-weight:600}
[data-school="fhs"] .row-actions a{border-color:transparent;color:var(--accent);text-decoration:underline;text-underline-offset:3px}
[data-school="fhs"] .notice{background:var(--surface);color:var(--ink);border-color:var(--line);box-shadow:inset 0 3px var(--ok)}
[data-school="fhs"] .notice.error{color:#8f2028;box-shadow:inset 0 3px var(--stop)}
}
/* Fair Haven on a phone (outside the layers, as the shared phone rules are). */
@media screen and (max-width:720px){
/* Figures in a row become lines of a ledger: the label, then the figure on the right. */
[data-school="fhs"] .stats-grid{grid-template-columns:minmax(0,1fr)}
[data-school="fhs"] .stats-grid > *{display:flex;flex-wrap:wrap;justify-content:space-between;align-items:baseline;gap:0 12px;padding:12px 16px}
[data-school="fhs"] .stats-grid > * > strong{font-size:20px;margin:0}
[data-school="fhs"] .stats-grid > * > :is(small,p){flex-basis:100%;margin:2px 0 0}
[data-school="fhs"] .sidebar{display:grid;padding:8px 16px}
[data-school="fhs"] .sidebar-crest{display:block;width:40px;height:40px;padding:5px}
[data-school="fhs"] .demo-mark-band{padding-left:14px}
}
