/* ==========================================================================
   Global School Software — design system  v2
   Light ed-tech SaaS: tinted canvas, white cards, generous radii, soft
   shadows, one indigo primary with warm amber for emphasis.
   Self-hosted Inter — no CDN, so the strict CSP holds.
   ========================================================================== */

@font-face {
  font-family: "InterVar";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("../fonts/inter-var.woff2") format("woff2");
}

:root {
  /* --- brand: indigo --------------------------------------------------- */
  --brand-050: #eef0ff;
  --brand-100: #e0e3ff;
  --brand-200: #c7caff;
  --brand-400: #818cf8;
  --brand-500: #6366f1;
  --brand-600: #5a5cf0;
  --brand-700: #4f46e5;
  --brand-800: #4338ca;
  --brand-900: #312e81;

  /* --- accent: amber ---------------------------------------------------- */
  --accent-050: #fff8e9;
  --accent-100: #fdecc8;
  --accent-500: #f5a524;
  --accent-600: #e08d0e;
  --accent-700: #b45309;

  /* --- neutrals --------------------------------------------------------- */
  --ink:        #101828;
  --ink-soft:   #475467;
  --ink-faint:  #98a2b3;
  --line:       #eaecf0;
  --line-soft:  #f2f4f7;
  --surface:    #ffffff;
  --surface-2:  #fbfcfe;
  --canvas:     #f7f8fc;

  /* --- status ----------------------------------------------------------- */
  --ok-700:   #027a48;  --ok-100:   #ecfdf3;  --ok-200: #d1fadf;
  --warn-700: #b54708;  --warn-100: #fffaeb;  --warn-200: #fef0c7;
  --err-700:  #d92d20;  --err-100:  #fef3f2;  --err-200: #fee4e2;
  --info-700: #0e7090;  --info-100: #ecfdff;  --info-200: #cff9fe;

  /* --- gendered tints, always paired with a differing silhouette so
         identity never rests on colour alone -------------------------- */
  --boy-100:  #e8f0ff;  --boy-700:  #175cd3;
  --girl-100: #fdf2f8;  --girl-700: #be185d;

  /* --- shape ------------------------------------------------------------ */
  --r-xs:   6px;
  --r-sm:   8px;
  --r:     12px;
  --r-lg:  16px;
  --r-xl:  24px;
  --r-pill: 999px;

  --shadow-xs: 0 1px 2px rgba(16, 24, 40, .05);
  --shadow-sm: 0 1px 3px rgba(16, 24, 40, .08), 0 1px 2px rgba(16, 24, 40, .04);
  --shadow:    0 4px 8px -2px rgba(16, 24, 40, .06), 0 12px 24px -8px rgba(16, 24, 40, .10);
  --shadow-lg: 0 8px 16px -4px rgba(16, 24, 40, .08), 0 24px 48px -12px rgba(16, 24, 40, .18);
  --ring:      0 0 0 4px rgba(79, 70, 229, .14);

  --sans: "InterVar", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
          "Helvetica Neue", Arial, sans-serif;
  --display: var(--sans);
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;

  --container: 1200px;
  --masthead-h: 64px;
}

/* ==========================================================================
   Base
   ========================================================================== */

*, *::before, *::after { box-sizing: border-box; }

/* `hidden` must beat any display rule a component sets on itself. */
[hidden] { display: none !important; }

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

body {
  margin: 0;
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.55;
  color: var(--ink);
  background: var(--canvas);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 {
  font-family: var(--display);
  font-weight: 650;
  line-height: 1.2;
  color: var(--ink);
  margin: 0 0 .5em;
  letter-spacing: -.021em;
}

h1 { font-size: clamp(1.6rem, 1.25rem + 1.6vw, 2.3rem); font-weight: 700; }
h2 { font-size: clamp(1.2rem, 1.05rem + .7vw, 1.5rem); }
h3 { font-size: 1.05rem; }
h4 { font-size: .95rem; }

p { margin: 0 0 1em; }
p:last-child { margin-bottom: 0; }

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

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

img { max-width: 100%; height: auto; display: block; }

small { font-size: .82rem; }

code, kbd { font-family: var(--mono); font-size: .86em; }

::selection { background: var(--brand-100); }

:focus-visible {
  outline: 2px solid var(--brand-700);
  outline-offset: 2px;
  border-radius: 4px;
}

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 999;
  background: var(--brand-700); color: #fff; padding: .6rem 1rem; border-radius: var(--r-sm);
}
.skip-link:focus { left: .5rem; top: .5rem; }

/* ==========================================================================
   Layout
   ========================================================================== */

.container { width: 100%; max-width: var(--container); margin-inline: auto; padding-inline: 1.25rem; }
.container--wide { max-width: 1440px; }
.container--narrow { max-width: 780px; }

.stack > * + * { margin-top: 1rem; }
.stack-sm > * + * { margin-top: .5rem; }
.stack-lg > * + * { margin-top: 1.75rem; }

.row { display: flex; gap: 1rem; }
.row--between { justify-content: space-between; }
.row--center { align-items: center; }
.row--wrap { flex-wrap: wrap; }
.row--tight { gap: .5rem; }
.spacer { flex: 1 1 auto; }

.grid { display: grid; gap: 1rem; }
.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--auto { grid-template-columns: repeat(auto-fill, minmax(272px, 1fr)); }
.grid--sidebar { grid-template-columns: minmax(0, 1fr) 336px; align-items: start; }

.section { padding-block: 2.5rem; }
.section--tight { padding-block: 1.5rem; }

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

/* ==========================================================================
   Masthead — white and bordered, like the reference dashboards
   ========================================================================== */

.masthead {
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 40;
}

.masthead__inner { display: flex; align-items: center; gap: 1.5rem; min-height: var(--masthead-h); }

.brand { display: flex; align-items: center; gap: .6rem; color: var(--ink); text-decoration: none; }
.brand:hover { color: var(--ink); text-decoration: none; }

.brand__mark {
  width: 36px; height: 36px; flex: none;
  display: grid; place-items: center;
  background: linear-gradient(140deg, var(--brand-500), var(--brand-700));
  color: #fff;
  border-radius: 10px;
  font-weight: 700; font-size: .82rem; letter-spacing: -.02em;
  box-shadow: 0 2px 6px rgba(79, 70, 229, .28);
}

.brand__name { font-size: 1.02rem; font-weight: 650; line-height: 1.15; letter-spacing: -.02em; }
.brand__sub { font-size: .64rem; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-faint); font-weight: 600; }

.nav { display: flex; align-items: center; gap: .15rem; margin-left: auto; }

.nav__link {
  color: var(--ink-soft);
  padding: .45rem .75rem;
  border-radius: var(--r-sm);
  font-size: .9rem; font-weight: 500;
  white-space: nowrap;
}
.nav__link:hover { background: var(--line-soft); color: var(--ink); text-decoration: none; }
.nav__link[aria-current="page"] { background: var(--brand-050); color: var(--brand-700); font-weight: 600; }

.nav-toggle {
  display: none; margin-left: auto;
  background: var(--line-soft); border: 1px solid var(--line); color: var(--ink-soft);
  width: 38px; height: 36px; border-radius: var(--r-sm); cursor: pointer;
}

@media (max-width: 880px) {
  .nav-toggle { display: grid; place-items: center; }
  .nav {
    display: none; position: absolute; left: 0; right: 0; top: 100%;
    flex-direction: column; align-items: stretch; gap: .1rem;
    background: var(--surface); padding: .6rem 1.25rem 1rem;
    border-bottom: 1px solid var(--line);
    box-shadow: var(--shadow);
  }
  .nav.is-open { display: flex; }
  .nav__link { padding: .6rem .6rem; }
}

/* ==========================================================================
   Buttons
   ========================================================================== */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .45rem;
  padding: .58rem 1.05rem;
  font: inherit; font-size: .89rem; font-weight: 600;
  border-radius: var(--r-sm);
  border: 1px solid transparent;
  cursor: pointer;
  transition: background .14s ease, border-color .14s ease, color .14s ease,
              box-shadow .14s ease, transform .06s ease;
  white-space: nowrap;
  text-decoration: none;
  letter-spacing: -.006em;
}
.btn:active { transform: translateY(1px); }
.btn:hover { text-decoration: none; }
.btn[disabled], .btn.is-disabled { opacity: .5; pointer-events: none; }

.btn--primary { background: var(--brand-700); color: #fff; box-shadow: 0 1px 2px rgba(16, 24, 40, .06); }
.btn--primary:hover { background: var(--brand-800); color: #fff; }

.btn--gold { background: var(--accent-500); color: #3d2a06; }
.btn--gold:hover { background: var(--accent-600); color: #3d2a06; }

.btn--ghost { background: var(--surface); border-color: var(--line); color: var(--ink-soft); }
.btn--ghost:hover { background: var(--line-soft); border-color: #d9dde4; color: var(--ink); }

.btn--quiet { background: transparent; color: var(--ink-faint); padding-inline: .5rem; }
.btn--quiet:hover { background: var(--line-soft); color: var(--ink-soft); }

.btn--danger { background: var(--err-700); color: #fff; }
.btn--danger:hover { background: #b42318; color: #fff; }

.btn--ok { background: var(--ok-700); color: #fff; }
.btn--ok:hover { background: #05603a; color: #fff; }

.btn--sm { padding: .36rem .7rem; font-size: .82rem; border-radius: var(--r-xs); }
.btn--lg { padding: .72rem 1.5rem; font-size: .98rem; border-radius: var(--r); }
.btn--block { width: 100%; }

.btn--onnavy { background: var(--surface); color: var(--ink-soft); border-color: var(--line); }
.btn--onnavy:hover { background: var(--line-soft); color: var(--ink); }

/* ==========================================================================
   Cards & panels
   ========================================================================== */

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r);
  box-shadow: var(--shadow-xs);
}
.card__body { padding: 1.25rem; }
.card__head {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--line-soft);
  display: flex; align-items: center; gap: .75rem;
}
.card__head h2, .card__head h3 { margin: 0; font-size: 1rem; font-weight: 650; }
.card__foot {
  padding: .85rem 1.25rem;
  border-top: 1px solid var(--line-soft);
  background: var(--surface-2);
  border-radius: 0 0 var(--r) var(--r);
}
/*
 * `card--flush` means "a table or list may run edge to edge inside me".
 *
 * It used to say `.card--flush .card__body { padding: 0 }`, which is a
 * different thing entirely, and wrong. A `.card__body` holds ordinary content —
 * a bar chart, an empty-state line, an inline form — and zeroing its padding
 * put that content hard against the card border, twenty pixels to the left of
 * the heading directly above it, with no space above or below. That was true
 * on 22 cards across the product; the platform dashboard is simply where it was
 * noticed.
 *
 * The rule was never needed. Every element that genuinely goes edge to edge —
 * `.table-wrap`, `.resultlist`, `.reqlist` — is a direct child of `.card`, not
 * of `.card__body`, so it is unaffected by the body's padding either way. All
 * the rule did was break the bodies that sat beside those elements.
 *
 * If a body ever does need to be full-bleed, give it `card__body--flush`
 * explicitly rather than inferring it from the parent.
 */
.card__body--flush { padding: 0; }
.card--link { transition: box-shadow .16s ease, border-color .16s ease, transform .16s ease; }
.card--link:hover { box-shadow: var(--shadow); border-color: var(--brand-200); transform: translateY(-2px); }

.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 1.25rem;
}

/* ==========================================================================
   Typography helpers
   ========================================================================== */

.eyebrow {
  font-size: .7rem; font-weight: 700; letter-spacing: .1em;
  text-transform: uppercase; color: var(--brand-700);
  margin-bottom: .45rem;
}
.eyebrow--light { color: var(--brand-700); }

.lede { font-size: 1.04rem; color: var(--ink-soft); line-height: 1.6; }
.muted { color: var(--ink-soft); }
.faint { color: var(--ink-faint); }
.tiny { font-size: .78rem; }
.strong { font-weight: 650; }
.serif { font-family: var(--display); font-weight: 650; letter-spacing: -.015em; }
.nowrap { white-space: nowrap; }
.center { text-align: center; }
.right { text-align: right; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.rule {
  display: flex; align-items: center; gap: .9rem;
  font-size: .74rem; font-weight: 600; letter-spacing: .09em; text-transform: uppercase;
  color: var(--ink-faint); margin: 1.75rem 0 1rem;
}
.rule::after { content: ""; flex: 1; height: 1px; background: var(--line); }

/* ==========================================================================
   Badges, pills, chips
   ========================================================================== */

.badge {
  display: inline-flex; align-items: center; gap: .3rem;
  padding: .2rem .6rem;
  font-size: .74rem; font-weight: 600; line-height: 1.5;
  border-radius: var(--r-pill);
  background: var(--line-soft); color: var(--ink-soft);
  border: 1px solid transparent;
}
.badge--ok   { background: var(--ok-100);   color: var(--ok-700); }
.badge--warn { background: var(--warn-100); color: var(--warn-700); }
.badge--err  { background: var(--err-100);  color: var(--err-700); }
.badge--info { background: var(--info-100); color: var(--info-700); }
.badge--navy { background: var(--brand-050); color: var(--brand-700); }
.badge--gold { background: var(--accent-050); color: var(--accent-700); }
.badge--outline { background: transparent; border-color: var(--line); color: var(--ink-soft); }
.badge--boy  { background: var(--boy-100);  color: var(--boy-700); }
.badge--girl { background: var(--girl-100); color: var(--girl-700); }

.dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; flex: none; }

.chips { display: flex; flex-wrap: wrap; gap: .4rem; }
.chip {
  display: inline-flex; align-items: center; gap: .35rem;
  padding: .34rem .75rem;
  font-size: .82rem; font-weight: 500;
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  background: var(--surface);
  color: var(--ink-soft);
  cursor: pointer;
}
.chip:hover { border-color: var(--brand-200); background: var(--brand-050); text-decoration: none; color: var(--brand-700); }
.chip.is-active { background: var(--brand-700); border-color: var(--brand-700); color: #fff; }

/* ==========================================================================
   Forms
   ========================================================================== */

.field { margin-bottom: 1rem; }
.field:last-child { margin-bottom: 0; }

.label { display: block; font-size: .82rem; font-weight: 600; color: var(--ink); margin-bottom: .35rem; }
.label .req { color: var(--err-700); font-weight: 400; }

.hint { font-size: .78rem; color: var(--ink-faint); margin-top: .3rem; }

.input, .select, .textarea {
  width: 100%;
  padding: .58rem .75rem;
  font: inherit; font-size: .92rem;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  box-shadow: var(--shadow-xs);
  transition: border-color .14s ease, box-shadow .14s ease;
}
.input:hover, .select:hover, .textarea:hover { border-color: #d0d5dd; }
.input:focus, .select:focus, .textarea:focus {
  outline: none;
  border-color: var(--brand-400);
  box-shadow: var(--ring);
}
.input::placeholder, .textarea::placeholder { color: var(--ink-faint); }
.input[readonly], .input[disabled] { background: var(--line-soft); color: var(--ink-soft); }

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

.select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%23667085' d='M1.4 0 6 4.6 10.6 0 12 1.4 6 7.4 0 1.4Z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right .75rem center;
  padding-right: 2.1rem;
}

.input.is-invalid, .select.is-invalid, .textarea.is-invalid {
  border-color: var(--err-700);
  box-shadow: 0 0 0 4px var(--err-100);
}

.error { color: var(--err-700); font-size: .78rem; margin-top: .3rem; }

.check { display: flex; align-items: flex-start; gap: .55rem; font-size: .88rem; line-height: 1.45; cursor: pointer; }
.check input { margin-top: .2rem; width: 16px; height: 16px; accent-color: var(--brand-700); flex: none; }

.fieldset {
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--surface);
  padding: 1.25rem 1.35rem;
  margin: 0 0 1.15rem;
  box-shadow: var(--shadow-xs);
}
.fieldset > legend {
  font-size: .95rem; font-weight: 650;
  color: var(--ink); padding-inline: .45rem;
  letter-spacing: -.01em;
}

.input-group { display: flex; }
.input-group .input { border-radius: var(--r-sm) 0 0 var(--r-sm); }
.input-group .btn { border-radius: 0 var(--r-sm) var(--r-sm) 0; }

.form-grid { display: grid; gap: 0 1rem; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.form-grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 1180px) { .grid--sidebar aside .form-grid { grid-template-columns: minmax(0, 1fr); } }
.form-grid .span-2 { grid-column: span 2; }
.form-grid .span-all { grid-column: 1 / -1; }
@media (max-width: 700px) {
  .form-grid, .form-grid--3 { grid-template-columns: minmax(0, 1fr); }
  .form-grid .span-2, .form-grid .span-all { grid-column: auto; }
}

/* ==========================================================================
   Alerts
   ========================================================================== */

.alert {
  display: flex; gap: .7rem; align-items: flex-start;
  padding: .85rem 1rem;
  border-radius: var(--r);
  border: 1px solid;
  font-size: .89rem;
  margin-bottom: 1.25rem;
}
.alert__icon { flex: none; margin-top: .12rem; }
.alert--ok   { background: var(--ok-100);   border-color: var(--ok-200);   color: var(--ok-700); }
.alert--warn { background: var(--warn-100); border-color: var(--warn-200); color: var(--warn-700); }
.alert--err  { background: var(--err-100);  border-color: var(--err-200);  color: var(--err-700); }
.alert--info { background: var(--info-100); border-color: var(--info-200); color: var(--info-700); }
.alert ul { margin: .35rem 0 0; padding-left: 1.1rem; }

/* ==========================================================================
   Tables
   ========================================================================== */

/*
 * `contain: paint` alongside the scrolling, not instead of it.
 *
 * `overflow-x: auto` alone makes the table scroll inside its card — and the
 * table still contributes its full width to the *document's* scrollable area,
 * so the whole page scrolled sideways by 96px on a 380px screen even though
 * the table itself was scrolling correctly. `contain: paint` tells the browser
 * this box's descendants cannot affect layout outside it, which is already
 * true here, and the page stops moving.
 *
 * The alternative — `table-layout: fixed; width: 100%` — also removes the
 * page overflow, by squeezing a five-column comparison table into 340px. A
 * table you can scroll beats a table you cannot read.
 */
.table-wrap { overflow-x: auto; border-radius: var(--r); contain: paint; }

.table { width: 100%; border-collapse: collapse; font-size: .89rem; }
.table th {
  text-align: left;
  font-size: .74rem; font-weight: 600; letter-spacing: .02em;
  color: var(--ink-faint);
  padding: .7rem .95rem;
  border-bottom: 1px solid var(--line);
  background: var(--surface-2);
  white-space: nowrap;
}
.table td { padding: .8rem .95rem; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: var(--surface-2); }
.table--fixed { table-layout: fixed; }

/* ==========================================================================
   Stats
   ========================================================================== */

.stat {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 1.1rem 1.15rem;
  box-shadow: var(--shadow-xs);
}
.stat__icon {
  width: 38px; height: 38px; border-radius: 10px;
  display: grid; place-items: center;
  background: var(--brand-050); color: var(--brand-700);
  margin-bottom: .8rem;
}
.stat__label { font-size: .8rem; font-weight: 550; color: var(--ink-soft); margin-bottom: .3rem; }
.stat__value {
  font-size: 1.85rem; font-weight: 700;
  color: var(--ink); line-height: 1.08;
  letter-spacing: -.03em;
  font-variant-numeric: tabular-nums;
}
.stat__value small { font-size: .9rem; color: var(--ink-faint); font-weight: 500; }
.stat__meta { font-size: .78rem; color: var(--ink-faint); margin-top: .35rem; }

.stat--navy {
  background: linear-gradient(150deg, var(--brand-700), var(--brand-900));
  border-color: transparent;
  box-shadow: 0 6px 18px -6px rgba(49, 46, 129, .45);
}
.stat--navy .stat__label { color: rgba(255,255,255,.72); }
.stat--navy .stat__value { color: #fff; }
.stat--navy .stat__meta  { color: rgba(255,255,255,.68); }
.stat--navy .stat__icon  { background: rgba(255,255,255,.16); color: #fff; }

.stat-strip {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 1px; background: var(--line);
  border: 1px solid var(--line); border-radius: var(--r); overflow: hidden;
}
.stat-strip > div { background: var(--surface); padding: 1rem 1.15rem; }

/* ==========================================================================
   Meters
   ========================================================================== */

.meter { height: 8px; border-radius: var(--r-pill); background: var(--line-soft); overflow: hidden; }
.meter__fill { height: 100%; border-radius: var(--r-pill); background: var(--brand-700); transition: width .4s ease; }
.meter__fill--ok   { background: var(--ok-700); }
.meter__fill--warn { background: var(--accent-500); }
.meter__fill--err  { background: var(--err-700); }

/* ==========================================================================
   Avatars & identity
   ========================================================================== */

.avatar {
  width: 38px; height: 38px; flex: none;
  border-radius: 50%;
  display: grid; place-items: center;
  background: var(--brand-050); color: var(--brand-700);
  font-weight: 650; font-size: .82rem;
  overflow: hidden;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar--lg { width: 56px; height: 56px; font-size: 1.05rem; }
.avatar--sm { width: 30px; height: 30px; font-size: .7rem; }
.avatar--square { border-radius: 9px; }

.crest {
  width: 64px; height: 64px; flex: none;
  border-radius: var(--r);
  display: grid; place-items: center;
  background: var(--surface); color: var(--brand-700);
  font-weight: 700; font-size: 1.5rem; letter-spacing: -.03em;
  overflow: hidden;
  border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
}
.crest img { width: 100%; height: 100%; object-fit: cover; }
.crest--lg { width: 92px; height: 92px; font-size: 2.1rem; border-radius: var(--r-lg); border: 4px solid var(--surface); }

/* ==========================================================================
   Tabs
   ========================================================================== */

.tabs { display: flex; gap: .2rem; overflow-x: auto; border-bottom: 1px solid var(--line); scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab {
  padding: .75rem .95rem;
  font-size: .89rem; font-weight: 550;
  color: var(--ink-soft);
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  white-space: nowrap;
}
.tab:hover { color: var(--brand-700); text-decoration: none; }
.tab.is-active { color: var(--brand-700); border-bottom-color: var(--brand-700); font-weight: 600; }

/* ==========================================================================
   Empty states
   ========================================================================== */

.empty { text-align: center; padding: 3rem 1.5rem; color: var(--ink-soft); }
.empty__mark {
  width: 52px; height: 52px; margin: 0 auto .9rem;
  border-radius: var(--r); display: grid; place-items: center;
  background: var(--brand-050); color: var(--brand-700);
}
.empty h3 { margin-bottom: .35rem; }

/* ==========================================================================
   Pagination
   ========================================================================== */

.pagination { display: flex; flex-wrap: wrap; gap: .3rem; list-style: none; padding: 0; margin: 1.5rem 0 0; }
.pagination a, .pagination span {
  display: inline-grid; place-items: center;
  min-width: 36px; height: 36px; padding-inline: .55rem;
  border: 1px solid var(--line); border-radius: var(--r-sm);
  background: var(--surface); color: var(--ink-soft);
  font-size: .85rem; font-weight: 550;
}
.pagination a:hover { border-color: var(--brand-200); background: var(--brand-050); color: var(--brand-700); text-decoration: none; }
.pagination .active span { background: var(--brand-700); border-color: var(--brand-700); color: #fff; }
.pagination .disabled span { opacity: .4; }

/* ==========================================================================
   App shell
   ========================================================================== */

.shell { display: grid; grid-template-columns: 248px minmax(0, 1fr); min-height: calc(100vh - var(--masthead-h)); }

.sidebar {
  background: var(--surface);
  border-right: 1px solid var(--line);
  padding: 1.25rem .75rem;
  position: sticky; top: var(--masthead-h); align-self: start;

  /*
   * `height`, not `max-height`.
   *
   * With max-height the sidebar is only as tall as its own nav, so on any page
   * longer than the menu — an analytics page with a full-height chart, say —
   * its background and right border simply stop, leaving a bare strip down the
   * side of the window. Pinning it to the viewport height instead means the
   * column always reads as a column, and because it is sticky it stays exactly
   * that tall however far the page scrolls.
   */
  height: calc(100vh - var(--masthead-h)); overflow-y: auto;
}
.sidebar__group + .sidebar__group { margin-top: 1.5rem; }
.sidebar__title {
  font-size: .68rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase;
  color: var(--ink-faint); padding: 0 .7rem; margin-bottom: .5rem;
}
.sidebar__link {
  display: flex; align-items: center; gap: .65rem;
  padding: .55rem .7rem;
  border-radius: var(--r-sm);
  color: var(--ink-soft); font-size: .89rem; font-weight: 550;
  margin-bottom: .1rem;
}
.sidebar__link:hover { background: var(--line-soft); color: var(--ink); text-decoration: none; }
.sidebar__link.is-active { background: var(--brand-050); color: var(--brand-700); font-weight: 650; }
.sidebar__link .count {
  margin-left: auto; font-size: .72rem; font-weight: 700;
  background: var(--err-100); color: var(--err-700);
  padding: .05rem .45rem; border-radius: var(--r-pill);
}
.sidebar__link.is-active .count { background: var(--brand-100); color: var(--brand-800); }

.workspace { padding: 1.75rem 1.75rem 3rem; min-width: 0; }

.page-head { display: flex; align-items: flex-start; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.5rem; }
.page-head h1 { font-size: 1.55rem; margin: 0; }
.page-head p { margin: .25rem 0 0; color: var(--ink-soft); font-size: .92rem; }

@media (max-width: 900px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .sidebar {
    position: static; max-height: none;
    border-right: 0; border-bottom: 1px solid var(--line);
    display: flex; gap: .3rem; overflow-x: auto; padding: .6rem .75rem;
  }
  /* groups become inline runs so the whole nav is one horizontal scroller */
  .sidebar__group { display: flex; gap: .3rem; }
  .sidebar__group + .sidebar__group { margin-top: 0; }
  .sidebar__title { display: none; }
  .sidebar__link { white-space: nowrap; margin-bottom: 0; }
  .workspace { padding: 1.25rem 1rem 2.5rem; }
}

/* ==========================================================================
   Public hero — light and tinted, in the spirit of the references
   ========================================================================== */

.hero {
  background:
    radial-gradient(900px 380px at 88% -30%, rgba(245, 165, 36, .16), transparent 62%),
    radial-gradient(1000px 420px at 6% -10%, rgba(99, 102, 241, .22), transparent 60%),
    linear-gradient(180deg, var(--brand-050) 0%, var(--canvas) 100%);
  color: var(--ink);
  padding: 3.25rem 0 2.75rem;
  position: relative;
  border-bottom: 1px solid var(--line);
}
.hero__grid { display: grid; grid-template-columns: 1.1fr .9fr; gap: 3rem; align-items: center; }
@media (max-width: 940px) { .hero__grid { grid-template-columns: minmax(0,1fr); gap: 2rem; } .hero__aside { display: none; } }
.hero--slim { padding: 2.5rem 0 2rem; }
.hero--slim h1 { max-width: 24ch; }
.hero h1 { color: var(--ink); max-width: 20ch; }
.hero p { color: var(--ink-soft); max-width: 58ch; font-size: 1.04rem; }

.searchbar {
  display: flex; gap: .5rem; flex-wrap: wrap;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: .5rem;
  margin-top: 1.6rem;
  box-shadow: var(--shadow);
  max-width: 740px;
}
.searchbar .input, .searchbar .select { border-color: transparent; box-shadow: none; flex: 1 1 180px; min-width: 0; }
.searchbar .input:focus, .searchbar .select:focus { box-shadow: var(--ring); border-color: var(--brand-400); }
.searchbar .btn { flex: none; }

.hero-stats {
  display: flex; flex-wrap: wrap; gap: 2.25rem;
  margin-top: 2.25rem; padding-top: 1.5rem;
  border-top: 1px solid var(--line);
}
.hero-stats__item { min-width: 92px; }
.hero-stats__value {
  font-size: 1.7rem; font-weight: 700; color: var(--ink);
  line-height: 1; font-variant-numeric: tabular-nums; letter-spacing: -.03em;
}
.hero-stats__label { font-size: .74rem; font-weight: 550; color: var(--ink-faint); margin-top: .35rem; }

/* ==========================================================================
   School card
   ========================================================================== */

.school-card {
  display: flex; flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  overflow: hidden;
  box-shadow: var(--shadow-xs);
  transition: box-shadow .16s ease, transform .16s ease, border-color .16s ease;
}
.school-card:hover { box-shadow: var(--shadow); transform: translateY(-3px); border-color: var(--brand-200); text-decoration: none; }

.school-card__banner {
  height: 68px; position: relative;
  /* the school's accent is supplied as --accent-hue and used at low opacity,
     so a wall of cards reads as one system rather than a rainbow */
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--accent-hue, #4f46e5) 16%, #fff),
                            color-mix(in srgb, var(--accent-hue, #4f46e5) 6%, #fff));
  border-bottom: 1px solid var(--line-soft);
}
.school-card__banner img { width: 100%; height: 100%; object-fit: cover; }

.school-card__crest {
  position: absolute; left: 1.1rem; bottom: -24px;
  width: 54px; height: 54px;
  border-radius: 13px;
  border: 3px solid var(--surface);
  background: var(--surface);
  display: grid; place-items: center;
  font-weight: 700; font-size: 1.15rem; color: var(--accent-hue, var(--brand-700));
  overflow: hidden;
  box-shadow: var(--shadow-xs);
}
.school-card__crest img { width: 100%; height: 100%; object-fit: cover; }

.school-card__body { padding: 2.1rem 1.15rem 1rem; flex: 1; }
.school-card__name { font-size: 1.02rem; font-weight: 650; color: var(--ink); margin: 0 0 .15rem; letter-spacing: -.015em; }
.school-card__meta { font-size: .82rem; color: var(--ink-faint); }

.school-card__stats {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 1px; background: var(--line-soft);
  border-top: 1px solid var(--line-soft);
  margin-top: .95rem;
}
.school-card__stats > div { background: var(--surface); padding: .65rem .5rem; text-align: center; }
.school-card__stats .n { font-size: 1.05rem; font-weight: 700; color: var(--ink); font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.school-card__stats .l { font-size: .67rem; color: var(--ink-faint); font-weight: 550; }

.school-card__foot {
  padding: .7rem 1.15rem;
  border-top: 1px solid var(--line-soft);
  background: var(--surface-2);
  display: flex; align-items: center; gap: .5rem;
  font-size: .8rem;
}

.stars { display: inline-flex; gap: 1px; color: var(--accent-500); line-height: 1; }
.stars svg { width: 13px; height: 13px; }
.stars .off { color: #e2e6ec; }

/* ==========================================================================
   School public page
   ========================================================================== */

.school-hero { background: var(--surface); border-bottom: 1px solid var(--line); position: relative; }
.school-hero__cover { height: 200px; overflow: hidden; background: var(--brand-700); }
.school-hero__cover img { width: 100%; height: 100%; object-fit: cover; }
.school-hero__cover--plain {
  height: 140px;
  background:
    radial-gradient(700px 260px at 12% 0%, rgba(245,165,36,.28), transparent 60%),
    linear-gradient(120deg, var(--brand-600), var(--brand-900));
}
.school-hero__id { display: flex; gap: 1.15rem; align-items: flex-end; padding-bottom: 1.4rem; margin-top: -46px; position: relative; }
.school-hero__id h1 { color: var(--ink); margin: 0 0 .2rem; font-size: clamp(1.35rem, 1.1rem + 1.3vw, 1.95rem); }
.school-hero__meta { color: var(--ink-soft); font-size: .88rem; }

.tabbar { background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: var(--masthead-h); z-index: 30; }

/* ==========================================================================
   Timeline & checklist
   ========================================================================== */

.timeline { list-style: none; padding: 0; margin: 0; }
.timeline li { position: relative; padding: 0 0 1.15rem 1.5rem; border-left: 2px solid var(--line); }
.timeline li:last-child { border-left-color: transparent; padding-bottom: 0; }
.timeline li::before {
  content: ""; position: absolute; left: -6px; top: .35rem;
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--surface); border: 2px solid var(--brand-500);
}
.timeline li.is-ok::before   { border-color: var(--ok-700); }
.timeline li.is-err::before  { border-color: var(--err-700); }
.timeline li.is-warn::before { border-color: var(--accent-500); }

.checklist { list-style: none; padding: 0; margin: 0; }
.checklist li {
  display: flex; align-items: center; gap: .65rem;
  padding: .6rem 0;
  border-bottom: 1px solid var(--line-soft);
  font-size: .89rem;
}
.checklist li:last-child { border-bottom: 0; }
.checklist .tick {
  width: 20px; height: 20px; flex: none; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--line-soft); color: var(--ink-faint);
  font-size: .68rem;
}
.checklist li.is-done .tick { background: var(--ok-100); color: var(--ok-700); }
.checklist li.is-done span { color: var(--ink-faint); text-decoration: line-through; }

/* ==========================================================================
   Pricing
   ========================================================================== */

.price-card {
  display: flex; flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 1.6rem 1.4rem;
  position: relative;
  box-shadow: var(--shadow-xs);
}
.price-card.is-featured { border-color: var(--brand-700); box-shadow: var(--ring), var(--shadow); }
.price-card__flag {
  position: absolute; top: -12px; left: 50%; transform: translateX(-50%);
  background: var(--brand-700); color: #fff;
  font-size: .68rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
  padding: .25rem .8rem; border-radius: var(--r-pill); white-space: nowrap;
}
.price-card__amount { font-size: 2.3rem; font-weight: 700; color: var(--ink); line-height: 1; margin: .55rem 0 .15rem; letter-spacing: -.035em; }
/* Only the unit ("/ year") is small and grey — not the wrapper that the
   billing toggle switches, which contains the figure itself. */
.price-card__amount .unit { font-size: .92rem; color: var(--ink-faint); font-weight: 500; letter-spacing: 0; }

.feature-list { list-style: none; padding: 0; margin: 1.1rem 0 0; }
.feature-list li { display: flex; align-items: flex-start; gap: .55rem; padding: .34rem 0; font-size: .88rem; color: var(--ink-soft); }
.feature-list svg { flex: none; margin-top: .2rem; color: var(--ok-700); }
.feature-list li.is-off { color: var(--ink-faint); }
.feature-list li.is-off svg { color: #d0d5dd; }

/* ==========================================================================
   Charts
   Categorical slots re-validated against the white chart surface for
   lightness band, chroma floor, CVD separation and contrast.
   ========================================================================== */

:root {
  --cat-1: #4f46e5;
  --cat-2: #d97706;
  --cat-3: #0e9384;
  --chart-muted: var(--ink-faint);
  --chart-grid:  #eef1f5;
  --chart-surface: #ffffff;
}

.chart { position: relative; }
.chart__title { font-size: .95rem; font-weight: 650; color: var(--ink); margin-bottom: .1rem; letter-spacing: -.01em; }
.chart__sub { font-size: .78rem; color: var(--ink-faint); margin-bottom: .9rem; }
.chart svg { display: block; width: 100%; height: auto; overflow: visible; }

.chart .grid-line { stroke: var(--chart-grid); stroke-width: 1; }
.chart .axis-label { font-size: 10px; fill: var(--chart-muted); font-family: var(--sans); }
.chart .series-line { fill: none; stroke: var(--cat-1); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.chart .series-area { fill: var(--cat-1); opacity: .07; }
.chart .series-dot { fill: var(--cat-1); stroke: var(--chart-surface); stroke-width: 2; }
.chart .hit { fill: transparent; cursor: crosshair; }
.chart .crosshair { stroke: var(--chart-muted); stroke-width: 1; stroke-dasharray: 3 3; opacity: 0; }
.chart.is-hovering .crosshair { opacity: 1; }

.chart__tip {
  position: absolute; z-index: 5; pointer-events: none;
  background: var(--ink); color: #fff;
  padding: .45rem .65rem; border-radius: var(--r-sm);
  font-size: .78rem; line-height: 1.35; white-space: nowrap;
  box-shadow: var(--shadow); opacity: 0;
  transform: translate(-50%, -125%);
  transition: opacity .1s ease;
}
.chart.is-hovering .chart__tip { opacity: 1; }
.chart__tip b { font-variant-numeric: tabular-nums; }

.compbar { display: flex; height: 26px; border-radius: var(--r-sm); overflow: hidden; gap: 2px; background: var(--chart-surface); }
.compbar > span { display: block; height: 100%; }
.compbar__legend { display: flex; flex-wrap: wrap; gap: 1rem; margin-top: .75rem; font-size: .82rem; }
.compbar__legend .key { display: inline-flex; align-items: center; gap: .4rem; color: var(--ink-soft); }
.compbar__legend .swatch { width: 10px; height: 10px; border-radius: 3px; flex: none; }
.compbar__legend b { color: var(--ink); font-variant-numeric: tabular-nums; }

.hbars { display: grid; gap: .6rem; }
.hbar { display: grid; grid-template-columns: 120px minmax(0,1fr) 52px; align-items: center; gap: .7rem; font-size: .84rem; }
.hbar__track { display: block; background: var(--chart-grid); border-radius: var(--r-pill); height: 10px; overflow: hidden; }
.hbar__fill { display: block; height: 100%; border-radius: var(--r-pill); background: var(--cat-1); min-width: 2px; }

/*
 * ...but zero is zero.
 *
 * The 2px floor above exists so that one school out of four hundred still
 * shows something rather than nothing. Applied to a genuine zero it paints a
 * stub that reads as "a little", which is the one answer that is definitely
 * wrong. A bar at 0% therefore keeps no minimum at all.
 *
 * Matching on the inline width is deliberate: it fixes every one of the twelve
 * places that draw one of these bars, without each of them having to remember.
 * "width:0%" cannot collide with "width:0.5%" or "width:20%" — the percent
 * sign is part of the match.
 */
.hbar__fill[style*="width:0%"],
.hbar__fill[style*="width: 0%"] { min-width: 0; }
.hbar__value { text-align: right; font-variant-numeric: tabular-nums; color: var(--ink-soft); font-weight: 550; }

.spark { display: block; width: 100%; height: auto; overflow: visible; }

/* ==========================================================================
   Attendance register
   ========================================================================== */

.roll { display: grid; grid-template-columns: repeat(auto-fill, minmax(238px, 1fr)); gap: .65rem; }

.pupil {
  position: relative;
  display: flex; flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r);
  overflow: hidden;
  box-shadow: var(--shadow-xs);
  transition: border-color .12s ease, box-shadow .12s ease;
}

.pupil__hit {
  display: flex; align-items: center; gap: .65rem;
  width: 100%; padding: .7rem .8rem;
  background: none; border: 0; font: inherit; color: inherit;
  text-align: left; cursor: pointer;
}
.pupil__hit:hover { background: var(--surface-2); }

.pupil__figure {
  width: 40px; height: 40px; flex: none;
  border-radius: 50%;
  display: grid; place-items: center;
  background: var(--line-soft); color: var(--ink-faint);
}
.pupil__figure--male   { background: var(--boy-100);  color: var(--boy-700); }
.pupil__figure--female { background: var(--girl-100); color: var(--girl-700); }

.pupil__id { min-width: 0; flex: 1; }
.pupil__name {
  display: block;
  font-size: .92rem; font-weight: 600; color: var(--ink);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  letter-spacing: -.01em;
}
.pupil__meta { font-size: .74rem; color: var(--ink-faint); font-variant-numeric: tabular-nums; }

.pupil__mark {
  flex: none; width: 28px; height: 28px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--line-soft); color: var(--ink-faint);
  font-size: .7rem; font-weight: 700;
}

.pupil__states {
  display: grid; grid-template-columns: repeat(5, 1fr);
  gap: 1px; background: var(--line-soft);
  border-top: 1px solid var(--line-soft);
}
.pupil__states input { position: absolute; opacity: 0; pointer-events: none; }
.pupil__states label {
  display: grid; place-items: center;
  padding: .45rem .1rem;
  background: var(--surface);
  font-size: .72rem; font-weight: 700;
  color: var(--ink-faint);
  cursor: pointer;
  min-height: 36px;
}
.pupil__states label:hover { background: var(--brand-050); color: var(--brand-700); }
.pupil__states input:focus-visible + label { outline: 2px solid var(--brand-700); outline-offset: -2px; }

.pupil__states input:checked + label[data-tone="ok"]   { background: var(--ok-700);     color: #fff; }
.pupil__states input:checked + label[data-tone="err"]  { background: var(--err-700);    color: #fff; }
.pupil__states input:checked + label[data-tone="warn"] { background: var(--accent-600); color: #fff; }
.pupil__states input:checked + label[data-tone="info"] { background: var(--info-700);   color: #fff; }
.pupil__states input:checked + label[data-tone="navy"] { background: var(--brand-700);  color: #fff; }

.pupil.is-present  { box-shadow: inset 3px 0 0 var(--ok-700),     var(--shadow-xs); }
.pupil.is-absent   { box-shadow: inset 3px 0 0 var(--err-700),    var(--shadow-xs); background: #fffcfc; }
.pupil.is-late     { box-shadow: inset 3px 0 0 var(--accent-600), var(--shadow-xs); }
.pupil.is-leave    { box-shadow: inset 3px 0 0 var(--info-700),   var(--shadow-xs); }
.pupil.is-half_day { box-shadow: inset 3px 0 0 var(--brand-700),  var(--shadow-xs); }

.pupil.is-present  .pupil__mark { background: var(--ok-100);     color: var(--ok-700); }
.pupil.is-absent   .pupil__mark { background: var(--err-100);    color: var(--err-700); }
.pupil.is-late     .pupil__mark { background: var(--accent-050); color: var(--accent-700); }
.pupil.is-leave    .pupil__mark { background: var(--info-100);   color: var(--info-700); }
.pupil.is-half_day .pupil__mark { background: var(--brand-050);  color: var(--brand-700); }

.tallybar {
  position: sticky; bottom: 0; z-index: 20;
  display: flex; align-items: center; gap: 1rem; flex-wrap: wrap;
  margin-top: 1rem;
  padding: .8rem 1.1rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r);
  box-shadow: 0 -8px 24px -8px rgba(16,24,40,.12);
}
.tally { display: flex; gap: 1.1rem; flex-wrap: wrap; font-size: .84rem; }
.tally b { font-variant-numeric: tabular-nums; font-size: 1.05rem; font-weight: 700; letter-spacing: -.02em; }
.tally .k { display: inline-flex; align-items: center; gap: .35rem; color: var(--ink-soft); }
.tally .swatch { width: 9px; height: 9px; border-radius: 3px; flex: none; }

.statuskey { display: flex; flex-wrap: wrap; gap: .8rem; font-size: .78rem; color: var(--ink-soft); }
.statuskey .k { display: inline-flex; align-items: center; gap: .35rem; }
.statuskey .box {
  width: 20px; height: 20px; border-radius: var(--r-xs);
  display: grid; place-items: center;
  font-size: .64rem; font-weight: 700; color: #fff;
}

.sectioncard {
  display: flex; align-items: center; gap: .85rem;
  padding: .9rem 1rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r);
  box-shadow: var(--shadow-xs);
  transition: border-color .14s ease, box-shadow .14s ease, transform .14s ease;
}
.sectioncard:hover { border-color: var(--brand-200); box-shadow: var(--shadow); transform: translateY(-2px); text-decoration: none; }
.sectioncard__badge {
  width: 46px; height: 46px; flex: none; border-radius: var(--r-sm);
  display: grid; place-items: center;
  background: var(--brand-050); color: var(--brand-700);
  font-weight: 700; font-size: 1rem;
}
.sectioncard.is-done .sectioncard__badge { background: var(--ok-100); color: var(--ok-700); }

.monthgrid { border-collapse: separate; border-spacing: 2px; font-size: .74rem; }
.monthgrid th { padding: .25rem; font-size: .64rem; background: none; border: 0; color: var(--ink-faint); }
.monthgrid td { padding: 0; border: 0; }
.monthgrid .cell {
  width: 22px; height: 22px; border-radius: var(--r-xs);
  display: grid; place-items: center;
  font-size: .62rem; font-weight: 700; color: #fff;
  background: var(--line-soft);
}
.monthgrid .cell--present  { background: var(--ok-700); }
.monthgrid .cell--absent   { background: var(--err-700); }
.monthgrid .cell--late     { background: var(--accent-600); }
.monthgrid .cell--leave    { background: var(--info-700); }
.monthgrid .cell--half_day { background: var(--brand-700); }
.monthgrid .cell--none     { background: var(--line-soft); color: var(--ink-faint); }

@media (max-width: 520px) {
  .roll { grid-template-columns: minmax(0, 1fr); }
  .tallybar { padding: .65rem .8rem; }
}

/* Without JavaScript the card-wide tap target does nothing, so hide it and
   leave the segmented control as the only interface. */
.no-js .pupil__hit { display: none; }
.no-js .pupil__states { border-top: 0; }

/* ==========================================================================
   Dialogs
   ========================================================================== */

dialog {
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-lg);
  padding: 1.5rem;
  max-width: 460px; width: calc(100% - 2rem);
  color: var(--ink);
}
dialog::backdrop { background: rgba(16, 24, 40, .5); }

/* ==========================================================================
   Footer
   ========================================================================== */

.site-foot {
  background: var(--surface);
  border-top: 1px solid var(--line);
  color: var(--ink-soft);
  padding: 2.5rem 0 1.75rem;
  margin-top: 3rem;
  font-size: .87rem;
}
.site-foot h4 { color: var(--ink); font-size: .78rem; letter-spacing: .06em; text-transform: uppercase; margin-bottom: .7rem; font-weight: 700; }
.site-foot a { color: var(--ink-soft); }
.site-foot a:hover { color: var(--brand-700); }
.site-foot__top { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2.1fr); gap: 2.5rem; }
.site-foot__links { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1.5rem; }
.site-foot__links ul { list-style: none; padding: 0; margin: 0; line-height: 2; }
.site-foot__bar {
  margin-top: 2rem; padding-top: 1.15rem;
  border-top: 1px solid var(--line);
  display: flex; flex-wrap: wrap; align-items: center; gap: .75rem;
  font-size: .8rem; color: var(--ink-faint);
}
.site-foot__meta { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; }
@media (max-width: 900px) {
  .site-foot__top { grid-template-columns: minmax(0, 1fr); gap: 2rem; }
  .site-foot__links { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 460px) { .site-foot__links { grid-template-columns: minmax(0, 1fr); } }

/* ==========================================================================
   Long-form documents: legal pages, about, security, help
   ========================================================================== */

.doc { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 3rem; align-items: start; }
.doc__toc { position: sticky; top: 1.5rem; display: flex; flex-direction: column; gap: .3rem; }
.doc__toc-title {
  font-size: .68rem; font-weight: 700; letter-spacing: .07em; text-transform: uppercase;
  color: var(--ink-faint); margin: 0 0 .35rem;
}
.doc__toc a { font-size: .82rem; color: var(--ink-soft); padding: .15rem 0; }
.doc__toc a:hover { color: var(--brand-700); }
.doc__body { max-width: 72ch; }
.doc__foot { margin-top: 2.5rem; padding-top: 1.25rem; border-top: 1px solid var(--line); }
@media (max-width: 900px) {
  .doc { grid-template-columns: minmax(0, 1fr); gap: 1.75rem; }
  .doc__toc { position: static; flex-flow: row wrap; gap: .35rem .9rem; }
  .doc__toc-title { width: 100%; }
}

/* Prose used by both .doc__body and the wider about/security pages. */
.prose, .doc__body { color: var(--ink-soft); line-height: 1.72; }
.prose > h2, .doc__body > h2 {
  margin: 2.25rem 0 .6rem; font-size: 1.18rem; color: var(--ink);
  scroll-margin-top: 1.5rem;
}
.prose > h2:first-child, .doc__body > h2:first-child { margin-top: 0; }
.prose > h3, .doc__body > h3 { margin: 1.5rem 0 .4rem; font-size: 1rem; color: var(--ink); }
.prose p, .doc__body p { margin: 0 0 .9rem; }
.prose ul, .prose ol, .doc__body ul, .doc__body ol { margin: 0 0 1.1rem; padding-left: 1.2rem; }
.prose li, .doc__body li { margin-bottom: .35rem; }
.prose code, .doc__body code {
  background: var(--line-soft); border-radius: 4px; padding: .1rem .32rem;
  font-size: .86em; color: var(--ink);
}
.table--doc { font-size: .86rem; margin: 0 0 1.4rem; }
.table--doc td, .table--doc th { vertical-align: top; }

.callout {
  background: var(--brand-050);
  border: 1px solid var(--brand-100, var(--line));
  border-left: 3px solid var(--brand-700);
  border-radius: var(--r-sm);
  padding: 1rem 1.15rem;
  margin: 0 0 1.75rem;
  font-size: .9rem;
  color: var(--ink-soft);
}
.callout strong { color: var(--ink); }

/* Numbered onboarding steps. */
.steps { list-style: none; counter-reset: step; padding: 0; margin: 0; }
.steps > li {
  counter-increment: step;
  position: relative;
  padding: 0 0 1.5rem 3.1rem;
  border-left: 2px solid var(--line);
  margin-left: 1rem;
}
.steps > li:last-child { border-left-color: transparent; padding-bottom: 0; }
.steps > li::before {
  content: counter(step);
  position: absolute; left: -1rem; top: -.15rem;
  width: 2rem; height: 2rem; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--brand-700); color: #fff;
  font-size: .82rem; font-weight: 700;
}
.steps h3 { margin: 0 0 .3rem; font-size: 1rem; }
.steps p { margin: 0; color: var(--ink-soft); font-size: .9rem; line-height: 1.65; }

/* Disclosure-based FAQ: open/close with no JavaScript at all. */
.faq {
  border: 1px solid var(--line); border-radius: var(--r-sm);
  background: var(--surface); padding: .85rem 1.05rem; margin-bottom: .6rem;
}
.faq summary {
  cursor: pointer; font-weight: 600; color: var(--ink); font-size: .92rem;
  list-style: none; display: flex; align-items: center; gap: .6rem;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::before {
  content: "+"; flex: none;
  width: 1.15rem; height: 1.15rem; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--brand-050); color: var(--brand-700);
  font-size: .85rem; font-weight: 700; line-height: 1;
}
.faq[open] summary::before { content: "−"; }
.faq[open] summary { margin-bottom: .5rem; }
.faq p { margin: 0; font-size: .88rem; color: var(--ink-soft); line-height: 1.65; }

/* --- a record's fields, two columns on desktop, stacked on a phone ---- */
.datalist { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 1.5rem; margin: 0; }
.datalist > div { padding: .55rem 0; border-bottom: 1px solid var(--line-soft); }
.datalist dt { font-size: .72rem; font-weight: 600; color: var(--ink-faint); margin: 0 0 .12rem; }
.datalist dd { margin: 0; font-size: .9rem; color: var(--ink); word-break: break-word; }
@media (max-width: 620px) { .datalist { grid-template-columns: minmax(0, 1fr); } }

.queue-list { list-style: none; margin: 0; padding: 0; }
.queue-list li {
  display: flex; align-items: center; gap: .5rem;
  padding: .35rem 0; border-bottom: 1px solid var(--line-soft); font-size: .85rem;
}
.queue-list__pos {
  flex: none; min-width: 1.7rem; height: 1.7rem; padding: 0 .35rem;
  border-radius: var(--r-sm); background: var(--brand-050); color: var(--brand-700);
  display: grid; place-items: center; font-size: .75rem; font-weight: 700;
}

/* --- where a family stands in the admission queue --------------------- */
.queue-standing {
  padding: 1rem 1.2rem; border-radius: var(--r);
  background: var(--surface-2); border: 1px solid var(--line);
  text-align: left;
}
.queue-standing strong {
  display: block; font-size: 2rem; line-height: 1.1;
  color: var(--brand-700); letter-spacing: -.03em;
}

/* --- the statutory requirement list ----------------------------------- */
.reqlist { list-style: none; margin: 0; padding: 0; }
.reqlist > li { border-top: 1px solid var(--line-soft); padding: .9rem 1.1rem; }
.reqlist > li:first-child { border-top: 0; }
.reqlist > li.is-expired { background: var(--err-100); }

.reqlist__row { display: flex; align-items: flex-start; gap: .8rem; }
.reqlist__body { flex: 1; min-width: 0; }
.reqlist__body strong { font-size: .92rem; }

.reqlist__mark {
  flex: none; width: 1.6rem; height: 1.6rem; border-radius: 50%;
  display: grid; place-items: center; margin-top: .1rem;
}
.reqlist__mark.is-met { background: var(--ok-100); color: var(--ok-700); }
.reqlist__mark.is-partial { background: var(--warn-100); color: var(--warn-700); }
.reqlist__mark.is-pending { background: var(--err-100); color: var(--err-700); }
.reqlist__mark.is-not_applicable { background: var(--line-soft); color: var(--ink-faint); }
.reqlist__mark.is-expired { background: var(--err-100); color: var(--err-700); }

.reqlist__facts {
  display: flex; flex-wrap: wrap; align-items: center; gap: .4rem;
  margin: .35rem 0 .2rem;
}
.reqlist__actions { flex: none; display: flex; gap: .3rem; }

.reqlist__edit { margin-top: .6rem; }
.reqlist__edit > summary {
  cursor: pointer; font-size: .8rem; font-weight: 600; color: var(--brand-700);
  list-style: none; display: inline-flex; align-items: center; gap: .35rem;
}
.reqlist__edit > summary::-webkit-details-marker { display: none; }
.reqlist__edit[open] > summary { margin-bottom: .6rem; }
.reqlist__edit form {
  border: 1px solid var(--line); border-radius: var(--r-sm);
  padding: .9rem 1rem; background: var(--surface-2);
}

@media (max-width: 640px) {
  .reqlist__row { flex-wrap: wrap; }
  .reqlist__actions { width: 100%; }
}

/* --- institution classification badges -------------------------------- */
.school-hero__tags {
  display: flex; flex-wrap: wrap; gap: .35rem; margin-top: .5rem;
}
.school-hero__tags .badge { backdrop-filter: blur(2px); }

/* --- the public admission queue --------------------------------------- */
.panel--soft { background: var(--surface-2); border-style: dashed; padding: 1rem 1.1rem; }

.quota {
  border: 1px solid var(--line); border-radius: var(--r-sm);
  padding: .75rem .85rem; background: var(--surface);
  display: flex; flex-direction: column; gap: .4rem;
}
.quota .meter { margin: .1rem 0 .2rem; }

/* --- the public compliance panel ------------------------------------- */
.compliance-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: .5rem;
}
.compliance-item {
  display: flex; align-items: flex-start; gap: .5rem;
  padding: .6rem .7rem; border: 1px solid var(--line);
  border-radius: var(--r-sm); background: var(--surface);
  font-size: .85rem;
}
.compliance-item__icon { flex: none; margin-top: .1rem; }
.compliance-item.is-met .compliance-item__icon { color: var(--ok-700); }
.compliance-item.is-pending .compliance-item__icon { color: var(--err-700); }
.compliance-item.is-partial .compliance-item__icon { color: var(--warn-700); }
.compliance-item.is-not_applicable { opacity: .6; }
.compliance-item small { display: block; color: var(--ink-faint); font-size: .74rem; }

/* --- the verified-by badge on a public page --------------------------- */
.verified-badge {
  display: flex; align-items: center; gap: .8rem;
  padding: .85rem 1.1rem; border-radius: var(--r);
  background: var(--ok-100); border: 1px solid var(--ok-200);
}
.verified-badge__seal {
  flex: none; width: 2.6rem; height: 2.6rem; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--ok-700); color: #fff;
}
.verified-badge strong { display: block; font-size: .92rem; color: var(--ok-700); }
.verified-badge span { font-size: .8rem; color: var(--ink-soft); }

/* --- two-factor setup ------------------------------------------------ */
.mfa-qr {
  display: inline-block; padding: .75rem; margin-top: .6rem;
  background: #fff; border: 1px solid var(--line); border-radius: var(--r-sm);
}
.mfa-qr svg { display: block; max-width: 100%; height: auto; }
.mfa-secret {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 1.02rem; letter-spacing: .06em; color: var(--ink);
  background: var(--line-soft); border-radius: var(--r-sm);
  padding: .55rem .8rem; margin: 0; word-break: break-all;
  user-select: all;
}
.code-input {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 1.35rem; letter-spacing: .35em; text-align: center;
  max-width: 11rem; padding-inline: .5rem;
}
.recovery-codes {
  list-style: none; padding: 0; margin: 0;
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .4rem;
}
.recovery-codes li {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: .95rem; letter-spacing: .04em;
  padding: .5rem .7rem; border: 1px dashed var(--line);
  border-radius: var(--r-sm); background: var(--surface-2);
  user-select: all;
}
@media (max-width: 460px) { .recovery-codes { grid-template-columns: minmax(0, 1fr); } }

/* --- small definition list used on intake and application cards ------ */
.minilist { margin: 0; font-size: .84rem; }
.minilist > div {
  display: flex; justify-content: space-between; gap: 1rem;
  padding: .35rem 0; border-bottom: 1px dashed var(--line);
}
.minilist > div:last-child { border-bottom: 0; }
.minilist dt { color: var(--ink-faint); margin: 0; }
.minilist dd { margin: 0; font-weight: 600; color: var(--ink); text-align: right; }

/* --- the reference a family quotes back to the school ---------------- */
.reference {
  display: inline-flex; flex-direction: column; gap: .2rem; align-items: center;
  padding: .8rem 1.6rem; border-radius: var(--r);
  background: var(--brand-050); border: 1px dashed var(--brand-200);
}
.reference strong {
  font-size: 1.4rem; letter-spacing: .08em; color: var(--brand-700);
  font-variant-numeric: tabular-nums;
}

/* ==========================================================================
   Workspace search
   ========================================================================== */

.wsearch {
  position: relative; display: flex; align-items: center; gap: .55rem;
  margin-bottom: 1.5rem; padding: .1rem .85rem;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-pill); box-shadow: var(--shadow-sm, none);
}
.wsearch:focus-within { border-color: var(--brand-200); box-shadow: var(--ring); }
.wsearch > svg { flex: none; color: var(--ink-faint); }
.wsearch__input {
  flex: 1; min-width: 0; border: 0; background: transparent;
  padding: .7rem 0; font: inherit; font-size: .9rem; color: var(--ink);
}
.wsearch__input:focus { outline: 0; }
.wsearch__input::placeholder { color: var(--ink-faint); }
.wsearch__input::-webkit-search-cancel-button { cursor: pointer; }
.wsearch__key {
  flex: none; padding: .1rem .42rem; border: 1px solid var(--line);
  border-bottom-width: 2px; border-radius: 5px;
  font-size: .7rem; color: var(--ink-faint); background: var(--line-soft);
}
.wsearch:focus-within .wsearch__key { display: none; }

.wsearch__panel {
  position: absolute; left: 0; right: 0; top: calc(100% + .35rem); z-index: 40;
  max-height: min(60vh, 420px); overflow-y: auto;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r); box-shadow: var(--shadow-lg, var(--shadow));
  padding: .35rem;
}
.wsearch__group {
  padding: .5rem .7rem .25rem;
  font-size: .66rem; font-weight: 700; letter-spacing: .07em;
  text-transform: uppercase; color: var(--ink-faint);
}
.wsearch__item {
  display: flex; align-items: center; gap: .6rem; width: 100%;
  padding: .5rem .7rem; border-radius: var(--r-sm);
  color: var(--ink); text-decoration: none; font-size: .88rem;
}
.wsearch__item:hover, .wsearch__item.is-active {
  background: var(--brand-050); color: var(--brand-700); text-decoration: none;
}
.wsearch__item .meta { font-size: .74rem; color: var(--ink-faint); display: block; }
.wsearch__item.is-active .meta { color: var(--brand-700); opacity: .75; }
.wsearch__empty { padding: .9rem .7rem; font-size: .82rem; color: var(--ink-faint); }

/* Full results page. */
.resultlist { list-style: none; margin: 0; padding: 0; }
.resultlist li + li { border-top: 1px solid var(--line-soft); }
.resultlist a {
  display: flex; align-items: center; gap: .75rem;
  padding: .75rem 1.1rem; color: var(--ink); text-decoration: none;
}
.resultlist a:hover { background: var(--surface-2); text-decoration: none; }
.resultlist__icon {
  flex: none; width: 2rem; height: 2rem; border-radius: var(--r-sm);
  display: grid; place-items: center;
  background: var(--brand-050); color: var(--brand-700);
}
.resultlist strong { display: block; font-size: .9rem; }

@media (max-width: 640px) { .wsearch__key { display: none; } }

/* A count beside a sidebar item — an inbox that needs attention. */
.sidebar__count {
  margin-left: auto; padding: .1rem .42rem;
  border-radius: var(--r-pill); background: var(--brand-700); color: #fff;
  font-size: .68rem; font-weight: 700; line-height: 1.4;
}

.school-hero__live { margin-top: .9rem; }
.school-hero__live:empty { display: none; }

.school-card__ribbon {
  position: absolute; left: .6rem; top: .6rem; z-index: 1;
  display: flex; flex-wrap: wrap; gap: .3rem;
}
.school-card__ribbon .live-tag { box-shadow: 0 1px 3px rgba(16, 24, 40, .12); }

/* --- "admissions open" / "events on" ribbons ------------------------- */
.live-strip { display: flex; flex-wrap: wrap; gap: .4rem; }
.live-tag {
  display: inline-flex; align-items: center; gap: .35rem;
  padding: .25rem .6rem; border-radius: var(--r-pill);
  font-size: .74rem; font-weight: 650; letter-spacing: .01em;
  border: 1px solid transparent;
}
.live-tag--admissions { background: var(--ok-100); color: var(--ok-700); border-color: var(--ok-200); }
.live-tag--events { background: var(--accent-050); color: var(--accent-700); }
.live-tag--closing { background: var(--warn-100); color: var(--warn-700); }
a.live-tag:hover { text-decoration: none; filter: brightness(.97); }
/* A quiet pulse marks "happening now" without becoming a distraction. */
.live-tag__dot { width: .42rem; height: .42rem; border-radius: 50%; background: currentColor; }
@media (prefers-reduced-motion: no-preference) {
  .live-tag__dot { animation: live-pulse 2.4s ease-in-out infinite; }
}
@keyframes live-pulse { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }

/* The spam trap. Off-screen rather than display:none, because some automated
   fillers skip anything that is not rendered at all. */
.trap {
  position: absolute !important;
  left: -9999px; top: auto;
  width: 1px; height: 1px; overflow: hidden;
}

/* ==========================================================================
   Input kit — every control here is designed to be tapped, not typed into
   ========================================================================== */

.field[data-invalid] .input,
.field[data-invalid] .select,
.field[data-invalid] .textarea { border-color: var(--err-700); }
.field__error {
  display: flex; align-items: center; gap: .3rem;
  font-size: .78rem; color: var(--err-700); margin-top: .3rem;
}

/* --- stepper --------------------------------------------------------- */
.stepper { display: flex; align-items: stretch; gap: .4rem; }
.stepper__input { text-align: center; min-width: 0; max-width: 7rem; -moz-appearance: textfield; appearance: textfield; }
.stepper__input::-webkit-outer-spin-button,
.stepper__input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.stepper__btn {
  flex: none; width: 2.5rem;
  border: 1px solid var(--line); border-radius: var(--r-sm);
  background: var(--surface); color: var(--ink);
  font-size: 1.15rem; font-weight: 600; line-height: 1; cursor: pointer;
}
.stepper__btn:hover { background: var(--brand-050); border-color: var(--brand-200); color: var(--brand-700); }
.stepper__btn:disabled { opacity: .4; cursor: not-allowed; background: var(--line-soft); }
.stepper__suffix { align-self: center; font-size: .84rem; color: var(--ink-faint); }

/* --- slider ---------------------------------------------------------- */
.slider { display: flex; align-items: center; gap: .9rem; }
.slider__range { flex: 1; accent-color: var(--brand-700); height: 1.5rem; }
.slider__value { display: flex; align-items: center; gap: .35rem; }
.slider__number { width: 5.5rem; text-align: center; }
.slider__suffix { font-size: .84rem; color: var(--ink-faint); }
.slider__scale { display: flex; justify-content: space-between; font-size: .7rem; color: var(--ink-faint); margin-top: .15rem; }
.no-js .slider__scale { display: none; }

/* --- combo ----------------------------------------------------------- */
.combo__search { position: relative; margin-bottom: .4rem; }
.combo__search svg { position: absolute; left: .65rem; top: 50%; transform: translateY(-50%); color: var(--ink-faint); }
.combo__search .input { padding-left: 2rem; }
.combo__empty { margin: .35rem 0 0; }

/* --- chips (multi) and segment (single) ------------------------------ */
.chipset { display: flex; flex-wrap: wrap; gap: .4rem; }
.chipset__item input, .segment__item input {
  position: absolute; opacity: 0; width: 1px; height: 1px;
}
.chipset__item span {
  display: inline-block; cursor: pointer;
  padding: .42rem .85rem; border-radius: var(--r-pill);
  border: 1px solid var(--line); background: var(--surface);
  font-size: .85rem; color: var(--ink-soft);
  transition: background .12s, border-color .12s, color .12s;
}
.chipset__item span:hover { border-color: var(--brand-200); background: var(--brand-050); }
.chipset__item input:checked + span {
  background: var(--brand-700); border-color: var(--brand-700); color: #fff;
}
.chipset__item input:focus-visible + span,
.segment__item input:focus-visible + span { box-shadow: var(--ring); }

.segment {
  display: inline-flex; flex-wrap: wrap; gap: .2rem; padding: .22rem;
  border: 1px solid var(--line); border-radius: var(--r-pill); background: var(--surface);
}
.segment__item span {
  display: inline-block; cursor: pointer;
  padding: .4rem .95rem; border-radius: var(--r-pill);
  font-size: .85rem; font-weight: 550; color: var(--ink-soft);
}
.segment__item span:hover { color: var(--brand-700); }
.segment__item input:checked + span { background: var(--brand-700); color: #fff; }

/* --- prefixed input (phone) ------------------------------------------ */
.prefixed { display: flex; align-items: stretch; }
.prefixed__tag {
  display: flex; align-items: center; padding: 0 .7rem;
  border: 1px solid var(--line); border-right: 0;
  border-radius: var(--r-sm) 0 0 var(--r-sm);
  background: var(--line-soft); color: var(--ink-soft);
  font-size: .86rem; font-weight: 600;
}
.prefixed .input { border-radius: 0 var(--r-sm) var(--r-sm) 0; }

/* Shown only when scripting is available — the billing toggle, for instance,
   would hide half the prices if it rendered without its script. */
.no-js .js-only { display: none !important; }

.billing-switch {
  display: inline-flex; gap: .25rem; margin: 0 0 1.5rem;
  padding: .25rem; border: 1px solid var(--line); border-radius: var(--r-pill);
  background: var(--surface);
}
.billing-switch button {
  border: 0; background: transparent; cursor: pointer;
  padding: .45rem 1rem; border-radius: var(--r-pill);
  font: inherit; font-size: .86rem; font-weight: 600; color: var(--ink-soft);
  display: inline-flex; align-items: center; gap: .45rem;
}
.billing-switch button.is-active { background: var(--brand-700); color: #fff; }
.billing-switch button.is-active .badge { background: rgba(255,255,255,.2); color: #fff; }

.trust {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 1px; background: var(--line);
  border: 1px solid var(--line); border-radius: var(--r); overflow: hidden;
}
.trust > div { background: var(--surface); padding: 1.1rem 1.15rem; }
.trust svg { color: var(--brand-700); }
.trust strong { display: block; margin: .5rem 0 .2rem; font-size: .9rem; color: var(--ink); }
.trust span { font-size: .82rem; color: var(--ink-soft); line-height: 1.55; }

.table--compare .row-group td {
  text-align: left; background: var(--surface-2);
  font-size: .7rem; font-weight: 700; letter-spacing: .07em; text-transform: uppercase;
  color: var(--ink-faint); padding-top: .9rem; padding-bottom: .5rem;
}
.table--compare td, .table--compare th { text-align: center; }
.table--compare td:first-child, .table--compare th:first-child { text-align: left; }
.table--compare th.is-featured { background: var(--brand-050); color: var(--brand-700); }
.table--compare tfoot td { border-top: 1px solid var(--line); }

.sitemap__head { font-size: .78rem; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-faint); margin-bottom: .6rem; }
.sitemap__list { list-style: none; padding: 0; margin: 0; line-height: 2; font-size: .9rem; }

/* ==========================================================================
   Utilities
   ========================================================================== */

.mt-0{margin-top:0}.mt-1{margin-top:.5rem}.mt-2{margin-top:1rem}.mt-3{margin-top:1.5rem}.mt-4{margin-top:2rem}
.mb-0{margin-bottom:0}.mb-1{margin-bottom:.5rem}.mb-2{margin-bottom:1rem}.mb-3{margin-bottom:1.5rem}
.hide { display: none !important; }
@media (max-width: 700px) { .hide-sm { display: none !important; } }
@media print {
  .masthead, .sidebar, .site-foot, .no-print { display: none !important; }
  body { background: #fff; }
}

/* ==========================================================================
   Marks entry
   ========================================================================== */

.table--marks td { padding-block: .55rem; }
.input--mark {
  text-align: center;
  font-variant-numeric: tabular-nums;
  font-weight: 650;
  padding-inline: .5rem;
}
.input--mark:disabled { background: var(--line-soft); color: var(--ink-faint); }

/* remove the number spinners — they get in the way of fast entry */
.input--mark::-webkit-outer-spin-button,
.input--mark::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.input--mark { -moz-appearance: textfield; appearance: textfield; }

tr.is-pass   .input--mark { border-color: var(--ok-200);  box-shadow: inset 0 0 0 1px var(--ok-200); }
tr.is-fail   .input--mark { border-color: var(--err-200); box-shadow: inset 0 0 0 1px var(--err-200); background: #fffbfb; }
tr.is-absent td { background: var(--line-soft); }

tr.is-pass   [data-verdict] { background: var(--ok-100);  color: var(--ok-700); }
tr.is-fail   [data-verdict] { background: var(--err-100); color: var(--err-700); }
tr.is-absent [data-verdict] { background: var(--line-soft); color: var(--ink-faint); }

/* ==========================================================================
   Report card (screen + print)
   ========================================================================== */

.card-sheet {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 2.25rem;
  max-width: 820px;
  margin-inline: auto;
  box-shadow: var(--shadow-xs);
}
.card-sheet__head {
  display: flex; align-items: center; gap: 1.1rem;
  padding-bottom: 1.25rem; border-bottom: 2px solid var(--brand-700);
}
.card-sheet__title { font-size: 1.35rem; font-weight: 700; letter-spacing: -.02em; margin: 0; }
.card-sheet__sub { font-size: .82rem; color: var(--ink-soft); }
.card-sheet__band {
  display: inline-block;
  margin-top: .6rem; padding: .2rem .7rem;
  background: var(--brand-050); color: var(--brand-700);
  border-radius: var(--r-pill);
  font-size: .78rem; font-weight: 650;
}
.card-sheet__grid {
  display: grid; grid-template-columns: repeat(4, minmax(0,1fr));
  gap: 1px; background: var(--line);
  border: 1px solid var(--line); border-radius: var(--r-sm);
  overflow: hidden; margin: 1.25rem 0;
}
.card-sheet__grid > div { background: var(--surface); padding: .7rem .85rem; }
.card-sheet__grid dt { font-size: .7rem; color: var(--ink-faint); font-weight: 600; }
.card-sheet__grid dd { margin: .15rem 0 0; font-size: .92rem; font-weight: 600; }
.card-sheet__sign {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 2rem;
  margin-top: 3rem; text-align: center; font-size: .78rem; color: var(--ink-faint);
}
.card-sheet__sign span { display: block; border-top: 1px solid var(--ink-faint); padding-top: .4rem; }

/* Grade-band editor: five tight columns that stay readable in a 336px rail. */
.bandrow {
  display: grid;
  grid-template-columns: 3.4rem 1fr 1fr 2.9rem 1.6rem;
  gap: .3rem; align-items: center;
}
.bandrow--head > span {
  font-size: .66rem; font-weight: 600; letter-spacing: .04em;
  text-transform: uppercase; color: var(--ink-faint);
}
.input--tight { padding: .38rem .4rem; font-size: .82rem; text-align: center; }
/* Firefox and WebKit both reserve room for spinners the rail cannot spare. */
.input--tight::-webkit-outer-spin-button,
.input--tight::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.input--tight[type="number"] { -moz-appearance: textfield; appearance: textfield; }

/* An unpublished card is still a draft; say so on paper as well as on screen. */
.card-sheet--draft { position: relative; overflow: hidden; }
.card-sheet--draft::after {
  content: "DRAFT";
  position: absolute; inset: 0;
  display: grid; place-items: center;
  font-size: clamp(4rem, 18vw, 9rem); font-weight: 800; letter-spacing: .1em;
  color: var(--err-700); opacity: .06;
  transform: rotate(-24deg);
  pointer-events: none;
}

@media print {
  @page { size: A4; margin: 12mm; }
  body { background: #fff; font-size: 12px; }
  .card-sheet { border: 0; box-shadow: none; padding: 0; max-width: none; }
  .card-sheet--draft::after { opacity: .1; }
  .page-head, .tallybar, .no-print,
  .topbar, .sidebar, .navbar, .alert, .site-footer, .footer { display: none !important; }
  .shell, .workspace { display: block !important; padding: 0 !important; margin: 0 !important; }
  a { text-decoration: none; color: inherit; }
  .table thead th { background: #f4f4f4 !important; }
  .badge { border: 1px solid #999; color: #000 !important; background: transparent !important; }
}
