/* School Fee Help: "term planner" design (approved by Philip, 29 Nov 2026).
   White page, charcoal text, one deep teal, pale sky tint, amber only for close deadlines.
   Headings: Zilla Slab. Body: Public Sans. Squared tiles, thin rules, planner rows. Tokens first. */

@font-face { font-family: 'Zilla Slab'; src: url('/fonts/zilla-slab-latin-600-normal.woff2') format('woff2'); font-weight: 600; font-style: normal; font-display: swap; }
@font-face { font-family: 'Zilla Slab'; src: url('/fonts/zilla-slab-latin-700-normal.woff2') format('woff2'); font-weight: 700; font-style: normal; font-display: swap; }
@font-face { font-family: 'Public Sans'; src: url('/fonts/public-sans-latin-400-normal.woff2') format('woff2'); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: 'Public Sans'; src: url('/fonts/public-sans-latin-400-italic.woff2') format('woff2'); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: 'Public Sans'; src: url('/fonts/public-sans-latin-600-normal.woff2') format('woff2'); font-weight: 600; font-style: normal; font-display: swap; }
@font-face { font-family: 'Public Sans'; src: url('/fonts/public-sans-latin-700-normal.woff2') format('woff2'); font-weight: 700; font-style: normal; font-display: swap; }

:root {
  --page: #ffffff;
  --ink: #1d2428;
  --text-2: #3a474e;
  --muted: #51606a;
  --teal: #0f5e63;
  --teal-deep: #093f43;
  --tint: #eaf4f7;
  --stripe: #f4f9fb;
  --line: #cfdde2;
  --rule: #1d2428;
  --amber-bg: #fff1cc;
  --amber-text: #7a4100;
  --slab: 'Zilla Slab', Georgia, 'Times New Roman', serif;
  --sans: 'Public Sans', system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
  --wrap: 1120px;
  --prose: 68ch;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --page: #10181b;
    --ink: #e8eff1;
    --text-2: #c5d2d6;
    --muted: #a3b3b9;
    --teal: #74cbd0;
    --teal-deep: #a5e0e3;
    --tint: #17272b;
    --stripe: #141f22;
    --line: #2d4046;
    --rule: #c5d2d6;
    --amber-bg: #4a3300;
    --amber-text: #ffd98a;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; background: var(--page); color: var(--ink); font-family: var(--sans); font-size: 18px; line-height: 1.6; }
[hidden] { display: none !important; }
img, svg { max-width: 100%; height: auto; }
a { color: var(--teal); text-underline-offset: 3px; }
a:hover { color: var(--teal-deep); }
:focus-visible { outline: 3px solid var(--teal); outline-offset: 2px; }
h1, h2, h3 { font-family: var(--slab); line-height: 1.15; margin: 0; font-variant-numeric: lining-nums; }
h1 { font-weight: 700; font-size: clamp(2.1rem, 5vw, 3.4rem); }
h2 { font-weight: 600; font-size: 1.65rem; }
h3 { font-weight: 600; font-size: 1.3rem; }
p { margin: 0; }
.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 24px; }
.skip { position: absolute; left: -9999px; top: 0; background: var(--ink); color: var(--page); padding: 12px 16px; z-index: 10; }
.skip:focus { left: 8px; top: 8px; }
.small { font-size: 0.86rem; color: var(--muted); }
.eyebrow { font-size: 0.8rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--teal); }

/* Header */
.site-head { border-bottom: 2px solid var(--rule); }
.site-head .wrap { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 4px 32px; padding-top: 12px; padding-bottom: 12px; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-family: var(--slab); font-weight: 700; font-size: 1.5rem; color: var(--ink); text-decoration: none; padding: 8px 0; }
.brand:hover { color: var(--ink); }
.brand svg { width: 26px; height: 26px; flex: none; }
.brand .m-frame { fill: var(--page); stroke: var(--teal); }
.brand .m-fill { fill: var(--teal); }
.brand .m-line { stroke: var(--teal); }
.nav ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0 24px; }
.nav a { display: inline-block; padding: 11px 0; font-size: 1rem; font-weight: 600; text-decoration: none; }
.nav a:hover, .nav a[aria-current='page'] { text-decoration: underline; text-decoration-thickness: 2px; }

/* Page furniture */
.hero { padding: 56px 0 40px; display: flex; flex-direction: column; gap: 20px; }
.hero h1 { max-width: 18ch; }
.lede { font-size: 1.2rem; line-height: 1.5; color: var(--text-2); max-width: 62ch; }
.page-head { padding: 40px 0 24px; display: flex; flex-direction: column; gap: 14px; }
.page-head h1 { max-width: 24ch; font-size: clamp(2rem, 4vw, 3rem); }
.crumbs { font-size: 0.92rem; }
.section { padding: 0 0 48px; display: flex; flex-direction: column; gap: 16px; }
.section-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 24px; }
.more { font-weight: 600; display: inline-block; padding: 10px 0; }

/* Entry-age tiles */
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 16px; }
.tile { border: 1.5px solid var(--rule); padding: 20px; display: flex; flex-direction: column; gap: 6px; color: var(--ink); text-decoration: none; }
.tile:hover { background: var(--tint); color: var(--ink); }
.tile-age { font-variant-numeric: lining-nums; font-family: var(--slab); font-weight: 700; font-size: 2.75rem; line-height: 1; color: var(--teal); }
.tile strong { font-weight: 700; }
.tile span:last-child { font-size: 0.92rem; color: var(--muted); }

/* Planner: deadlines grouped by month */
.planner { border: 1.5px solid var(--rule); }
.planner-month { display: grid; grid-template-columns: 132px minmax(0, 1fr); border-top: 1px solid var(--line); }
.planner-month:first-child { border-top: 0; }
.planner-label { font-variant-numeric: lining-nums; background: var(--tint); padding: 16px; font-family: var(--slab); font-weight: 700; font-size: 1.15rem; line-height: 1.2; }
.planner-row { padding: 14px 16px; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 16px; border-top: 1px solid var(--line); }
.planner-row:first-child { border-top: 0; }
.planner-day { font-weight: 700; min-width: 2.2em; }
.planner-what { flex: 1 1 260px; }
.flag { display: inline-block; background: var(--amber-bg); color: var(--amber-text); font-weight: 700; font-size: 0.82rem; padding: 3px 8px; white-space: nowrap; }
.flag[hidden] { display: none; }
@media (max-width: 560px) { .planner-month { grid-template-columns: 1fr; } .planner-label { padding: 10px 16px; } }

/* Principle boxes and tinted boxes */
.boxes { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; }
.box { border-top: 6px solid var(--teal); background: var(--tint); padding: 20px; display: flex; flex-direction: column; gap: 8px; }
.panel { border: 1.5px solid var(--rule); padding: 20px; display: flex; flex-direction: column; gap: 8px; }
.box p, .panel p { font-size: 1rem; line-height: 1.5; }

/* Facts band */
.facts { border: 1.5px solid var(--rule); display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.fact { padding: 20px; display: flex; flex-direction: column; gap: 4px; border-left: 1px solid var(--line); margin-left: -1px; }
.fact b { font-variant-numeric: lining-nums; font-family: var(--slab); font-weight: 700; font-size: 2.25rem; line-height: 1.1; }
.fact span { font-size: 1rem; line-height: 1.4; }

/* Filters */
.filters { display: flex; flex-wrap: wrap; align-items: end; gap: 12px 16px; padding-bottom: 20px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-weight: 700; font-size: 0.92rem; }
select, input[type='text'], input[type='email'], textarea { font: inherit; color: var(--ink); background: var(--page); border: 1.5px solid var(--rule); border-radius: 0; padding: 10px 12px; min-height: 46px; width: 100%; }
.check { display: flex; align-items: center; gap: 10px; min-height: 46px; font-weight: 600; font-size: 0.95rem; }
.check input { width: 22px; height: 22px; accent-color: var(--teal); }
.count { margin-left: auto; font-size: 0.92rem; color: var(--muted); padding-bottom: 12px; }

/* The school table */
.table-box { border: 1.5px solid var(--rule); overflow-x: auto; }
.schools { border-collapse: collapse; width: 100%; font-size: 1rem; line-height: 1.4; }
.schools th { text-align: left; padding: 12px 14px; font-size: 0.8rem; letter-spacing: 0.04em; text-transform: uppercase; background: var(--tint); border-bottom: 2px solid var(--rule); white-space: nowrap; }
.schools td { padding: 14px; border-top: 1px solid var(--line); vertical-align: top; }
.schools tbody tr:nth-child(even) { background: var(--stripe); }
.schools tbody tr[hidden] { display: none; }
.schools .place { display: block; font-size: 0.86rem; color: var(--muted); }
.schools .none { color: var(--muted); }
.deadline { display: block; }
.deadline + .deadline { margin-top: 8px; }
.deadline .past { color: var(--muted); }
.empty { padding: 20px; }
@media (max-width: 760px) {
  .table-box { border: 0; overflow: visible; }
  .schools thead { position: absolute; left: -9999px; }
  .schools, .schools tbody, .schools tr, .schools td { display: block; }
  .schools tr { border: 1.5px solid var(--rule); margin-bottom: 16px; }
  .schools tbody tr:nth-child(even) { background: var(--page); }
  .schools td { border-top: 1px solid var(--line); padding: 12px 14px; }
  .schools td:first-child { border-top: 0; background: var(--tint); }
  .schools td[data-label]::before { content: attr(data-label); display: block; font-size: 0.76rem; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted); margin-bottom: 2px; }
}

/* Reading pages */
.prose { max-width: var(--prose); display: flex; flex-direction: column; gap: 16px; padding-bottom: 56px; }
.prose h2 { padding-top: 14px; }
.prose ul, .prose ol { margin: 0; padding-left: 1.3em; display: flex; flex-direction: column; gap: 8px; }
.log { list-style: none; margin: 0; padding: 0; border: 1.5px solid var(--rule); }
.log li { display: grid; grid-template-columns: 132px minmax(0, 1fr); border-top: 1px solid var(--line); }
.log li:first-child { border-top: 0; }
.log time { font-variant-numeric: lining-nums; background: var(--tint); padding: 14px 16px; font-family: var(--slab); font-weight: 700; }
.log div { padding: 14px 16px; }
.log .kind { font-size: 0.78rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--teal); display: block; }
@media (max-width: 560px) { .log li { grid-template-columns: 1fr; } .log time { padding: 8px 16px; } }

/* Contact form */
.form { border: 1.5px solid var(--rule); padding: 20px; display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; }
.form .wide { grid-column: 1 / -1; }
.form .trap { position: absolute; left: -9999px; }
.btn { font: inherit; font-weight: 700; color: #ffffff; background: #0f5e63; border: 0; border-radius: 0; padding: 12px 22px; min-height: 46px; cursor: pointer; }
.btn:hover { background: #093f43; }
.note { border-left: 6px solid var(--teal); background: var(--tint); padding: 14px 16px; }
.note[hidden] { display: none; }

/* Footer */
.site-foot { border-top: 2px solid var(--rule); background: var(--tint); margin-top: 8px; }
.site-foot .wrap { padding-top: 24px; padding-bottom: 28px; display: flex; flex-direction: column; gap: 10px; font-size: 0.92rem; }
.site-foot ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0 24px; font-weight: 600; }
.site-foot li a { display: inline-block; padding: 10px 0; }
.site-foot p { color: var(--text-2); }

@media print { .site-head nav, .filters, .site-foot ul { display: none; } }

/* Tools */
.tool { border: 1.5px solid var(--rule); margin-bottom: 20px; }
.tool-form { background: var(--tint); padding: 20px; display: flex; flex-wrap: wrap; align-items: end; gap: 16px; }
.tool-form .field { flex: 1 1 200px; max-width: 320px; }
.tool-form .field.narrow { flex: 0 1 150px; }
.tool-form .hint { font-size: 0.82rem; color: var(--muted); }
input[type='date'], input[type='number'] { font: inherit; color: var(--ink); background: var(--page); border: 1.5px solid var(--rule); border-radius: 0; padding: 10px 12px; min-height: 46px; width: 100%; }
.tool-out { padding: 20px; display: flex; flex-direction: column; gap: 16px; }
.tool-out h2 { font-size: 1.35rem; }
.tool-out h3 { font-size: 1.1rem; }
.big { font-family: var(--slab); font-weight: 700; font-size: 1.9rem; line-height: 1.15; font-variant-numeric: lining-nums; }
.sum { border: 1.5px solid var(--rule); display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
.sum div { padding: 14px 16px; border-left: 1px solid var(--line); margin-left: -1px; display: flex; flex-direction: column; gap: 2px; }
.sum span { font-size: 0.9rem; color: var(--text-2); }
.out-box { overflow-x: auto; border: 1.5px solid var(--rule); }
.out { border-collapse: collapse; width: 100%; font-size: 1rem; }
.out th { text-align: left; padding: 10px 14px; font-size: 0.8rem; letter-spacing: 0.04em; text-transform: uppercase; background: var(--tint); border-bottom: 2px solid var(--rule); white-space: nowrap; }
.out td { padding: 10px 14px; border-top: 1px solid var(--line); vertical-align: top; }
.out .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.out tfoot td { font-weight: 700; border-top: 2px solid var(--rule); }
.match { list-style: none; margin: 0; padding: 0; border: 1.5px solid var(--rule); }
.match li { padding: 12px 16px; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 2px; }
.match li:first-child { border-top: 0; }
.match .small { font-size: 0.9rem; }
.past .planner-day, .past .planner-what { color: var(--muted); }

/* Guides */
.guide { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 24px 48px; }
.toc { flex: 1 1 230px; border: 1.5px solid var(--rule); padding: 18px; }
.toc h2 { font-size: 1.15rem; padding-bottom: 6px; }
.toc ul { list-style: none; margin: 0; padding: 0; }
.toc a { display: flex; align-items: flex-start; gap: 10px; padding: 9px 0; text-decoration: none; font-size: 0.98rem; line-height: 1.35; }
.toc a:hover { text-decoration: underline; }
.tick { width: 16px; height: 16px; border: 1.5px solid var(--teal); flex: none; margin-top: 2px; }
.guide .prose { flex: 999 1 540px; min-width: 0; }
.answer { background: var(--tint); border-top: 6px solid var(--teal); padding: 20px; display: flex; flex-direction: column; gap: 8px; }
.answer h2 { padding-top: 0; font-size: 1.35rem; }
.sources { font-size: 0.98rem; }
.report { flex-direction: row; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 4px 24px; }
.guide-list { list-style: none; margin: 0; padding: 0; border: 1.5px solid var(--rule); }
.guide-list li { padding: 16px 18px; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 4px; }
.guide-list li:first-child { border-top: 0; }
.guide-list a { font-family: var(--slab); font-size: 1.2rem; }
.prose .out-box { margin: 4px 0; }
.prose .out td, .prose .out th { white-space: normal; }

/* Pictures: planner-style drawings from src/lib/art.js. Colours follow the tokens, so they follow dark mode. */
.art { line-height: 0; overflow: hidden; border: 1.5px solid var(--rule); background: var(--tint); }
.art svg { display: block; width: 100%; height: 100%; }
.art .bg { fill: var(--tint); }
.art .gl { stroke: var(--line); stroke-width: 2; fill: none; }
.art .frame { display: none; }
.art .ln { stroke: var(--ink); stroke-width: 4; fill: none; }
.art .pp { fill: var(--page); stroke: var(--ink); stroke-width: 4; }
.art .tl, .art .dot { fill: var(--teal); }
.art .tls { stroke: var(--teal); stroke-width: 5; fill: none; }
.art .sf { fill: var(--line); }
.art .tn { fill: var(--tint); }
.art-head, .art-hero { aspect-ratio: 16 / 7; max-height: 220px; }
@media (max-width: 759px) { .art-no-phone { display: none; } }
@media (min-width: 760px) {
  .page-head.has-art { display: grid; grid-template-columns: minmax(0, 1fr) 300px; column-gap: 48px; row-gap: 14px; align-content: start; }
  .page-head.has-art > * { grid-column: 1; }
  .page-head.has-art > .art { grid-column: 2; grid-row: 1 / span 4; align-self: center; height: 188px; aspect-ratio: auto; max-height: none; }
  .hero.has-art { display: grid; grid-template-columns: minmax(0, 1fr) 400px; column-gap: 48px; row-gap: 20px; }
  .hero.has-art > * { grid-column: 1; }
  .hero.has-art > .art { grid-column: 2; grid-row: 1 / span 3; align-self: center; height: 250px; aspect-ratio: auto; max-height: none; }
}
.box .art-box { height: 92px; margin: -4px 0 6px; }
.guide-list li:has(.art-thumb) { display: grid; grid-template-columns: 128px minmax(0, 1fr); gap: 16px; align-items: start; }
.guide-list li > div { display: flex; flex-direction: column; gap: 4px; }
.art-thumb { height: 80px; }
@media (max-width: 520px) { .guide-list li:has(.art-thumb) { grid-template-columns: 84px minmax(0, 1fr); gap: 12px; } .art-thumb { height: 56px; } }
@media print { .art { display: none; } }
