/* ────────────────────────────────────────────────────────────
   School Atlas — design system (v2)
   White workspace · black typography · red accents
   accent · editorial serif display · Unpoly drawer sheets

   Direction: the Fizzy/Hey family — a white canvas, a white
   ink top bar, squared controls with offset "sticker" shadows,
   and right-side sheets for focused entry work.
   ──────────────────────────────────────────────────────────── */

:root {
  /* White-first surfaces */
  --paper: #ffffff;
  --paper-2: #fffafa;
  --card: #ffffff;
  --card-2: #fffafa;

  /* Neutral black typography */
  --ink: #171717;
  --ink-2: #333333;
  --muted: #606060;
  --faint: #767676;

  /* lines — hard, ink-tinted */
  --line: #e5dada;
  --line-strong: #b8a5a5;

  /* Red scale */
  --accent: #c92520;
  --accent-strong: #a31d18;
  --accent-wash: #fff7f6;
  --accent-soft: #f5b8b2;

  /* State labels retain meaning within the red palette */
  --live: #a61b16;
  --live-wash: #fff7f6;
  --draft: #7f1d1d;
  --draft-wash: #fff7f7;
  --review: #b91c1c;
  --review-wash: #fbe6e3;

  /* White navigation with black labels */
  --nav: #ffffff;
  --nav-2: #fff7f6;
  --nav-line: rgba(0, 0, 0, .12);
  --nav-text: #4b4b4b;
  --nav-text-strong: #171717;

  /* elevation */
  --shadow-sm: 2px 2px 0 rgba(0, 0, 0, .1);
  --shadow: 4px 4px 0 rgba(0, 0, 0, .14);
  --shadow-lg: 8px 8px 0 rgba(0, 0, 0, .16);
  --focus: 0 0 0 3px rgba(198, 40, 40, .24);

  --radius: 8px;
  --radius-lg: 12px;

  --font-ui: "Segoe UI", -apple-system, BlinkMacSystemFont, Roboto, "Helvetica Neue", Arial, sans-serif;
  font-family: var(--font-ui);
  font-size: 15px;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

* { box-sizing: border-box; }
html { background: var(--paper); }
body { margin: 0; min-width: 320px; background: var(--paper); }
a { color: inherit; }
button, input, textarea, select { font: inherit; }
::selection { background: var(--accent-soft); }

/* Consistent Vietnamese-capable typography throughout the interface. */
.brand-name, .page-intro h1, .panel-heading h2, .section-heading h2,
.stat-item strong, .empty-state h2, .lesson-hero h2, .sheet-title,
.access-page h1, .year-choice strong, .cell-title, .unit-label strong {
  font-family: var(--font-ui);
}

/* ── Unpoly runtime chrome ─────────────────────────────── */

up-progress-bar {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 999999;
  height: 3px;
  background-color: var(--accent);
}

@keyframes move-from-right { from { transform: translateX(100%); } to { transform: translateX(0); } }
@keyframes move-to-right { from { transform: translateX(0); } to { transform: translateX(100%); } }
@keyframes move-from-left { from { transform: translateX(-100%); } to { transform: translateX(0); } }
@keyframes move-to-left { from { transform: translateX(0); } to { transform: translateX(-100%); } }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes fade-out { from { opacity: 1; } to { opacity: 0; } }

/* ── Sheet (Unpoly drawer) ─────────────────────────────── */

.account-menu { position: relative; }
.account-menu summary { cursor: pointer; list-style: none; }
.account-menu summary::-webkit-details-marker { display: none; }
.account-menu summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
.account-dropdown { position: absolute; right: 0; top: calc(100% + 12px); z-index: 100; width: 240px; max-width: calc(100vw - 32px); background: var(--paper); color: var(--ink); border: 2px solid var(--ink); box-shadow: var(--shadow-lg); padding: 8px; }
.account-dropdown a, .account-dropdown button { display: block; width: 100%; padding: 12px; text-align: left; color: inherit; background: none; border: 0; font: inherit; text-decoration: none; cursor: pointer; }
.account-dropdown a:hover, .account-dropdown button:hover { background: var(--card); }
.account-dropdown form { margin: 0; }
up-modal { z-index: 2000; position: fixed; inset: 0; }
up-modal-backdrop { position: absolute; inset: 0; background: rgba(0, 0, 0, .5); }
up-modal-viewport { position: absolute; inset: 0; display: flex; align-items: flex-start; justify-content: center; padding: min(12vh, 100px) 16px 24px; overflow-y: auto; overscroll-behavior: contain; }
up-modal-box { position: relative; display: block; width: 520px; max-width: 100%; background: var(--paper); border: 2px solid var(--ink); box-shadow: var(--shadow-lg); }
up-modal-content { display: block; }
up-modal-dismiss { display: none; }
up-drawer { z-index: 2000; position: fixed; inset: 0; }
up-drawer-backdrop { position: absolute; inset: 0; background: rgba(0, 0, 0, .5); }
up-drawer-viewport {
  position: absolute; inset: 0;
  display: flex; justify-content: flex-end;
  overflow: hidden;
}
up-drawer[position=right] up-drawer-viewport { justify-content: flex-end; }
up-drawer[position=left] up-drawer-viewport { justify-content: flex-start; }

up-drawer-box {
  position: relative;
  width: min(700px, 100%);
  min-height: 100vh;
  max-width: 100%;
  padding: 0;
  background: var(--paper);
  border-left: 2px solid var(--ink);
  box-shadow: var(--shadow-lg);
  overflow-y: auto;
  overscroll-behavior: contain;
}
up-drawer[nesting="1"] up-drawer-box { width: min(600px, 96%); border-left-color: var(--accent); }
up-drawer[nesting="2"] up-drawer-box { width: min(540px, 96%); }

up-drawer-dismiss {
  position: absolute; top: 18px; right: 20px; z-index: 5;
  display: grid; place-items: center;
  width: 34px; height: 34px;
  color: var(--ink); background: var(--card);
  border: 2px solid var(--ink);
  border-radius: var(--radius);
  font-size: 15px; line-height: 1;
  cursor: pointer;
  box-shadow: 2px 2px 0 rgba(0, 0, 0, .12);
}
up-drawer-dismiss:hover { background: var(--accent); color: #fff; }

/* Sheet document (server-rendered body inside the drawer) */

.sheet { display: grid; grid-template-rows: auto minmax(0, 1fr); }
up-modal-viewport:has(.sheet), up-modal-viewport:has(#main.workspace) { align-items: safe center; padding: 24px 16px; }
up-modal-box:has(.sheet) { width: min(900px, 100%); }
up-modal-box:has(#main.workspace) { width: min(1200px, 100%); }
body > .sheet { width: min(900px, calc(100% - 32px)); margin: 24px auto; border: 2px solid var(--ink); box-shadow: var(--shadow-lg); }

.sheet-head {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: flex-start; justify-content: space-between; gap: 20px;
  padding: 26px 32px 20px;
  background: var(--card);
  border-bottom: 2px solid var(--ink);
}
.sheet-head-copy { min-width: 0; padding-right: 44px; }
.sheet-title {
  margin: 8px 0 0;
  font-size: 26px; font-weight: 700; letter-spacing: -.02em; line-height: 1.1;
  color: var(--ink);
}
.sheet-sub { margin: 8px 0 0; color: var(--muted); font-size: 13.5px; line-height: 1.5; }
.sheet-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; justify-content: flex-end; }

.sheet-main { display: grid; align-content: start; gap: 26px; padding: 24px 32px 96px; min-width: 0; }
.sheet-main .page-feedback { margin: 0 0 2px; }
.sheet-main .panel-heading { margin-bottom: 14px; }
.sheet-main form { max-width: none; }

/* ── Shell: top nav ────────────────────────────────────── */

.app-shell { min-height: 100vh; }

.topbar {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: stretch; gap: 8px;
  height: 58px;
  padding: 0 20px;
  background: var(--nav);
  border-bottom: 2px solid #000;
}

.brand {
  display: flex; align-items: center; gap: 11px;
  padding: 0 10px 0 4px;
  text-decoration: none;
  color: var(--nav-text-strong);
}
.brand-mark {
  display: grid; place-items: center;
  width: 30px; height: 30px;
  background: var(--accent);
  color: #fff;
  border: 2px solid #000;
  border-radius: var(--radius);
  box-shadow: 2px 2px 0 rgba(0, 0, 0, .45);
  font-size: 13px; font-weight: 800; letter-spacing: -.02em;
}
.brand-name { font-size: 17px; font-weight: 700; letter-spacing: -.02em; }
.brand-sub { display: block; color: var(--nav-text); font-size: 9px; font-weight: 700; letter-spacing: .18em; text-transform: uppercase; margin-top: -2px; }

.top-nav {
  display: flex; align-items: stretch; gap: 2px;
  margin-left: 14px;
  min-width: 0; flex: 1 1 auto;
  overflow-x: auto;
  scrollbar-width: none;
}
.top-nav::-webkit-scrollbar { display: none; }

.top-link {
  position: relative;
  display: flex; align-items: center;
  padding: 0 14px;
  color: var(--nav-text);
  font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
  text-decoration: none;
  white-space: nowrap;
  transition: color .14s ease, background .14s ease;
}
.top-link svg { margin-right: 7px; opacity: .8; }
.top-link:hover { color: var(--nav-text-strong); background: var(--nav-2); }
.top-link.active { color: var(--nav-text-strong); background: var(--nav-2); }
.top-link.active::after {
  content: ""; position: absolute; left: 10px; right: 10px; bottom: 0; height: 3px;
  background: var(--accent);
}

.topbar-right { display: flex; align-items: center; gap: 10px; margin-left: auto; flex-shrink: 0; }

.context-pill {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 7px 12px;
  color: var(--nav-text-strong);
  background: var(--nav-2);
  border: 1px solid var(--nav-line);
  border-radius: var(--radius);
  font-size: 12px; font-weight: 650;
  text-decoration: none;
  white-space: nowrap;
}
.context-pill:hover { border-color: var(--accent); }
.context-dialog { padding: 24px; max-width: 520px; margin: auto; }
.context-dialog label { display: grid; gap: 8px; }
.context-dialog input[type="search"] { width: 100%; min-height: 44px; }
.context-results { margin-top: 16px; max-height: 50vh; overflow-y: auto; }
.context-choice { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 12px; border-bottom: 1px solid var(--line); color: var(--ink); text-decoration: none; }
.context-choice > div { display: grid; gap: 4px; }
.context-choice[aria-current], .context-choice:hover { background: var(--accent-wash); }
.context-choice:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.context-choice > span { font-size: 12px; }
.settings-nav { display: flex; flex-wrap: wrap; gap: 4px 16px; border-bottom: 1px solid var(--line); margin-bottom: 28px; }
.settings-nav-link { padding: 10px 0; color: var(--muted); text-decoration: none; border-bottom: 3px solid transparent; font-size: 14px; font-weight: 650; }
.settings-nav-link:hover { color: var(--ink); }
.settings-nav-link[aria-current="page"] { color: var(--accent); border-color: var(--accent); }
.settings-nav-link:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.context-pill .pill-kicker { color: var(--nav-text); font-size: 9.5px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }

.user-chip { display: inline-flex; align-items: center; gap: 9px; padding-left: 4px; color: var(--nav-text); font-size: 12.5px; font-weight: 600; }
.user-chip strong { color: var(--nav-text-strong); font-weight: 700; }

.avatar {
  display: grid; place-items: center;
  width: 30px; height: 30px;
  background: var(--accent-wash); color: var(--accent-strong);
  border: 1.5px solid var(--line-strong);
  border-radius: var(--radius);
  font-size: 11px; font-weight: 800;
}

/* ── Context strip ─────────────────────────────────────── */

.context-strip {
  display: flex; align-items: center; justify-content: space-between; gap: 20px;
  padding: 9px 32px;
  background: var(--paper-2);
  border-bottom: 1px solid var(--line-strong);
}
.context-path { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; color: var(--muted); font-size: 12.5px; }
.context-path strong { color: var(--ink); font-weight: 750; }
.context-separator { color: var(--faint); }
.context-switch { display: flex; align-items: center; gap: 14px; color: var(--muted); font-size: 11.5px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
.context-switch-link { color: var(--accent); text-decoration: none; }
.context-switch-link:hover { color: var(--accent-strong); text-decoration: underline; text-underline-offset: 3px; }

/* ── Workspace & page ──────────────────────────────────── */

.workspace { min-width: 0; }

.page-content { max-width: 1340px; margin: 0 auto; padding: 34px 40px 110px; animation: page-rise .28s cubic-bezier(.22, .61, .36, 1) both; }

@keyframes page-rise {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  color: var(--accent); font-size: 10.5px; font-weight: 800; letter-spacing: .16em; text-transform: uppercase;
}
.eyebrow::before { content: ""; width: 16px; height: 3px; background: var(--accent); }

.page-intro { display: flex; align-items: flex-end; justify-content: space-between; gap: 32px; margin-bottom: 30px; }
.page-intro h1 {
  max-width: 780px; margin: 12px 0 0;
  font-size: clamp(30px, 3.2vw, 42px);
  font-weight: 700; letter-spacing: -.025em; line-height: 1.05;
  color: var(--ink);
}
.intro-actions { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 10px; padding-bottom: 4px; }
.intro-actions form { display: inline-flex; max-width: none; padding: 0; }
.row-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; }

.page-feedback { min-height: 0; margin: -12px 0 22px; }
.page-content-lower { display: grid; gap: 40px; }
.page-content-lower > * { min-width: 0; }

/* ── Links & buttons (squared, hard-edged) ─────────────── */

.text-link, .quiet-link { color: var(--accent); text-decoration: none; }
.text-link:hover, .quiet-link:hover { color: var(--accent-strong); text-decoration: underline; text-underline-offset: 3px; }
.quiet-link { font-size: 13px; font-weight: 750; }

.primary-link, .secondary-link, .table-action {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 12.5px; font-weight: 750; text-decoration: none; white-space: nowrap;
  transition: background .14s ease, border-color .14s ease, color .14s ease, transform .12s ease, box-shadow .12s ease;
}

.primary-link {
  padding: 10px 16px;
  color: #fff; background: var(--accent);
  border: 2px solid var(--ink); border-radius: var(--radius);
  box-shadow: 3px 3px 0 rgba(0, 0, 0, .22);
}
.primary-link:hover { background: var(--accent-strong); box-shadow: 1px 1px 0 rgba(0, 0, 0, .22); transform: translate(2px, 2px); }

.secondary-link {
  padding: 9px 14px;
  color: var(--ink); background: var(--card);
  border: 2px solid var(--ink); border-radius: var(--radius);
  box-shadow: 3px 3px 0 rgba(0, 0, 0, .18);
}
.secondary-link:hover { background: var(--ink); color: var(--card); box-shadow: 1px 1px 0 rgba(0, 0, 0, .18); transform: translate(2px, 2px); }

.table-action { color: var(--accent); font-size: 12.5px; font-weight: 750; }
.table-action:hover { color: var(--accent-strong); text-decoration: underline; text-underline-offset: 3px; }

.primary-button, .secondary-button, .quiet-button {
  display: inline-flex; align-items: center; justify-content: center;
  width: fit-content; padding: 10px 15px;
  border-radius: var(--radius); font-size: 12.5px; font-weight: 750;
  transition: background .14s ease, border-color .14s ease, color .14s ease, transform .12s ease, box-shadow .12s ease;
}
.primary-button {
  color: #fff; background: var(--accent);
  border: 2px solid var(--ink);
  box-shadow: 3px 3px 0 rgba(0, 0, 0, .22);
}
.primary-button:hover { background: var(--accent-strong); box-shadow: 1px 1px 0 rgba(0, 0, 0, .22); transform: translate(2px, 2px); }
.secondary-button {
  color: var(--ink); background: var(--card);
  border: 2px solid var(--ink);
  box-shadow: 3px 3px 0 rgba(0, 0, 0, .18);
}
.secondary-button:hover { background: var(--ink); color: var(--card); box-shadow: 1px 1px 0 rgba(0, 0, 0, .18); transform: translate(2px, 2px); }
.quiet-button { padding: 6px 2px; color: var(--accent); background: transparent; border: 0; font-size: 12.5px; }
.quiet-button:hover, .move-action:hover { color: var(--accent-strong); text-decoration: underline; text-underline-offset: 3px; }
.button-row { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; }
.button-row form { max-width: none; }

/* ── Panels & headings ─────────────────────────────────── */

.panel { min-width: 0; }
.panel-heading {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 24px;
  padding: 0 0 14px; margin-bottom: 18px;
  border-bottom: 2px solid var(--ink);
}
.panel-heading h2 { margin: 0; font-size: 19px; font-weight: 700; letter-spacing: -.01em; color: var(--ink); }
.panel-heading p { max-width: 640px; margin: 6px 0 0; color: var(--muted); font-size: 13px; line-height: 1.55; }
.panel-heading > a, .panel-heading > .quiet-link { align-self: center; }

.section-heading {
  display: flex; align-items: baseline; justify-content: space-between; gap: 20px;
  padding-bottom: 12px; margin-bottom: 16px;
  border-bottom: 2px solid var(--ink);
}
.section-heading h2 { margin: 0; font-size: 19px; font-weight: 700; letter-spacing: -.01em; }
.section-heading a { color: var(--accent); font-size: 12.5px; font-weight: 750; text-decoration: none; }
.section-heading a:hover { color: var(--accent-strong); text-decoration: underline; text-underline-offset: 3px; }

.section-copy { max-width: 680px; margin: 12px 0 0; color: var(--muted); font-size: 13.5px; line-height: 1.6; }

/* ── Stat strips ───────────────────────────────────────── */

.stat-strip {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  margin: 0 0 38px;
  background: var(--card);
  border: 2px solid var(--ink);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.stat-item { display: grid; gap: 5px; min-width: 0; padding: 18px 22px; background: var(--card); }
.stat-item + .stat-item { border-left: 2px solid var(--ink); }
.stat-item span {
  overflow: hidden; color: var(--muted); font-size: 10px; font-weight: 800;
  letter-spacing: .12em; text-overflow: ellipsis; text-transform: uppercase; white-space: nowrap;
}
.stat-item strong { overflow: hidden; font-size: 30px; font-weight: 700; letter-spacing: -.03em; color: var(--ink); text-overflow: ellipsis; white-space: nowrap; }
.stat-item em { overflow: hidden; color: var(--accent); font-size: 12px; font-style: normal; font-weight: 750; text-overflow: ellipsis; white-space: nowrap; }

/* ── Tables ────────────────────────────────────────────── */

.table-wrap {
  overflow-x: auto;
  background: var(--card);
  border: 2px solid var(--ink);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}
.table-wrap table { width: 100%; min-width: 640px; border-collapse: collapse; }
.table-wrap th {
  padding: 12px 16px; color: var(--muted);
  font-size: 10px; font-weight: 800; letter-spacing: .12em;
  text-align: left; text-transform: uppercase; white-space: nowrap;
  border-bottom: 2px solid var(--ink);
  background: var(--paper-2);
}
.table-wrap td {
  padding: 14px 16px; color: var(--ink-2); font-size: 13.5px; line-height: 1.45;
  vertical-align: top;
  border-top: 1px solid var(--line);
  transition: background .12s ease;
}
.table-wrap tbody tr:first-child td { border-top: 0; }
.table-wrap tbody tr:hover td { background: var(--accent-wash); }
.table-wrap th:first-child, .table-wrap td:first-child { padding-left: 18px; }
.table-wrap th:last-child, .table-wrap td:last-child { padding-right: 18px; }
.table-wrap td > span:not(.status-chip), .table-primary { display: grid; gap: 3px; }
.table-wrap td strong { color: var(--ink); font-weight: 750; }
.table-wrap td small, .table-primary span, .table-wrap td > span > span { color: var(--muted); font-size: 12.5px; }
.table-primary { color: var(--ink); text-decoration: none; }
.table-primary:hover strong { color: var(--accent-strong); }
.table-action { display: inline-block; margin-right: 14px; }
.table-wrap td form, .objective-row form { display: inline-flex; max-width: none; padding: 0; margin: 0; }
.home-grid > .panel .table-wrap table { min-width: 0; }

/* ── Status tags (squared) ─────────────────────────────── */

.status-chip {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 4px 9px;
  border: 1.5px solid currentColor;
  border-radius: var(--radius);
  font-size: 10px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; white-space: nowrap;
}
.status-chip::before { content: ""; width: 5px; height: 5px; background: currentColor; }
.status-live { color: var(--live); background: var(--live-wash); border-color: var(--live); }
.status-draft { color: var(--draft); background: var(--draft-wash); border-color: var(--draft); }
.status-neutral { color: var(--muted); background: var(--card-2); border-color: var(--line-strong); }

/* ── Forms ─────────────────────────────────────────────── */

form { display: grid; gap: 20px; max-width: 680px; padding-top: 8px; }
form > input[type="hidden"] { display: none; }
form label { display: grid; gap: 7px; }
.field-label { display: block; color: var(--muted); font-size: 10.5px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
form .field-label, .access-form label > span { margin-bottom: 0; }

.field-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; align-items: end; }
.field-row > * { min-width: 0; }
.attendance-current { display: grid; gap: 6px; min-width: 230px; }
.attendance-current .status-chip { justify-self: start; }
.attendance-current small { display: block; line-height: 1.45; }
.table-wrap td.attendance-update { min-width: 560px; }
.table-wrap td.attendance-update > form {
  display: grid;
  grid-template-columns: 140px 120px minmax(190px, 1fr) auto;
  align-items: end;
  gap: 10px;
  width: 100%;
  max-width: none;
  padding: 0;
  margin: 0;
}
.attendance-update .field-label { font-size: 9px; }
.attendance-update input,
.attendance-update select { min-height: 38px; padding: 7px 9px; }
.attendance-update button { min-height: 38px; white-space: nowrap; }
.assessment-result-list { display: grid; gap: 18px; margin-top: 24px; }
.assessment-result-card {
  display: grid; grid-template-columns: minmax(220px, .7fr) minmax(0, 1.3fr);
  gap: 26px; padding: 20px; background: var(--paper-2);
  border: 2px solid var(--ink); border-radius: var(--radius);
}
.assessment-result-card h3 { margin: 7px 0 5px; font-size: 20px; }
.assessment-result-card p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.5; }
.assessment-result-card form { width: 100%; max-width: none; padding: 0; }

input:not([type="hidden"]), select, textarea {
  width: 100%; min-width: 0; padding: 10px 12px;
  color: var(--ink); background: var(--card);
  border: 2px solid var(--ink); border-radius: var(--radius);
  outline: none;
  transition: border-color .14s ease, box-shadow .14s ease;
}
input:not([type="hidden"]):hover, select:hover, textarea:hover { border-color: var(--line-strong); }
input:not([type="hidden"]):focus, select:focus, textarea:focus {
  border-color: var(--accent); box-shadow: var(--focus);
}
textarea { min-height: 110px; resize: vertical; line-height: 1.55; }
button { cursor: pointer; }

.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 36px; align-items: start; }

/* ── Notices & empty states ────────────────────────────── */

.notice {
  display: flex; align-items: center; gap: 10px; width: fit-content; max-width: 100%;
  padding: 10px 14px;
  color: var(--ink); background: var(--card);
  border: 2px solid var(--ink); border-radius: var(--radius);
  box-shadow: 3px 3px 0 rgba(0, 0, 0, .14);
  font-size: 13px;
}
.notice-dot { width: 8px; height: 8px; flex: 0 0 auto; background: var(--accent); }

.empty-state { padding: 30px 0 10px; }
.empty-state h2 { margin: 0; font-size: 20px; font-weight: 700; letter-spacing: -.01em; }
.empty-state p { max-width: 540px; margin: 9px 0 18px; color: var(--muted); font-size: 13.5px; line-height: 1.6; }

.warning-panel {
  padding: 18px 20px; background: var(--review-wash);
  border: 2px solid var(--review); border-left-width: 4px;
  border-radius: var(--radius);
}
.warning-panel h3 { margin: 0 0 10px; font-size: 15px; color: var(--review); font-family: var(--font-ui); }
.warning-panel ul { display: grid; gap: 8px; margin: 0; padding-left: 18px; color: var(--ink-2); font-size: 13.5px; }

/* ── Home ──────────────────────────────────────────────── */

.home-grid { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(300px, .6fr); gap: 40px; align-items: start; }

/* ── Planning: years & matrix ──────────────────────────── */

.year-row { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 0 0 18px; margin-bottom: 12px; }
.year-row h2 { margin: 0 0 6px; font-size: 19px; letter-spacing: -.01em; font-family: var(--font-ui); }
.year-row p { margin: 0; color: var(--muted); font-size: 13px; }

.year-picker { display: grid; gap: 10px; }
.year-choice {
  display: flex; align-items: center; justify-content: space-between; gap: 18px;
  padding: 14px 16px;
  color: var(--ink); text-decoration: none;
  border: 2px solid var(--ink); border-radius: var(--radius);
  background: var(--card);
  box-shadow: 3px 3px 0 rgba(0, 0, 0, .1);
  transition: border-color .12s ease, box-shadow .12s ease, background .12s ease, transform .12s ease;
}
.year-choice span:not(.status-chip) { color: var(--muted); font-size: 13px; }
.year-choice strong { display: block; margin-bottom: 2px; font-size: 15px; }
.year-choice:hover { box-shadow: 1px 1px 0 rgba(0, 0, 0, .1); transform: translate(2px, 2px); }
.year-choice:hover strong { color: var(--accent-strong); }
.year-choice.active { background: var(--accent-wash); border-color: var(--accent); }

.plan-note { display: flex; align-items: center; gap: 9px; margin: 4px 0 18px; color: var(--muted); font-size: 12.5px; }
.plan-note .icon { color: var(--accent); font-weight: 800; }

.matrix-wrap { min-width: 0; overflow-x: auto; background: var(--card); border: 2px solid var(--ink); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.matrix { width: 100%; min-width: 920px; border-collapse: collapse; table-layout: fixed; }
.matrix th {
  padding: 13px 16px; color: var(--muted);
  font-size: 10px; font-weight: 800; letter-spacing: .12em;
  text-align: left; text-transform: uppercase;
  border-bottom: 2px solid var(--ink);
  background: var(--paper-2);
}
.matrix th:first-child { width: 118px; }
.matrix td { height: 148px; padding: 0; vertical-align: top; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.matrix td:last-child, .matrix th:last-child { border-right: 0; }
.matrix tbody tr:last-child td { border-bottom: 0; }

.week-label { display: grid; align-content: start; gap: 4px; height: 100%; padding: 16px 14px; background: var(--paper-2); }
.week-label strong { font-size: 13px; color: var(--ink); }
.week-label span { color: var(--muted); font-size: 11.5px; }

.matrix tr.unit-row td { height: auto; padding: 0; background: var(--paper); border-bottom: 2px solid var(--ink); }
.unit-label { display: flex; align-items: baseline; gap: 12px; padding: 10px 16px; }
.unit-label strong { font-size: 11px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: var(--accent-strong); }
.unit-label span { color: var(--muted); font-size: 11.5px; }

.matrix-cell {
  display: block; height: 100%; padding: 14px 14px;
  text-decoration: none;
  transition: background .14s ease, box-shadow .14s ease;
}
.matrix-cell:hover { background: var(--card-2); }
.matrix-cell-filled:hover { box-shadow: inset 4px 0 0 var(--accent); background: var(--accent-wash); }
.cell-kicker { display: block; margin-bottom: 8px; color: var(--accent); font-size: 9.5px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; }
.cell-title { display: block; margin-bottom: 7px; font-size: 14.5px; font-weight: 700; letter-spacing: -.01em; line-height: 1.18; color: var(--ink); }
.cell-summary { display: block; color: var(--muted); font-size: 12px; line-height: 1.45; }
.cell-meta { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 11px; }
.cell-meta span { padding: 2px 7px; color: var(--accent-strong); background: var(--accent-wash); border: 1px solid var(--accent-soft); border-radius: var(--radius); font-size: 9.5px; font-weight: 800; letter-spacing: .03em; }
.matrix-empty {
  display: flex; align-items: center; justify-content: center; gap: 7px;
  height: 100%; min-height: 148px;
  color: var(--faint); font-size: 12px; font-weight: 700;
  background: repeating-linear-gradient(-45deg, transparent, transparent 9px, rgba(0, 0, 0, .025) 9px, rgba(0, 0, 0, .025) 18px);
}
.matrix-empty strong { color: var(--accent); font-size: 18px; font-weight: 700; }
.matrix-empty:hover { background: var(--accent-wash); color: var(--accent-strong); }

/* ── Entry sheet & objectives ──────────────────────────── */

.sheet-copy-input { width: 100%; min-height: 84px; padding: 10px 12px; color: var(--ink-2); background: var(--card); border: 2px solid var(--ink); border-radius: var(--radius); resize: vertical; font-size: 14px; line-height: 1.55; }
.sheet-copy-input:focus { border-color: var(--accent); box-shadow: var(--focus); outline: none; }

.objective-group { display: grid; gap: 10px; margin-top: 18px; }
.objective-group-label { color: var(--muted); font-size: 10.5px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; }
.objective-row {
  display: grid; grid-template-columns: 64px minmax(0, 1fr) auto; align-items: center; gap: 12px;
  padding: 12px 14px;
  background: var(--card); border: 2px solid var(--ink); border-left-width: 4px;
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}
.objective-row.supporting { border-left-color: var(--draft); background: var(--draft-wash); }
.objective-code { color: var(--accent); font-size: 11px; font-weight: 850; letter-spacing: .02em; }
.objective-row.supporting .objective-code { color: var(--draft); }
.objective-label { display: grid; gap: 3px; }
.objective-label strong { font-size: 13.5px; }
.objective-label span { color: var(--muted); font-size: 12px; }
.move-action { color: var(--accent); font-size: 12px; font-weight: 750; text-decoration: none; }
.add-objective {
  display: inline-flex; align-items: center; gap: 8px; margin-top: 18px;
  color: var(--accent); font-size: 13px; font-weight: 800; text-decoration: none;
}
.add-objective:hover { color: var(--accent-strong); }
.add-objective span {
  display: grid; place-items: center; width: 20px; height: 20px;
  border: 2px solid var(--accent); border-radius: var(--radius); font-size: 14px; line-height: 1;
}

.resource-list { display: grid; gap: 0; margin: 0; padding: 0; list-style: none; }
.resource-row {
  display: flex; align-items: center; justify-content: space-between; gap: 20px;
  padding: 13px 0; border-bottom: 1px solid var(--line);
}
.resource-row:last-child { border-bottom: 0; }
.resource-row span { color: var(--muted); font-size: 13px; }
.resource-row strong { font-size: 13.5px; font-weight: 700; }
.resource-kind { color: var(--accent) !important; font-size: 11px !important; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }

/* ── Tags ──────────────────────────────────────────────── */

.tag-list { display: flex; flex-wrap: wrap; gap: 8px; padding-top: 6px; }
.tag-list span {
  padding: 6px 11px; color: var(--ink-2); background: var(--card);
  border: 1.5px solid var(--ink); border-radius: var(--radius);
  font-size: 12.5px; font-weight: 650;
}

/* ── Lessons & tasks ───────────────────────────────────── */

.lesson-hero {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 24px;
  padding-bottom: 20px; margin-bottom: 22px;
  border-bottom: 2px solid var(--ink);
}
.lesson-hero h2 { margin: 7px 0 8px; font-size: 26px; font-weight: 700; letter-spacing: -.02em; }
.lesson-hero p { max-width: 620px; margin: 0; color: var(--muted); font-size: 14px; line-height: 1.6; }
.task-state { display: flex; align-items: center; gap: 10px; padding: 0 0 16px; color: var(--muted); font-size: 13px; }
.lesson-target-links > div > strong { display: block; margin-top: 14px; font-size: 13px; }
.lesson-target-links li { display: flex; align-items: baseline; gap: 12px; }

/* ── Templates ─────────────────────────────────────────── */

.template-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 36px; align-items: start; }
.template-list { display: grid; gap: 22px; padding-top: 8px; }
.template-version { display: grid; gap: 14px; padding-bottom: 20px; border-bottom: 2px solid var(--line-strong); }
.template-version > div:first-child { display: flex; align-items: center; justify-content: space-between; gap: 15px; }
.template-category-list { display: grid; gap: 10px; }
.template-category {
  display: grid; gap: 8px; padding: 13px 15px;
  background: var(--card); border: 2px solid var(--ink); border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}
.template-category-list span { color: var(--ink); font-size: 13px; font-weight: 700; }
.template-category-list small { color: var(--muted); font-size: 12px; }
.template-version form { padding-top: 5px; }

/* ── Access / login ────────────────────────────────────── */

/* ── Family partnership ────────────────────────────────── */

.family-shell { min-height: 100vh; background: var(--paper); }
.family-topbar {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; gap: 28px;
  min-height: 68px; padding: 0 max(22px, calc((100vw - 1180px) / 2));
  color: var(--nav-text); background: var(--ink);
  border-bottom: 3px solid var(--accent);
}
.family-nav { display: flex; align-items: stretch; align-self: stretch; }
.family-nav-link {
  display: flex; align-items: center; padding: 0 14px;
  color: var(--nav-text); border-bottom: 3px solid transparent;
  font-size: 13px; font-weight: 750; text-decoration: none;
}
.family-nav-link:hover, .family-nav-link.active { color: var(--nav-text-strong); border-bottom-color: var(--accent); }
.family-user-chip { margin-left: auto; }
.family-main { width: min(1180px, 100%); margin: 0 auto; padding: 50px 28px 80px; }
.family-intro { display: flex; align-items: end; justify-content: space-between; gap: 28px; margin-bottom: 32px; }
.family-intro h1 { max-width: 740px; margin: 8px 0 0; font-size: clamp(36px, 6vw, 62px); line-height: .98; letter-spacing: -.045em; }
.family-intro p { max-width: 700px; margin: 15px 0 0; color: var(--muted); font-size: 15px; line-height: 1.65; }
.family-content { display: grid; gap: 34px; }
.family-child-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; }
.family-child-card {
  display: grid; gap: 22px; padding: 26px;
  background: var(--card); border: 2px solid var(--ink); border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}
.family-child-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; }
.family-child-head h2 { margin: 5px 0 4px; font-size: 28px; letter-spacing: -.025em; }
.family-child-head p { margin: 0; color: var(--muted); font-size: 13px; }
.family-child-mark {
  display: grid; place-items: center; width: 48px; height: 48px; flex: 0 0 auto;
  color: var(--accent-strong); background: var(--accent-wash);
  border: 2px solid var(--accent); border-radius: 50%; font-size: 19px; font-weight: 850;
}
.family-card-report, .family-card-empty { min-height: 116px; padding: 18px; background: var(--paper-2); border-left: 4px solid var(--accent); }
.family-card-report p, .family-card-empty span { display: block; margin: 9px 0 0; color: var(--muted); font-size: 13.5px; line-height: 1.55; }
.family-report-period { color: var(--ink); font-size: 12px; font-weight: 800; }
.family-outcomes { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 14px; }
.family-reports { display: grid; gap: 48px; }
.family-report-stack { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(300px, .55fr); gap: 34px; align-items: start; }
.family-teacher-note { margin: 0 0 24px; padding: 20px 22px; background: var(--accent-wash); border-left: 4px solid var(--accent); }
.family-teacher-note p { margin: 0; color: var(--ink); font-family: var(--font-ui); font-size: 18px; line-height: 1.55; }
.family-teacher-note cite { display: block; margin-top: 10px; color: var(--accent-strong); font-size: 11px; font-style: normal; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
.family-checkin { position: sticky; top: 92px; padding: 22px; background: var(--paper-2); border: 2px solid var(--ink); border-radius: var(--radius-lg); }
.family-checkin form { max-width: none; }
.family-thread { display: grid; gap: 10px; margin: 0 0 22px; }
.family-thread-message, .family-thread-reply { padding: 14px 16px; background: var(--card); border-left: 3px solid var(--draft); }
.family-thread-reply { margin-left: 18px; border-left-color: var(--live); }
.family-thread p { margin: 7px 0 0; color: var(--ink-2); font-size: 13.5px; line-height: 1.55; }
.family-thread small { display: block; margin-top: 7px; color: var(--muted); }
.family-thread-list { display: grid; gap: 18px; }
.family-assessments { display: grid; gap: 24px; }
.family-assessment { padding: 20px; background: var(--paper-2); border-left: 4px solid var(--accent); }
.family-assessment + .family-assessment { border-top: 1px solid var(--line); }
.family-assessment-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; }
.family-assessment h3 { margin: 6px 0 0; font-size: 22px; }
.family-assessment > p { margin: 12px 0 18px; color: var(--ink-2); line-height: 1.55; }
.family-staff-thread { display: grid; grid-template-columns: minmax(0, 1fr) minmax(260px, .55fr); gap: 28px; padding: 18px; background: var(--paper-2); border-left: 4px solid var(--draft); }
.family-staff-thread p { margin: 8px 0 0; line-height: 1.55; }
.family-staff-thread blockquote { margin: 12px 0 0; padding: 12px 14px; background: var(--card); border-left: 3px solid var(--live); }
.family-staff-thread form { max-width: none; }

.access-page {
  display: grid; align-content: center; gap: 18px;
  width: min(460px, calc(100vw - 44px)); min-height: 100vh; margin: 0 auto; padding: 50px 0;
}
.access-mark {
  display: grid; place-items: center; width: 48px; height: 48px;
  color: #fff; background: var(--accent);
  border: 2px solid var(--ink);
  border-radius: var(--radius);
  box-shadow: 4px 4px 0 rgba(0, 0, 0, .2);
  font-weight: 800; font-size: 20px;
}
.access-page h1 { margin: 0; font-size: 38px; font-weight: 700; letter-spacing: -.03em; line-height: 1.02; }
.access-page > p { margin: -3px 0 6px; color: var(--muted); font-size: 14.5px; line-height: 1.6; }
.access-form {
  width: 100%; max-width: none; padding: 26px;
  background: var(--card); border: 2px solid var(--ink); border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}
.access-form label > span { color: var(--muted); font-size: 12px; font-weight: 700; }

/* ── Responsive ────────────────────────────────────────── */

@media (max-width: 1020px) {
  .stat-strip { grid-template-columns: repeat(2, 1fr); }
  .stat-item:nth-child(n + 3) { border-left: 0; border-top: 2px solid var(--ink); }
  .template-grid { grid-template-columns: 1fr; }
  .top-nav { margin-left: 4px; }
  .top-link { padding: 0 10px; }
}

@media (max-width: 900px) {
  .brand-sub { display: none; }
  .topbar { padding: 0 12px; }
  .topbar-right .user-chip > span:not(.avatar), .context-pill .pill-kicker { display: none; }
  .context-pill { padding: 7px 9px; }
  .context-strip, .page-content { padding-left: 20px; padding-right: 20px; }
  .home-grid { grid-template-columns: 1fr; gap: 40px; }
  .page-intro { align-items: flex-start; flex-direction: column; }
  .form-grid { grid-template-columns: 1fr; }
  .field-row { grid-template-columns: 1fr; }
  .table-wrap td.attendance-update > form { grid-template-columns: 1fr; }
  .assessment-result-card { grid-template-columns: 1fr; }
  .sheet-head, .sheet-main { padding-left: 20px; padding-right: 20px; }
  .family-report-stack { grid-template-columns: 1fr; }
  .family-checkin { position: static; }
  .family-staff-thread { grid-template-columns: 1fr; }
}

@media (max-width: 560px) {
  .context-switch { display: none; }
  .context-strip { align-items: flex-start; flex-direction: column; gap: 8px; }
  .page-content { padding: 26px 14px 60px; }
  .page-intro { margin-bottom: 26px; }
  .page-intro h1 { font-size: 32px; }
  .stat-strip { grid-template-columns: repeat(2, 1fr); }
  .stat-item { padding: 15px 16px; }
  .home-grid > .panel .table-wrap table { min-width: 0; table-layout: fixed; }
  .home-grid > .panel .table-wrap th, .home-grid > .panel .table-wrap td,
  .home-grid + .panel .table-wrap th, .home-grid + .panel .table-wrap td { padding-right: 6px; padding-left: 2px; }
  .home-grid > .panel .table-wrap td:nth-last-child(2), .home-grid + .panel .table-wrap td:nth-last-child(2) { padding-right: 22px !important; }
  .home-grid > .panel .table-wrap td:last-child, .home-grid + .panel .table-wrap td:last-child { padding-left: 16px !important; text-align: right; }
  .home-grid > .panel .table-wrap td:last-child .table-action, .home-grid + .panel .table-wrap td:last-child .table-action { display: inline-block; margin-right: 0; }
  .home-grid > .panel:first-child .table-wrap th:last-child, .home-grid > .panel:first-child .table-wrap td:last-child { display: none; }
  .home-grid + .panel .status-chip { padding: 3px 7px; font-size: 9px; }
  .top-nav { margin-left: 0; }
  .top-link svg { display: none; }
  .sheet-head { flex-direction: column; gap: 12px; }
  .sheet-title { font-size: 22px; }
  up-drawer-box { border-left-width: 1px; }
  .family-topbar { min-height: 60px; padding: 0 12px; }
  .family-topbar .brand-copy { display: none; }
  .family-user-chip strong { display: none; }
  .family-main { padding: 34px 14px 64px; }
  .family-intro { align-items: flex-start; flex-direction: column; }
  .family-child-grid { grid-template-columns: 1fr; }
  .family-child-card { padding: 20px; }
  .family-report-stack .table-wrap { overflow-x: auto; }
  .family-content > .panel .stat-strip { grid-template-columns: 1fr; }
  .family-content > .panel .stat-item + .stat-item { border-left: 0; border-top: 2px solid var(--ink); }
  .family-content > .panel .stat-item strong,
  .family-content > .panel .stat-item em { overflow: visible; text-overflow: clip; white-space: normal; }
}

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

/* ── Small screens ─────────────────────────────────────── */

@media (max-width: 860px) {
  .brand-sub { display: none; }
  .topbar { padding: 0 10px; gap: 4px; }
  .topbar-right { min-width: 0; }
  .topbar .context-pill { display: none; }
  .user-chip strong { display: none; }
  .context-strip { padding: 8px 14px; }
  .context-switch { display: none; }
  .page-content { padding: 22px 14px 80px; }
  .sheet-head { padding: 20px 16px 16px; }
  .sheet-main { padding: 18px 16px 80px; }
  .sheet-actions { flex-wrap: wrap; }
  .matrix-scroll { overflow-x: auto; }
}

/* Weekly teaching spine: consistent destinations and a printable school grid. */
.workflow-nav { display:flex; flex-wrap:wrap; gap:1.25rem; border-bottom:1px solid var(--border, #ddd); padding:0 0 1rem; margin-bottom:1.5rem; }
.settings-destinations { display:flex; flex-wrap:wrap; gap:1rem 2rem; }
.settings-destination { padding:.75rem 0; text-decoration:underline; text-underline-offset:4px; }
.workflow-form { padding:1.25rem 0; max-width:760px; }
details > summary { cursor:pointer; padding:.85rem 0; font-weight:600; }
.timetable-wrap { overflow-x:auto; margin-top:1rem; }
.timetable { table-layout:fixed; width:100%; min-width:780px; border-collapse:collapse; }
.timetable th,.timetable td { border:1px solid #d2d5d8; padding:.8rem; vertical-align:top; }
.timetable th small { display:block; font-weight:400; margin-top:.4rem; }
.timetable-lesson { display:flex; flex-direction:column; gap:.6rem; padding:.4rem 0; }
.feedback-student { padding:1.25rem 0; border-bottom:1px solid #ddd; }
.feedback-student form { max-width:760px; }
.draft-status { color:#606060; font-size:.85rem; min-height:1.2em; }
:focus-visible { outline:3px solid #c62828; outline-offset:3px; }
@media(max-width:700px) { .topbar { flex-wrap:wrap; } .top-nav { order:3; width:100%; justify-content:space-between; } .top-link { padding:.8rem .5rem; } .workflow-nav { gap:.75rem; } .field-row { display:flex; flex-direction:column; } }
@media print {
  @page { size:A4 landscape; margin:10mm; }
  .topbar,.context-strip,.workflow-nav,.intro-actions,.no-print,form,details,.page-feedback { display:none !important; }
  .app-main,.workspace,.page-content { display:block !important; padding:0 !important; margin:0 !important; max-width:none !important; }
  .timetable-wrap,.table-wrap { overflow:visible !important; }
  .timetable { min-width:0; width:100%; font-size:10pt; }
  .timetable th,.timetable td { padding:6pt; border:1px solid #777; }
  .panel { box-shadow:none; break-inside:auto; margin:10pt 0; }
  tr { break-inside:avoid; } thead { display:table-header-group; }
  a { color:#000 !important; text-decoration:none !important; }
  .page-content-lower > .no-print { display:none !important; }
}
.print-only { display:none; }
@media print { .print-only { display:block; } .timetable-panel > .panel-heading { display:none; } }
.weekly-targets li { display:flex; flex-wrap:wrap; gap:.4rem .75rem; padding:.5rem 0; }
@media(max-width:700px) {
  .topbar { height:auto; min-height:58px; gap:0 8px; }
  .brand,.topbar-right { min-height:54px; }
  .top-nav { flex:1 0 100%; margin-left:0; min-height:46px; }
  .top-link { flex:1; justify-content:center; font-size:10px; letter-spacing:.04em; }
  .top-link svg { display:none; }
  .field-row { align-items:stretch; width:100%; }
  .field-row label { width:100%; }
  .intro-actions { justify-content:flex-start; }
}
@media print {
  html,body,.app-shell { background:white !important; color:black; }
  .page-intro h1 { font-size:22pt; }
  .timetable .status-chip { display:none; }
}

/* Section navigation stays outside the changing page content. */
.context-strip.workflow-nav { justify-content:flex-start; margin:0; padding:0 32px; gap:28px; }
.context-strip.workflow-nav a { padding:14px 0; text-decoration:none; border-bottom:2px solid transparent; }
.context-strip.workflow-nav a.active { color:var(--accent); border-bottom-color:var(--accent); }
.page-breadcrumbs { margin-bottom:20px; }
@media(max-width:700px) { .context-strip.workflow-nav { flex-direction:row; flex-wrap:nowrap; gap:20px; padding:0 14px; overflow-x:auto; } .context-strip.workflow-nav a { white-space:nowrap; } }
@media print { .page-breadcrumbs { display:none; } }

.programme-overview { border-top:2px solid var(--ink); border-bottom:1px solid var(--line-strong); padding:24px 0; }
.programme-facts { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:24px; margin:0; }
.programme-facts dt { font-size:12px; color:var(--muted); margin-bottom:10px; }
.programme-facts dd { margin:0; font-weight:700; overflow-wrap:anywhere; }
.programme-section-heading { margin:40px 0 24px; }
.programme-section-heading p,.programme-empty { color:var(--muted); font-size:14px; }
.programme-subject { border-top:1px solid var(--line-strong); padding:24px 0; }
.programme-subject > h2 { font-size:26px; margin:0 0 20px; }
.programme-grade { padding:16px 0; }
.programme-grade-heading { display:flex; align-items:center; justify-content:space-between; gap:16px; }
.programme-grade-heading h3 { margin:0; }
.programme-goal-columns { display:grid; grid-template-columns:1fr 1fr; gap:40px; }
.programme-goal-columns h4 { color:var(--muted); font-size:12px; text-transform:uppercase; letter-spacing:.06em; }
.programme-goals { list-style:none; padding:0; margin:0; }
.programme-goals li { display:flex; align-items:baseline; gap:12px; padding:12px 0; border-top:1px solid var(--line); }
.goal-code { font-size:11px; color:var(--muted); min-width:65px; }
@media(max-width:700px) { .programme-facts { grid-template-columns:1fr 1fr; } .programme-goal-columns { grid-template-columns:1fr; gap:12px; } }
.programme-levels { display:flex; align-items:center; gap:2px; margin:28px 0; padding:3px; height:40px; box-sizing:border-box; width:fit-content; max-width:100%; background:var(--paper); border:1px solid #202020; border-left:2px solid var(--accent); border-radius:var(--radius); overflow-x:auto; }
.programme-level { display:flex; align-items:center; justify-content:center; height:32px; padding:0 22px; min-width:68px; box-sizing:border-box; border-radius:var(--radius); text-align:center; text-decoration:none; color:var(--ink); font-size:13px; font-weight:650; white-space:nowrap; }
.programme-level:hover, .programme-level.active { background:var(--accent-wash); color:var(--accent-strong); }
.programme-level:focus-visible { outline:2px solid var(--accent); outline-offset:2px; }
.programme-grade-heading { justify-content:flex-end; }
.programme-dialog { padding:28px; max-width:640px; margin:auto; }
.programme-dialog-heading,.programme-section-actions { display:flex; align-items:center; justify-content:space-between; gap:20px; }
.programme-dialog-heading h2,.programme-section-actions h2 { margin:0; }
.programme-dialog form { display:grid; gap:18px; margin-top:20px; }
.programme-dialog textarea { width:100%; min-height:120px; }
.programme-edit-goals { list-style:none; padding:0; }
.programme-edit-goals li { display:flex; align-items:flex-start; justify-content:space-between; gap:24px; padding:18px 0; border-top:1px solid var(--line); }
.programme-edit-goals p { margin:8px 0 0; }
.programme-edit-goals small { color:var(--muted); }
.programme-edit-goals .button-row { flex-shrink:0; }
.context-dialog-heading { display:flex; align-items:start; justify-content:space-between; gap:20px; margin-bottom:20px; }
.context-dialog-heading h2 { margin:0; font-size:24px; }
@media(max-width:700px) { .programme-section-actions,.programme-edit-goals li { flex-direction:column; align-items:stretch; } .programme-dialog { padding:20px; } }

/* Explicit date display with the browser calendar retained as the picker. */
.dialog-actions { justify-content: flex-end; }
.date-field { display: block; position: relative; min-width: 0; }
.date-field > input[type="text"] { width: 100%; padding-right: 48px; }
.date-field-icon { position: absolute; right: 14px; top: 50%; transform: translateY(-50%); font-size: 26px; line-height: 1; color: var(--muted); pointer-events: none; }
.date-field > .date-field-picker { position: absolute; right: 0; top: 0; width: 44px; height: 100%; min-width: 0; padding: 0; opacity: 0; cursor: pointer; }
.date-field:has(.date-field-picker:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }
.date-field-picker::-webkit-calendar-picker-indicator { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; padding: 0; cursor: pointer; }

.programme-goal-heading { justify-content:space-between; }

/* Annual goal order is independent for main and supporting goals. */
.programme-edit-goals .goal-position { color:var(--muted); font-variant-numeric:tabular-nums; min-width:1.5em; padding-top:2px; }
.programme-edit-goals .goal-description { flex:1; min-width:0; }
.programme-goal-actions { display:flex; align-items:center; gap:16px; flex-shrink:0; }
.programme-goal-actions form { display:flex; gap:8px; margin:0; }
.programme-goal-actions .goal-move { padding:8px 12px; min-width:40px; min-height:44px; }
.goal-move:disabled { opacity:.35; cursor:default; box-shadow:none; }
.programme-edit-goals .goal-prerequisites { font-size:.85rem; color:var(--muted); line-height:1.8; }
.goal-prerequisite { display:inline-block; margin-right:6px; padding:0 6px; color:var(--ink); border:1px solid var(--line); }
.programme-prerequisite-picker { margin:24px 0; padding:0; border:0; min-width:0; }
.programme-prerequisite-picker legend { font-weight:700; }
.prerequisite-options { max-height:260px; overflow-y:auto; border-top:1px solid var(--line); border-bottom:1px solid var(--line); }
.prerequisite-option { display:flex; align-items:flex-start; gap:12px; padding:12px 4px; cursor:pointer; }
.prerequisite-option + .prerequisite-option { border-top:1px solid var(--line); }
.prerequisite-option input { width:20px; height:20px; min-width:20px; margin:3px 0; accent-color:var(--accent); }
.prerequisite-option > span { display:grid; gap:4px; }
.prerequisite-option small { color:var(--muted); }
@media(max-width:900px) { .programme-goal-actions { flex-direction:column; align-items:flex-end; gap:12px; } }
@media(max-width:700px) {
  .programme-edit-goals li { position:relative; padding-left:32px; }
  .programme-edit-goals .goal-position { position:absolute; left:0; }
  .programme-goal-actions { flex-direction:row; justify-content:space-between; align-items:center; }
}

/* The subject editor is a compact authoring table with a persistent blank row. */
.goal-grid-wrap { margin-top:20px; overflow-x:auto; }
.goal-grid { width:100%; border-collapse:collapse; table-layout:fixed; min-width:720px; }
.goal-grid th { text-align:left; color:var(--muted); font-size:.75rem; padding:10px; border-bottom:2px solid var(--line-strong); }
.goal-grid th:first-child { width:38px; }
.goal-grid th:nth-child(2) { width:125px; }
.goal-grid th:nth-child(4) { width:200px; }
.goal-grid th:last-child { width:104px; }
.goal-grid td { padding:8px; vertical-align:top; border:1px solid var(--line); }
.goal-grid .grid-position { color:var(--muted); text-align:center; padding-top:18px; font-variant-numeric:tabular-nums; }
.goal-grid .grid-code { font-size:.75rem; color:var(--muted); padding-top:18px; overflow-wrap:anywhere; }
.goal-grid .grid-code select { width:100%; font-size:.8rem; margin-top:8px; padding:6px; }
.goal-grid .grid-description { padding:3px; }
.goal-grid textarea { width:100%; min-height:48px; padding:10px; border:1px solid transparent; background:transparent; box-shadow:none; resize:vertical; font:inherit; line-height:1.5; }
.goal-grid textarea:hover { background:var(--card); }
.goal-grid textarea:focus { outline:2px solid var(--accent); outline-offset:-2px; background:var(--card); }
.grid-save-status { display:block; color:var(--muted); font-size:.72rem; padding:0 10px; line-height:1.4; }
.grid-save-status:not(:empty) { padding-bottom:6px; }
.goal-grid .grid-error { background:var(--accent-wash); }
.grid-error .grid-save-status { color:var(--review); }
.goal-grid .grid-actions form { margin:0; display:inline; }
.goal-grid .grid-actions { white-space:normal; }
.goal-grid .grid-save { padding:5px 10px; font-size:.75rem; margin-bottom:8px; }
.goal-grid .grid-move,.goal-grid .grid-remove { display:inline-flex; align-items:center; justify-content:center; min-width:28px; min-height:32px; padding:3px; color:var(--muted); border:0; box-shadow:none; background:transparent; font-size:1rem; text-decoration:none; cursor:pointer; }
.goal-grid .grid-move:disabled { opacity:.3; cursor:default; }
.goal-grid .grid-move:hover:not(:disabled),.goal-grid .grid-remove:hover { color:var(--accent); background:var(--accent-wash); }
.goal-grid [hidden] { display:none !important; }
.grid-prerequisites summary { cursor:pointer; color:var(--muted); font-size:.8rem; padding:9px 0; overflow-wrap:anywhere; }
.grid-prerequisites[open] summary { color:var(--ink); }
.grid-prerequisite-options { max-height:240px; overflow:auto; font-size:.8rem; }
.grid-prerequisite-options .prerequisite-option { gap:8px; padding:10px 0; }
.grid-prerequisite-options input { width:16px; height:16px; min-width:16px; }
.grid-enhanced .goal-grid-row[data-goal-id=""] { background:var(--card); }
.goal-grid textarea { resize:none; }
.goal-grid th:last-child { width:140px; }
.grid-more { display:inline-block; position:relative; }
.grid-more summary { display:inline-flex; align-items:center; justify-content:center; width:28px; min-height:32px; cursor:pointer; list-style:none; color:var(--muted); }
.grid-more summary::-webkit-details-marker { display:none; }
.grid-more[open] { display:block; white-space:normal; }
.grid-more a { display:block; font-size:.75rem; padding:8px 0; }
.goal-grid .grid-discard { padding:3px 0; font-size:.7rem; border:0; background:transparent; box-shadow:none; cursor:pointer; color:var(--muted); }

.goal-grid th:first-child { width:64px; }
.goal-grid th:last-child { width:76px; }
.goal-grid .grid-position { white-space:nowrap; padding:8px 2px; }
.grid-row-number { display:inline-block; min-width:18px; font-size:.75rem; }
.goal-grid .grid-drag-handle { display:inline-flex; align-items:center; justify-content:center; padding:0; width:30px; min-height:36px; border:0; background:transparent; box-shadow:none; color:var(--muted); cursor:grab; touch-action:none; user-select:none; font-size:22px; vertical-align:middle; }
.goal-grid .grid-drag-handle:hover,.goal-grid .grid-drag-handle:focus-visible { color:var(--accent); background:var(--accent-wash); }
.goal-row-dragging,.goal-row-dragging * { cursor:grabbing !important; user-select:none !important; }
.goal-grid .grid-dragging { opacity:.45; }
.goal-grid .grid-drop-before > td { box-shadow:inset 0 3px var(--accent); }
.goal-grid .grid-drop-after > td { box-shadow:inset 0 -3px var(--accent); }

/* Custom elements keep their native table/form children in the light DOM. */
atlas-goal-grid { display:block; }
atlas-goal-grid:not([data-component-ready]) .grid-drag-handle { display:none; }

/* Prerequisite choices live in a nested Unpoly layer; retain native details
   as the no-JavaScript form fallback. */
.grid-enhanced .grid-prerequisites > .grid-prerequisite-options { display:none; }
.grid-enhanced .grid-prerequisites summary { color:var(--accent); }
atlas-prerequisite-picker { display:block; }
.prerequisite-layer up-modal-box { width:900px; max-width:calc(100vw - 32px); }
.prerequisite-picker { padding:32px; }
.prerequisite-picker h2 { margin:0 0 12px; }
.picker-goal { color:var(--muted); margin:0 0 24px; }
.picker-toolbar { display:flex; gap:16px; align-items:center; }
.picker-toolbar input[type=search] { flex:1; min-width:0; }
.picker-selected { display:flex; gap:8px; align-items:center; white-space:nowrap; }
.picker-selected input { width:18px; height:18px; }
.picker-options { max-height:45vh; overflow:auto; border-top:1px solid var(--line); }
.picker-options .prerequisite-option { padding:14px 8px; border-bottom:1px solid var(--line); }
.picker-options .prerequisite-option[hidden] { display:none; }
.picker-options .prerequisite-option span span { display:block; }
.picker-options input { width:20px; height:20px; min-width:20px; }
.picker-actions { display:flex; justify-content:flex-end; gap:12px; margin-top:24px; }
[data-picker-error] { color:var(--review); }
@media(max-width:600px) { .prerequisite-picker { padding:20px; } .picker-toolbar { align-items:stretch; flex-direction:column; } }

/* Authoring dialogs leave room for goal wording and prerequisite selection. */
up-modal:has(atlas-prerequisite-field) up-modal-box { width:1100px; max-width:calc(100vw - 32px); }
.programme-dialog:has(atlas-prerequisite-field) { max-width:1040px; }
atlas-prerequisite-field { display:block; min-width:0; }
.prerequisite-field-summary { overflow-wrap:anywhere; }
.goal-grid th:last-child { width:180px; }
.goal-grid .grid-actions { white-space:nowrap; }
.goal-grid .grid-role-link,.goal-grid .grid-remove { display:inline-flex; align-items:center; min-height:36px; padding:6px 8px; font-size:.875rem; color:var(--accent); text-decoration:none; }
.goal-grid .grid-actions [hidden] { display:none; }

.programme-dialog:has(atlas-prerequisite-field) form { max-width:none; }

.removed-goals del { color:var(--muted); text-decoration:line-through; }
.removed-goals td:last-child { width:180px; white-space:nowrap; }

.new-subject-option summary { width:fit-content; cursor:pointer; color:var(--accent); font-size:.875rem; }
.new-subject-option[open] summary { margin-bottom:16px; }

/* K1 annual curriculum: one aligned subject/outcome matrix. */
.k1-curriculum-frame { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: #fff; margin-top: 24px; }
.k1-curriculum { width: 100%; border-collapse: collapse; table-layout: fixed; text-align: left; }
.k1-curriculum th, .k1-curriculum td { padding: 24px 28px; vertical-align: top; border-bottom: 1px solid var(--line); }
.k1-curriculum th:first-child { width: 22%; border-right: 1px solid var(--line); }
.k1-curriculum thead th { background: var(--accent-wash); color: var(--ink); font-weight: 650; padding-top: 18px; padding-bottom: 18px; }
.k1-curriculum tbody th { background: #fffafa; font-weight: 600; color: var(--ink); }
.k1-curriculum tbody tr:last-child > * { border-bottom: 0; }
.k1-curriculum ul { margin: 0; padding-left: 20px; line-height: 1.8; }
.k1-curriculum li + li { margin-top: 6px; }
@media (max-width: 600px) { .k1-curriculum th, .k1-curriculum td { padding: 16px 12px; } .k1-curriculum th:first-child { width: 30%; } }

.k1-goal-link { display: block; color: inherit; text-decoration: none; border-radius: var(--radius); padding: 4px 8px; margin-left: -8px; }
.k1-goal-link:hover { background: var(--accent-wash); color: var(--ink); text-decoration: underline; text-underline-offset: 4px; }
.k1-goal-link:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.k1-selected-goal { line-height: 1.7; max-width: 70ch; }
.k1-lessons td.k1-lesson-list { padding: 0; }
.k1-lesson-cell { padding: 20px 24px; border-bottom: 1px solid var(--line); }
.k1-lesson-cell:last-child { border-bottom: 0; }
.k1-lesson-cell h3 { margin: 0; font-size: 17px; line-height: 1.5; }
.k1-lesson-detail { white-space: pre-line; line-height: 1.7; margin: 8px 0; }
.k1-lesson-source { display: inline-block; margin-top: 8px; font-size: 12px; color: var(--muted); }
.k1-lesson-link { display: block; color: inherit; text-decoration: none; }
.k1-lesson-link:hover { color: var(--accent); text-decoration: underline; text-underline-offset: 4px; }
.k1-lesson-link:focus-visible { outline: 2px solid var(--accent); outline-offset: 5px; }
.k1-lesson-panel { border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: #fff; }
.k1-lesson-panel section + section { border-top: 1px solid var(--line); }
.k1-lesson-panel section > h2 { margin: 0; padding: 16px 24px; font-size: 18px; background: var(--accent-wash); border-bottom: 1px solid var(--line); }
.k1-lesson-section-body { padding: 20px 24px; line-height: 1.7; }
.k1-lesson-section-body details { margin-top: 18px; }
.k1-lesson-section-body summary { cursor: pointer; width: fit-content; }
.k1-lesson-section-body form { margin-top: 16px; }
.k1-lesson-section-body textarea { width: 100%; }

.k1-goal-cta { display: block; margin-top: 3px; color: var(--accent); font-size: 12px; font-weight: 600; }
.k1-goal-link:hover .k1-goal-cta { color: var(--accent-strong); }

.programme-navigation-row { display: flex; align-items: center; justify-content: space-between; gap: 24px; flex-wrap: wrap; }
/* Compact year control in the product's red, white and black palette. */
.programme-year-picker { margin: 0 0 0 auto; min-width: 0; }
@media (max-width: 480px) { .programme-year-picker { width: 100%; } .programme-year-picker label { justify-content: space-between; } }

.top-link.active, .top-link:hover { color: var(--accent-strong); }

/* Keep the year selector secondary to the programme heading. */

.programme-add-actions { display:flex; justify-content:flex-end; }

.programme-delete-link { display:inline-block; color:var(--muted); font-size:12px; font-weight:400; margin:8px 0 8px 12px; text-decoration:underline; }
.programme-delete-link:hover { color:var(--accent); }
.programme-history-version { border:1px solid var(--line); padding:18px; margin-bottom:14px; border-radius:var(--radius); }
.programme-history-version summary { cursor:pointer; font-weight:600; }
.programme-version-content { white-space:pre-wrap; overflow-wrap:anywhere; font:inherit; line-height:1.65; }

.subject-lesson-heading { margin:0 0 16px; font-size:22px; line-height:1.4; }
.subject-lesson-header { padding:18px 24px; background:var(--accent-wash); border-bottom:1px solid var(--line); font-weight:650; }
.programme-item-actions { display:inline-flex; vertical-align:middle; gap:2px; margin-left:8px; }
.programme-icon-action { display:inline-flex; align-items:center; justify-content:center; width:28px; height:28px; color:var(--muted); border-radius:var(--radius); text-decoration:none; }
.programme-icon-action:hover { color:var(--accent); background:var(--accent-wash); }
.programme-icon-action:focus-visible { outline:2px solid var(--accent); outline-offset:2px; }
.programme-action-glyph { display:block; width:13px; height:13px; flex-shrink:0; background:currentColor; mask-size:contain; mask-repeat:no-repeat; }
.icon-pencil { mask-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m16 3 5 5-13 13H3v-5L16 3Z M13 6l5 5'/%3E%3C/svg%3E"); }
.icon-trash { mask-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 6h18M9 6V3h6v3M5 6l1 15h12l1-15M10 10v7M14 10v7'/%3E%3C/svg%3E"); }
.subject-lesson-heading { font-size:28px; font-weight:700; }

.lesson-title-row { display:flex; align-items:center; justify-content:space-between; gap:16px; }
.lesson-title-row h3 { flex:1; min-width:0; }
.lesson-title-row .programme-item-actions { flex-shrink:0; }


/* Warm red accents keep light surfaces from looking rose-pink. */
.k1-curriculum thead th, .subject-lesson-header { color:var(--accent-strong); }

.subject-edit-goals { list-style:none; padding:0; margin:0; }
.subject-edit-goals li { display:flex; align-items:flex-start; justify-content:space-between; gap:12px; padding:12px 0; border-bottom:1px solid var(--line); }
.subject-edit-goals .programme-item-actions { flex-shrink:0; }

.programme-edit-footer { display:flex; align-items:center; justify-content:flex-end; gap:18px; margin-top:20px; }

.blank-objective-input { display:block; width:100%; background:#fff; border:1px solid var(--line-strong); border-radius:var(--radius); box-shadow:none; padding:12px; resize:vertical; }
.blank-objective-input:focus { border-color:var(--accent); outline:2px solid var(--accent-wash); }

atlas-objective-inputs { display:grid; gap:8px; }
.compact-objective-input { height:40px; min-height:40px; padding:8px 12px; }
.compact-objective-input::placeholder { color:var(--muted); }
.objective-entry-hint { display:block; margin-top:6px; color:var(--muted); font-size:12px; }

/* Programme controls consume the shared button and native select styles. */
.programme-year-picker label { display:flex; align-items:center; gap:10px; }
.programme-year-picker label > span { color:var(--muted); font-size:11px; font-weight:700; text-transform:uppercase; white-space:nowrap; }
.programme-year-picker select { width:auto; min-width:150px; cursor:pointer; }

up-modal-box, .programme-dialog, .settings-form { border-radius:var(--radius-lg); }
.table-wrap, .goal-grid-wrap, .timetable-wrap { border-radius:var(--radius-lg); overflow-x:auto; }
.programme-year-picker select {
  appearance:none;
  -webkit-appearance:none;
  padding-left:16px;
  padding-right:42px;
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%23171717' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m4 6 4 4 4-4'/%3E%3C/svg%3E");
  background-repeat:no-repeat;
  background-size:14px 14px;
  background-position:right 16px center;
}
.programme-add-actions a.secondary-button,
.programme-add-actions a.secondary-button:hover,
.programme-add-actions a.secondary-button:focus { text-decoration:none; }
.monthly-programme { max-width:100%; }
.monthly-programme table { width:100%; min-width:850px; table-layout:fixed; }
.monthly-programme th, .monthly-programme td { min-width:0; padding:14px 12px; vertical-align:top; overflow-wrap:anywhere; white-space:normal; }
.monthly-programme td details, .monthly-programme td select { min-width:0; max-width:100%; }
.monthly-programme td form { display:flex; flex-direction:column; gap:12px; width:100%; }
.monthly-programme .secondary-button { max-width:100%; white-space:normal; padding:10px 12px; }
.monthly-programme th:first-child { width:90px; min-width:0; white-space:nowrap; overflow-wrap:normal; position:sticky; left:0; background:var(--paper); z-index:1; }
.monthly-programme thead th { background:var(--accent-wash); color:var(--accent-strong); }
.monthly-lesson-items { margin:0 0 12px; padding:0; list-style:none; }
.monthly-lesson-items li { padding:10px; margin-bottom:8px; border:1px solid var(--line); border-radius:var(--radius); background:var(--paper); }

.monthly-programme .monthly-add-button { display:inline-flex; align-items:center; justify-content:center; width:32px; height:32px; min-height:32px; padding:0; font-size:24px; line-height:1; font-weight:400; color:var(--accent-strong); box-shadow:none; }

.monthly-programme .monthly-add-button,
.monthly-programme .monthly-add-button:hover,
.monthly-programme .monthly-add-button:active {
  border:0; background:transparent; box-shadow:none; transform:none;
  font-size:18px; width:28px; height:28px; min-height:28px;
}

.monthly-lesson-choices { max-height:320px; overflow-y:auto; width:100%; }
.monthly-lesson-choice { display:flex; align-items:flex-start; gap:8px; padding:10px 4px; border-bottom:1px solid var(--line); cursor:pointer; text-transform:none; letter-spacing:normal; font-size:13px; }
.monthly-lesson-choice input { width:16px; min-height:16px; height:16px; flex:none; margin:2px 0; }
.monthly-lesson-preview { display:none; position:fixed; right:24px; top:180px; width:min(360px, calc(100vw - 48px)); max-height:60vh; overflow:auto; padding:20px; z-index:100; background:white; border:1px solid var(--line); border-radius:12px; box-shadow:0 8px 30px #0002; color:var(--ink); font-size:14px; font-weight:400; line-height:1.6; white-space:pre-wrap; }
.monthly-lesson-preview p { color:var(--accent-strong); margin:12px 0 8px; }
.monthly-lesson-choice:hover .monthly-lesson-preview,
.monthly-lesson-choice:focus-within .monthly-lesson-preview { display:block; }
.monthly-lesson-choice:hover { background:var(--accent-wash); }

.monthly-programme .monthly-save { width:28px; min-height:28px; padding:2px; box-shadow:none; }
.monthly-lesson-items li { display:flex; align-items:center; gap:6px; }
.monthly-programme .monthly-lesson-items form { width:auto; margin-left:auto; flex:none; }
.monthly-remove { border:0; background:transparent; padding:4px; width:24px; height:24px; cursor:pointer; color:var(--muted); }

.monthly-picker > .monthly-lesson-choices { background:white; border:1px solid var(--line); border-radius:8px; padding:4px; margin-top:6px; }
.monthly-lesson-choice:has(input:checked) { background:var(--accent-wash); color:var(--accent-strong); }

.monthly-programme tbody tr:hover td { background:transparent; }
.monthly-programme tbody tr td:hover,
.monthly-programme tbody tr th:hover { background:var(--accent-wash); }

.monthly-picker { position:relative; }
.monthly-picker > summary.secondary-button { width:100%; display:flex; justify-content:space-between; align-items:center; font-weight:400; box-shadow:none; }
.monthly-picker > summary::after { content:"⌄"; margin-left:8px; }
.monthly-picker > .monthly-lesson-choices { position:absolute; bottom:calc(100% + 4px); left:0; width:280px; max-height:280px; z-index:30; box-shadow:0 6px 20px #0002; }
.monthly-picker .monthly-lesson-choice input { position:absolute; opacity:0; width:1px; height:1px; }
.monthly-picker .monthly-lesson-choice { padding:9px 12px; font-weight:400; }
.monthly-picker .monthly-lesson-choice:focus-within { outline:2px solid var(--accent); outline-offset:-2px; }

.monthly-picker-actions { display:flex; gap:8px; flex-wrap:wrap; align-items:center; }

.monthly-selection-dialog { width:min(800px,90vw); max-height:85vh; padding:24px; border:1px solid var(--line); border-radius:12px; background:white; }
.monthly-selection-dialog::backdrop { background:#0006; }
.monthly-selection-dialog form { max-width:none; }
.monthly-selection-dialog .monthly-picker > summary { display:none; }
.monthly-selection-dialog .monthly-picker > .monthly-lesson-choices { position:static!important; width:100%; max-height:45vh; box-shadow:none; }
.monthly-selection-dialog .monthly-lesson-choice[hidden] { display:none; }
.monthly-selection-dialog .monthly-lesson-choice input { position:static; opacity:1; width:16px; height:16px; }
.monthly-selection-dialog .monthly-picker-actions { justify-content:flex-end; margin-top:16px; }

.monthly-selection-dialog .monthly-lesson-choice { display:grid; grid-template-columns:16px 1fr; gap:8px; }
.monthly-lesson-inline-detail { grid-column:2; font-weight:400; color:var(--ink); }
.monthly-lesson-inline-detail > summary { cursor:pointer; color:var(--accent-strong); font-size:12px; }
.monthly-lesson-inline-detail > div { white-space:pre-wrap; line-height:1.6; padding:8px 0; }
.monthly-lesson-inline-detail > strong { display:none; }
.monthly-lesson-inline-detail > p { margin:8px 0; }

form[data-class-directory-filter] > .row-actions { display:flex; justify-content:flex-end; }
form[data-class-directory-filter] > .row-actions { justify-content:space-between; align-items:center; }
form[data-class-directory-filter] > .row-actions > a { order:-1; font-size:12px; padding:6px 10px; min-height:30px; }
form[data-class-directory-filter] > .row-actions { justify-content:flex-end; gap:8px; }
.timetable td > details > summary { cursor:pointer; color:var(--accent-strong); font-size:18px; list-style:none; }
.timetable td > details > summary::-webkit-details-marker { display:none; }
.timetable td { min-width:150px; }
.timetable-lesson > small { font-size:15px; font-weight:700; line-height:1.35; }
.timetable-lesson > strong { font-size:14px; font-weight:500; line-height:1.45; }
.timetable-lesson > .status-chip, .lesson-catalog-preview .status-chip { font-size:10px; font-weight:500; padding:3px 6px; align-self:flex-start; letter-spacing:0; }

.timetable td[id^="slot-"] { scroll-margin-top:100px; }

.weekly-usage-badge { display:inline-block; justify-self:start; grid-column:2; font-size:11px; font-weight:500; line-height:1.4; padding:3px 8px; border-radius:6px; }
.weekly-usage-badge.is-pending { color:var(--accent-strong); background:var(--accent-wash); border:1px solid #eac4c0; }
.weekly-usage-badge.is-added { color:#555; background:#f2f2f2; border:1px solid #ddd; }
.timetable td > div:has(.timetable-lesson) { position:relative; }
.timetable td > div > .timetable-lesson > small { padding-right:26px; }
.timetable td > div:has(.timetable-lesson) > form { position:absolute; top:4px; right:0; margin:0; padding:0; width:auto; }
.monthly-selection-dialog > form > button.primary-button { display:block; margin-left:auto; }

.delete-confirm-dialog { width:min(420px,90vw); padding:24px; border:1px solid var(--line); border-radius:12px; background:white; }
.delete-confirm-dialog::backdrop { background:#0006; }
.delete-confirm-dialog .row-actions { display:flex; justify-content:flex-end; gap:8px; }

.resource-filter-row { display:grid; grid-template-columns:minmax(0,1fr) minmax(0,1fr); gap:16px; max-width:680px; }
.resource-filter-row > label { min-width:0; }
.resource-filter-row select { min-height:36px; height:36px; padding:6px 12px; font-size:14px; }

.intro-actions:has(#resource-save-area) { align-items:flex-start; }
#resource-save-area > .primary-button { margin-top:0; }

[data-material-categories] .material-kind-used { font-weight: 700; }
[data-material-categories] .material-kind-unused { font-weight: 400; }

.lesson-resource-list > li { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.lesson-resource-list > li > form { display: inline-flex; width: auto; margin: 0; }
.lesson-resource-list > li > .quiet-link { min-width: 0; overflow-wrap: anywhere; }

.material-create-actions { display: flex; justify-content: flex-end; align-items: center; gap: 12px; }
.material-create-actions > button { margin: 0; }

.lesson-resource-list > li > .monthly-remove,
.lesson-resource-list > li > form > .monthly-remove {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 28px;
  width: 28px;
  height: 28px;
  padding: 0;
  margin: 0;
  line-height: 1;
  border-radius: 5px;
  box-shadow: none;
  vertical-align: middle;
}
.lesson-resource-list > li > form { align-items: center; padding: 0; flex: 0 0 auto; }
.lesson-resource-list .monthly-remove:hover { background: #f5f5f5; }

#teaching-material-picker > form + button { margin-top: 16px; }

.lesson-resource-list > li > .monthly-remove + form { margin-left: -8px; }

.asset-hover-preview { position: fixed; z-index: 10000; pointer-events: none; width: 260px; max-width: calc(100vw - 16px); padding: 12px; background: white; color: #222; border: 1px solid #ddd; border-radius: 10px; box-shadow: 0 6px 24px #0003; overflow-wrap: anywhere; }
.asset-hover-preview strong, .asset-hover-preview small { display: block; }
.asset-hover-preview small { color: #666; margin-top: 6px; font-size: 12px; }
.asset-hover-preview img { display: block; width: 100%; max-height: 180px; object-fit: contain; margin-top: 10px; }

[data-material-categories][hidden] { display: none; }

.lesson-status-emphasis { margin: 12px 0 18px; }
.lesson-status-emphasis .status-chip { font-size: 13px; padding: 9px 14px; border-width: 2px; color: var(--ink); background: #f1f1f1; font-weight: 800; }

.lesson-resource-kind { color: var(--muted); font-size: 12px; font-weight: 400; }

form > .resource-filter-submit { justify-self: end; margin-left: auto; }

.resource-attachment-row { display:flex; align-items:center; gap:8px; }
.resource-attachment-row > form { display:inline-flex; margin:0; width:auto; }

.resource-grade-checks { display:flex; flex-wrap:wrap; gap:12px; min-height:36px; align-items:center; margin-top:7px; }
.resource-grade-checks label { display:inline-flex; align-items:center; gap:5px; font-size:14px; }
.resource-grade-checks input { width:16px; height:16px; margin:0; }

.page-intro h1 .lesson-heading-subject { display: inline; margin-left: 16px; vertical-align: middle; }

.save-action-button { background: var(--accent) !important; color: #fff !important; border: 2px solid var(--ink); }
.save-action-button:hover { background: var(--accent-strong) !important; color: #fff !important; }

.monthly-programme, .monthly-programme th, .monthly-programme td,
.monthly-programme thead th, .monthly-programme th:first-child,
.monthly-programme tbody tr:hover td, .monthly-programme tbody tr td:hover,
.monthly-programme tbody tr th:hover { background: #fff; }
.monthly-attached-detail { flex: 1; min-width: 0; }
.monthly-attached-detail > summary { cursor: pointer; list-style: none; }
.monthly-attached-detail > summary::-webkit-details-marker { display: none; }
.monthly-attached-detail > summary:hover { text-decoration: underline; }
.monthly-lesson-description { white-space: pre-wrap; }

.timetable a.timetable-lesson, .timetable a.timetable-lesson:hover, .timetable a.timetable-lesson:focus, .timetable a.timetable-lesson * { text-decoration: none; }

.annual-goal-add { display:inline-flex; align-items:center; justify-content:center; width:32px; height:32px; color:var(--accent); font-size:24px; text-decoration:none; border-radius:var(--radius); }
.annual-goal-add:hover { background:var(--accent-wash); text-decoration:none; }

/* Action controls never underline their labels, in any interaction state. */
:is(button, [role="button"], .primary-button, .secondary-button, .quiet-button,
    .primary-link, .secondary-link, .table-action, .move-action),
:is(button, [role="button"], .primary-button, .secondary-button, .quiet-button,
    .primary-link, .secondary-link, .table-action, .move-action):is(:hover, :focus, :active),
:is(button, [role="button"], .primary-button, .secondary-button, .quiet-button,
    .primary-link, .secondary-link, .table-action, .move-action) * {
  text-decoration: none !important;
}

.lesson-title-row > input[type="checkbox"] { flex:none; width:16px; height:16px; margin-right:12px; }

[data-bulk-lessons] { display:flex; flex-wrap:wrap; gap:12px; align-items:center; }

[data-select-all-lessons][hidden] { display:none; }

[data-bulk-goal-options][hidden] { display:none; }

[data-lesson-content-form][hidden],
[data-lesson-content-view][hidden] { display: none !important; }
[data-content-saved] { color: #22643a; font-weight: 600; margin-bottom: 16px; }

.annual-goal-entry { padding: 4px 0; }
.annual-goal-label { color: inherit; text-decoration: none; }
.annual-goal-entry > .k1-goal-cta { width: fit-content; text-decoration: none; }

/* Shared lesson-status palette in detail pages and weekly timetables. */
:is(.lesson-status-emphasis, .timetable-lesson) .status-chip[data-status="planned"] {
  color: #1e40af; background: #eff6ff; border-color: #93b4ed;
}
:is(.lesson-status-emphasis, .timetable-lesson) .status-chip[data-status="taught"] {
  color: #6b21a8; background: #faf5ff; border-color: #c4a1e8;
}
:is(.lesson-status-emphasis, .timetable-lesson) .status-chip[data-status="completed"] {
  color: #166534; background: #f0fdf4; border-color: #86c99c;
}
:is(.lesson-status-emphasis, .timetable-lesson) .status-chip[data-status="skipped"] {
  color: #4b5563; background: #f3f4f6; border-color: #9ca3af;
}

.monthly-lesson-items > li:has(.monthly-attached-detail) { cursor: pointer; }

.monthly-shared-lesson { display:block; flex:1; color:inherit; text-decoration:none; padding:4px 0; }


.lesson-catalog-preview { border:2px solid var(--ink); border-radius:var(--radius-lg); box-shadow:var(--shadow-sm); background:var(--card); overflow:hidden; }
.lesson-catalog-preview > .table-wrap { border:0; border-radius:0; box-shadow:none; }
.lesson-catalog-preview > [data-expand-lessons] { display:block; margin:16px 16px 16px auto; }

.lesson-catalog-preview .table-wrap tbody tr td,
.lesson-catalog-preview .table-wrap tbody tr:hover td { background: var(--card); }
.lesson-catalog-preview tbody td a { color: inherit; text-decoration: none; }
.lesson-catalog-preview tbody td a:hover,
.lesson-catalog-preview tbody td a:focus-visible { color: var(--accent); text-decoration: none; }

.lesson-catalog-preview .lesson-row-number { width:56px; white-space:nowrap; font-variant-numeric:tabular-nums; }

.lesson-slide-track { display:flex; overflow-x:auto; scroll-snap-type:x mandatory; scrollbar-color:#171717 #ededed; scrollbar-width:auto; }
.lesson-slide-track::-webkit-scrollbar { height:10px; }
.lesson-slide-track::-webkit-scrollbar-track { background:#ededed; }
.lesson-slide-track::-webkit-scrollbar-thumb { background:#171717; border:2px solid #ededed; border-radius:6px; }
.lesson-slide-page { flex:0 0 100%; min-width:0; scroll-snap-align:start; border:0; border-radius:0; box-shadow:none; }
.lesson-slide-page table { min-width:0; table-layout:fixed; }
.lesson-slide-page th:first-child { width:56px; }
.lesson-slide-page th:last-child { width:30%; }
.lesson-slide-page td { overflow-wrap:anywhere; }
.lesson-slide-controls { display:flex; align-items:center; justify-content:flex-end; gap:12px; padding:16px; }
.lesson-slide-controls > span { margin-right:auto; }


.assessment-toolbar { display:flex; align-items:center; justify-content:space-between; gap:1rem; }
.assessment-scroll { overflow:auto; max-height:65vh; border:1px solid #ddd; border-radius:10px; }
.assessment-table { border-collapse:separate; border-spacing:0; width:100%; }
.assessment-table th,.assessment-table td { padding:14px; border-bottom:1px solid #ddd; border-right:1px solid #ddd; background:white; }
.assessment-table thead th { position:sticky; top:0; z-index:2; min-width:230px; background:#fff7f7; vertical-align:top; }
.assessment-table thead th p { font-weight:normal; text-transform:none; letter-spacing:normal; margin:.5rem 0 0; }
.assessment-table tr > :first-child { position:sticky; left:0; z-index:1; min-width:190px; text-align:left; background:white; }
.assessment-table thead tr > :first-child { z-index:3; background:#fff7f7; }
.assessment-options { display:flex; flex-wrap:wrap; gap:8px 12px; min-width:230px; }
.assessment-options label { display:flex; align-items:center; gap:5px; cursor:pointer; font-weight:normal; text-transform:none; letter-spacing:normal; }
.assessment-options input { width:13px; height:13px; margin:0; accent-color:#c81914; }
.assessment-options input:checked + span { color:#b51212; font-weight:700; }
.assessment-table tbody tr:hover td,.assessment-table tbody tr:hover th { background:white; }
[data-assessment-matrix] { width:100%; max-width:none; }
.assessment-note { margin-top:8px; }
.assessment-note summary { cursor:pointer; color:#666; font-size:13px; }
.assessment-note textarea { width:100%; min-width:0; margin-top:8px; font-size:14px; }
.assessment-required { display:block; color:#b51212; font-weight:700; width:100%; }
.assessment-table td.assessment-missing { box-shadow:inset 0 0 0 2px #c81914; }
textarea[readonly] { background:#f5f5f5; color:#555; }
button.assessment-saved,button.assessment-saved:disabled { background:#fff!important; color:#333!important; border-color:#222!important; opacity:1; }
.assessment-note.has-note summary { color:#a20f0f; font-weight:700; background:transparent; border:0; border-radius:0; padding:3px 0; width:fit-content; }
.assessment-note-count { display:block; width:fit-content; margin-top:6px; padding:2px 7px; border-radius:5px; color:#a20f0f; background:#fff1f1; font-size:12px; font-weight:600; }
.assessment-save-popup { width:min(400px,calc(100vw - 40px)); box-sizing:border-box; padding:26px; border:1px solid #e1d4a9; border-radius:14px; background:#fff; box-shadow:0 12px 40px #0003; text-align:center; }
.assessment-save-popup::backdrop { background:#0005; }
.assessment-save-popup h2 { margin:14px 0 10px; font-size:21px; }
.assessment-save-popup p { margin:0 0 22px; line-height:1.5; color:#555; }
.assessment-warning-triangle { display:inline-flex; align-items:center; justify-content:center; width:44px; height:40px; padding-top:9px; box-sizing:border-box; background:#f5c542; color:#483600; font-size:25px; font-weight:800; clip-path:polygon(50% 0,100% 100%,0 100%); }

.assessment-note summary:focus { outline:none; box-shadow:none; }
.assessment-note summary:focus-visible { text-decoration:underline; text-underline-offset:3px; }
.assessment-summary-wrap { overflow-x:auto; border:1px solid #ddd; border-radius:10px; background:white; }
.assessment-summary-wrap table { width:100%; border-collapse:separate; border-spacing:0; min-width:650px; }
.assessment-summary-wrap th,.assessment-summary-wrap td { padding:14px; border:0; border-right:1px solid #ddd; border-bottom:1px solid #ddd; background:white; font-size:14px; text-transform:none; letter-spacing:normal; vertical-align:middle; }
.assessment-summary-wrap thead th { background:#fff7f7; font-weight:700; text-align:center; }
.assessment-summary-wrap thead th:first-child,.assessment-summary-wrap tbody th { text-align:left; }
.assessment-summary-wrap tbody th { width:48%; font-weight:600; }
.assessment-summary-wrap tbody th p { margin:6px 0 0; font-weight:400; }
.assessment-summary-wrap td { text-align:center; font-variant-numeric:tabular-nums; }
.assessment-summary-wrap tr > :last-child { border-right:0; }
.assessment-summary-wrap tbody tr:last-child > * { border-bottom:0; }
.assessment-summary-wrap tbody tr:hover > * { background:white; }

form.monthly-filters, form[data-class-directory-filter] { max-width: none; }
@media (min-width: 701px) {
  .monthly-filters > .field-row,
  form[data-class-directory-filter] > .field-row:first-of-type { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

form:is([data-class-directory-filter], .monthly-filters, [data-catalog-filter], .programme-year-picker, .resource-filters) { gap: 12px; padding-top: 0; }
form:is([data-class-directory-filter], .monthly-filters, [data-catalog-filter], .programme-year-picker, .resource-filters) .field-row { gap: 12px; }
form:is([data-class-directory-filter], .monthly-filters, [data-catalog-filter], .programme-year-picker, .resource-filters) label { gap: 4px; }
form:is([data-class-directory-filter], .monthly-filters, [data-catalog-filter], .programme-year-picker, .resource-filters) .field-label {
  font-size: 11px; font-weight: 500; letter-spacing: 0; text-transform: none;
}
form:is([data-class-directory-filter], .monthly-filters, [data-catalog-filter], .programme-year-picker, .resource-filters) input:not([type="hidden"]):not([type="checkbox"]):not([type="radio"]),
form:is([data-class-directory-filter], .monthly-filters, [data-catalog-filter], .programme-year-picker, .resource-filters) select {
  height: 34px; min-height: 34px; padding: 5px 10px; font-size: 13px;
  font-weight: 400; border: 1px solid #d5d5d5; border-radius: 6px;
  background-color: #fff; box-shadow: none;
}
form:is([data-class-directory-filter], .monthly-filters, [data-catalog-filter], .programme-year-picker, .resource-filters) input:not([type="hidden"]):not([type="checkbox"]):not([type="radio"]):hover,
form:is([data-class-directory-filter], .monthly-filters, [data-catalog-filter], .programme-year-picker, .resource-filters) select:hover { border-color: #999; }
form:is([data-class-directory-filter], .monthly-filters, [data-catalog-filter], .programme-year-picker, .resource-filters) input:not([type="hidden"]):not([type="checkbox"]):not([type="radio"]):focus,
form:is([data-class-directory-filter], .monthly-filters, [data-catalog-filter], .programme-year-picker, .resource-filters) select:focus { border-color: var(--red); }

.timetable-lesson .status-chip::before, .lesson-catalog-preview .status-chip::before { content: none; }
.resource-filters .resource-grade-checks label { font-size: 13px; font-weight: 400; }

.brand-mark { width: 36px; height: 36px; min-width: 36px; flex-shrink: 0; font-size: 12px; line-height: 1; }



form[data-catalog-filter] { max-width: none; }
@media (min-width: 701px) {
  form[data-catalog-filter] > .field-row { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

.lesson-slide-controls > button.secondary-button,
.lesson-slide-controls > button.secondary-button:hover,
.lesson-slide-controls > button.secondary-button:active {
  border: 0; background: transparent; box-shadow: none; transform: none;
}
.lesson-slide-controls > button.secondary-button:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 2px;
}

.table-wrap.monthly-programme { border: 0; border-radius: 0; box-shadow: none; }
.monthly-programme table { border-collapse: collapse; }
.monthly-programme th, .monthly-programme td {
  border: 1px solid #d2d5d8; padding: .8rem; vertical-align: top;
}
.monthly-programme thead th, .monthly-programme tbody th {
  color: var(--ink); background: #fff; font-size: 14px;
  font-weight: 700; letter-spacing: 0; text-transform: none;
}
.monthly-programme tbody th small { display: block; font-size: 12px; font-weight: 400; margin-top: 6px; }
.monthly-programme .monthly-lesson-items li {
  border: 0; border-radius: 0; background: transparent; padding: .4rem 0;
  align-items: flex-start; margin-bottom: 8px;
}


form.resource-filters { max-width: none; width: 100%; }
form.resource-filters > .resource-filter-submit { justify-self: end; }
@media (min-width: 701px) {
  form.resource-filters { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 2fr); align-items: end; }
  form.resource-filters > .resource-filter-row { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; }
  form.resource-filters > .resource-filter-submit { grid-column: 1 / -1; }
  form.resource-filters .resource-grade-checks { min-height: 34px; align-items: center; }
}

.monthly-programme thead th:not(:first-child) { text-align: center; vertical-align: middle; }

.timetable-wrap { border-radius: 0; }
.week-switcher { gap: 16px; flex-wrap: wrap; }
.week-switcher .secondary-link { padding: 7px 12px; min-height: 34px; border: 1px solid #bfc3c7; border-radius: 6px; box-shadow: none; font-size: 13px; }
.week-switcher .secondary-link:hover { background: #f4f4f4; border-color: var(--ink); }

.k1-curriculum-frame { border: 0; border-radius: 0; box-shadow: none; overflow-x: auto; }
.k1-curriculum th, .k1-curriculum td,
.k1-curriculum th:first-child,
.k1-curriculum tbody tr:last-child > * {
  border: 1px solid #d2d5d8; padding: .8rem; background: #fff;
}
.k1-curriculum thead th {
  color: var(--ink); background: #fff; font-size: 14px; font-weight: 700;
  text-transform: none; letter-spacing: 0; text-align: center; vertical-align: middle;
}
.k1-curriculum tbody th { color: var(--ink); background: #fff; }

.lesson-catalog-preview, [data-resource-bank] > .table-wrap { border: 1px solid #d2d5d8; border-radius: 0; box-shadow: none; background: #fff; }
.lesson-catalog-preview .table-wrap th,
.lesson-catalog-preview .table-wrap td,
[data-resource-bank] .table-wrap th,
[data-resource-bank] .table-wrap td {
  border-bottom: 1px solid #d2d5d8; border-right: 1px solid #d2d5d8; background: #fff;
}
.lesson-catalog-preview .table-wrap th:last-child,
.lesson-catalog-preview .table-wrap td:last-child,
[data-resource-bank] .table-wrap th:last-child,
[data-resource-bank] .table-wrap td:last-child { border-right: 0; }
.lesson-catalog-preview .table-wrap thead th,
[data-resource-bank] .table-wrap thead th {
  color: var(--ink); background: #fff; font-size: 14px; font-weight: 700;
  letter-spacing: 0; text-transform: none;
}
.lesson-slide-controls > span { margin-right: 0; font-size: 13px; }
.lesson-slide-controls > button.secondary-button { font-size: 13px; }

.catalog-search-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; align-items: end; }
.catalog-goal-filters { display: flex; gap: 18px; align-items: center; min-height: 34px; flex-wrap: nowrap; }
.catalog-goal-filters label { display: inline-flex; flex: 0 0 auto; align-items: center; gap: 6px; font-size: 13px; white-space: nowrap; }
.catalog-goal-filters input[type="checkbox"] { width: 13px; height: 13px; min-width: 13px; flex: 0 0 13px; margin: 0; }
.lesson-slide-controls { padding: 6px 0; gap: 6px; }
.lesson-slide-controls > span, .lesson-slide-controls > button.secondary-button { font-size: 12px; }
.lesson-slide-controls > button.secondary-button { padding: 4px 8px; min-height: 28px; }
@media(max-width:700px) { .catalog-search-row { grid-template-columns: 1fr; } }

.catalog-add-lesson { justify-self: end; }
.catalog-create-choices { display: grid; gap: 10px; margin-bottom: 20px; }
#catalog-add-lesson { width: min(520px, calc(100vw - 40px)); max-height: 80vh; overflow-y: auto; }
.catalog-create-grade { border: 1px solid #d1d5db; border-radius: 6px; overflow: hidden; }
.catalog-create-grade > summary { padding: 14px 16px; font-weight: 700; cursor: pointer; }
.catalog-create-grade[open] > summary { background: #fff6f6; border-bottom: 1px solid #d1d5db; }
.catalog-create-subjects { display: grid; }
.catalog-create-subjects > a { padding: 12px 20px; color: #171717; text-decoration: none; }
.catalog-create-subjects > a + a { border-top: 1px solid #eee; }
.catalog-create-subjects > a:hover, .catalog-create-subjects > a:focus-visible { background: #fff6f6; color: #c71919; }

@media (min-width: 701px) { form.annual-filters > .field-row { grid-template-columns: repeat(4, minmax(0, 1fr)); } }

.programme-dialog.lesson-create-dialog { width: min(900px, 90vw); max-width: 100%; }
.lesson-create-dialog form { max-width: none; }

.lesson-add-options { display:flex; gap:12px; margin-bottom:20px; }
.lesson-add-options [aria-pressed="true"] { color:var(--accent); border-color:var(--accent); }
.lesson-bank-choices { max-height:360px; overflow:auto; }
.lesson-bank-choices label { display:flex; align-items:center; gap:10px; padding:12px 0; border-bottom:1px solid #d2d5d8; }
.lesson-bank-choices label[hidden] { display:none; }
.lesson-bank-choices input { width:13px; flex:0 0 13px; }
.lesson-bank-choices small { margin-left:auto; color:var(--muted); }

.lesson-catalog-preview td:has([data-delete-bank-lesson]) { position:relative; padding-right:45px; }
.lesson-catalog-preview td > form:has([data-delete-bank-lesson]) { position:absolute; right:12px; top:50%; transform:translateY(-50%); margin:0; padding:0; }

.subject-lesson-section > .k1-curriculum-frame { border:1px solid #d2d5d8; border-radius:0; box-shadow:none; background:white; }
.subject-lesson-section .subject-lesson-header { background:white; color:var(--ink); font-size:14px; font-weight:700; padding:16px; border-bottom:1px solid #d2d5d8; }
.subject-lesson-section .lesson-title-row { padding:16px; border-bottom:1px solid #d2d5d8; background:white; }
.subject-lesson-section .lesson-title-row:last-child { border-bottom:0; }
.subject-lesson-section .lesson-title-row h3 { font-size:13px; font-weight:400; margin:0; }

.annual-goal-entry > .k1-goal-cta, .k1-goal-link > .k1-goal-cta { display:inline-block; margin-top:0; margin-left:10px; vertical-align:baseline; white-space:nowrap; }

.subject-lesson-section > form[data-bulk-lessons] { display:inline-flex; width:auto; margin:0 0 0 12px; padding:0; vertical-align:middle; }

.subject-lesson-heading .subject-grade-label { display:inline; margin-left:16px; vertical-align:middle; font-size:10.5px; font-weight:800; letter-spacing:.1em; text-transform:uppercase; color:var(--muted); white-space:nowrap; }

.lesson-create-dialog [hidden] { display: none !important; }

.goal-lesson-number { display:inline-block; min-width:28px; margin-right:8px; font-variant-numeric:tabular-nums; }
.subject-lesson-section .lesson-title-row h3 { display:flex; align-items:baseline; gap:8px; }
.subject-lesson-section .goal-lesson-number { flex:0 0 28px; margin-right:0; }
.subject-lesson-section .k1-lesson-link { min-width:0; flex:1; }
#catalog-add-lesson select { border:1px solid #bfc3c9; }
#catalog-add-lesson select:focus, #catalog-add-lesson select:focus-visible { border-color:#73777f; outline:1px solid #73777f; outline-offset:1px; box-shadow:none; }
#catalog-add-lesson > label + label { margin-top:16px; }

.lesson-create-dialog select:focus, .lesson-create-dialog select:focus-visible { border-color:#73777f; outline:1px solid #73777f; outline-offset:1px; box-shadow:none; }
[data-catalog-filter] .resource-grade-checks { display:flex; flex-wrap:nowrap; align-items:center; gap:10px; min-height:34px; }
[data-catalog-filter] .resource-grade-checks label { display:inline-flex; flex:none; align-items:center; gap:4px; white-space:nowrap; font-size:13px; }
[data-catalog-filter] .resource-grade-checks input { width:14px; height:14px; margin:0; flex:none; }
.monthly-selection-dialog select[aria-label="Lọc trạng thái bài học"] { margin-top:12px; margin-bottom:8px; }

.timetable-lesson:has([data-subject="subject-english"]), [data-subject="subject-english"] { --subject-color:#0072b2; }
.timetable-lesson:has([data-subject="subject-phonics"]), [data-subject="subject-phonics"] { --subject-color:#d55e00; }
.timetable-lesson:has([data-subject="subject-math"]), [data-subject="subject-math"] { --subject-color:#e6b800; }
.timetable-lesson:has([data-subject="subject-art"]), [data-subject="subject-art"] { --subject-color:#aa4499; }
.timetable-lesson:has([data-subject="subject-pe"]), [data-subject="subject-pe"] { --subject-color:#009e73; }

@media (min-width: 800px) {
  form.resource-filters { grid-template-columns: minmax(0,1fr) minmax(0,1fr) minmax(0,3fr); }
  form.resource-filters > .resource-filter-row { max-width:none; grid-template-columns: minmax(0,1fr) minmax(0,1fr) minmax(0,1.25fr); }
}

@media (min-width: 800px) {
  form.resource-filters {
    grid-template-columns: repeat(4, minmax(0, 1fr)) max-content;
    align-items: start;
  }
  form.resource-filters > .resource-filter-row { display: contents; }
  form.resource-filters .resource-grade-checks {
    flex-wrap: nowrap;
    white-space: nowrap;
    gap: 8px;
    height: 34px;
  }
  form.resource-filters .resource-grade-checks label { flex: none; }
}

.timetable a.timetable-lesson { border-left:4px solid var(--subject-color, #737373); padding-left:10px; }
.timetable .timetable-subject { color:#171717; font-weight:700; }
.timetable-legend { display:flex; flex-wrap:wrap; gap:12px 24px; margin:20px 0; font-size:13px; }
.timetable-legend > span { display:inline-flex; align-items:center; gap:8px; }
.timetable-legend > span::before { content:""; width:4px; height:18px; background:var(--subject-color, #737373); flex:none; }
.teaching-viewer { width:min(1100px,94vw); max-width:94vw; }
.teaching-viewer .button-row { justify-content:flex-end; gap:12px; }
.teaching-file { display:block; margin:12px 0; }
.teaching-viewer [data-teaching-media] { display:block; width:100%; max-height:70vh; margin-top:16px; object-fit:contain; }
.teaching-viewer iframe { height:70vh; border:0; }
.teaching-viewer:fullscreen { background:white; overflow:auto; }

.status-chip[data-status="preparing"] { color:#92400e; background:#fffbeb; border-color:#d97706; }
.assessment-options label[hidden] { display:none; }
[data-participation] { display:block; margin-top:12px; max-width:100%; font-size:12px; }

.assessment-options label:has(input[value="insufficient"]) span { font-size:13px; }

.assessment-table select[data-participation] { width:170px; max-width:100%; min-height:28px; height:28px; padding:3px 8px; font-size:12px; font-weight:400; color:#666; border:1px solid #d1d5db; border-radius:4px; background:#fafafa; box-shadow:none; }
.assessment-table select[data-participation]:focus { outline:1px solid #9ca3af; outline-offset:1px; border-color:#9ca3af; }

.assessment-options input[type="radio"] { width:13px; height:13px; min-width:13px; min-height:13px; flex:0 0 13px; }

/* Keep all native selection controls at the requested size, including table overrides. */
html body input:is([type="radio"], [type="checkbox"]) { width:13px !important; height:13px !important; min-width:13px !important; min-height:13px !important; max-width:13px !important; max-height:13px !important; flex:0 0 13px !important; }

html body input[type="radio"] {
  appearance:none; -webkit-appearance:none; box-sizing:border-box;
  border:1px solid #aaa; border-radius:50%; background:#fff; padding:0;
}
html body input[type="radio"]:checked {
  background:radial-gradient(circle, #c62828 0 3px, transparent 3.5px);
}
html body input[type="radio"]:disabled { border-color:#ccc; background-color:#f7f7f7; }
html body input[type="radio"]:disabled:checked {
  background:radial-gradient(circle, #c4c4c4 0 3px, #f7f7f7 3.5px);
}
html body input[type="radio"]:focus-visible { outline:2px solid #c62828; outline-offset:2px; }

.assessment-options label, .assessment-options label span { font-size:13px; }

.assessment-table tbody th, .assessment-table tbody td { vertical-align:top; }
.assessment-note summary, .assessment-note.has-note summary { padding:3px 0; }

.student-directory-filters { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)) auto; gap:16px; align-items:end; }
.student-directory-filters label { font-size:12px; font-weight:400; letter-spacing:0; text-transform:none; }
.student-directory-filters select { min-width:0; width:100%; height:36px; padding:6px 10px; border:1px solid #d1d5db; border-radius:5px; font-size:13px; box-shadow:none; }
.student-directory-count { margin:24px 0 12px; color:#666; font-size:13px; }
.student-directory-table { overflow:auto; }
.student-directory-table table { min-width:800px; width:100%; }
.student-directory-table td { vertical-align:top; }
.student-directory-table th:nth-child(1) { width:23%; }
.student-directory-table th:nth-child(2) { width:13%; }
.student-directory-table th:nth-child(3) { width:17%; }
.student-directory-table th:nth-child(4) { width:22%; }
.student-note-text { white-space:pre-wrap; }
.student-profile-edit { margin-top:8px; font-size:13px; }
.student-profile-edit summary { color:#b51212; cursor:pointer; }
.student-profile-edit form { min-width:220px; padding-top:12px; }
@media(max-width:760px) { .student-directory-filters { grid-template-columns:1fr 1fr; } }
.student-directory-filters { max-width:none; }
.page-content-lower:has(.student-directory-filters) { gap:20px; }
.student-directory-count { margin:0; }
.student-directory-table td { padding:14px 16px; }
.student-profile-edit summary { padding:3px 0; font-weight:400; }
.student-directory-table td .student-profile-edit form { display:grid; gap:12px; padding-top:12px; }

.student-directory-filters { grid-template-columns:repeat(4,minmax(0,1fr)); }
.student-directory-table th:nth-child(1) { width:30%; }
.student-directory-table th:nth-child(2) { width:15%; }
.student-directory-table th:nth-child(3) { width:25%; }
.student-directory-table th:nth-child(4) { width:30%; }
@media(max-width:760px) { .student-directory-filters { grid-template-columns:1fr 1fr; } }

/* Student directory follows weekly planning's plain filters and grid. */
form.student-directory-filters { gap:12px; padding-top:0; }
form.student-directory-filters label { gap:4px; }
form.student-directory-filters .field-label { font-size:11px; font-weight:500; letter-spacing:0; text-transform:none; }
form.student-directory-filters select { height:34px; min-height:34px; padding:5px 10px; font-size:13px; font-weight:400; border:1px solid #d5d5d5; border-radius:6px; background:#fff; box-shadow:none; }
form.student-directory-filters select:hover { border-color:#999; }
form.student-directory-filters select:focus { border-color:var(--red); }
.student-directory-table .table-wrap { border:0; border-radius:0; box-shadow:none; }
.student-directory-table table { border-collapse:collapse; border:1px solid #d1d5db; }
.student-directory-table th, .student-directory-table td { border:1px solid #d1d5db; padding:14px 16px; background:#fff; }
.student-directory-table th { font-size:14px; font-weight:700; letter-spacing:0; text-transform:none; color:#171717; }
.student-directory-table tr:hover td { background:#fafafa; }
.student-report-filters { max-width:none; grid-template-columns:repeat(3,minmax(0,1fr)); }
.parent-report-preview { padding:20px; border:1px solid #ddd; }
.parent-report-preview textarea { display:block; width:100%; margin:12px 0; }
@media(max-width:700px) { .student-report-filters { grid-template-columns:1fr; } }

.student-profile-compact { display:flex; align-items:baseline; flex-wrap:wrap; gap:8px 24px; color:#666; font-size:13px; }
.student-profile-compact details { margin:0; }
.student-profile-compact summary { padding:0; font-size:13px; font-weight:400; }
.student-profile-compact form { min-width:260px; }

.student-report-filters { grid-template-columns:repeat(2,minmax(0,1fr)); }

.student-report-filters select:focus, .student-report-filters input:focus { border-color:#171717; outline:none; box-shadow:none; }
.student-report-filters select:focus-visible, .student-report-filters input:focus-visible { outline:1px solid #888; outline-offset:2px; }

.objective-subject-label { display:inline; margin-left:6px; font-weight:400; }

.assessment-exception-note { font-style:italic; color:#888; font-size:13px; }
td > .assessment-exception-note { display:block; }
.report-grid .table-wrap { border:0; border-radius:0; box-shadow:none; }
.report-grid table { width:100%; border-collapse:collapse; }
.report-grid th, .report-grid td { border:1px solid #d1d5db; padding:14px 16px; background:white; vertical-align:top; }
.report-grid th { font-size:14px; text-transform:none; letter-spacing:0; color:#171717; }
.parent-report-preview { border:1px solid #d1d5db; padding:20px; background:white; }
.parent-report-preview > h3 { margin:0 0 20px; padding-bottom:16px; border-bottom:1px solid #d1d5db; }

.parent-report-header { display:flex; justify-content:space-between; align-items:start; gap:24px; border-bottom:1px solid #d1d5db; padding-bottom:16px; margin-bottom:20px; }
.parent-report-header h3 { margin:0; }
.parent-report-school { display:grid; gap:4px; text-align:right; font-size:13px; }
@media(max-width:600px) { .parent-report-header { flex-direction:column; } .parent-report-school { text-align:left; } }

/* Student reports follow the monthly planning grid and compact controls. */
.page-content-lower:has(.student-report-filters) .table-wrap { border:0; border-radius:0; box-shadow:none; }
.page-content-lower:has(.student-report-filters) table { border-collapse:collapse; width:100%; }
.page-content-lower:has(.student-report-filters) th,
.page-content-lower:has(.student-report-filters) td { border:1px solid #d1d5db; padding:14px 16px; background:white; vertical-align:top; }
.page-content-lower:has(.student-report-filters) th { font-size:14px; text-transform:none; letter-spacing:0; color:#171717; }
.page-content-lower:has(.student-report-filters) .section-heading { border-bottom:0; padding-bottom:0; }
.student-report-filters { gap:16px; padding-top:0; }
.student-report-filters label { gap:4px; }
.student-report-filters .field-label { font-size:11px; font-weight:500; letter-spacing:0; text-transform:none; }
.student-report-filters select, .student-report-filters input:not([type=hidden]) { height:34px; min-height:34px; padding:5px 10px; font-size:13px; border:1px solid #d5d5d5; border-radius:6px; background:white; box-shadow:none; }
.support-guidance-note { color:#888; font-style:italic; font-weight:400; font-size:13px; }
.class-report-filters { grid-template-columns:repeat(3,minmax(0,1fr)); }
.class-results table { min-width:1000px; }
.class-results th:first-child { width:32%; }
.class-report-students { display:flex; flex-wrap:wrap; gap:12px 24px; }
.parent-report-preview form { max-width:none; padding-top:0; }
@media(max-width:700px) { .class-report-filters { grid-template-columns:1fr; } }
.page-content-lower:has(.student-report-filters) .table-wrap tbody tr:hover td { background:#fff; }
.page-content-lower:has(.student-report-filters) th { white-space:normal; }
[data-report-preview] table { table-layout:fixed; }
[data-report-preview] th:first-child { width:48%; }
[data-report-preview].report-grid th:first-child { width:42%; }
[data-report-preview].report-grid th:nth-child(2) { width:16%; }
[data-report-preview] td { overflow-wrap:anywhere; }
@media print {
 [data-report-preview] .lesson-slide-track { display:block; overflow:visible; }
 [data-report-preview] .lesson-slide-page { width:100%; }
 .lesson-slide-controls { display:none; }
}
.parent-report-preview form { margin-bottom:16px; gap:12px; }
.parent-report-preview .button-row { margin-top:12px; margin-bottom:12px; gap:8px; }
.parent-report-preview [data-copy-status] { display:block; margin-top:8px; color:#666; font-size:13px; }

.parent-report-actions { display:flex; align-items:center; gap:8px; margin-top:16px; }
.parent-report-export { position:relative; margin:0; }
.parent-report-export > summary { list-style:none; display:flex; align-items:center; gap:12px; margin:0; }
.parent-report-export > summary::-webkit-details-marker { display:none; }
.parent-report-export > summary::after { content:"▾"; font-size:11px; }
.parent-report-export-options { position:absolute; bottom:calc(100% + 8px); left:0; min-width:190px; z-index:5; padding:4px; background:#fff; border:1px solid #d1d5db; border-radius:6px; box-shadow:0 4px 14px #0002; }
.parent-report-export-options button { display:flex; align-items:center; justify-content:space-between; gap:16px; width:100%; padding:9px 12px; border:0; border-radius:3px; box-shadow:none; background:#fff; color:#171717; text-align:left; }
.parent-report-export-options button:hover:not(:disabled) { background:#f3f4f6; transform:none; }
.parent-report-export-options button:disabled { color:#888; cursor:not-allowed; opacity:1; }
.parent-report-export-options small { font-size:11px; font-weight:400; }

.learning-metrics { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); border:1px solid #d1d5db; background:#fff; }
.learning-metric { display:grid; gap:6px; padding:16px 20px; }
.learning-metric + .learning-metric { border-left:1px solid #d1d5db; }
.learning-metric-label { font-size:14px; font-weight:600; }
.learning-metric > strong { font-size:30px; line-height:1.2; color:#171717; }
.learning-metric > small { font-size:12px; color:#777; }
.learning-outcomes, .learning-pending { display:flex; flex-wrap:wrap; gap:8px 20px; margin-top:12px; font-size:13px; }
.learning-outcomes span { padding:5px 9px; border:1px solid #e0e0e0; border-radius:4px; }
.learning-pending { color:#777; }
.learning-pending:empty { display:none; }
@media(max-width:600px) {
 .learning-metrics { grid-template-columns:1fr; }
 .learning-metric + .learning-metric { border-left:0; border-top:1px solid #d1d5db; }
}

.outcome-not-yet { color:#c61b17; font-weight:600; }

.parent-note-status { color:#555; font-size:13px; }
.parent-note-status:empty { display:none; }

.parent-report-period { display:block; font-size:13px; font-weight:400; color:#666; margin-top:6px; }

.parent-report-export > summary[aria-disabled="true"] { color:#888; background:#f5f5f5; cursor:not-allowed; box-shadow:none; }
[data-save-required] { display:block; margin-top:8px; }
[data-save-required][hidden] { display:none; }

.parent-report-actions [data-copy-parent-report]:disabled,
.parent-report-actions [data-copy-parent-report]:disabled:hover {
  color:#888; background:#f5f5f5; cursor:not-allowed;
  box-shadow:none; transform:none; opacity:1;
}


.lesson-slide-track.has-visible-scrollbar { scrollbar-width:none; scroll-snap-type:none; }
.lesson-slide-track.has-visible-scrollbar::-webkit-scrollbar { display:none; }
input.lesson-slide-scrollbar { appearance:none; -webkit-appearance:none; display:block; width:100%; height:20px; min-height:0; padding:0; margin:0; border:0; border-radius:0; background:#fff; box-shadow:none; cursor:ew-resize; }
input.lesson-slide-scrollbar::-webkit-slider-runnable-track { height:8px; background:#ededed; border-radius:4px; }
input.lesson-slide-scrollbar::-webkit-slider-thumb { appearance:none; -webkit-appearance:none; width:48px; height:8px; background:#171717; border-radius:4px; }
input.lesson-slide-scrollbar::-moz-range-track { height:8px; background:#ededed; border-radius:4px; }
input.lesson-slide-scrollbar::-moz-range-thumb { width:48px; height:8px; border:0; background:#171717; border-radius:4px; }
input.lesson-slide-scrollbar:focus-visible { outline:2px solid #555; outline-offset:2px; }
@media print { .lesson-slide-scrollbar { display:none !important; } }

.resource-kind-dialog { width:min(420px,90vw); padding:24px; border:1px solid #ccc; border-radius:10px; background:white; color:#171717; }
.resource-kind-dialog::backdrop { background:rgb(0 0 0 / .25); }
.resource-kind-dialog button + button { margin-left:12px; }
.field-row:has([data-add-resource-kind]) { align-items:start; }
button[data-add-resource-kind] { display:block; margin-top:10px; padding:2px 0; }

.subject-lesson-header { display:flex; justify-content:space-between; gap:16px; }
.subject-lesson-section .lesson-objective-count { width:110px; text-align:center; flex-shrink:0; font-variant-numeric:tabular-nums; }

[data-monthly-inline-notice][hidden] { display:none; }
.subject-lesson-section .lesson-title-row h3 { flex:1; min-width:0; }

[data-monthly-inline-notice] { color:#b91c1c; border:1px solid #dc2626; background:#fff1f2; box-shadow:none; }
.monthly-fix-objectives { display:block; width:fit-content; margin-top:10px; padding:7px 12px; border:1px solid #b91c1c; border-radius:6px; color:#b91c1c; background:white; font-weight:600; }
form[id^="resource-edit-"] :is(input,select,textarea):is(:hover,:focus,:focus-visible) { background-color:#fff; border-color:#171717; box-shadow:none; outline-color:#666; }
form[id^="resource-edit-"] :is(input,select,textarea):focus:not(:focus-visible) { outline:none; }

/* Keep the lesson editor visibly inside its parent page. */
up-modal-viewport:has([data-lesson-content-form], .subject-lesson-section) { padding: 9vh 24px; }
up-modal-box:has(#main.workspace [data-lesson-content-form], #main.workspace .subject-lesson-section) { width: min(900px, 86vw); }
up-modal-box:has(#main.workspace [data-lesson-content-form], #main.workspace .subject-lesson-section) > up-modal-content { max-height: 82vh; overflow-y: auto; overscroll-behavior: contain; }
@media (max-width: 600px) {
  up-modal-viewport:has([data-lesson-content-form], .subject-lesson-section) { padding: 5vh 12px; }
  up-modal-box:has(#main.workspace [data-lesson-content-form], #main.workspace .subject-lesson-section) { width: 100%; }
  up-modal-box:has(#main.workspace [data-lesson-content-form], #main.workspace .subject-lesson-section) > up-modal-content { max-height: 90vh; }
}

.goal-lesson-actions { display:flex; justify-content:flex-end; align-items:center; gap:8px; margin-bottom:24px; }
.goal-lesson-actions > form[data-bulk-lessons] { display:flex; flex:none; width:auto; margin:0; padding:0; gap:0; }
.goal-lesson-actions > form[data-bulk-lessons] > span:empty { display:none; }
.subject-lesson-section .lesson-title-row > input[type="checkbox"] { order:3; margin:0; }
.subject-lesson-section:has(.goal-lesson-actions input[name="bulk"]) .subject-lesson-header { padding-right:48px; }

/* A lesson opened above its list leaves that parent overlay visible. */
up-modal:has(.subject-lesson-section) ~ up-modal up-modal-viewport:has([data-lesson-content-form]) { padding:14vh 24px; }
up-modal:has(.subject-lesson-section) ~ up-modal up-modal-box:has(#main.workspace [data-lesson-content-form]) { width:min(780px, 76vw); }
up-modal:has(.subject-lesson-section) ~ up-modal up-modal-box:has(#main.workspace [data-lesson-content-form]) > up-modal-content { max-height:72vh; }
@media (max-width:600px) {
  up-modal:has(.subject-lesson-section) ~ up-modal up-modal-viewport:has([data-lesson-content-form]) { padding:9vh 24px; }
  up-modal:has(.subject-lesson-section) ~ up-modal up-modal-box:has(#main.workspace [data-lesson-content-form]) { width:100%; }
  up-modal:has(.subject-lesson-section) ~ up-modal up-modal-box:has(#main.workspace [data-lesson-content-form]) > up-modal-content { max-height:82vh; }
}

/* Management reports: readable comparisons with direct paths to the records. */
[data-management-reports] { color:#20252a; }
.report-tabs { display:flex; gap:8px; border-bottom:1px solid #d9dfe2; margin:0 0 24px; flex-wrap:wrap; }
.report-tabs button { border:0; border-bottom:3px solid transparent; border-radius:0; background:white; padding:12px 16px; box-shadow:none; color:#57616b; font-weight:650; }
.report-tabs button[aria-current="page"] { border-bottom-color:#b91c1c; color:#b91c1c; }
.report-filter-grid { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:16px; }
.report-filter-grid label, .report-panel > label { display:flex; flex-direction:column; gap:6px; font-size:13px; color:#56616b; }
.report-filter-grid :is(select,input), .report-panel > label select { min-width:0; width:100%; padding:9px 10px; border:1px solid #c8cfd4; border-radius:6px; background:white; font-size:14px; color:#20252a; height:40px; }
.report-source-banner { background:#fff6df; border:1px solid #dbc17a; border-radius:8px; padding:14px 18px; line-height:1.6; font-size:14px; margin:20px 0; }
.report-source-note { color:#657078; font-size:13px; line-height:1.6; margin:18px 0; }
.report-action-strip { display:flex; align-items:center; justify-content:space-between; gap:16px; margin:20px 0; font-size:13px; }
.report-kpis { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:16px; margin:16px 0 24px; }
.report-kpi { border:1px solid #d9dfe2; border-radius:10px; padding:20px; display:flex; flex-direction:column; gap:10px; background:white; }
.report-kpi > span { color:#56616b; font-size:14px; }
.report-kpi strong { font-size:30px; line-height:1.15; letter-spacing:-.6px; }
.report-kpi small { color:#657078; font-size:12px; }
.report-panels { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:20px; }
.report-panel { padding:22px; border:1px solid #d9dfe2; border-radius:10px; margin-bottom:20px; background:#fff; min-width:0; }
.report-panel h2 { font-size:19px; margin:0 0 20px; }
.report-panel p { font-size:14px; color:#56616b; line-height:1.6; }
.report-panel small { font-size:12px; color:#657078; }
.report-wide { grid-column:1/-1; }
.report-line { width:100%; height:auto; min-height:190px; }
.report-line text { font-size:12px; fill:#56616b; }
.report-bars { display:grid; gap:17px; }
.report-bar-row { display:grid; grid-template-columns:minmax(95px,1.2fr) 2fr 48px; gap:12px; align-items:center; font-size:13px; }
.report-bar-track { height:12px; background:#f0f2f4; border-radius:3px; overflow:hidden; }
.report-bar-track i { display:block; height:100%; border-radius:3px; }
.report-bar-row b { text-align:right; }
.report-table-wrap { max-height:540px; overflow:auto; margin-top:16px; scrollbar-color:#333 #eee; }
.report-table-wrap table { width:100%; border-collapse:collapse; font-size:13px; }
.report-table-wrap th { position:sticky; top:0; background:#f5f7f8; z-index:1; }
.report-table-wrap :is(th,td) { padding:12px; border:1px solid #dce1e5; text-align:left; vertical-align:middle; }
.report-heat small { display:block; margin-top:5px; }
.report-text-button { border:0; padding:0; background:transparent; box-shadow:none; color:#b91c1c; text-align:left; }
.report-recommendations { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:14px; }
.report-recommendations button { display:flex; flex-direction:column; gap:12px; border:1px solid #e3d8d3; border-radius:8px; box-shadow:none; padding:18px; text-align:left; background:#fffdfa; color:#20252a; }
.report-recommendations span { font-size:13px; font-weight:400; color:#657078; line-height:1.6; }
.report-recommendations em { color:#aa3129; font-style:normal; font-size:13px; }
.report-method { padding:16px 0; font-size:13px; color:#657078; line-height:1.7; }
.report-empty { padding:32px 12px; text-align:center; color:#657078; }
@media(max-width:800px) { .report-filter-grid,.report-kpis { grid-template-columns:repeat(2,minmax(0,1fr)); }.report-panels { grid-template-columns:1fr; }.report-recommendations { grid-template-columns:1fr; } }
@media(max-width:450px) { .report-filter-grid,.report-kpis { grid-template-columns:1fr; }.report-panel { padding:14px; }.report-action-strip { align-items:flex-start; flex-direction:column; } }

/* Keep orientation in long weekly grids, with a separate compact overview. */
@media screen {
  .timetable-wrap { max-height:72vh; overflow:auto; }
  .timetable { border-collapse:separate; border-spacing:0; }
  .timetable thead th { position:sticky; top:0; z-index:2; background:white; }
  .timetable tbody th { position:sticky; left:0; z-index:1; background:white; }
  .timetable thead th:first-child { left:0; z-index:3; }
}
.timetable-overview-trigger { margin-left:auto; }
.week-overview-dialog { width:96vw; max-width:none; height:92vh; max-height:92vh; box-sizing:border-box; padding:20px; border:2px solid #171717; border-radius:12px; }
.week-overview-dialog[open] { display:flex; flex-direction:column; gap:16px; }
.week-overview-dialog::backdrop { background:rgb(0 0 0 / .45); }
.week-overview-toolbar { display:flex; align-items:center; gap:8px; flex-wrap:wrap; }
.week-overview-toolbar > strong { margin-right:auto; }
.week-overview-toolbar button { padding:8px 12px; }
.week-overview-toolbar output { min-width:45px; text-align:center; }
.week-overview-viewport { flex:1; min-height:0; overflow:auto; }
.week-overview-viewport .timetable { min-width:850px; }
.week-overview-viewport .timetable th,.week-overview-viewport .timetable td { padding:5px 8px; font-size:12px; }
.week-overview-viewport .timetable-lesson { gap:2px; padding:2px 0 2px 6px; }
.week-overview-viewport .timetable-lesson > small,.week-overview-viewport .timetable-lesson > strong { font-size:12px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; padding-right:0; }
.week-overview-viewport .timetable th small { margin-top:2px; }
.explorer-tools,.explorer-tabs,.explorer-filters,.explorer-pages {display:flex;gap:12px;align-items:end;flex-wrap:wrap;margin:18px 0;}
.explorer-tools > a {margin-left:auto;}
.explorer-layout {display:grid;grid-template-columns:210px minmax(0,1fr);gap:28px;}
.explorer-subjects {display:flex;flex-direction:column;gap:8px;align-self:start;position:sticky;top:80px;}
.explorer-subjects button {text-align:left;white-space:normal;}
.explorer-layout button {padding:9px 12px;box-shadow:none;border:1px solid #d2d5d8;border-radius:6px;background:white;}
.explorer-layout button.is-active {background:#fff1f1;border-color:#bd1717;color:#a00;font-weight:700;}
.explorer-filters label:first-child {flex:2;min-width:200px;}
.explorer-filters label {flex:1;min-width:140px;}
.explorer-main {min-width:0;}
.explorer-main td small {display:block;color:#666;margin-top:6px;}
.explorer-main td {vertical-align:top;}
.explorer-main td:nth-child(2) {width:45%;}
.explorer-summary {font-weight:600;}
.explorer-compare {display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px;}
.explorer-compare section {border:1px solid #ddd;padding:14px;border-radius:8px;}
.explorer-compare button {display:block;width:100%;margin:8px 0;text-align:left;}
.explorer-demo-dialog {max-width:600px;padding:28px;}
@media(max-width:700px){.explorer-layout{grid-template-columns:1fr;}.explorer-subjects{position:static;flex-direction:row;overflow:auto;}.explorer-subjects button{flex:0 0 150px;}.explorer-compare{grid-template-columns:1fr;}}
.weekly-subject-tabs {display:flex;flex-wrap:wrap;gap:8px;margin-bottom:14px;}
.weekly-subject-tabs button {padding:8px 12px;border:1px solid #ccc;border-radius:6px;box-shadow:none;}
.weekly-subject-tabs button[aria-pressed=true] {background:#fff1f1;border-color:#b71919;color:#a00;}
.weekly-subject-heading {font-size:16px;margin:0;padding:12px 8px;background:#f5f5f5;border-bottom:1px solid #ddd;}
.explorer-tools button {padding:9px 14px;border:1px solid #ccc;border-radius:6px;background:white;font-weight:600;}
.explorer-main .data-table td {padding:12px;line-height:1.4;font-size:14px;}
.explorer-main .data-table th {padding:12px;font-size:11px;letter-spacing:.03em;}
.explorer-main td form {padding:0;margin:6px 0 0;display:inline-block;float:right;}
.explorer-main td form button {padding:3px 6px;font-size:12px;}
.explorer-main td > button {border:0;padding:0;text-align:left;background:transparent;}

.skills-workspace{margin:24px 0;padding:24px;border:1px solid #ddd;border-radius:12px;background:#fff}.skills-workspace h2{margin:0 0 10px}.skills-workspace small{display:block;color:#666;margin-top:6px}.skills-actions{display:flex;gap:10px;align-items:center;justify-content:flex-end;margin:16px 0}.skills-workspace button,.skill-edit-dialog button{padding:8px 14px;background:white;border:1px solid #aaa;border-radius:7px;cursor:pointer}.skills-workspace button:hover{background:#f4f4f4}.skills-matrix{width:100%;min-width:720px}.skills-matrix td,.skills-matrix th{padding:14px;border:1px solid #ddd}.skill-phase{display:block;background:#edf5f1;padding:7px;border-radius:5px;color:#225b45}.topic-cards{display:grid;grid-template-columns:repeat(auto-fit,minmax(190px,1fr));gap:12px;margin:18px 0}.topic-cards button{text-align:left;min-height:80px}.topic-cards span{display:block;margin-top:8px}.topic-cards [aria-pressed=true]{border:2px solid #222;background:#f4f4f4}.skill-lesson{display:flex;justify-content:space-between;align-items:center;border-bottom:1px solid #ddd;padding:14px 0;gap:16px}.skill-lesson p{margin:6px 0}.skill-edit-dialog{width:min(600px,90vw);max-height:85vh;overflow:auto;padding:26px;border:2px solid #222;border-radius:12px}.skill-edit-dialog label{display:block;margin:14px 0}.skill-edit-dialog select,.skill-edit-dialog input,.skill-edit-dialog textarea{width:100%}.skills-workspace details{padding:12px;border-bottom:1px solid #ddd}.skills-workspace [role=status],.skill-edit-dialog [role=alert]{color:#b42318}

.topic-required-skills { display: grid; gap: 6px; margin: 10px 0; padding-top: 10px; border-top: 1px solid #ddd; }
.topic-required-skills > span { font-size: 14px; font-weight: normal; }

/* Shared annual outline and monthly pacing projection. */
.planner-filters .field-row{align-items:end}.planner-calendar{display:flex;align-items:center;gap:28px;margin:20px 0;color:#6e6863;font-size:13px}.planner-progress{width:210px;font-size:12px}.planner-progress>div{display:flex;justify-content:space-between;gap:10px}.planner-progress progress{width:100%;height:6px;accent-color:#387bbb}.planner-progress.is-complete progress{accent-color:#29835a}.planner-subjects{display:flex;gap:8px;flex-wrap:wrap;margin:20px 0}.planner-subjects label{display:flex;align-items:center;gap:7px;padding:8px 12px;border:1px solid #e4dfdb;border-radius:5px;font-size:13px}.planner-subjects label:has(:checked){background:#fff3f1;border-color:#d8aba5;color:#a32c24}.planner-tabs{display:flex;align-items:center;gap:20px;border-bottom:1px solid #e4dfdb;margin:20px 0}.planner-tabs form{margin-left:auto}.planner-tab{padding:12px 0!important;color:#312e2b!important}.planner-tab.active{border-bottom:2px solid #b82a24;color:#b82a24!important}.planner-total strong{font-size:25px;margin-right:8px}.planner-subject{margin:28px 0}.planner-subject h2{font-size:18px;margin-bottom:16px}.planner-outcome{border:1px solid #e5e1dd;margin-bottom:14px}.planner-outcome>summary{display:flex;align-items:center;gap:15px;background:#faf9f7;padding:18px;cursor:pointer;font-size:14px;font-weight:550}.planner-outcome>summary:before{content:'›';font-size:20px}.planner-outcome[open]>summary:before{content:'⌄'}.planner-outcome>summary small{margin-left:auto;white-space:nowrap;font-weight:400;color:#a42e25}.planner-lesson{display:grid;grid-template-columns:42px minmax(0,1fr) 220px;gap:15px;margin:0 20px 0 42px;padding:17px 0;border-bottom:1px solid #e6e2de}.planner-number{font-size:12px;color:#736e68}.planner-lesson a,.planner-sheet-lesson>a{font-weight:550}.planner-detail{white-space:pre-line;font-size:12px;line-height:1.6;color:#6d665f;margin:8px 0}.planner-assignments>div{display:grid;gap:6px}.planner-assignments>div>a{font-size:12px;background:#faf9f7;border:1px solid #e5e0db;border-radius:5px;padding:7px;font-weight:400}.planner-assignments details{margin-top:9px}.planner-assignments details summary{list-style:none}.planner-assignments details li{font-size:12px}.planner-add{display:inline-block;margin:12px 20px 12px 42px}.planner-sheet-scroll{overflow:auto;border:1px solid #e4dfdb}.planner-sheet{border-collapse:collapse;min-width:850px;width:100%;table-layout:fixed}.planner-sheet th,.planner-sheet td{border:1px solid #e4dfdb;vertical-align:top;padding:15px;width:210px}.planner-sheet th{background:#faf9f7;font-size:13px}.planner-sheet th:first-child{width:145px;position:sticky;left:0;z-index:1}.planner-sheet-lesson{margin-bottom:16px}.planner-sheet small{font-size:11px;font-weight:400}.planner-sheet details{font-size:12px}.pacing-saved-allocation{display:flex;align-items:center;justify-content:space-between;gap:15px;margin:8px 0}.pacing-saved-allocation form{margin:0}@media(max-width:700px){.planner-calendar{align-items:start;flex-direction:column;gap:12px}.planner-lesson{grid-template-columns:32px minmax(0,1fr);margin:0 12px;gap:10px}.planner-assignments{grid-column:2}.planner-outcome>summary{flex-wrap:wrap;padding:12px}.planner-tabs{gap:12px;flex-wrap:wrap}.planner-tabs form{margin-left:0}}
atlas-year-calendar{display:block}.year-holiday-row{display:grid;grid-template-columns:1fr 1fr 1fr 30px;gap:8px;align-items:center;margin:12px 0}.year-holiday-row input{min-width:0;width:100%}[data-calendar-count]{margin:18px 0;font-weight:550}@media(max-width:600px){.year-holiday-row{grid-template-columns:1fr 1fr}.year-holiday-row>label:first-child{grid-column:1/-1}}
.planner-metrics{display:grid;grid-template-columns:repeat(5,1fr);border-block:1px solid #e3ded8;padding:20px 0;gap:15px}.planner-metrics>div{border-right:1px solid #e3ded8;padding-right:15px}.planner-metrics>div:last-child{border:0}.planner-metrics span{display:block;font-size:12px;color:#6d665f;margin-bottom:10px}.planner-metrics strong{font-size:26px;margin-right:6px}.planner-metrics small{font-size:12px;color:#6d665f}.planner-from-week{display:flex;justify-content:flex-end;margin:12px 0}.planner-specific{margin:12px 42px;white-space:pre-line;color:#665e57;font-size:13px}@media(max-width:700px){.planner-metrics{grid-template-columns:repeat(2,1fr)}.planner-metrics>div{border:0}}
.planner-subject-heading{display:flex;align-items:baseline;justify-content:space-between;gap:15px}.planner-subject-heading>a{font-size:12px;font-weight:400}
.page-content-lower:has(>.planner-filters){gap:12px}.planner-filters,.planner-subjects,.planner-from-week{max-width:none;width:100%;padding-top:0}.planner-filters .field-row{grid-template-columns:2fr 1fr 1fr;max-width:850px}.planner-calendar{margin:8px 0}.planner-subjects{margin:12px 0}.planner-from-week{margin:0}.planner-tabs{margin:8px 0 16px}.planner-tab{text-decoration:none!important}.planner-filters input,.planner-filters select,.planner-from-week select,.planner-tabs select{border:1px solid #d7d1cb;box-shadow:none}.planner-subjects input{accent-color:#b82a24}@media(max-width:650px){.planner-filters .field-row{grid-template-columns:1fr 1fr}.planner-filters .field-row>label:first-child{grid-column:1/-1}}

/* Planner owns its layout, independent of the shared page/form defaults. */
.year-planner{display:grid;gap:16px;min-width:0;width:100%}
.year-planner>form{margin:0;padding:0;max-width:none;width:100%;gap:8px}
.year-planner .planner-filters .field-row{display:grid;grid-template-columns:minmax(180px,1.4fr) minmax(160px,1fr) minmax(100px,.65fr);max-width:760px;gap:16px}
.year-planner .planner-calendar{margin:0;gap:28px;padding:0 0 12px;border-bottom:1px solid #e4dfdb}
.year-planner .planner-subjects{display:flex;flex-wrap:wrap;gap:8px}
.year-planner .planner-subjects label{margin:0;white-space:nowrap;padding:8px 10px}
.year-planner .planner-from-week{display:flex;justify-content:flex-end}
.year-planner .planner-from-week .field{max-width:210px}
.year-planner .planner-metrics{padding:16px 0}
.year-planner .planner-tabs{margin:0;min-height:44px}
.year-planner .planner-tabs form{padding:0;width:auto;max-width:150px}
.year-planner .planner-subject{margin:8px 0 24px}
.year-planner .planner-subject-heading h2{margin:8px 0 12px}
@media(max-width:650px){.year-planner .planner-filters .field-row{grid-template-columns:1fr 1fr;gap:12px}.year-planner .planner-filters .field-row> :first-child{grid-column:1/-1}.year-planner .planner-calendar{flex-direction:row;flex-wrap:wrap;gap:12px}.year-planner .planner-from-week{justify-content:flex-start}.year-planner .planner-subjects label{white-space:normal}}
#programme-dialog fieldset{border:0;padding:0;margin:0;min-width:0}.year-subject-settings{border-top:1px solid #e4dfdb;padding-top:16px}.year-subject-settings h3{margin:0 0 12px}.year-subject-settings h4{font-size:14px;margin:20px 0 12px}.year-subject-options{display:grid;grid-template-columns:1fr 1fr;gap:12px}.year-subject-options label{display:flex;align-items:center;gap:8px;font-size:14px}.year-subject-options input{width:auto;accent-color:#b82a24}

/* Keep both navigation levels together, including wrapped mobile headers. */
.app-navigation{position:sticky;top:0;z-index:50;background:var(--nav)}
.app-navigation>.topbar{position:relative;top:auto}

.planner-capacity .planner-from-week{margin:10px 0 0;padding:0;display:block;width:100%;max-width:none}.planner-capacity .planner-from-week label{gap:4px}.planner-capacity .planner-from-week .field-label{font-size:10px;margin:0}.planner-capacity .planner-from-week select{font-size:11px;min-height:30px;padding:5px;width:100%}
form.weekly-context-filters{max-width:none;width:100%;padding:0;gap:12px}form.weekly-context-filters>.field-row:first-of-type{display:grid;grid-template-columns:1fr 1.2fr .65fr 1fr;gap:12px}.weekly-date-control{display:flex;gap:8px;align-items:center}.weekly-date-control button{min-height:38px}.week-picker-dialog{width:min(430px,90vw);padding:24px;border:1px solid #ddd;border-radius:12px}.week-picker-dialog::backdrop{background:#0006}.week-picker-dialog input{width:100%}.week-picker-list{display:grid;gap:8px;margin:16px 0}.week-picker-list button[aria-pressed=true]{border-color:#b82a24;color:#b82a24;background:#fff3f1}.week-switcher{display:none}@media(max-width:650px){form.weekly-context-filters>.field-row:first-of-type{grid-template-columns:1fr 1fr}}

/* Annual outcomes form one outline, with aligned disclosure and action columns. */
.year-planner .planner-outcome{border:0;border-top:1px solid #e8e5e2;margin:0;border-radius:0;box-shadow:none;background:transparent}
.year-planner .planner-outcome>summary{display:grid;grid-template-columns:16px minmax(0,1fr) auto auto;align-items:center;column-gap:12px;padding:16px 0 10px;background:transparent;list-style:none;line-height:1.5}
.year-planner .planner-outcome>summary::-webkit-details-marker{display:none}
.year-planner .planner-outcome>summary::before{content:'';display:block;box-sizing:border-box;width:7px;height:7px;border-right:1.5px solid #69635e;border-bottom:1.5px solid #69635e;transform:rotate(-45deg);justify-self:center;align-self:center}
.year-planner .planner-outcome[open]>summary::before{content:'';transform:rotate(45deg) translate(-1px,-1px)}
.year-planner .planner-outcome>summary>span:first-of-type{font-weight:550}
.year-planner .planner-outcome>summary small{color:#817a74;font-size:12px;margin:0;font-weight:400}
.year-planner .planner-outcome>summary>a{font-size:12px;font-weight:500;padding:4px 8px;justify-self:end}
.year-planner .planner-outcome>summary:hover{background:#fcfbfa}
.year-planner .planner-outcome>summary:focus-visible{outline:2px solid #b82a24;outline-offset:3px}
.year-planner .planner-add{margin:0 0 14px 28px;padding:4px 0;font-size:12px;font-weight:500}
.year-planner .planner-lesson{margin:0 0 0 28px;padding:14px 0;border-bottom:1px solid #f0eeeb}
.year-planner .planner-specific{margin:0 0 12px 28px}
@media(max-width:650px){.year-planner .planner-outcome>summary{grid-template-columns:16px minmax(0,1fr) auto;gap:8px}.year-planner .planner-outcome>summary small{grid-column:2;grid-row:2}.year-planner .planner-outcome>summary>a{grid-column:3;grid-row:1}.year-planner .planner-add,.year-planner .planner-lesson,.year-planner .planner-specific{margin-left:24px}}

/* Shared subject identity across year filters and weekly timetable. */
[data-subject="subject-science"],.timetable-lesson:has([data-subject="subject-science"]){--subject-color:#b65335}
[data-subject="subject-music"],.timetable-lesson:has([data-subject="subject-music"]){--subject-color:#6264b5}
.year-planner .planner-subjects label{border-color:#e3dfda;color:#38332f;background:white}
.year-planner .planner-subjects label:has(:checked){background:color-mix(in srgb,var(--subject-color,#737373) 9%,white);border-color:color-mix(in srgb,var(--subject-color,#737373) 35%,white);border-left-color:var(--subject-color,#737373);color:#38332f}
.year-planner .planner-subjects input{accent-color:var(--subject-color,#737373)}
.year-planner .planner-subjects label:focus-within{outline:2px solid var(--subject-color,#737373);outline-offset:2px}

/* One subject chip treatment for annual selection and weekly counts. */
.year-planner .planner-subjects .subject-chip,.timetable-legend .subject-chip{display:inline-flex;align-items:center;gap:8px;padding:8px 10px;border:1px solid color-mix(in srgb,var(--subject-color,#737373) 35%,white);border-radius:5px;background:color-mix(in srgb,var(--subject-color,#737373) 9%,white);color:#38332f;font-size:13px;line-height:20px;min-height:38px;box-sizing:border-box}
.year-planner .planner-subjects .subject-chip:not(:has(:checked)){background:white;border-color:#e3dfda}
.timetable-legend{gap:8px;margin:12px 0 20px}
.timetable-legend .subject-chip::before{content:none}
.timetable-legend .timetable-subject-count{font-size:12px;font-weight:500}

/* Normal controls: the current product default. */
:root{--control-border:#d7d1cb;--control-radius:6px}
body :is(.primary-button,.secondary-button,.primary-link,.secondary-link){min-height:40px;border-width:1px;border-radius:var(--control-radius);box-shadow:none;transform:none;font-size:13px;font-weight:600;line-height:20px;padding:9px 14px}
body :is(.primary-button,.primary-link){border-color:var(--accent)}
body :is(.secondary-button,.secondary-link){border-color:var(--control-border);background:#fff;color:var(--ink)}
body :is(.primary-button,.primary-link):hover{box-shadow:none;transform:none;background:var(--accent-strong)}
body :is(.secondary-button,.secondary-link):hover{box-shadow:none;transform:none;background:#f7f6f4;color:var(--ink);border-color:#a9a29c}
body :is(input:not([type=hidden]):not([type=checkbox]):not([type=radio]),select,textarea){min-height:40px;border:1px solid var(--control-border);border-radius:var(--control-radius);box-shadow:none;font-size:13px;line-height:20px;padding:9px 12px;background:white}
body :is(input,select,textarea,button,a):focus-visible{outline:2px solid var(--accent);outline-offset:2px}
body :is(input,select,textarea):focus{box-shadow:none}
body .field-label{font-size:12px;font-weight:500;letter-spacing:0;text-transform:none;line-height:18px}
body :is(button,input,select,textarea):disabled{opacity:.5;cursor:not-allowed}
.weekly-date-control{gap:8px}.weekly-date-control>select{width:auto;min-width:280px;flex:0 1 430px}
.weekly-date-control>button{flex:none;width:40px;padding:9px}

.timetable-legend label.subject-chip{cursor:pointer;margin:0}
.timetable-legend .subject-chip input{width:14px;height:14px;min-height:0;margin:0;accent-color:var(--subject-color,#737373)}
.timetable-legend .subject-chip:not(:has(:checked)){background:white;border-color:#e3dfda}
.timetable td>div[hidden]{display:none!important}

.assessment-label { display:inline-block; margin-left:10px; padding:2px 7px; border-radius:4px; background:#eef0fa; color:#4b4f92; font-size:11px; font-weight:600; }
.planner-specific { margin:0 0 16px 28px; max-width:80ch; color:#625e59; line-height:1.6; }

/* Keep calendar fields and the optional copy action on a consistent form rhythm. */
#programme-dialog atlas-year-calendar > label:first-child { display:block; margin-bottom:16px; }
#programme-dialog atlas-year-calendar > .field-row { margin:0 0 16px; align-items:start; }
#programme-dialog atlas-year-calendar .year-copy-option { display:flex; flex-direction:row; align-items:center; gap:10px; margin:0 0 20px; font-size:14px; }
#programme-dialog atlas-year-calendar .year-copy-option input { flex:0 0 16px; width:16px; height:16px; min-height:0; margin:0; padding:0; accent-color:#b82a24; }
#programme-dialog atlas-year-calendar .year-copy-option span { line-height:1.5; }

up-modal-box:has(.lesson-create-dialog) { width:min(820px, calc(100vw - 40px)); }
#programme-dialog.lesson-create-dialog { width:100%; max-width:820px; min-width:0; box-sizing:border-box; }
.lesson-create-dialog .lesson-outcome-context { margin:0 0 24px; padding:0 0 18px; border-bottom:1px solid #e4dfdb; }
.lesson-outcome-context small { color:#736d67; font-size:12px; }
.lesson-outcome-context h3 { margin:6px 0; font-size:17px; line-height:1.45; }
.lesson-outcome-context p { margin:6px 0 0; color:#625e59; line-height:1.55; }
.lesson-create-dialog form > label { display:block; margin:0 0 18px; }
.lesson-create-dialog textarea { width:100%; resize:vertical; }

atlas-lesson-weeks { display:block; }
atlas-lesson-weeks h3 { margin:0 0 12px; font-size:16px; }
.lesson-week-row { display:grid; grid-template-columns:minmax(0,1fr) 88px 32px; gap:12px; align-items:end; margin-bottom:12px; }
.lesson-week-row label { min-width:0; margin:0; }
.lesson-week-row input,.lesson-week-row select { width:100%; min-width:0; }
.lesson-week-row button { height:40px; padding:0; }
#programme-dialog .programme-edit-footer { display:flex; flex-direction:row; align-items:center; justify-content:flex-end; gap:12px; margin-top:20px; }
#programme-dialog.lesson-create-dialog form { display:flex; flex-direction:column; gap:16px; }
#programme-dialog.lesson-create-dialog form > label { margin:0; }
#programme-dialog.lesson-create-dialog .lesson-outcome-context { margin:0; padding-bottom:12px; }
#programme-dialog.lesson-create-dialog .programme-edit-footer { margin-top:4px; }
#programme-dialog.lesson-create-dialog > h2 { margin:0 0 20px; }
up-modal-box:has(.lesson-create-dialog) > up-modal-content { max-height:calc(100dvh - 48px); overflow-y:auto; }

.planner-subject-heading h2 { margin:0; }
.subject-entry-counts,.subject-plan-summary,.subject-heading-actions { display:flex; flex-wrap:wrap; align-items:center; gap:8px 20px; }
.subject-entry-counts { margin-top:6px; color:#706963; font-size:12px; }
.subject-plan-summary { padding:12px 0; border-bottom:1px solid #e4dfdb; font-size:13px; color:#625e59; }
.subject-plan-summary strong { color:#272421; }
.subject-plan-summary .is-taught strong { color:#29835a; }
.subject-plan-summary .is-unplanned strong { color:#94621b; }
.subject-plan-summary .is-over-quota { color:#b42318; font-weight:600; }
.subject-heading-actions { justify-content:flex-end; font-size:12px; }
@media(max-width:600px){.planner-subject-heading{align-items:flex-start;gap:12px}.subject-heading-actions{gap:8px;flex-direction:column;align-items:flex-end}}
.lesson-order-controls { display:flex; gap:2px; margin:6px 0 0; }
.lesson-order-controls button { width:24px; min-height:24px; padding:0; border:0; background:transparent; color:#706963; font-size:14px; }
.lesson-order-controls button:disabled { opacity:.25; }
.lesson-order-controls button:not(:disabled):hover { background:#f2eeea; }

/* Class execution is visible beneath each annual lesson. */
.lesson-class-implementations{display:grid;gap:8px;margin-top:12px}
.lesson-class-line{display:flex;align-items:baseline;flex-wrap:wrap;gap:8px 12px}
.planner-lesson .lesson-class-tag{display:inline-flex;align-items:center;padding:4px 9px;border:1px solid #dedbd7;border-radius:5px;background:#faf9f7;color:#393632;font-size:12px;font-weight:550;white-space:nowrap}
.lesson-class-line>small{color:#79736c;font-size:12px}
.lesson-class-sessions{display:flex;flex-wrap:wrap;gap:6px 12px}
.planner-lesson .lesson-class-session{font-size:12px;font-weight:400}

.lesson-allocation-overview{padding:10px 0;border-bottom:1px solid #e5e1dd;margin-bottom:12px;font-size:14px;font-weight:550}
.lesson-allocation-overview small{display:block;margin-top:4px;font-size:12px;font-weight:400;color:#736e68}
.lesson-week-overview{grid-column:1/-1;font-size:12px;color:#625d57;padding-bottom:8px}
.lesson-week-overview ul{margin:6px 0 0;padding-left:18px}
.lesson-week-overview small{display:block;margin-top:5px}

up-modal-box:has(.year-settings-dialog){width:min(920px,calc(100vw - 32px));max-width:920px}
up-modal-box:has(.year-settings-dialog)>up-modal-content{max-height:calc(100dvh - 48px);overflow-y:auto}
#programme-dialog.year-settings-dialog{width:100%;max-width:none;box-sizing:border-box}
.year-class-level{padding:12px 0;border-bottom:1px solid #e5e1dd}
.year-class-level h4{margin:0 0 8px}
.year-class-row{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr) 28px;gap:12px;align-items:end;margin-bottom:8px}
.year-class-row>label{margin:0}
.year-class-level>[data-add-class]{margin-top:4px}

.weekly-resource-picker[hidden], .weekly-resource-picker [hidden] { display:none!important; }
.weekly-resource-picker { display:grid; gap:12px; margin-top:20px; }

/* The overlay scrolls the entire weekly picker sheet, with no nested scrollers. */
.weekly-picker-viewport {
  position:fixed; inset:0; width:100%; height:100%; max-width:none; max-height:none;
  margin:0; padding:32px 16px; box-sizing:border-box; border:0; border-radius:0;
  background:transparent; overflow-y:auto; overscroll-behavior:contain;
}
.weekly-picker-sheet {
  width:min(800px,100%); margin:auto; padding:24px; box-sizing:border-box;
  border:1px solid var(--line); border-radius:12px; background:white;
}
.weekly-picker-sheet .monthly-lesson-choices { max-height:none; overflow:visible; }
.weekly-picker-sheet > form > button.primary-button { display:block; margin-left:auto; }
