/* Flex1: central sign-in pages, My account and (later) the admin area.
   Started as a copy of the Teaching Portal's static/app.css, so both look the same;
   in phase 3 the portal's own pages load this file instead, leaving one source.
   Pastel, quiet, mostly white space. Light and dark. System fonts only. */
:root {
  --bg: #fbfaf7; --card: #ffffff; --ink: #2f2b3a; --muted: #7b7690; --line: #ebe7f2;
  --accent: #6f63a8; --ok: #3f8a64; --bad: #b4535f; --warn: #a77a1c;
  --mint: #dcf2e7; --lilac: #ebe5fb; --peach: #fde5d8; --sky: #dcebfa; --butter: #faf1cc; --rose: #fadfe7;
  --r: 14px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #17161d; --card: #1f1d27; --ink: #ece9f5; --muted: #a39db8; --line: #2f2c3b;
    --accent: #c4b9f2; --ok: #8fd3ad; --bad: #f0a0aa; --warn: #e8c46e;
    --mint: #1f3a2f; --lilac: #2c2742; --peach: #3e2c25; --sky: #1f3042; --butter: #3a3420; --rose: #3d2530;
    color-scheme: dark;
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.55 system-ui, -apple-system, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif; }
a { color: var(--accent); text-underline-offset: 3px; }
h1 { font-size: 30px; line-height: 1.15; margin: 4px 0 18px; font-weight: 650; letter-spacing: -.01em; }
h2 { font-size: 15px; margin: 0 0 12px; font-weight: 650; }
.muted { color: var(--muted); } .small { font-size: 13px; } .ok { color: var(--ok); } .bad { color: var(--bad); }
.kicker { color: var(--muted); font-size: 13px; letter-spacing: .04em; margin: 0; }

/* brand: two quiet lines, a dot of colour */
.brand { display: inline-block; text-decoration: none; color: var(--ink); font-weight: 650; font-size: 17px; line-height: 1.2; }
.brand span { display: block; font-weight: 450; font-size: 13px; color: var(--muted); }
.brand::after { content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: #8fd1b0; margin-left: 4px; vertical-align: 2px; }

/* forms */
label { display: block; font-size: 14px; color: var(--ink); }
label small, .stack small { display: block; color: var(--muted); font-size: 12.5px; margin-top: 4px; }
input[type=text], input[type=email], input[type=password], input[type=search], input[type=number], input[type=date], input:not([type]), select {
  width: 100%; margin-top: 6px; padding: 11px 13px; font: inherit; color: var(--ink); background: var(--card);
  border: 1px solid var(--line); border-radius: 10px; outline: none; transition: border-color .15s, box-shadow .15s;
}
textarea { display: block; width: 100%; margin-top: 6px; padding: 11px 13px; font: inherit; color: var(--ink); background: var(--card);
  border: 1px solid var(--line); border-radius: 10px; outline: none; resize: vertical; }
input[type=file] { display: block; margin-top: 6px; font: inherit; font-size: 13.5px; color: var(--muted); max-width: 100%; }
input:focus, select:focus, textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent); }
button { font: inherit; font-weight: 600; cursor: pointer; border: 0; border-radius: 999px; padding: 11px 22px; background: var(--ink); color: var(--bg); transition: transform .1s, opacity .15s; }
button:hover { opacity: .9; } button:active { transform: translateY(1px); }
button.small, a.btn.small { padding: 7px 14px; font-size: 13px; }
button.ghost { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 1px var(--line); }
button.danger { background: transparent; color: var(--bad); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--bad) 35%, transparent); }
button.link { background: none; color: var(--accent); padding: 0; font-weight: 500; text-decoration: underline; text-underline-offset: 3px; border-radius: 0; }
.stack { display: grid; gap: 16px; } .stack-tight { display: grid; gap: 12px; justify-items: start; align-content: start; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; } .row input { width: auto; flex: 1; min-width: 180px; margin: 0; }
.inline { display: inline; } .actions { display: flex; gap: 8px; flex-wrap: wrap; }
.check { display: flex; gap: 8px; align-items: center; font-size: 14px; }
/* A line of small ticks inside a .row form (a staff list row: its apps, then its courses). */
.row .tick-group { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 16px; flex-basis: 100%; }
.row .tick-group input { flex: none; width: auto; min-width: 0; }
.note { padding: 11px 14px; border-radius: 10px; background: var(--sky); margin: 0 0 14px; font-size: 14px; }
.note.ok { background: var(--mint); } .note.bad { background: var(--rose); }
.links { display: flex; gap: 18px; flex-wrap: wrap; font-size: 14px; margin-top: 20px; }

/* course pills (register, settings, student page) */
fieldset.courses, .courses { border: 0; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 8px; }
fieldset.courses legend { font-size: 14px; margin-bottom: 8px; padding: 0; }
.pill { position: relative; }
.pill input { position: absolute; opacity: 0; inset: 0; cursor: pointer; margin: 0; }
.pill span { display: inline-block; padding: 7px 13px; border-radius: 999px; font-size: 13.5px; border: 1px solid var(--line); background: var(--card); transition: background .15s, border-color .15s; }
.pill input:checked + span { border-color: transparent; font-weight: 600; }
.pill input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.t0 input:checked + span, .t0.tile, .card.t0 { background: var(--mint); }
.t1 input:checked + span, .t1.tile, .card.t1 { background: var(--lilac); }
.t2 input:checked + span, .t2.tile, .card.t2 { background: var(--peach); }
.t3 input:checked + span, .t3.tile, .card.t3 { background: var(--sky); }
.t4 input:checked + span, .t4.tile, .card.t4 { background: var(--butter); }
.t5 input:checked + span, .t5.tile, .card.t5 { background: var(--rose); }
.privacy { background: var(--bg); border: 1px dashed var(--line); border-radius: 12px; padding: 14px 16px; font-size: 13.5px; }
.privacy p { margin: 6px 0 10px; color: var(--muted); }

/* ---------- sign-in pages: one card, three drifting pastel clouds ---------- */
.m-auth { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 40px 16px 24px; overflow-x: hidden; }
.blobs { position: fixed; inset: 0; z-index: 0; pointer-events: none; }
.blobs i { position: absolute; width: 46vmax; height: 46vmax; border-radius: 50%; filter: blur(60px); opacity: .75; animation: drift 28s ease-in-out infinite alternate; }
.blobs i:nth-child(1) { background: var(--mint);  top: -18vmax; left: -12vmax; }
.blobs i:nth-child(2) { background: var(--lilac); bottom: -22vmax; right: -14vmax; animation-delay: -9s; }
.blobs i:nth-child(3) { background: var(--peach); top: 40%; left: 55%; width: 26vmax; height: 26vmax; animation-delay: -18s; }
@keyframes drift { to { transform: translate(4vmax, -3vmax) scale(1.08); } }
@media (prefers-reduced-motion: reduce) { .blobs i { animation: none; } }
.auth { position: relative; z-index: 1; width: 100%; max-width: 420px; background: color-mix(in srgb, var(--card) 88%, transparent);
        backdrop-filter: blur(10px); border: 1px solid var(--line); border-radius: 22px; padding: 30px 30px 26px; box-shadow: 0 20px 60px rgba(70,60,110,.08); }
.auth .brand { margin-bottom: 26px; }
.m-auth .foot { position: relative; z-index: 1; }
.foot { color: var(--muted); font-size: 12px; text-align: center; padding: 22px 16px; }

/* ---------- student home ---------- */
.top { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 22px max(16px, calc((100vw - 880px) / 2)); }
.who { font-size: 13px; color: var(--muted); }
.wrap { max-width: 880px; margin: 0 auto; padding: 24px 16px 40px; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; margin: 10px 0 26px; }
.card { position: relative; display: block; padding: 22px 22px 24px; border-radius: 18px; color: var(--ink); text-decoration: none; min-height: 132px; transition: transform .15s; }
.card:hover { transform: translateY(-2px); }
.card .code { display: block; font-size: 34px; font-weight: 700; letter-spacing: -.02em; }
.card .name { display: block; font-size: 14px; color: color-mix(in srgb, var(--ink) 75%, transparent); margin-top: 4px; }
.card .go { position: absolute; right: 20px; bottom: 16px; font-size: 18px; opacity: .5; }

/* ---------- dashboard ---------- */
.admin { display: grid; grid-template-columns: 210px 1fr; min-height: 100vh; }
.side { position: sticky; top: 0; align-self: start; height: 100vh; display: flex; flex-direction: column; gap: 2px; padding: 26px 18px; border-right: 1px solid var(--line); }
.side .brand { margin: 0 8px 26px; }
.side a:not(.brand), .side .link { display: block; padding: 7px 10px; border-radius: 9px; color: var(--ink); text-decoration: none; font-size: 14px; text-align: left; font-weight: 450; }
.side a:not(.brand):hover { background: var(--lilac); }
.side a[aria-current] { background: var(--lilac); font-weight: 600; }
.side .sep { flex: 1; }
.side .link { color: var(--muted); text-decoration: none; }
.content { padding: 30px 36px 60px; max-width: 1180px; min-width: 0; }
section { margin: 0 0 30px; }
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 30px; }
.tile { border-radius: 16px; padding: 16px 18px; text-decoration: none; color: var(--ink); }
.tile b { display: block; font-size: 30px; line-height: 1.1; font-weight: 700; }
.tile span { font-size: 13px; color: color-mix(in srgb, var(--ink) 70%, transparent); }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 30px; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { text-align: left; font-weight: 600; color: var(--muted); font-size: 12.5px; padding: 8px 10px; border-bottom: 1px solid var(--line); }
td { padding: 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.compact td { padding: 8px 10px; }
tr.failed td { background: color-mix(in srgb, var(--rose) 45%, transparent); }
.right { text-align: right; white-space: nowrap; }
.badge { display: inline-block; font-size: 12px; padding: 3px 9px; border-radius: 999px; white-space: nowrap; }
.s-active { background: var(--mint); } .s-pending { background: var(--butter); } .s-unverified { background: var(--sky); } .s-suspended { background: var(--rose); }
.chip { display: inline-block; font-size: 12px; padding: 2px 8px; border-radius: 6px; background: var(--lilac); margin: 0 4px 2px 0; }
.flag { display: inline-block; font-size: 11.5px; padding: 1px 8px; border-radius: 999px; background: var(--butter); color: var(--warn); font-weight: 600; }
.flag.bad { background: var(--rose); color: var(--bad); }
.dot-on { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: #5ec28f; box-shadow: 0 0 0 3px var(--mint); vertical-align: 1px; margin-left: 4px; }
.alerts { list-style: none; padding: 0; margin: 0; } .alerts li { padding: 9px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; margin: 0 0 18px; }
.filters input, .filters select { width: auto; margin: 0; padding: 8px 11px; font-size: 14px; }
.filters label { display: flex; gap: 6px; align-items: center; font-size: 13px; color: var(--muted); }
.small-link { font-size: 13px; padding-bottom: 8px; }
.pager { display: flex; gap: 18px; justify-content: center; padding: 16px; font-size: 14px; }
.more { font-size: 13px; margin: 10px 0 0; }
.crumb { margin: 0 0 6px; font-size: 13px; }
.facts { display: flex; flex-wrap: wrap; gap: 8px 18px; align-items: center; font-size: 14px; color: var(--muted); margin: -6px 0 26px; }
.domains { list-style: none; padding: 0; margin: 0 0 12px; display: flex; flex-wrap: wrap; gap: 8px; }
.domains li { background: var(--mint); padding: 6px 12px; border-radius: 999px; font-size: 14px; }
.domains .link { font-size: 12.5px; margin-left: 6px; }
.toggle { display: flex; gap: 12px; align-items: flex-start; padding: 12px 0; border-bottom: 1px solid var(--line); cursor: pointer; }
.toggle input { margin-top: 4px; width: 17px; height: 17px; accent-color: var(--accent); flex: none; }
.toggle small { display: block; color: var(--muted); font-size: 13px; font-weight: 400; margin-top: 2px; }

/* ---------- My account ---------- */
.access { list-style: none; padding: 0; margin: 0 0 14px; display: grid; gap: 10px; }
.access li { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap;
             background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 12px 16px; }
.s-approved { background: var(--mint); } .s-requested { background: var(--butter); } .s-revoked { background: var(--rose); }
.panel { background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 22px; margin: 0 0 22px; }
.panel h2 { margin-bottom: 14px; }
/* ---------- admin extras (phase 2) ---------- */
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
code { font: 12.5px ui-monospace, Consolas, monospace; background: var(--lilac); padding: 1px 5px; border-radius: 5px; }
.alarm { border: 2px solid var(--bad); font-size: 14.5px; }
.alarm ul { margin: 6px 0 0; padding-left: 20px; }
.preview .tiles { margin-bottom: 18px; }
tr.p-invalid td, tr.p-dup td { color: var(--muted); }
tr.p-add td:first-child { box-shadow: inset 3px 0 0 #8fd1b0; }
details.decline { margin-top: 8px; font-size: 13.5px; }
details.decline summary { cursor: pointer; color: var(--muted); }
details.decline form { margin-top: 10px; max-width: 360px; }
.m-admin .foot { display: none; }
/* Admin > Classes: units per class, and the student import preview */
details.panel > summary { cursor: pointer; list-style-position: outside; }
details.course-units[open] > summary { margin-bottom: 4px; }
fieldset.unit-sec { border: 0; border-top: 1px solid var(--line); margin: 12px 0 0; padding: 10px 0 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 6px 18px; }
fieldset.unit-sec legend { padding: 0 6px 0 0; }
.unit-row { font-size: 13.5px; align-items: flex-start; }
.unit-row input { margin-top: 3px; }
/* Worksheet and Mark scheme switches under a 9618 or 0478 unit (spec 10.15) */
.unit-cell .rel { display: flex; flex-wrap: wrap; gap: 2px 14px; margin: 2px 0 4px 26px; }
.unit-cell .rel .check { font-size: 12.5px; color: var(--muted); }
.unit-cell .rel small { flex-basis: 100%; font-size: 12px; }
.uid { font-variant-numeric: tabular-nums; font-weight: 600; min-width: 2.6em; display: inline-block; }
tr.p-new td:first-child, tr.p-update td:first-child { box-shadow: inset 3px 0 0 #8fd1b0; }
tr.p-invalid td:first-child { box-shadow: inset 3px 0 0 var(--bad); }
.pick-list { max-height: 320px; overflow-y: auto; display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 6px 18px;
             border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; width: 100%; box-sizing: border-box; }
.pick-list .check { align-items: flex-start; } .pick-list input { margin-top: 3px; }
.trap { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

/* Self-assessment (phase 3b, spec section 5A): rating colours are soft pastels with dark text,
   kept the same in dark mode so the contrast stays high. The word or letter is always shown too. */
.rate { display: inline-block; font-size: 12.5px; font-weight: 600; padding: 2px 10px; border-radius: 999px; white-space: nowrap; }
.r-not_yet { background: #f8d7da; color: #5c1d24; }
.r-getting_there { background: #fde8c4; color: #573a06; }
.r-confident { background: #d4f0dd; color: #1b4a2c; }
.r-none { background: #e9e7ee; color: #46424f; }
.revisit { list-style: none; padding: 0; margin: 0 0 10px; } .revisit li { padding: 7px 0; border-bottom: 1px solid var(--line); }
.revisit li .small { margin-left: 6px; }
h3.sec { font-size: 12.5px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin: 18px 0 6px; font-weight: 650; }
table.progress td.uid { width: 3.5em; }
/* Class heatmap: one cell per student and unit */
.legend { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; font-size: 13px; color: var(--muted); margin: 0 0 14px; }
.heat-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 14px; }
table.heat { display: table; width: auto; min-width: 100%; font-size: 13px; }
table.heat th, table.heat td { border-bottom: 1px solid var(--line); padding: 6px 8px; white-space: nowrap; }
table.heat th.u { text-align: center; font-variant-numeric: tabular-nums; }
table.heat th.u small { display: block; font-weight: 400; max-width: 7em; overflow: hidden; text-overflow: ellipsis; }
table.heat td.cell { text-align: center; padding: 4px; }
table.heat td.cell span { display: block; min-width: 2.2em; padding: 5px 4px; border-radius: 7px; font-weight: 700; }
table.heat th.who { position: sticky; left: 0; background: var(--card); z-index: 1; font-weight: 500; color: var(--ink); text-align: left; }
table.heat tr.count td { font-size: 12px; text-align: center; color: var(--muted); }
table.heat tr.count td b { color: var(--ink); }
.help-note { max-width: 32em; overflow-wrap: anywhere; }

/* Admin Overview (2026-11-18): the activity chart, the class cards and their rating mix */
.cls h3, h3.sub { font-size: 15px; margin: 4px 0 8px; }
.chart { display: flex; align-items: stretch; gap: 4px; height: 170px; padding-top: 4px; }
.chart .col { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; min-width: 0; border-radius: 6px; outline: none; }
.chart .bar { width: 100%; max-width: 30px; border-radius: 4px 4px 0 0; background: color-mix(in srgb, var(--accent) 55%, var(--card)); }
.chart .today .bar { background: var(--accent); }
.chart .n { font-size: 11.5px; color: var(--muted); visibility: hidden; font-variant-numeric: tabular-nums; }
.chart .col:hover .n, .chart .col:focus .n, .chart .today .n { visibility: visible; }
.chart .col:hover, .chart .col:focus-visible { background: var(--lilac); }
.chart .day { font-size: 11px; color: var(--muted); padding: 5px 0 0; border-top: 1px solid var(--line); width: 100%; text-align: center; white-space: nowrap; }
.chart .wkend .day { opacity: .6; }
.chart .today .day { color: var(--ink); font-weight: 600; }
.classes { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 14px; }
.cls { border: 1px solid var(--line); border-radius: var(--r); padding: 16px 18px; background: var(--card); }
.cls h3 a { color: var(--ink); text-decoration: none; }
.facts-sm { font-size: 13.5px; color: var(--muted); margin: 0 0 10px; } .facts-sm b { color: var(--ink); }
.mix { display: flex; gap: 2px; height: 10px; border-radius: 999px; overflow: hidden; }
.mix span { display: block; min-width: 4px; }
.mix-key { margin: 8px 0 0; display: flex; flex-wrap: wrap; gap: 4px; } .mix-key .rate { font-size: 11.5px; padding: 1px 8px; }
.mix-none { font-size: 13px; margin: 0; }
.approvals td.right { white-space: normal; }   /* several Approve buttons wrap instead of widening the page */
@media (max-width: 820px) { .chart { height: 140px; gap: 2px; } .chart .day { font-size: 10px; } }
.ks3-acc { border-top: 1px solid var(--line); padding: 12px 0 16px; }
.ks3-acc p { margin: 0 0 8px; }

@media (max-width: 820px) {
  .admin { grid-template-columns: 1fr; }
  .side { position: static; height: auto; flex-direction: row; flex-wrap: wrap; border-right: 0; border-bottom: 1px solid var(--line); padding: 14px 16px; }
  .side .brand { width: 100%; margin: 0 0 8px; } .side .sep { display: none; }
  .content { padding: 22px 16px 50px; }
  .two { grid-template-columns: 1fr; }
  table { display: block; overflow-x: auto; }
  /* Tables with buttons: one cell under another, so no button is off-screen */
  table.stack-sm, table.stack-sm tbody, table.stack-sm tr, table.stack-sm td { display: block; overflow: visible; }
  table.stack-sm th { display: none; }
  table.stack-sm td { border-bottom: 0; padding: 6px 0; }
  table.stack-sm tr { border-bottom: 1px solid var(--line); padding: 8px 0; }
  .auth { padding: 24px 20px; }
}

/* Flex1 Campus logo (phase 5b): the one-line SVG in place of the old "Mr Ova's Flex1" text */
.brand.logo { line-height: 0; }
.brand.logo::after { content: none; }
.brand.logo img { display: block; width: 150px; height: auto; }
.foot a { color: inherit; }

/* Admin side menu (2026-11-06): the flex1 campus logo (links home), then "Admin" (links to the Overview) */
.side .brand.logo { margin: 0 8px 6px; }
.side a.side-title { font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); font-weight: 600; margin-bottom: 18px; }
.side a.side-title:hover { background: none; color: var(--ink); }
@media (max-width: 820px) { .side a.side-title { margin-bottom: 4px; } }

/* Admin (2026-11-06): page numbers under long lists, and a small "Manage" button */
.pager { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 16px 0; font-size: 14px; }
.pager a, .pager b { display: inline-block; min-width: 34px; text-align: center; padding: 5px 10px; border-radius: 99px; border: 1px solid var(--line); text-decoration: none; color: var(--ink); }
.pager b { background: var(--ink); color: var(--bg, #fff); border-color: var(--ink); }
.btn-link { display: inline-block; font-size: 13px; padding: 4px 12px; border-radius: 99px; border: 1px solid var(--line); text-decoration: none; color: var(--ink); white-space: nowrap; }
.btn-link:hover { border-color: var(--muted); }

/* Admin sub-pages as rounded tabs (2026-11-06), first used by Admin > Seats:
   Overview · Plans · Logs · Settings. The current tab is filled in. */
.subtabs { display: inline-flex; flex-wrap: wrap; gap: 4px; padding: 4px; margin: -4px 0 26px; background: var(--card); border: 1px solid var(--line); border-radius: 99px; }
.subtabs a { padding: 7px 16px; border-radius: 99px; font-size: 14px; font-weight: 500; color: var(--muted); text-decoration: none; }
.subtabs a:hover { color: var(--ink); }
.subtabs a[aria-current] { background: var(--ink); color: var(--bg); font-weight: 600; }
.subtabs a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
@media (max-width: 560px) { .subtabs { border-radius: 16px; } }
.page-lead { margin: -8px 0 22px; max-width: 70ch; }
/* small rounded filters above a list (All, Info, Warnings, Errors) */
.filter-pills { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 0 0 16px; }
.filter-pills a { font-size: 13px; padding: 5px 13px; border-radius: 99px; border: 1px solid var(--line); text-decoration: none; color: var(--ink); }
.filter-pills a:hover { border-color: var(--muted); }
.filter-pills a[aria-current] { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.filter-pills form { margin-left: auto; }
.lvl { display: inline-block; font-size: 11.5px; font-weight: 650; padding: 1px 8px; border-radius: 99px; letter-spacing: .03em; }
.lvl-info { background: var(--sky); } .lvl-warning { background: var(--butter); color: var(--warn); } .lvl-error { background: var(--rose); color: var(--bad); }
.nowrap { white-space: nowrap; }

/* ---------- flex1 exam builder (exams/app/: new.php, test.php) ---------- */
a.btn { display: inline-block; font-weight: 600; text-decoration: none; border-radius: 999px; padding: 11px 22px; background: var(--ink); color: var(--bg); }
/* Dashboard and course choice (2026-11-18): the Flex1 Campus look of static/portal.css: a big
   ">flex1 exam builder" title, and pastel cards with a deeper colour of the same tint for small text. */
.ex-mast { padding: 18px 0 10px; }
.ex-mast h1 { font-size: clamp(34px, 6vw, 52px); line-height: 1.04; margin: 6px 0 0; letter-spacing: -.02em; font-weight: 400; }
.ex-mast h1 .fx { font-weight: 750; } .ex-mast h1 .pw { font-weight: 400; }
.ex-mast h1 .gt { color: #2f6b55; font-weight: 800; margin-right: .05em; }
.ex-mast h1 .dot { display: inline-block; width: .3em; height: .3em; border-radius: 50%; background: #2f6b55; margin-left: .08em; }
.ex-mast .lead { color: var(--muted); font-size: 17px; max-width: 620px; margin: 12px 0 18px; }
.ex-sec-title { font-size: 13px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin: 30px 0 12px; }
.ex-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 16px; }
.t-peach { --tint: var(--peach); --deep: #9a5632; } .t-sky { --tint: var(--sky); --deep: #2e6286; } .t-mint { --tint: var(--mint); --deep: #2f6b55; }
.t-lilac { --tint: var(--lilac); --deep: #5a4a8c; } .t-butter { --tint: var(--butter); --deep: #8a7322; } .t-rose { --tint: var(--rose); --deep: #8c3e62; }
@media (prefers-color-scheme: dark) {
  .ex-mast h1 .gt { color: #9fdcbf; } .ex-mast h1 .dot { background: #9fdcbf; }
  .t-peach { --deep: #f2bf9e; } .t-sky { --deep: #a6d2f0; } .t-mint { --deep: #9fdcbf; } .t-lilac { --deep: #c8bdf0; } .t-butter { --deep: #ecd88e; } .t-rose { --deep: #f0b3cc; }
}
.ex-card { display: flex; flex-direction: column; gap: 6px; min-height: 170px; padding: 18px 18px 14px; border-radius: 18px; background: var(--tint, var(--card)); color: var(--ink); }
a.ex-card { text-decoration: none; transition: transform .18s ease, box-shadow .18s ease; }
a.ex-card:hover, a.ex-card:focus-visible { transform: translateY(-3px); box-shadow: 0 10px 28px rgba(40, 50, 70, .10); outline: none; }
.ex-card p { margin: 0; }
.ex-card h3 { font-size: 19px; line-height: 1.2; margin: 2px 0 0; font-weight: 700; }
.ex-card h3 a { color: inherit; text-decoration: none; } .ex-card h3 a:hover { text-decoration: underline; }
.ex-board { font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--deep); font-weight: 650; }
.ex-meta { font-size: 13.5px; color: var(--ink); opacity: .75; }
.ex-big { font-size: 15px; font-weight: 650; } .ex-big span { font-weight: 400; opacity: .75; }
/* The tests as a list (2026-11-18): a row each, course tag, details and downloads, Open and Manage.
   Manage opens a strip under its row, which pushes the next row down. */
.ex-rows { list-style: none; margin: 0; padding: 0; border-bottom: 1px solid var(--line); }
.ex-row { position: relative; display: grid; grid-template-columns: 118px minmax(0, 1fr) auto; gap: 6px 16px; align-items: center; padding: 14px 4px; border-top: 1px solid var(--line); scroll-margin-top: 20px; }
.ex-tag { justify-self: start; font-size: 11.5px; letter-spacing: .06em; text-transform: uppercase; font-weight: 650; padding: 4px 10px; border-radius: 99px; background: var(--tint); color: var(--deep); white-space: nowrap; }
.ex-row h3 { font-size: 15.5px; margin: 0; font-weight: 650; line-height: 1.3; }
.ex-row h3 a { color: var(--ink); text-decoration: none; } .ex-row h3 a:hover { text-decoration: underline; }
.ex-row p { margin: 2px 0 0; }
.ex-meta { font-size: 13px; color: var(--muted); } .ex-none { font-style: italic; }
.ex-dl { font-size: 13px; color: var(--muted); margin-top: 6px !important; }
.ex-dl a { font-weight: 600; margin-right: 8px; } .ex-dl span + a { margin-left: 2px; } .ex-dl a + span { margin-left: 8px; }
.ex-row-acts { display: flex; gap: 10px; align-items: center; align-self: start; margin-top: 2px; }
/* Manage: its strip is the row's second line (the <details> spans the row under the title), and its
   button is pinned next to Open, so an open strip simply pushes the next row down. */
.ex-row:has(> details) .ex-row-acts { padding-right: 100px; }
.ex-row > details { grid-column: 2 / -1; }
.ex-row > details > summary { position: absolute; right: 4px; top: 16px; }
.ex-row-acts form { margin: 0; }
.ex-manage summary { cursor: pointer; font-size: 13px; padding: 4px 12px; border-radius: 99px; border: 1px solid var(--line); list-style: none; white-space: nowrap; }
.ex-manage summary:hover { border-color: var(--muted); }
.ex-manage summary::-webkit-details-marker { display: none; } .ex-manage summary::after { content: " \25BE"; }
.ex-menu { margin-top: 4px; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; padding: 10px 12px; border-radius: 12px; background: var(--sky); }
.ex-menu form { margin: 0; } .ex-rename { display: flex; gap: 8px; flex: 1 1 300px; align-items: center; }
.ex-rename input { margin: 0; flex: 1; min-width: 0; }
.ex-find { display: flex; gap: 8px; align-items: center; margin: 0 0 10px; } .ex-find input { max-width: 280px; margin: 0; }
.ex-pager { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 8px; font-size: 13.5px; color: var(--muted); padding: 12px 4px 0; }
.ex-pages { display: flex; gap: 4px; }
.ex-pages a { min-width: 32px; text-align: center; padding: 5px 9px; border-radius: 99px; border: 1px solid var(--line); text-decoration: none; color: var(--ink); }
.ex-pages a[aria-current] { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.ex-deleted { margin-top: 18px; } .ex-deleted summary { cursor: pointer; color: var(--muted); font-size: 14px; margin-bottom: 8px; }
.ex-deleted .ex-row { opacity: .8; }
.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; }
@media (max-width: 640px) {
  .ex-row { grid-template-columns: minmax(0, 1fr); }
  .ex-row-acts { justify-content: flex-start; }
  /* On a phone Manage sits under Open, its strip under it. */
  .ex-row:has(> details) .ex-row-acts { padding-right: 0; }
  .ex-row > details { grid-column: 1; }
  .ex-row > details > summary { position: static; display: inline-block; }
}
/* Bank cards: the open link at the foot. */
.ex-card-foot { margin-top: auto; padding-top: 10px; display: flex; align-items: flex-start; gap: 10px; flex-wrap: wrap; }
.ex-open { font-size: 14px; font-weight: 650; color: var(--deep); text-decoration: none; padding-top: 6px; }
.ex-open::after { content: " \2192"; }
.ex-papers summary { cursor: pointer; font-size: 13px; color: var(--deep); font-weight: 600; }
.ex-papers ul { margin: 6px 0; padding-left: 18px; font-size: 13px; } .ex-papers p { margin-top: 4px; }
.ex-courses .ex-card .ex-big { margin-top: auto; }
.ex-tree-head { justify-content: space-between; margin-bottom: 6px; } .ex-tree-head input { max-width: 240px; }
.ex-tree { border: 1px solid var(--line); border-radius: 12px; padding: 4px 14px; margin-bottom: 10px; background: var(--card); }
.ex-sec { border-bottom: 1px solid var(--line); padding: 8px 0; } .ex-sec:last-child { border-bottom: 0; }
.ex-sec summary { cursor: pointer; } .ex-sec summary .check { display: inline-flex; font-weight: 600; }
.ex-unit { padding: 4px 0 4px 26px; align-items: flex-start; } .ex-unit.muted { opacity: .6; }
.ex-time label { flex: 1; min-width: 200px; } .ex-filters summary { cursor: pointer; font-weight: 600; margin-bottom: 8px; }
.ex-total { position: sticky; top: 0; z-index: 2; background: var(--bg); border: 1px solid var(--line); border-radius: 14px; padding: 12px 16px; margin: 0 0 18px; }
.ex-total p { margin: 0 0 6px; } .ex-total .actions { margin-top: 8px; }
.ex-warn { color: var(--bad); }
.ex-list { list-style: none; padding: 0; margin: 0 0 24px; display: grid; gap: 16px; }
.ex-q { border: 1px solid var(--line); border-radius: 14px; padding: 14px; background: var(--card); scroll-margin-top: 150px; }
.ex-q.locked { border-color: var(--accent); }
.ex-q-head { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 10px; }
/* Cambridge's crops are black on white: keep them on white in dark mode too, and never wider than the page. */
.ex-img { display: block; max-width: 100%; height: auto; background: #fff; border-radius: 6px; padding: 6px; box-sizing: border-box; }
.ex-ms { margin: 10px 0; } .ex-ms summary { cursor: pointer; color: var(--muted); font-size: 14px; } .ex-ms .ex-img { margin-top: 8px; }
.ex-acts { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; margin-top: 10px; }
.ex-swap { margin-top: 12px; padding: 12px; border-radius: 12px; background: var(--sky); }
.ex-choice { border-top: 1px solid var(--line); padding: 10px 0; } .ex-choice .ex-acts { margin-top: 6px; }
.ex-version { border-top: 1px solid var(--line); padding: 10px 0; } .ex-version p { margin: 0 0 6px; } .ex-files { margin-top: 4px; }
textarea { width: 100%; box-sizing: border-box; font: inherit; padding: 10px; border-radius: 10px; border: 1px solid var(--line); background: var(--card); color: var(--ink); margin-top: 6px; }

/* ---------- flex1 planner (2026-11-19): the school calendar as month grids ----------
   Each day's colour says what it is; the same words are in the cell's label and in the list
   beside each month, so colour is never the only signal. */
.pl-months { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 22px 18px; margin-top: 14px; }
.pl-month h3 { font-size: 14px; margin: 0 0 6px; font-weight: 650; }
table.pl-grid { display: table; width: 100%; table-layout: fixed; border-collapse: separate; border-spacing: 2px; font-size: 12.5px; font-variant-numeric: tabular-nums; }
.pl-grid th { font-weight: 500; color: var(--muted); font-size: 11.5px; padding: 2px 0; text-align: center; border: 0; }
.pl-grid th.pl-we { opacity: .6; }
.pl-grid th.pl-wk { width: 2.1em; }
.pl-grid td { text-align: center; padding: 4px 0; border-radius: 6px; border: 0; }
.pl-grid td.pl-blank { background: none; }
.d-school { background: var(--card); box-shadow: inset 0 0 0 1px var(--line); }
.d-off { background: var(--sky); }
.d-event { background: var(--lilac); }
.d-stop { background: var(--peach); }
.d-extra { background: var(--mint); }
.d-weekend { background: color-mix(in srgb, var(--muted) 16%, var(--card)); color: var(--muted); }
.d-out { color: var(--muted); opacity: .75; }
.d-edge, .pl-grid td.edge { background: var(--butter); font-weight: 750; }
.pl-grid td.today { box-shadow: inset 0 0 0 2px var(--accent); font-weight: 750; }
.pl-dot { display: inline-block; flex: none; width: 11px; height: 11px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.pl-dot.d-out { box-shadow: inset 0 0 0 1px var(--line); }
.pl-notes { list-style: none; padding: 0; margin: 8px 0 0; font-size: 12.5px; display: grid; gap: 3px; }
.pl-notes li { display: flex; align-items: baseline; gap: 4px; } .pl-notes b { font-weight: 600; white-space: nowrap; }
.pl-coming { font-size: 14px; gap: 6px; }
.pl-key { list-style: none; padding: 0; margin: 0 0 6px; display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 12.5px; color: var(--muted); }
.pl-key li { display: flex; align-items: center; gap: 2px; }
.pl-ab { display: inline-block; min-width: 1.6em; padding: 1px 5px; border-radius: 6px; font-size: 12px; font-weight: 650; text-align: center; line-height: 1.5; }
.pl-ab.ab-a { background: var(--lilac); } .pl-ab.ab-b { background: var(--mint); } .pl-ab.ab-none { color: var(--muted); }
h2 .pl-ab { margin-left: 8px; font-size: 13px; padding: 2px 8px; vertical-align: 2px; }
.pl-key .pl-ab { margin-right: 2px; }
.pl-wkform { margin: 0; }
.pl-wkform button.pl-ab { color: var(--ink); background: var(--card); cursor: pointer; border: 0; border-radius: 6px; padding: 1px 5px; font-size: 12px; box-shadow: inset 0 0 0 1px var(--line); }
.pl-wkform button.pl-ab.ab-a { background: var(--lilac); } .pl-wkform button.pl-ab.ab-b { background: var(--mint); } .pl-wkform button.pl-ab.ab-none { color: var(--muted); }
.pl-wkform button.pl-ab.hand { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 2px; }
.pl-wkform button.pl-ab:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.pl-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 18px; }
.pl-week { list-style: none; padding: 0; margin: 10px 0 0; display: grid; gap: 6px; font-size: 14px; }
.pl-week li { display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap; } .pl-week li b { min-width: 6.5em; font-weight: 600; }
.pl-week li span:last-child { color: var(--muted); } .pl-week li.today b { color: var(--accent); }
.pl-form { max-width: 620px; }
.pl-two { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; }
fieldset.pl-fs { border: 0; padding: 0; margin: 0; display: grid; gap: 6px; }
fieldset.pl-fs legend { font-size: 14px; padding: 0; margin-bottom: 6px; }
.pl-ticks { display: flex; flex-wrap: wrap; gap: 6px 18px; }
form.pl-term { margin-bottom: 8px; } form.pl-term input[type=text] { min-width: 140px; } form.pl-term input[type=date] { flex: 0 1 170px; min-width: 140px; }
.pl-rows td:first-child { white-space: nowrap; }
tr.pl-editing td { background: var(--butter); }
.pl-sample { background: var(--bg); border: 1px dashed var(--line); border-radius: 10px; padding: 10px 12px; font-size: 12.5px; overflow-x: auto; white-space: pre; }
.pl-preview tr.pl-bad td { background: color-mix(in srgb, var(--rose) 60%, transparent); }
.pl-preview tr.pl-same td { color: var(--muted); }
.pl-delete { margin-top: 18px; }
@media (max-width: 560px) { .pl-months { grid-template-columns: minmax(0, 1fr); } }

/* flex1 planner phase 2: the preview of a calendar read from an uploaded file (admin/planner/upload.php). */
.pl-scroll { overflow-x: auto; }
.pl-edit { width: max-content; min-width: 100%; }
.pl-edit input[type="text"], .pl-edit input[type="date"], .pl-edit select { font-size: 13px; padding: 4px 6px; }
.pl-edit input[type="text"] { width: 13em; } .pl-edit input[type="date"] { width: 9.6em; } .pl-edit select { width: auto; min-width: 9em; }
.pl-edit input.pl-yg { width: 7em; margin-top: 4px; } .pl-edit td.small { min-width: 11em; }
.pl-edit td { vertical-align: top; }
.pl-colour { display: inline-block; margin-top: 3px; padding: 0 6px; border-radius: 99px; background: var(--butter); color: var(--ink); font-size: 11.5px; }
.pl-actions { margin-top: 18px; gap: 10px; }

/* Colours on My account: Light, Dark or Auto (static/theme.js). Since 2026-11-22 the only place to
   choose; the switch in the header and the admin menu is gone and every page is light by default. */
.theme-set { display: flex; gap: 8px; flex-wrap: wrap; }
.theme-set button[aria-pressed="true"] { background: var(--ink); color: var(--bg); box-shadow: none; }

/* flex1 planner phase 2b: duties, meetings, clubs and interventions. Each kind has a pastel colour,
   always shown with its word. */
.pl-kind { display: inline-block; padding: 0 7px; border-radius: 99px; font-size: 11.5px; font-weight: 600; line-height: 1.6; color: var(--ink); vertical-align: 1px; }
.k-duty { background: var(--peach); } .k-meeting { background: var(--sky); } .k-club { background: var(--mint); }
.k-intervention { background: var(--lilac); } .k-other { background: var(--butter); }
.pl-dot.d-k-duty { background: var(--peach); } .pl-dot.d-k-meeting { background: var(--sky); } .pl-dot.d-k-club { background: var(--mint); }
.pl-dot.d-k-intervention { background: var(--lilac); } .pl-dot.d-k-other { background: var(--butter); }
.pl-day-sessions { list-style: none; padding: 0; margin: 4px 0 2px; flex-basis: 100%; display: grid; gap: 3px; font-size: 13px; }
.pl-day-sessions li { display: block; } .pl-week > li > span:not(.pl-dot) { color: var(--muted); }
.pl-week .pl-day-sessions .pl-check, .pl-week .pl-day-sessions .pl-kind { color: var(--ink); }

/* flex1 planner phase 3a: schemes of work, classes and their plan. A lesson on This week is a plain
   outlined label; the deadline check and the item kinds are pastel labels, always with their words. */
.k-lesson { background: var(--card); box-shadow: inset 0 0 0 1px var(--line); }
.pl-pace, .pl-ik { display: inline-block; padding: 0 8px; border-radius: 99px; font-size: 12px; font-weight: 600; line-height: 1.7; color: var(--ink); white-space: nowrap; }
.pl-pace.p-ok { background: var(--mint); } .pl-pace.p-amber { background: var(--butter); } .pl-pace.p-red { background: var(--rose); }
.pl-pace.p-none { box-shadow: inset 0 0 0 1px var(--line); color: var(--muted); }
.ik-test { background: var(--peach); } .ik-revision { background: var(--sky); } .ik-spare { background: var(--mint); }
.ik-heading { background: var(--butter); } .ik-own { background: var(--lilac); } .ik-new { background: var(--butter); }
.pl-blocks { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.pl-block { border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; }
.pl-block.pl-heading { background: color-mix(in srgb, var(--butter) 55%, transparent); }
.pl-block-head { display: flex; gap: 10px; align-items: baseline; }
.pl-num { min-width: 1.8em; color: var(--muted); font-variant-numeric: tabular-nums; font-size: 13px; }
.pl-acts { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 8px 0 0 2.4em; }
.pl-acts button, .pl-acts a.btn { padding: 4px 11px; font-size: 12.5px; font-weight: 500; }
.pl-acts button[disabled] { opacity: .35; cursor: default; }
.pl-acts .pl-to input { width: 4.2em; padding: 4px 6px; font-size: 12.5px; margin: 0; }
.pl-lessons { margin: 6px 0 0 2.4em; } .pl-lessons ol { margin: 6px 0 0; padding-left: 1.4em; font-size: 13.5px; display: grid; gap: 3px; }
.pl-mini { font-size: 12.5px; margin-left: 8px; } .pl-mini a { margin-right: 6px; }
button.linkish { background: none; color: var(--accent); padding: 0 4px; font-size: 12.5px; font-weight: 500; text-decoration: underline; border-radius: 0; }
.pl-itemform { margin: 10px 0 4px 2.4em; padding: 12px; border-radius: 12px; background: var(--bg); }
.pl-adds { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 22px; }
.pl-adds h3 { font-size: 15px; margin: 0; }
.pl-fill { margin-top: 18px; }
.pl-plan th[scope=rowgroup] { background: color-mix(in srgb, var(--butter) 55%, transparent); text-align: left; }
.pl-plan tr.pl-past td { color: var(--muted); }
.pl-plan td:last-child { white-space: nowrap; }
/* The start page's Day, Week and Month views (Week agreed 2026-11-19; Day and Month 2026-11-20, made
   quieter the same day). Hairline rows instead of boxes, so the lessons stand out; each class keeps its
   pastel colour with a deeper edge; today's column is softly tinted; "Open in teach" opens the lesson
   in flex1 teach in a new tab, and Now marks the lesson on now. A list on a phone. */
.pl-nav { margin-bottom: 18px; }
.pl-wkhead { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 10px 18px; margin-bottom: 18px; }
.pl-wkhead h2 { margin: 0; font-size: 19px; letter-spacing: -.01em; }
.pl-wktitle p { margin: 3px 0 0; }
.pl-wktools { flex: 1 1 100%; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 12px; }
.pl-wknav { display: flex; flex-wrap: wrap; gap: 6px; }
.pl-wknav a { padding: 4px 12px; border-radius: 99px; color: var(--ink); text-decoration: none; font-weight: 500; box-shadow: inset 0 0 0 1px var(--line); white-space: nowrap; }
.pl-wknav a:hover, .pl-wknav a:focus-visible { background: var(--lilac); box-shadow: none; outline: none; }
.pl-views { display: inline-flex; gap: 2px; padding: 3px; border-radius: 99px; background: color-mix(in srgb, var(--muted) 10%, var(--card)); }
.pl-views a { padding: 4px 14px; border-radius: 99px; color: var(--muted); text-decoration: none; font-weight: 500; }
.pl-views a:hover { color: var(--ink); }
.pl-views a[aria-current] { background: var(--card); color: var(--ink); font-weight: 600; box-shadow: 0 1px 3px color-mix(in srgb, var(--ink) 14%, transparent); }
.pl-views a:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }

/* The class colours: a pastel card with a deeper edge (mid tones, so they read in light and dark). */
.cc0 { background: var(--lilac); --cc-edge: #9d8ce0; } .cc1 { background: var(--mint); --cc-edge: #5fbf94; } .cc2 { background: var(--sky); --cc-edge: #6aa6e0; }
.cc3 { background: var(--butter); --cc-edge: #dcb84a; } .cc4 { background: var(--rose); --cc-edge: #e08aa6; }

/* Week: the school days across, the periods down. */
.pl-wkgrid table { display: table; width: 100%; min-width: 640px; table-layout: fixed; border-collapse: collapse; font-size: 12.5px; }
.pl-wkgrid th, .pl-wkgrid td { border: 0; border-top: 1px solid var(--line); }
.pl-wkgrid thead th { border-top: 0; padding: 0 6px 10px; text-align: left; vertical-align: bottom; font-weight: 600; }
.pl-wkgrid thead th a { display: block; color: var(--ink); text-decoration: none; line-height: 1.25; }
.pl-wkgrid thead th a:hover .pl-dh-d, .pl-wkgrid thead th a:focus-visible .pl-dh-d { color: var(--accent); text-decoration: underline; }
.pl-dh-wd { display: block; font-size: 11.5px; font-weight: 500; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.pl-dh-d { display: block; font-size: 15px; font-weight: 650; }
.pl-dh-today { display: inline-block; margin-top: 4px; padding: 0 8px; border-radius: 99px; background: var(--accent); color: var(--card); font-size: 11px; font-weight: 650; line-height: 1.6; }
.pl-wkgrid thead th.today .pl-dh-wd, .pl-wkgrid thead th.today .pl-dh-d { color: var(--accent); }
.pl-wkgrid th.pl-wkp { width: 5.4em; padding: 8px 8px 8px 0; color: var(--ink); font-weight: 600; font-size: 12.5px; text-align: left; vertical-align: top; }
.pl-wkgrid th.pl-wkp small { display: block; font-size: 11px; font-weight: 400; color: var(--muted); }
.pl-wkgrid td { vertical-align: top; padding: 4px 3px; height: 58px; }
.pl-wkgrid td.today { background: color-mix(in srgb, var(--lilac) 45%, transparent); }
.pl-wkgrid tr.pl-wkslot th.pl-wkp { padding: 3px 8px 3px 0; font-weight: 500; color: var(--muted); font-size: 11.5px; }
.pl-wkgrid tr.pl-wkslot th.pl-wkp small { display: inline; margin-left: 4px; }
.pl-wkgrid tr.pl-wkslot td { height: 0; padding: 2px 3px; background: color-mix(in srgb, var(--muted) 5%, transparent); }
.pl-wkgrid tr.pl-wkslot td.today { background: color-mix(in srgb, var(--lilac) 45%, transparent); }
.pl-wkgrid td.pl-wkoff, .pl-wkgrid tr.pl-wkslot td.pl-wkoff { background: repeating-linear-gradient(135deg, transparent 0 7px, color-mix(in srgb, var(--sky) 55%, transparent) 7px 14px); }
.pl-wkstate { display: block; margin-top: 2px; font-weight: 500; font-size: 11.5px; color: var(--muted); }

/* A lesson, duty or meeting in a cell. */
.pl-wk-item { position: relative; display: block; padding: 6px 8px 7px 10px; border-radius: 9px; color: var(--ink); text-decoration: none; line-height: 1.3; margin-bottom: 4px; }
.pl-wk-item:last-child { margin-bottom: 0; }
div.pl-wk-item { box-shadow: inset 3px 0 0 var(--cc-edge, var(--line)); }
.pl-wk-item b { display: block; font-weight: 650; font-size: 13px; }
.pl-wk-item > a > span, .pl-wk-item > span:not(.pl-check):not(.pl-nowtag) { display: block; font-size: 11.5px; color: color-mix(in srgb, var(--ink) 72%, transparent); }
.pl-wk-item > a > span { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
a.pl-wk-item:hover, a.pl-wk-item:focus-visible { box-shadow: inset 0 0 0 1px var(--muted); outline: none; }
div.pl-wk-item > a:first-child { display: block; color: var(--ink); text-decoration: none; }
div.pl-wk-item > a:first-child:hover b, div.pl-wk-item > a:first-child:focus-visible b { text-decoration: underline; }
.pl-wk-item.pl-clash, div.pl-wk-item.pl-clash { box-shadow: inset 3px 0 0 var(--cc-edge, var(--bad)), inset 0 0 0 2px var(--bad); }
.pl-wk-item .pl-check { display: inline-block; margin-top: 3px; }
.pl-wk-item.pl-now { box-shadow: inset 3px 0 0 var(--cc-edge, var(--ink)), 0 0 0 2px var(--accent); }
.pl-nowtag { display: inline-block; padding: 0 7px; border-radius: 99px; background: var(--accent); color: var(--card); font-size: 10.5px; font-weight: 650; line-height: 1.6; }
.pl-wk-item > .pl-nowtag { position: absolute; top: 5px; right: 5px; }
.pl-teach { display: inline-flex; align-items: center; gap: 3px; margin-top: 5px; color: var(--accent); font-size: 11.5px; font-weight: 600; text-decoration: none; white-space: nowrap; }
.pl-teach:hover, .pl-teach:focus-visible { text-decoration: underline; }
.pl-wkkey { margin-top: 14px; }
.pl-wkdays { display: none; }

/* Day: an agenda, each period's name and times on the left, what is on in it on the right. */
ol.pl-agenda { list-style: none; margin: 0; padding: 0; max-width: 760px; }
.pl-agenda > li { display: grid; grid-template-columns: 7.5em minmax(0, 1fr); gap: 14px; padding: 8px 0; border-top: 1px solid var(--line); }
.pl-agenda > li:first-child { border-top: 0; }
.pl-dv-time b { display: block; font-size: 14px; font-weight: 650; }
.pl-dv-time span { display: block; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.pl-dv-what { display: grid; gap: 6px; align-content: start; }
.pl-agenda .pl-dv-slot { padding: 4px 0; }
.pl-agenda .pl-dv-slot:not(.pl-dv-busy) .pl-dv-time { display: flex; gap: 6px; align-items: baseline; white-space: nowrap; grid-column: 1 / -1; }
.pl-agenda .pl-dv-slot:not(.pl-dv-busy) .pl-dv-what { display: none; }
.pl-agenda .pl-dv-slot .pl-dv-time b { font-size: 12.5px; font-weight: 500; color: var(--muted); }
.pl-agenda .pl-dv-slot .pl-dv-time span { font-size: 11.5px; }
.pl-agenda .pl-dv-slot:not(.pl-dv-busy) { background: color-mix(in srgb, var(--muted) 5%, transparent); border-radius: 8px; padding: 4px 10px; margin: 2px 0; border-top: 0; }
.pl-agenda .pl-dv-slot:not(.pl-dv-busy) + li { border-top: 0; }
.pl-dv-free { display: block; padding: 10px 12px; border-radius: 10px; border: 1px dashed var(--line); color: var(--muted); font-size: 13px; }
.pl-dv-now .pl-dv-time b, .pl-dv-now .pl-dv-time span { color: var(--accent); }
.pl-agenda .pl-wk-item { display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: 14px; align-items: center; padding: 11px 14px 11px 16px; border-radius: 12px; margin: 0; }
.pl-agenda .pl-wk-item > * { grid-column: 1; justify-self: start; }
.pl-agenda .pl-wk-item > a:first-child { justify-self: stretch; }
.pl-agenda .pl-wk-item b { font-size: 16px; }
.pl-agenda .pl-wk-item > a > span { font-size: 13.5px; -webkit-line-clamp: 3; }
.pl-agenda .pl-wk-item > span:not(.pl-check):not(.pl-nowtag) { font-size: 12.5px; }
.pl-agenda .pl-wk-item > .pl-nowtag { position: static; justify-self: start; margin-top: 4px; }
.pl-links { display: flex; flex-wrap: wrap; gap: 2px 12px; }
.pl-agenda .pl-links { grid-column: 2; grid-row: 1 / span 4; align-self: end; justify-self: end; justify-content: flex-end; gap: 8px; margin-top: 26px; }
.pl-agenda .pl-teach { margin: 0; padding: 7px 14px; border-radius: 99px; background: var(--card); font-size: 13px; box-shadow: 0 1px 2px color-mix(in srgb, var(--ink) 12%, transparent); }
.pl-agenda .pl-teach:hover, .pl-agenda .pl-teach:focus-visible { text-decoration: none; background: var(--accent); color: var(--card); }
.pl-dayoff .pl-dv-what { min-height: 20px; border-radius: 8px; background: repeating-linear-gradient(135deg, transparent 0 7px, color-mix(in srgb, var(--sky) 55%, transparent) 7px 14px); }
.pl-wd + .pl-wd { margin-top: 20px; }
.pl-wd-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px; margin: 0 0 4px; font-size: 15px; }
.pl-wd-head a { color: var(--ink); text-decoration: none; } .pl-wd-head a:hover { text-decoration: underline; }
.pl-wd.today .pl-wd-head a { color: var(--accent); } .pl-wd-head .pl-dh-today { margin: 0; }
.pl-wd-none { margin: 0; }
.pl-dv-time .pl-kind { display: inline-block; margin-top: 3px; color: var(--ink); font-size: 11px; }
@media (max-width: 760px) {
  .pl-wkgrid { display: none; } .pl-wkdays { display: block; }
  .pl-wkhead { flex-direction: column; } .pl-wktools { flex-direction: column-reverse; align-items: flex-start; }
  .pl-agenda > li { grid-template-columns: 4.6em minmax(0, 1fr); gap: 10px; }
  .pl-agenda .pl-wk-item { grid-template-columns: minmax(0, 1fr); }
  .pl-agenda .pl-links { grid-column: 1; grid-row: auto; justify-self: start; justify-content: flex-start; margin-top: 8px; }
  .pl-agenda .pl-teach { padding: 5px 12px; }
}
.pl-monthview table { display: table; width: 100%; min-width: 560px; table-layout: fixed; border-collapse: separate; border-spacing: 3px; font-size: 12px; }
.pl-monthview th { text-align: left; font-weight: 600; padding: 2px 6px; border: 0; }
.pl-monthview td { vertical-align: top; height: 88px; padding: 4px 5px; border: 0; border-radius: 8px; background: color-mix(in srgb, var(--muted) 6%, var(--card)); }
.pl-monthview td.pl-mo-none { background: none; }
.pl-monthview td.today { box-shadow: inset 0 0 0 2px var(--accent); }
.pl-monthview td.pl-wkoff { background: repeating-linear-gradient(135deg, transparent 0 6px, color-mix(in srgb, var(--sky) 70%, transparent) 6px 12px); }
.pl-mo-day { display: block; color: var(--ink); text-decoration: none; margin-bottom: 2px; } .pl-mo-day b { font-size: 13px; }
.pl-mo-day:hover b, .pl-mo-day:focus-visible b { text-decoration: underline; color: var(--accent); }
.pl-mo-items { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.pl-mo-items li { padding: 1px 5px; border-radius: 5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; line-height: 1.35; }
.pl-mo-items li b { font-weight: 600; } .pl-mo-items li.pl-clash { box-shadow: inset 0 0 0 1px var(--bad); }
.pl-mo-count { display: none; }
@media (max-width: 760px) { .pl-monthview table { min-width: 0; } .pl-monthview td { height: 58px; } .pl-mo-items { display: none; } .pl-mo-count { display: block; font-size: 10.5px; line-height: 1.2; } }
details.pl-slot-edit { margin-top: 4px; } details.pl-slot-edit > summary { cursor: pointer; color: var(--accent); }
details.pl-slot-edit form { margin-top: 8px; padding: 10px; border-radius: 10px; background: color-mix(in srgb, var(--muted) 6%, var(--card)); }
.pl-ttfile { margin-bottom: 4px; } .pl-ttfile .row { align-items: end; justify-content: flex-start; gap: 10px 14px; } .pl-ttfile input[type=file] { flex: 0 1 auto; font-size: 13.5px; max-width: 100%; }
.pl-file { flex: 1 1 320px; } .pl-file input[type=file] { display: block; margin-top: 6px; font-size: 13.5px; }
.pl-preview tr.pl-headrow td { background: color-mix(in srgb, var(--butter) 55%, transparent); font-weight: 600; }
.pl-slots td:first-child { min-width: 10em; } .pl-slots form.row { flex-wrap: nowrap; } .pl-slots form.row input[type=date] { min-width: 0; flex: 0 1 10em; }
details.panel > summary h2.inline { display: inline; margin: 0; }
@media (max-width: 560px) { .pl-acts, .pl-lessons, .pl-itemform { margin-left: 0; } .pl-plan td:last-child { white-space: normal; } }
.pl-check { display: inline-block; padding: 0 6px; border-radius: 99px; background: var(--rose); font-size: 11.5px; }
tr.pl-cancelled td:first-child, tr.pl-cancelled td:nth-child(2) { text-decoration: line-through; color: var(--muted); }
.pl-facts { display: grid; grid-template-columns: max-content 1fr; gap: 6px 14px; margin: 0 0 14px; font-size: 14px; }
.pl-facts dt { color: var(--muted); } .pl-facts dd { margin: 0; }
.pl-who { gap: 10px; align-items: center; margin-bottom: 14px; }
a.btn.ghost { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 1px var(--line); }

/* ---------- flex1 planner week to week (phase 4, 2026-11-20) ----------
   A lesson card says its state in words (Taught, Didn't finish, Not ticked, Lost: Trip, Extra), with
   a quiet "Mark" that opens Taught with a note, Didn't finish and Lost. The pace light is a dot in the
   deadline label, which always has its words. */
.pl-pace.p-ok::before, .pl-pace.p-amber::before, .pl-pace.p-red::before { content: ""; display: inline-block; width: 7px; height: 7px; margin-right: 5px; border-radius: 50%; vertical-align: 1px; }
.pl-pace.p-ok::before { background: var(--ok); } .pl-pace.p-amber::before { background: var(--warn); } .pl-pace.p-red::before { background: var(--bad); }
.pl-mk-row { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; margin-top: 5px; }
.pl-mk { display: inline-block; padding: 0 7px; border-radius: 99px; font-size: 11px; font-weight: 600; line-height: 1.7; white-space: nowrap; color: var(--ink); background: color-mix(in srgb, var(--card) 70%, transparent); }
.pl-mk.mk-taught { color: var(--ok); } .pl-mk.mk-carry { color: var(--warn); }
.pl-mk.mk-none { background: transparent; box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--muted) 45%, transparent); color: var(--muted); font-weight: 500; }
.pl-mk.mk-lost { color: var(--bad); } .pl-mk.mk-extra { color: var(--accent); }
details.pl-mark > summary { display: inline-block; cursor: pointer; list-style: none; font-size: 11.5px; font-weight: 600; color: var(--accent); }
details.pl-mark > summary::-webkit-details-marker { display: none; }
details.pl-mark > summary::after { content: " \25BE"; font-size: 10px; }
details.pl-mark[open] > summary::after { content: " \25B4"; }
details.pl-mark > summary:hover, details.pl-mark > summary:focus-visible { text-decoration: underline; outline: none; }
/* Mark in the top right corner of each lesson (2026-11-22): the summary is placed there, so a closed
   menu takes no line of its own; opened, the menu shows under the lesson, the full width of it. The
   lesson's first line leaves room for it, and the "Now" tag goes under the name instead. */
details.pl-mark > summary { position: absolute; top: 6px; right: 8px; line-height: 1.5; }
div.pl-wk-item > a:first-child > b, div.pl-wk-item > b:first-child { padding-right: 44px; }
div.pl-wk-item > .pl-nowtag { position: static; margin-top: 3px; }
.pl-agenda details.pl-mark > summary { top: 12px; right: 14px; font-size: 12.5px; }
.pl-agenda div.pl-wk-item > a:first-child > b, .pl-agenda div.pl-wk-item > b:first-child { padding-right: 58px; }
.pl-agenda .pl-wk-item > details.pl-mark[open] { grid-column: 1 / -1; justify-self: stretch; }
/* A lesson with nothing planned on the class page: no words, a light dashed card like "Free". */
.pl-agenda div.pl-wk-item.pl-wk-empty { min-height: 42px; background: transparent; box-shadow: none; border: 1px dashed var(--line); }
.pl-mark-menu { display: grid; gap: 8px; margin-top: 6px; padding: 9px; border-radius: 10px; background: var(--card); box-shadow: 0 1px 3px color-mix(in srgb, var(--ink) 14%, transparent); }
.pl-mark-menu form { display: grid; gap: 6px; margin: 0; }
.pl-mark-menu form + form { padding-top: 8px; border-top: 1px solid var(--line); }
.pl-mark-menu label { display: grid; gap: 3px; font-size: 11.5px; font-weight: 600; color: var(--muted); }
.pl-mark-menu input[type=text], .pl-mark-menu select { width: 100%; min-width: 0; padding: 5px 8px; font-size: 12.5px; border-radius: 8px; }
.pl-mark-menu button { padding: 5px 11px; font-size: 12px; }
.pl-mark-menu button.linkish { padding: 0 2px; }
.pl-mark-menu button[disabled] { opacity: .45; cursor: not-allowed; }
.pl-mark-btns { display: flex; flex-wrap: wrap; align-items: center; gap: 5px; }
.pl-mark-menu p { margin: 0; }
.pl-note { display: block; margin-top: 4px; font-size: 11.5px; font-style: italic; color: color-mix(in srgb, var(--ink) 72%, transparent); }
.pl-wk-item.pl-lost, div.pl-wk-item.pl-lost { background: transparent; box-shadow: inset 0 0 0 1px var(--line); color: var(--muted); }
.pl-wk-item.pl-lost b { color: var(--muted); text-decoration: line-through; }
.pl-tick { font-size: 11.5px; white-space: nowrap; } .pl-tick.t-taught { color: var(--ok); } .pl-tick.t-carry { color: var(--warn); }
.pl-tick.t-none { color: var(--muted); font-style: italic; } .pl-tick.t-extra { color: var(--accent); }
.pl-mo-items li.pl-mo-lost { color: var(--muted); text-decoration: line-through; }
.pl-agenda .pl-wk-item > .pl-mk-row { justify-self: stretch; }
.pl-agenda.pl-cl-lessons .pl-wk-item b { font-size: 14.5px; }
.pl-changes-forms { margin-top: 14px; } .pl-changes-forms h3 { margin: 0 0 4px; font-size: 15px; }
.pl-changes-forms form { padding: 12px; border-radius: 12px; background: color-mix(in srgb, var(--muted) 5%, var(--card)); }

/* ---------- Admin: folded sections and one-line lists (2026-11-19) ----------
   fold() in lib/admin.php: a panel that shows only its title and a hint until clicked open. */
details.fold { padding: 0; }
details.fold > summary { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 14px; padding: 16px 22px; cursor: pointer; list-style: none; border-radius: 18px; }
details.fold > summary::-webkit-details-marker { display: none; }
details.fold > summary::before { content: "\25B8"; color: var(--muted); font-size: 14px; width: 12px; flex: none; transition: transform .15s; }
details.fold[open] > summary::before { transform: rotate(90deg); }
details.fold > summary:hover { background: color-mix(in srgb, var(--lilac) 35%, transparent); }
details.fold > summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
details.fold > summary h2 { margin: 0; font-size: 18px; }
details.fold > summary .fold-hint { color: var(--muted); font-size: 13.5px; }
details.fold > .fold-body { padding: 0 22px 22px 48px; }
details.fold .fold-body > :first-child { margin-top: 0; }
/* A few folds side by side (the staff list's "Import a CSV" and "Add one address") */
.folds-row { display: grid; grid-template-columns: 1fr 1fr; gap: 0 18px; align-items: start; margin-top: 18px; }
.folds-row details.fold { background: var(--bg); margin-bottom: 12px; }
.folds-row details.fold > summary h2 { font-size: 15.5px; }
.folds-row details.fold > .fold-body { padding-left: 22px; }

/* One row per person: name and email on one line, chips, a time and Manage on the right */
table.oneline td { padding: 8px 10px; vertical-align: middle; }
table.oneline td.who { white-space: nowrap; max-width: 340px; overflow: hidden; text-overflow: ellipsis; }
table.oneline td.who small { margin-left: 2px; }
table.oneline td.when { white-space: nowrap; color: var(--muted); font-size: 13px; }
table.oneline .badge, table.oneline .chip { margin: 1px 4px 1px 0; }
.list-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 6px 16px; }
.list-head h2 { margin-bottom: 10px; }

/* The staff list: one line each; Manage opens the row's edit form under it */
.srows { border-top: 1px solid var(--line); }
details.srow { border-bottom: 1px solid var(--line); }
details.srow > summary { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1.4fr) minmax(0, 1fr) minmax(0, .9fr) auto;
  gap: 4px 14px; align-items: center; padding: 8px 10px; cursor: pointer; list-style: none; font-size: 14px; }
details.srow > summary::-webkit-details-marker { display: none; }
details.srow > summary:hover { background: color-mix(in srgb, var(--lilac) 30%, transparent); }
details.srow > summary > span { min-width: 0; }
details.srow > summary .who { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
details.srow > summary .btn-link::after { content: " \25BE"; }
details.srow[open] > summary { background: color-mix(in srgb, var(--lilac) 30%, transparent); }
details.srow[open] > summary .btn-link { background: var(--ink); color: var(--bg); border-color: var(--ink); }
details.srow.failed > summary { background: color-mix(in srgb, var(--rose) 45%, transparent); }
details.srow > form, details.srow > .srow-body { padding: 12px 10px 16px; display: grid; gap: 12px; }
details.srow > .srow-body > * { margin: 0; }
details.srow > form .actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.srows .srow-head { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1.4fr) minmax(0, 1fr) minmax(0, .9fr) auto;
  gap: 14px; padding: 8px 10px; font-size: 12.5px; font-weight: 600; color: var(--muted); }
.srows .srow-head span:last-child { width: 86px; }

@media (max-width: 820px) {
  details.fold > summary { padding: 14px 16px; }
  details.fold > .fold-body { padding: 0 16px 18px; }
  .folds-row { grid-template-columns: 1fr; }
  table.oneline td.who { white-space: normal; max-width: none; }
  details.srow > summary { grid-template-columns: 1fr auto; }
  details.srow > summary > span:nth-child(2), details.srow > summary > span:nth-child(3), details.srow > summary > span:nth-child(4) { grid-column: 1; }
  details.srow > summary > .btn-link { grid-column: 2; grid-row: 1; }
  .srows .srow-head { display: none; }
}

/* ">flex1 campus" in running text (campus_mark() in lib/home.php, 2026-11-21): the chevron in the
   logo's green, "flex1" bold, as in the logo. */
.f1-mark { white-space: nowrap; }
.f1-mark .gt { color: #2f6b55; font-weight: 800; margin-right: .05em; }
.f1-mark .fx { font-weight: 750; letter-spacing: -.02em; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .f1-mark .gt { color: #9fdcbf; } }
:root[data-theme="dark"] .f1-mark .gt { color: #9fdcbf; }

/* Settings: the Subject list and "or a new subject" side by side (2026-11-21). */
.subject-pick { display: flex; flex-wrap: wrap; gap: 0 14px; align-items: flex-start; }
.subject-pick > label { flex: 1 1 200px; }

/* Settings > Classroom layouts (2026-11-21): a card per saved room, with its picture (light, like the
   classroom drawing in flex1 seats, in dark mode too). */
.layout-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; margin-top: 10px; }
.layout-card { border: 1px solid var(--line, #e6e3dc); border-radius: 12px; padding: 10px; }
.layout-card .layout-thumb { display: block; width: 100%; height: auto; margin-bottom: 6px; border-radius: 8px; }

/* KS3 login cards (docs/KS3-ONLINE-SPEC.md 2.3, 2026-11-22): 8 to an A4 page, with dashed edges to cut
   along. On screen they follow the theme; on paper they are black on white. */
.ks3-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 14px; margin-top: 18px; }
.ks3-card { border: 1.5px dashed var(--line); border-radius: 12px; padding: 14px 16px; background: var(--card); break-inside: avoid; }
.ks3-card .kc-name { font-weight: 700; font-size: 1.1rem; margin: 0; }
.ks3-card .kc-class { color: var(--muted); margin: 2px 0 0; font-size: .9rem; }
.ks3-card dl { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; margin: 12px 0 8px; }
.ks3-card dt { color: var(--muted); font-size: .9rem; }
.ks3-card dd { margin: 0; }
.ks3-card .kc-code { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: 1.15rem; font-weight: 700; letter-spacing: .04em; }
.ks3-card .kc-foot { color: var(--muted); font-size: .8rem; margin: 0; }
@media print {
  .ks3-cards-page .no-print, .ks3-cards-page .top, .ks3-cards-page .foot { display: none; }
  .ks3-cards-page { background: #fff; color: #000; }
  .ks3-cards-page .wrap { max-width: none; padding: 0; margin: 0; }
  .ks3-cards { grid-template-columns: 1fr 1fr; gap: 0; margin: 0; }
  .ks3-card { height: 66mm; border: 1px dashed #888; border-radius: 0; background: #fff; color: #000; padding: 8mm 9mm; box-sizing: border-box; }
  .ks3-card .kc-class, .ks3-card dt, .ks3-card .kc-foot { color: #444; }
  @page { size: A4; margin: 12mm; }
}

/* ---------- class pages in flex1 teach (docs/CLASS-PAGES-SPEC.md, phase C1) ---------- */
.ccards .ccard { min-height: 150px; padding-bottom: 46px; }
.ccard .code { font-size: 28px; }
.ccard .cc-now, .ccard .cc-next { display: block; font-size: 13.5px; margin-top: 8px; color: color-mix(in srgb, var(--ink) 80%, transparent); }
.ccard .cc-next { margin-top: 2px; font-size: 13px; }
.ccard .cc-mark { position: absolute; left: 22px; bottom: 16px; }
.cc-mark { background: var(--butter); color: var(--warn); font-weight: 600; }
.subtabs .cc-mark { margin-left: 4px; font-size: 11px; padding: 1px 7px; }
.cp-next { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 12px 16px; margin: -10px 0 22px; font-size: 14.5px; display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: center; }
h2.cp-course, h2.cc-row { margin: 26px 0 10px; color: var(--muted); font-size: 13px; letter-spacing: .04em; text-transform: uppercase; }
h2.cc-row:first-of-type { margin-top: 8px; }
details.cunit { padding: 16px 20px; margin-bottom: 12px; }
details.cunit > summary { cursor: pointer; display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: center; }
details.cunit > summary::-webkit-details-marker { display: none; }
details.cunit > summary::before { content: '\25B8'; color: var(--muted); font-size: 12px; width: 10px; }
details.cunit[open] > summary::before { content: '\25BE'; }
details.cunit > summary .chip { margin: 0; }
.lrows { list-style: none; padding: 0; margin: 12px 0 0; }
.lrows li { display: grid; grid-template-columns: 1fr auto; gap: 4px 14px; align-items: center; padding: 10px 0; border-top: 1px solid var(--line); font-size: 14px; }
.lrows .lr-acts { display: flex; gap: 14px; font-size: 13.5px; white-space: nowrap; }
.lrows .lr-state, .lrows .lr-set { grid-column: 1 / -1; color: var(--muted); }
.lrows .lr-set input[type=date] { flex: 0 1 11em; min-width: 0; padding: 5px 8px; }
.cu-foot { display: flex; flex-wrap: wrap; gap: 10px 18px; align-items: center; justify-content: space-between; border-top: 1px solid var(--line); padding-top: 12px; margin-top: 4px; }
.cu-switches .check { font-size: 13.5px; }
.cu-switches input[type=checkbox] { flex: none; min-width: 0; width: auto; }     /* not stretched like the .row text boxes */
/* A unit's worksheet and mark scheme as two icons in its title row (2026-11-23): filled pastel when shared,
   a faint outline when not (the words are in the hover text and for screen readers) */
.cu-ics { margin-left: auto; display: inline-flex; gap: 6px; }
.cu-ic { display: inline-flex; width: 28px; height: 28px; align-items: center; justify-content: center; border-radius: 8px; }
.cu-ic.on { background: var(--lilac); color: var(--accent, #6f63a8); --ic-fill: var(--card); }
.cu-ic.off { color: var(--muted); opacity: .45; --ic-fill: none; }
.cu-taught { color: var(--ok, #3f8a64); font-weight: 600; }
.cu-who { margin: 10px 0 0; }
.lrows .lr-taught { color: var(--muted); font-size: 12.5px; }
details.cunit.cu-done > summary b { color: var(--muted); }
/* The folded group of units the class has finished, at the bottom of its course */
details.cp-taught { margin: 6px 0 12px; }
details.cp-taught > summary { cursor: pointer; color: var(--muted); font-size: 14px; font-weight: 600; padding: 6px 0; }
details.cp-taught[open] > summary { margin-bottom: 8px; }
.cp-table-wrap { overflow-x: auto; }
.cp-work td:first-child { min-width: 14em; }
.cp-work th, .cp-work td:not(:first-child) { white-space: nowrap; }
tr.muted td { color: var(--muted); }
/* The class markbook (teach/class.php, Markbook tab, 2026-11-26): the colours of the lesson grid (work.css .wgrid) */
.mbook { border-collapse: collapse; font-size: 14px; }
.mbook th, .mbook td { padding: 5px 8px; border-bottom: 1px solid var(--line); text-align: center; white-space: nowrap; }
.mbook th:first-child, .mbook td:first-child { text-align: left; position: sticky; left: 0; background: var(--card, var(--paper, #fff)); }
.mbook thead th { font-size: 12.5px; vertical-align: bottom; }
.mbook td a { color: inherit; text-decoration: none; }
.mbook td a:hover { text-decoration: underline; }
.mbook .c-full { background: var(--mint); }
.mbook .c-part { background: var(--butter); }
.mbook .c-zero { background: var(--rose); }
.mbook .c-none { color: var(--muted); }
.mbook .mb-missing { color: var(--ink, inherit); font-weight: 600; }
.mbook sup { color: var(--muted); font-size: 11px; }
.mbook tfoot th { border-top: 2px solid var(--line); }
.mbook th.mb-unit { white-space: normal; min-width: 6em; border-left: 2px solid var(--line); }
@media (max-width: 560px) {
  .lrows li { grid-template-columns: 1fr; }
  .lrows .lr-acts { white-space: normal; flex-wrap: wrap; }
}

/* flex1 teach > a workbook task: Check in class (docs/CLASS-PAGES-SPEC.md 6.3, phase C5) */
.tk-list { list-style: none; padding: 0; margin: 0; }
.tk-list li { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px 14px; padding: 10px 0; border-top: 1px solid var(--line); }
.tk-acts { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.tk-acts form { margin: 0; }
.chip.ok { background: var(--mint); color: var(--ink); }
