/* ═══════════════════════════════════════════════════════════════
   ATLAS — shared design layer (student app + admin dashboard)
   A course is a route. Information sits on plates that point at their stop,
   the next action is one round "go" button, and state is a marker on the map.
   • The only colour that changes per school is --brand (Settings → Branding);
     it drives the go button, the route line and the "you are here" marker.
   • Everything is logical (inline-start / inline-end) so right-to-left layouts mirror.
   • Student pages run under a strict CSP: own fonts, own styles, no inline <style>.
══════════════════════════════════════════════════════════════════ */

/* Fonts are self-hosted (the student pages allow no third-party requests), variable weight 100-900, SIL Open Font License
   (public/fonts/OFL-*.txt). Outfit draws Latin text; Readex Pro, made to sit with geometric Latin fonts, draws Arabic.
   Each file only covers its own characters (unicode-range), so a page downloads only what it shows. */
@font-face {
  font-family: "Outfit";
  src: url("/fonts/outfit.woff2") format("woff2");
  font-weight: 100 900; font-style: normal; font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Outfit";
  src: url("/fonts/outfit-latin-ext.woff2") format("woff2");
  font-weight: 100 900; font-style: normal; font-display: swap;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Readex Pro";
  src: url("/fonts/readex-pro-arabic.woff2") format("woff2");
  font-weight: 160 700; font-style: normal; font-display: swap;
  unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0897-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC;
}

/* ── Tokens ─────────────────────────────────────────────────────── */
:root {
  /* --brand is the school's colour. /js/boot.js also sets -light / -dark variants of --go, --on-go, --route and
     --brand-ink, each nudged just enough to stay readable in that theme; the fallbacks below are used before it runs. */
  --brand: #c2410c;
  --on-brand: #ffffff;
  --go: var(--go-light, var(--brand));
  --on-go: var(--on-go-light, var(--on-brand));
  --go-deep: color-mix(in srgb, var(--go) 66%, #000);
  --route: var(--route-light, color-mix(in srgb, var(--go) 88%, #ff6a1a));
  --route-soft: color-mix(in srgb, var(--route) 22%, transparent);
  --brand-ink: var(--brand-ink-light, color-mix(in srgb, var(--go) 80%, #000));   /* the brand colour used as text on a plate */

  --map: #e7efe4;            /* the land */
  --map-2: #dce7d7;          /* quieter land: wells, table heads */
  --plate: #ffffff;          /* the white plate */
  --plate-2: #f3f7f1;        /* a quiet plate */
  --press: color-mix(in srgb, var(--ink) 11%, var(--plate));   /* a pressed button: a little toward the ink, so the icon stays clear in both themes */
  --ink: #12332a;            /* text and filled markers */
  --ink-2: #3d5b50;          /* secondary text (6.4:1 on the map) */
  --lock: #5a6b64;           /* locked / planned / borders you can see */
  --flag: #b36200;           /* flagged question (a diamond, never colour alone) */
  --fill: var(--ink);        /* answered node, selected signpost */
  --on-fill: #ffffff;
  --line: rgba(18, 51, 42, .16);
  --line-strong: #5a6b64;
  --focus: #12332a;
  --water: #cfe3f2;
  --topo-stroke: #12332a;

  --ok: #17663b;   --ok-bg: #dcf0e3;
  --bad: #9b1c1c;  --bad-bg: #f9dcd8;
  --warn: #7a4300; --warn-bg: #fdecd0;
  --info: #173a8a; --info-bg: #dbe7fb;

  --shadow-plate: 0 8px 18px rgba(18, 51, 42, .16);
  --shadow-soft: 0 5px 12px rgba(18, 51, 42, .14);
  --shadow-pop: 0 18px 40px rgba(18, 51, 42, .28);
  --scrim: rgba(18, 51, 42, .5);

  --font: "Outfit", "Readex Pro", ui-rounded, "SF Pro Rounded", "Nunito", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --r-sm: 14px; --r-md: 18px; --r-lg: 24px;
  color-scheme: light;
}
/* Night map */
[data-theme="dark"] {
  --go: var(--go-dark, var(--brand));
  --on-go: var(--on-go-dark, var(--on-brand));
  --route: var(--route-dark, color-mix(in srgb, var(--go) 88%, #ff6a1a));
  --brand-ink: var(--brand-ink-dark, color-mix(in srgb, var(--go) 60%, #fff));
  --map: #0e1a16;  --map-2: #14231e;
  --plate: #172a24; --plate-2: #122019;
  --ink: #e6f0ea;  --ink-2: #a3bcb0; --lock: #7f958b;
  --fill: #d9eadf; --on-fill: #0e1a16;
  --flag: #f0c070;
  --line: rgba(230, 240, 234, .17); --line-strong: #7f958b;
  --focus: #e6f0ea;
  --water: #16364a;
  --topo-stroke: #e6f0ea;
  --ok: #7fd3a0;   --ok-bg: rgba(127, 211, 160, .14);
  --bad: #f3a49e;  --bad-bg: rgba(243, 164, 158, .14);
  --warn: #f0c070; --warn-bg: rgba(240, 192, 112, .14);
  --info: #9db8ff; --info-bg: rgba(157, 184, 255, .14);
  --shadow-plate: 0 10px 22px rgba(0, 0, 0, .5);
  --shadow-soft: 0 6px 14px rgba(0, 0, 0, .45);
  --shadow-pop: 0 22px 50px rgba(0, 0, 0, .7);
  --scrim: rgba(3, 9, 7, .66);
  color-scheme: dark;
}

/* ── Base ───────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; -webkit-tap-highlight-color: transparent; }   /* no grey flash box when a button is tapped; every control has its own pressed state */
a, button, input, select, textarea, label, summary { touch-action: manipulation; }
body {
  margin: 0; min-height: 100vh; background: var(--map); color: var(--ink);
  font: 400 16px/1.5 var(--font); -webkit-font-smoothing: antialiased;
}
/* contour lines behind everything */
body::before {
  content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background: center / cover no-repeat url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1200 800' preserveAspectRatio='xMidYMid slice'%3E%3Cg fill='none' stroke='%2312332a' stroke-opacity='.09' stroke-width='1.4'%3E%3Cg transform='rotate(-14 980 170)'%3E%3Cellipse cx='980' cy='170' rx='290' ry='150'/%3E%3Cellipse cx='980' cy='170' rx='244' ry='122'/%3E%3Cellipse cx='980' cy='170' rx='198' ry='94'/%3E%3Cellipse cx='980' cy='170' rx='152' ry='68'/%3E%3Cellipse cx='980' cy='170' rx='106' ry='44'/%3E%3Cellipse cx='980' cy='170' rx='60' ry='24'/%3E%3C/g%3E%3Cg transform='rotate(10 200 190)'%3E%3Cellipse cx='200' cy='190' rx='240' ry='120'/%3E%3Cellipse cx='200' cy='190' rx='196' ry='94'/%3E%3Cellipse cx='200' cy='190' rx='152' ry='68'/%3E%3Cellipse cx='200' cy='190' rx='108' ry='44'/%3E%3Cellipse cx='200' cy='190' rx='64' ry='22'/%3E%3C/g%3E%3Cg transform='rotate(-8 700 740)'%3E%3Cellipse cx='700' cy='740' rx='300' ry='120'/%3E%3Cellipse cx='700' cy='740' rx='244' ry='92'/%3E%3Cellipse cx='700' cy='740' rx='188' ry='64'/%3E%3Cellipse cx='700' cy='740' rx='132' ry='40'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}
[data-theme="dark"] body::before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1200 800' preserveAspectRatio='xMidYMid slice'%3E%3Cg fill='none' stroke='%23e6f0ea' stroke-opacity='.07' stroke-width='1.4'%3E%3Cg transform='rotate(-14 980 170)'%3E%3Cellipse cx='980' cy='170' rx='290' ry='150'/%3E%3Cellipse cx='980' cy='170' rx='244' ry='122'/%3E%3Cellipse cx='980' cy='170' rx='198' ry='94'/%3E%3Cellipse cx='980' cy='170' rx='152' ry='68'/%3E%3Cellipse cx='980' cy='170' rx='106' ry='44'/%3E%3Cellipse cx='980' cy='170' rx='60' ry='24'/%3E%3C/g%3E%3Cg transform='rotate(10 200 190)'%3E%3Cellipse cx='200' cy='190' rx='240' ry='120'/%3E%3Cellipse cx='200' cy='190' rx='196' ry='94'/%3E%3Cellipse cx='200' cy='190' rx='152' ry='68'/%3E%3Cellipse cx='200' cy='190' rx='108' ry='44'/%3E%3Cellipse cx='200' cy='190' rx='64' ry='22'/%3E%3C/g%3E%3Cg transform='rotate(-8 700 740)'%3E%3Cellipse cx='700' cy='740' rx='300' ry='120'/%3E%3Cellipse cx='700' cy='740' rx='244' ry='92'/%3E%3Cellipse cx='700' cy='740' rx='188' ry='64'/%3E%3Cellipse cx='700' cy='740' rx='132' ry='40'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}
h1, h2, h3, h4, p, ul, ol, dl, dd, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }
h1, h2, h3, h4 { font-weight: 700; letter-spacing: -.02em; line-height: 1.15; }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--brand-ink); }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; border-radius: 8px; }
/* a heading or panel the page moves focus to (so a screen reader starts there) is not something to click: no ring around it */
[tabindex="-1"]:focus, [tabindex="-1"]:focus-visible { outline: none; }
.hidden, [hidden] { display: none !important; }
.muted { color: var(--ink-2); }
.small { font-size: .875rem; }
.center { text-align: center; }
.mono { font-family: var(--mono); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.icon { width: 1.2em; height: 1.2em; flex: none; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
/* direction arrows point the other way in right-to-left layouts */
[dir="rtl"] svg:has(> use[href="#i-arrow-right"]), [dir="rtl"] svg:has(> use[href="#i-right"]), [dir="rtl"] svg:has(> use[href="#i-left"]),
[dir="rtl"] svg:has(> use[href="#i-chev-left"]), [dir="rtl"] svg:has(> use[href="#i-chev-right"]) { transform: scaleX(-1); }
.label { font: 600 12px/1.3 var(--font); letter-spacing: .1em; text-transform: uppercase; color: var(--ink-2); }
.nocopy, .nocopy * { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }

/* ── Plates (the container) ─────────────────────────────────────── */
.plate, .card {
  position: relative; background: var(--plate); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-plate);
}
.plate-quiet { background: var(--plate-2); box-shadow: none; }
.plate-dash { background: transparent; border: 2px dashed var(--lock); box-shadow: none; }
/* a pointer toward the stop it describes */
.pt::before {
  content: ""; position: absolute; inset-inline-start: -7px; top: 22px; width: 14px; height: 14px;
  background: var(--plate); transform: rotate(45deg); border-radius: 3px;
}
.pt-top::before { inset-inline-start: 34px; top: -7px; }
.pt-dash::before { display: none; }

/* ── Chips ──────────────────────────────────────────────────────── */
.chips { display: flex; flex-wrap: wrap; gap: .5rem; }
.chip {
  display: inline-flex; align-items: center; gap: .4rem; padding: .28rem .8rem; border-radius: 999px; white-space: nowrap;
  background: var(--plate-2); border: 1.5px solid var(--line); color: var(--ink-2); font: 600 13px/1.3 var(--font);
}
.chip b { color: var(--ink); font-weight: 700; }
.chip .icon { width: 15px; height: 15px; }
.chip-soft { background: var(--map-2); border-color: transparent; color: var(--ink); }
.chip-warn { background: var(--warn-bg); border-color: transparent; color: var(--warn); }
.chip-ok   { background: var(--ok-bg);   border-color: transparent; color: var(--ok); }
.chip-bad  { background: var(--bad-bg);  border-color: transparent; color: var(--bad); }
.chip-info { background: var(--info-bg); border-color: transparent; color: var(--info); }

/* ── Buttons ────────────────────────────────────────────────────── */
/* the round "go": one per screen */
.go {
  display: inline-grid; place-items: center; width: 56px; height: 56px; flex: none; border: 0; border-radius: 50%;
  background: var(--go); color: var(--on-go); box-shadow: 0 6px 0 var(--go-deep); cursor: pointer; text-decoration: none;
  transition: transform .12s ease, box-shadow .12s ease, background .12s;
}
.go .icon { width: 24px; height: 24px; }
@media (hover: hover) { .go:hover:not(:disabled) { transform: translateY(-2px); box-shadow: 0 8px 0 var(--go-deep); } }
.go:active:not(:disabled) { transform: translateY(4px); box-shadow: 0 2px 0 var(--go-deep); }
.go:disabled, .go[aria-disabled="true"] { background: var(--map-2); color: var(--lock); box-shadow: none; cursor: not-allowed; }
.go:focus-visible { outline-offset: 5px; border-radius: 50%; }
.go-lg { width: 68px; height: 68px; box-shadow: 0 7px 0 var(--go-deep); }
.go-lg .icon { width: 28px; height: 28px; }
.go-sm { width: 44px; height: 44px; box-shadow: 0 4px 0 var(--go-deep); }
.go-sm .icon { width: 20px; height: 20px; }
.go-row { display: inline-flex; align-items: center; gap: .9rem; padding: 0; border: 0; background: none; color: var(--ink); text-align: start; cursor: pointer; }
.go-row .go-label { font: 600 17px/1.2 var(--font); }
.go-row:disabled { cursor: not-allowed; opacity: .75; }
@media (hover: hover) { .go-row:hover:not(:disabled) .go { transform: translateY(-2px); box-shadow: 0 8px 0 var(--go-deep); } }
.go-row:active:not(:disabled) .go { transform: translateY(4px); box-shadow: 0 2px 0 var(--go-deep); }
.go-row:focus-visible { outline-offset: 6px; border-radius: 34px; }

/* the small round circle: secondary actions */
.mini, .icon-btn {
  position: relative; display: inline-grid; place-items: center; width: 44px; height: 44px; flex: none; border-radius: 50%;
  background: var(--plate); border: 2px solid var(--ink); color: var(--ink); transition: background .12s, transform .1s;
}
@media (hover: hover) { .mini:hover:not(:disabled), .icon-btn:hover:not(:disabled) { background: var(--map-2); } }
.mini:active:not(:disabled), .icon-btn:active:not(:disabled) { background: var(--fill); color: var(--on-fill); }
.mini:disabled { border-style: dashed; border-color: var(--lock); color: var(--lock); background: transparent; cursor: not-allowed; }
.mini.on { background: var(--fill); color: var(--on-fill); }
.mini.danger { border-color: var(--bad); color: var(--bad); }
.mini .count { position: absolute; top: -6px; inset-inline-end: -6px; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 99px; background: var(--go); color: var(--on-go); font: 700 12px/20px var(--font); border: 2px solid var(--plate); text-align: center; }

/* the pill button, for forms */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem; min-height: 46px; padding: 0 1.3rem; border-radius: 999px;
  background: var(--plate); color: var(--ink); border: 2px solid var(--ink); font: 600 15px/1 var(--font); text-decoration: none; white-space: nowrap;
  transition: background .12s, transform .1s, box-shadow .12s;
}
@media (hover: hover) { .btn:hover:not(:disabled) { background: var(--map-2); } }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn .icon { width: 18px; height: 18px; }
.btn-primary { background: var(--go); color: var(--on-go); border-color: var(--go); box-shadow: 0 4px 0 var(--go-deep); }
@media (hover: hover) { .btn-primary:hover:not(:disabled) { background: var(--go); transform: translateY(-1px); box-shadow: 0 5px 0 var(--go-deep); } }
.btn-primary:active:not(:disabled) { transform: translateY(3px); box-shadow: 0 1px 0 var(--go-deep); }
.btn-success { background: var(--fill); color: var(--on-fill); border-color: var(--fill); box-shadow: 0 4px 0 color-mix(in srgb, var(--fill) 70%, #000); }
@media (hover: hover) { .btn-success:hover:not(:disabled) { background: var(--fill); transform: translateY(-1px); } }
.btn-ghost, .btn-secondary { background: var(--plate); }
.btn-danger { background: transparent; color: var(--bad); border-color: var(--bad); }
@media (hover: hover) { .btn-danger:hover:not(:disabled) { background: var(--bad-bg); } }
.btn-sm { min-height: 38px; padding: 0 1rem; font-size: 14px; }
.btn-lg { min-height: 54px; font-size: 17px; padding: 0 1.8rem; }
.btn-block { width: 100%; }
.link { background: none; border: 0; padding: .5rem .2rem; color: var(--ink); font: 600 15px var(--font); text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 4px; }

/* ── Inputs ─────────────────────────────────────────────────────── */
.input, .form-input, .form-select, select.input {
  width: 100%; min-height: 50px; padding: .7rem 1.2rem; background: var(--plate); color: var(--ink);
  border: 2px solid var(--line-strong); border-radius: 999px; font: 500 16px/1.3 var(--font); transition: border-color .12s, box-shadow .12s;
}
textarea.input, textarea.form-input, .form-textarea { border-radius: var(--r-md); padding: .85rem 1.1rem; min-height: 96px; resize: vertical; line-height: 1.5; }
.input::placeholder, .form-input::placeholder, textarea::placeholder { color: color-mix(in srgb, var(--ink-2) 78%, transparent); }
.input:focus, .form-input:focus, .form-select:focus, textarea:focus { outline: none; border-color: var(--ink); box-shadow: 0 0 0 4px color-mix(in srgb, var(--ink) 20%, transparent); }
.input-code { font-family: var(--mono); letter-spacing: .14em; text-transform: uppercase; }
/* Dropdowns: ONE look for every <select> in the portal (teacher and student pages), whatever class it has.
   The list opens in the portal's own style where the browser can do it (Chrome / Edge 135+); other browsers keep
   their native list but still get the pill and the arrow. */
select:not([multiple]):not([size]) {
  appearance: none; -webkit-appearance: none; min-width: 0; max-width: 100%; padding-inline-end: 2.4rem;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: pointer;
  background: var(--plate) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='9' viewBox='0 0 14 9'%3E%3Cpath d='M1 1l6 6 6-6' fill='none' stroke='%235a6b64' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat right 1.1rem center;
}
[dir="rtl"] select:not([multiple]):not([size]) { background-position: left 1.1rem center; }
@supports (appearance: base-select) {
  select:not([multiple]):not([size]), select:not([multiple]):not([size])::picker(select) { appearance: base-select; }
  select:not([multiple]):not([size]) { background-image: none; padding-inline-end: 1.2rem; }      /* the built-in arrow replaces the drawn one */
  select::picker-icon { color: var(--ink-2); transition: rotate .15s; }
  select:open::picker-icon { rotate: 180deg; }
  select::picker(select) {
    margin-block: 8px; padding: .4rem; max-width: min(92vw, 560px); border: 1px solid var(--line); border-radius: var(--r-md);
    background: var(--plate); color: var(--ink); box-shadow: var(--shadow-pop);
  }
  select option { display: flex; align-items: center; gap: .6rem; min-height: 40px; padding: .35rem .9rem; border-radius: 12px; font: 600 15px var(--font); color: var(--ink); white-space: normal; }
  select option::checkmark { order: 1; margin-inline-start: auto; }
  select option:hover, select option:focus-visible { background: var(--map-2); outline: none; }
  select option:checked { background: var(--fill); color: var(--on-fill); }
  select selectedcontent { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
}

/* round checkboxes and radios: a marker you can fill */
input[type="checkbox"], input[type="radio"] {
  -webkit-appearance: none; appearance: none; display: inline-grid; place-items: center; width: 24px; height: 24px; flex: none; margin: 0;
  border: 2.5px solid var(--ink); border-radius: 50%; background: var(--plate); cursor: pointer; transition: background .12s, border-color .12s;
}
input[type="checkbox"]:checked, input[type="radio"]:checked { background: var(--fill); border-color: var(--fill); }
input[type="checkbox"]:checked::after { content: ""; width: 11px; height: 6px; border-left: 3px solid var(--on-fill); border-bottom: 3px solid var(--on-fill); transform: rotate(-45deg) translate(1px, -1px); }
input[type="radio"]:checked::after { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--on-fill); }
input[type="checkbox"]:disabled, input[type="radio"]:disabled { opacity: .5; cursor: not-allowed; }

/* ── Markers and the route ──────────────────────────────────────── */
.node {
  position: relative; display: inline-grid; place-items: center; width: 28px; height: 28px; flex: none; border-radius: 50%;
  background: var(--plate); border: 3px solid var(--ink); color: var(--ink); font: 700 12px/1 var(--font);
}
.node .icon { width: 14px; height: 14px; stroke-width: 3; }
.node.done { background: var(--fill); color: var(--on-fill); border-color: var(--fill); }
.node.now { border-color: var(--route); box-shadow: 0 0 0 6px var(--route-soft); }
.node.now::before { content: ""; width: 11px; height: 11px; border-radius: 50%; background: var(--route); }
.node.now::after { content: ""; position: absolute; inset: -11px; border-radius: 50%; border: 2.5px solid var(--route); opacity: 0; animation: ring 2s ease-out infinite; }
@keyframes ring { 0% { transform: scale(.7); opacity: .9; } 100% { transform: scale(1.3); opacity: 0; } }
.node.lock { border-color: var(--lock); color: var(--lock); background: var(--map); }
.node.plan { border-style: dashed; border-color: var(--ink-2); background: transparent; color: var(--ink-2); }
.node.miss { border-color: var(--bad); color: var(--bad); }
.node.flag { background: var(--fill); color: var(--on-fill); border-color: var(--fill); }

/* a vertical route: a dotted line joining stops */
.route { position: relative; display: grid; gap: .9rem; padding-inline-start: 0; }
.route::before { content: ""; position: absolute; inset-inline-start: 13px; top: 14px; bottom: 14px; border-inline-start: 3px dotted var(--route); }
.stop { position: relative; display: grid; grid-template-columns: 28px minmax(0, 1fr); gap: .9rem; align-items: start; }
.stop > .node { margin-top: 13px; z-index: 1; box-shadow: 0 0 0 5px var(--map); }
.stop > .node.now { box-shadow: 0 0 0 5px var(--map), 0 0 0 11px var(--route-soft); }

/* ── Progress / spinner / alerts ────────────────────────────────── */
.spinner, .btn-spinner {
  width: 38px; height: 38px; border-radius: 50%; border: 4px solid var(--line); border-top-color: var(--route); animation: spin .9s linear infinite;
}
.btn-spinner { width: 18px; height: 18px; border-width: 3px; border-color: color-mix(in srgb, currentColor 30%, transparent); border-top-color: currentColor; }
@keyframes spin { to { transform: rotate(360deg); } }
.alert, .notice { display: flex; gap: .65rem; align-items: flex-start; padding: .8rem 1.1rem; border-radius: var(--r-md); font-size: .94rem; line-height: 1.45; border: 1.5px solid transparent; }
.alert-danger, .notice-bad   { background: var(--bad-bg);  color: var(--bad); }
.alert-warning, .notice-warn { background: var(--warn-bg); color: var(--warn); }
.alert-info, .notice-info    { background: var(--info-bg); color: var(--info); }
.alert-success, .notice-ok   { background: var(--ok-bg);   color: var(--ok); }

/* ── Overlays, sheets, toast ────────────────────────────────────── */
.overlay { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 1rem; background: var(--scrim); backdrop-filter: blur(3px); animation: fade .16s ease-out; }
.overlay-solid { background: var(--map); backdrop-filter: none; z-index: 200; }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
.dialog { width: 100%; max-width: 440px; padding: 1.6rem; text-align: center; box-shadow: var(--shadow-pop); }
.dialog-title { font-size: 1.35rem; margin-bottom: .45rem; }
.dialog-actions { display: flex; gap: .7rem; justify-content: center; align-items: center; margin-top: 1.4rem; flex-wrap: wrap; }
@media (max-width: 560px) {
  .overlay:not(.overlay-solid) { align-items: end; padding: 0; }
  .overlay:not(.overlay-solid) .dialog { max-width: none; border-radius: 28px 28px 0 0; padding: 1rem 1.4rem calc(1.6rem + env(safe-area-inset-bottom, 0px)); animation: sheet .22s ease-out; }
  .overlay:not(.overlay-solid) .dialog::before { content: ""; display: block; width: 44px; height: 5px; border-radius: 3px; background: var(--line); margin: 0 auto 1rem; }
}
@keyframes sheet { from { transform: translateY(40px); opacity: .4; } to { transform: none; opacity: 1; } }
.toast {
  position: fixed; bottom: calc(138px + env(safe-area-inset-bottom, 0px)); inset-inline: 14px; margin-inline: auto; z-index: 150; max-width: 500px; padding: .85rem 1.2rem; border-radius: 999px;
  background: var(--warn-bg); color: var(--warn); border: 1.5px solid color-mix(in srgb, var(--warn) 35%, transparent); box-shadow: var(--shadow-pop);
  font: 600 14.5px/1.35 var(--font); text-align: center;
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; } }

/* ── The school's logo in the round mark (Settings → Branding); without one the mark shows the initials ── */
.brand-mark.has-logo { background: #ffffff; padding: 0; overflow: hidden; box-shadow: inset 0 0 0 1px rgba(18, 51, 42, .12); }
.brand-mark.has-logo img { display: block; width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }

/* ── Slider (input type=range): a brand-coloured round thumb on a quiet track ── */
input[type="range"] { -webkit-appearance: none; appearance: none; width: 100%; height: 28px; background: transparent; cursor: pointer; }
input[type="range"]::-webkit-slider-runnable-track { height: 6px; border-radius: 99px; background: var(--map-2); }
input[type="range"]::-moz-range-track { height: 6px; border-radius: 99px; background: var(--map-2); }
input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; width: 22px; height: 22px; margin-top: -8px; border-radius: 50%; background: var(--go); border: 3px solid var(--plate); box-shadow: 0 0 0 1.5px var(--go); }
input[type="range"]::-moz-range-thumb { width: 16px; height: 16px; border-radius: 50%; background: var(--go); border: 3px solid var(--plate); box-shadow: 0 0 0 1.5px var(--go); }
input[type="range"]:focus-visible { outline: none; }
input[type="range"]:focus-visible::-webkit-slider-thumb { box-shadow: 0 0 0 1.5px var(--go), 0 0 0 6px color-mix(in srgb, var(--go) 30%, transparent); }
input[type="range"]:focus-visible::-moz-range-thumb { box-shadow: 0 0 0 1.5px var(--go), 0 0 0 6px color-mix(in srgb, var(--go) 30%, transparent); }
