/* ---------------------------------------------------------------------------------------------
 * Workspace layout and controls shared by every screen. Colours always come from the theme
 * variables set in operations.css (the portal's own light theme); nothing here picks a new colour.
 * Sizes: buttons 44px, tablet 48px, projector and emergency 64px. One primary button per area.
 * ------------------------------------------------------------------------------------------- */
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
:focus-visible { outline: 3px solid var(--brass); outline-offset: 2px; }

/* buttons: 44px high, 12px radius, six states */
.button { min-height: 44px; border-radius: 12px; padding: .5rem .95rem; font-size: .82rem; }
.button.small { min-height: 44px; font-size: .76rem; padding-inline: .7rem; }
.button:hover:not(:disabled) { filter: brightness(1.12); }
.button:active:not(:disabled) { filter: brightness(.92); transform: translateY(1px); }
.button:disabled { opacity: .55; cursor: not-allowed; }
.button.danger { background: var(--danger-tint); color: var(--danger-text); border-color: var(--danger-text); }
.button.danger.hold { background: var(--danger-text); color: #fff; }
@media (pointer: coarse) { .button, .button.small { min-height: 48px; } }
.inline-actions, .page-actions { gap: .6rem; }

/* sidebar groups */
.nav-group { margin-bottom: .55rem; }
.nav-group > .nav-item { margin-top: .25rem; }
.nav-heading { display: flex; align-items: center; justify-content: space-between; min-height: 44px; margin: .1rem 0; padding: 0 .62rem; font-size: .68rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--rail-heading); cursor: pointer; list-style: none; border-radius: .55rem; }
.nav-heading::-webkit-details-marker { display: none; }
.nav-heading::after { content: ""; width: .5rem; height: .5rem; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(45deg); transition: transform .15s; margin-right: .2rem; }
details.nav-group[open] > .nav-heading::after { transform: rotate(-135deg); }
.nav-heading:hover { background: var(--rail-raised); }
@media (prefers-reduced-motion: reduce) { .nav-heading::after { transition: none; } }
.shell { grid-template-columns: 248px minmax(0, 1fr); }
.nav-item { min-height: 44px; }

/* chips: icon and words, never colour alone */
.chip { display: inline-flex; align-items: center; gap: .3rem; min-height: 28px; padding: .1rem .6rem .1rem .45rem; border-radius: 99px; font-size: .72rem; font-weight: 700; background: var(--soft); color: var(--muted); }
.chip svg { width: .95rem; height: .95rem; flex: 0 0 auto; }
.chip.ok { background: var(--ok-tint); color: var(--ok-text); }
.chip.info { background: var(--ok-tint); color: var(--ok-text); }
.chip.warning { background: var(--warning-tint); color: var(--warning-text); }
.chip.danger { background: var(--danger-tint); color: var(--danger-text); }
.chip-row { display: inline-flex; flex-wrap: wrap; gap: .35rem; }
/* A field and its button on one line, wrapping on narrow screens (late arrivals desk entry, 20 Nov 2026). */
.inline-form { display: flex; flex-wrap: wrap; align-items: flex-end; gap: .6rem; }
.inline-form label { flex: 1 1 14rem; }

/* empty state */
.empty-state { max-width: 560px; margin: 1.2rem auto; padding: 1.6rem 1.5rem; text-align: center; border: 1px dashed var(--border); border-radius: 16px; background: var(--surface); }
.empty-state h2 { margin: 0 0 .4rem; font-size: 1.1rem; }
.empty-state p { margin: 0 0 1rem; color: var(--muted); font-size: .85rem; }
.empty-state .inline-actions { justify-content: center; }

/* search */
.search-box { display: block; min-width: min(100%, 18rem); }
.search-box input { width: 100%; min-height: 44px; border: 1px solid var(--border); border-radius: 12px; padding: .5rem .8rem; background: var(--surface); color: var(--text); }

/* stat tiles */
.stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(10.5rem, 1fr)); gap: .8rem; margin-bottom: .9rem; }
.stat-tile { background: var(--surface); border: 1px solid var(--border); border-left: 4px solid var(--border); border-radius: 12px; padding: .75rem .9rem; display: grid; gap: .1rem; }
.stat-tile.info { border-left-color: var(--ok-fill); }
.stat-tile.warning { border-left-color: var(--warning-text); }
.stat-tile.danger { border-left-color: var(--danger-text); }
.stat-label { color: var(--muted); font-size: .72rem; font-weight: 700; }
.stat-value { font-size: 1.9rem; line-height: 1.1; letter-spacing: -.04em; }
.stat-hint { color: var(--muted); font-size: .7rem; }

/* status line */
.feedback.warning { color: var(--warning-text); }
.feedback.danger { color: var(--danger-text); }

/* hold-to-confirm */
.button.hold { position: relative; overflow: hidden; min-height: 56px; min-width: 12rem; font-size: .95rem; user-select: none; touch-action: none; }
.hold-fill { position: absolute; inset: 0 auto 0 0; width: 0; background: #ffffff55; transition-property: width; transition-timing-function: linear; }
.hold-label { position: relative; }
.confirm-inline { display: inline-flex; gap: .4rem; flex-wrap: wrap; }

/* registers */
.data-table td, .data-table th { padding-block: .72rem; }
.data-table tbody tr:hover { background: var(--soft); }
.data-table th { position: sticky; top: 0; }
.split-view { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 400px); gap: .9rem; align-items: start; }
.detail-pane { position: sticky; top: 1rem; }
@media (max-width: 1100px) { .split-view { grid-template-columns: 1fr; } .detail-pane { position: static; } }

/* import wizard */
.wizard-steps { display: flex; gap: .5rem; padding: 0; margin: .6rem 0 1rem; list-style: none; flex-wrap: wrap; }
.wizard-steps li { padding: .25rem .7rem; border-radius: 99px; background: var(--soft); color: var(--muted); font-size: .72rem; font-weight: 700; }
.wizard-steps li.current { background: var(--primary); color: var(--on-primary); }
.wizard-steps li.done { background: var(--ok-tint); color: var(--ok-text); }
.wizard-summary, .wizard-errors { margin: .4rem 0 .8rem; padding-left: 1.2rem; font-size: .82rem; }
.wizard-errors { color: var(--danger-text); }
.wizard-body { display: grid; gap: .8rem; }

/* projector and display mode: large type, nothing to click */
body.projector { font-size: 24px; }
body.projector .sidebar, body.projector .topbar { display: none; }
body.projector .shell { display: block; }
body.projector main { max-width: none; padding: 1.5rem 2rem; }
body.projector .button { min-height: 64px; font-size: 1.1rem; }
.fire-banner { background: var(--emergency); color: var(--on-emergency); min-height: 96px; display: flex; align-items: center; justify-content: center; gap: 1rem; padding: 1rem 2rem; font-size: 2.2rem; font-weight: 800; letter-spacing: -.02em; border-radius: 12px; }
.fire-banner small { font-size: 1.1rem; font-weight: 600; opacity: .95; }
.fire-banner.practice { background: var(--warning-solid); }

@media (prefers-reduced-motion: reduce) { * { transition-duration: 0ms !important; animation-duration: 0ms !important; } }

.palette{position:fixed;inset:0;background:rgba(14,22,48,.45);display:flex;flex-direction:column;align-items:center;padding-top:15vh;z-index:50}
.palette input{width:min(560px,92vw);min-height:48px;border-radius:12px 12px 0 0;border:1px solid var(--line,#dde3ee);padding:0 16px;font-size:1rem}
.palette ul{list-style:none;margin:0;padding:0;width:min(560px,92vw);max-height:50vh;overflow:auto;background:#fff;border:1px solid var(--line,#dde3ee);border-top:0;border-radius:0 0 12px 12px}
.palette li{padding:0}
.palette li a,.palette li:not(:has(a)){display:block;min-height:44px;padding:12px 16px;color:inherit;text-decoration:none}
.palette li[aria-selected="true"]{background:#e8eeff}

.fleet-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(12rem, 17rem); gap: 1rem; align-items: start; }
.fleet-layout.without-map { grid-template-columns: minmax(0, 1fr); }
.fleet-map { min-height: clamp(22rem, 64vh, 42rem); border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
@media (max-width: 900px) { .fleet-layout { grid-template-columns: minmax(0, 1fr); } }
.legend-row {
  display: grid; grid-template-columns: auto minmax(0, 1fr); gap: .35rem .55rem; align-items: center;
  width: 100%; min-height: 44px; text-align: left; background: var(--surface); color: var(--text);
  border: 1px solid var(--border); border-radius: 8px; padding: .65rem .75rem;
}
button.legend-row { cursor: pointer; }
button.legend-row:hover { background: var(--soft); }
.legend-row > strong { overflow-wrap: anywhere; }
.legend-row > :is(.chip, small) { grid-column: 2; justify-self: start; }
.legend-dot { width: .6rem; height: .6rem; border-radius: 50%; }
.fleet-setup-row { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: .5rem; padding-block: .5rem; }
.fleet-setup-row + .fleet-setup-row { border-top: 1px solid var(--border); }
.fleet-setup-row p { margin: 0; }
.class-filters { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 13rem), 1fr)); gap: 1rem; }
.roll-editor { padding-bottom: 2rem; }
.roll-student { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: .7rem; }
.roll-student-name { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.roll-student .chip-row { flex-shrink: 0; }
.checklist{list-style:none;margin:0;padding:0;display:grid;gap:8px}
.fire-banner small{margin-left:auto}

/* dashboard dropdowns */
.area-menu { display: grid; gap: .5rem; }
.area { border: 1px solid var(--border); border-radius: 12px; background: var(--surface); }
.area > summary { display: flex; align-items: center; justify-content: space-between; min-height: 44px; padding: 0 .9rem; font-weight: 700; cursor: pointer; list-style: none; color: var(--text); }
.area > summary::-webkit-details-marker { display: none; }
.area > summary::after { content: ""; width: .5rem; height: .5rem; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(45deg); }
.area[open] > summary::after { transform: rotate(-135deg); }
.area .chip-row { padding: .2rem .9rem .9rem; }

/* Locked (unpaid) modules: still in the menu, clearly marked, never colour alone. */
/* On the navy menu a locked item is a paler blue-white (#C7D3EE on #0A1A4F is 11.2:1); the "Locked" chip carries the meaning. */
.nav-item.locked { color: #c7d3ee; }
html[data-theme="dark"] .nav-item.locked { color: var(--rail-muted); }
.nav-item .nav-lock { margin-left: auto; font-size: 0.75rem; padding: 2px 8px; border-radius: 999px; background: #EEF1F6; color: #4A5468; border: 1px solid #DDE3EE; }

/* ---------------------------------------------------------------------------------------------
 * 2026 look, asked for by RJL on 16 Nov 2026: navy side menu with bright text, headings that stand
 * out, sharper corners and visible depth. Applies to every screen because every screen is built
 * from the same parts (page head, panel, button, table, chip). The sign-in screens keep their own
 * approved theme: nothing below applies while body has the class signin-mode.
 *
 * Sources for the choices: fixed left menu with collapsible groups and tabular numerals
 * (adminlte.io/blog/admin-dashboard-design, read 16 Nov 2026); 44px targets and visible focus
 * (WCAG 2.2, 2.5.8 and 2.4.7). Fixed colours used here are contrast-tested in test/contrast.test.ts.
 *
 * Font: all text stays Zing Sans Rust. The file we hold is the demo cut with one light weight, and
 * faked bold is switched off, so headings are made to stand out by size, colour, an orange rule
 * and a tinted heading strip, not by weight.
 * ------------------------------------------------------------------------------------------- */
body { font-variant-numeric: tabular-nums; }

/* side menu: depth, white text, bright active row with an orange edge */
html:not([data-theme="dark"]) .sidebar {
  background: linear-gradient(180deg, #0d2247 0%, #071530 45%, #040c1f 100%);
  border-right: 0; box-shadow: 6px 0 28px #06103a4d; z-index: 2;
}
.sidebar :focus-visible { outline-color: #ffffff; }
.sidebar .nav-item { border-radius: 6px; font-size: .84rem; }
.sidebar .nav-heading { border-radius: 6px; font-size: .72rem; }
.sidebar .nav-group { border-top: 1px solid var(--rail-line); padding-top: .35rem; }
.sidebar .nav-item[aria-current="page"] { border-width: 2px; box-shadow: inset 4px 0 0 var(--rail-accent), 0 0 18px #ff7a0040, 0 6px 14px #00000059; }
.sidebar .nav-item[aria-current="page"] svg { color: var(--rail-accent); }
.sidebar .brand-card { border-radius: 0; box-shadow: 0 8px 18px #00000047; }
.sidebar .side-footer { color: var(--rail-heading); }

/* page title: larger, navy, with an orange rule under it */
body:not(.signin-mode) .page-head h1 { font-size: clamp(2rem, 3.2vw, 2.8rem); letter-spacing: -.03em; }
body:not(.signin-mode) .page-head h1::after {
  content: ""; display: block; width: 72px; height: 5px; margin-top: .55rem; border-radius: 3px; background: var(--accent);
}
body:not(.signin-mode) .page-head p { font-size: .9rem; }

/* cards: sharper corners, raised, with the heading in its own tinted strip */
body:not(.signin-mode) .panel {
  --panel-x: 1.2rem; --panel-y: 1.1rem;
  padding: var(--panel-y) var(--panel-x); border-radius: 8px; border-color: color-mix(in srgb, var(--text) 22%, var(--surface));
  box-shadow: 0 1px 2px color-mix(in srgb, var(--text) 8%, transparent), 0 10px 28px color-mix(in srgb, var(--text) 12%, transparent);
}
html:not([data-theme="dark"]) body:not(.signin-mode) .panel { border-radius: 8px; }
body:not(.signin-mode) .panel > .panel-head {
  margin: calc(-1 * var(--panel-y)) calc(-1 * var(--panel-x)) .95rem; padding: .7rem var(--panel-x);
  border-bottom: 2px solid var(--primary); border-radius: 7px 7px 0 0;
  background: linear-gradient(180deg, color-mix(in srgb, var(--primary) 4%, var(--surface)), color-mix(in srgb, var(--primary) 12%, var(--surface)));
}
/* Light theme: a clear blue tint (not grey) so the strip reads as part of the brand. Navy #0A1A4F on #E1E9FF is 13.9:1. */
html:not([data-theme="dark"]) body:not(.signin-mode) .panel > .panel-head { background: linear-gradient(180deg, #f4f7ff, #e1e9ff); }
body:not(.signin-mode) .panel > .panel-head h2 { font-size: 1.25rem; letter-spacing: -.01em; }
body:not(.signin-mode) .panel h2 { font-size: 1.25rem; }
@media (max-width: 720px) { body:not(.signin-mode) .panel { --panel-x: .77rem; --panel-y: .85rem; } }

/* buttons, fields and tiles: sharper corners; buttons are raised and settle when pressed */
body:not(.signin-mode) .button {
  border-radius: 6px;
  box-shadow: inset 0 1px 0 #ffffff38, 0 2px 0 color-mix(in srgb, var(--text) 28%, transparent), 0 8px 16px color-mix(in srgb, var(--text) 16%, transparent);
  transition: transform .15s ease-out, box-shadow .15s ease-out;
}
body:not(.signin-mode) .button:hover:not(:disabled) { transform: translateY(-1px); }
body:not(.signin-mode) .button:active:not(:disabled) { transform: translateY(1px); box-shadow: inset 0 1px 0 #ffffff38, 0 1px 0 color-mix(in srgb, var(--text) 28%, transparent); }
body:not(.signin-mode) .button:disabled { box-shadow: none; }
body:not(.signin-mode) :is(.field input, .field select, .picker select, .field textarea, .search-box input) { border-radius: 6px; box-shadow: inset 0 2px 4px color-mix(in srgb, var(--text) 6%, transparent); }
body:not(.signin-mode) :is(.stat-tile, .empty-state, .area, .legend-row, .form-dialog, .wx-week li) { border-radius: 8px; }
body:not(.signin-mode) :is(.stat-tile, .area) { box-shadow: 0 6px 16px color-mix(in srgb, var(--text) 9%, transparent); }
body:not(.signin-mode) .stat-value { color: var(--primary); }

/* top strip and bar: squared tiles, a soft shadow so the bar sits above the page */
.ts-state, .ts-pill, .ts-weather, .ts-user, .ts-fire { border-radius: 8px; }
.top-strip small { text-transform: uppercase; letter-spacing: .06em; color: var(--brass); }
.ts-fire small { color: #fff; }
.topbar { box-shadow: 0 4px 14px color-mix(in srgb, var(--text) 7%, transparent); position: relative; z-index: 1; }

/* tables: column headings read as headings */
body:not(.signin-mode) .data-table th { text-transform: uppercase; letter-spacing: .06em; color: var(--primary); border-bottom: 2px solid var(--primary); }

/* phone width: menu groups stack one per row so headings and their screens never sit side by side */
@media (max-width: 720px) {
  .sidebar nav { display: grid; gap: .15rem; }
  .sidebar .nav-group { margin-bottom: 0; }
  .sidebar .brand-card { max-width: 15rem; margin: 0; border-radius: 8px; }
}

/* ---------------------------------------------------------------------------------------------
 * Bold, vivid pass (RJL, 16 Nov 2026): the side menu follows the Magic Keys Balwyn portal menu
 * (deep navy, bold white items, orange outline on the current screen), and the portal font is
 * Montserrat so weight can do the work the single-weight Zing Sans Rust demo cut could not.
 * ------------------------------------------------------------------------------------------- */
.sidebar .nav-item { font-weight: 600; font-size: .88rem; letter-spacing: 0; }
.sidebar .nav-item[aria-current="page"] { font-weight: 700; }
.sidebar .nav-heading { font-weight: 800; letter-spacing: .14em; }
.sidebar .side-footer { font-weight: 600; }
body:not(.signin-mode) .page-head h1 { font-weight: 800; letter-spacing: -.02em; }
body:not(.signin-mode) .page-head p { font-weight: 500; }
body:not(.signin-mode) :is(.panel h2, .panel-head h2, .empty-state h2) { font-weight: 800; }
body:not(.signin-mode) .panel-head h3 { font-weight: 700; }
html:not([data-theme="dark"]) body:not(.signin-mode) .panel > .panel-head { background: linear-gradient(180deg, #e9efff, #cfdcff); border-bottom-width: 3px; }
/* primary buttons: a vivid blue-to-navy face. White on the lightest stop #1d3fb8 is 9.1:1. */
html:not([data-theme="dark"]) body:not(.signin-mode) .button:not(.secondary):not(.danger) { background: linear-gradient(180deg, #1d3fb8, #0a1a4f); }
body:not(.signin-mode) .button { font-weight: 700; }
body:not(.signin-mode) .data-table th { font-weight: 800; }
body:not(.signin-mode) .data-table td:first-child { font-weight: 600; }
body:not(.signin-mode) .stat-label { font-weight: 700; text-transform: uppercase; letter-spacing: .05em; }
body:not(.signin-mode) .stat-value { font-weight: 800; }
body:not(.signin-mode) .stat-tile { border-top: 3px solid var(--brass); }

/* Gate access control on the Today page: each door is a large raised key you press, so it reads as a physical control. */
.gate-doors { gap: .8rem; padding: .2rem 0 .3rem; }
body:not(.signin-mode) .gate-doors .button {
  min-height: 64px; min-width: 12rem; padding: .7rem 1.3rem; font-size: 1rem; border-radius: 8px;
  box-shadow: inset 0 1px 0 #ffffff59, inset 0 -3px 0 #00000040, 0 5px 0 #06103a, 0 14px 24px color-mix(in srgb, var(--text) 28%, transparent);
}
body:not(.signin-mode) .gate-doors .button:hover:not(:disabled) { transform: translateY(-2px); }
body:not(.signin-mode) .gate-doors .button:active:not(:disabled) { transform: translateY(4px); box-shadow: inset 0 1px 0 #ffffff59, 0 1px 0 #06103a; }

/* ---------------------------------------------------------------------------------------------
 * Sharp navy-and-orange pass (RJL, 17 Nov 2026): "no baby blue, modern and sharp, the Balwyn font".
 * Card headings sit on a solid navy strip with an orange rule; pale-blue tints are gone from the
 * light theme. Font is Zing Sans Rust, the Balwyn portal font (set as --ui-font in operations.css).
 * Contrast, worked out with the WCAG formula: white on navy #0A1A4F 16.5:1; white on the orange
 * button face (lightest stop #C2410C) 5.2:1; navy on the pale orange #FFE9DC 14.1:1. Orange #E8501F is used for
 * rules and edges only, never behind small text.
 * ------------------------------------------------------------------------------------------- */
html:not([data-theme="dark"]) body:not(.signin-mode) .panel { border-radius: 4px; border-color: #0a1a4f33; }
html:not([data-theme="dark"]) body:not(.signin-mode) .panel > .panel-head {
  background: #0a1a4f; border-bottom: 3px solid var(--accent); border-radius: 3px 3px 0 0;
}
html:not([data-theme="dark"]) body:not(.signin-mode) .panel > .panel-head :is(h2, h3, p, small, .message) { color: #fff; }
/* A main button on the navy strip takes the orange face so it stands off the strip. */
body:not(.signin-mode) .button { border-radius: 4px; }
body:not(.signin-mode) :is(.stat-tile, .empty-state, .area, .legend-row, .form-dialog, .wx-week li) { border-radius: 4px; }
body:not(.signin-mode) .stat-tile { border-top-color: var(--accent); }
html:not([data-theme="dark"]) .palette li[aria-selected="true"] { background: #e8edff; }
html:not([data-theme="dark"]) .ts-avatar { background: #0a1a4f; color: #fff; }
html:not([data-theme="dark"]) .top-strip small { color: #4a5468; }
html:not([data-theme="dark"]) .ts-fire small { color: #fff; }

/* Moving 3D gate pictures (gate-tiles.js). The navy studio backdrop shows through the see-through 3D canvas. */
.gate-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr)); gap: 1rem; align-items: start; }
.gate-card { display: grid; gap: .6rem; }
.gate-card .button { width: 100%; }
.gate-fire { margin-bottom: 1rem; max-width: 34rem; }
.gate-fire .gate-name, .gate-fire .message { margin: 0; }
.gate-card .gate-name { margin: 0; display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; }
.gate-card .message { margin: 0; }
.gate-card .confirm-inline { display: grid; gap: .4rem; }
/* Light studio for the 3D gates (RJL, 20 Nov 2026: "light background"). */
.gate3d { margin: 0; border: 1px solid #d5dde8; border-radius: 4px; overflow: hidden; background: #fff; box-shadow: 0 10px 24px #0a1a4f1f; }
.gate3d-stage { position: relative; aspect-ratio: 4 / 3; background: radial-gradient(ellipse at 50% 58%, #ffffff 0%, #f1f5fa 45%, #dfe6ef 100%); }
.gate3d-stage canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.gate3d figcaption { padding: .5rem .7rem; border-top: 3px solid var(--accent); background: #fff; color: #0a1a4f; font-size: .8rem; font-weight: 700; }
/* No 3D available: a plain labelled box, so the caption still says which gate type it is. */
.gate3d.no-3d .gate3d-stage { aspect-ratio: 8 / 1; }

/* Today graphs (today-charts.js): attendance, and replies to the absence text. */
/* Boxes sit side by side, three across on a wide screen, and never stretch one box over the whole page. */
.today-graphs { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 19rem), 1fr)); gap: 1rem; align-items: start; }
.today-graphs.wide-first { grid-template-columns: repeat(auto-fit, minmax(min(100%, 24rem), 1fr)); }
.today-graphs > .panel { min-width: 0; }
/* In a small box the pie sits above its legend, and tables scroll inside the box instead of widening it. */
.today-graphs .pie-body { grid-template-columns: 1fr; justify-items: center; }
.today-graphs .pie-svg { max-width: 13rem; }
.today-graphs .pie-legend { width: 100%; }
.today-graphs .table-wrap, .today-graphs table { max-width: 100%; }
.today-graphs > .panel { overflow-x: auto; }
.bar-chart-summary { margin: 0 0 .7rem; font-weight: 600; }
.bar-chart-rows { display: grid; grid-template-columns: minmax(9rem, max-content) 1fr; gap: .55rem .9rem; margin: 0; align-items: center; }
.bar-chart-rows dt { font-weight: 700; }
.bar-chart-rows dd { display: grid; grid-template-columns: 1fr 3rem 3rem; gap: .6rem; align-items: center; margin: 0; }
.bar-chart-rows dd strong { text-align: right; font-size: 1.1rem; color: #0a1a4f; }
.bar-share { color: #4a5468; font-size: .85rem; text-align: right; }
.bar { width: 100%; height: 14px; display: block; }
.bar-track { fill: #e6e9f0; }
.bar-fill { fill: #4a5468; }
.bar-fill.ok { fill: #0a1a4f; }
.bar-fill.warning { fill: var(--warning-fill); }
.bar-fill.danger { fill: var(--danger-fill); }
@media (max-width: 720px) { .bar-chart-rows { grid-template-columns: 1fr; } }

/* ---- Floating cards (RJL, 18 Nov 2026, after the analytics dashboard he picked) ----
 * Every panel and number card floats: white, 12px corners, a hairline edge and a soft shadow on the light grey
 * page, with a plain bold heading instead of the tinted strip. Light theme only; dark mode keeps its own look. */
html:not([data-theme="dark"]) body:not(.signin-mode) .panel {
  border-radius: 12px; border-color: #e3e8f1;
  box-shadow: 0 1px 2px rgba(14, 22, 48, .05), 0 8px 24px rgba(14, 22, 48, .07);
}
html:not([data-theme="dark"]) body:not(.signin-mode) .panel > .panel-head {
  background: #fff; border-bottom: 1px solid #eef1f6; border-radius: 12px 12px 0 0; margin-bottom: .8rem;
}
/* Same selector shape as the navy-strip rule above (its :is() counts as a class), so this later rule wins. */
html:not([data-theme="dark"]) body:not(.signin-mode) .panel > .panel-head :is(h2, h3, p, small, .message) { color: #0e1630; }
html:not([data-theme="dark"]) body:not(.signin-mode) .panel > .panel-head h2 { font-size: 1.05rem; letter-spacing: 0; }
html:not([data-theme="dark"]) body:not(.signin-mode) .stat-tile {
  border-radius: 12px; border: 1px solid #e3e8f1; border-top: 1px solid #e3e8f1; border-left: 4px solid #c9d1e0;
  box-shadow: 0 1px 2px rgba(14, 22, 48, .05), 0 8px 24px rgba(14, 22, 48, .07); padding: 1rem 1.1rem;
}
html:not([data-theme="dark"]) body:not(.signin-mode) .stat-tile.ok { border-left-color: var(--ok-text); }
html:not([data-theme="dark"]) body:not(.signin-mode) .stat-tile.warning { border-left-color: var(--warning-fill); }
html:not([data-theme="dark"]) body:not(.signin-mode) .stat-tile.danger { border-left-color: var(--danger-fill); }
body:not(.signin-mode) .stat-tile .stat-value { font-size: 2rem; line-height: 1.1; }

/* Tabs under the page title: a floating pill bar. */
.dash-tabs { display: flex; flex-wrap: wrap; gap: .35rem; padding: .35rem; background: var(--surface); border: 1px solid #e3e8f1; border-radius: 12px;
  box-shadow: 0 1px 2px rgba(14, 22, 48, .05), 0 8px 24px rgba(14, 22, 48, .07); width: fit-content; max-width: 100%; }
.dash-tab { min-height: 40px; padding: 0 1rem; border: 0; border-radius: 9px; background: transparent; font: inherit; font-weight: 600; color: var(--muted); cursor: pointer; }
.dash-tab:hover { background: #f5f7fb; color: var(--text); }
.dash-tab[aria-selected="true"] { background: #0a1a4f; color: #fff; }
.dash-tab:focus-visible { outline: 3px solid #2447d6; outline-offset: 2px; }

/* Main column and a narrower right column, like the reference; one column on smaller screens. */
.dash-grid { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 1rem; align-items: start; }
@media (max-width: 1100px) { .dash-grid { grid-template-columns: 1fr; } }

/* Recent activity: one line each with a coloured left edge by kind (the words carry the meaning too). */
.activity-feed { list-style: none; margin: 0; padding: 0; display: grid; gap: .5rem; }
.activity-feed li { padding: .45rem .7rem; border-left: 4px solid #2447d6; background: #f8f9fc; border-radius: 0 8px 8px 0; }
.activity-feed li.tone-danger { border-left-color: var(--danger-fill); }
.activity-feed li.tone-warning { border-left-color: var(--warning-fill); }
.activity-feed strong { display: block; font-size: .88rem; }
.activity-feed small { color: var(--muted); font-size: .75rem; text-transform: none; letter-spacing: 0; }

/* Line graph. Each series has its own colour AND dash pattern. */
.line-chart { margin: 0; }
.line-svg { width: 100%; height: auto; display: block; }
.line-svg .grid { stroke: #eef1f6; stroke-width: 1; }
.line-svg .axis { fill: #4a5468; font-size: 11px; }
.line-svg .line { fill: none; stroke-width: 2.5; stroke-linejoin: round; stroke-linecap: round; }
.line-svg .line.danger, .line-svg .dot.danger { stroke: var(--danger-fill); }
.line-svg .line.warning, .line-svg .dot.warning { stroke: var(--warning-fill); }
.line-svg .line.neutral, .line-svg .dot.neutral { stroke: #6b7385; }
.line-svg .dot { fill: #fff; stroke-width: 2; }
.line-svg .line.dash-1 { stroke-dasharray: 7 5; }
.line-svg .line.dash-2 { stroke-dasharray: 2 5; }
.line-legend { display: flex; flex-wrap: wrap; gap: 1rem; list-style: none; margin: 0 0 .4rem; padding: 0; font-size: .82rem; color: var(--muted); }
.line-legend .swatch { display: inline-block; width: 22px; height: 0; border-top: 3px solid #6b7385; margin-right: .4rem; vertical-align: middle; }
.line-legend .danger .swatch { border-top-color: var(--danger-fill); }
.line-legend .warning .swatch { border-top-color: var(--warning-fill); }
.line-legend .dash-1 .swatch { border-top-style: dashed; }
.line-legend .dash-2 .swatch { border-top-style: dotted; }

/* ---- Vivid, glossy colour (RJL, 18 Nov 2026: "high definition, vibrant and shiny, not flat") ----
 * Number cards are filled with a rich two-stop gradient, a glass highlight across the top half, a soft
 * coloured glow and white text. Each fill was chosen dark enough for white text to stay readable
 * (both stops of every fill are 4.5:1 or better against white: WCAG contrast formula, run 18 Nov 2026).
 * Light theme only. Status is still also given in words on every card, never by colour alone. */
html:not([data-theme="dark"]) body:not(.signin-mode) .stat-tile {
  position: relative; overflow: hidden; border: 0; border-left: 0; color: #fff;
  background: linear-gradient(135deg, #3b5bdb 0%, #1e3a8a 100%);
  box-shadow: 0 10px 24px -6px rgba(30, 58, 138, .55), inset 0 1px 0 rgba(255, 255, 255, .35);
}
html:not([data-theme="dark"]) body:not(.signin-mode) .stat-tile::before {
  content: ""; position: absolute; inset: 0 0 50% 0; pointer-events: none;
  background: linear-gradient(180deg, rgba(255, 255, 255, .28), rgba(255, 255, 255, 0));
}
html:not([data-theme="dark"]) body:not(.signin-mode) .stat-tile::after {
  content: ""; position: absolute; width: 140px; height: 140px; right: -40px; top: -60px; border-radius: 50%; pointer-events: none;
  background: radial-gradient(circle, rgba(255, 255, 255, .25), rgba(255, 255, 255, 0) 70%);
}
html:not([data-theme="dark"]) body:not(.signin-mode) .stat-tile :is(.stat-label, .stat-value, .stat-hint) { position: relative; z-index: 1; color: #fff; text-shadow: 0 1px 2px rgba(0, 0, 0, .25); }
html:not([data-theme="dark"]) body:not(.signin-mode) .stat-tile .stat-hint { color: rgba(255, 255, 255, .92); }
html:not([data-theme="dark"]) body:not(.signin-mode) .stat-tile .stat-value { font-size: 2.4rem; }

/* Tabs: the open tab is a glossy navy-to-royal-blue pill. */
.dash-tab[aria-selected="true"] {
  background: linear-gradient(180deg, #3b5bdb, #1e3a8a); color: #fff;
  box-shadow: 0 6px 14px -4px rgba(30, 58, 138, .6), inset 0 1px 0 rgba(255, 255, 255, .35);
}

/* Graph: brighter, thicker lines with a soft glow; the area under each line fades out (gradients in the SVG). */
.line-svg .line { stroke-width: 3.5; filter: drop-shadow(0 2px 3px rgba(14, 22, 48, .25)); }
.line-svg .line.danger, .line-svg .dot.danger { stroke: var(--danger-fill); }
.line-svg .line.warning, .line-svg .dot.warning { stroke: var(--warning-fill); }
.line-svg .line.neutral, .line-svg .dot.neutral { stroke: #6172f3; }
.line-svg .dot { r: 4.5; stroke-width: 2.5; }
.line-svg .area { stroke: none; }
.line-legend .danger .swatch { border-top-color: var(--danger-fill); }
.line-legend .warning .swatch { border-top-color: var(--warning-fill); }
.line-legend li:not(.danger):not(.warning) .swatch { border-top-color: #6172f3; }

/* Recent activity: a vivid coloured edge with a light wash of the same colour. */
.activity-feed li { border-left-width: 5px; border-left-color: var(--info-fill); background: linear-gradient(90deg, var(--info-tint), var(--surface) 70%); }
.activity-feed li.tone-danger { border-left-color: var(--danger-fill); background: linear-gradient(90deg, var(--danger-tint), var(--surface) 70%); }
.activity-feed li.tone-warning { border-left-color: var(--warning-fill); background: linear-gradient(90deg, var(--warning-tint), var(--surface) 70%); }

/* Status chips: glossy pills. Text colours are the existing dark ones, so contrast does not drop. */
html:not([data-theme="dark"]) body:not(.signin-mode) .chip { box-shadow: inset 0 1px 0 rgba(255, 255, 255, .7), 0 1px 2px rgba(14, 22, 48, .12); }
html:not([data-theme="dark"]) body:not(.signin-mode) .chip.ok { background: var(--ok-tint); color: var(--ok-text); }
html:not([data-theme="dark"]) body:not(.signin-mode) .chip.warning { background: var(--warning-tint); color: var(--warning-text); }
html:not([data-theme="dark"]) body:not(.signin-mode) .chip.danger { background: var(--danger-tint); color: var(--danger-text); }

/* Children-to-watch panel: a warm glowing gradient instead of flat cream. */
.ts-watch { background: var(--warning-tint); border-color: var(--warning-fill); box-shadow: 0 10px 24px -8px color-mix(in srgb, var(--danger-fill) 35%, transparent); }
.ts-watch-card { box-shadow: 0 6px 16px -6px rgba(14, 22, 48, .25); }

/* ---- Raised, coloured tiles (RJL, 18 Nov 2026: "all tabs 3D looking and coloured, but professional") ----
 * Top strip tiles, the children-to-watch cards and the gate schedule time boxes sit above the page: a tinted
 * face, a coloured lower edge like the side of a key, and a soft shadow underneath. Text colours are the
 * existing dark ones on light tints, so contrast does not drop. Status is still given in words on every tile.
 * Light theme only, like the vivid pass above. */
html:not([data-theme="dark"]) :is(.ts-state, .ts-pill, .ts-weather, .ts-user) {
  --tile-edge: #98a2b3; --tile-tint: #f2f4f7;
  border: 1px solid color-mix(in srgb, var(--tile-edge) 45%, #fff); border-bottom: 3px solid var(--tile-edge);
  background: linear-gradient(180deg, #fff 0%, var(--tile-tint) 100%);
  box-shadow: inset 0 1px 0 #fff, 0 8px 16px -8px color-mix(in srgb, var(--tile-edge) 70%, transparent);
  transition: transform .15s ease-out, box-shadow .15s ease-out;
}
html:not([data-theme="dark"]) :is(.ts-state, .ts-pill, .ts-weather, .ts-user):hover {
  transform: translateY(-2px);
  box-shadow: inset 0 1px 0 #fff, 0 14px 22px -10px color-mix(in srgb, var(--tile-edge) 85%, transparent);
}
/* Each tile's edge colour follows its state. */
html:not([data-theme="dark"]) .ts-pill.ok, html:not([data-theme="dark"]) .ts-weather { --tile-edge: var(--info-fill); --tile-tint: var(--info-tint); }
html:not([data-theme="dark"]) .ts-pill.warning { --tile-edge: var(--warning-fill); --tile-tint: var(--warning-tint); }
html:not([data-theme="dark"]) .ts-pill.danger { --tile-edge: var(--danger-fill); --tile-tint: var(--danger-tint); }
html:not([data-theme="dark"]) .ts-state:has(.ts-dot.ok) { --tile-edge: var(--ok-fill); --tile-tint: var(--ok-tint); }
html:not([data-theme="dark"]) .ts-state:has(.ts-dot.warning) { --tile-edge: var(--warning-fill); --tile-tint: var(--warning-tint); }
html:not([data-theme="dark"]) .ts-state:has(.ts-dot.danger) { --tile-edge: var(--danger-fill); --tile-tint: var(--danger-tint); }
html:not([data-theme="dark"]) .ts-user { --tile-edge: #1e3a8a; --tile-tint: #eef4ff; }
html:not([data-theme="dark"]) .ts-avatar { background: linear-gradient(135deg, #3b5bdb, #1e3a8a); color: #fff; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .35); }
.ts-dot.ok { box-shadow: 0 0 0 3px color-mix(in srgb, var(--ok-fill) 18%, transparent); }
.ts-dot.warning { box-shadow: 0 0 0 3px color-mix(in srgb, var(--warning-fill) 20%, transparent); }
.ts-dot.danger { box-shadow: 0 0 0 3px color-mix(in srgb, var(--danger-fill) 22%, transparent); }

/* The fire button is a physical red key: glossy face, dark lower edge, and it settles when pressed. White on #b42318 is 6.6:1. */
.ts-fire {
  border: 0; border-bottom: 4px solid var(--danger-text); background: linear-gradient(180deg, var(--danger-solid) 0%, var(--danger-solid) 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .35), 0 10px 20px -8px color-mix(in srgb, var(--danger-fill) 70%, transparent);
  transition: transform .12s ease-out, box-shadow .12s ease-out, border-bottom-width .12s ease-out;
}
.ts-fire:hover, .ts-fire:focus-visible { background: linear-gradient(180deg, var(--danger-solid) 0%, var(--danger-solid) 100%); transform: translateY(-2px); }
.ts-fire:active { transform: translateY(2px); border-bottom-width: 2px; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .35), 0 4px 8px -6px color-mix(in srgb, var(--danger-fill) 70%, transparent); }

/* Children-to-watch cards float above the panel, with an orange top edge. */
.ts-watch-card {
  border-top: 4px solid var(--warning-fill); background: linear-gradient(180deg, #fff 0%, #fffcf5 100%);
  box-shadow: 0 2px 0 rgba(14, 22, 48, .06), 0 14px 24px -12px color-mix(in srgb, var(--danger-fill) 45%, transparent);
  transition: transform .15s ease-out, box-shadow .15s ease-out;
}
.ts-watch-card:hover { transform: translateY(-3px); box-shadow: 0 2px 0 rgba(14, 22, 48, .06), 0 20px 30px -14px color-mix(in srgb, var(--danger-fill) 55%, transparent); }

/* Gate schedule time boxes: the time sits in the centre and the box floats like the other tiles. */
.time-box {
  min-width: 7.5rem; min-height: 44px; padding: .35rem .5rem; text-align: center; font: inherit; font-weight: 700; color: var(--text);
  border: 1px solid color-mix(in srgb, var(--info-fill) 40%, #fff); border-bottom: 3px solid var(--info-fill); border-radius: 8px;
  background: linear-gradient(180deg, #fff 0%, var(--info-tint) 100%);
  box-shadow: inset 0 1px 0 #fff, 0 8px 16px -8px rgba(46, 144, 250, .6);
  transition: transform .15s ease-out, box-shadow .15s ease-out;
}
/* The clock button is lifted out of the row and pinned to the right edge, so the time centres on the whole box. */
.time-box { position: relative; padding-inline: 1.6rem; }
.time-box::-webkit-datetime-edit { flex: 1 1 auto; text-align: center; padding: 0; }
.time-box::-webkit-datetime-edit-fields-wrapper { display: inline-block; }
.time-box::-webkit-calendar-picker-indicator { position: absolute; right: .35rem; top: 50%; translate: 0 -50%; margin: 0; cursor: pointer; }
.time-box:hover:not(:disabled), .time-box:focus-visible { transform: translateY(-2px); box-shadow: inset 0 1px 0 #fff, 0 14px 22px -10px rgba(46, 144, 250, .75); }
.time-box:disabled { opacity: 1; color: var(--text); border-bottom-color: #98a2b3; border-color: #d0d5dd #d0d5dd #98a2b3; background: linear-gradient(180deg, #fff 0%, #f2f4f7 100%); box-shadow: inset 0 1px 0 #fff, 0 8px 16px -8px rgba(102, 112, 133, .55); }
html[data-theme="dark"] .time-box, html[data-theme="dark"] .time-box:disabled { background: var(--surface); color: var(--text); border-color: var(--border); box-shadow: 0 8px 16px -8px #000; }

@media (prefers-reduced-motion: reduce) {
  :is(.ts-state, .ts-pill, .ts-weather, .ts-user, .ts-fire, .ts-watch-card, .time-box) { transition: none; }
  :is(.ts-state, .ts-pill, .ts-weather, .ts-user, .ts-fire, .ts-watch-card, .time-box):hover { transform: none; }
}

/* ---- 3D pie graphs (RJL, 18 Nov 2026) ---- */
.pie-chart { margin: 0; }
.pie-body { display: grid; grid-template-columns: minmax(11rem, 15rem) minmax(0, 1fr); gap: 1rem; align-items: center; }
@media (max-width: 560px) { .pie-body { grid-template-columns: 1fr; justify-items: center; } }
.pie-svg { width: 100%; height: auto; display: block; overflow: visible; }
.pie-shadow { fill: rgba(14, 22, 48, .18); filter: blur(6px); }
.pie-gloss { fill: rgba(255, 255, 255, .16); pointer-events: none; }
.pie-slice { cursor: pointer; transition: transform .18s ease-out; }
.pie-slice.lifted { transform: translateY(-9px); }
.pie-slice:hover { transform: translateY(-4px); }
.pie-slice.lifted:hover { transform: translateY(-9px); }
.pie-top { stroke: #fff; stroke-width: 1.2; stroke-linejoin: round; }
/* Top face and rim per tone: the rim is the same hue, darker, which is what makes the disc look solid. */
.pie-slice.ok .pie-top { fill: var(--ok-fill); } .pie-slice.ok .pie-wall { fill: var(--ok-text); }
.pie-slice.warning .pie-top { fill: var(--warning-fill); } .pie-slice.warning .pie-wall { fill: var(--warning-fill); }
.pie-slice.danger .pie-top { fill: var(--danger-fill); } .pie-slice.danger .pie-wall { fill: var(--danger-fill); }
.pie-slice.neutral .pie-top { fill: #98a2b3; } .pie-slice.neutral .pie-wall { fill: #475467; }
.pie-slice.info .pie-top { fill: var(--info-fill); } .pie-slice.info .pie-wall { fill: #175cd3; }
/* Group colours for figures that are not a status (year levels, classes). */
.pie-slice.cat1 .pie-top { fill: var(--info-fill); } .pie-slice.cat1 .pie-wall { fill: #175cd3; } .pie-key.cat1 .pie-dot { background: var(--info-fill); }
.pie-slice.cat2 .pie-top { fill: #15b79e; } .pie-slice.cat2 .pie-wall { fill: #0e7090; } .pie-key.cat2 .pie-dot { background: #15b79e; }
.pie-slice.cat3 .pie-top { fill: #7a5af8; } .pie-slice.cat3 .pie-wall { fill: #5925dc; } .pie-key.cat3 .pie-dot { background: #7a5af8; }
.pie-slice.cat4 .pie-top { fill: #6172f3; } .pie-slice.cat4 .pie-wall { fill: #444ce7; } .pie-key.cat4 .pie-dot { background: #6172f3; }
.pie-slice.cat5 .pie-top { fill: #ee46bc; } .pie-slice.cat5 .pie-wall { fill: #c11574; } .pie-key.cat5 .pie-dot { background: #ee46bc; }
.pie-slice.cat6 .pie-top { fill: #667085; } .pie-slice.cat6 .pie-wall { fill: #344054; } .pie-key.cat6 .pie-dot { background: #667085; }
/* ---- 3D block graph (21 Nov 2026). Each block is three faces in one status colour: the top is lightened and the
   side is darkened by an overlay, so one colour per tone is enough. Colours never carry meaning alone: every block
   has its number on it and its name, count and share in the key underneath. */
.block-chart { margin: 0; display: grid; gap: .6rem; }
.block-svg { width: 100%; max-width: 40rem; height: auto; display: block; margin: 0 auto; overflow: visible; }
.block-floor { stroke: var(--line, #d0d5dd); stroke-width: 1; }
.block-shadow { fill: rgba(14, 22, 48, .14); }
.block-front, .block-top, .block-side { fill: #98a2b3; }
.block.ok .block-front, .block.ok .block-top, .block.ok .block-side { fill: var(--ok-solid); }
.block.warning .block-front, .block.warning .block-top, .block.warning .block-side { fill: var(--warning-solid); }
.block.danger .block-front, .block.danger .block-top, .block.danger .block-side { fill: var(--danger-solid); }
.block.info .block-front, .block.info .block-top, .block.info .block-side { fill: var(--info-fill); }
.block-lift { fill: rgba(255, 255, 255, .34); }
.block-shade { fill: rgba(8, 14, 32, .26); }
.block-number { font-size: 15px; font-weight: 700; fill: var(--muted, #667085); }
.block-number.on-face { fill: #fff; }
.block-share { font-size: 26px; font-weight: 800; fill: var(--text, #101828); }
.block-count { font-size: 11px; font-weight: 600; fill: var(--muted, #667085); display: none; }
.block-leader { fill: none; stroke: var(--muted, #667085); stroke-width: 1; }
.block-pin { fill: var(--muted, #667085); }
.block-key { grid-template-columns: repeat(auto-fit, minmax(min(100%, 13rem), 1fr)); }
.block-row { display: grid; grid-template-columns: auto 1fr auto auto; align-items: center; gap: .5rem; padding: .4rem .6rem;
  border: 1px solid var(--line, #d0d5dd); border-radius: 8px; background: var(--surface, #fff); }
.block-tag { font-weight: 700; font-size: .78rem; color: #fff; background: #98a2b3; border-radius: 4px; padding: .1rem .35rem; }
.block-row.ok .block-tag { background: var(--ok-solid); } .block-row.warning .block-tag { background: var(--warning-solid); color: #1d1300; }
.block-row.danger .block-tag { background: var(--danger-solid); } .block-row.info .block-tag { background: var(--info-fill); }
.block-row:hover { transform: none; box-shadow: none; }
/* ---- 3D bar field (21 Nov 2026): one red, five shades by height. Faces share the shade; overlays light the top and
   darken the right side. */
.field-chart { margin: 0; display: grid; gap: .5rem; }
.field-svg { width: 100%; max-width: 52rem; height: auto; display: block; margin: 0 auto; overflow: visible; }
.field-tile { fill: #fdf1ee; stroke: #f0d5cf; stroke-width: .6; }
.field-cell.gap .field-tile { fill: none; stroke: #b9c0cc; stroke-dasharray: 3 3; }
.field-face { stroke: rgba(255, 255, 255, .35); stroke-width: .4; }
.heat1 .field-face { fill: #f9c9bd; } .field-swatch.heat1 { background: #f9c9bd; }
.heat2 .field-face { fill: #f39a86; } .field-swatch.heat2 { background: #f39a86; }
.heat3 .field-face { fill: #e5553f; } .field-swatch.heat3 { background: #e5553f; }
.heat4 .field-face { fill: #bd1f1f; } .field-swatch.heat4 { background: #bd1f1f; }
.heat5 .field-face { fill: #7a0c12; } .field-swatch.heat5 { background: #7a0c12; }
.field-light { fill: rgba(255, 255, 255, .3); }
.field-dark { fill: rgba(8, 14, 32, .24); }
.field-value { font-size: 12px; font-weight: 800; fill: #101828; stroke: #fff; stroke-width: 3; stroke-linejoin: round; paint-order: stroke; }
.field-label { font-size: 12px; fill: var(--muted, #667085); }
.field-label.series { font-weight: 700; fill: var(--text, #101828); }
.field-key { margin: 0; display: flex; align-items: center; gap: .3rem; font-size: .8rem; color: var(--muted, #667085); }
.field-swatch { width: 1.1rem; height: .7rem; border-radius: 2px; display: inline-block; }
.field-table summary { cursor: pointer; font-size: .85rem; width: fit-content; }
/* The top of Today: the attendance graph gets the wider column, the trend spans its whole row. */
.today-graphs.today-top { grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); align-items: stretch; }
@media (max-width: 1000px) { .today-graphs.today-top { grid-template-columns: 1fr; } }
.today-graphs > .panel.span-all { grid-column: 1 / -1; }
.pie-legend { list-style: none; margin: 0; padding: 0; display: grid; gap: .35rem; }
.pie-key {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto 3rem; gap: .55rem; align-items: center; width: 100%;
  padding: .45rem .6rem; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); color: var(--text);
  font: inherit; text-align: left; cursor: pointer; transition: transform .15s ease-out, box-shadow .15s ease-out;
}
.pie-key:hover { transform: translateY(-1px); box-shadow: 0 6px 14px -8px rgba(14, 22, 48, .5); }
.pie-key[aria-pressed="true"] { border-color: var(--brass); box-shadow: inset 0 0 0 1px var(--brass); }
.pie-key strong { font-size: 1.1rem; text-align: right; }
.pie-label { font-weight: 700; }
.pie-dot { width: 12px; height: 12px; border-radius: 3px; background: #98a2b3; }
.pie-key.ok .pie-dot { background: var(--ok-solid); } .pie-key.warning .pie-dot { background: var(--warning-solid); }
.pie-key.danger .pie-dot { background: var(--danger-solid); } .pie-key.info .pie-dot { background: var(--info-fill); }
@media (prefers-reduced-motion: reduce) {
  .pie-slice, .pie-key { transition: none; }
  .pie-slice:hover, .pie-slice.lifted, .pie-slice.lifted:hover, .pie-key:hover { transform: none; }
  .pie-slice.lifted .pie-top { stroke: var(--text); stroke-width: 2.5; }
}

/* Lockdown panel (back from 18 Nov 2026). Calm when off; a solid red edge and tint when on, so it cannot be missed. */
.lockdown-panel { border-left: 6px solid var(--line-strong); }
.lockdown-panel.is-on { border-left-color: var(--emergency); background: linear-gradient(180deg, var(--danger-tint), var(--surface) 70%); box-shadow: 0 10px 24px color-mix(in srgb, var(--emergency) 18%, transparent); }

/* ---- Classroom help room board (RJL, 18 Nov 2026) ------------------------------------------------------------
 * Calendar-style grid: every classroom in a fixed place. Each tile is raised with a coloured top edge for its state;
 * the state is also written in words, so colour is never the only signal. Text stays dark on light tints (4.5:1+). */
.room-summary { display: grid; gap: 0.75rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 10rem), 1fr)); }
.room-count { --edge: #98a2b3; --tint: #f2f4f7; display: grid; gap: 0.15rem; padding: 0.7rem 0.9rem; border-radius: 8px;
  border: 1px solid color-mix(in srgb, var(--edge) 45%, #fff); border-bottom: 3px solid var(--edge);
  background: linear-gradient(180deg, #fff 0%, var(--tint) 100%); box-shadow: 0 8px 16px -10px color-mix(in srgb, var(--edge) 80%, transparent); }
.room-count strong { font-size: 1.6rem; line-height: 1.1; color: #101828; }
.room-count-label { font-size: 0.72rem; letter-spacing: 0.06em; text-transform: uppercase; color: #344054; }
.room-count.ok { --edge: var(--ok-fill); --tint: var(--ok-tint); } .room-count.warning { --edge: var(--warning-fill); --tint: var(--warning-tint); } .room-count.danger { --edge: var(--danger-fill); --tint: var(--danger-tint); }

.room-board { display: grid; gap: 0.75rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 11rem), 1fr)); }
/* Emergency roll call class grid (RJL, 18 Nov 2026). One tile per class, calendar style; each child with a tick,
 * a cross (class reported without them) or a dash (not checked yet). Colour is never the only signal: each row also
 * has the symbol and a spoken label. */
/* Setup guide (RJL, 18 Nov 2026): one card per part of the portal, status chip, numbered steps, RJL's part. */
.setup-summary { margin: 0; padding: .7rem .9rem; border-left: 5px solid var(--rail-2, #0d2247); background: #eef2f8; border-radius: 6px; font-weight: 600; color: #0a1a4f; }
.setup-grid { display: grid; gap: .8rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 19rem), 1fr)); }
.setup-item { display: flex; flex-direction: column; gap: .45rem; padding: .85rem .95rem; border: 1px solid var(--border, #d0d7e6); border-left: 5px solid #8a94a8; border-radius: 8px; background: var(--surface, #fff); }
.setup-item.setup-done { border-left-color: var(--ok-fill); } .setup-item.setup-todo { border-left-color: var(--warning-fill); } .setup-item.setup-rjl { border-left-color: var(--info-fill); }
.setup-head { display: flex; align-items: start; justify-content: space-between; gap: .6rem; }
.setup-head h3 { margin: 0; font-size: 1.05rem; }
.setup-what { margin: 0; }
.setup-label { margin: .2rem 0 0; font-size: .75rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--muted, #475467); }
.setup-steps { margin: 0; padding-left: 1.3rem; display: grid; gap: .25rem; }
.setup-rjl { margin: 0; padding: .45rem .6rem; border-radius: 6px; background: var(--info-tint); color: #0a1a4f; font-size: .92rem; }
.setup-item > .button { align-self: flex-start; margin-top: auto; }
html[data-theme="dark"] .setup-summary { background: #16214a; color: #dfe6ff; }
html[data-theme="dark"] .setup-rjl { background: #16214a; color: #dfe6ff; }
html[data-theme="dark"] .setup-label { color: #c9d2e6; }
.rc-grid { display: grid; gap: .75rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 14rem), 1fr)); }
.rc-tile { display: flex; flex-direction: column; border: 1px solid var(--line, #d0d7e6); border-top: 5px solid #8a94a8; border-radius: 8px; background: var(--panel, #fff); min-height: 9rem; }
.rc-tile.rc-ok { border-top-color: var(--ok-text); } .rc-tile.rc-danger { border-top-color: var(--danger-fill); }
.rc-head { display: flex; flex-wrap: wrap; align-items: center; gap: .35rem .6rem; padding: .55rem .7rem; border-bottom: 1px solid var(--line, #d0d7e6); }
.rc-class { font-size: 1.15rem; } .rc-count { font-size: .85rem; color: var(--muted, #475467); margin-right: auto; }
.rc-list { list-style: none; margin: 0; padding: .3rem; display: grid; gap: 2px; }
.rc-btn { display: flex; align-items: center; gap: .5rem; width: 100%; min-height: 2.25rem; padding: .25rem .45rem; border: 0; border-radius: 6px; background: transparent; color: inherit; font: inherit; text-align: left; }
button.rc-btn { cursor: pointer; } button.rc-btn:hover { background: #eef2fb; } button.rc-btn:focus-visible { outline: 3px solid #2447d6; outline-offset: 1px; }
.rc-mark { display: inline-grid; place-items: center; flex: none; width: 1.6rem; height: 1.6rem; border-radius: 50%; font-weight: 800; border: 2px solid #8a94a8; color: #475467; }
.rc-yes .rc-mark { background: var(--ok-solid); border-color: var(--ok-text); color: #fff; }
.rc-no .rc-mark { background: var(--danger-solid); border-color: var(--danger-fill); color: #fff; }
.rc-no .rc-name { font-weight: 700; color: var(--danger-text); }
.rc-note { margin-left: auto; font-size: .75rem; color: var(--muted, #475467); }
.rc-empty { padding: .6rem; color: var(--muted, #475467); font-size: .9rem; }
.rc-banner { margin: 0 0 .75rem; padding: .6rem .8rem; border-radius: 6px; border-left: 5px solid; font-weight: 600; }
.rc-banner.rc-open { background: #fff1ee; border-color: var(--danger-fill); color: var(--danger-text); }
.rc-banner.rc-closed { background: #eef2fb; border-color: #2447d6; color: #0a1a4f; }
html[data-theme="dark"] .rc-tile { background: var(--surface); border-color: var(--border); }
html[data-theme="dark"] .rc-tile.rc-ok { border-top-color: var(--ok-fill); } html[data-theme="dark"] .rc-tile.rc-danger { border-top-color: var(--on-navy-danger); }
html[data-theme="dark"] .rc-head { border-color: var(--border); }
html[data-theme="dark"] .rc-count, html[data-theme="dark"] .rc-note, html[data-theme="dark"] .rc-empty { color: #c9d2e6; }
html[data-theme="dark"] button.rc-btn:hover { background: #1d2a55; }
html[data-theme="dark"] .rc-no .rc-name { color: var(--on-navy-danger); }
html[data-theme="dark"] .rc-mark { color: #c9d2e6; }
html[data-theme="dark"] .rc-banner.rc-open { background: var(--emergency); color: var(--on-emergency); }
html[data-theme="dark"] .rc-banner.rc-closed { background: #16214a; color: #dfe6ff; }
.room-tile { --edge: var(--ok-fill); --tint: #ffffff; display: grid; gap: 0.4rem; align-content: start; min-height: 8.5rem; padding: 0.75rem 0.85rem;
  border-radius: 10px; border: 1px solid #e4e7ec; border-top: 5px solid var(--edge); background: linear-gradient(180deg, var(--tint) 0%, #fff 100%);
  box-shadow: 0 10px 18px -12px rgba(16, 24, 40, 0.45); transition: transform .15s ease-out, box-shadow .15s ease-out; }
.room-tile:hover { transform: translateY(-2px); box-shadow: 0 16px 24px -14px rgba(16, 24, 40, 0.55); }
.room-tile-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 0.5rem; }
.room-name { margin: 0; font-size: 1.15rem; color: #101828; }
.room-tablet { display: inline-flex; align-items: center; gap: 0.35rem; font-size: 0.7rem; color: #344054; text-align: right; }
.room-dot { width: 0.65rem; height: 0.65rem; border-radius: 50%; flex: none; background: #98a2b3; box-shadow: 0 0 0 3px #f2f4f7; }
.room-dot.online { background: var(--ok-solid); box-shadow: 0 0 0 3px var(--ok-tint); }
.room-dot.offline { background: var(--danger-solid); box-shadow: 0 0 0 3px var(--danger-tint); }
.room-state { margin: 0; font-weight: 700; font-size: 0.85rem; color: #101828; }
.room-seen { margin: 0; font-size: 0.72rem; color: #475467; }
.room-tile.state-ok { --edge: var(--ok-fill); }
.room-tile.state-waiting { --edge: var(--warning-fill); --tint: var(--warning-tint); }
.room-tile.state-on_the_way { --edge: var(--info-fill); --tint: var(--info-tint); }
.room-tile.state-unanswered { --edge: var(--danger-fill); --tint: var(--danger-tint); animation: room-alert 1.6s ease-in-out infinite; }
.room-tile.state-practice { --edge: #7a5af8; --tint: #f4f3ff; }
.room-tile.state-ok.tablet-offline, .room-tile.state-ok.tablet-never { --edge: #98a2b3; --tint: #f9fafb; }
.room-legend { margin: 0; font-size: 0.75rem; color: #475467; }
@keyframes room-alert { 50% { box-shadow: 0 0 0 4px color-mix(in srgb, var(--danger-fill) 25%, transparent), 0 10px 18px -12px rgba(16, 24, 40, 0.45); } }
@media (prefers-reduced-motion: reduce) { .room-tile, .room-tile.state-unanswered { animation: none; transition: none; } }
html[data-theme="dark"] .room-tile, html[data-theme="dark"] .room-count { background: var(--surface); border-color: var(--border); }
html[data-theme="dark"] :is(.room-name, .room-state, .room-count strong) { color: var(--text); }
html[data-theme="dark"] :is(.room-tablet, .room-seen, .room-legend, .room-count-label) { color: var(--muted); }

/* ---------------------------------------------------------------------------------------------
 * Formal pass (RJL, 18 Nov 2026): "formal, professional, up to date, interactive, on every page".
 * Applies to every screen through the shared parts (page head, panel, table, button, chip, tabs).
 * Colours stay the approved navy #0A1A4F, blue #2447D6 and orange #E8501F; nothing new behind small text.
 * Motion follows IBM Carbon's productive easing and 110 to 240 ms durations; all of it is switched off
 * for people who ask their device for reduced motion (WCAG technique C39).
 * Focus is a 3px solid blue outline (WCAG 2.4.7); sticky bars never cover a focused control (2.4.11).
 * ------------------------------------------------------------------------------------------- */
:root { --ease: cubic-bezier(.2, 0, .38, .9); --navy: #0a1a4f; --blue: #2447d6; --orange: var(--accent); }

/* Focus and scrolling: one clear outline everywhere; focused items stop below the sticky top strip. */
body:not(.signin-mode) main :focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; }
body:not(.signin-mode) main :is(a, button, input, select, textarea, summary, [tabindex]) { scroll-margin-top: 9rem; }

/* Page title: a short description line under the orange rule, set at a readable size and measure. */
body:not(.signin-mode) .page-head p { max-width: 75ch; color: #4a5468; line-height: 1.55; }

/* Cards: one resting shadow, lifted one step on hover only where the card itself is a link or control. */
body:not(.signin-mode) .panel { transition: box-shadow 240ms var(--ease); }
body:not(.signin-mode) .section-stack { gap: 1.1rem; }

/* Tables: a sticky heading row, quiet row dividers, a hover tint, and figures that line up. */
body:not(.signin-mode) .data-table { font-variant-numeric: tabular-nums; }
body:not(.signin-mode) .data-table thead th, body:not(.signin-mode) .data-table tr:first-child > th { position: sticky; top: 0; z-index: 1; background: var(--surface); }
body:not(.signin-mode) .data-table tbody tr { transition: background-color 110ms var(--ease); }
body:not(.signin-mode) .data-table tbody tr:hover { background: #f5f7fb; }
html[data-theme="dark"] body:not(.signin-mode) .data-table tbody tr:hover { background: color-mix(in srgb, var(--text) 6%, var(--surface)); }

/* Buttons and links: the same easing everywhere; links carry an underline so they never rely on colour alone. */
body:not(.signin-mode) .button { transition: transform 150ms var(--ease), box-shadow 150ms var(--ease), filter 150ms var(--ease); }
body:not(.signin-mode) main a:not(.button):not(.nav-item) { text-underline-offset: .18em; text-decoration-thickness: 1px; }
body:not(.signin-mode) main a:not(.button):not(.nav-item):hover { text-decoration-thickness: 2px; }

/* Stat tiles: a small lift on hover so the numbers read as live figures. */
html:not([data-theme="dark"]) body:not(.signin-mode) .stat-tile { transition: transform 150ms var(--ease), box-shadow 150ms var(--ease); }
html:not([data-theme="dark"]) body:not(.signin-mode) .stat-tile:hover { transform: translateY(-2px); box-shadow: 0 1px 2px rgba(14, 22, 48, .06), 0 14px 30px rgba(14, 22, 48, .12); }

/* Form fields: a firm border and a blue edge while typing. */
body:not(.signin-mode) :is(.field input, .field select, .field textarea, .search-box input) { transition: border-color 110ms var(--ease), box-shadow 110ms var(--ease); }
body:not(.signin-mode) :is(.field input, .field select, .field textarea, .search-box input):focus { border-color: var(--blue); }

/* Dropdown groups on Today ("Everything, by area"): a turning marker so open and closed read differently. */
body:not(.signin-mode) .area > summary { cursor: pointer; }

/* Today tabs: the open tab has a navy face AND an orange underline, so it never relies on colour alone. */
.dash-tab { transition: background-color 150ms var(--ease), color 150ms var(--ease); }
.dash-tab[aria-selected="true"] { box-shadow: inset 0 -3px 0 var(--orange); }

/* ---- Announce button and panel in the top strip (any page) ---- */
.ts-announce {
  display: flex; align-items: center; gap: .55rem; min-height: 44px; padding: .35rem .9rem; cursor: pointer;
  border: 1px solid var(--navy); border-radius: 8px; background: linear-gradient(180deg, #1d3fb8, var(--navy)); color: #fff; font: inherit; text-align: left;
  box-shadow: inset 0 1px 0 #ffffff38, 0 2px 0 #06103a, 0 8px 16px rgba(10, 26, 79, .25); transition: transform 150ms var(--ease);
}
.ts-announce span { display: grid; }
.top-strip .ts-announce small, .top-strip .ts-announce strong { color: #fff; }
.ts-announce:hover { transform: translateY(-1px); }
.ts-announce:active { transform: translateY(1px); }
.ts-announce:focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; }
.ts-announce[aria-expanded="true"] { box-shadow: inset 0 -3px 0 var(--orange), 0 2px 0 #06103a; }
/* Off: still opens, to say why it cannot announce. Navy text on the pale face is over 12:1. */
.ts-announce.off { background: #eef1f6; border-color: #c9d1e0; color: var(--navy); box-shadow: none; }
.top-strip .ts-announce.off small, .top-strip .ts-announce.off strong { color: var(--navy); }
.ts-announce-panel {
  position: absolute; top: calc(100% + .4rem); right: clamp(1rem, 3vw, 3.1rem); z-index: 40;
  width: min(30rem, calc(100vw - 2rem)); display: grid; gap: .55rem; padding: 1rem 1.1rem 1.1rem;
  background: var(--surface); border: 1px solid #0a1a4f33; border-top: 4px solid var(--orange); border-radius: 6px;
  box-shadow: 0 2px 4px rgba(14, 22, 48, .08), 0 24px 48px rgba(14, 22, 48, .22);
}
.ts-announce-panel h2 { margin: 0; font-size: 1.1rem; color: var(--navy); }
.ts-announce-panel label { font-weight: 700; color: var(--navy); }
.ts-announce-panel textarea { width: 100%; min-height: 5.5rem; padding: .6rem .7rem; border: 1px solid #c9d1e0; border-radius: 4px; font: inherit; resize: vertical; background: var(--surface); color: var(--text); }
.ts-announce-panel textarea:focus { outline: 3px solid var(--blue); outline-offset: 1px; border-color: var(--blue); }
.top-strip .ts-announce-panel small { text-transform: none; letter-spacing: 0; }
.ts-announce-count { justify-self: end; font-variant-numeric: tabular-nums; }
.ts-announce-status { margin: 0; padding: .55rem .7rem; border-left: 4px solid; border-radius: 3px; font-size: .9rem; }
.ts-announce-status.ok { border-color: var(--ok-text); background: #e8f5ec; color: var(--ok-text); }
.ts-announce-status.warning { border-color: var(--warning-fill); background: var(--warning-tint); color: var(--warning-text); }
.ts-announce-status.danger { border-color: var(--danger-fill); background: #feeceb; color: var(--danger-text); }
.ts-announce-actions { display: flex; flex-wrap: wrap; gap: .5rem; }
@media (max-width: 720px) { .ts-announce-panel { right: 1rem; left: 1rem; width: auto; } }

/* ---- Tracked vehicles on Today: the fleet page shown inside a card ---- */
.fleet-embed { display: block; width: 100%; height: clamp(20rem, 52vh, 34rem); border: 1px solid #0a1a4f33; border-radius: 4px; background: #eef1f6; }
/* The fleet page when shown inside that card: the page only, no menu, strip or title bar. */
body.embed .sidebar, body.embed .topbar, body.embed #top-strip, body.embed .skip-link, body.embed .page-head { display: none !important; }
body.embed .shell { display: block; min-height: 0; }
body.embed main { padding: .5rem; max-width: none; }
body.embed .fleet-map { min-height: calc(100vh - 1rem); }

/* ---- Line graphs: chosen-day guide, highest-to-lowest band, read-out and table ---- */
.line-svg { border-radius: 4px; cursor: crosshair; touch-action: pan-y; }
.line-svg:focus-visible { outline: 3px solid var(--blue); outline-offset: 3px; }
.line-svg .band { fill: var(--accent); fill-opacity: .1; stroke: none; }
.line-svg .guide { stroke: var(--navy); stroke-width: 1.5; stroke-dasharray: 3 3; }
.line-svg .dot { transition: r 110ms var(--ease); }
.line-svg .dot.active { r: 7; stroke-width: 3; }
.line-readout { margin: .2rem 0 .5rem; min-height: 1.6rem; padding: .35rem .6rem; border-left: 3px solid var(--orange); background: #f5f7fb; color: var(--navy); font-size: .9rem; font-variant-numeric: tabular-nums; }
html[data-theme="dark"] .line-readout { background: color-mix(in srgb, var(--text) 8%, var(--surface)); color: var(--text); }
.line-details { margin-top: .6rem; }
.line-details > summary { cursor: pointer; color: var(--blue); font-size: .85rem; font-weight: 700; min-height: 32px; display: inline-flex; align-items: center; }
.line-table { width: 100%; margin-top: .4rem; border-collapse: collapse; font-size: .85rem; font-variant-numeric: tabular-nums; }
.line-table :is(th, td) { padding: .4rem .5rem; text-align: left; border-bottom: 1px solid var(--border); }
.line-table th { color: var(--navy); }

/* ---- Weather card: conditions grid, selectable days, official links and source line ---- */
.wx-label { font-size: 1.05rem; color: var(--navy); }
html[data-theme="dark"] .wx-label { color: var(--text); }
.wx-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(9.5rem, 1fr)); gap: .6rem; margin: 0; }
.wx-fact { margin: 0; padding: .6rem .75rem; border: 1px solid #e3e8f1; border-left: 3px solid var(--blue); border-radius: 4px; background: var(--surface); }
.wx-fact dt { font-size: .72rem; letter-spacing: .05em; text-transform: uppercase; color: #4a5468; }
.wx-fact dd { margin: .15rem 0 0; font-size: 1.15rem; color: var(--navy); font-variant-numeric: tabular-nums; }
html[data-theme="dark"] .wx-fact dd { color: var(--text); }
.wx-fact dd.wx-fact-note { font-size: .78rem; color: #4a5468; }
.wx-sub { margin: .3rem 0 0; font-size: .95rem; color: var(--navy); border-bottom: 2px solid var(--orange); padding-bottom: .3rem; }
html[data-theme="dark"] .wx-sub { color: var(--text); }
.wx-week li { padding: 0; border: 0; background: none; }
.wx-day {
  width: 100%; min-height: 44px; display: grid; justify-items: center; gap: .1rem; padding: .55rem .2rem; cursor: pointer;
  border: 1px solid var(--border); border-radius: 4px; background: var(--soft); color: inherit; font: inherit;
  transition: transform 150ms var(--ease), box-shadow 150ms var(--ease), background-color 150ms var(--ease);
}
.wx-day:hover { transform: translateY(-2px); box-shadow: 0 8px 18px rgba(14, 22, 48, .12); }
/* Chosen day: blue top rule, raised white face, navy border. Three cues, not colour alone. */
.wx-day[aria-pressed="true"] { background: var(--surface); border-color: var(--navy); box-shadow: inset 0 3px 0 var(--blue), 0 8px 18px rgba(14, 22, 48, .14); }
.wx-day:focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; }
.wx-day-rain { font-size: .68rem; color: #4a5468; }
.wx-day-detail { margin: 0; padding: .55rem .75rem; border-left: 3px solid var(--orange); background: #f5f7fb; color: var(--navy); font-size: .92rem; }
html[data-theme="dark"] .wx-day-detail { background: color-mix(in srgb, var(--text) 8%, var(--surface)); color: var(--text); }
.wx-links { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem .9rem; font-size: .82rem; }
.wx-links span { font-weight: 700; color: var(--navy); }
html[data-theme="dark"] .wx-links span { color: var(--text); }
.wx-source { margin: 0; padding-top: .55rem; border-top: 1px solid var(--border); color: #4a5468; font-size: .75rem; }

/* Reduced motion: no movement, no transitions. */
@media (prefers-reduced-motion: reduce) {
  body:not(.signin-mode) :is(.panel, .button, .stat-tile, .dash-tab, .ts-announce, .wx-day, .data-table tbody tr, .line-svg .dot) { transition: none !important; }
  body:not(.signin-mode) :is(.stat-tile, .ts-announce, .wx-day, .button):hover { transform: none !important; }
}

/* ---- Dark mode contrast (RJL, 18 Nov 2026) ---------------------------------------------------------------------
 * The light theme's fixed dark greys and dark amber were also used in dark mode, where they fell to 2.2-2.5:1
 * (axe-core 4.14, 84 failures). These swap them for the dark theme's own text colours, 4.5:1 or better on its
 * panels. Light mode is unchanged. */
html[data-theme="dark"] :is(.page-head p, .bar-share, .wx-fact dt, .wx-fact dd.wx-fact-note, .wx-day-rain, .wx-source) { color: var(--muted); }
html[data-theme="dark"] body:not(.signin-mode) .page-head p { color: var(--muted); }
html[data-theme="dark"] .line-svg .axis { fill: var(--muted); }
html[data-theme="dark"] .ts-pill.ok strong { color: #84caff; }
html[data-theme="dark"] .ts-pill.warning strong { color: var(--on-navy-warning); }
html[data-theme="dark"] .ts-pill.danger strong { color: var(--on-navy-danger); }
html[data-theme="dark"] :is(.ts-link, .line-details > summary) { color: #9db8ff; }

/* Keyboard focus on scroll boxes is shown like every other control. */
.table-scroll:focus-visible { outline: 3px solid #2447d6; outline-offset: 2px; }

/* ---- Wide screens (RJL, 18 Nov 2026) ------------------------------------------------------------------------------
 * With the work area full width, boxes keep a sensible minimum and add columns as space allows. */
@media (min-width: 1800px) {
  .today-graphs { grid-template-columns: repeat(auto-fit, minmax(min(100%, 22rem), 1fr)); }
  .room-board { grid-template-columns: repeat(auto-fill, minmax(12rem, 1fr)); }
}

/* ---- Tiles that open their page (RJL, 18 Nov 2026) ----------------------------------------------------------------
 * A tile that is a link looks like the tile it was, lifts on hover, shows a keyboard focus ring, and carries a small
 * "Open" cue so it is clear it goes somewhere. */
a.stat-tile, a.ts-pill, a.ts-state { color: inherit; text-decoration: none; cursor: pointer; }
a.stat-tile { position: relative; transition: transform .15s ease-out, box-shadow .15s ease-out; }
a.stat-tile:hover { transform: translateY(-2px); box-shadow: 0 12px 22px -14px rgba(16, 24, 40, .55); }
a.stat-tile:focus-visible, a.ts-pill:focus-visible, a.ts-state:focus-visible { outline: 3px solid #2447d6; outline-offset: 2px; }
/* The cue takes the tile's own text colour: dark on plain tiles, white on the coloured ones, so it always has the
   same contrast as the label above it (an earlier fixed blue was unreadable on the coloured tiles). */
.stat-open { font-size: .7rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: inherit; text-decoration: underline; text-underline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { a.stat-tile { transition: none; } a.stat-tile:hover { transform: none; } }

/* The Announce button keeps white text on its own dark blue in both themes. */
html[data-theme="dark"] .top-strip .ts-announce:not(.off) :is(small, strong) { color: #fff; }
/* Switched off, the button is pale in both themes, so its words are navy (13:1 on #eef1f6). */
.top-strip .ts-announce.off :is(small, strong) { color: var(--navy); }

/* ---- Stripe style reference pass (RJL, 18 Nov 2026; AnimatedWebs style "stripe", captured 2026-10-12) -------------
 * Taken from the reference: a cool off-white canvas, hairline cobalt-grey borders, soft layered shadows instead of
 * heavy outlines, slate supporting text, small consistent corners (4-8px), calm tables and inputs with a clear
 * focus ring. NOT taken: Stripe's indigo, font, logo or wording. MK4S keeps its navy #0A1A4F, blue #2447D6, orange
 * #E8501F, Zing Sans Rust and its own logo. Light theme only; dark mode is unchanged.
 * Contrast (WCAG formula): slate #50617A on white 6.4:1, on canvas #F6F9FC 6.1:1; navy on white 16.5:1. */
html:not([data-theme="dark"]) body:not(.signin-mode) {
  --mk-canvas: #f6f9fc; --mk-line: #e3e8ef; --mk-line-strong: #cfd8e3; --mk-slate: #50617a; --mk-ink: #0a1a4f;
  --mk-shadow: 0 1px 1px rgba(6, 27, 49, .04), 0 2px 6px -1px rgba(6, 27, 49, .08), 0 14px 32px -18px rgba(6, 27, 49, .28);
  --mk-shadow-hover: 0 1px 1px rgba(6, 27, 49, .05), 0 6px 14px -4px rgba(6, 27, 49, .12), 0 22px 44px -20px rgba(6, 27, 49, .35);
  background: var(--mk-canvas);
}
html:not([data-theme="dark"]) body:not(.signin-mode) main { background: var(--mk-canvas); }

/* Cards */
html:not([data-theme="dark"]) body:not(.signin-mode) .panel {
  border: 1px solid var(--mk-line); border-radius: 8px; background: #fff; box-shadow: var(--mk-shadow);
  transition: box-shadow 180ms var(--ease, ease-out);
}
html:not([data-theme="dark"]) body:not(.signin-mode) .panel:hover { box-shadow: var(--mk-shadow-hover); }
html:not([data-theme="dark"]) body:not(.signin-mode) .panel > .panel-head { border-radius: 7px 7px 0 0; }

/* Supporting text */
html:not([data-theme="dark"]) body:not(.signin-mode) :is(.page-head p, main .message, .stat-hint, .room-seen, .room-legend, .wx-source) { color: var(--mk-slate); }

/* Buttons: small corners, firm weight, one clear focus ring */
html:not([data-theme="dark"]) body:not(.signin-mode) .button { border-radius: 6px; font-weight: 600; }
html:not([data-theme="dark"]) body:not(.signin-mode) .button.secondary { background: #fff; border: 1px solid var(--mk-line-strong); color: var(--mk-ink); box-shadow: 0 1px 1px rgba(6, 27, 49, .06); }
html:not([data-theme="dark"]) body:not(.signin-mode) .button.secondary:hover { border-color: #9fb0c6; background: #fbfcfe; }
html:not([data-theme="dark"]) body:not(.signin-mode) :is(.button, a, input, select, textarea):focus-visible { outline: 3px solid rgba(36, 71, 214, .45); outline-offset: 2px; }

/* Inputs */
html:not([data-theme="dark"]) body:not(.signin-mode) :is(input:not([type="checkbox"]):not([type="radio"]), select, textarea) {
  border: 1px solid var(--mk-line-strong); border-radius: 6px; background: #fff;
}
html:not([data-theme="dark"]) body:not(.signin-mode) :is(input, select, textarea):focus { border-color: #2447d6; }

/* Tables: quiet header, hairline rows, a light hover so a row is easy to follow across a wide screen */
html:not([data-theme="dark"]) body:not(.signin-mode) .data-table th { color: var(--mk-slate); font-size: .72rem; letter-spacing: .05em; border-bottom: 1px solid var(--mk-line-strong); }
html:not([data-theme="dark"]) body:not(.signin-mode) .data-table td { border-bottom: 1px solid var(--mk-line); }
html:not([data-theme="dark"]) body:not(.signin-mode) .data-table tbody tr:hover td { background: #f6f9fc; }

/* Tab row */
html:not([data-theme="dark"]) body:not(.signin-mode) .dash-tabs { border: 1px solid var(--mk-line); border-radius: 8px; box-shadow: var(--mk-shadow); }
@media (prefers-reduced-motion: reduce) { html body .panel { transition: none; } }

/* ---- Sick bay: who is in there now (RJL, 18 Nov 2026) ------------------------------------------------------------
 * Raised child cards coloured by where the family is up to, and the chosen child's family contact drawn as a phone.
 * Every state is in words too. Text is dark on light tints, or white on the navy phone header (16:1). */
.sb-board { display: grid; gap: 1.1rem; grid-template-columns: minmax(0, 1fr) minmax(min(100%, 22rem), 26rem); align-items: start; }
@media (max-width: 1000px) { .sb-board { grid-template-columns: 1fr; } }
.sb-cards { display: grid; gap: .75rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 14rem), 1fr)); align-content: start; }
.sb-card {
  --edge: #98a2b3; --tint: #f9fafb; display: grid; gap: .3rem; text-align: left; font: inherit; color: #101828; cursor: pointer;
  padding: .8rem .9rem; border-radius: 12px; border: 1px solid #e4e7ec; border-top: 5px solid var(--edge);
  background: linear-gradient(160deg, #fff 0%, var(--tint) 100%);
  box-shadow: 0 1px 0 rgba(255, 255, 255, .9) inset, 0 2px 0 rgba(16, 24, 40, .05), 0 14px 26px -16px rgba(16, 24, 40, .55);
  transform: perspective(700px) rotateX(0deg); transition: transform .18s ease-out, box-shadow .18s ease-out;
}
.sb-card:hover { transform: perspective(700px) rotateX(4deg) translateY(-3px); box-shadow: 0 2px 0 rgba(16, 24, 40, .05), 0 22px 30px -16px rgba(16, 24, 40, .6); }
.sb-card.is-selected { outline: 3px solid #2447d6; outline-offset: 2px; }
.sb-card:focus-visible { outline: 3px solid #2447d6; outline-offset: 2px; }
.sb-card.fam-ok { --edge: var(--ok-fill); --tint: var(--ok-tint); }
.sb-card.fam-warning { --edge: var(--warning-fill); --tint: var(--warning-tint); }
.sb-card.fam-danger { --edge: var(--danger-fill); --tint: var(--danger-tint); }
.sb-card.fam-info { --edge: var(--info-fill); --tint: var(--info-tint); }
.sb-card-name { font-size: 1.05rem; font-weight: 700; }
.sb-card-meta, .sb-card-time { font-size: .78rem; color: #344054; }
.sb-card-family { justify-self: start; margin-top: .2rem; padding: .2rem .55rem; border-radius: 999px; font-size: .74rem; font-weight: 700; background: #fff; border: 1px solid currentColor; }
.sb-card-family.ok { color: var(--ok-text); } .sb-card-family.warning { color: var(--warning-text); } .sb-card-family.danger { color: var(--danger-text); } .sb-card-family.info { color: #175cd3; }
.sb-card-flag { font-size: .74rem; font-weight: 700; color: var(--danger-text); }
.sb-card.needs-attention { animation: sb-pulse 1.8s ease-in-out infinite; }
@keyframes sb-pulse { 50% { box-shadow: 0 0 0 4px color-mix(in srgb, var(--danger-fill) 22%, transparent), 0 14px 26px -16px rgba(16, 24, 40, .55); } }

/* The phone */
.sb-phone {
  position: relative; display: grid; gap: .6rem; padding: .9rem .9rem 1.1rem; border-radius: 34px;
  background: linear-gradient(160deg, #1f2a44, #0a1a4f 60%, #050c26); border: 1px solid #0a1a4f;
  box-shadow: inset 0 0 0 6px #121c36, inset 0 1px 0 rgba(255, 255, 255, .18), 0 30px 50px -24px rgba(6, 16, 58, .75), 0 8px 18px -10px rgba(6, 16, 58, .5);
  transform: perspective(1200px) rotateY(-4deg); transform-origin: right center;
}
.sb-phone::before { content: ""; justify-self: center; width: 34%; height: 6px; border-radius: 6px; background: #2b3758; }
.sb-phone-head { display: grid; gap: .2rem; padding: .55rem .7rem; border-radius: 16px; background: rgba(255, 255, 255, .08); color: #fff; }
.sb-phone-head strong { font-size: 1rem; } .sb-phone-head small { color: #d0d8ea; font-size: .74rem; }
.sb-phone-head .chip { justify-self: start; }
.sb-thread { list-style: none; margin: 0; padding: .6rem; display: grid; gap: .45rem; max-height: 22rem; overflow-y: auto; border-radius: 16px; background: #f2f4f7; }
.sb-msg { display: grid; gap: .1rem; max-width: 85%; padding: .45rem .65rem; border-radius: 14px; font-size: .84rem; line-height: 1.35; color: #101828; box-shadow: 0 1px 1px rgba(16, 24, 40, .08); }
.sb-msg.side-school { justify-self: end; background: #d1e0ff; border-bottom-right-radius: 4px; }
.sb-msg.side-family { justify-self: start; background: #fff; border-bottom-left-radius: 4px; }
.sb-msg.side-system { justify-self: center; max-width: 100%; background: transparent; box-shadow: none; text-align: center; color: #344054; font-size: .75rem; }
.sb-msg-who { font-size: .68rem; font-weight: 700; letter-spacing: .03em; color: #344054; text-transform: uppercase; }
.sb-msg-time { font-size: .66rem; color: #475467; justify-self: end; }
.sb-quick { display: flex; flex-wrap: wrap; gap: .35rem; }
.sb-quick .button, .sb-leave .button { min-height: 36px; padding: .3rem .65rem; font-size: .74rem; }
.sb-compose { display: flex; gap: .4rem; }
.sb-compose input { flex: 1; min-width: 0; border-radius: 999px !important; padding: .45rem .8rem; }
.sb-compose .button { border-radius: 999px; min-height: 36px; }
.sb-leave { display: flex; flex-wrap: wrap; gap: .35rem; padding-top: .5rem; border-top: 1px solid rgba(255, 255, 255, .15); }
.sb-phone-note { margin: 0; font-size: .7rem; color: #d0d8ea; }
@media (prefers-reduced-motion: reduce) {
  .sb-card, .sb-phone { transition: none; transform: none; } .sb-card:hover { transform: none; } .sb-card.needs-attention { animation: none; }
}
@media (max-width: 1000px) { .sb-phone { transform: none; } }
/* ---- Wider work area (RJL, 18 Nov 2026: "site wider") --------------------------------------------------------------
 * Narrower side gutters and a slightly slimmer menu give the work area about 70px more width on a 1920px screen.
 * The pinned children-to-watch strip is made compact (shorter cards, smaller photo) so it takes less of the screen
 * while it stays in view, as asked on 17 Nov. */
.shell { grid-template-columns: 236px minmax(0, 1fr); }
main { padding-inline: clamp(.75rem, 1.4vw, 1.75rem); }
.top-strip { padding-inline: clamp(.75rem, 1.4vw, 1.75rem); }
@media (max-width: 900px) { .shell { grid-template-columns: 185px minmax(0, 1fr); } }
@media (max-width: 720px) { .shell { display: block; } }
.ts-watch { padding: .5rem .8rem; }
.ts-watch h2 { margin-bottom: .35rem; font-size: .9rem; }
.ts-watch-list { grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)); gap: .5rem; }
.ts-watch-card { min-height: 0; gap: .3rem; padding: .5rem .65rem; }
.ts-face { width: 34px; height: 34px; }
.ts-watch-alert { font-size: .85rem; }

/* ---- Loading screen (RJL, 18 Nov 2026: "make that animated and interactive looking") ------------------------------
 * Pure CSS (the page's security policy allows no inline script): two counter-turning arcs in the brand orange and
 * blue, a dot orbiting the badge, a soft breathing glow, the logo lifting slightly, and four loading lines that take
 * turns. The badge tilts towards the pointer on hover. The logo itself is never recoloured or distorted.
 * Under reduced motion everything is still and only the first loading line shows. */
.workspace-loading { gap: 1.4rem; grid-auto-flow: row; align-content: center; background: radial-gradient(60rem 40rem at 50% 45%, #ffffff 0%, var(--bg) 70%); }
.workspace-loading-stage { position: relative; display: grid; place-items: center; width: clamp(12rem, 60vw, 19rem); aspect-ratio: 1; perspective: 900px; }
.workspace-loading-stage > * { grid-area: 1 / 1; }
.workspace-loading-stage .workspace-loading-mark {
  width: 78%; transform-style: preserve-3d; transition: transform .35s cubic-bezier(.22, 1, .36, 1);
  box-shadow: 0 1px 0 #fff inset, 0 18px 40px -14px rgba(10, 26, 79, .45), 0 4px 12px rgba(10, 26, 79, .12);
  animation: wl-float 3.2s ease-in-out infinite;
}
.workspace-loading-stage .workspace-loading-mark::after { display: none; }
.workspace-loading-stage:hover .workspace-loading-mark { transform: rotateX(10deg) rotateY(-12deg) scale(1.03); }
.workspace-loading-stage .workspace-loading-mark img { animation: wl-breathe 3.2s ease-in-out infinite; }
.wl-glow { width: 92%; aspect-ratio: 1; border-radius: 50%; background: radial-gradient(circle, rgba(36, 71, 214, .22) 0%, rgba(36, 71, 214, .12) 45%, transparent 70%); animation: wl-pulse 2.4s ease-in-out infinite; }
.wl-ring { aspect-ratio: 1; border-radius: 50%; border: 4px solid transparent; }
.wl-ring-outer { width: 100%; border-top-color: var(--accent); border-right-color: var(--accent); animation: wl-spin 1.6s cubic-bezier(.55, .15, .45, .85) infinite; filter: drop-shadow(0 0 6px rgba(36, 71, 214, .55)); }
.wl-ring-inner { width: 88%; border-bottom-color: #2447d6; border-left-color: #2447d6; animation: wl-spin 2.2s linear infinite reverse; filter: drop-shadow(0 0 6px rgba(36, 71, 214, .5)); }
.wl-orbit { width: 100%; aspect-ratio: 1; animation: wl-spin 3.6s linear infinite; }
.wl-dot { display: block; width: 12px; height: 12px; margin: -6px auto 0; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 4px rgba(36, 71, 214, .25), 0 0 14px var(--accent); }
.wl-steps { position: relative; height: 1.4em; width: min(90vw, 22rem); margin: 0; text-align: center; font-size: .95rem; letter-spacing: .08em; text-transform: uppercase; color: #0a1a4f; }
.wl-steps span { position: absolute; inset: 0; opacity: 0; animation: wl-step 6s infinite; }
.wl-steps span:nth-child(2) { animation-delay: 1.5s; } .wl-steps span:nth-child(3) { animation-delay: 3s; } .wl-steps span:nth-child(4) { animation-delay: 4.5s; }
@keyframes wl-spin { to { transform: rotate(1turn); } }
@keyframes wl-float { 50% { translate: 0 -6px; } }
@keyframes wl-breathe { 50% { scale: 1.035; } }
@keyframes wl-pulse { 50% { scale: 1.12; opacity: .65; } }
@keyframes wl-step { 0% { opacity: 0; translate: 0 8px; } 6%, 22% { opacity: 1; translate: 0 0; } 28%, 100% { opacity: 0; translate: 0 -8px; } }
@media (prefers-reduced-motion: reduce) {
  .wl-glow, .wl-ring, .wl-orbit, .workspace-loading-stage .workspace-loading-mark, .workspace-loading-stage .workspace-loading-mark img, .wl-steps span { animation: none; }
  .wl-steps span:first-child { opacity: 1; }
  .workspace-loading-stage:hover .workspace-loading-mark { transform: none; }
}
html[data-theme="dark"] .workspace-loading { background: radial-gradient(60rem 40rem at 50% 45%, #1a2550 0%, var(--bg) 70%); }
html[data-theme="dark"] .wl-steps { color: #e6ecff; }
/* Reception tablet: the contractor's result in large type, so it can be read from a step back (RJL, 18 Nov 2026). */
.kiosk-result { min-height: 2.4rem; margin: 0; padding: .7rem 1rem; border-radius: 8px; font-size: 1.25rem; font-weight: 700; color: #101828; }
.kiosk-result:empty { padding: 0; }
.kiosk-result.ok { background: var(--ok-tint); border-left: 6px solid var(--ok-fill); color: var(--ok-text); }
.kiosk-result.warning { background: var(--warning-tint); border-left: 6px solid var(--warning-fill); color: var(--warning-text); }
.kiosk-result.danger { background: var(--danger-tint); border-left: 6px solid var(--danger-fill); color: var(--danger-text); }

/* Contractors on site on Today: a full-width box, pie beside the list (RJL, 18 Nov 2026). */
.today-graphs > .contractors-today { grid-column: 1 / -1; }
.ct-split { display: grid; gap: 1rem; grid-template-columns: minmax(0, 1fr); align-items: start; }
@media (min-width: 900px) { .ct-split { grid-template-columns: minmax(16rem, 24rem) minmax(0, 1fr); } }

/* ---- Rail-matched colour system (RJL, 18 Nov 2026: "the colours need to better suit the side dashboard panel but
 * still have the same effect. Site wide.") ------------------------------------------------------------------------
 * Every coloured surface now shares the side menu's navy (--rail) as its base. Status is a deep tint that fades into
 * that navy, a bright 4px stripe on the left, and a glow of the same hue. The glossy sheen and corner highlight stay.
 * White text contrast on the lightest stop of each fill (WCAG formula, run 18 Nov 2026):
 *   info #1f3d8f 9.9:1 / ok #0b6b45 6.6:1 / warning #93470a 6.7:1 / danger #a3231a 7.5:1 / rail #071530 18.1:1.
 * Status is still written in words on every tile; colour is never the only signal. Applies to light and dark themes. */
:root {
  --rail: #071530; --rail-2: #0d2247;
  /* Quiet normal (20 Nov 2026 colour review): OK and info tiles stay plain navy with a thin stripe; only warning and
   * danger tiles get a coloured face. Stripes use the light "on navy" status colours (5.6:1 to 8.6:1 on #0D2247). */
  --tile-info: var(--rail-2); --tile-ok: var(--rail-2); --tile-warning: var(--warning-solid); --tile-danger: var(--danger-solid);
  --edge-info: var(--on-navy-info); --edge-ok: var(--on-navy-ok); --edge-warning: var(--on-navy-warning); --edge-danger: var(--on-navy-danger);
}
body:not(.signin-mode) .stat-tile, html:not([data-theme="dark"]) body:not(.signin-mode) .stat-tile {
  --tone: var(--tile-info); --edge: var(--edge-info);
  position: relative; overflow: hidden; border: 0; color: #fff;
  border-left: 4px solid var(--edge);
  background: linear-gradient(135deg, var(--tone) 0%, var(--rail-2) 62%, var(--rail) 100%);
  box-shadow: 0 10px 24px -8px color-mix(in srgb, var(--edge) 55%, transparent), 0 2px 6px rgba(4, 12, 31, .25), inset 0 1px 0 rgba(255, 255, 255, .22);
}
body:not(.signin-mode) .stat-tile.ok, html:not([data-theme="dark"]) body:not(.signin-mode) .stat-tile.ok { --tone: var(--tile-ok); --edge: var(--edge-ok); background: linear-gradient(135deg, var(--tone) 0%, var(--rail-2) 62%, var(--rail) 100%); }
body:not(.signin-mode) .stat-tile.warning, html:not([data-theme="dark"]) body:not(.signin-mode) .stat-tile.warning { --tone: var(--tile-warning); --edge: var(--edge-warning); background: linear-gradient(135deg, var(--tone) 0%, var(--rail-2) 62%, var(--rail) 100%); }
body:not(.signin-mode) .stat-tile.danger, html:not([data-theme="dark"]) body:not(.signin-mode) .stat-tile.danger { --tone: var(--tile-danger); --edge: var(--edge-danger); background: linear-gradient(135deg, var(--tone) 0%, var(--rail-2) 62%, var(--rail) 100%); }
body:not(.signin-mode) .stat-tile.info, html:not([data-theme="dark"]) body:not(.signin-mode) .stat-tile.info { background: linear-gradient(135deg, var(--tone) 0%, var(--rail-2) 62%, var(--rail) 100%); }
body:not(.signin-mode) .stat-tile::before {
  content: ""; position: absolute; inset: 0 0 55% 0; pointer-events: none;
  background: linear-gradient(180deg, rgba(255, 255, 255, .16), rgba(255, 255, 255, 0));
}
body:not(.signin-mode) .stat-tile::after {
  content: ""; position: absolute; width: 150px; height: 150px; right: -50px; top: -70px; border-radius: 50%; pointer-events: none;
  background: radial-gradient(circle, color-mix(in srgb, var(--edge) 45%, transparent), transparent 70%);
}
body:not(.signin-mode) .stat-tile :is(.stat-label, .stat-value, .stat-hint, .stat-open) { position: relative; z-index: 1; color: #fff; text-shadow: 0 1px 2px rgba(0, 0, 0, .3); }
body:not(.signin-mode) .stat-tile .stat-label { color: color-mix(in srgb, var(--edge) 35%, #ffffff); }
body:not(.signin-mode) .stat-tile .stat-hint { color: rgba(255, 255, 255, .9); }
body:not(.signin-mode) a.stat-tile:hover { box-shadow: 0 16px 30px -10px color-mix(in srgb, var(--edge) 65%, transparent), 0 2px 6px rgba(4, 12, 31, .25), inset 0 1px 0 rgba(255, 255, 255, .22); }
body:not(.signin-mode) a.stat-tile:focus-visible { outline: 3px solid var(--edge); outline-offset: 3px; }

/* Tabs and primary buttons use the same rail navy, with the brand orange as the "you are here" underline. */
.dash-tab[aria-selected="true"] {
  background: linear-gradient(180deg, var(--rail-2), var(--rail)); color: #fff;
  box-shadow: inset 0 -3px 0 var(--on-navy-accent), 0 6px 14px -6px rgba(7, 21, 48, .7), inset 0 1px 0 rgba(255, 255, 255, .18);
}
html:not([data-theme="dark"]) body:not(.signin-mode) .button:not(.secondary):not(.danger) { background: linear-gradient(180deg, #1f3d8f, var(--rail)); }

/* Panel headers: a pale wash of the rail navy with a navy rule, instead of the lilac-blue band. */
html:not([data-theme="dark"]) body:not(.signin-mode) .panel > .panel-head {
  background: linear-gradient(180deg, #f6f8fc, #e8edf6); border-bottom: 3px solid var(--rail-2);
}
html:not([data-theme="dark"]) body:not(.signin-mode) .panel > .panel-head :is(h2, h3) { color: var(--rail); }

/* Contractors on site pill: names of the first two people under the count. */
.ts-pill .ts-names { display: block; max-width: 14rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .72rem; }
.ts-pill .ts-names:empty { display: none; }

/* Camera pan, tilt and zoom pad (RJL, 18 Nov 2026): a cross of direction buttons with home in the middle, zoom beside. */
.ptz-wrap { display: flex; flex-wrap: wrap; align-items: center; gap: 1rem; }
.ptz-pad { display: grid; grid-template-columns: repeat(3, 3.25rem) 1rem 3.25rem; grid-template-rows: repeat(3, 3.25rem); gap: .35rem; padding: .6rem; border-radius: 12px;
  background: linear-gradient(180deg, var(--rail-2, #0d2247), var(--rail, #071530)); box-shadow: 0 8px 20px -10px rgba(7, 21, 48, .8); }
.ptz-pad:focus-visible { outline: 3px solid #ffffff; outline-offset: 3px; }
.ptz-btn { display: grid; place-items: center; border: 1px solid rgba(255, 255, 255, .25); border-radius: 10px; background: rgba(255, 255, 255, .08); color: #fff; font-size: 1.3rem; font-weight: 700; cursor: pointer; }
.ptz-btn:hover { background: rgba(255, 255, 255, .2); } .ptz-btn:active { transform: translateY(1px); }
.ptz-btn:focus-visible { outline: 3px solid #ffffff; outline-offset: 1px; }
.ptz-pad[aria-busy="true"] .ptz-btn { opacity: .6; }
.ptz-up { grid-area: 1 / 2; } .ptz-left { grid-area: 2 / 1; } .ptz-home { grid-area: 2 / 2; } .ptz-right { grid-area: 2 / 3; } .ptz-down { grid-area: 3 / 2; }
.ptz-zoom-in { grid-area: 1 / 5; } .ptz-zoom-out { grid-area: 3 / 5; }
.ptz-status { margin: 0; max-width: 32rem; font-weight: 600; }

/* Cameras > Live view: the CCTV channel wall (RJL, 18 Nov 2026). Recorder-style grid of 4, 6, 8, 16 or 32 channels.
 * Tiles tilt slightly towards the pointer and lift, so the wall reads as something to press. Reduced motion: flat. */
.cctv-bar { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem; }
.cctv-label { font-size: .75rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted, #475467); }
.cctv-layouts { display: inline-flex; border: 1px solid var(--border, #d0d7e6); border-radius: 8px; overflow: hidden; }
.cctv-layout { min-width: 2.9rem; min-height: 2.75rem; border: 0; border-right: 1px solid var(--border, #d0d7e6); background: var(--surface, #fff); color: var(--text, #101828); font: inherit; font-weight: 700; cursor: pointer; }
.cctv-layout:last-child { border-right: 0; }
.cctv-layout[aria-checked="true"] { background: linear-gradient(180deg, var(--rail-2, #0d2247), var(--rail, #071530)); color: #fff; box-shadow: inset 0 -3px 0 var(--on-navy-accent); }
.cctv-layout:focus-visible { outline: 3px solid #ffffff; outline-offset: -3px; }
.cctv-note { margin: .2rem 0 .6rem; font-weight: 600; }
.cctv-grid { display: grid; grid-template-columns: repeat(var(--cols, 2), minmax(0, 1fr)); gap: .45rem; padding: .45rem; border-radius: 12px;
  background: linear-gradient(180deg, #0b1430, #050a18); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .06), 0 14px 30px -18px rgba(5, 10, 24, .9); perspective: 1200px; }
.cctv-tile { position: relative; display: block; width: 100%; aspect-ratio: 16 / 9; padding: 0; overflow: hidden; border: 1px solid rgba(255, 255, 255, .12); border-radius: 6px;
  background: radial-gradient(120% 90% at 50% 40%, #2a3350, #11182c); color: #fff; font: inherit; text-align: left; transition: transform .18s ease-out, box-shadow .18s ease-out; }
button.cctv-tile { cursor: pointer; }
button.cctv-tile:hover { transform: translateY(-3px) rotateX(4deg); box-shadow: 0 14px 22px -12px rgba(0, 0, 0, .9), 0 0 0 2px var(--on-navy-accent); z-index: 1; }
button.cctv-tile:focus-visible { outline: 3px solid #ffffff; outline-offset: 2px; z-index: 1; }
.cctv-tile.empty { opacity: .55; }
.cctv-canvas { display: block; width: 100%; height: 100%; object-fit: cover; }
.cctv-cap { position: absolute; left: 0; right: 0; bottom: 0; display: flex; align-items: center; gap: .35rem; padding: .25rem .45rem; font-size: .72rem;
  background: linear-gradient(0deg, rgba(0, 0, 0, .78), transparent); color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cctv-cap b { color: #c7d3ee; } .cctv-ptz { margin-left: auto; padding: 0 .3rem; border-radius: 4px; background: var(--on-navy-accent); color: #06103a; font-style: normal; font-weight: 800; font-size: .65rem; }
.cctv-tile.no-picture::after { content: "No picture"; position: absolute; inset: 0; display: grid; place-items: center; font-size: .75rem; color: #c9d2e6; }
/* A camera with an unanswered flame or weapon alert: red edge on its tile, so it stands out in a full wall. */
.cctv-tile.flame-spotted { outline: 3px solid #ff6b5e; outline-offset: -3px; }
.cctv-grid[data-layout="16"] .cctv-cap, .cctv-grid[data-layout="32"] .cctv-cap { font-size: .62rem; padding: .15rem .3rem; }
.cctv-focus { display: grid; gap: .7rem; }
.cctv-focus-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .6rem; }
.cctv-focus-head h3 { margin: 0; }
.cctv-canvas.big { aspect-ratio: 16 / 9; height: auto; max-width: 1280px; border-radius: 10px; background: #0b1430; touch-action: none; cursor: grab; }
.cctv-hint { margin: 0; color: var(--muted, #475467); }
@media (max-width: 720px) {
  .cctv-grid[data-layout="16"], .cctv-grid[data-layout="32"] { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .cctv-grid[data-layout="6"], .cctv-grid[data-layout="8"] { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (prefers-reduced-motion: reduce) { button.cctv-tile, button.cctv-tile:hover { transition: none; transform: none; } }
html[data-theme="dark"] .cctv-layout { background: var(--surface); color: var(--text); }
/* Side menu footer (RJL, 18 Nov 2026): account settings (dark mode, sign out) and the connection state live here,
 * off the main screen. The settings fold away so they are never pressed by accident. */
.side-footer { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; }
.side-settings { flex: 1 0 100%; border: 1px solid rgba(255, 255, 255, .18); border-radius: 8px; }
.side-settings > summary { cursor: pointer; padding: .55rem .7rem; color: #c7d3ee; font-size: .78rem; letter-spacing: .1em; text-transform: uppercase; list-style-position: inside; }
.side-settings > summary:focus-visible { outline: 3px solid #fff; outline-offset: 2px; }
.side-settings-body { display: grid; gap: .4rem; padding: 0 .6rem .6rem; }
.side-button { min-height: 2.5rem; padding: .4rem .7rem; border: 1px solid rgba(255, 255, 255, .3); border-radius: 6px; background: rgba(255, 255, 255, .06); color: #fff; font: inherit; font-size: .85rem; text-align: left; cursor: pointer; }
.side-button:hover { background: rgba(255, 255, 255, .16); }
.side-button:focus-visible { outline: 3px solid #fff; outline-offset: 2px; }
.side-connection { flex: 1 0 100%; display: flex; align-items: center; gap: .4rem; margin: 0; font-size: .78rem; color: #dbe4ff; }
.side-connection strong { font-weight: 700; }
.side-connection.ok strong { color: var(--on-navy-ok); } .side-connection.warning strong { color: var(--on-navy-warning); }
.side-lock { width: .7rem; height: .55rem; border: 2px solid currentColor; border-radius: 2px; position: relative; margin-top: .25rem; }
.side-lock::before { content: ""; position: absolute; left: 50%; top: -.55rem; width: .45rem; height: .45rem; transform: translateX(-50%); border: 2px solid currentColor; border-bottom: 0; border-radius: .3rem .3rem 0 0; }
/* On phones the side menu sits above the page; keep its settings and connection state reachable there. */
@media (max-width: 720px) { .side-footer { display: flex; } }

/* PA bar (RJL, 18 Nov 2026): the first row of the top strip on every page. Type, check, announce. */
#top-strip .pa-bar { flex: 1 0 100%; grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: center; gap: .5rem .6rem; padding: .55rem .7rem;
  border-radius: 10px; background: linear-gradient(135deg, var(--rail-2, #0d2247), var(--rail, #071530)); color: #fff; box-shadow: 0 8px 18px -10px rgba(7, 21, 48, .8); }
#top-strip .pa-bar[hidden] { display: none; }
.pa-bar.live { box-shadow: 0 0 0 3px var(--on-navy-accent), 0 8px 18px -10px rgba(7, 21, 48, .8); }
.pa-switch { display: grid; min-width: 4.5rem; min-height: 2.75rem; padding: .25rem .6rem; border-radius: 8px; border: 1px solid rgba(255, 255, 255, .35); background: rgba(255, 255, 255, .06); color: #fff; font: inherit; text-align: left; cursor: pointer; }
.pa-switch small { font-size: .65rem; letter-spacing: .1em; color: #c7d3ee; } .pa-switch strong { font-size: .9rem; }
.pa-switch.on { background: var(--ok-solid); border-color: var(--ok-fill); }
.pa-switch:disabled { cursor: not-allowed; opacity: .7; }
.pa-modes { display: inline-flex; border: 1px solid rgba(255, 255, 255, .35); border-radius: 8px; overflow: hidden; }
.pa-mode { min-height: 2.75rem; padding: .3rem .7rem; border: 0; background: transparent; color: #fff; font: inherit; font-size: .82rem; cursor: pointer; }
.pa-mode[aria-checked="true"] { background: var(--on-navy-accent); color: #06103a; font-weight: 700; }
.pa-mode:disabled { cursor: not-allowed; opacity: .6; }
.pa-field { flex: 1 1 18rem; display: flex; align-items: center; gap: .4rem; min-width: 0; background: #fff; border-radius: 8px; padding: 0 .55rem; }
.pa-text { flex: 1; min-width: 0; min-height: 2.75rem; border: 0; background: transparent; color: #101828; font: inherit; font-size: 1rem; }
.pa-text:focus { outline: none; } .pa-field:focus-within { box-shadow: 0 0 0 3px var(--on-navy-accent); }
.pa-text:disabled { cursor: not-allowed; }
.pa-count { color: #475467; font-size: .72rem; white-space: nowrap; }
.pa-voice { min-height: 2.75rem; max-width: 13rem; border: 1px solid rgba(255,255,255,.35); border-radius: 10px; background: rgba(255,255,255,.08); color: #fff; font: inherit; font-size: .85rem; padding: 0 .6rem; }
.pa-voice option { color: #101828; }
.pa-voice:focus-visible { outline: 3px solid #ffffff; outline-offset: 2px; }
.pa-voice:disabled { opacity: .6; cursor: not-allowed; }
.pa-bar .button { min-height: 2.75rem; }
.pa-bar .button.armed { background: var(--danger-solid); border-color: var(--danger-fill); color: #fff; }
.pa-bar :is(button, a):focus-visible { outline: 3px solid #ffffff; outline-offset: 2px; }
.pa-link { color: #c7d3ee; font-size: .82rem; }
.pa-status { flex: 1 0 100%; margin: 0; min-height: 1.2em; font-size: .85rem; color: #dbe4ff; }
.pa-status:empty { display: none; }
.pa-status.ok { color: var(--on-navy-ok); } .pa-status.warning { color: var(--on-navy-warning); } .pa-status.danger { color: var(--on-navy-danger); }
/* The strip's own small/strong colours must not leak into the PA bar (contrast checked 18 Nov 2026). */
#top-strip .pa-bar .pa-switch small { color: #c7d3ee; }
#top-strip .pa-bar .pa-switch strong { color: #ffffff; }
#top-strip .pa-bar .pa-count, html[data-theme="dark"] #top-strip .pa-bar .pa-count { color: #475467; }

/* ---- Recorder-style control board under the CCTV wall (RJL, 18 Nov 2026) ---------------------------------
   Looks like the keyboard on a security recorder: a dark panel, a lit display, chunky keys. Orange is the
   portal's action colour; red is kept for Record only. */
.cctv-screen { display: grid; gap: .6rem; }
.cctv-screen:fullscreen { background: #02060f; padding: 1rem; align-content: center; overflow: auto; }
.cctv-screen:fullscreen .cctv-grid { max-height: calc(100vh - 2rem); }
.nvr-board { display: grid; grid-template-columns: minmax(16rem, 1.3fr) auto minmax(14rem, 1fr); grid-template-areas: "lcd pad nav" "rec pad nav" "form form form" "status status status";
  gap: .8rem 1rem; margin-top: .8rem; padding: 1rem; border-radius: 14px; color: #e8eefc;
  background: linear-gradient(180deg, #1a2336 0%, #0c1222 55%, #070b16 100%);
  border: 1px solid #2a3550; box-shadow: inset 0 1px 0 rgba(255,255,255,.08), 0 18px 30px -18px rgba(0,0,0,.8); }
.nvr-lcd { grid-area: lcd; display: grid; gap: .3rem; align-content: center; min-height: 5.2rem; padding: .7rem .9rem; border-radius: 8px;
  background: radial-gradient(120% 140% at 0 0, #13301f 0%, #06140c 70%); border: 1px solid var(--ok-text);
  box-shadow: inset 0 2px 8px rgba(0,0,0,.7), 0 0 0 3px #0a0f1b; font-variant-numeric: tabular-nums; }
.nvr-lcd-row { display: flex; align-items: baseline; justify-content: space-between; gap: .8rem; }
.nvr-lcd-ch { font-size: 1.6rem; letter-spacing: .06em; color: #7dffb0; text-shadow: 0 0 8px rgba(125,255,176,.55); }
.nvr-lcd-cam { font-size: .95rem; color: #b9f5cf; text-align: right; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nvr-lcd-clock { font-size: .82rem; color: #8fd9aa; }
.nvr-lcd-state { font-size: .78rem; font-weight: 800; letter-spacing: .1em; color: #8fd9aa; }
.nvr-lcd-state.live { color: #ff6b5f; text-shadow: 0 0 8px rgba(255,107,95,.6); }
.nvr-keypad { grid-area: pad; display: grid; grid-template-columns: repeat(3, 3.4rem); gap: .45rem; align-content: start; }
.nvr-nav { grid-area: nav; display: grid; grid-template-columns: 1fr 1fr; gap: .45rem; align-content: start; }
.nvr-rec { grid-area: rec; display: grid; grid-template-columns: 1fr 1fr; gap: .45rem; }
.nvr-key { min-height: 3rem; border-radius: 9px; border: 1px solid #34405c; color: #eef3ff; font: inherit; font-weight: 800; font-size: 1.05rem; cursor: pointer;
  background: linear-gradient(180deg, #2c3854 0%, #1a2337 100%); box-shadow: 0 3px 0 #050912, inset 0 1px 0 rgba(255,255,255,.12);
  transition: transform .06s ease, box-shadow .06s ease, background .15s ease; }
.nvr-key:hover { background: linear-gradient(180deg, #36446a 0%, #1f2a42 100%); }
.nvr-key:active { transform: translateY(2px); box-shadow: 0 1px 0 #050912, inset 0 1px 0 rgba(255,255,255,.08); }
.nvr-key:focus-visible { outline: 3px solid #ffffff; outline-offset: 2px; }
.nvr-key.nvr-fn { font-size: .8rem; color: #c9d4ee; }
.nvr-key.nvr-enter { font-size: .8rem; background: linear-gradient(180deg, var(--on-navy-accent) 0%, var(--on-navy-accent) 100%); border-color: var(--on-navy-accent); color: #06103a; }
.nvr-key.nvr-wide { font-size: .88rem; padding: 0 .7rem; }
.nvr-key.on { background: linear-gradient(180deg, var(--on-navy-accent) 0%, var(--on-navy-accent) 100%); color: #06103a; border-color: var(--on-navy-accent); }
.nvr-key.nvr-save { color: #c7d3ee; }
.nvr-key.nvr-record { color: var(--on-navy-danger); border-color: var(--danger-text); }
.nvr-form { grid-area: form; display: grid; gap: .55rem; padding: .9rem; border-radius: 10px; background: rgba(255,255,255,.05); border: 1px solid #34405c; }
.nvr-form[hidden] { display: none; }
.nvr-form h4 { margin: 0; font-size: 1rem; }
.nvr-form label { font-weight: 700; font-size: .85rem; }
.nvr-minutes { display: flex; flex-wrap: wrap; gap: .4rem; }
.nvr-min { min-height: 2.6rem; padding: 0 .8rem; border-radius: 8px; border: 1px solid #34405c; background: #141c2e; color: #e8eefc; font: inherit; font-weight: 700; cursor: pointer; }
.nvr-min[aria-checked="true"] { background: var(--on-navy-accent); border-color: var(--on-navy-accent); color: #06103a; }
.nvr-min:focus-visible { outline: 3px solid #ffffff; outline-offset: 2px; }
.nvr-reason { min-height: 2.75rem; padding: 0 .7rem; border-radius: 8px; border: 1px solid #45526f; background: #0b1120; color: #fff; font: inherit; font-size: 1rem; }
.nvr-reason:focus { outline: 3px solid #ffffff; outline-offset: 1px; }
.nvr-form-note { margin: 0; font-size: .82rem; color: #b8c3dc; }
.nvr-form-actions { display: flex; gap: .5rem; flex-wrap: wrap; }
.nvr-status { grid-area: status; margin: 0; min-height: 1.2em; font-size: .88rem; font-weight: 600; color: #cfd8ee; }
.nvr-status.ok { color: var(--on-navy-ok); } .nvr-status.danger { color: var(--on-navy-danger); } .nvr-status.warning { color: var(--on-navy-warning); }
@media (max-width: 900px) {
  .nvr-board { grid-template-columns: 1fr; grid-template-areas: "lcd" "pad" "nav" "rec" "form" "status"; }
  .nvr-keypad { grid-template-columns: repeat(3, minmax(3.4rem, 1fr)); }
}
@media (prefers-reduced-motion: reduce) { .nvr-key { transition: none; } .nvr-key:active { transform: none; } }

/* ---- Panel headings, site wide (RJL, 18 Nov 2026: "make all of these tabs a different colour so you can tell they
   are a heading, interactive and nice like the others, matching the theme"). Same navy as the side dashboard with the
   orange accent bar; on hover a light sweep runs across and the orange bar grows. Overrides the earlier pale heads. */
body:not(.signin-mode) .panel > .panel-head {
  position: relative; overflow: hidden; isolation: isolate;
  background: linear-gradient(135deg, var(--rail-2, #0d2247) 0%, var(--rail, #071530) 70%) !important;
  border-bottom: 0 !important; border-radius: 10px 10px 0 0;
  padding-left: 1.15rem;
  box-shadow: inset 5px 0 0 var(--rail-accent, var(--on-navy-accent)), inset 0 -1px 0 rgba(255, 255, 255, .08);
  transition: box-shadow .25s ease, transform .25s ease;
}
body:not(.signin-mode) .panel > .panel-head :is(h2, h3) {
  color: #fff !important; text-transform: uppercase; letter-spacing: .06em; font-size: 1rem;
  text-shadow: 0 1px 0 rgba(0, 0, 0, .35);
}
body:not(.signin-mode) .panel > .panel-head :is(p, small, .message) { color: #c9d4ee !important; }
/* the light sweep */
body:not(.signin-mode) .panel > .panel-head::after {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background: linear-gradient(100deg, transparent 30%, rgba(255, 255, 255, .14) 50%, transparent 70%);
  transform: translateX(-120%); transition: transform .7s ease;
}
body:not(.signin-mode) .panel:is(:hover, :focus-within) > .panel-head::after { transform: translateX(120%); }
body:not(.signin-mode) .panel:is(:hover, :focus-within) > .panel-head {
  box-shadow: inset 9px 0 0 var(--rail-accent, var(--on-navy-accent)), inset 0 -2px 0 var(--rail-accent, var(--on-navy-accent)), 0 6px 16px -8px rgba(141, 180, 255, .55);
}
/* buttons sitting in a heading: glass on navy, orange on hover */
/* Buttons in the navy panel headers: see buttons.css (one source of truth). */
@media (prefers-reduced-motion: reduce) {
  body:not(.signin-mode) .panel > .panel-head, body:not(.signin-mode) .panel > .panel-head::after,
  body:not(.signin-mode) .panel > .panel-head .button { transition: none; }
  body:not(.signin-mode) .panel > .panel-head::after { display: none; }
}
/* Strip tiles are one colour (RJL, 20 Nov 2026: "these colours don't suit, make them one colour only"): the same navy
   with a blue edge whatever the state. The state is still given in the words on each tile and by the small dot on the
   system-state tile (green, amber or red with a white ring), so colour is never the only signal and nothing is lost. */
:is(.ts-state, .ts-pill, .ts-weather) {
  --edge: var(--on-navy-accent, #84caff);
  position: relative; color: #fff !important; text-shadow: none;
  border: 0 !important; border-left: 3px solid var(--edge) !important; border-radius: 8px;
  /* Flat read-only status cards (RJL, 20 Nov 2026: status must not look like buttons): solid navy, no shine, no shadow,
     no lift on hover. Buttons have the shadow and the lift; cards never do. */
  background: var(--rail-2, #0d2247) !important; box-shadow: none !important; transition: none; cursor: default;
}
:is(.ts-state, .ts-pill, .ts-weather) > * { position: relative; z-index: 1; }
:is(.ts-state, .ts-pill, .ts-weather) :is(small, strong, a, span) { color: #fff !important; }
:is(.ts-state, .ts-pill, .ts-weather) small { opacity: .88; }
:is(.ts-state, .ts-pill, .ts-weather):focus-visible { outline: 3px solid #fff; outline-offset: 2px; }
.ts-state .ts-dot { width: 11px; height: 11px; box-shadow: 0 0 0 2px #fff; }
.ts-state .ts-dot.ok { background: var(--ok-fill) !important; } .ts-state .ts-dot.warning { background: var(--warning-fill) !important; } .ts-state .ts-dot.danger { background: var(--danger-fill) !important; }
/* A tab the beacon is pointing at pulses a ring so the eye lands on it. */
:is(.ts-state, .ts-pill, .ts-weather).flag { animation: tl-flag 1.8s ease-in-out infinite; }
@keyframes tl-flag { 0%, 100% { outline: 2px solid transparent; outline-offset: 2px; } 50% { outline: 2px solid color-mix(in srgb, var(--edge) 80%, #fff); outline-offset: 4px; } }

/* Always-on 3D site status beacon (RJL, 20 Nov 2026): fixed bottom-right, never blocks the page. */
.site-beacon { --bk: var(--ok-fill); position: fixed; right: 1.25rem; bottom: 1.25rem; z-index: 40; display: flex; align-items: center; gap: .7rem; max-width: min(22rem, calc(100vw - 36px));
  padding: .55rem .9rem .55rem .6rem; border: 0; border-left: 4px solid var(--bk); border-radius: 12px; color: #fff; cursor: pointer; text-align: left; font: inherit;
  background: linear-gradient(135deg, #0d2247 0%, #071530 100%); box-shadow: 0 14px 30px -10px color-mix(in srgb, var(--bk) 60%, transparent), 0 2px 8px rgba(4, 12, 31, .35), inset 0 1px 0 rgba(255, 255, 255, .2); }
/* The status cube and the Ask Keys button are two separate things (RJL, 20 Nov 2026: "I want them separated"):
   when Ask Keys is on the page the cube sits above it with a clear gap, never underneath it. */
body:has(.keys-ai-fab) .site-beacon:not(.in-bar) { bottom: 7rem; }
/* In the title bar: part of the page flow, never over content. Compact so the bar keeps its height. */
.site-beacon.in-bar { position: static; margin-left: auto; padding: .5rem .95rem .5rem .6rem; gap: .75rem; max-width: min(34rem, 62vw);
  box-shadow: 0 2px 8px rgba(4, 12, 31, .25), inset 0 1px 0 rgba(255, 255, 255, .2); }
.site-beacon.in-bar .bk-scene, .site-beacon.in-bar .bk-cube { width: 40px; height: 40px; }
.site-beacon.in-bar .bk-face.front { transform: translateZ(20px); }
.site-beacon.in-bar .bk-face.back { transform: rotateY(180deg) translateZ(20px); }
.site-beacon.in-bar .bk-face.left { transform: rotateY(-90deg) translateZ(20px); }
.site-beacon.in-bar .bk-face.right { transform: rotateY(90deg) translateZ(20px); }
.site-beacon.in-bar .bk-face.top { transform: rotateX(90deg) translateZ(20px); }
.site-beacon.in-bar .bk-face.bottom { transform: rotateX(-90deg) translateZ(20px); }
.site-beacon.in-bar .bk-word { font-size: 1.1rem; }
.site-beacon.in-bar .bk-detail { font-size: .85rem; }
.site-beacon.warning { --bk: var(--warning-fill); }
.site-beacon.danger { --bk: var(--danger-fill); }
.site-beacon:focus-visible { outline: 3px solid #fff; outline-offset: 2px; }
.site-beacon .bk-text { display: grid; min-width: 0; }
.site-beacon .bk-word { font-size: 1rem; letter-spacing: .02em; }
.site-beacon .bk-detail { opacity: .88; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* The reasons (RJL, 20 Nov 2026: "make this bigger and have more info about the issue"): one line per flagged tab,
   the tab name in bold then what it says. Wraps rather than cutting off, so the reason is always readable. */
.site-beacon .bk-issues { display: grid; gap: .2rem; margin-top: .3rem; }
.site-beacon .bk-issues:empty { display: none; }
.site-beacon .bk-issue { display: block; padding-left: .55rem; border-left: 3px solid var(--warning-fill); font-size: .85rem; line-height: 1.3; white-space: normal; }
.site-beacon .bk-issue.danger { border-left-color: var(--danger-fill); }
.site-beacon .bk-issue b { margin-right: .35rem; }
.bk-scene { width: 38px; height: 38px; perspective: 160px; flex: none; }
.bk-cube { position: relative; display: block; width: 38px; height: 38px; transform-style: preserve-3d; animation: bk-spin 7s linear infinite; }
.bk-face { position: absolute; inset: 0; display: block; border: 1px solid rgba(255, 255, 255, .55); background: color-mix(in srgb, var(--bk) 78%, transparent); box-shadow: inset 0 0 12px rgba(255, 255, 255, .35), 0 0 14px color-mix(in srgb, var(--bk) 70%, transparent); }
.bk-face.front { transform: translateZ(19px); }
.bk-face.back { transform: rotateY(180deg) translateZ(19px); }
.bk-face.left { transform: rotateY(-90deg) translateZ(19px); }
.bk-face.right { transform: rotateY(90deg) translateZ(19px); }
.bk-face.top { transform: rotateX(90deg) translateZ(19px); }
.bk-face.bottom { transform: rotateX(-90deg) translateZ(19px); }
.site-beacon.danger .bk-cube { animation-duration: 2.2s; }
@keyframes bk-spin { from { transform: rotateX(-24deg) rotateY(0deg); } to { transform: rotateX(-24deg) rotateY(360deg); } }
@media (prefers-reduced-motion: reduce) { .bk-cube { animation: none; transform: rotateX(-24deg) rotateY(35deg); } :is(.ts-state, .ts-pill, .ts-weather).flag { animation: none; outline: 2px solid var(--edge); outline-offset: 3px; } }
@media print { .site-beacon { display: none; } }

/* Children to watch: heading with Minimise, real faces. */
.ts-watch-head { display: flex; align-items: center; justify-content: space-between; gap: .8rem; }
.ts-watch-head h2 { margin: 0; }
.ts-watch.min { padding-block: .45rem; }
.ts-watch-toggle { min-height: 2.5rem; padding: 0 1rem; border-radius: 999px; border: 1px solid var(--warning-fill); background: #fff; color: var(--warning-text); font: inherit; font-weight: 800; cursor: pointer; }
.ts-watch-toggle:hover { background: var(--warning-solid); color: #fff; }
.ts-watch-toggle:focus-visible { outline: 3px solid #ffffff; outline-offset: 2px; }
.ts-watch-list { margin-top: .6rem; }
.ts-watch-card .ts-face { width: 56px; height: 56px; box-shadow: 0 0 0 3px #fff, 0 0 0 5px var(--danger-fill); }
.ts-face img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ts-watch-alert { color: var(--danger-text) !important; }

/* Student profile photo card */
.sp-card { display: grid; grid-template-columns: min(320px, 45%) 1fr; gap: 1.25rem; align-items: center; }
@media (max-width: 560px) { .sp-card { grid-template-columns: 1fr; } }
.sp-face { width: 100%; aspect-ratio: 1 / 1; border-radius: 18px; overflow: hidden; background: linear-gradient(135deg, #1e3a8a, #071530); display: grid; place-items: center; box-shadow: 0 0 0 4px #fff, 0 12px 24px -10px rgba(7, 21, 48, .6); }
.sp-face img { width: 100%; height: 100%; object-fit: contain; background: #fff; } /* contain: the whole ID photo shows, never cropped */
.sp-initials { color: #fff; font-size: 5rem; font-weight: 800; }
.sp-who h3 { margin: 0 0 .25rem; font-size: 1.3rem; }
.sp-who p { margin: 0; color: var(--muted); }
.sp-controls { grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: center; gap: .6rem; }
.sp-controls input[type=file] { position: absolute; width: 1px; height: 1px; opacity: 0; }
.sp-file { display: inline-flex; align-items: center; min-height: 2.75rem; padding: 0 1rem; border-radius: 10px; border: 2px dashed #1e3a8a; color: #1e3a8a; font-weight: 800; cursor: pointer; }
.sp-controls input[type=file]:focus-visible + .sp-file { outline: 3px solid #ffffff; outline-offset: 2px; }
.sp-consent { font-size: .85rem; display: inline-flex; gap: .4rem; align-items: center; }
.sp-note { margin: 0; font-size: .85rem; } .sp-note.ok { color: var(--ok-text); } .sp-note.danger { color: var(--danger-text); }

/* ---- Full student record (RJL, 19 Nov 2026) ---------------------------------------------------------------- */
.sr-wrap { display: grid; gap: .9rem; }
.sr-critical { display: flex; flex-wrap: wrap; gap: .5rem; }
.sr-alert { display: inline-flex; align-items: center; min-height: 2.4rem; padding: .3rem .9rem; border-radius: 999px; font-weight: 800; color: #fff;
  border-bottom: 3px solid rgba(0, 0, 0, .25); box-shadow: 0 8px 16px -10px rgba(0, 0, 0, .5); }
.sr-alert.danger { background: linear-gradient(160deg, var(--danger-solid), var(--danger-solid)); }
.sr-alert.warning { background: linear-gradient(160deg, var(--warning-solid), var(--warning-solid)); }
.sr-alert.ok { background: linear-gradient(160deg, var(--ok-solid), var(--ok-solid)); }
.sr-tabs { display: flex; flex-wrap: wrap; gap: .4rem; border-bottom: 2px solid #e4e7ec; }
.sr-tab { min-height: 2.75rem; padding: 0 1rem; border: 0; border-radius: 10px 10px 0 0; background: transparent; color: #344054; font: inherit; font-weight: 800; cursor: pointer; }
.sr-tab[aria-selected="true"] { background: linear-gradient(135deg, var(--rail-2, #0d2247), var(--rail, #071530)); color: #fff; box-shadow: inset 0 -3px 0 var(--rail-accent, var(--on-navy-accent)); }
.sr-tab:focus-visible { outline: 3px solid #ffffff; outline-offset: 2px; }
.sr-section { margin-bottom: 1rem; }
.sr-section-head { display: flex; justify-content: space-between; align-items: center; gap: .6rem; }
.sr-section-head h4 { margin: .2rem 0; font-size: 1rem; text-transform: uppercase; letter-spacing: .04em; color: #0d2247; }
.sr-list { list-style: none; margin: .4rem 0 0; padding: 0; display: grid; gap: .6rem; }
.sr-empty { color: var(--muted); font-size: .9rem; }
.sr-card { border: 1px solid #e4e7ec; border-left: 5px solid #1e3a8a; border-radius: 12px; padding: .7rem .9rem; background: #fff; box-shadow: 0 6px 14px -10px rgba(7, 21, 48, .5); transition: transform .15s ease; }
.sr-card:hover { transform: translateY(-2px); }
.sr-card.resolved { opacity: .65; border-left-color: #98a2b3; }
.sr-card-top { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; }
.sr-date { color: var(--muted); font-size: .85rem; }
.sr-details { display: grid; grid-template-columns: max-content 1fr; gap: .15rem .8rem; margin: .5rem 0 0; font-size: .9rem; }
.sr-details dt { color: #475467; font-weight: 700; }
.sr-details dd { margin: 0; }
.sr-card-foot { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem; margin-top: .5rem; }
.sr-keep { color: var(--muted); }
.sr-form { display: grid; gap: .55rem; padding: .9rem; border: 2px dashed #1e3a8a; border-radius: 12px; background: #f5f8ff; margin-top: .5rem; }
.sr-guide { margin: 0; padding: .55rem .7rem; background: #fff; border-left: 4px solid var(--on-navy-accent); border-radius: 6px; font-size: .9rem; }
.sr-field { display: grid; gap: .2rem; }
.sr-field span { font-weight: 700; font-size: .88rem; }
.sr-field :is(input:not([type=checkbox]), select, textarea) { min-height: 2.6rem; padding: .4rem .6rem; border: 1px solid #98a2b3; border-radius: 8px; font: inherit; }
.sr-field input[type=checkbox] { width: 1.4rem; height: 1.4rem; }
.sr-field small { color: var(--muted); }
.sr-form-actions { display: flex; flex-wrap: wrap; gap: .5rem; }
.sr-example-banner { margin: 0; padding: .7rem 1rem; border-radius: 10px; background: linear-gradient(135deg, #e8edff, #e8edff); border: 1px solid var(--warning-fill); font-weight: 700; color: var(--warning-text); }
@media (prefers-reduced-motion: reduce) { .sr-card { transition: none; } .sr-card:hover { transform: none; } }
/* Sick bay phone: status bar and example mode (19 Nov 2026). */
.sb-phone-bar { display: flex; justify-content: space-between; padding: 0 .4rem; font-size: .68rem; font-weight: 600; color: #d0d8ea; letter-spacing: .02em; }
.sb-phone-signal { display: inline-flex; align-items: center; gap: .3rem; }
.sb-phone-signal::before { content: ""; width: 14px; height: 9px; background: linear-gradient(90deg, currentColor 0 18%, transparent 18% 27%, currentColor 27% 45%, transparent 45% 54%, currentColor 54% 72%, transparent 72% 81%, currentColor 81%); clip-path: polygon(0 100%, 100% 0, 100% 100%); }
.sb-phone.is-example { opacity: .96; }
.sb-phone.is-example .sb-thread { max-height: 18rem; }
.sb-example-tag { margin: 0; padding: .4rem .6rem; border-radius: 10px; background: var(--warning-tint); color: var(--warning-text); font-size: .74rem; font-weight: 600; }

/* Classroom wall (RJL, 19 Nov 2026): a giant tablet across the page with every classroom on it.
   Tapping a room shows that room's tablet screen inside the same device. Words always carry the state, not colour alone. */
.wall-device { position: relative; width: 100%; min-height: min(78vh, 56rem); padding: 1.6rem; border-radius: 2.2rem;
  background: linear-gradient(160deg, #1b2440 0%, #0b1022 60%, #05070f 100%);
  box-shadow: 0 0 0 2px #2a3558, 0 30px 60px -25px rgba(5, 10, 30, 0.75), inset 0 1px 0 rgba(255, 255, 255, 0.08); }
.wall-camera { position: absolute; top: 0.62rem; left: 50%; width: 0.55rem; height: 0.55rem; margin-left: -0.275rem; border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #4a5b8c, #0b1022 70%); box-shadow: 0 0 0 2px #10172f; }
.wall-glass { display: grid; gap: 1rem; align-content: start; min-height: calc(min(78vh, 56rem) - 3.2rem); padding: 1.1rem; border-radius: 1.2rem;
  background: linear-gradient(180deg, #f7f9fc 0%, #eef2f8 100%); box-shadow: inset 0 0 0 1px #d0d7e5, inset 0 6px 18px -10px rgba(10, 26, 79, 0.35); }
.wall-status { display: flex; flex-wrap: wrap; align-items: center; gap: 0.6rem 1rem; padding-bottom: 0.7rem; border-bottom: 3px solid var(--orange); }
.wall-title { font-size: 1.35rem; color: var(--navy); text-transform: uppercase; letter-spacing: 0.02em; margin-right: auto; }
.wall-stat { padding: 0.3rem 0.7rem; border-radius: 999px; background: #fff; border: 1px solid #d0d7e5; font-size: 0.8rem; color: var(--navy); }
.wall-stat.ok { border-color: var(--ok-fill); background: var(--ok-tint); color: var(--ok-text); }
.wall-stat.danger { border-color: var(--danger-fill); background: var(--danger-tint); color: var(--danger-text); font-weight: 700; }
.wall-live { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; padding: 0.7rem; border-radius: 0.8rem;
  background: var(--danger-tint); border: 2px solid var(--danger-fill); animation: room-alert 1.6s ease-in-out infinite; }
.wall-live-label { font-weight: 800; color: var(--danger-text); text-transform: uppercase; font-size: 0.8rem; margin-right: 0.4rem; }
/* Classroom rows (RJL, 20 Nov 2026): the class name large and in colour, a white card beside it. Several columns on a
   wide screen so a whole school fits without scrolling. */
.wall-grid { display: grid; gap: 0.9rem 1.4rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 21rem), 1fr)); }
/* Class colours: decoration only, chosen by year level. No red and no amber here: on this screen those mean a room
   needs help. Each is 4.5:1 or better on white. */
.wall-hue-0 { --class: #1d4ed8; }
.wall-hue-1 { --class: #0f766e; }
.wall-hue-2 { --class: #6d28d9; }
.wall-hue-3 { --class: #2f7d32; }
.wall-hue-4 { --class: #0e7490; }
.wall-tile { --edge: var(--class); --tint: #ffffff; display: flex; align-items: stretch; gap: 0; min-height: 5.6rem; padding: 0; border: 0;
  background: none; text-align: left; font: inherit; cursor: pointer; color: #101828; border-radius: 0.9rem;
  transition: transform .15s var(--ease); }
.wall-tile:hover, .wall-tile:focus-visible { transform: translateY(-2px); outline: 3px solid var(--blue); outline-offset: 3px; }
.wall-room { flex: 0 0 6.3rem; width: 6.3rem; display: flex; align-items: center; justify-content: flex-end; padding-right: 0.35rem;
  margin-right: -0.45rem; position: relative; z-index: 1; font-size: 3.2rem; line-height: 1; font-weight: 800; letter-spacing: -0.03em;
  color: var(--edge); text-shadow: 3px 2px 0 rgba(16, 24, 40, 0.14); white-space: nowrap; }
.wall-room.mid { font-size: 2.45rem; }
.wall-room.long { font-size: 1.25rem; line-height: 1.1; letter-spacing: 0; text-align: right; white-space: normal; overflow-wrap: anywhere; text-shadow: 2px 1px 0 rgba(16, 24, 40, 0.12); }
.wall-card { flex: 1 1 auto; min-width: 0; display: grid; gap: 0.2rem; align-content: center; padding: 0.75rem 1rem 0.75rem 1.2rem;
  border-radius: 0.9rem; border: 1px solid #d0d7e5; background: linear-gradient(90deg, var(--tint) 0%, #fff 70%);
  box-shadow: 0 12px 20px -14px rgba(10, 26, 79, 0.55); }
.wall-tile:hover .wall-card, .wall-tile:focus-visible .wall-card { box-shadow: 0 18px 28px -14px rgba(10, 26, 79, 0.6); }
.wall-state { font-weight: 800; font-size: 0.95rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--edge); }
.wall-foot { font-size: 0.82rem; color: #475467; }
.wall-tablet { display: inline-flex; align-items: center; gap: 0.35rem; font-size: 0.75rem; color: #344054; }
/* A room that needs help takes the status colour in place of its class colour. The words say the same thing. */
.wall-tile.state-waiting { --edge: var(--warning-text); --tint: var(--warning-tint); }
.wall-tile.state-waiting .wall-card { border-color: var(--warning-fill); }
.wall-tile.state-on_the_way { --edge: var(--info-text); --tint: var(--info-tint); }
.wall-tile.state-on_the_way .wall-card { border-color: var(--info-fill); }
.wall-tile.state-unanswered { --edge: var(--danger-text); --tint: var(--danger-tint); }
.wall-tile.state-unanswered .wall-card { border: 2px solid var(--danger-fill); animation: room-alert 1.6s ease-in-out infinite; }
.wall-tile.state-practice .wall-card { border-style: dashed; }
.wall-legend { margin: 0; font-size: 0.75rem; color: #475467; }
.wall-teacher { display: grid; gap: 0.9rem; }
.wall-teacher-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 0.6rem 1rem; }
.wall-mirror-note { font-size: 0.75rem; color: #475467; }
.wall-teacher-screen { display: grid; gap: 0.8rem; padding: 1.2rem; border-radius: 1rem; background: #fff; border: 1px solid #d0d7e5;
  box-shadow: 0 12px 24px -16px rgba(10, 26, 79, 0.5); }
.wall-teacher-title { margin: 0; font-size: 1.6rem; color: var(--navy); text-transform: uppercase; }
.wall-teacher-sub, .wall-help-calm { margin: 0; color: #475467; }
.wall-teacher-h { margin: 0.4rem 0 0; color: var(--orange); text-transform: uppercase; font-size: 0.85rem; letter-spacing: 0.04em; }
.wall-help-banner { display: grid; gap: 0.35rem; padding: 0.9rem 1rem; border-radius: 0.8rem; border: 2px solid var(--warning-fill); background: var(--warning-tint); }
.wall-help-banner.danger { border-color: var(--danger-fill); background: var(--danger-tint); animation: room-alert 1.6s ease-in-out infinite; }
.wall-help-banner.info { border-color: var(--info-fill); background: var(--info-tint); }
.wall-roll-counts { display: grid; gap: 0.6rem; grid-template-columns: repeat(auto-fit, minmax(7rem, 1fr)); }
.wall-roll-count { display: grid; padding: 0.7rem; border-radius: 0.7rem; background: #f2f5fa; border: 1px solid #d0d7e5; }
.wall-roll-count strong { font-size: 1.6rem; color: var(--navy); }
.wall-roll-count span { font-size: 0.75rem; color: #475467; }
.wall-medical { margin: 0; padding-left: 1.2rem; color: var(--danger-text); }
.wall-office-actions { display: flex; flex-wrap: wrap; gap: 0.6rem; }
@media (max-width: 640px) { .wall-device { padding: 0.9rem; border-radius: 1.4rem; } .wall-glass { padding: 0.7rem; } }
@media (prefers-reduced-motion: reduce) { .wall-tile, .wall-live, .wall-tile.state-unanswered .wall-card, .wall-help-banner.danger { animation: none; transition: none; } }
html[data-theme="dark"] .wall-glass { background: #0f1629; box-shadow: inset 0 0 0 1px #24304f; }
html[data-theme="dark"] :is(.wall-card, .wall-teacher-screen, .wall-roll-count, .wall-stat) { background: var(--surface); border-color: var(--border); color: var(--text); }
html[data-theme="dark"] .wall-hue-0 { --class: #93b4ff; }
html[data-theme="dark"] .wall-hue-1 { --class: #5eead4; }
html[data-theme="dark"] .wall-hue-2 { --class: #c4b5fd; }
html[data-theme="dark"] .wall-hue-3 { --class: #86d98a; }
html[data-theme="dark"] .wall-hue-4 { --class: #67d7ee; }
html[data-theme="dark"] :is(.wall-foot, .wall-tablet) { color: var(--text); }
html[data-theme="dark"] :is(.wall-title, .wall-teacher-title, .wall-roll-count strong) { color: var(--text); }
/* Loading screen (19 Nov 2026): the key from the logo turns in the middle while the rings and dots circle it. */
.workspace-loading-stage .workspace-loading-mark.wl-key { width: 56%; aspect-ratio: 1; display: grid; place-items: center; background: none; border: 0; box-shadow: none; border-radius: 0;
  animation: wl-key-spin 2.8s cubic-bezier(.45, .05, .55, .95) infinite; }
.workspace-loading-stage .workspace-loading-mark.wl-key img { width: 100%; height: auto; animation: none; filter: drop-shadow(0 10px 14px rgba(10, 26, 79, .35)); }
.workspace-loading-stage:hover .workspace-loading-mark.wl-key { transform: none; }
.wl-orbit-2 { width: 88%; animation: wl-spin 2.6s linear infinite reverse; }
.wl-orbit-2 .wl-dot { width: 9px; height: 9px; margin-top: -4.5px; background: #2447d6; box-shadow: 0 0 0 4px rgba(36, 71, 214, .25), 0 0 14px #2447d6; }
@keyframes wl-key-spin { from { transform: rotateY(0); } to { transform: rotateY(1turn); } }
@media (prefers-reduced-motion: reduce) { .workspace-loading-stage .workspace-loading-mark.wl-key, .wl-orbit-2 { animation: none; } }

/* Keys helper: the big sample window and the frame inside it (19 Nov 2026). */
.page-guide-show { margin-top: 12px; padding: 10px 16px; border: 1px solid var(--primary); border-radius: 4px; background: var(--primary); color: var(--on-primary); font: inherit; font-weight: 600; cursor: pointer; }
.page-guide-show:hover { filter: brightness(1.1); }
.example-overlay { position: fixed; inset: 0; z-index: 1000; display: flex; flex-direction: column; background: rgba(5, 8, 17, 0.82); padding: 16px; gap: 8px; }
.example-bar { display: flex; align-items: center; gap: 16px; padding: 10px 14px; border-radius: 4px; background: var(--primary); color: var(--on-primary); }
.example-bar span { flex: 1; opacity: 0.85; }
.example-close { padding: 8px 14px; border: 1px solid currentColor; border-radius: 4px; background: transparent; color: inherit; font: inherit; font-weight: 600; cursor: pointer; }
.example-frame { flex: 1; width: 100%; border: 0; border-radius: 4px; background: var(--bg); }
/* Inside the frame: a fixed banner, no side menu and no top strip, so nothing in view looks like a real control. */
.example-banner { position: sticky; top: 0; z-index: 50; padding: 8px 14px; background: var(--primary); color: var(--on-primary); font-weight: 700; letter-spacing: 0.04em; text-align: center; }
body.example .sidebar, body.example #top-strip, body.example #navigation, body.example #sign-out { display: none; }
body.example .shell { display: block; }

/* Who is on site: the "nobody to sign in yet" box (19 Nov 2026). */
.form-dialog .form-actions { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: 1rem; }

/* Reception tablet for contractors (RJL, 19 Nov 2026): a tablet frame with one question per screen and big touch buttons.
   Words always carry the state, not colour alone. */
.rt-device { position: relative; max-width: 52rem; margin: 0 auto 1.5rem; padding: 1.5rem; border-radius: 2.2rem;
  background: linear-gradient(160deg, #1b2440 0%, #0b1022 60%, #05070f 100%);
  box-shadow: 0 0 0 2px #2a3558, 0 30px 60px -25px rgba(5, 10, 30, 0.75), inset 0 1px 0 rgba(255, 255, 255, 0.08); }
.rt-camera { position: absolute; top: 0.6rem; left: 50%; width: 0.55rem; height: 0.55rem; margin-left: -0.275rem; border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #4a5b8c, #0b1022 70%); box-shadow: 0 0 0 2px #10172f; }
.rt-glass { min-height: min(70vh, 46rem); padding: 1.4rem; border-radius: 1.2rem; color: #101828;
  background: linear-gradient(180deg, #f7f9fc 0%, #eef2f8 100%); box-shadow: inset 0 0 0 1px #d0d7e5, inset 0 6px 18px -10px rgba(10, 26, 79, 0.35); }
.rt-screen { display: grid; gap: 1rem; align-content: start; }
.rt-screen.center { align-content: center; min-height: min(62vh, 40rem); text-align: center; }
.rt-head { padding-bottom: 0.7rem; border-bottom: 3px solid var(--orange); }
.rt-school { margin: 0; font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.06em; color: #475467; }
.rt-title { margin: 0.2rem 0 0; font-size: 1.9rem; color: var(--navy); text-transform: uppercase; letter-spacing: 0.01em; }
.rt-sub { margin: 0.3rem 0 0; font-size: 1.15rem; color: #344054; }
.rt-steps { margin: 0; padding-left: 1.4rem; display: grid; gap: 0.5rem; font-size: 1.2rem; color: #101828; }
.rt-privacy { margin: 0; font-size: 0.8rem; line-height: 1.45; color: #475467; }
.rt-cards { display: grid; gap: 0.9rem; grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr)); }
.rt-card { padding: 1rem 1.1rem; border-radius: 0.9rem; background: #fff; border: 1px solid #d0d7e5; border-top: 6px solid var(--blue); box-shadow: 0 12px 20px -14px rgba(10, 26, 79, 0.55); }
.rt-card h3 { margin: 0 0 0.4rem; font-size: 1.2rem; color: var(--navy); }
.rt-card p { margin: 0; font-size: 1.05rem; line-height: 1.5; }
.rt-btn { min-height: 3.5rem; padding: 0.7rem 1.4rem; border-radius: 0.9rem; border: 2px solid #d0d7e5; background: #fff; color: var(--navy);
  font: inherit; font-size: 1.25rem; font-weight: 700; cursor: pointer; touch-action: manipulation; }
.rt-btn:hover { border-color: var(--blue); }
.rt-btn:focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; }
.rt-btn.primary { background: var(--navy); border-color: var(--navy); color: #fff; min-height: 4rem; }
.rt-btn.primary:disabled { background: #98a2b3; border-color: #98a2b3; cursor: not-allowed; }
.rt-btn.ghost { background: transparent; border-color: transparent; color: #475467; }
.rt-btn.key { min-height: 4.2rem; font-size: 1.8rem; }
.rt-btn.key.small { font-size: 1.05rem; color: #475467; }
.rt-pad { display: grid; gap: 0.6rem; grid-template-columns: repeat(3, 1fr); max-width: 26rem; width: 100%; margin: 0 auto; }
.rt-dots { display: flex; justify-content: center; gap: 0.8rem; padding: 0.4rem 0; }
.rt-dot { width: 1.4rem; height: 1.4rem; border-radius: 50%; border: 3px solid var(--navy); background: transparent; }
.rt-dot.on { background: var(--navy); }
/* Late-arrival card box (RJL, 20 Nov 2026): a scanner types into it, so it is big, recessed and always readable. */
.rt-card-input { width: 100%; max-width: 26rem; margin: 0 auto; min-height: 4rem; padding: 0.6rem 1rem; border-radius: 0.9rem;
  border: 2px solid #98a2b3; background: #fff; color: #101828; font: inherit; font-size: 2rem; font-weight: 700; letter-spacing: 0.12em;
  text-align: center; text-transform: uppercase; box-shadow: inset 0 3px 8px -4px rgba(10, 26, 79, 0.35); }
.rt-card-input:focus { outline: 3px solid var(--blue); outline-offset: 2px; border-color: var(--blue); }
.rt-result { padding: 2rem 1.4rem; border-radius: 1.2rem; border-left: 10px solid var(--edge, var(--ok-fill)); background: #fff; }
.rt-result .rt-title { font-size: 2.4rem; }
.rt-result .rt-sub { font-size: 1.4rem; }
.rt-mark { margin: 0; font-size: 1rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.08em; }
.rt-result.ok { --edge: var(--ok-fill); background: var(--ok-tint); color: var(--ok-text); }
.rt-result.warning { --edge: var(--warning-fill); background: var(--warning-tint); color: var(--warning-text); }
.rt-result.danger { --edge: var(--danger-fill); background: var(--danger-tint); color: var(--danger-text); }
.rt-result .rt-title, .rt-result .rt-sub { color: inherit; }
@media (max-width: 640px) { .rt-device { padding: 0.8rem; border-radius: 1.4rem; } .rt-glass { padding: 0.9rem; } .rt-title { font-size: 1.5rem; } }



/* ===== Depth pass (RJL, 19 Nov 2026: "every image and tab 4D or 5D looking").
 * Every pressable thing looks raised and presses in; every surface sits on layered shadow. One set of rules for all
 * pages. Motion is short and stops for people who turn on reduce motion. ===== */
:root { --d-key: 0 1px 0 rgba(255, 255, 255, .55) inset, 0 -1px 0 rgba(6, 21, 48, .08) inset;
  --d-lift: 0 1px 1px rgba(6, 21, 48, .06), 0 4px 0 rgba(6, 21, 48, .07), 0 14px 28px -14px rgba(6, 21, 48, .45);
  --d-lift-hi: 0 1px 1px rgba(6, 21, 48, .06), 0 6px 0 rgba(6, 21, 48, .08), 0 22px 36px -16px rgba(6, 21, 48, .55);
  --d-press: 0 1px 0 rgba(6, 21, 48, .1), 0 2px 6px -2px rgba(6, 21, 48, .35) inset; }

/* Figure tiles: raised keys that open their list. Buttons are reset to look exactly like the linked tiles. */
body:not(.signin-mode) button.stat-tile { font: inherit; text-align: left; color: inherit; width: 100%; cursor: pointer; }
body:not(.signin-mode) .stat-tile.is-link { cursor: pointer; text-decoration: none; transform: translateZ(0); transition: transform .16s var(--ease), box-shadow .16s var(--ease); box-shadow: var(--d-key), var(--d-lift); }
body:not(.signin-mode) .stat-tile.is-link:hover { transform: translateY(-3px) rotateX(4deg); box-shadow: var(--d-key), var(--d-lift-hi); }
body:not(.signin-mode) .stat-tile.is-link:active { transform: translateY(2px); box-shadow: var(--d-press); }
body:not(.signin-mode) .stat-tile.is-link:focus-visible { outline: 3px solid #2447d6; outline-offset: 3px; }
.stat-row { perspective: 900px; }
.stat-open { font-size: .7rem; font-weight: 700; letter-spacing: .04em; opacity: .75; }

/* Tabs: a raised tray with keys that sink when chosen. */
body:not(.signin-mode) .dash-tabs { background: linear-gradient(180deg, #f6f8fc, #e9eef7); box-shadow: inset 0 1px 0 #fff, var(--d-lift); }
body:not(.signin-mode) .dash-tab { position: relative; background: linear-gradient(180deg, #ffffff, #eef2f9); color: #0a1a4f; box-shadow: var(--d-key), 0 2px 0 #c9d2e3, 0 6px 10px -8px rgba(6, 21, 48, .5);
  transition: transform .14s var(--ease), box-shadow .14s var(--ease); }
body:not(.signin-mode) .dash-tab:hover { transform: translateY(-1px); background: linear-gradient(180deg, #ffffff, #e6ecf8); }
body:not(.signin-mode) .dash-tab[aria-selected="true"] { background: linear-gradient(180deg, #1d3fb8, #0a1a4f); color: #fff; transform: translateY(2px);
  box-shadow: 0 1px 0 #06103a, 0 3px 8px -2px rgba(0, 0, 0, .45) inset, inset 0 -3px 0 var(--accent); }

/* Panels: layered card that lifts slightly under the pointer. */
body:not(.signin-mode) #workspace .panel { box-shadow: 0 1px 0 rgba(6, 21, 48, .05), 0 10px 26px -18px rgba(6, 21, 48, .5), 0 2px 6px -3px rgba(6, 21, 48, .12); transition: box-shadow .2s var(--ease), transform .2s var(--ease); }
body:not(.signin-mode) #workspace .panel:hover { box-shadow: 0 1px 0 rgba(6, 21, 48, .05), 0 18px 34px -20px rgba(6, 21, 48, .55), 0 3px 8px -3px rgba(6, 21, 48, .14); }
body:not(.signin-mode) #workspace .panel-head { box-shadow: inset 0 1px 0 rgba(255, 255, 255, .14), inset 0 -2px 0 rgba(0, 0, 0, .18); }

/* Empty pages: a raised card with a soft glow and an icon, not a flat dashed box, plus its way forward. */
body:not(.signin-mode) .empty-state { position: relative; border: 1px solid color-mix(in srgb, #2447d6 18%, var(--border)); background: radial-gradient(120% 90% at 50% 0%, #ffffff, #f1f4fb 70%);
  box-shadow: var(--d-key), var(--d-lift); }
body:not(.signin-mode) #workspace .empty-state, body:not(.signin-mode) .empty-state { padding-top: 3.9rem; }
body:not(.signin-mode) .empty-state::before { content: ""; position: absolute; top: .9rem; left: 50%; width: 38px; height: 38px; translate: -50% 0; border-radius: 12px;
  background: linear-gradient(145deg, #3d6bff, #0a1a4f); box-shadow: 0 4px 0 #061026, 0 10px 18px -8px rgba(36, 71, 214, .7), inset 0 1px 0 rgba(255, 255, 255, .35); }
body:not(.signin-mode) .empty-state::after { content: "+"; position: absolute; top: .9rem; left: 50%; width: 38px; height: 38px; translate: -50% 0; display: grid; place-items: center;
  color: #fff; font-weight: 800; font-size: 1.3rem; line-height: 1; }
html[data-theme="dark"] body:not(.signin-mode) .empty-state { background: radial-gradient(120% 90% at 50% 0%, #1d2a57, #121a3a 70%); }

/* Ordinary buttons: a real key with a lip that sinks when pressed. */
body:not(.signin-mode) .button:not(.link):not(.stat-tile) { box-shadow: var(--d-key), 0 3px 0 color-mix(in srgb, var(--text) 30%, transparent), 0 8px 14px -10px rgba(6, 21, 48, .55); }
body:not(.signin-mode) .button:active:not(:disabled) { transform: translateY(2px); box-shadow: var(--d-press); }

/* Pictures in cards (camera frames, photos, the phone) sit in a framed, lit bezel. */
body:not(.signin-mode) #workspace :is(.panel, .empty-state) img:not([width="16"]):not(.icon) { border-radius: 8px; box-shadow: 0 1px 0 rgba(255, 255, 255, .6) inset, 0 10px 22px -14px rgba(6, 21, 48, .6); }

/* "Set up this page" beside Keys. */
.page-tools { display: flex; flex-wrap: wrap; align-items: flex-start; gap: .6rem; }
.page-tools .keys-helper:not([open]) { margin-bottom: .9rem; }
.page-tools .keys-helper[open] { flex: 1 1 100%; order: 2; }
.page-setup-btn { display: inline-flex; align-items: center; gap: .5rem; min-height: 46px; margin: .1rem 0 .9rem; padding: .35rem 1rem .35rem .45rem; border-radius: 999px; cursor: pointer;
  font: inherit; font-size: .82rem; font-weight: 700; color: #fff; border: 1px solid #0a1a4f; background: linear-gradient(180deg, var(--accent), #1d3fb8);
  box-shadow: var(--d-key), 0 3px 0 var(--danger-text), 0 10px 18px -10px rgba(36, 71, 214, .8); transition: transform .14s var(--ease), box-shadow .14s var(--ease); }
.page-setup-btn:hover { transform: translateY(-2px); }
.page-setup-btn:active { transform: translateY(2px); box-shadow: var(--d-press); }
.page-setup-btn:focus-visible { outline: 3px solid #2447d6; outline-offset: 3px; }
.page-setup-icon { width: 30px; height: 30px; padding: 6px; border-radius: 50%; background: rgba(255, 255, 255, .2); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .4); }
.setup-dialog { width: min(1100px, 94vw); max-height: 88vh; overflow: auto; }
.setup-dialog .setup-grid { margin: .8rem 0 1rem; }

/* A tile press brings its list into view and flashes it so the eye finds it. */
.jump-flash { animation: jump-flash 1.4s var(--ease) 1; }
@keyframes jump-flash { 0% { outline: 3px solid var(--accent); outline-offset: 4px; } 70% { outline: 3px solid var(--accent); outline-offset: 4px; } 100% { outline: 3px solid transparent; outline-offset: 10px; } }

@media (prefers-reduced-motion: reduce) {
  body:not(.signin-mode) :is(.stat-tile.is-link, .dash-tab, #workspace .panel, .page-setup-btn) { transition: none; }
  body:not(.signin-mode) .stat-tile.is-link:hover, .page-setup-btn:hover, body:not(.signin-mode) .dash-tab:hover { transform: none; }
  .jump-flash { animation: none; outline: 3px solid var(--accent); outline-offset: 4px; }
}
/* Lists a tile jumps to stop below the fixed PA bar and status strip, not under them. */
#workspace :is(.panel, .empty-state) { scroll-margin-top: 175px; }

/* Keys AI chat (19 Nov 2026). A round button bottom right, and a panel above it. Same depth language as the rest. */
.keys-ai-fab { position: fixed; right: 1.25rem; bottom: 1.25rem; z-index: 60; display: inline-flex; align-items: center; gap: .5rem;
  padding: .45rem 1rem .45rem .45rem; border-radius: 999px; border: 1px solid color-mix(in srgb, var(--primary) 35%, var(--border));
  background: var(--surface); color: var(--text); font: inherit; font-weight: 650; cursor: pointer;
  box-shadow: var(--d-lift, 0 10px 24px rgba(10, 26, 79, .22)); transition: transform .15s var(--ease, ease), box-shadow .15s var(--ease, ease); }
.keys-ai-fab:hover { transform: translateY(-2px); }
.keys-ai-fab:active { transform: translateY(0); box-shadow: var(--d-press, 0 2px 6px rgba(10, 26, 79, .25)); }
.keys-ai-fab:focus-visible, .keys-ai-panel :focus-visible { outline: 3px solid var(--primary); outline-offset: 2px; }
.keys-ai-fab .keys-face, .keys-ai-title .keys-face { width: 2.1rem; height: 2.1rem; }
.keys-ai-panel { position: fixed; right: 1.25rem; bottom: 5rem; z-index: 61; width: min(26rem, calc(100vw - 2.5rem));
  max-height: min(40rem, calc(100vh - 7rem)); display: flex; flex-direction: column; border-radius: 1rem;
  border: 1px solid var(--border); background: var(--surface); color: var(--text); box-shadow: var(--d-lift, 0 18px 40px rgba(10, 26, 79, .28)); }
.keys-ai-panel[hidden] { display: none; }
.keys-ai-head { display: flex; align-items: center; justify-content: space-between; padding: .7rem .9rem; border-bottom: 1px solid var(--border); }
.keys-ai-title { display: flex; align-items: center; gap: .5rem; }
.keys-ai-close, .keys-ai-send, .keys-ai-confirm, .keys-ai-yes, .keys-ai-no { font: inherit; border-radius: .6rem; padding: .4rem .8rem; cursor: pointer;
  border: 1px solid var(--border); background: var(--surface); color: var(--text); }
.keys-ai-send, .keys-ai-yes { background: var(--primary); color: var(--on-primary, #fff); border-color: var(--primary); font-weight: 650; }
.keys-ai-send:disabled, .keys-ai-yes:disabled, .keys-ai-no:disabled { opacity: .55; cursor: default; }
.keys-ai-log { flex: 1 1 auto; overflow-y: auto; padding: .75rem .9rem; display: flex; flex-direction: column; gap: .6rem; }
.keys-ai-msg { max-width: 92%; padding: .55rem .75rem; border-radius: .8rem; }
.keys-ai-msg p { margin: 0; white-space: pre-wrap; }
.keys-ai-msg p + p { margin-top: .35rem; }
.keys-ai-user { align-self: flex-end; background: color-mix(in srgb, var(--primary) 12%, var(--surface)); }
.keys-ai-assistant { align-self: flex-start; background: color-mix(in srgb, var(--navy, #0a1a4f) 6%, var(--surface)); border: 1px solid var(--border); }
.keys-ai-msg.is-waiting { color: var(--muted); }
.keys-ai-source, .keys-ai-why { font-size: .78rem; color: var(--muted); }
.keys-ai-action { margin-top: .5rem; padding: .6rem; border-radius: .7rem; border: 1px solid color-mix(in srgb, var(--orange, #1d3fb8) 45%, var(--border));
  background: color-mix(in srgb, var(--orange, #1d3fb8) 6%, var(--surface)); display: grid; gap: .45rem; }
.keys-ai-action.is-done { border-color: var(--border); background: var(--surface); }
.keys-ai-action-title { font-weight: 650; }
.keys-ai-quote { margin: 0; padding: .4rem .6rem; border-left: 3px solid var(--primary); background: var(--surface); }
.keys-ai-check { display: flex; gap: .45rem; align-items: flex-start; font-size: .88rem; }
.keys-ai-final { display: flex; flex-wrap: wrap; gap: .45rem; align-items: center; }
.keys-ai-final p { flex: 1 1 100%; font-weight: 650; }
.keys-ai-link { font-weight: 650; }
.keys-ai-form { display: grid; grid-template-columns: 1fr auto; gap: .45rem; padding: .7rem .9rem; border-top: 1px solid var(--border); }
.keys-ai-label { grid-column: 1 / -1; font-size: .8rem; color: var(--muted); }
.keys-ai-input { font: inherit; resize: vertical; min-height: 2.6rem; border-radius: .6rem; border: 1px solid var(--border); padding: .45rem .6rem; background: var(--surface); color: var(--text); }
@media (prefers-reduced-motion: reduce) { .keys-ai-fab { transition: none; } .keys-ai-fab:hover { transform: none; } }
@media print { .keys-ai-fab, .keys-ai-panel { display: none !important; } }
/* Keys AI energy orb (20 Nov 2026). The canvas carries its own glow, so no border or background. */
/* The AnimatedWebs orb fills about 60% of its canvas (it is made as a background); scale it up for icon use, as its own "scale" option does. */
.keys-orb { display: block; flex: none; transform: scale(1.5); pointer-events: none; }
/* Sizes come from keys-ai.js and page-guides.js (56 px on the button and page help, 44 px in the panel header). */
.keys-ai-fab { padding: .3rem 1.1rem .3rem .35rem; gap: .65rem; font-size: 1.05rem; }
.keys-orb-helper { flex: 0 0 56px; display: grid; place-items: center; width: 56px; height: 56px; }
/* Keys AI: Find a student (20 Nov 2026). Searched in the browser over the portal's own list; never sent to the AI. */
.keys-ai-finder { display: grid; gap: .35rem; padding: .6rem .9rem; border-bottom: 1px solid var(--border); }
.keys-ai-find-input { font: inherit; border-radius: .6rem; border: 1px solid var(--border); padding: .5rem .65rem; background: var(--surface); color: var(--text); }
.keys-ai-find-results { list-style: none; margin: 0; padding: 0; display: grid; gap: .3rem; max-height: 14rem; overflow-y: auto; }
.keys-ai-find-hit { display: flex; justify-content: space-between; gap: .6rem; padding: .45rem .6rem; border-radius: .55rem; border: 1px solid var(--border);
  text-decoration: none; color: var(--text); background: color-mix(in srgb, var(--primary) 5%, var(--surface)); }
.keys-ai-find-hit:hover, .keys-ai-find-hit:focus-visible { border-color: var(--primary); }
.keys-ai-find-hit span { color: var(--muted); font-size: .85rem; white-space: nowrap; }
.keys-ai-find-empty { color: var(--muted); font-size: .88rem; padding: .2rem .1rem; }
/* Loading screen with Keys' orb (20 Nov 2026): the orb swirls in place of the turning key, so the key turn is switched off. */
.workspace-loading-stage .workspace-loading-mark.wl-key.wl-orb { animation: none; }
.workspace-loading-stage .wl-orb .keys-orb { transform: scale(1.45); }
.keys-ai-fab .keys-orb { width: 2.5rem; height: 2.5rem; margin: -.1rem 0; }
.keys-ai-title .keys-orb { width: 2.1rem; height: 2.1rem; }

/* ===== Keycap buttons (RJL, 20 Nov 2026: "make all the buttons proper UI or 3D").
   Adapted from AnimatedWebs "Rectangle Buttons", variants Meridian Keycap Primary and Secondary, downloaded with RJL's
   AnimatedWebs Pro account. Licence line as supplied: AnimatedWebs Pro source. Licensed to AnimatedWebs account MH5XZY1S
   under the AnimatedWebs license; do not resell or redistribute. Ref MH5XZY1S-57ac0113.
   How it works: the button itself is the key's housing; a ::before layer behind the words is the key cap, sitting on a
   hard 5 px edge. On hover the cap travels down 4 px onto its base, on press 5 px. The words stay put, as in the original.
   Applied to every .button in the signed-in workspace. Left alone: hold-to-confirm safety buttons (.hold, they draw their
   own progress fill), link buttons and stat tiles. Danger buttons get a red cap so they still read as dangerous. */
html body:not(.signin-mode) .button:not(.link):not(.stat-tile):not(.hold) {
  position: relative; isolation: isolate; overflow: visible;
  min-height: 50px; padding: .45rem 1.25rem calc(.45rem + 6px); border: 0; border-radius: 14px;
  background: #dfe5ee; box-shadow: inset 0 0 0 1px rgba(4, 7, 13, .09);
  color: #1d2532; font-weight: 650; filter: none; transform: none; text-shadow: none;
}
html body:not(.signin-mode) .button:not(.link):not(.stat-tile):not(.hold)::before {
  content: ""; position: absolute; inset: 3px 4px 9px; z-index: -1; border-radius: 11px;
  background: linear-gradient(180deg, #fbfcfe, #e3e8f1);
  box-shadow: 0 5px 0 #bcc5d3, 0 9px 15px -2px rgba(4, 7, 13, .2), inset 0 1px #fff;
  transition: transform .13s cubic-bezier(.22, .61, .36, 1), box-shadow .13s cubic-bezier(.22, .61, .36, 1);
}
html body:not(.signin-mode) .button:not(.link):not(.stat-tile):not(.hold):hover:not(:disabled) { filter: none; transform: none; }
html body:not(.signin-mode) .button:not(.link):not(.stat-tile):not(.hold):hover:not(:disabled)::before {
  transform: translateY(4px); box-shadow: 0 1px 0 #bcc5d3, 0 3px 8px -2px rgba(4, 7, 13, .18), inset 0 1px #fff;
}
html body:not(.signin-mode) .button:not(.link):not(.stat-tile):not(.hold):active:not(:disabled) { filter: none; transform: none; }
html body:not(.signin-mode) .button:not(.link):not(.stat-tile):not(.hold):active:not(:disabled)::before { transform: translateY(5px); box-shadow: 0 0 0 #bcc5d3, inset 0 1px #fff; }
/* Primary (a plain .button): the blue cap. */
html body:not(.signin-mode) .button:not(.secondary):not(.danger):not(.link):not(.stat-tile):not(.hold) {
  background: #dbe7f6; box-shadow: inset 0 0 0 1px rgba(46, 133, 232, .3); color: #04182f;
}
html body:not(.signin-mode) .button:not(.secondary):not(.danger):not(.link):not(.stat-tile):not(.hold)::before {
  background: linear-gradient(180deg, #6db6ff, #2e85e8);
  box-shadow: 0 5px 0 #1d6dc4, 0 9px 18px -2px rgba(21, 88, 158, .32), inset 0 1px rgba(255, 255, 255, .5);
}
html body:not(.signin-mode) .button:not(.secondary):not(.danger):not(.link):not(.stat-tile):not(.hold):hover:not(:disabled)::before {
  box-shadow: 0 1px 0 #1d6dc4, 0 3px 10px -2px rgba(21, 88, 158, .3), inset 0 1px rgba(255, 255, 255, .5);
}
/* Danger: the same key in red, white words (portal addition; AnimatedWebs has no red cap). */
html body:not(.signin-mode) .button.danger:not(.link):not(.stat-tile):not(.hold) { background: var(--danger-tint); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--danger-fill) 35%, transparent); color: #fff; }
html body:not(.signin-mode) .button.danger:not(.link):not(.stat-tile):not(.hold)::before {
  background: linear-gradient(180deg, var(--danger-solid), var(--emergency));
  box-shadow: 0 5px 0 var(--danger-text), 0 9px 18px -2px color-mix(in srgb, var(--danger-fill) 35%, transparent), inset 0 1px rgba(255, 255, 255, .4);
}
html body:not(.signin-mode) .button.danger:not(.link):not(.stat-tile):not(.hold):hover:not(:disabled)::before {
  box-shadow: 0 1px 0 var(--danger-text), 0 3px 10px -2px color-mix(in srgb, var(--danger-fill) 30%, transparent), inset 0 1px rgba(255, 255, 255, .4);
}
/* Dark theme: the original dark keycaps. */
html[data-theme="dark"] body:not(.signin-mode) .button.secondary:not(.link):not(.stat-tile):not(.hold) { background: #0c1017; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .07); color: #dde5f2; }
html[data-theme="dark"] body:not(.signin-mode) .button.secondary:not(.link):not(.stat-tile):not(.hold)::before {
  background: linear-gradient(180deg, #2a3142, #1c2230); box-shadow: 0 5px 0 #080b11, 0 9px 15px -2px rgba(0, 0, 0, .62), inset 0 1px rgba(255, 255, 255, .11);
}
html[data-theme="dark"] body:not(.signin-mode) .button:not(.secondary):not(.danger):not(.link):not(.stat-tile):not(.hold) { background: #050f1c; box-shadow: inset 0 0 0 1px rgba(77, 163, 255, .22); }
/* Small buttons keep the key, a little shorter. */
html body:not(.signin-mode) .button.small:not(.link):not(.stat-tile):not(.hold) { min-height: 44px; padding: .35rem .9rem calc(.35rem + 6px); }
/* Disabled keys do not travel. Keyboard focus gets a clear ring. */
html body:not(.signin-mode) .button:not(.link):not(.stat-tile):not(.hold):disabled { opacity: .55; }
html body:not(.signin-mode) .button:not(.link):not(.stat-tile):not(.hold):focus-visible { outline: 3px solid #2447d6; outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { html body:not(.signin-mode) .button:not(.link):not(.stat-tile):not(.hold)::before { transition: none; } }
/* Keys' still orb (20 Nov 2026): same size as the moving orb where it stands in for it; small in the example bar. */
img.keys-orb-still { display: block; flex: none; width: 56px; height: 56px; object-fit: contain; filter: drop-shadow(0 2px 6px rgba(36, 71, 214, .35)); animation: none; }
.keys-ai-title img.keys-orb-still { width: 44px; height: 44px; }
.example-bar img.keys-orb-still { width: 30px; height: 30px; }

/* Secondary buttons in a navy panel heading (e.g. "Edit gate schedules" on Access control, 20 Nov 2026).
   The heading rule above forces white text, but the 3D key cap draws a white face behind the label, so the label
   disappeared. Give these buttons navy text so it reads on the white cap. */

/* News and tasks (20 Nov 2026): one card per notice. Unread notices carry the orange edge; read ones go quiet. */
.news-card { padding: .9rem 1.1rem; border: 1px solid #d5dde8; border-left: 5px solid var(--accent); border-radius: 4px; background: #fff; }
.news-card h3 { margin: 0 0 .35rem; color: #0a1a4f; }
.news-card .news-body { white-space: pre-line; margin: .5rem 0; }
.news-card.is-read { border-left-color: #c5cfdc; }
.news-card.is-hidden { opacity: .7; border-left-color: var(--warning-fill); }

/* Camera wall: why there is no picture (site box offline or not set). */
.cctv-box-warning { padding: .7rem 1rem; border: 1px solid var(--warning-fill); border-left: 5px solid var(--warning-fill); border-radius: 4px; background: var(--warning-tint); color: var(--warning-text); }
.cctv-box-warning p { margin: .2rem 0; font-weight: 600; }

/* ID cards (20 Nov 2026): the card picture at half size, framed like a real card. */
.idcard-preview img { display: block; max-width: 100%; height: auto; border-radius: 14px; border: 1px solid #d5dde8; box-shadow: 0 10px 24px #0a1a4f26; background: #fff; }
.idcard-preview .inline-actions { margin-top: .8rem; }

/* Error log (20 Nov 2026): one bar per day, and an expandable row per fault. */
.bar-list { list-style: none; margin: 0; padding: 0; display: grid; gap: .35rem; }
.bar-row { display: grid; grid-template-columns: 7.5rem 1fr 3rem; align-items: center; gap: .6rem; }
.bar-row .bar { display: block; height: .7rem; border-radius: .35rem; background: var(--accent, #2f6fed); min-width: 0; }
.bar-row .bar-value { text-align: right; }
.error-row { border: 1px solid var(--line, #d7dce5); border-radius: .5rem; padding: .55rem .75rem; }
.error-row summary { cursor: pointer; }
.error-row .facts { display: grid; grid-template-columns: max-content 1fr; gap: .25rem .9rem; margin: .6rem 0; }
.error-row .facts dd { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
/* System settings: crest and colours sample (RJL, 20 Nov 2026). Looks like the top of the printed ID card. */
.brand-sample { max-width: 22rem; border: 1px solid var(--border); border-radius: 10px; overflow: hidden; background: #fff; }
.brand-sample-head { display: flex; align-items: center; gap: .6rem; padding: .55rem .75rem; background: var(--brand); color: #fff; font-weight: 700; border-bottom: 4px solid var(--accent); }
.brand-sample-head img { width: 34px; height: 34px; object-fit: contain; background: #fff; border-radius: 5px; padding: 2px; }
.brand-sample-body { padding: .55rem .75rem; }
.brand-sample-tag { color: var(--accent); font-weight: 700; letter-spacing: .15em; font-size: .85rem; }
.colour-field { display: grid; gap: .3rem; max-width: 16rem; }
.colour-field input[type=color] { width: 4.5rem; height: 2.4rem; padding: 2px; border: 1px solid var(--border); border-radius: 6px; background: transparent; }
.plain-list { margin: 0; padding-left: 1.2rem; display: grid; gap: .35rem; }
/* ---- Gentler Today tiles (RJL, 20 Nov 2026: "make the tiles gentler in colour, more safer colours") -------------
 * Light theme only. Replaces the navy fill, gloss and coloured glow with a soft tint of the status colour, dark text and
 * a calm stripe on the left. Status is still written in words on every tile; colour is never the only signal.
 * Contrast (WCAG formula, worked 20 Nov 2026), text on its own tile:
 *   body text #1b2433: 14.0:1 or better on every tint; hints #3d4a5c: 8.1:1 or better.
 *   labels: ok #0e5e3b on #eef8f2 7.2:1 / info #1d3f8f on #eef3fd 8.7:1 / warning #7a4a06 on #fdf6e7 6.9:1 /
 *           danger #932118 on #fdf0ee 7.6:1. All above the 4.5:1 minimum. */
:root {
  /* Quiet normal (colour review, 20 Nov 2026): OK and info tiles are plain white; only warning and danger keep a tint. */
  --soft-info: #ffffff; --soft-ok: #ffffff; --soft-warning: var(--warning-tint); --soft-danger: var(--danger-tint);
  --soft-info-edge: var(--line-strong); --soft-ok-edge: var(--ok-fill); --soft-warning-edge: var(--warning-fill); --soft-danger-edge: var(--danger-fill);
  --soft-info-text: var(--info-text); --soft-ok-text: var(--ok-text); --soft-warning-text: var(--warning-text); --soft-danger-text: var(--danger-text);
  --soft-shadow: 0 1px 2px rgba(16, 24, 40, .06), 0 6px 16px -10px rgba(16, 24, 40, .25);
}
html:not([data-theme="dark"]) body:not(.signin-mode) .stat-tile {
  --tone: var(--soft-info); --edge: var(--soft-info-edge); --label: var(--soft-info-text);
  background: var(--tone); color: #1b2433;
  border: 1px solid color-mix(in srgb, var(--edge) 35%, #dfe5ee); border-left: 5px solid var(--edge);
  box-shadow: var(--soft-shadow);
}
/* Clickable tiles keep their gentle lift, without a coloured glow. */
html:not([data-theme="dark"]) body:not(.signin-mode) .stat-tile.is-link { box-shadow: var(--soft-shadow); }
html:not([data-theme="dark"]) body:not(.signin-mode) .stat-tile.ok { --tone: var(--soft-ok); --edge: var(--soft-ok-edge); --label: var(--soft-ok-text); background: var(--tone); border-left-color: var(--edge); box-shadow: var(--soft-shadow); }
html:not([data-theme="dark"]) body:not(.signin-mode) .stat-tile.warning { --tone: var(--soft-warning); --edge: var(--soft-warning-edge); --label: var(--soft-warning-text); background: var(--tone); border-left-color: var(--edge); box-shadow: var(--soft-shadow); }
html:not([data-theme="dark"]) body:not(.signin-mode) .stat-tile.danger { --tone: var(--soft-danger); --edge: var(--soft-danger-edge); --label: var(--soft-danger-text); background: var(--tone); border-left-color: var(--edge); box-shadow: var(--soft-shadow); }
html:not([data-theme="dark"]) body:not(.signin-mode) .stat-tile.info { background: var(--tone); border-left-color: var(--edge); box-shadow: var(--soft-shadow); }
html:not([data-theme="dark"]) body:not(.signin-mode) .stat-tile::before,
html:not([data-theme="dark"]) body:not(.signin-mode) .stat-tile::after { content: none; }
html:not([data-theme="dark"]) body:not(.signin-mode) .stat-tile :is(.stat-label, .stat-value, .stat-hint, .stat-open) { color: #1b2433; text-shadow: none; }
html:not([data-theme="dark"]) body:not(.signin-mode) .stat-tile .stat-label { color: var(--label); }
html:not([data-theme="dark"]) body:not(.signin-mode) .stat-tile .stat-hint { color: #3d4a5c; }
html:not([data-theme="dark"]) body:not(.signin-mode) .stat-tile .stat-open { color: var(--label); }
html:not([data-theme="dark"]) body:not(.signin-mode) a.stat-tile:hover,
html:not([data-theme="dark"]) body:not(.signin-mode) .stat-tile.is-link:hover { box-shadow: 0 2px 4px rgba(16, 24, 40, .08), 0 12px 24px -12px rgba(16, 24, 40, .3); }
html:not([data-theme="dark"]) body:not(.signin-mode) a.stat-tile:focus-visible { outline: 3px solid #2447d6; outline-offset: 3px; }

/* ---- Interactive 3D tiles (RJL, 20 Nov 2026: "realistic and 3D, moves around when you touch it, interactive") -----
 * tile-tilt.js sets --rx/--ry (lean toward the pointer) and --mx/--my (where the light sits). The tile is a real 3D
 * object: label, number and arrow float at different depths, a soft light follows the pointer, the shadow falls away
 * from it, pressing pushes the tile in and the arrow slides out on hover. Off under reduced motion. Both themes. */
html body:not(.signin-mode) .stat-tile.is-link {
  --rx: 0deg; --ry: 0deg; --mx: 50%; --my: 0%;
  overflow: visible; transform-style: preserve-3d; will-change: transform;
  transform: perspective(700px) rotateX(var(--rx)) rotateY(var(--ry)) translateZ(0);
  transition: transform .45s cubic-bezier(.2, .8, .2, 1), box-shadow .45s cubic-bezier(.2, .8, .2, 1);
}
html body:not(.signin-mode) .stat-tile.is-link.tilting { transform: perspective(700px) rotateX(var(--rx)) rotateY(var(--ry)) translateZ(0); transition: transform .08s linear, box-shadow .12s linear; }
/* The shadow sits on the side away from the pointer, so the tile reads as lifted off the page. */
html body:not(.signin-mode) .stat-tile.is-link.tilting {
  box-shadow: calc(var(--ry) * -1.1) calc(var(--rx) * 1.1 + 14px) 28px -12px rgba(16, 24, 40, .32), 0 1px 2px rgba(16, 24, 40, .08);
}
/* Soft light that follows the finger or mouse. Visual only: never takes the click. */
html body:not(.signin-mode) .stat-tile.is-link::after {
  content: ""; position: absolute; inset: 0; width: auto; height: auto; border-radius: inherit; pointer-events: none;
  background: radial-gradient(circle at var(--mx) var(--my), rgba(255, 255, 255, .55), rgba(255, 255, 255, 0) 55%);
  opacity: 0; transition: opacity .3s ease; transform: translateZ(1px);
}
html body:not(.signin-mode) .stat-tile.is-link.tilting::after { opacity: 1; }
html[data-theme="dark"] body:not(.signin-mode) .stat-tile.is-link::after { background: radial-gradient(circle at var(--mx) var(--my), rgba(255, 255, 255, .18), rgba(255, 255, 255, 0) 55%); }
/* Depth: while the tile is being touched the words float above the card, the number highest. At rest they sit flat,
 * so nothing drifts past the tile's edge. */
html body:not(.signin-mode) .stat-tile.is-link :is(.stat-label, .stat-value, .stat-hint, .stat-open) { transition: transform .35s cubic-bezier(.2, .8, .2, 1); }
html body:not(.signin-mode) .stat-tile.is-link :is(.stat-value, .stat-open) { display: inline-block; }
html body:not(.signin-mode) .stat-tile.is-link:is(.tilting, .pressing) .stat-label { transform: translateZ(10px); }
html body:not(.signin-mode) .stat-tile.is-link:is(.tilting, .pressing) .stat-value { transform: translateZ(20px); }
html body:not(.signin-mode) .stat-tile.is-link:is(.tilting, .pressing) .stat-hint { transform: translateZ(8px); }
/* The arrow slides out when the tile is pointed at or focused. */
html body:not(.signin-mode) .stat-tile.is-link:is(:hover, :focus-visible) .stat-open { transform: translateX(6px); }
html body:not(.signin-mode) .stat-tile.is-link:is(.tilting, .pressing) .stat-open { transform: translateZ(14px) translateX(6px); }
/* Pressing pushes the whole tile in. */
html body:not(.signin-mode) .stat-tile.is-link.pressing { transform: perspective(700px) rotateX(var(--rx)) rotateY(var(--ry)) translateZ(-10px) scale(.985); }
/* Hover without movement (and keyboard focus): a small fixed lift instead of the old rotate. */
html body:not(.signin-mode) .stat-tile.is-link:hover:not(.tilting),
html body:not(.signin-mode) .stat-tile.is-link:focus-visible { transform: perspective(700px) rotateX(3deg) translateY(-3px); }
html body:not(.signin-mode) .stat-tile.is-link:active { transform: perspective(700px) rotateX(var(--rx)) rotateY(var(--ry)) translateZ(-10px) scale(.985); }
@media (prefers-reduced-motion: reduce) {
  html body:not(.signin-mode) .stat-tile.is-link,
  html body:not(.signin-mode) .stat-tile.is-link:is(:hover, :focus-visible, :active, .tilting, .pressing) { transform: none !important; transition: none !important; }
  body:not(.signin-mode) .stat-tile.is-link :is(.stat-label, .stat-value, .stat-hint, .stat-open) { transform: none !important; }
  html body:not(.signin-mode) .stat-tile.is-link::after { display: none; }
}

/* Area under the Today line graphs (today-charts.js): the same status colours as everywhere else, in both themes. */
.area-stop { stop-color: #6172f3; }
.area-stop.danger { stop-color: var(--danger-fill); }
.area-stop.warning { stop-color: var(--warning-fill); }
.area-stop.ok { stop-color: var(--ok-fill); }

/* ---- Full-screen lockdown (lockdown-screen.js, RJL 20 Nov 2026) ----------------------------------------------------
 * One emergency colour in both themes: white on #8E1B1B is 9.0:1. No flashing or pulsing (WCAG 2.3.1). The word LOCKDOWN
 * and the "!" mark carry the meaning as well as the colour. Sits above every other layer, the menu and the top strip. */
.lockdown-screen { position: fixed; inset: 0; z-index: 2000; display: grid; place-items: center; padding: 2rem;
  background: var(--emergency); color: var(--on-emergency); overflow: auto; }
.lockdown-screen[hidden] { display: none; }
.lockdown-inner { max-width: 52rem; display: grid; gap: .9rem; justify-items: center; text-align: center; }
.lockdown-mark { display: grid; place-items: center; width: 5.5rem; height: 5.5rem; border: 6px solid var(--on-emergency);
  border-radius: 50%; font-size: 3.4rem; font-weight: 900; line-height: 1; }
.lockdown-title { margin: 0; font-size: clamp(3.5rem, 11vw, 8rem); font-weight: 900; letter-spacing: .04em; line-height: 1; color: var(--on-emergency); }
.lockdown-title:focus { outline: none; }
.lockdown-when { margin: 0; font-size: clamp(1.2rem, 2.6vw, 1.7rem); font-weight: 700; font-variant-numeric: tabular-nums; }
.lockdown-line { margin: 0; font-size: clamp(1.15rem, 2.4vw, 1.6rem); font-weight: 600; }
.lockdown-lost { margin: .4rem 0 0; padding: .6rem 1rem; border: 2px solid var(--on-emergency); border-radius: 8px; font-weight: 700; }
.lockdown-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: .8rem; margin-top: 1.2rem; }
.lockdown-actions :is(a, button) { min-height: 56px; display: inline-flex; align-items: center; padding: 0 1.4rem; border-radius: 8px;
  font: inherit; font-size: 1.05rem; font-weight: 700; text-decoration: none; cursor: pointer;
  background: var(--on-emergency); color: var(--emergency); border: 2px solid var(--on-emergency); }
.lockdown-actions .lockdown-hide { background: transparent; color: var(--on-emergency); }
.lockdown-screen :focus-visible { outline: 4px solid var(--on-emergency); outline-offset: 4px; }
/* The bar: shown while staff keep working during a lockdown (it cannot be closed), and briefly after the all-clear. */
.lockdown-bar { position: fixed; inset: 0 0 auto 0; z-index: 1999; display: flex; flex-wrap: wrap; align-items: center; gap: .6rem 1.2rem;
  min-height: 56px; padding: .5rem 1.2rem; background: var(--emergency); color: var(--on-emergency); font-size: 1rem; }
.lockdown-bar[hidden] { display: none; }
.lockdown-bar strong { font-size: 1.15rem; letter-spacing: .06em; }
.lockdown-bar.cleared { background: var(--ok-solid); }
.lockdown-bar .lockdown-show { margin-left: auto; min-height: 44px; padding: 0 1rem; border-radius: 6px; border: 2px solid var(--on-emergency);
  background: var(--on-emergency); color: var(--emergency); font: inherit; font-weight: 700; cursor: pointer; }
.lockdown-bar .lockdown-lost { margin: 0; padding: .2rem .6rem; }
body.in-lockdown .main-shell { padding-top: 56px; }
@media print { .lockdown-screen, .lockdown-bar { display: none !important; } }

/* Clubs roll (views/clubs.js): tick boxes big enough to tap on a classroom tablet (WCAG 2.5.8 needs 24px; 32px here). */
.roll-tick { width: 32px; height: 32px; margin: 0; accent-color: var(--accent); cursor: pointer; }

/* ---- Cameras live view fits one screen (RJL, 20 Nov 2026: "4 camera squares with the controllers all in the one
 * section. I shouldn't have to scroll") --------------------------------------------------------------------------
 * One toolbar row: Live view / Camera setup, channels, Start watching and the note. Below it, on screens 1100px and
 * wider, the channels fill the rest of the window on the left and the recorder keys stand in a column on the right.
 * The wall's height (--fit-h) is measured by views/cameras.js from its top edge to the bottom of the window. */
.cam-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem 1rem; margin-bottom: .6rem; }
.cam-toolbar .dash-tabs { margin: 0; }
.cam-toolbar:not(.is-live) > :is(.cctv-bar, .cctv-note) { display: none; }
.cam-toolbar > .cctv-note { flex: 1 1 18rem; margin: 0; font-size: .85rem; color: var(--muted); }
@media (min-width: 1100px) {
  .cctv-wall:has(> .cctv-screen) { display: grid; grid-template-columns: minmax(0, 1fr) 18.5rem; gap: .8rem; height: var(--fit-h, auto); min-height: 20rem; }
  .cctv-wall > .cctv-screen { min-height: 0; height: 100%; grid-template-rows: minmax(0, 1fr); }
  .cctv-wall .cctv-grid { height: 100%; box-sizing: border-box; grid-template-rows: repeat(var(--rows, 2), minmax(0, 1fr)); }
  .cctv-wall .cctv-tile { aspect-ratio: auto; height: 100%; min-height: 0; }
  /* The whole picture is shown, never cropped: black bars rather than a cut-off corner of the yard. */
  .cctv-wall .cctv-tile .cctv-canvas { width: 100%; height: 100%; object-fit: contain; background: #050a18; }
  .cctv-wall .cctv-focus { min-height: 0; height: 100%; grid-template-rows: auto minmax(0, 1fr) auto auto; overflow: auto; }
  .cctv-wall .cctv-focus .cctv-canvas.big { width: 100%; height: 100%; min-height: 0; object-fit: contain; background: #050a18; border-radius: 8px; }
  /* Recorder keys: a column beside the channels, compact so all of it is in view; it scrolls inside itself if a very short window needs it. */
  .cctv-wall > .nvr-board { margin-top: 0; min-height: 0; overflow: auto; align-content: start; padding: .8rem; gap: .6rem;
    grid-template-columns: 1fr; grid-template-areas: "lcd" "pad" "nav" "rec" "form" "status"; }
  .cctv-wall > .nvr-board .nvr-lcd { min-height: 4.2rem; padding: .55rem .75rem; }
  .cctv-wall > .nvr-board .nvr-keypad { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .4rem; }
  .cctv-wall > .nvr-board .nvr-key { min-height: 2.75rem; }
}

/* Title row (RJL, 20 Nov 2026): the title text gives way first, so Keys and "Set up this page" stay on the right of the
   title instead of dropping onto their own line and pushing the page down. */
.page-head > :first-child:not(.page-tools) { flex: 1 1 20rem; min-width: 0; }
.page-head > .page-tools { flex: 0 1 auto; margin-left: auto; }
/* Short windows (laptops at 800px tall or less): the recorder keypad tightens so it fits beside the cameras. */
@media (min-width: 1100px) and (max-height: 960px) {
  .cctv-wall > .nvr-board { gap: .35rem; padding: .55rem; }
  .cctv-wall > .nvr-board :is(.nvr-keypad, .nvr-nav, .nvr-rec) { gap: .3rem; }
  .cctv-wall > .nvr-board :is(.nvr-key, .nvr-nav button, .nvr-rec button) { min-height: 2.05rem; padding-block: .15rem; }
  .cctv-wall > .nvr-board .nvr-lcd { min-height: 0; padding: .35rem .6rem; }
}
/* Page filters (Class / From / To and similar) sit on their own line under the title, side by side, instead of
   stacking in a tall column inside the title row and pushing the title down (RJL site audit, 20 Nov 2026). */
.page-head > .chip-row:has(.field) { order: 3; flex: 1 1 100%; display: flex; flex-wrap: wrap; align-items: end; gap: .6rem 1rem; }
.page-head > .chip-row:has(.field) .field { flex: 0 1 13rem; min-width: 9rem; margin: 0; }

/* Restricted wellbeing log (student pop-up tab and Settings, 20 Nov 2026). */
.wellbeing-list { margin: 0 0 1rem; padding: 0; list-style: none; display: grid; gap: .6rem; }
.wellbeing-entry { padding: .7rem .85rem; border: 1px solid var(--border, #DDE3EE); border-radius: 12px; background: #fff; display: grid; gap: .25rem; }
.wellbeing-meta { font-size: .78rem; font-weight: 600; color: var(--muted, #4A5468); }
.wellbeing-note { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.5; }
.wellbeing-staff { margin: .75rem 0 0; padding: 0; list-style: none; display: grid; gap: .5rem; }
.wellbeing-staff-row { display: grid; grid-template-columns: 1fr auto auto; align-items: center; gap: .75rem; min-height: 44px; border-bottom: 1px solid var(--border, #DDE3EE); padding: .25rem 0; }

/* Locked-module preview and trial tag (RJL, 20 Nov 2026). */
.locked-preview .locked-what { font-size: 1.1rem; font-weight: 600; margin: 0; }
.locked-preview .locked-points { margin: 0; padding-left: 1.2rem; display: grid; gap: .3rem; }
.locked-preview textarea { width: 100%; font: inherit; padding: .6rem .7rem; border-radius: 8px; border: 1px solid var(--line, #c9d1e0); }
.nav-item .nav-lock { flex: none; white-space: nowrap; }
/* The tag must never be cut off when the menu shows a scrollbar: the row stays inside the menu's width. */
.nav-group > .nav-item { box-sizing: border-box; max-width: 100%; }

/* ---------- Teacher tablet: an app layout, not the office site (RJL, 20 Nov 2026) ----------
   The office menu and title bar are hidden; "Menu" brings the menu back. The screen is one window tall: a bar, the roll
   (which scrolls inside itself) and the help strip. The help strip is in the layout, so it can never cover a student. */
body[data-view="tablet"]:not(.tablet-menu-open) .sidebar { display: none; }
body[data-view="tablet"] .shell { display: block; }
body[data-view="tablet"].tablet-menu-open .sidebar { position: fixed; inset: 0 auto 0 0; z-index: 60; width: min(18rem, 85vw); box-shadow: 0 0 0 100vmax rgba(4, 12, 31, .45); }
body[data-view="tablet"] .topbar, body[data-view="tablet"] .page-tools, body[data-view="tablet"] .page-head { display: none; }
body[data-view="tablet"] main { padding: .6rem .8rem; max-width: none; }
.tablet-app { display: grid; grid-template-rows: auto minmax(0, 1fr) auto; gap: .6rem; height: var(--tablet-h, 80vh); min-height: 20rem; }
.tablet-bar { display: flex; flex-wrap: wrap; align-items: end; gap: .6rem .8rem; }
.tablet-bar .field { flex: 0 1 11rem; margin: 0; }
.tablet-bar .tablet-tabs { flex: 1 1 auto; display: flex; gap: .4rem; margin: 0; }
.tablet-bar .tablet-menu-btn { margin-left: auto; }
.tablet-area { min-height: 0; overflow: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
.tablet-area .roll-editor { padding-bottom: .5rem; }
.tablet-area .roll-shortcuts { display: none; } /* keyboard hints: no use on a touch screen */
/* Students as tiles: name on top, three big marks underneath, several to a row. */
.tablet-area .roll-roster { display: grid; grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr)); gap: .6rem; }
.tablet-area .roll-student { flex-direction: column; align-items: stretch; gap: .5rem; padding: .7rem; }
.tablet-area .roll-student .chip-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: .35rem; }
#mk4s body:not(.signin-mode) .tablet-area .roll-student .chip-row .button { min-height: calc(44rem / 14); padding-inline: .3rem; }
.tablet-help { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: .8rem; padding: .6rem .8rem;
  border: 1px solid var(--line-strong, #cbd5e1); border-radius: 8px; background: var(--surface, #fff); }
.tablet-help-note { margin: 0; }
.tablet-help-state { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; justify-content: flex-end; }
.tablet-help-state .chip { white-space: normal; }
#mk4s body:not(.signin-mode) .tablet-help .button.hold { min-width: 14rem; min-height: calc(56rem / 14); font-size: calc(17rem / 14); font-weight: 600; }
body.example .tablet-help { display: none; }
@media (max-width: 700px) {
  .tablet-help { grid-template-columns: 1fr; }
  #mk4s body:not(.signin-mode) .tablet-help .button.hold { width: 100%; }
}

/* ==== Header weather band (RJL, 21 Nov 2026) =========================================================================
 * The full weather display under the status strip on every page, with the stay-indoors warning. Depth is built from
 * real layers, not pictures: a lit top edge, a hard base edge and a soft cast shadow on each raised piece, the weather
 * picture in a glass disc, and day tiles that tip toward the reader when pointed at. Status colours come from the
 * design tokens only (--ok, --warning, --danger), and each state also has its own words and its own icon shape, so
 * colour is never the only signal. Motion stops under "reduce motion". */
.wx-band {
  --wx-lit: rgba(255, 255, 255, .75); --wx-base: color-mix(in srgb, var(--text) 16%, transparent); --wx-cast: rgba(6, 21, 48, .34);
  --wx-edge: var(--warning-fill);
  position: relative; display: grid; gap: .85rem; margin: .9rem clamp(.75rem, 1.4vw, 1.75rem); padding: 1.15rem 1.1rem 1.05rem;
  border: 1px solid color-mix(in srgb, var(--text) 14%, var(--surface)); border-radius: 14px; overflow: hidden;
  background: linear-gradient(180deg, color-mix(in srgb, var(--blue) 6%, var(--surface)), var(--surface) 46%);
  box-shadow: inset 0 1px 0 var(--wx-lit), 0 2px 0 var(--wx-base), 0 18px 32px -20px var(--wx-cast), 0 4px 10px -6px var(--wx-cast);
}
.wx-band[hidden] { display: none; }
/* RJL, 21 Nov 2026: "just have it show on the main page". The full weather band squashed every other page (Cameras
   lost its height to it), so it shows on Today only. The small weather tile in the strip above still shows on every
   page, and turns amber or red when students are to stay inside. body[data-view] is set by the router (operations.js). */
body:not([data-view="today"]) .wx-band { display: none !important; }
.wx-band[data-status="outside"] { --wx-edge: var(--ok-fill); }
.wx-band[data-status="indoors"] { --wx-edge: var(--danger-fill); }
/* A lit bar along the top edge in the colour of the decision. */
.wx-band::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 5px; background: linear-gradient(90deg, var(--wx-edge), color-mix(in srgb, var(--wx-edge) 55%, var(--surface))); }
html[data-theme="dark"] .wx-band { --wx-lit: rgba(255, 255, 255, .09); --wx-base: rgba(0, 0, 0, .55); --wx-cast: rgba(0, 0, 0, .7); }
body:is(.signin-mode, .projector, .plain-mode, .embed) .wx-band { display: none; }

/* The decision. A raised slab with a badge that stands off the surface. */
.wx-alert {
  display: flex; align-items: center; gap: .95rem; padding: .8rem 1rem; border-radius: 10px; border: 1px solid color-mix(in srgb, currentColor 30%, transparent);
  border-left-width: 6px; box-shadow: inset 0 1px 0 var(--wx-lit), 0 2px 0 color-mix(in srgb, currentColor 22%, transparent), 0 12px 20px -14px var(--wx-cast);
}
.wx-alert.ok { color: var(--ok-text); background: linear-gradient(180deg, var(--ok-tint), color-mix(in srgb, var(--ok-tint) 62%, var(--surface))); }
.wx-alert.warning { color: var(--warning-text); background: linear-gradient(180deg, var(--warning-tint), color-mix(in srgb, var(--warning-tint) 62%, var(--surface))); }
.wx-alert.danger { color: var(--danger-text); background: linear-gradient(180deg, var(--danger-tint), color-mix(in srgb, var(--danger-tint) 62%, var(--surface))); }
.wx-alert-badge {
  flex: none; display: grid; place-items: center; width: 54px; height: 54px; border-radius: 50%; color: inherit; position: relative;
  background: radial-gradient(circle at 32% 26%, var(--surface), color-mix(in srgb, currentColor 16%, var(--surface)) 72%);
  box-shadow: inset 0 2px 1px var(--wx-lit), inset 0 -3px 5px color-mix(in srgb, currentColor 22%, transparent), 0 3px 0 color-mix(in srgb, currentColor 30%, transparent), 0 10px 16px -8px var(--wx-cast);
}
/* Stay indoors: a slow ring spreads from the badge so the eye finds it. Words and icon carry the meaning without it. */
.wx-alert.danger .wx-alert-badge::after { content: ""; position: absolute; inset: -4px; border-radius: 50%; border: 2px solid currentColor; opacity: 0; animation: wx-ping 2.4s ease-out infinite; }
@keyframes wx-ping { 0% { transform: scale(.86); opacity: .55; } 70%, 100% { transform: scale(1.32); opacity: 0; } }
.wx-alert-text { display: grid; gap: .12rem; min-width: 0; }
.wx-alert-head { font-size: 1.22rem; font-weight: 800; letter-spacing: -.01em; line-height: 1.2; }
.wx-alert-why { font-size: .92rem; font-weight: 600; }
.wx-alert-call { font-size: .8rem; color: var(--text); }
.wx-alert-call a { color: inherit; font-weight: 700; }

/* Heading row. */
.wx-band-head { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem 1rem; }
.wx-band-place { display: flex; flex-wrap: wrap; align-items: baseline; gap: .15rem .6rem; margin-right: auto; }
.wx-band-place h2 { margin: 0; font-size: 1.05rem; font-weight: 800; color: var(--navy); }
.wx-band-place span { color: var(--muted); font-size: .85rem; }
html[data-theme="dark"] .wx-band-place h2 { color: var(--text); }
.wx-band-line { display: flex; align-items: center; gap: .5rem; font-size: .95rem; }
.wx-band-line strong { font-size: 1.3rem; font-weight: 800; }
.wx-band-body { display: grid; gap: .85rem; }
.wx-band .wx-source { text-align: right; }
.wx-alert-sun .wx-alert-badge .wx-icon { color: inherit; }
.wx-alert-sun .wx-alert-head { font-size: 1.05rem; }

/* Now: the weather picture in a glass disc, the temperature cut deep, the two rings on raised dials. */
.wx-band .wx-now { align-items: center; }
.wx-band .wx-big { gap: 1.1rem; }
.wx-band .wx-big > .wx-icon {
  box-sizing: content-box; padding: 15px; border-radius: 50%;
  background: radial-gradient(circle at 32% 24%, var(--surface) 8%, color-mix(in srgb, var(--blue) 15%, var(--surface)) 72%);
  box-shadow: inset 0 2px 1px var(--wx-lit), inset 0 -5px 9px color-mix(in srgb, var(--blue) 20%, transparent), 0 3px 0 color-mix(in srgb, var(--blue) 26%, transparent), 0 14px 22px -10px var(--wx-cast);
  filter: drop-shadow(0 1px 0 var(--wx-lit));
}
.wx-band .wx-temp {
  font-size: clamp(3rem, 5vw, 4rem); font-weight: 800; letter-spacing: -.04em; line-height: .95; color: var(--navy);
  text-shadow: 0 1px 0 var(--wx-lit), 0 3px 0 color-mix(in srgb, var(--navy) 14%, transparent), 0 12px 18px color-mix(in srgb, var(--navy) 20%, transparent);
}
html[data-theme="dark"] .wx-band .wx-temp { color: var(--text); text-shadow: 0 2px 0 rgba(0, 0, 0, .6), 0 12px 18px rgba(0, 0, 0, .5); }
.wx-band .wx-label { font-size: 1.15rem; font-weight: 600; }
.wx-band .wx-rings { gap: 1.1rem; }
.wx-band .wx-ring svg {
  width: 72px; height: 72px; border-radius: 50%; background: radial-gradient(circle at 34% 28%, var(--surface), color-mix(in srgb, var(--blue) 9%, var(--surface)) 78%);
  box-shadow: inset 0 2px 1px var(--wx-lit), 0 3px 0 var(--wx-base), 0 12px 18px -10px var(--wx-cast);
}
.wx-band .wx-ring strong { top: 26px; font-size: .95rem; font-weight: 800; }
.wx-band .wx-ring small { font-size: .72rem; margin-top: .3rem; }
.wx-band .wx-ring-track { stroke: color-mix(in srgb, var(--text) 12%, var(--surface)); }
.wx-band .wx-ring-arc { filter: drop-shadow(0 2px 2px color-mix(in srgb, var(--blue) 45%, transparent)); }

/* Readings: raised tiles with a lit top edge and a hard base edge. */
.wx-band .wx-facts { grid-template-columns: repeat(auto-fit, minmax(10.5rem, 1fr)); gap: .7rem; }
.wx-band .wx-fact {
  padding: .7rem .85rem .75rem; border: 1px solid color-mix(in srgb, var(--text) 12%, var(--surface)); border-left: 4px solid var(--blue); border-radius: 9px;
  background: linear-gradient(180deg, var(--surface), color-mix(in srgb, var(--blue) 5%, var(--surface)));
  box-shadow: inset 0 1px 0 var(--wx-lit), 0 2px 0 var(--wx-base), 0 12px 18px -14px var(--wx-cast);
  transition: transform .18s var(--ease), box-shadow .18s var(--ease);
}
.wx-band .wx-fact:hover { transform: translateY(-2px); box-shadow: inset 0 1px 0 var(--wx-lit), 0 4px 0 var(--wx-base), 0 18px 22px -14px var(--wx-cast); }
.wx-band .wx-fact dd { font-size: 1.3rem; font-weight: 800; }
.wx-band .wx-fact dd.wx-fact-note { font-size: .78rem; font-weight: 500; }

/* Seven days: tiles on a shared stage. Pointing at one tips it toward the reader; the chosen day stands proud. */
.wx-band .wx-week { perspective: 1100px; gap: .6rem; }
.wx-band .wx-day {
  border-radius: 10px; border: 1px solid color-mix(in srgb, var(--text) 12%, var(--surface)); transform-origin: 50% 100%;
  background: linear-gradient(180deg, var(--surface), color-mix(in srgb, var(--blue) 6%, var(--surface)));
  box-shadow: inset 0 1px 0 var(--wx-lit), 0 3px 0 var(--wx-base), 0 12px 18px -14px var(--wx-cast);
  transition: transform .2s var(--ease), box-shadow .2s var(--ease);
}
.wx-band .wx-day:hover { transform: translateY(-4px) rotateX(9deg); box-shadow: inset 0 1px 0 var(--wx-lit), 0 6px 0 var(--wx-base), 0 22px 24px -16px var(--wx-cast); }
.wx-band .wx-day:active { transform: translateY(2px); box-shadow: inset 0 2px 4px var(--wx-base), 0 1px 0 var(--wx-base); }
.wx-band .wx-day[aria-pressed="true"] {
  transform: translateY(-3px); border-color: var(--blue);
  box-shadow: inset 0 4px 0 var(--blue), inset 0 5px 0 var(--wx-lit), 0 5px 0 color-mix(in srgb, var(--blue) 45%, transparent), 0 20px 24px -16px var(--wx-cast);
}
.wx-band .wx-day .wx-icon { filter: drop-shadow(0 3px 2px color-mix(in srgb, var(--blue) 30%, transparent)); }
.wx-band .wx-day strong { font-size: 1.2rem; font-weight: 800; }
.wx-band .wx-day-detail { border-radius: 8px; box-shadow: inset 0 2px 4px color-mix(in srgb, var(--text) 8%, transparent); }

/* Minimised: the warning and one line. */
.wx-band.min { gap: .6rem; padding-bottom: .8rem; }
.wx-band.min .wx-alert { padding: .55rem .8rem; }
.wx-band.min .wx-alert-badge { width: 40px; height: 40px; }
.wx-band.min .wx-alert-badge svg { width: 22px; height: 22px; }
.wx-band.min .wx-alert-head { font-size: 1.05rem; }
.wx-band.min .wx-alert-call { display: none; }

@media (max-width: 700px) {
  .wx-band { padding: 1rem .8rem .9rem; }
  .wx-alert { align-items: flex-start; }
  .wx-band .wx-rings { width: 100%; justify-content: space-around; }
}
@media (prefers-reduced-motion: reduce) {
  .wx-alert.danger .wx-alert-badge::after { animation: none; }
  .wx-band :is(.wx-fact, .wx-day) { transition: none; }
  .wx-band :is(.wx-fact, .wx-day):hover, .wx-band .wx-day[aria-pressed="true"] { transform: none; }
}
@media (forced-colors: active) { .wx-band::before { background: CanvasText; } .wx-alert { border: 2px solid CanvasText; } }
@media print { .wx-band { display: none; } }

/* ==== Finance receipt (21 Nov 2026) =================================================================================
 * The receipt opens in a dialog with Print. While printing, only the receipt is shown, in black on white, so a family
 * gets a clean page. */
.receipt-sheet { display: grid; gap: .5rem; min-width: min(32rem, 80vw); }
.receipt-school { margin: 0; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; font-size: .8rem; }
.receipt-sheet h2 { margin: 0; }
.receipt-void { margin: 0; padding: .45rem .6rem; border-left: 4px solid var(--danger-fill); background: var(--danger-tint); color: var(--danger-text); font-weight: 700; }
.receipt-lines { display: grid; grid-template-columns: max-content 1fr; gap: .35rem 1rem; margin: .4rem 0; }
.receipt-lines dt { color: var(--muted); }
.receipt-lines dd { margin: 0; font-weight: 600; font-variant-numeric: tabular-nums; }
.receipt-note { margin: 0; color: var(--muted); font-size: .85rem; }
@media print {
  body.printing-receipt > *:not(.receipt-dialog) { display: none !important; }
  body.printing-receipt .receipt-dialog { position: static; border: 0; box-shadow: none; padding: 0; max-width: none; background: #fff; color: #000; }
  body.printing-receipt .receipt-dialog::backdrop { display: none; }
  body.printing-receipt .receipt-actions { display: none; }
  body.printing-receipt .receipt-lines dt, body.printing-receipt .receipt-school, body.printing-receipt .receipt-note { color: #000; }
}

/* Email (21 Nov 2026): inbox list beside the open message; stacks on a narrow screen. */
.mail-grid { display: grid; grid-template-columns: minmax(16rem, 2fr) 3fr; gap: 1rem; align-items: start; }
@media (max-width: 900px) { .mail-grid { grid-template-columns: 1fr; } }
.mail-list { display: flex; flex-direction: column; max-height: 70vh; overflow-y: auto; border: 1px solid var(--line, #dfe3ea); border-radius: 8px; }
.mail-item { display: block; border-bottom: 1px solid var(--line, #dfe3ea); }
.mail-row { display: grid; width: 100%; gap: .15rem; text-align: left; padding: .6rem .75rem; background: transparent; border: 0; cursor: pointer; font: inherit; color: inherit; }
.mail-row:hover, .mail-row:focus-visible { background: rgba(16, 31, 51, .05); }
.mail-row.is-open { background: rgba(16, 31, 51, .09); }
.mail-row-top { display: flex; justify-content: space-between; gap: .5rem; }
.mail-row-top strong { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mail-row.is-unread .mail-row-top strong, .mail-row.is-unread .mail-row-subject { font-weight: 700; }
.mail-row-top small { white-space: nowrap; opacity: .75; }
.mail-row-subject, .mail-row-preview { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mail-row-preview { opacity: .7; font-size: .9em; }
.mail-reader { min-width: 0; }
.mail-subject { margin: 0 0 .5rem; overflow-wrap: anywhere; }
.mail-meta { display: grid; grid-template-columns: auto 1fr; gap: .15rem .75rem; margin: 0 0 1rem; font-size: .92em; }
.mail-meta dt { opacity: .7; } .mail-meta dd { margin: 0; overflow-wrap: anywhere; }
.mail-text { white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.55; padding: .75rem 0; border-top: 1px solid var(--line, #dfe3ea); }
.mail-reply { display: grid; gap: .5rem; margin-top: 1rem; }
.mail-reply .button, .mail-reply button { justify-self: start; }
