:root {
  --bg: #f6f5f2;
  --surface: #ffffff;
  --surface-2: #f0efeb;
  --ink: #1d2433;
  --ink-2: #4a5263;
  --muted: #6b7280;
  --line: #e2e0da;
  --line-strong: #cfccc4;
  --brand: #365f91;          /* the faculty template's heading blue */
  --brand-ink: #ffffff;
  --brand-soft: #e8eef6;
  --focus: #2f6fd6;
  --good: #2e7d4f;
  --warn: #9a6200;
  --bad: #b3261e;
  --ai: #6b4fbb;
  --ai-soft: #f1edfb;
  --music: #365f91; --va: #a14a2a; --drama: #7a2e6b; --pdm: #2c6e6a; --japanese: #9b2f3f;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(20, 24, 33, .06), 0 4px 16px rgba(20, 24, 33, .05);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #14171d; --surface: #1c2028; --surface-2: #232833; --ink: #e8eaf0; --ink-2: #c3c8d4; --muted: #9098a8;
    --line: #2d3340; --line-strong: #3b4252; --brand: #7ea6dc; --brand-ink: #0f1520; --brand-soft: #22324a;
    --ai: #b49cf2; --ai-soft: #2a2442; --music: #7ea6dc; --va: #e09a7b; --drama: #d18cc3; --pdm: #7cc4bf; --japanese: #ec8f9c;
    --shadow: 0 1px 2px rgba(0,0,0,.3), 0 4px 16px rgba(0,0,0,.25);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-padding-top: 76px; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 15px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3 { line-height: 1.25; margin: 0; }
h1 { font-size: 1.6rem; letter-spacing: -.01em; }
h2 { font-size: 1.15rem; }
a { color: var(--brand); }
a.btn { text-decoration: none; }
code { font-size: .9em; background: var(--surface-2); padding: 1px 5px; border-radius: 4px; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }

.muted { color: var(--muted); }
.small { font-size: .85rem; }
.pad { padding: 24px 0; }
.err { color: var(--bad); }
.note { background: var(--surface-2); border-radius: 8px; padding: 10px 12px; color: var(--ink-2); }

/* buttons */
.btn {
  font: inherit; font-weight: 550; font-size: .92rem; cursor: pointer;
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 14px; border-radius: 8px; border: 1px solid var(--line-strong);
  background: var(--surface); color: var(--ink);
  transition: background .15s, border-color .15s, transform .08s;
}
.btn:hover { background: var(--surface-2); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .6; cursor: progress; }
.btn.primary { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
.btn.primary:hover { filter: brightness(1.08); }
.btn.small { padding: 5px 10px; font-size: .84rem; }
.btn.ai { border-color: color-mix(in srgb, var(--ai) 35%, transparent); color: var(--ai); background: var(--ai-soft); }
.btn.ai:hover { border-color: var(--ai); }
.spark { font-size: .8em; }
.icon-btn {
  font: inherit; cursor: pointer; width: 30px; height: 30px; border-radius: 7px;
  border: 1px solid transparent; background: transparent; color: var(--muted); font-size: 1rem;
}
.icon-btn:hover:not(:disabled) { background: var(--surface-2); color: var(--ink); border-color: var(--line); }
.icon-btn.danger:hover { color: var(--bad); }
.icon-btn:disabled { opacity: .3; cursor: default; }
.link-quiet { font: inherit; background: none; border: 0; padding: 4px 2px; margin: -4px -2px; color: var(--ink-2); cursor: pointer; text-decoration: none; font-size: .88rem; }
@media (pointer: coarse) { .link-quiet { padding: 8px 4px; margin: -8px -4px; } .card-actions { gap: 6px 16px; } }
.link-quiet:hover { color: var(--brand); text-decoration: underline; }

/* gate */
.gate { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.gate-card {
  width: min(400px, 100%); background: var(--surface); border: 1px solid var(--line);
  border-radius: 14px; padding: 28px; box-shadow: var(--shadow); display: grid; gap: 10px;
}
.gate-card h1 { color: var(--brand); }
.gate-card label { font-weight: 600; font-size: .9rem; margin-top: 6px; }
/* the public demo (CP_DEMO): its sign-in card and the reminder in the top bar */
.demo-card { width: min(460px, 100%); }
.demo-card p { margin: 0; }
.demo-tag, .demo-pill { justify-self: start; font-size: .75rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
  padding: 2px 10px; border-radius: 999px; background: var(--brand-soft, #e7eef7); color: var(--brand); }
.demo-pill { white-space: nowrap; }

/* inputs */
input[type=text], input[type=url], input[type=number], input[type=password], select, textarea {
  font: inherit; color: var(--ink); background: var(--surface);
  border: 1px solid var(--line-strong); border-radius: 8px; padding: 8px 10px; width: 100%;
  transition: border-color .15s, box-shadow .15s;
}
textarea { resize: vertical; line-height: 1.45; min-height: 42px; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--focus); box-shadow: 0 0 0 3px color-mix(in srgb, var(--focus) 18%, transparent); }
::placeholder { color: color-mix(in srgb, var(--muted) 75%, transparent); }
.check { display: inline-flex; align-items: center; gap: 6px; font-size: .9rem; color: var(--ink-2); cursor: pointer; }

/* top bar */
.topbar {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px 20px; background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(10px); border-bottom: 1px solid var(--line);
}
.brand { display: inline-flex; align-items: center; gap: 9px; font-weight: 700; color: var(--ink); text-decoration: none; white-space: nowrap; flex-shrink: 0; }
/* The editor's top bar holds its toolbar: below a wide screen the brand is its mark only (still the way home), so the bar stays one row. */
@media (max-width: 1440px) { .topbar:has(.save-state) .brand-name { display: none; } }
.topbar-right .user-name { max-width: 10em; }
.brand-mark { width: 22px; height: 22px; border-radius: 6px; background: var(--brand); position: relative; }
.brand-mark::after { content: ""; position: absolute; inset: 5px 6px; border: 2px solid var(--brand-ink); border-radius: 2px; border-right-width: 0; border-left-width: 0; }
.topbar-right { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }
.save-state { font-size: .84rem; color: var(--muted); min-width: 7em; text-align: right; }
.save-state.bad { color: var(--bad); }

/* list */
.page { max-width: 1120px; margin: 0 auto; padding: 28px 20px 80px; }
.list-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.list-head p { margin: 6px 0 0; }
.list-tools { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 8px; }
.list-hidden { margin: 0 0 10px; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { font: inherit; font-size: .86rem; padding: 5px 12px; border-radius: 999px; border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink-2); cursor: pointer; }
.chip.on { background: var(--ink); color: var(--surface); border-color: var(--ink); }
.group-head { margin: 26px 0 10px; font-size: .95rem; color: var(--muted); font-weight: 650; letter-spacing: .02em; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); display: flex; flex-direction: column; transition: border-color .15s, box-shadow .15s; }
.card:hover { border-color: var(--line-strong); box-shadow: var(--shadow); }
.card-main { padding: 14px 16px 10px; color: inherit; text-decoration: none; flex: 1; }
.card-main h3 { font-size: 1.05rem; margin: 8px 0 4px; }
.card-main p { margin: 0; font-size: .9rem; }
.card-meta { display: flex; gap: 6px; align-items: center; justify-content: space-between; }
.card-foot { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 4px 8px; padding: 8px 16px; border-top: 1px solid var(--line); }
.card-actions { display: flex; flex-wrap: wrap; gap: 2px 12px; white-space: nowrap; }
.list-filters { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.empty { text-align: center; padding: 56px 20px; background: var(--surface); border: 1px dashed var(--line-strong); border-radius: 14px; margin-top: 16px; }
.empty p { color: var(--ink-2); max-width: 46ch; margin: 10px auto 18px; }

.subj { font-size: .75rem; font-weight: 650; letter-spacing: .02em; padding: 2px 8px; border-radius: 999px; color: var(--music); background: color-mix(in srgb, currentColor 11%, transparent); }
.subj-visual-arts { color: var(--va); } .subj-drama { color: var(--drama); } .subj-pdm { color: var(--pdm); } .subj-japanese { color: var(--japanese); }
.status { font-size: .75rem; font-weight: 600; padding: 2px 8px; border-radius: 999px; background: var(--surface-2); color: var(--ink-2); }
.status-ready { background: #fff3d6; color: var(--warn); }
.status-registered { background: #e3f3e8; color: var(--good); }
.status-evaluated { background: var(--brand-soft); color: var(--brand); }
/* A program's, schedule's or notification's use: In use, Not in use (kept for later), New (not sorted yet). */
.status.in-use { background: #e3f3e8; color: var(--good); }
.status.use-new { background: transparent; color: var(--brand); box-shadow: inset 0 0 0 1px currentColor; }
@media (prefers-color-scheme: dark) {
  .status-ready { background: #3a2f12; } .status-registered, .status.in-use { background: #183324; color: #7fd3a0; }
}
.use-pick { display: inline-flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.row-inline.tight { gap: 4px; margin-bottom: 0; }
.status-select { width: auto; padding: 6px 8px; font-size: .86rem; font-weight: 600; }
.badge { display: inline-block; margin-left: 6px; font-size: .7rem; font-weight: 600; padding: 1px 6px; border-radius: 4px; background: #fff3d6; color: var(--warn); vertical-align: 1px; }
@media (prefers-color-scheme: dark) { .badge { background: #3a2f12; } }

/* editor */
.ed-layout { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 28px; max-width: 1240px; margin: 0 auto; padding: 0 20px; }
.side { position: sticky; top: var(--topbar-h, 64px); align-self: start; padding: 24px 0; }
.side .back { display: inline-block; font-size: .88rem; text-decoration: none; margin-bottom: 14px; color: var(--ink-2); }
.side ol { list-style: none; margin: 0; padding: 0; border-left: 2px solid var(--line); }
.side li a { display: block; padding: 5px 12px; margin-left: -2px; border-left: 2px solid transparent; color: var(--ink-2); text-decoration: none; font-size: .92rem; }
.side li a:hover { color: var(--brand); border-left-color: var(--brand); }
.editor { padding: 24px 0 120px; min-width: 0; }
.ed-head { margin-bottom: 18px; }
.ed-head h1 { margin: 8px 0 4px; }
.ed-head p { margin: 0; }
.sec { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 18px 20px 20px; margin-bottom: 14px; }
.sec-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; }
.sec-head h2 { color: var(--brand); }
.sec-tools { display: flex; align-items: center; gap: 10px; }
.sec-fold { all: unset; cursor: pointer; display: inline-flex; align-items: center; gap: 8px; }
.sec-fold::before { content: "▸"; color: var(--muted); font-size: .75em; transform: rotate(90deg); transition: transform .15s; }
.sec-fold:focus-visible { outline: 2px solid var(--brand); outline-offset: 3px; border-radius: 4px; }
.sec.folded { padding-bottom: 6px; }
.sec.folded .sec-fold::before { transform: none; }
.sec.folded > :not(.sec-head), .sec.folded .sec-tools { display: none; }
.sec.folded .sec-head { margin-bottom: 12px; }
.fold-all { display: flex; gap: 12px; margin-top: 12px; padding-left: 12px; font-size: .85rem; }
.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 16px; }
.span2 { grid-column: 1 / -1; }
.field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.lbl { font-size: .82rem; font-weight: 650; color: var(--ink-2); }
.hint { font-size: .78rem; color: var(--muted); }
.mini { font-size: .9rem; margin: 18px 0 8px; color: var(--ink-2); }
.row-inline { display: flex; gap: 8px; align-items: center; margin-bottom: 6px; }
.row-inline .grow { flex: 1; }
.code-in { width: 120px !important; flex: none; }

.bank { display: grid; gap: 2px; }
.bank > p { margin: 0 0 6px; }
.outcome { display: grid; grid-template-columns: auto 104px 1fr; gap: 10px; align-items: start; padding: 7px 8px; border-radius: 8px; cursor: pointer; font-size: .93rem; }
.outcome:hover { background: var(--surface-2); }
.outcome input { margin-top: 4px; }
.outcome .code { font-weight: 700; font-variant-numeric: tabular-nums; font-size: .86rem; padding-top: 1px; }

.assess { display: grid; gap: 6px; }
.assess-task { display: grid; gap: 6px; padding-bottom: 12px; border-bottom: 1px solid var(--line); margin-bottom: 6px; }
.assess-row { display: grid; grid-template-columns: 2.4fr 1.2fr 64px 30px; gap: 8px; align-items: center; }
.assess-linkrow { display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: center; }
.assess-link { max-width: 100%; }
.assess-row input[readonly] { background: var(--bg); color: var(--muted); }

/* Formatting toolbar over each text field: writes the markup lib/docx.php renders. */
.fmt-bar { display: flex; flex-wrap: wrap; gap: 2px; margin-bottom: -2px; }
.fmt { font: inherit; font-size: .78rem; min-width: 28px; height: 24px; padding: 0 7px; border-radius: 6px; border: 1px solid transparent;
  background: transparent; color: var(--ink-2); cursor: pointer; line-height: 1; }
.fmt:hover { background: var(--surface-2); border-color: var(--line); color: var(--ink); }
.fmt-b { font-weight: 800; }
.fmt-i { font-style: italic; font-family: Georgia, serif; }
.fmt-bar { container-type: inline-size; }
.fmt.fmt-ai { margin-left: auto; color: var(--ai); font-weight: 600; }
/* A narrow box: just the ✦, so the toolbar stays on one line. */
@container (max-width: 330px) { .fmt-ai-text { display: none; } .fmt { min-width: 22px; padding: 0 4px; } }
.fmt.fmt-ai:hover { background: var(--ai-soft); border-color: color-mix(in srgb, var(--ai) 35%, transparent); color: var(--ai); }
.rich.rich-view { border: 0; padding: 0; background: none; cursor: auto; min-height: 0; box-shadow: none; }
.field textarea { font-variant-ligatures: none; }
.rich { font: inherit; color: var(--ink); background: var(--surface); border: 1px solid var(--line-strong); border-radius: 8px;
  padding: 8px 10px; width: 100%; line-height: 1.45; overflow-wrap: anywhere; position: relative; cursor: text;
  counter-reset: n0 n1 n2; transition: border-color .15s, box-shadow .15s; }
.rich:focus { outline: none; border-color: var(--focus); box-shadow: 0 0 0 3px color-mix(in srgb, var(--focus) 18%, transparent); }
.rich.is-empty::before { content: attr(data-placeholder); position: absolute; left: 10px; top: 8px; right: 10px; pointer-events: none;
  color: color-mix(in srgb, var(--muted) 75%, transparent); }
.rich a { color: var(--brand); }
.rich > div { position: relative; min-height: 1.45em; }
.rich > div[data-k="h"] { font-weight: 700; font-size: 1.04em; color: var(--brand); margin-top: .35em; }
.rich > div[data-k="h"]:first-child { margin-top: 0; }
.rich > div[data-k="b"], .rich > div[data-k="n"], .rich > div[data-k="c"], .rich > div[data-k="x"] { padding-left: 1.4em; }
.rich > div[data-l="1"]:not([data-k="p"]):not([data-k="h"]) { margin-left: 1.4em; }
.rich > div[data-l="2"]:not([data-k="p"]):not([data-k="h"]) { margin-left: 2.8em; }
.rich > div::before { position: absolute; left: 0; color: var(--ink-2); }
.rich > div[data-k="b"]::before { content: "•"; left: .35em; }
.rich > div[data-k="b"][data-l="1"]::before { content: "◦"; }
.rich > div[data-k="b"][data-l="2"]::before { content: "▪"; }
/* Numbered steps count from 1 again after a plain line, heading or blank line, as the export does; a, b, c under a step. */
/* counter-set, not counter-reset: a reset on a sibling line doesn't restart the count for the lines after it. */
.rich > div[data-l="0"]:not([data-k="n"]):not([data-k="c"]):not([data-k="x"]) { counter-set: n0 0 n1 0 n2 0; }
.rich > div[data-k="n"][data-l="0"] { counter-increment: n0; counter-set: n1 0 n2 0; }
.rich > div[data-k="n"][data-l="1"], .rich > div[data-sub][data-l="1"] { counter-increment: n1; counter-set: n2 0; }
.rich > div[data-k="n"][data-l="2"], .rich > div[data-sub][data-l="2"] { counter-increment: n2; }
.rich > div[data-k="n"][data-l="0"]::before { content: counter(n0) "."; }
.rich > div[data-k="n"][data-l="1"]::before, .rich > div[data-sub][data-l="1"]::before { content: counter(n1, lower-alpha) "."; left: 0; }
.rich > div[data-k="n"][data-l="2"]::before, .rich > div[data-sub][data-l="2"]::before { content: counter(n2, lower-roman) "."; left: 0; }
.rich > div[data-k="c"]::before, .rich > div[data-k="x"]::before { content: "☐"; cursor: pointer; font-size: 1.05em; }
.rich > div[data-k="x"]::before { content: "☑"; color: var(--brand); }
.kf-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 10px; }
.kf-cols .lbl { font-weight: 600; }

/* Checklists: repertoire categories, content areas */
.ticks { display: grid; gap: 2px; margin-bottom: 6px; }
.tick { display: grid; grid-template-columns: auto 1fr; gap: 9px; align-items: start; padding: 5px 8px; border-radius: 8px; cursor: pointer; font-size: .93rem; }
.tick:hover { background: var(--surface-2); }
.tick input { margin-top: 3px; }
.tick.small { font-size: .86rem; padding: 4px 6px; }
.tickrow .use { display: flex; gap: 10px; align-items: center; margin: 0 0 4px 30px; font-size: .8rem; }
.tickrow:not(:has(> .tick input:checked)) .use { display: none; }
.tickrow .use select { width: auto; font-size: .8rem; padding: 2px 4px; }
.use-assessed { white-space: nowrap; }
.use-assessed { display: inline-flex; gap: 5px; align-items: center; cursor: pointer; color: var(--muted, #666); }
/* Strategy boxes: Literacy | Numeracy, and the differentiation table's three columns */
.strat-cols { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-top: 6px; }
.strat-cols.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.strat-col { display: grid; align-content: start; gap: 4px; min-width: 0; }
.strat-col > .lbl { color: var(--brand); }
.strat-col > .lbl.sub { margin-top: 8px; }
.ticks > .tick-group { font-size: .74rem; font-weight: 600; letter-spacing: .02em; color: var(--muted); padding: 8px 6px 1px; }
.ticks > .tick-group:first-child { padding-top: 0; }
/* The teacher's own strategy items: one editable line each, removable, with an Add box below. */
.own-items { display: grid; gap: 4px; }
.own-line { display: flex; align-items: flex-start; gap: 6px; }
.own-dot { color: var(--muted); width: 14px; text-align: center; flex: none; }
.own-dot { padding-top: 4px; }
.own-line textarea { flex: 1; min-width: 0; padding: 3px 6px; font: inherit; font-size: .85rem; line-height: 1.35; border-color: transparent; background: transparent; resize: none; overflow: hidden; min-height: 0; }
.own-line textarea:hover, .own-line textarea:focus { border-color: var(--line); background: var(--bg); }
.own-del { border: 0; background: none; color: var(--muted); font-size: 1.1rem; line-height: 1; padding: 2px 6px; cursor: pointer; border-radius: 4px; }
.own-del:hover, .own-del:focus-visible { color: var(--danger, #b42318); background: var(--hover, rgba(0,0,0,.05)); }
.own-row .use { display: flex; gap: 10px; align-items: center; margin: 0 0 4px 20px; font-size: .8rem; }
.own-row .use select { width: auto; font-size: .8rem; padding: 2px 4px; }
.own-add { display: flex; gap: 6px; margin-left: 20px; }
.own-add input { flex: 1; min-width: 0; padding: 3px 6px; font-size: .85rem; }
.own-other { margin-top: 6px; }
@media (max-width: 900px) { .strat-cols, .strat-cols.three { grid-template-columns: 1fr; } }
.content-cols { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.content-col .mini { margin-top: 4px; color: var(--brand); }
.content-group { font-size: .8rem; font-weight: 700; color: var(--ink-2); margin: 12px 0 4px 6px; }
.assess-headrow { font-size: .78rem; font-weight: 650; color: var(--muted); }
.assess > .btn { justify-self: start; margin-top: 4px; }

.weeks { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; margin: 10px 0 12px; }
.week { border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
.week[open] { border-color: var(--line-strong); box-shadow: var(--shadow); }
.week summary { list-style: none; cursor: pointer; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 10px 8px 14px; }
.week summary::-webkit-details-marker { display: none; }
.week summary::before { content: "▸"; color: var(--muted); font-size: .8rem; margin-right: -2px; transition: transform .15s; }
.week[open] summary::before { transform: rotate(90deg); }
.week-title { flex: 1; min-width: 0; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.week-tools { display: flex; gap: 2px; align-items: center; }
.week-tools .btn { margin-right: 6px; }
.week-body { padding: 4px 14px 16px; border-top: 1px solid var(--line); padding-top: 14px; }

/* dialogs */
.dlg { border: 0; padding: 0; border-radius: 14px; background: var(--surface); color: var(--ink); box-shadow: 0 20px 60px rgba(0,0,0,.25); width: min(560px, calc(100vw - 32px)); }
.dlg.wide { width: min(860px, calc(100vw - 32px)); }
.dlg::backdrop { background: rgba(20, 24, 33, .45); }
.dlg-inner { padding: 22px; display: grid; gap: 14px; max-height: calc(100vh - 40px); overflow: auto; }
.dlg-actions { display: flex; justify-content: flex-end; gap: 8px; position: sticky; bottom: -22px; background: var(--surface); padding: 10px 0 0; }
.form-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.form-grid .span2 { grid-column: 1 / -1; }
.form-grid label { display: flex; flex-direction: column; gap: 5px; }
.subject-pick { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin-top: 5px; }
.subject-opt { font: inherit; font-weight: 600; padding: 12px; border-radius: 10px; border: 1.5px solid var(--line-strong); background: var(--surface); color: var(--music); cursor: pointer; text-align: left; }
.subject-opt.on { border-color: currentColor; background: color-mix(in srgb, currentColor 9%, var(--surface)); }
.versions { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; max-height: 50vh; overflow: auto; }
.versions li { display: flex; justify-content: space-between; align-items: center; padding: 6px 10px; border-radius: 8px; background: var(--surface-2); }

.suggest { display: grid; gap: 10px; }
.suggest > p { margin: 0; }
.thinking { display: flex; align-items: center; gap: 10px; color: var(--ai); padding: 14px; background: var(--ai-soft); border-radius: 10px; }
.dots { width: 18px; height: 18px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .dots { animation: none; } * { transition: none !important; } }
.sug-list { display: grid; gap: 8px; }
.sug-all { font-size: .85rem; color: var(--muted); }
.sug-item { display: grid; grid-template-columns: auto 1fr; gap: 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; cursor: pointer; }
.sug-item:has(input:checked) { border-color: color-mix(in srgb, var(--ai) 50%, transparent); background: var(--ai-soft); }
.sug-item input { margin-top: 4px; }
.sug-label { font-weight: 650; font-size: .9rem; margin-bottom: 3px; }
.sug-text { white-space: pre-wrap; font-size: .9rem; color: var(--ink-2); }
/* Suggest: what's there now beside the draft. */
.sug-compare { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 4px; }
.sug-compare > div { min-width: 0; padding: 6px 8px; border-radius: 6px; border: 1px solid var(--line); }
.sug-col { font-size: .72rem; font-weight: 650; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); margin-bottom: 3px; }
.sug-now { background: color-mix(in srgb, var(--line) 25%, transparent); }
.sug-now .if-ticked { display: none; text-transform: none; letter-spacing: 0; color: var(--warn); }
.sug-item:has(input:checked) .sug-compare:not(.adds) .sug-now .if-ticked, .replace-all .sug-compare:not(.adds) .sug-now .if-ticked { display: inline; }
.sug-item:has(input:checked) .sug-compare:not(.adds) .sug-now .sug-text, .replace-all .sug-compare:not(.adds) .sug-now .sug-text { text-decoration: line-through; text-decoration-color: color-mix(in srgb, var(--warn) 55%, transparent); opacity: .75; }
.sug-new { background: var(--surface); }
.fill-only .sug-compare .if-ticked { display: none !important; }
.fill-only .sug-compare .sug-now .sug-text { text-decoration: none !important; opacity: 1 !important; }
.fill-only .sug-compare .sug-new { opacity: .45; }
/* Suggest weeks / import: one row per week, opened to compare. */
.wk-cmp-list { display: grid; gap: 6px; }
.wk-cmp { border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px; }
.wk-cmp > summary { cursor: pointer; font-size: .9rem; }
.wk-cmp[open] > summary { margin-bottom: 6px; }
.fill-only .only-replace, .replace-all .only-fill, .fill-only .sas-sug-row.clears { display: none; }
.wk-gone { margin: 4px 0 0; font-size: .88rem; color: var(--warn); }
@media (max-width: 700px) { .sug-compare { grid-template-columns: 1fr; } }
.modes { border: 0; padding: 0; margin: 0 0 8px; display: grid; gap: 4px; }

.toast { position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%); z-index: 50; background: var(--ink); color: var(--surface); padding: 10px 16px; border-radius: 10px; box-shadow: var(--shadow); font-size: .92rem; transition: opacity .4s, transform .4s; max-width: calc(100vw - 32px); }
.toast.bad { background: var(--bad); color: #fff; }
.toast-undo { font: inherit; font-weight: 650; background: none; border: 0; color: inherit; text-decoration: underline; cursor: pointer; padding: 4px 6px; margin-left: 4px; }
.toast.out { opacity: 0; transform: translate(-50%, 8px); }

@media (max-width: 860px) {
  .ed-layout { grid-template-columns: 1fr; padding: 0 16px; }
  .side { display: none; }
  .grid { grid-template-columns: 1fr; }
  .assess-row { grid-template-columns: 1fr 1fr; }
  .content-cols { grid-template-columns: 1fr; }
  .assess-headrow { display: none; }
  .form-grid { grid-template-columns: 1fr 1fr; }
  .topbar { padding: 10px 16px; }
  .page { padding: 20px 16px 60px; }
  .save-state { min-width: 0; font-size: .78rem; }
}
/* Phones (audit 13 Oct 2026): the top bar wrapped to ~180 px and stuck, with the class strip under it. */
@media (max-width: 760px) {
  .topbar { position: static; }
  .cls-strip { top: 0; }
}
/* Where the side nav is hidden: "← Programming" and a section menu above the class strip. */
.sec-jump { display: none; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 10px; }
.sec-jump .back { font-size: .88rem; text-decoration: none; color: var(--ink-2); }
.sec-jump select { font: inherit; font-size: .9rem; padding: 6px 8px; border-radius: 8px; border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink); }
@media (max-width: 860px) { .sec-jump { display: flex; } }
@media (max-width: 1180px) { .with-preview .sec-jump { display: flex; } }
.cls-view-note { margin-top: 12px; }
.cls-stray { margin-top: 10px; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.sug-block { display: block; cursor: default; }
.sug-block .modes { margin: 8px 0 8px 22px; }
.note { white-space: pre-line; }
.note strong { color: var(--ink); }
.head-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.head-actions.center { justify-content: center; }

/* Stage 6 week tags, focus-area hours */
.week-tags { display: flex; flex-wrap: wrap; gap: 6px 18px; align-items: center; }
.week-tags > div { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.chip-tick { display: inline-flex; align-items: center; gap: 4px; font-size: .82rem; padding: 2px 8px 2px 4px; border: 1px solid var(--line); border-radius: 999px; cursor: pointer; }
.chip-tick:has(input:checked) { background: var(--brand-soft); border-color: var(--brand); }
.row-inline input.hours-in { width: 84px; flex: none; }
.depth-toggle { margin-top: 4px; }
.gdoc-note { margin: -4px 0 4px; }
.imp-step { display: grid; gap: 10px; }
.imp-step[hidden] { display: none; }

/* Review */
.review-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; }
.rv { padding: 8px 10px; border-radius: 8px; background: var(--surface-2); font-size: .9rem; line-height: 1.45; }
.rv-tag { display: inline-block; font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; padding: 1px 6px; border-radius: 4px; margin-right: 6px; }
.rv-issue .rv-tag { background: color-mix(in srgb, var(--bad) 16%, transparent); color: var(--bad); }
.rv-check .rv-tag { background: color-mix(in srgb, var(--warn) 18%, transparent); color: var(--warn); }
.rv-idea .rv-tag { background: var(--ai-soft); color: var(--ai); }
.rv-area { font-weight: 650; }
.rv-fix { margin-top: 6px; }
.rv-fix summary { cursor: pointer; font-size: .85rem; color: var(--ink-2); }

/* Assessment schedules */
.sched-strip { margin-bottom: 18px; }
.sched-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.sched-meta { margin-top: 12px; }
.sched-wrap { overflow-x: auto; margin: 16px 0 10px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.sched { border-collapse: collapse; width: 100%; min-width: 760px; font-size: .9rem; }
.sched th, .sched td { border-bottom: 1px solid var(--line); padding: 6px 8px; vertical-align: top; text-align: left; }
.sched thead th { background: var(--brand-soft); color: var(--brand); white-space: nowrap; }
.sched thead th input { display: inline-block; width: calc(100% - 34px); font-weight: 650; }
.sched tbody th { font-weight: 650; color: var(--ink-2); white-space: nowrap; }
.sched input.num { width: 64px; text-align: center; }
.sched .comp-name { min-width: 180px; }
.sched textarea { min-width: 150px; font-size: .85rem; }
.comp-sum { margin-left: 8px; font-size: .8rem; color: var(--muted); }
.comp-sum.bad, [data-grand].bad { color: var(--bad); }
.total-row { background: var(--surface-2); }
.page > .back { display: inline-block; margin-bottom: 8px; }

/* Program register */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); margin-top: 10px; }
.reg { border-collapse: collapse; width: 100%; min-width: 980px; font-size: .9rem; }
.reg th, .reg td { border-bottom: 1px solid var(--line); padding: 5px 6px; text-align: left; vertical-align: middle; }
.reg thead th { background: var(--brand-soft); color: var(--brand); font-weight: 650; white-space: nowrap; }
.reg input[type=text], .reg input[type=url], .reg select { width: 100%; padding: 5px 7px; font-size: .88rem; }
.reg .c-year { width: 64px; } .reg .c-class { width: 96px; } .reg .c-term { width: 120px; } .reg .c-teacher { width: 90px; }
.reg .c-doc { width: 230px; } .reg .c-tick { width: 52px; text-align: center; white-space: nowrap; } .reg .c-del { width: 36px; }
.reg .c-unit a { display: inline-block; margin-top: 2px; }
.reg tr.due { background: color-mix(in srgb, var(--warn) 7%, transparent); }
.reg.usage { min-width: 640px; }
.reg.usage .num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.reg.usage tr.on { background: var(--brand-soft); }
.usage-prices { margin-top: 24px; }
.usage-line { margin-top: 2px; }
.doc-cell { display: flex; gap: 6px; align-items: center; }
.due-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--warn); margin-left: 4px; vertical-align: 2px; }
.loose { display: grid; gap: 4px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 8px 12px; }
.loose-row { display: flex; gap: 12px; align-items: baseline; flex-wrap: wrap; }
.reg-note { margin-top: 2px; max-width: 34ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Google Doc dialog */
.row-inline { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.row-inline input { flex: 1; min-width: 160px; }
.folder-browser { border: 1px solid var(--line); border-radius: 10px; padding: 10px; display: grid; gap: 8px; }
.folder-browser .crumbs { color: var(--muted); }
.folder-list { display: grid; gap: 2px; max-height: 240px; overflow: auto; }
.folder { text-align: left; font: inherit; font-size: .9rem; background: none; border: 0; border-radius: 6px; padding: 6px 8px; color: var(--ink); cursor: pointer; }
.folder::before { content: "▸ "; color: var(--muted); }
.folder:hover { background: var(--surface-2); }
.folder-browser > .btn { justify-self: start; }
.folder-picker { display: grid; gap: 8px; }
/* Import: the unit's resources folder */
.res-found p { margin: 6px 0 0; }
.res-list summary { cursor: pointer; font-size: .9rem; color: var(--muted); }
.res-list .ticks { max-height: 220px; overflow: auto; margin-top: 6px; }
.res-unused { display: grid; gap: 4px; margin-top: 6px; }
.res-row { display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.res-row select { margin-left: auto; font-size: .85rem; }
.gdoc-note { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; background: var(--surface-2); }
.gdoc-note p { margin: 0; }
.gdoc-links { display: flex; gap: 8px; flex-wrap: wrap; }

/* Depth study (Stage 5): scaffold ticks in two columns, and one row per step of the plan */
.ticks.two-col { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.ds-advice { margin: 0 0 10px; }
.ds-advice summary { cursor: pointer; }
.ds-advice ul { margin: 4px 0 8px 18px; padding: 0; }
.ds-plan { display: grid; gap: 8px; margin-top: 6px; }
.ds-step { display: grid; grid-template-columns: minmax(0, 2fr) 110px minmax(0, 3fr); gap: 10px; align-items: start; padding: 8px; border: 1px solid var(--line, #e3e5ea); border-radius: 8px; }
.ds-step-name { font-size: .88rem; padding-top: 22px; }
@media (max-width: 900px) { .ticks.two-col { grid-template-columns: 1fr; } .ds-step { grid-template-columns: 1fr; } .ds-step-name { padding-top: 0; } }

/* Coverage: one row per content point, repertoire area or outcome, with the units that cover it; gaps stand out */
.cov-sec { margin: 22px 0; }
.cov-table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.cov-table td { border-top: 1px solid var(--line); padding: 6px 8px; vertical-align: top; }
.cov-table td:first-child { width: 55%; }
.cov-table tr.gap td:first-child { color: var(--ink); }
.cov-table tr.gap { background: color-mix(in srgb, #d97706 8%, transparent); }
.cov-chip { display: inline-block; margin: 0 6px 4px 0; padding: 1px 8px; border-radius: 999px; background: var(--surface-2); font-size: .8rem; text-decoration: none; color: var(--ink-2); }
.cov-chip:hover { text-decoration: underline; }
.cov-none { color: #b45309; font-size: .85rem; }
@media (max-width: 700px) { .cov-table td:first-child { width: auto; } }
.content-table { font-size: .95rem; margin: 14px 0 4px; color: var(--brand); }
.bank.life-skills { margin-top: 18px; }

/* Register & Comments per class, in each teaching-sequence row */
.wreg-entries { display: grid; gap: 8px; }
.wreg-entry { display: grid; grid-template-columns: 130px 1fr 28px; gap: 8px; align-items: start; }
.wreg-entry .lbl:empty { display: none; }
.wreg-entry .wreg-del { margin-top: 6px; }
.wreg-entry:first-child .wreg-del { margin-top: 30px; }
.wreg-add { justify-self: start; }
@media (max-width: 760px) { .wreg-entry { grid-template-columns: 1fr; } }

/* Planning or a class (Sam, 13 Oct 2026): the strip under the title, a class's register, the head teacher's grid. */
.cls-strip { position: sticky; top: var(--topbar-h, 57px); z-index: 15; display: flex; flex-wrap: wrap; align-items: center; gap: 6px;
  margin: 14px 0 0; padding: 8px 0; background: var(--bg); border-bottom: 1px solid var(--line); }
.cls-btn { font: inherit; font-size: .86rem; padding: 5px 12px; border-radius: 999px; border: 1px solid var(--line-strong);
  background: var(--surface); color: var(--ink-2); cursor: pointer; }
.cls-btn:hover { background: var(--surface-2); }
.cls-btn.on { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
.cls-btn.cls-all { margin-left: 6px; }
.cls-mine { font-weight: 700; }
.cls-note p { margin: 0 0 8px; }
.regw-list { display: grid; gap: 10px; margin-top: 10px; }
.regw { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; }
.regw-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 10px; }
.regw-head .week-title { font-weight: 600; }
.regw-head .link-quiet { margin-left: auto; }
.regw-plan { margin: 6px 0 4px; }
.regw-plan > summary { cursor: pointer; color: var(--ink-2); font-size: .88rem; }
.regw-plan-body { display: grid; gap: 10px; margin: 8px 0 4px; padding: 10px 12px; background: var(--surface-2); border-radius: 8px; }
.regw-res { margin: 0; padding-left: 18px; }
.regw .wreg { margin: 8px 0 0; }
.rg-table { border-collapse: collapse; font-size: .86rem; }
.rg-table th, .rg-table td { border: 1px solid var(--line); padding: 0; text-align: center; vertical-align: middle; }
.rg-table thead th { padding: 6px 6px; font-weight: 600; color: var(--ink-2); white-space: nowrap; background: var(--surface-2); }
.rg-table tbody th { text-align: left; padding: 6px 10px; white-space: nowrap; }
.rg-table .rg-sum { padding: 6px 8px; white-space: nowrap; }
.rg-cell { min-width: 2.6em; padding: 6px 4px; white-space: nowrap; }
.rg-cell.ok { background: color-mix(in srgb, var(--good) 16%, transparent); }
.rg-cell.due { background: color-mix(in srgb, var(--warn) 16%, transparent); color: var(--warn); }
.rg-btn { font: inherit; width: 100%; min-height: 2.2em; border: 0; background: transparent; color: inherit; cursor: pointer; padding: 4px; }
.rg-btn:hover { outline: 2px solid var(--focus); outline-offset: -2px; }
.cls-table td { vertical-align: top; }
.cls-table .cls-code { width: 7.5em; }
.cls-table select { width: auto; min-width: 7em; }
.cls-teachers { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.cls-teachers .chip { display: inline-flex; align-items: center; gap: 2px; padding: 2px 4px 2px 10px; cursor: default; }
.cls-teachers .chip.lead { border-color: var(--brand); font-weight: 600; }
.cls-teachers select { width: auto; padding: 3px 6px; font-size: .84rem; }
.wreg-bar .wreg-code { width: 150px; padding: 4px 8px; font-size: .88rem; }

/* Evaluation page */
.ev-table { width: 100%; border-collapse: collapse; margin: 8px 0 16px; font-size: .92rem; }
.ev-table th, .ev-table td { border-bottom: 1px solid var(--line); padding: 6px; text-align: left; vertical-align: top; }
.ev-table thead th { color: var(--brand); font-weight: 650; }
.ev-table .ev-group th { background: var(--surface-2, #f2f2f2); font-weight: 650; padding-top: 8px; }
.ev-classes { margin: 6px 0 4px; flex-wrap: wrap; }
.ev-for { margin: 10px 0 0; font-size: 1rem; color: var(--brand); }
.ev-table .ev-area { width: 30%; }
.ev-table .ev-rating { width: 260px; }
.ev-table textarea { width: 100%; resize: vertical; }
.seg { display: inline-flex; border: 1px solid var(--line-strong); border-radius: 8px; overflow: hidden; }
.seg-btn { font: inherit; font-size: .84rem; padding: 4px 10px; border: 0; background: var(--surface); color: var(--ink-2); cursor: pointer; }
.seg-btn + .seg-btn { border-left: 1px solid var(--line); }
.seg-btn.on { background: var(--brand); color: #fff; }
@media (max-width: 760px) { .ev-table .ev-rating { width: auto; } }

/* Live preview: the exported program beside the editor */
.btn.on { background: var(--brand-soft); border-color: var(--brand); color: var(--brand); }
/* Sync with Doc: something changed in both places and waits for the teacher. */
.btn.attn { border-color: var(--warn); color: var(--warn); }
.conflict + .conflict { margin-top: 14px; }
.ed-layout.with-preview { grid-template-columns: 170px minmax(0, 1fr) minmax(340px, 44%); max-width: none; gap: 20px; }
.pv { position: sticky; top: var(--topbar-h, 64px); align-self: start; height: calc(100vh - var(--topbar-h, 64px)); display: flex; flex-direction: column; padding: 16px 0 12px; min-width: 0; }
.ed-layout.with-preview.sched-layout { grid-template-columns: minmax(0, 1fr) minmax(340px, 44%); }
.sched-layout > .page { max-width: none; width: 100%; padding-left: 0; padding-right: 0; }
.pv-bar { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; flex-wrap: wrap; }
.pv-zoom { margin-left: auto; display: inline-flex; gap: 4px; }
.pv-scroll { flex: 1; overflow: auto; background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; padding: 8px; }
.pv-pages { color: #000; }
.pv-pages section.docx { background: #fff; box-shadow: 0 1px 4px rgba(0,0,0,.18); margin: 0 auto 10px; font-family: 'Quattrocento Sans', Calibri, Arial, sans-serif; }
.pv-pages .pv-here { animation: pv-here 1.6s ease-out; }
@keyframes pv-here { from { box-shadow: 0 0 0 4px rgba(54,95,145,.55); background-color: rgba(54,95,145,.12); } to { box-shadow: 0 0 0 4px rgba(54,95,145,0); background-color: transparent; } }
@media (max-width: 1180px) { .ed-layout.with-preview { grid-template-columns: minmax(0, 1fr) minmax(300px, 46%); } .ed-layout.with-preview .side { display: none; } }
@media (max-width: 860px) { .ed-layout.with-preview { grid-template-columns: 1fr; } .pv { display: none; } }

/* A week's activities (1.1, 1.2 …): each its own name and box */
.wk-note { margin: 0; }
.activities { gap: 8px; }
.activity { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px 12px; display: grid; gap: 6px; background: var(--surface-2); }
.act-head { display: flex; align-items: center; gap: 8px; }
.act-no { font-weight: 700; color: var(--brand); min-width: 2.2em; }
.act-head .act-title { flex: 1; min-width: 0; font-weight: 600; }
.activities > .btn { justify-self: start; }

/* Scope & Sequence: one block per row */
.sas-weeks { display: grid; gap: 12px; }
.sas-week { border: 1px solid var(--line); border-radius: 10px; padding: 12px; }
.sas-week-head { font-weight: 700; color: var(--brand); margin-bottom: 8px; }
.sas-sug { display: grid; gap: 6px; margin-top: 4px; }
.sas-sug-row { display: grid; grid-template-columns: 150px 1fr; gap: 10px; }
.sas-sug-key { font-size: .82rem; font-weight: 650; color: var(--ink-2); display: flex; flex-direction: column; gap: 3px; align-items: flex-start; }
@media (max-width: 700px) { .sas-sug-row { grid-template-columns: 1fr; } }

/* Tick grid (Visual Arts forms, Viewpoints, Artworld concepts): one row per group. */
.tick-grid .grid-row { display: grid; grid-template-columns: 150px 1fr; gap: 10px; align-items: start; padding: 6px 0; border-top: 1px solid var(--line, #e5e5e5); }
.tick-grid .grid-row:first-of-type { border-top: 0; }
.tick-grid .grid-label { font-weight: 600; font-size: .88rem; padding-top: 5px; }
.ticks.inline { display: flex; flex-wrap: wrap; gap: 2px 6px; margin: 0; }
.ticks.inline .tick { display: inline-grid; }
@media (max-width: 700px) { .tick-grid .grid-row { grid-template-columns: 1fr; gap: 2px; } }
.gate-card div.first-time:not([hidden]), .gate-card div.ht-first:not([hidden]) { display: grid; gap: 10px; }
.gate-card .small { font-size: .82rem; margin-top: 4px; }

/* drop-down menus (Export, More, the user menu) */
.menu { position: relative; }
.menu > summary { list-style: none; cursor: pointer; user-select: none; }
.menu > summary::-webkit-details-marker { display: none; }
.menu > summary::after { content: ''; display: inline-block; width: 0; height: 0; margin-left: 7px; vertical-align: 2px;
  border-left: 4px solid transparent; border-right: 4px solid transparent; border-top: 5px solid currentColor; }
.menu-pop { position: absolute; right: 0; top: calc(100% + 6px); z-index: 50; min-width: 220px; display: grid; padding: 6px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 8px 28px rgba(10, 14, 22, .18); }
.menu-pop a, .menu-pop button { text-align: left; padding: 9px 11px; border-radius: 6px; color: var(--ink); background: none; border: 0;
  font: inherit; font-size: .92rem; cursor: pointer; text-decoration: none; white-space: nowrap; }
.menu-pop a:hover, .menu-pop button:hover, .menu-pop a:focus-visible, .menu-pop button:focus-visible { background: var(--surface-2); outline: none; }
.user-name { max-width: 14em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* page navigation */
.app-nav { display: flex; gap: 2px; margin-right: auto; margin-left: 18px; flex-wrap: wrap; }
.nav-link { padding: 6px 11px; border-radius: 8px; color: var(--ink-2); text-decoration: none; font-size: .93rem; }
.nav-link:hover { background: var(--surface-2); color: var(--ink); }
.nav-link.on { background: var(--brand-soft); color: var(--brand); font-weight: 600; }
.btn.quiet { border-color: transparent; background: none; color: var(--ink-2); }
.btn.quiet:hover { background: var(--surface-2); }
@media (max-width: 760px) { .app-nav { order: 3; width: 100%; margin: 6px 0 0; } .topbar { flex-wrap: wrap; } }

/* staff */
.staff-table { width: 100%; border-collapse: collapse; }
.staff-table th, .staff-table td { text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.staff-table th { font-size: .8rem; color: var(--muted); font-weight: 600; }
.role-key { margin: 4px 0 12px; padding-left: 1.2em; display: grid; gap: 2px; }
.staff-table input[type=text] { min-width: 180px; }
.table-wrap { overflow-x: auto; }
.feedback-list { display: grid; gap: 8px; margin: 8px 0 20px; padding: 0; list-style: none; }
.feedback-list li { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; background: var(--surface); }
.feedback-list li.done { opacity: .55; }
.feedback-list .fb-meta { font-size: .8rem; color: var(--muted); display: flex; gap: 10px; justify-content: space-between; flex-wrap: wrap; }
.feedback-list .fb-text { white-space: pre-wrap; margin: 6px 0 0; }

/* help: tours and guides */
.tour { position: fixed; inset: 0; z-index: 1000; pointer-events: none; }
.tour-block { position: fixed; inset: 0; pointer-events: auto; }
/* A step that asks you to do something leaves the page usable, with a lighter dim. */
.tour.acting .tour-block { display: none; }
.tour.acting .tour-spot { box-shadow: 0 0 0 9999px rgba(10, 14, 22, .32); }
.tour-spot { position: fixed; border-radius: 10px; box-shadow: 0 0 0 9999px rgba(10, 14, 22, .62); outline: 3px solid var(--brand); transition: all .25s ease; pointer-events: none; }
.tour-spot.none { inset: 0; width: 0; height: 0; outline: 0; }
.tour.acting .tour-spot.none { box-shadow: none; }
.tour-card { position: fixed; pointer-events: auto; background: var(--surface); color: var(--ink); border-radius: 14px; padding: 18px 20px; box-shadow: var(--shadow);
  border: 1px solid var(--line); border-top: 4px solid var(--brand); max-width: calc(100vw - 32px); transition: top .2s ease, left .2s ease; }
.tour-card.centre { left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(460px, calc(100vw - 32px)); }
.tour.acting .tour-card.centre { top: auto; bottom: 16px; left: auto; right: 16px; transform: none; width: min(380px, calc(100vw - 32px)); }
.tour-card h2 { margin: 2px 0 6px; font-size: 1.15rem; }
.tour-card p { margin: 0 0 8px; line-height: 1.5; }
.tour-actions { display: flex; justify-content: space-between; align-items: center; margin-top: 10px; gap: 8px; }
.tour-count { margin: 0; }
@media (prefers-reduced-motion: reduce) { .tour-spot, .tour-card { transition: none; } }
.help-btn { padding: 4px 12px; }
.help-btn span { display: inline-grid; place-items: center; width: 18px; height: 18px; border-radius: 50%; background: var(--brand); color: var(--brand-ink); font-size: .75rem; font-weight: 700; }
.help-dlg { width: min(620px, calc(100vw - 32px)); }
.help-panel { display: grid; gap: 10px; }
.help-panel > p { margin: 0; }
.help-tour { display: flex; align-items: center; justify-content: space-between; gap: 14px; background: var(--brand-soft); border-radius: 10px; padding: 12px 14px; }
.help-tour p { margin: 2px 0 0; }
.help-how { margin: 6px 0 0; font-size: 1rem; }
.help-panel input[type=search] { width: 100%; }
.help-guides { display: grid; gap: 12px; }
.help-group h3 { margin: 0 0 4px; font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.help-item { display: flex; gap: 10px; align-items: flex-start; width: 100%; text-align: left; background: none; border: 1px solid transparent; border-radius: 8px; padding: 7px 8px; color: inherit; font: inherit; cursor: pointer; }
.help-item:hover, .help-item:focus-visible { background: var(--surface-2); border-color: var(--line); }
.help-item b { display: block; font-weight: 600; }
.help-item .muted { display: block; }
.help-tick { color: var(--brand); font-weight: 700; min-width: 1em; }
.help-foot { border-top: 1px solid var(--line); padding-top: 10px; }
.welcome p { margin: 0 0 10px; line-height: 1.5; }
.start-card { border: 1px solid var(--line); border-left: 4px solid var(--brand); border-radius: 8px; padding: 10px 14px; margin: 0 0 16px; background: var(--brand-soft); }
.start-head { display: flex; align-items: baseline; gap: 10px; }
.start-head h2 { font-size: 1rem; margin: 0; }
.start-head .link-quiet { margin-left: auto; }
.start-list { list-style: none; margin: 6px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 4px 18px; }
.start-list li.done button { color: var(--muted); text-decoration: line-through; }
.mine { margin: 0 0 16px; }
.mine h2 { font-size: 1rem; margin: 0 0 6px; }
.mine p { margin: 0; }
.mine-list { display: grid; gap: 6px; }
.mine-unit { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; border: 1px solid var(--line); border-radius: 8px; padding: 8px 12px; background: var(--surface); }
.mine-title { font-weight: 600; }
.mine-unit .row-inline { margin-left: auto; }
@media (max-width: 600px) { .help-tour { flex-direction: column; align-items: stretch; } .mine-unit .row-inline { margin-left: 0; } }
/* Learning experiences ticked per activity (Stage 6) */
.act-les { display: inline-flex; gap: 4px; flex-wrap: wrap; margin-left: 4px; }
.act-les .chip-tick span { min-width: 1.6em; text-align: center; }

/* Fill the gaps: what's empty, then each part's suggestions under its own heading. */
.gaps-pick { display: grid; gap: 6px; margin: 4px 0 10px; }
.gap-result { margin-top: 14px; }
.gap-result > h3 { font-size: .95rem; margin: 0 0 6px; color: var(--brand); }

/* Import: each choice's name, with when to pick it underneath. */
.imp-choice { align-items: flex-start; }
.imp-choice > span { display: grid; gap: 2px; }
.imp-when { line-height: 1.35; }
.imp-choice input { margin-top: 3px; flex: none; }

/* Assessment task notifications, under the schedule */
.notice-sec { margin-top: 32px; padding-top: 8px; border-top: 1px solid var(--line); }
.notice-tabs { flex-wrap: wrap; margin: 6px 0 10px; }
.notice-actions { gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.notice-actions .check input { width: auto; margin: 0; }
.code-tag { display: inline-block; font-size: .8rem; padding: 1px 7px; margin: 0 4px 2px 0; border: 1px solid var(--line); border-radius: 999px; color: var(--ink-2); }
.rubric-ed { display: grid; gap: 8px; margin-bottom: 8px; }
.rubric-band { display: grid; grid-template-columns: 76px minmax(0, 1fr) auto; gap: 8px; align-items: start; }
.rubric-band > input.num { text-align: center; }
.rubric-tools { display: inline-flex; gap: 2px; }
.notice-shared { margin: 14px 0 24px; }
.notice-shared > summary { cursor: pointer; color: var(--ink-2); font-size: .9rem; margin-bottom: 8px; }
@media (max-width: 640px) { .rubric-band { grid-template-columns: 1fr; } }
.notice-cols { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.notice-ticks .own-line { margin-left: 6px; }
.notice-ticks .own-line input { flex: 1; min-width: 0; padding: 3px 6px; font-size: .85rem; border-color: transparent; background: transparent; }
.notice-ticks .own-line input:hover, .notice-ticks .own-line input:focus { border-color: var(--line); background: var(--bg); }
@media (max-width: 900px) { .notice-cols { grid-template-columns: 1fr; } }

/* Pickers in the New schedule / New notification dialogs: one line per schedule or task, actions on the right. */
.pick-list { list-style: none; margin: 4px 0 12px; padding: 0; display: grid; gap: 4px; }
.pick-list li { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 6px 8px; border: 1px solid var(--line); border-radius: var(--radius); }
.pick-list li > span:first-child { min-width: 0; }
.pick-group .lbl { margin-top: 8px; }

/* Sign-off (each class's registration and evaluation sign-offs, in the Evaluation section) */
.signoffs { margin-top: 20px; }
.so-table { width: 100%; border-collapse: collapse; margin: 8px 0 4px; font-size: .92rem; }
.so-table th, .so-table td { border-bottom: 1px solid var(--line); padding: 6px; text-align: left; vertical-align: middle; }
.so-table .so-part th { background: var(--surface-2, #f2f2f2); color: var(--brand); font-weight: 650; padding-top: 8px; }
.so-table .so-who { width: 34%; }
.so-table .so-sig { width: 30%; }
.so-table .so-date { width: 170px; }
.so-table .so-act { text-align: right; white-space: nowrap; }
.sig-img { display: block; max-height: 46px; max-width: 220px; }
/* A signature is dark ink on a transparent background: give it white paper in dark mode too. */
.sig-img, .sig-preview img { background: #fff; border-radius: 4px; padding: 2px 4px; }
.sig-preview { min-height: 72px; display: flex; align-items: center; justify-content: center; border: 1px dashed var(--line); border-radius: 8px; margin: 10px 0; padding: 8px; }
.sig-preview img { max-height: 90px; max-width: 100%; }
.sig-ways { display: grid; grid-template-columns: 1fr; gap: 14px; }
.sig-ways h3 { font-size: .95rem; margin: 0 0 4px; }
.sig-pad { display: block; width: 100%; max-width: 600px; aspect-ratio: 600 / 180; background: #fff; border: 1px solid var(--line); border-radius: 8px; touch-action: none; cursor: crosshair; margin-bottom: 6px; }
.yc-sum { text-align: left; font-size: .85rem; }
.yc-grid { border-collapse: collapse; width: 100%; }
.yc-grid th, .yc-grid td { padding: 6px 8px; border-bottom: 1px solid var(--line); text-align: center; }
.yc-grid tbody th { text-align: left; font-weight: 500; white-space: nowrap; }
.waiting { border: 1px solid var(--line); border-left: 4px solid var(--brand); border-radius: 8px; padding: 10px 14px; margin: 0 0 16px; }
.waiting h2 { font-size: 1rem; margin: 0 0 6px; }
.waiting ul { margin: 0; padding-left: 18px; }
.waiting li { margin: 2px 0; }
.staff-table .btn { white-space: nowrap; }

/* School terms: the term's dates and weeks under Term and above the teaching sequence, and the Staff page's dates. */
.term-fit { margin: 0; }
.term-fit .term-warn { color: var(--warn); display: block; }
.taught-by { display: flex; flex-wrap: wrap; gap: .25rem 1.25rem; padding: .35rem 0; }
.taught-by-cls b { font-weight: 600; }
.terms-table input[type=date] { width: 9.5rem; }
.terms-table td { white-space: nowrap; }
/* Narrower screens: each year's terms stack, labelled, instead of scrolling sideways (audit 13 Oct 2026). */
@media (max-width: 1000px) {
  .terms-table thead { display: none; }
  .terms-table tr, .terms-table td { display: block; }
  .terms-table tr { padding: 8px 0; border-bottom: 1px solid var(--line); }
  .terms-table td { border: 0; padding: 4px 0; }
  .terms-table td:first-child { font-weight: 650; }
  .terms-table td[data-term]::before { content: attr(data-term) ": "; display: inline-block; min-width: 4.5em; color: var(--muted); font-size: .88rem; }
}
.lessons-set input.num-input { width: 4.5rem; }
.lessons-set td { white-space: nowrap; }
.lessons-set { margin-top: 1rem; }
/* Import: feedback on the draft, under the preview. */
.imp-revise { margin-top: 1rem; padding-top: .75rem; border-top: 1px solid var(--line, #ddd); }
/* Sections and rows scrolled to sit below the top bar and the class strip. */
.editor > .sec, .editor .week, .editor .regw { scroll-margin-top: calc(var(--topbar-h, 57px) + 60px); }
.reg .reg-link { display: block; margin-top: 3px; width: 100%; font-size: .8rem; padding: 3px 5px; }
.reg .yc-ok { color: var(--good); font-weight: 700; }
.reg input[type=checkbox]:disabled { opacity: 1; cursor: help; }
/* The use badge as its own control (editor top bar, schedule and notification pages). */
.use-btn { display: inline-flex; align-items: center; padding: 2px 0; border-radius: 999px; }
.use-btn:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.use-pick .menu-pop { right: auto; left: 0; min-width: 240px; }
.topbar .use-pick .menu-pop { left: auto; right: 0; }
.menu-pop .menu-note { margin: 2px 11px 4px; }
.page-jump { display: flex; flex-wrap: wrap; gap: 4px 14px; margin: -4px 0 14px; font-size: .92rem; }
#setup-staff, #setup-classes, #setup-terms, #setup-lessons, #setup-feedback { scroll-margin-top: 76px; }
.due-box { width: 100%; min-width: 0; resize: none; overflow: hidden; line-height: 1.35; font: inherit; }
/* The formatting buttons show on the box being worked in (or pointed at); ✦ Suggest always shows (UI audit, 13 Oct 2026). */
.fmt-bar .fmt { transition: opacity .12s; }
:has(> .fmt-bar):not(:focus-within):not(:hover) > .fmt-bar .fmt:not(.fmt-ai) { opacity: 0; pointer-events: none; }
/* The pane is hidden at this width (.pv above), so its button goes too. */
@media (max-width: 860px) { .preview-btn { display: none; } }
/* Resource tags: worked out from the link, as the export prints them (resourceTag()). */
.res-tag { flex: none; min-width: 64px; text-align: center; font: 700 10px/1 system-ui, sans-serif; letter-spacing: .03em; color: #fff; padding: 4px 6px; border-radius: 3px; }
.res-tag.none { background: transparent; }
.regw-res.tagged { list-style: none; padding-left: 0; }
.regw-res.tagged li { display: flex; gap: 6px; align-items: baseline; margin-bottom: 3px; }
.regw-res.tagged .res-tag { min-width: 0; font-size: 9px; padding: 2px 4px; }
.row-inline.res-row { flex-wrap: nowrap; }
.row-inline.res-row input { min-width: 0; }
.row-inline.res-row input[type=text] { flex: 1 1 40%; }

/* school reports (lib/reports.php): on a schedule, and the Reports page */
.reports-sec { margin-top: 28px; }
.report-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 16px; }
.report-card { border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; background: var(--surface); min-width: 0; }
.report-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; flex-wrap: wrap; margin-bottom: 6px; }
.report-head h4 { margin: 0; font-size: 1rem; }
.report-outs { margin: 4px 0 8px; padding-left: 1.4em; }
.report-outs li { margin-bottom: 8px; }
.report-out { display: flex; gap: 6px; align-items: flex-start; }
.report-out textarea { flex: 1; resize: none; overflow: hidden; }
.report-outs .week-tags { margin-top: 4px; }
.rep-filters { margin-bottom: 18px; }
.rep-course { border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; margin-bottom: 14px; background: var(--surface); }
.rep-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; }
.rep-head h2 { margin: 0; font-size: 1.05rem; }
.rep-actions { margin-left: auto; display: inline-flex; gap: 6px; }
.rep-table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.rep-table td { border: 1px solid var(--line); padding: 6px 8px; vertical-align: top; }
.rep-desc { width: 45%; }
.rep-no { width: 2.2em; text-align: center; color: var(--muted); }
.rep-changed { background: #fff6a8; }
@media (prefers-color-scheme: dark) { .rep-changed { background: #4a4413; } }
