/* Oaka Digital - admin/parent app styles.
   Layered on Bootstrap 5.3.3; only what Bootstrap doesn't already provide.
   Started small in Phase 0; this pass (visual/layout upgrade, "snazzy and
   pro on desktop and mobile") re-themes Bootstrap's own CSS variables where
   possible (cheapest, lowest-risk way to reshape every .card/.btn/.table/
   .badge/.form-control at once) and adds a small set of new component
   classes for the page-header band, the gate stepper, the attention list,
   the card grid toolbar, sticky panels and the credential-reveal panel. */

/* Design tokens (brand/neutral colours, radii, shadow, --oaka-font-sans)
   come from assets/css/tokens.css, linked in views/layout.php just before
   this file - see that file's own header for the full palette. tokens.css
   already re-points the neutral/body/border/card Bootstrap variables; this
   file only adds the admin/parent-specific remaps tokens.css deliberately
   leaves to the page-family stylesheets (build plan: "declares exactly two
   things - fonts and the :root palette - page-specific component classes
   belong in app.css/learner.css"): brand-colour buttons/links/focus rings,
   and the 10px admin/parent corner radius (learner pages get the pill
   radius instead, set by learner.css). */
:root {
  /* Local shorthand for the many rules below already written against it
     (stat tiles, toasts, review image, repeatable rows, …) - same 16px
     surface radius tokens.css defines as --oaka-radius-surface. */
  --oaka-radius: var(--oaka-radius-surface, 1rem);

  /* Re-point Bootstrap's primary/link colours at the brand so every
     .btn-primary, link, focus ring and .text-bg-primary follows without
     touching the vendored bootstrap.min.css. tokens.css doesn't set these
     (they're admin+parent specific - learner.css makes its own choice). */
  --bs-primary: var(--oaka-brand);
  --bs-primary-rgb: var(--oaka-brand-rgb);
  --bs-link-color: var(--oaka-brand);
  --bs-link-color-rgb: var(--oaka-brand-rgb);
  --bs-link-hover-color: var(--oaka-brand-dark);
  --bs-link-hover-color-rgb: 41, 1, 109;
  --bs-focus-ring-color: rgba(74, 4, 146, .25);

  /* A couple of neutral remaps tokens.css leaves unset. */
  --bs-heading-color: var(--oaka-text);
  --bs-tertiary-color: var(--oaka-muted);
  --bs-card-cap-bg: transparent;

  /* Corner radius scale for admin/parent buttons/inputs/alerts - 10px, per
     the shared design system ("16px surfaces, 10px admin buttons, pill on
     learner pages"). tokens.css's own --oaka-radius-admin is the single
     source for the 10px figure. */
  --bs-border-radius: var(--oaka-radius-admin, .625rem);
  --bs-border-radius-sm: .5rem;
  --bs-border-radius-lg: var(--oaka-radius-surface, 1rem);
  --bs-border-radius-xl: 1.25rem;
}
h1, h2, h3, h4, h5, h6 {
  font-weight: 800;
  letter-spacing: -.01em;
}
.h6 { font-weight: 700; letter-spacing: 0; } /* card/section titles stay readable at small size */

/* Inputs/selects are explicit surfaces (white) rather than inheriting
   --bs-body-bg, which is now the lavender PAGE colour, not a surface. */
.form-control,
.form-select,
.form-control-plaintext {
  background-color: var(--oaka-surface);
  color: var(--oaka-text);
}
.form-control::placeholder { color: var(--oaka-muted); opacity: 1; }

/* ---------------------------------------------------------- bootstrap --- */

.btn {
  font-weight: 600;
  letter-spacing: .005em;
}
.btn-primary {
  --bs-btn-bg: var(--oaka-brand);
  --bs-btn-border-color: var(--oaka-brand);
  --bs-btn-hover-bg: var(--oaka-brand-dark);
  --bs-btn-hover-border-color: var(--oaka-brand-dark);
  --bs-btn-active-bg: var(--oaka-brand-dark);
  --bs-btn-active-border-color: var(--oaka-brand-dark);
  --bs-btn-disabled-bg: var(--oaka-brand);
  --bs-btn-disabled-border-color: var(--oaka-brand);
  --bs-btn-focus-shadow-rgb: var(--oaka-brand-rgb);
}
.btn-outline-primary {
  --bs-btn-color: var(--oaka-brand);
  --bs-btn-border-color: var(--oaka-brand);
  --bs-btn-hover-bg: var(--oaka-brand);
  --bs-btn-hover-border-color: var(--oaka-brand);
  --bs-btn-active-bg: var(--oaka-brand-dark);
  --bs-btn-active-border-color: var(--oaka-brand-dark);
  --bs-btn-focus-shadow-rgb: var(--oaka-brand-rgb);
}
/* Lime is the accent: "done" states, success chips and the success button. */
.btn-success {
  --bs-btn-bg: var(--oaka-accent);
  --bs-btn-border-color: var(--oaka-accent);
  --bs-btn-color: #1b1b1b;
  --bs-btn-hover-bg: #86ad1b;
  --bs-btn-hover-border-color: #86ad1b;
  --bs-btn-hover-color: #1b1b1b;
  --bs-btn-active-bg: #78a018;
  --bs-btn-active-border-color: #78a018;
  --bs-btn-active-color: #1b1b1b;
  --bs-btn-focus-shadow-rgb: 149, 193, 30;
}
.btn-outline-success {
  --bs-btn-color: #4c6a0d;
  --bs-btn-border-color: var(--oaka-accent);
  --bs-btn-hover-bg: var(--oaka-accent);
  --bs-btn-hover-border-color: var(--oaka-accent);
  --bs-btn-hover-color: #1b1b1b;
  --bs-btn-active-bg: #86ad1b;
  --bs-btn-active-border-color: #86ad1b;
  --bs-btn-active-color: #1b1b1b;
  --bs-btn-focus-shadow-rgb: 149, 193, 30;
}
.btn-outline-secondary {
  --bs-btn-color: var(--oaka-muted);
  --bs-btn-border-color: var(--oaka-border);
  --bs-btn-hover-bg: var(--oaka-tint);
  --bs-btn-hover-border-color: #cfc6e6;
  --bs-btn-hover-color: var(--oaka-brand-dark);
  --bs-btn-active-bg: var(--oaka-tint);
  --bs-btn-active-color: var(--oaka-brand-dark);
}
.text-bg-primary, .bg-primary { background-color: var(--oaka-brand) !important; color: #fff !important; }
.text-bg-success, .bg-success { background-color: var(--oaka-accent) !important; color: #1b1b1b !important; }
.text-primary { color: var(--oaka-brand) !important; }
.form-control:focus, .form-select:focus {
  border-color: #a98ad2;
  box-shadow: 0 0 0 .25rem rgba(74, 4, 146, .25);
}
.form-check-input:checked { background-color: var(--oaka-brand); border-color: var(--oaka-brand); }
.form-check-input:indeterminate { background-color: var(--oaka-brand); border-color: var(--oaka-brand); } /* "Select all shown" when only some are ticked (23 Oct 2026) */
.form-check-input:focus { border-color: #a98ad2; box-shadow: 0 0 0 .25rem rgba(74, 4, 146, .25); }
.form-switch .form-check-input:checked { background-color: var(--oaka-brand); border-color: var(--oaka-brand); }
.nav-pills .nav-link.active { background-color: var(--oaka-brand); }
.page-link { color: var(--oaka-brand); }
.active > .page-link, .page-link.active { background-color: var(--oaka-brand); border-color: var(--oaka-brand); }

/* Badges: rounded pill chips everywhere (status pills, gate chips, counts) -
   colour is never the only signal, every one of these already carries a
   short label too. */
.badge {
  border-radius: var(--oaka-radius-pill);
  font-weight: 700;
  letter-spacing: .01em;
  padding: .38em .7em;
}
.badge.text-bg-light.border { color: var(--oaka-muted); border-color: var(--oaka-border) !important; }

/* Tables: quiet header, no zebra striping, a soft tint on row hover so a
   pointer/keyboard user always sees which row they are on without relying
   on the row border alone. */
.table {
  --bs-table-border-color: var(--oaka-border);
  --bs-table-hover-bg: var(--oaka-tint);
  --bs-table-hover-color: var(--oaka-text);
}
.table > thead > tr > th {
  font-size: .72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--oaka-muted);
  border-bottom-width: 2px;
}
.table > :not(caption) > * > * { padding-top: .6rem; padding-bottom: .6rem; }
.table-sm > :not(caption) > * > * { padding-top: .45rem; padding-bottom: .45rem; }

.alert { border-radius: var(--oaka-radius-admin, .625rem); border-width: 1px; }

code {
  background: var(--oaka-tint);
  color: var(--oaka-brand-dark);
  padding: .15em .4em;
  border-radius: .35em;
  font-size: .9em;
}

/* ---------------------------------------------------------------- brand --- */

/* Brand::icon()'s fallback is an inline SVG inheriting currentColor; a real
   logo file is an <img> that must not. Both occupy the same box so
   installing/swapping one never shifts the layout. Used wherever
   Brand::icon()/wordmark() render outside the nav (error.php, the bare
   login pages, parent_auth.php's problem screen). */
.brand-mark {
  width: 26px; height: 26px;
  object-fit: contain;
  flex: none;
  border-radius: 6px;
}
svg.brand-mark { color: var(--oaka-brand); }

.brand-wordmark {
  display: inline-block;
  font-weight: 700;
  font-size: 1.35rem;
  letter-spacing: -.01em;
  color: var(--oaka-brand);
}
img.brand-wordmark {
  width: auto; height: 64px;
  object-fit: contain;
}
.login-card { width: 100%; max-width: 26rem; padding: 0 1rem; }
/* The school trial form (22 Oct 2026: was a style="" the CSP blocked, so it showed at 26rem). */
.login-card--wide { max-width: 34rem; }

/* Sign-in page (26 Oct 2026, Harry: "too wordy ... we specialise in visual learners"): the ways in for someone new are
   picture tiles under the form, not sentences. */
.login-starts { display: grid; grid-template-columns: repeat(3, 1fr); gap: .6rem; }
.login-start {
  display: flex; flex-direction: column; align-items: center; gap: .3rem;
  padding: .9rem .4rem .8rem; text-align: center; text-decoration: none; color: var(--oaka-text);
  background: var(--oaka-surface); border: 1px solid var(--oaka-border);
  border-radius: var(--oaka-radius-surface); box-shadow: var(--oaka-shadow-soft);
  transition: border-color .15s ease, transform .15s ease, background-color .15s ease;
}
.login-start:hover, .login-start:focus-visible { border-color: var(--oaka-brand); background: var(--oaka-tint); color: var(--oaka-text); transform: translateY(-1px); }
.login-start-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 2.75rem; height: 2.75rem; border-radius: 50%; background: var(--oaka-tint); color: var(--oaka-brand);
}
.login-start:hover .login-start-icon, .login-start:focus-visible .login-start-icon { background: var(--oaka-surface); }
.login-start-title { font-weight: 800; font-size: .95rem; line-height: 1.2; }
.login-start-sub { font-size: .78rem; line-height: 1.25; color: var(--oaka-muted); }
.login-start--row { flex-direction: row; justify-content: flex-start; gap: .85rem; padding: .85rem 1rem; text-align: left; }
.login-start-text { display: flex; flex-direction: column; gap: .1rem; }
.login-more {
  display: block; padding: .55rem 1rem; border-radius: var(--oaka-radius-pill); font-size: .9rem; text-align: center;
  color: var(--oaka-brand); text-decoration: none;
}
.login-more svg { vertical-align: -3px; margin-left: .15rem; }
.login-more:hover, .login-more:focus-visible { background: var(--oaka-tint); color: var(--oaka-brand-dark); }
.login-admin { font-size: .75rem; color: var(--oaka-muted); text-decoration: none; }
.login-admin:hover, .login-admin:focus-visible { color: var(--oaka-brand); text-decoration: underline; }
@media (max-width: 359.98px) {
  .login-starts { grid-template-columns: 1fr; }
  .login-starts .login-start { flex-direction: row; gap: .75rem; padding: .7rem .9rem; text-align: left; }
  .login-starts .login-start-sub { margin-left: auto; }
}
.oaka-wordmark-purple { width: 120px; height: auto; object-fit: contain; }

/* Admin/parent navbar: dark purple gradient with light text; a thin lime
   rule underneath is the one deliberately large-ish lime element the brief
   allows (a rule, not a fill). data-bs-theme="dark" on the <nav> already
   flips Bootstrap's own toggler icon and nav-link colours; only the
   background/shape is ours. */
.oaka-nav {
  background: linear-gradient(120deg, var(--oaka-brand-dark) 0%, var(--oaka-brand) 100%);
  border-bottom: 3px solid var(--oaka-accent);
  box-shadow: 0 2px 14px rgba(20, 0, 56, .18);
}
.oaka-nav .navbar-brand, .oaka-nav .brand-wordmark, .oaka-nav svg.brand-mark { color: #fff; }
.oaka-nav .navbar-brand { gap: .55rem; }
.oaka-nav .brand-wordmark,
.oaka-nav img.brand-wordmark {
  height: 34px;
  width: auto;
  object-fit: contain;
}
.oaka-brand-suffix {
  font-weight: 800;
  font-size: 1.05rem;
  letter-spacing: -.01em;
  color: #fff;
  padding-left: .55rem;
  border-left: 1px solid rgba(255, 255, 255, .3);
}
.oaka-nav .nav-link {
  color: rgba(255, 255, 255, .82);
  font-weight: 600;
  border-radius: var(--oaka-radius-admin, .625rem);
  padding-inline: .75rem;
}
.oaka-nav .nav-link:hover, .oaka-nav .nav-link:focus-visible { color: #fff; background: rgba(255, 255, 255, .08); }
.oaka-nav .nav-link.active { color: #fff; background: rgba(255, 255, 255, .16); }
.oaka-user-chip {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  background: rgba(255, 255, 255, .12);
  border-radius: var(--oaka-radius-pill);
  padding: .35rem .6rem .35rem .9rem;
  color: #fff;
}
.oaka-user-chip .badge {
  background: var(--oaka-accent);
  color: #1b1b1b;
}
.oaka-nav .btn-outline-secondary {
  --bs-btn-color: #fff;
  --bs-btn-border-color: rgba(255, 255, 255, .55);
  --bs-btn-hover-bg: rgba(255, 255, 255, .16);
  --bs-btn-hover-border-color: #fff;
  --bs-btn-hover-color: #fff;
  --bs-btn-active-bg: rgba(255, 255, 255, .22);
  --bs-btn-active-color: #fff;
}

/* -------------------------------------------------------------- focus --- */

/* Bootstrap's own focus ring already covers form controls; this widens it
   to links, buttons and cards too, so keyboard users always see exactly
   where they are - colour is never the only signal (build plan §14). */
a:focus-visible,
button:focus-visible,
.nav-link:focus-visible,
.dashboard-card-link:focus-visible {
  outline: 3px solid var(--oaka-brand);
  outline-offset: 2px;
  border-radius: .25rem;
}

/* --------------------------------------------------------- touch targets --- */

/* Every tappable control is at least 44px tall on a phone - build plan §14.
   .btn-lg is the one used for the primary action on every form (sign in,
   update password, sign out, add learner). */
.btn-lg {
  min-height: 48px;
}

/* Main content: full-bleed on a phone, capped and centred on a wide
   desktop monitor - an un-capped .container-fluid stretching edge to edge
   on a large screen is exactly the "1990s" complaint being fixed here. */
main.container-fluid {
  max-width: 1400px;
  margin-inline: auto;
}

/* ------------------------------------------------------------ page header --- */

/* views/partials/page_header.php. A consistent title + status pill +
   right-aligned actions band, used at the top of most admin/parent pages
   in place of the ad-hoc d-flex header each one used to hand-roll. */
.page-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: .75rem 1rem;
  margin-bottom: 1.75rem;
}
.page-header-title {
  font-size: 1.5rem;
  margin-bottom: .15rem;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: .55rem;
}
.page-header-badge { vertical-align: middle; font-size: .7rem; }
.page-header-subtitle {
  color: var(--oaka-muted);
  font-size: .875rem;
  margin-bottom: 0;
}
.page-header-subtitle a { font-weight: 600; }
.page-header-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  align-items: center;
}

/* --------------------------------------------------------------- toolbar --- */

/* A single rounded bar holding filters or a compact set of related
   controls (the topics filter bar, the cards page's sort/reprocess row). */
.toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: .75rem 1rem;
  background: var(--oaka-surface);
  border: 1px solid var(--oaka-border);
  border-radius: var(--oaka-radius-pill);
  padding: .65rem 1.1rem;
  margin-bottom: 1.25rem;
  box-shadow: var(--oaka-shadow-soft);
}
.toolbar .form-label { margin-bottom: .15rem; }
.toolbar-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  margin-bottom: 1.25rem;
}

/* ----------------------------------------------------------------- admin --- */

.stat-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: .9rem;
}
@media (min-width: 576px) {
  .stat-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (min-width: 992px) {
  .stat-grid { grid-template-columns: repeat(4, 1fr); }
}
.stat-grid--3 { grid-template-columns: repeat(2, 1fr); }
@media (min-width: 576px) {
  .stat-grid--3 { grid-template-columns: repeat(3, 1fr); }
}

.stat-tile {
  display: flex;
  flex-direction: column;
  gap: .15rem;
  padding: 1rem 1.1rem;
  border: 1px solid var(--oaka-border);
  border-radius: var(--oaka-radius-surface);
  background: var(--oaka-surface);
  box-shadow: var(--oaka-shadow-soft);
  height: 100%;
  /* A left rail encodes state in form as well as colour. */
  border-left-width: 4px;
  border-left-color: var(--oaka-border);
  transition: transform .15s ease, box-shadow .15s ease;
}
.stat-tile--good { border-left-color: var(--oaka-accent); }
.stat-tile--warn { border-left-color: var(--bs-warning); }
.stat-tile--bad  { border-left-color: var(--bs-danger); }

a.dashboard-card-link .stat-tile,
.stat-tile-link .stat-tile { cursor: pointer; }
.dashboard-card-link:hover .stat-tile,
.dashboard-card-link:focus-visible .stat-tile {
  transform: translateY(-2px);
  box-shadow: 0 .6rem 1.4rem rgba(41, 1, 109, .14);
}

.stat-label {
  font-size: .6875rem;
  font-weight: 700;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--oaka-muted);
}

/* Small uppercase section headings (admin home's "Queue"/"Manage", the
   account page's "Change password"/"Your details"). CSP has no
   'unsafe-inline' for style-src, so this lives here rather than as a
   style="" attribute on the heading itself - see views/layout.php's header. */
.detail-label {
  letter-spacing: .07em;
}
.stat-value {
  font-size: 1.9rem;
  font-weight: 800;
  line-height: 1.1;
  color: var(--oaka-text);
  letter-spacing: -.02em;
}
.stat-sub { font-size: .74rem; color: var(--oaka-muted); }
.num { font-variant-numeric: tabular-nums; }

/* "Attention" list - admin home's compact list of things waiting on a
   human (cards awaiting review, audio awaiting review, WYON in review,
   dead jobs). Rows only render when their controller-supplied count is
   > 0 (see admin_index.php) - this is purely the shape. */
.attention-list {
  list-style: none;
  margin: 0;
  padding: 0;
  background: var(--oaka-surface);
  border: 1px solid var(--oaka-border);
  border-radius: var(--oaka-radius-surface);
  box-shadow: var(--oaka-shadow-soft);
  overflow: hidden;
}
.attention-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  padding: .8rem 1.1rem;
  border-bottom: 1px solid var(--oaka-border);
}
.attention-list li:last-child { border-bottom: none; }
.attention-list a { font-weight: 700; text-decoration: none; }
.attention-list a:hover { text-decoration: underline; }
.attention-list-count {
  font-variant-numeric: tabular-nums;
  font-weight: 800;
  color: var(--oaka-brand);
}
.attention-list-empty {
  padding: 1rem 1.1rem;
  color: var(--oaka-muted);
  font-size: .875rem;
}

/* Topic Card thumbnails (/admin/cards.php). Square corners: a rounded
   clip was tried in Phase 1b and looked unnatural against the printed
   card's own corner radius (Harry, 13 Sep 2026). */
.admin-card-thumb-wrap {
  overflow: hidden;
}
.admin-card-thumb {
  object-fit: contain;
}
.admin-card-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: .35rem;
}
.admin-card-position {
  max-width: 5rem;
}

/* The bulk-upload panel: a dashed, tinted panel so it reads as a distinct
   "drop zone"-styled area, even though the actual control underneath is a
   plain file input + button (no drag-and-drop behaviour - see
   admin_cards.php's own header). */
.dropzone-panel {
  border: 2px dashed #cfc2e8;
  border-radius: var(--oaka-radius-surface);
  background: var(--oaka-tint);
  padding: 1.1rem 1.25rem;
}
.dropzone-panel .form-control { background: var(--oaka-surface); }

.dashboard-card-link { text-decoration: none; color: inherit; }
.dashboard-card-link .card {
  transition: box-shadow .13s ease, border-color .13s ease, transform .13s ease;
}
.dashboard-card-link:hover .card,
.dashboard-card-link:focus-visible .card {
  border-color: #d9d0ee;
  box-shadow: 0 .6rem 1.4rem rgba(41, 1, 109, .14);
  transform: translateY(-2px);
}

@media (prefers-reduced-motion: reduce) {
  .dashboard-card-link .card,
  .stat-tile { transition: none; }
  .dashboard-card-link:hover .card,
  .dashboard-card-link:hover .stat-tile { transform: none; }
}

/* --------------------------------------------------------- gate stepper --- */

/* /admin/topic.php's Publish checklist - Content -> Audio -> WYON -> Quiz,
   as a vertical stepper with a connecting rail rather than a plain bullet
   list, so the four editorial gates read as one pipeline with a clear
   order. Each .gate-step wraps the same badge + text this list already
   rendered - no new data, just a shape for it. */
.gate-stepper {
  list-style: none;
  margin: 0 0 1.25rem;
  padding: 0;
}
.gate-step {
  position: relative;
  display: flex;
  gap: .85rem;
  padding-bottom: 1.15rem;
  padding-left: .1rem;
}
.gate-step:last-child { padding-bottom: 0; }
.gate-step-marker {
  flex: none;
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: .95rem;
  background: var(--oaka-tint);
  color: var(--oaka-muted);
  border: 2px solid var(--oaka-border);
  position: relative;
  z-index: 1;
}
.gate-step-met .gate-step-marker {
  background: var(--oaka-accent);
  border-color: var(--oaka-accent);
  color: #1b1b1b;
}
.gate-step:not(:last-child)::before {
  content: "";
  position: absolute;
  left: 1rem;
  top: 2rem;
  bottom: 0;
  width: 2px;
  background: var(--oaka-border);
  transform: translateX(-1px);
}
.gate-step-met:not(:last-child)::before { background: var(--oaka-accent); }
.gate-step-body { padding-top: .2rem; min-width: 0; }
.gate-step-title { font-weight: 700; margin-bottom: .1rem; }
.gate-step-detail { font-size: .82rem; color: var(--oaka-muted); }

/* ------------------------------------------------------- credential reveal --- */

/* The one-time username/password reveal (parent Add-learner, parent
   learner Reset password, admin Users create-admin/reset-learner) - a
   large lime-bordered panel so it reads as "written down now, shown once"
   rather than an ordinary success alert. Bootstrap's own .d-print-none /
   .d-print-block utilities (already vendored) do the print-hide work on
   the surrounding chrome; @media print below covers the app shell itself. */
.credential-reveal {
  border: 2px solid var(--oaka-accent) !important;
  background: #fbfdf4;
  border-radius: var(--oaka-radius-surface);
}
.credential-reveal .card-body { padding: 1.5rem; }
.credential-value {
  font-size: 1.4rem;
  font-weight: 800;
  letter-spacing: .02em;
  color: var(--oaka-brand-dark);
}

/* V1-F2 spreadsheet import: one cut-out slip per pupil (name, class,
   username, password, sign-in address) - a grid of small credential-reveal-
   style cards rather than one big panel, since there can be dozens of them.
   On screen: a responsive grid. In print (@media print below): a fixed
   2-per-row grid with a dashed "cut here" border, so a sheet of slips can
   actually be cut apart. */
.pupil-slip-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr));
  gap: 1rem;
}
.pupil-slip {
  border: 2px solid var(--oaka-accent);
  border-radius: var(--oaka-radius-admin);
  background: #fbfdf4;
  padding: .9rem 1rem;
  font-size: .85rem;
  break-inside: avoid;
}
.pupil-slip-name { font-weight: 800; margin-bottom: .15rem; }
.pupil-slip-class { color: var(--oaka-muted); margin-bottom: .5rem; }
.pupil-slip-row { display: flex; justify-content: space-between; gap: .5rem; }
.pupil-slip-row + .pupil-slip-row { margin-top: .2rem; }
.pupil-slip-value { font-family: var(--bs-font-monospace, monospace); font-weight: 700; }

/* A copyable identifier (learner username chips, admin-created credentials)
   - monospace in a soft tinted pill so it reads as "data", not prose. */
.mono-chip {
  display: inline-flex;
  align-items: center;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  background: var(--oaka-tint);
  color: var(--oaka-brand-dark);
  border-radius: var(--oaka-radius-admin, .625rem);
  padding: .25em .55em;
  font-size: .92em;
}

/* Initials avatar circle - parent dashboard learner cards. */
.avatar-circle {
  flex: none;
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 50%;
  background: var(--oaka-brand);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 1.05rem;
  letter-spacing: .02em;
}

/* Learner cards on the parent dashboard, and progress-bar cells on the
   learner detail page. */
.learner-card {
  display: flex;
  align-items: center;
  gap: .85rem;
  padding: .9rem 1rem;
  border: 1px solid var(--oaka-border);
  border-radius: var(--oaka-radius-surface);
  background: var(--oaka-surface);
}
/* Per-topic progress bars (/parent/learner.php) - a native <progress>
   element rather than a hand-rolled div pair, so the percentage is a real
   HTML attribute (value/max) and never needs an inline style="" to set a
   dynamic width (CSP: style-src 'self', no unsafe-inline). Cross-browser
   styling of <progress> needs both the WebKit/Blink and Firefox
   pseudo-elements - there is no standard third way. */
.progress-cell { min-width: 7rem; }
.oaka-progress {
  appearance: none;
  -webkit-appearance: none;
  display: block;
  width: 100%;
  height: .5rem;
  margin-top: .3rem;
  border: none;
  border-radius: var(--oaka-radius-pill);
  overflow: hidden;
  background: var(--oaka-tint); /* Firefox track */
}
.oaka-progress::-webkit-progress-bar {
  background: var(--oaka-tint);
  border-radius: var(--oaka-radius-pill);
}
.oaka-progress::-webkit-progress-value {
  background: var(--oaka-brand);
  border-radius: var(--oaka-radius-pill);
  transition: width .2s ease;
}
.oaka-progress::-moz-progress-bar {
  background: var(--oaka-brand);
  border-radius: var(--oaka-radius-pill);
}
.oaka-progress--done::-webkit-progress-value { background: var(--oaka-accent); }
.oaka-progress--done::-moz-progress-bar { background: var(--oaka-accent); }
@media (prefers-reduced-motion: reduce) {
  .oaka-progress::-webkit-progress-value { transition: none; }
}
.learner-card-info { flex: 1 1 12rem; min-width: 12rem; }

/* A few one-off width caps that used to be inline style="" attributes
   (CSP: style-src 'self', no unsafe-inline - same rule as .proposal-field-
   col/.table-header-sm above) - /admin/cards.php's file input and
   /admin/topic.php's sort-order number field. */
.w-file-input { max-width: 26rem; }
.w-sort-order { max-width: 8rem; }

/* ---------------------------------------------------------------- toast --- */

/* Built by assets/js/app.js's window.oaka.toast(). aria-live is set on the
   host in JS, not here, since it must exist before the first toast appends
   to it. */
.oaka-toast-host {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  z-index: 1080;
  display: flex;
  flex-direction: column;
  gap: .5rem;
  max-width: min(22rem, calc(100vw - 2rem));
}
.oaka-toast {
  background: var(--oaka-surface);
  border: 1px solid var(--oaka-border);
  border-left: 3px solid var(--oaka-brand);
  border-radius: var(--oaka-radius-admin, .625rem);
  box-shadow: 0 .5rem 1.5rem rgba(0, 0, 0, .12);
  padding: .6rem .85rem;
  font-size: .85rem;
  opacity: 1;
  transform: translateY(0);
  transition: opacity .25s ease, transform .25s ease;
}
.oaka-toast--out { opacity: 0; transform: translateY(6px); }
.oaka-toast--good { border-left-color: var(--bs-success); }
.oaka-toast--bad  { border-left-color: var(--bs-danger); }

@media (prefers-reduced-motion: reduce) {
  .oaka-toast { transition: none; }
}

/* ------------------------------------------------------- card review (Gate 1) --- */

/* /admin/card.php - build plan §13.3, §14. Mobile-first: a single column by
   default (image above the form), a two-column grid from the point a
   tablet-ish viewport has room for both without squeezing either - chosen
   as a plain CSS grid rather than Bootstrap's row/col so the review page's
   own rules stay self-contained here, next to the other classes it owns. */
.review-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
  align-items: start;
}
@media (min-width: 992px) {
  .review-grid { grid-template-columns: minmax(300px, 38%) 1fr; }
}

/* The card image: a plain click/Enter/Space toggle (admin-review.js) swaps
   the height cap for "none" rather than opening a lightbox overlay - simpler
   markup, no positioning math, and it never needs a close button because
   the same control re-shrinks it. Sticky on desktop, so the image stays in
   view while the form to its right scrolls. */
.review-image {
  cursor: zoom-in;
  overflow: hidden;
  border: 1px solid var(--oaka-border);
  border-radius: var(--oaka-radius-surface);
  background: var(--oaka-tint);
  display: flex;
  justify-content: center;
  /* flex-start, not the default stretch: a stretched <img> flex item is
     resized to the box and loses its aspect ratio (16 Sep 2026 - the card
     looked squashed). The height cap lives on the image itself below. */
  align-items: flex-start;
  box-shadow: var(--oaka-shadow-soft);
}
@media (min-width: 992px) {
  .review-image:not(.is-large) {
    position: sticky;
    top: 5.5rem; /* clears the sticky nav */
  }
}
.review-image img {
  max-width: 100%;
  max-height: 55vh;
  width: auto;
  height: auto;
  object-fit: contain;
  display: block;
}
.review-image.is-large {
  cursor: zoom-out;
}
.review-image.is-large img {
  max-height: none;
}

/* One key-term or testable-fact row (admin-review.js clones these from a
   <template> of the same markup - see admin_card.php's header). */
.repeatable-row {
  border: 1px solid var(--oaka-border);
  border-radius: var(--oaka-radius-admin, .625rem);
  padding: .75rem;
  margin-bottom: .75rem;
  background: var(--oaka-surface);
}
.repeatable-row:last-child { margin-bottom: 0; }

/* The sticky bottom action bar (mobile only) that holds Save/Approve on
   the card-review form, so the primary actions stay reachable without
   scrolling back up a long form. */
@media (max-width: 767.98px) {
  .sticky-actions {
    position: sticky;
    bottom: 0;
    z-index: 5;
    background: var(--oaka-surface);
    border-top: 1px solid var(--oaka-border);
    margin: 1rem -1rem 0;
    padding: .75rem 1rem calc(.75rem + env(safe-area-inset-bottom, 0px));
    box-shadow: 0 -.4rem 1rem rgba(41, 1, 109, .08);
  }
  .sticky-actions .btn { flex: 1 1 auto; }
}

/* The "a fresh proposal exists" panel shown above the form when
   extraction_json.pending is true (build plan §13.3's re-extract diff).
   Amber, not red or green - it is neither an error nor a completed action,
   just something waiting on a decision. */
.proposal-panel {
  border: 1px solid var(--bs-warning-border-subtle, #ffe69c);
  background: var(--bs-warning-bg-subtle, #fff3cd);
  border-radius: var(--oaka-radius-surface);
  padding: 1rem 1.25rem;
  margin-bottom: 1.5rem;
}
.proposal-panel pre {
  white-space: pre-wrap;
  word-break: break-word;
  margin: 0;
  font-size: .8125rem;
  max-height: 14rem;
  overflow-y: auto;
}
/* Shrink the "Field" column to its content (the classic width:1% +
   nowrap table trick) so the two value columns split the rest evenly -
   done in CSS rather than a per-cell style="" attribute (CSP: style-src
   'self', no unsafe-inline; see views/layout.php's header for the same
   rule biting a style="" attribute once before, in Phase 0). */
.proposal-field-col {
  width: 1%;
  white-space: nowrap;
}

/* /admin/jobs.php's table headers and inline status filter - found as real
   style="" CSP violations during Phase 3 integration (style-src 'self', no
   unsafe-inline; same rule as .proposal-field-col above and .detail-label
   from Phase 0) and replaced with these two classes instead. */
.table-header-sm { font-size: .72rem; }
.select-inline { width: auto; }

/* ------------------------------------------------- WYON review (Gate 3) --- */

/* /admin/wyon.php - build plan §13.5.4, §14; Phase 5. One row per
   candidate/approved/rejected item, grouped under its source card's own
   heading in the template. Kept visually close to .repeatable-row (Gate 1's
   own per-row card) rather than inventing a new shape, since both are "one
   editable unit of AI output in a list of many". */
.wyon-row {
  border: 1px solid var(--oaka-border);
  border-radius: var(--oaka-radius-surface);
  padding: .9rem 1.1rem;
  margin-bottom: .85rem;
  background: var(--oaka-surface);
  box-shadow: var(--oaka-shadow-soft);
}
.wyon-row-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .5rem;
  margin-bottom: .5rem;
}
.wyon-issues {
  padding-left: 1.1rem;
  color: var(--bs-danger);
}
.wyon-distractor-row {
  display: flex;
  gap: .5rem;
  align-items: center;
  margin-bottom: .4rem;
}
.wyon-distractor-row .form-control { flex: 1 1 auto; }

/* The "View source" side panel - a plain toggled-visibility panel (JS flips
   the `hidden` attribute, never inline style="", per views/layout.php's own
   CSP note) rather than a modal/dialog: no backdrop, no focus trap beyond
   moving focus to its close button on open and back to the trigger on
   close (admin-wyon.js), so Tab still reaches the rest of the page if a
   keyboard user chooses to move past it. Docked to the right of the
   viewport on wide screens; a plain block above the content on narrow ones
   (build plan §14: side gutter and no horizontal scroll matter here too,
   even though this is an admin-only page). */
.wyon-source-panel {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(26rem, 100vw);
  overflow-y: auto;
  background: var(--oaka-surface);
  border-left: 1px solid var(--oaka-border);
  box-shadow: -.5rem 0 1.5rem rgba(0, 0, 0, .12);
  padding: 1rem 1.25rem;
  z-index: 1075;
}
@media (max-width: 575.98px) {
  .wyon-source-panel {
    position: static;
    width: auto;
    box-shadow: none;
    border: 1px solid var(--oaka-border);
    border-radius: var(--oaka-radius-surface);
    margin-bottom: 1rem;
  }
}
.wyon-source-image {
  max-width: 100%;
  height: auto;
  border: 1px solid var(--oaka-border);
  border-radius: var(--oaka-radius-admin, .625rem);
  margin-bottom: .75rem;
  display: block;
}

/* --------------------------------------------- Quiz admin (Test), Phase 6 --- */

/* /admin/quizzes.php + /admin/quiz.php - build plan §13.6.1 point 6. One
   card per question (admin_quiz.php), one row per choice inside it; kept
   deliberately close to .wyon-row's own shape above rather than inventing
   a new visual language for what is structurally the same kind of page
   (an editorial list of AI/import-sourced items, reviewed and corrected by
   hand). */
.quiz-admin-question {
  scroll-margin-top: 5.5rem; /* the per-question #q<id> redirect target lands
                                 just below the fixed top bar, not under it */
}
.quiz-admin-choice-row .form-control {
  flex: 1 1 auto;
}
.quiz-admin-choice-thumb {
  width: 2.5rem;
  height: 2.5rem;
  object-fit: contain;
  border: 1px solid var(--oaka-border);
  border-radius: var(--oaka-radius-admin, .625rem);
  background: var(--oaka-surface);
}
.quiz-admin-pending-image {
  white-space: nowrap;
}
.quiz-admin-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
}
.quiz-admin-import-form .form-select {
  max-width: 32rem;
}
.quiz-admin-summary {
  line-height: 1.5;
}

/* ------------------------------------------------- Audio review (Gate 2) --- */

/* /admin/card.php's audio panel and /admin/pronunciations.php's tester -
   build plan §13.4.2/§13.4.3, §14; Phase 4. Kept close to the existing
   review-page language (.repeatable-row, .proposal-panel above) rather than
   inventing new chrome for what is, structurally, one more "AI output
   reviewed by a human" panel. */
.audio-panel audio {
  width: 100%;
}
.audio-script-sent {
  font-size: .9rem;
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-word;
  padding: .75rem;
  background: var(--bs-tertiary-bg);
  border: 1px solid var(--oaka-border);
  border-radius: var(--oaka-radius-admin, .625rem);
}
/* The substituted span inside .audio-script-sent - what Tts\Pronunciation
   actually sent to ElevenLabs in place of the card's own wording. */
mark.pron-sub {
  background: var(--bs-warning-bg-subtle, #fff3cd);
  color: inherit;
  padding: 0 .15em;
  border-radius: .2em;
}

/* ------------------------------------------------- catalogue (admin) --- */

/* /admin/topics.php's key-stage tabs + subject chips - Sep 2026 catalogue
   pass, owner request 3 ("navigating and filtering topics must be
   clearer"). Same class names, same behaviour (plain links, ?ks=/
   ?subject=) as the learner catalogue's own .catalogue-tabs/.catalogue-chips
   in learner.css; admin pages never load that file, so the admin-styled
   version lives here instead - 10px radius throughout (this design
   system's admin/learner distinction), not the learner surface's pill. */
.catalogue-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
  margin-bottom: .65rem;
}
.catalogue-tab {
  display: inline-flex;
  align-items: center;
  padding: .4rem .85rem;
  border-radius: var(--oaka-radius-admin, .625rem);
  font-weight: 700;
  font-size: .84rem;
  text-decoration: none;
  color: var(--oaka-text);
  background: var(--oaka-surface);
  border: 1px solid var(--oaka-border);
}
.catalogue-tab:hover, .catalogue-tab:focus-visible {
  color: var(--oaka-text);
  border-color: var(--oaka-brand);
}
.catalogue-tab.is-active {
  color: #fff;
  background: var(--oaka-brand);
  border-color: var(--oaka-brand);
}
.catalogue-chips {
  display: flex;
  flex-wrap: wrap;
  gap: .35rem;
  margin-bottom: 1rem;
}
.catalogue-chip {
  display: inline-flex;
  align-items: center;
  padding: .25rem .7rem;
  border-radius: var(--oaka-radius-admin, .625rem);
  font-weight: 600;
  font-size: .76rem;
  text-decoration: none;
  color: var(--oaka-brand-dark);
  background: var(--oaka-tint);
  border: 1px solid transparent;
}
.catalogue-chip:hover, .catalogue-chip:focus-visible {
  color: var(--oaka-brand-dark);
  border-color: var(--oaka-brand);
}
.catalogue-chip.is-active {
  color: #1b1b1b;
  background: var(--oaka-accent);
}

/* ------------------------------------------------------- cover art --- */

/* /admin/topics.php's small list thumbnail and /admin/topic.php's larger
   "Cover image" preview - Sep 2026 catalogue pass, owner request 2 ("the
   catalogue must be much more visual"). Content\Covers::urlFor() supplies
   the <img> src; Content\Covers::tileFallback() supplies the initials/hue
   for .cover-fallback when there is no cover image at all - same
   12-swatch `.cover-hue-*` palette as the learner catalogue's own tiles
   (learner.css), duplicated here with the same hues because admin pages
   never load that file; see that file's own comment on why this is a
   deliberate, harmless duplication rather than a shared third file. */
.cover-thumb {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  aspect-ratio: 210 / 297;   /* A4, like the booklet covers (21 Oct 2026) */
  border-radius: var(--oaka-radius-admin, .625rem);
  overflow: hidden;
  background: var(--oaka-tint);
  font-weight: 800;
  font-size: .82rem;
}
.cover-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  display: block;
}

.cover-surface {
  display: flex;
  flex-wrap: wrap;
  gap: 1.1rem;
  align-items: flex-start;
}
.cover-preview {
  flex: none;
  width: 8rem;
  aspect-ratio: 210 / 297;   /* A4, like the booklet covers (21 Oct 2026) */
  border-radius: var(--oaka-radius-admin, .625rem);
  overflow: hidden;
  background: var(--oaka-tint);
  border: 1px solid var(--oaka-border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 1.9rem;
}
.cover-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  display: block;
}
.cover-surface-controls {
  flex: 1 1 14rem;
  min-width: 14rem;
}
.cover-surface-controls .btn { margin-right: .4rem; }

.cover-hue-0   { background: hsl(0 72% 90%);   color: hsl(0 55% 28%); }
.cover-hue-30  { background: hsl(30 75% 88%);  color: hsl(28 60% 26%); }
.cover-hue-60  { background: hsl(50 70% 86%);  color: hsl(45 55% 24%); }
.cover-hue-90  { background: hsl(90 45% 86%);  color: hsl(92 40% 24%); }
.cover-hue-120 { background: hsl(140 45% 87%); color: hsl(142 45% 22%); }
.cover-hue-150 { background: hsl(165 45% 87%); color: hsl(168 45% 22%); }
.cover-hue-180 { background: hsl(190 50% 88%); color: hsl(192 50% 24%); }
.cover-hue-210 { background: hsl(205 60% 90%); color: hsl(206 55% 30%); }
.cover-hue-240 { background: hsl(250 55% 92%); color: hsl(255 45% 34%); }
.cover-hue-270 { background: hsl(272 50% 91%); color: hsl(275 45% 32%); }
.cover-hue-300 { background: hsl(300 45% 91%); color: hsl(302 40% 30%); }
.cover-hue-330 { background: hsl(330 60% 92%); color: hsl(332 50% 32%); }

/* --------------------------------------------------------------- print --- */

/* The credential-reveal panel (parent Add-learner / Reset password, admin
   Users) is the one thing on these pages worth printing. Everything else
   - nav, buttons, forms, the rest of the page - is chrome. Bootstrap's own
   .d-print-none / .d-print-block utilities (already vendored) mark the
   exceptions inside the panel itself (Copy buttons, the "sign in at…"
   note); this covers the app shell around it. */
@media print {
  .oaka-nav, .admin-breadcrumb, .oaka-toast-host, .page-header-actions, .toolbar, footer { display: none !important; }
  main.container-fluid { max-width: none; padding: 0; margin: 0; }
  .credential-reveal { box-shadow: none; }
  body { background: #fff; }
  /* V1-F2 pupil-slip printing: two per row with a dashed cut line, page
     breaks never landing mid-slip. */
  .pupil-slip-grid { grid-template-columns: repeat(2, 1fr); gap: .5rem; }
  .pupil-slip { border-style: dashed; box-shadow: none; }
}

/* ============================================================ Sep 2026 ===
   Admin navigation + topic hub redesign - owner complaint on
   /admin/topic.php: "nav and layout are very confusing… no way to reach
   Topics/Users/Entitlements/Jobs/Settings from inside a topic and no
   breadcrumb… the most important thing (cards) hidden behind a small
   button… publish controls somewhere further down." Two pieces: the admin
   nav strip now carries all six sections (views/layout.php), and every
   admin page can pass a $breadcrumbs trail rendered just under it; the
   topic hub itself (views/pages/admin_topic.php) is rebuilt around one
   ordered "workflow" column - Cards -> Content -> Audio -> Practise ->
   Test -> Publish - replacing the old two-column pile of same-weight
   boxes. See BUILD-NOTES.md's "Topic hub redesign" section for the full
   account of what changed and why. */

/* Six section links now share the strip with the brand mark, user chip and
   Sign out (was two: Home/Account) - tightened padding/size keeps them
   comfortable at real desktop widths; navbar-expand-lg's existing collapse
   to the hamburger below that is unchanged. */
.oaka-nav .navbar-nav .nav-link {
  padding-inline: .6rem;
  font-size: .93rem;
}
/* 26 Oct 2026 (Harry): a long label ("Teach from the Board") wraps onto two lines on a narrower desktop, so every item
   sits in the middle of the bar, and a wrapped label is centred and set closer. */
@media (min-width: 992px) {
  .oaka-nav .navbar-nav { align-items: center; }
  .oaka-nav .navbar-nav .nav-link { text-align: center; line-height: 1.25; }
}
/* Laptop widths: a little tighter, so the school menu fits on one line from about 1280px and the admin menu from about 1366px. */
@media (min-width: 992px) and (max-width: 1599.98px) {
  .oaka-nav .navbar-nav .nav-link { padding-inline: .42rem; font-size: .88rem; }
}
/* The user chip and Sign Out stay on one line only where the admin menu, the longest, has room (below this they wrap). */
@media (min-width: 1366px) {
  .oaka-nav .oaka-user-chip, .oaka-nav .btn { white-space: nowrap; }
}

/* ---------------------------------------------------------- breadcrumb --- */

/* views/layout.php's admin $breadcrumbs row - same idea as learner.css's
   own .learner-breadcrumb (see that file's comment for the shared
   contract), styled for the admin surface: a plain strip directly under
   the dark nav bar rather than fixed/overlaid, since admin pages already
   scroll normally under a sticky nav. */
.admin-breadcrumb {
  background: var(--oaka-surface);
  border-bottom: 1px solid var(--oaka-border);
}
.admin-breadcrumb-list {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .3rem;
  margin: 0;
  padding: .6rem 0;
  font-size: .82rem;
}
.admin-breadcrumb-item {
  display: flex;
  align-items: center;
  gap: .3rem;
  min-width: 0;
}
.admin-breadcrumb-item:not(:first-child)::before {
  content: '\203A';
  color: var(--oaka-muted);
  font-weight: 700;
}
.admin-breadcrumb-link {
  color: var(--oaka-muted);
  text-decoration: none;
  font-weight: 700;
  max-width: 16rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.admin-breadcrumb-link:hover, .admin-breadcrumb-link:focus-visible {
  color: var(--oaka-brand);
  text-decoration: underline;
}
.admin-breadcrumb-current {
  color: var(--oaka-text);
  font-weight: 800;
  max-width: 20rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ------------------------------------------------------- topic hub header --- */

/* admin_topic.php's own page header - replaces the shared page_header.php
   partial here (a plain title + subtitle band can't hold a cover thumbnail
   and three chips): a small 3:4 cover (or the same initials/hue fallback
   tile the catalogue and the "Topic details" cover panel both use) at
   left, title + key-stage/subject/status chips filling the middle, and
   "Preview as learner"/"Unpublish" at the right. The old subtitle line
   here used to print the raw /media/t/<hash>/… path - removed entirely
   per the owner's complaint; nothing reads it.  */
.topic-hub-header {
  display: flex;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 1rem 1.25rem;
  margin-bottom: 1.75rem;
}
.topic-hub-cover {
  flex: none;
  width: 4.5rem;
  aspect-ratio: 210 / 297;   /* A4, like the booklet covers (21 Oct 2026) */
  border-radius: var(--oaka-radius-admin, .625rem);
  overflow: hidden;
  background: var(--oaka-tint);
  border: 1px solid var(--oaka-border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 1.15rem;
}
.topic-hub-cover img { width: 100%; height: 100%; object-fit: cover; object-position: center top; display: block; }
.topic-hub-header-main { flex: 1 1 16rem; min-width: 0; }
.topic-hub-header-title {
  font-size: 1.5rem;
  margin-bottom: .5rem;
}
.topic-hub-header-chips {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
}
.topic-hub-header-actions {
  flex: none;
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  align-items: center;
  margin-left: auto;
}
@media (max-width: 575.98px) {
  .topic-hub-header-actions { margin-left: 0; width: 100%; }
  .topic-hub-header-actions .btn, .topic-hub-header-actions form { flex: 1 1 auto; }
}

/* ---------------------------------------------------------- workflow --- */

/* The redesign's centrepiece: one ordered column, Cards -> Content ->
   Audio -> Practise -> Test -> Publish, each its own surface - replacing
   the old same-weight "Cover image / Metadata / AI extraction / Audio /
   WYON / Quizzes" box pile the owner called "confusing… no obvious
   order… the most important thing hidden behind a small button". A
   left-hand rail of numbered circles (lime tick once done, amber while
   partly done, grey/numbered while not started yet) reads as one pipeline
   - same visual idea as the existing .gate-stepper below, just the large,
   primary-content version of it rather than a compact four-line summary. */
.topic-workflow {
  list-style: none;
  margin: 0 0 2.25rem;
  padding: 0;
  max-width: 46rem;
}
.topic-workflow-step {
  position: relative;
  display: flex;
  gap: 1rem;
  padding-bottom: 1.35rem;
}
.topic-workflow-step:last-child { padding-bottom: 0; }
.topic-workflow-step:not(:last-child)::before {
  content: "";
  position: absolute;
  left: 1.3rem;
  top: 2.75rem;
  bottom: 0;
  width: 2px;
  background: var(--oaka-border);
  transform: translateX(-1px);
}
.topic-workflow-step.is-done:not(:last-child)::before { background: var(--oaka-accent); }
.topic-workflow-step-marker {
  flex: none;
  width: 2.6rem;
  height: 2.6rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 1.05rem;
  background: var(--oaka-tint);
  color: var(--oaka-muted);
  border: 2px solid var(--oaka-border);
  position: relative;
  z-index: 1;
}
.topic-workflow-step.is-partial .topic-workflow-step-marker {
  background: var(--bs-warning-bg-subtle, #fff3cd);
  border-color: var(--bs-warning-border-subtle, #ffe69c);
  color: var(--bs-warning-text-emphasis, #664d03);
}
.topic-workflow-step.is-done .topic-workflow-step-marker {
  background: var(--oaka-accent);
  border-color: var(--oaka-accent);
  color: #1b1b1b;
}
.topic-workflow-step-surface {
  flex: 1 1 auto;
  min-width: 0;
  background: var(--oaka-surface);
  border: 1px solid var(--oaka-border);
  border-radius: var(--oaka-radius-surface);
  box-shadow: var(--oaka-shadow-soft);
  padding: 1.1rem 1.3rem;
}
.topic-workflow-step-title {
  font-size: 1.05rem;
  margin-bottom: .3rem;
}
.topic-workflow-step-status {
  color: var(--oaka-muted);
  margin-bottom: .85rem;
  font-size: .92rem;
}
.topic-workflow-step-note {
  color: var(--oaka-muted);
  font-size: .8rem;
  margin: .6rem 0 0;
}
.topic-workflow-step-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .5rem 1rem;
}

/* A secondary action styled as a small link, not a second button - "at
   most one primary button plus one or two secondary links" per step.
   Applies equally to <a> (navigation) and a borderless <button type=submit>
   (a same-page POST, e.g. "Re-extract all") so both read identically. */
.topic-workflow-step-link {
  display: inline-flex;
  align-items: center;
  background: none;
  border: none;
  padding: 0;
  font-size: .82rem;
  font-weight: 700;
  color: var(--oaka-muted);
  text-decoration: none;
  cursor: pointer;
}
.topic-workflow-step-link:hover, .topic-workflow-step-link:focus-visible {
  color: var(--oaka-brand-dark);
  text-decoration: underline;
}
.topic-workflow-step-link:disabled { color: var(--oaka-border); cursor: not-allowed; }

/* The Test step's "Import legacy quizzes" form, collapsed behind a native
   <details> once the topic already has quizzes (no JS needed - the CSP
   forbids inline scripts, and <details>/<summary> already do exactly this
   without any). */
.topic-workflow-step-surface details { margin-top: .9rem; }
.topic-workflow-step-surface details > summary {
  cursor: pointer;
  font-weight: 700;
  font-size: .85rem;
  color: var(--oaka-brand-dark);
  list-style: none;
}
.topic-workflow-step-surface details > summary::-webkit-details-marker { display: none; }
.topic-workflow-step-surface details > summary::before {
  content: '\25B8';
  display: inline-block;
  margin-right: .4rem;
  transition: transform .15s ease;
}
.topic-workflow-step-surface details[open] > summary::before { transform: rotate(90deg); }
.topic-workflow-step-surface details > .details-body { margin-top: .75rem; }

/* A quiet, de-emphasised destructive action at the very bottom of the
   Publish step - Archive is a real, confirmed action (js-confirm still
   guards it) but should never compete visually with Publish/Unpublish. */
.topic-archive-link {
  display: inline-block;
  background: none;
  border: none;
  padding: 0;
  font-size: .8rem;
  font-weight: 600;
  color: var(--oaka-muted);
  text-decoration: none;
}
.topic-archive-link:hover, .topic-archive-link:focus-visible {
  color: var(--bs-danger);
  text-decoration: underline;
}

@media (prefers-reduced-motion: reduce) {
  .topic-workflow-step-surface details > summary::before { transition: none; }
}

/* Activity time - Oct 2026 */
.activity-bar-cell { width: 55%; }
.activity-meter { width: 100%; height: 0.9rem; }

/* Glossary tidy-up screen (/admin/glossary.php) - Oct 2026. The booklet page
   stays in view beside the list on a wide screen; the thumbnail picker is a
   plain grid. No scripts involved. */
.glossary-page-panel { position: sticky; top: 4.5rem; max-height: calc(100vh - 5.5rem); overflow-y: auto; }
.glossary-page-scroll { max-height: 60vh; overflow: auto; border: 1px solid var(--oaka-border); border-radius: var(--oaka-radius-admin); background: #fff; }
.glossary-page-img { display: block; width: 100%; height: auto; min-width: 640px; }
.glossary-thumb-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(8.5rem, 1fr)); gap: .5rem; }
.glossary-thumb { display: block; cursor: pointer; border: 1px solid var(--oaka-border); border-radius: var(--oaka-radius-admin); padding: .25rem; background: #fff; }
.glossary-thumb img { display: block; width: 100%; height: auto; border-radius: 4px; }
.glossary-toolbar { position: sticky; top: 3.75rem; z-index: 5; background: var(--oaka-bg); padding: .4rem 0; }
/* An entry the page jumps to (#g715 after Edit or Save) lands below the top bar AND the sticky toolbar, which used to
   cover it (Harry, 27 Oct 2026). */
.glossary-row, .glossary-approved { scroll-margin-top: 11rem; }
.glossary-def { field-sizing: content; min-height: 3.2rem; }
.glossary-readings { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; }
.glossary-reading { background: var(--oaka-tint); border-radius: var(--oaka-radius-admin); padding: .4rem .5rem; }
@media (max-width: 1199.98px) {
  .glossary-page-panel { position: static; max-height: none; overflow: visible; }
  .glossary-toolbar { top: 0; }
  .glossary-readings { grid-template-columns: 1fr; }
}

/* "Review cards with no printed number" (/admin/cards.php?review=unnumbered) - Oct 2026. */
.unnumbered-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(9.5rem, 1fr)); gap: .6rem; }
.unnumbered-item { display: flex; flex-direction: column; gap: .25rem; border: 1px solid var(--oaka-border); border-radius: var(--oaka-radius-admin); padding: .35rem; background: #fff; cursor: pointer; }
.unnumbered-item img { display: block; width: 100%; height: 9rem; object-fit: contain; background: var(--oaka-bg); border-radius: 4px; }
.unnumbered-item.is-locked { opacity: .65; cursor: default; }
.unnumbered-noimg { display: flex; align-items: center; justify-content: center; height: 9rem; font-size: .8rem; color: var(--oaka-muted); background: var(--oaka-bg); border-radius: 4px; }

/* ===========================================================================
   Approval screen (/admin/approve.php, 20 Oct 2026; Harry: "drastically improve
   the approval workflow"). One topic, one section ("block") at a time: the
   printed card beside the AI's text, the fact check inline, that section's
   Practise items and quiz questions underneath. Class prefix: ap-.
   Colours come from tokens.css only.
   ======================================================================== */
.ap { max-width: 1280px; margin: 0 auto; }
.ap kbd { font-size: .68em; padding: .05em .35em; margin-left: .25em; color: var(--oaka-muted); background: var(--oaka-tint); border: 1px solid var(--oaka-border); border-bottom-width: 2px; border-radius: .3rem; font-family: inherit; font-weight: 700; }
.ap-head { display: flex; flex-wrap: wrap; gap: 1rem; justify-content: space-between; align-items: flex-start; margin-bottom: .75rem; }
.ap-head-main { flex: 1 1 28rem; min-width: 0; }
.ap-head-side { display: flex; flex-wrap: wrap; gap: .4rem; }
.ap-title { font-size: 1.35rem; font-weight: 800; margin: 0 0 .25rem; }
.ap-title-sub { font-weight: 600; color: var(--oaka-muted); }
.ap-progress-line { margin: 0 0 .4rem; color: var(--oaka-text); }
.ap-needs-count { color: #b3261e; }
.ap-sep { color: var(--oaka-border); margin: 0 .15rem; }
.ap-progress { width: 100%; height: .6rem; accent-color: var(--oaka-brand); }
.ap-devnote { margin: 0 0 .75rem; padding: .4rem .75rem; font-size: .85rem; color: var(--oaka-muted); background: var(--oaka-tint); border-radius: var(--oaka-radius-admin); }
.ap-help { margin-bottom: .75rem; padding: .75rem 1rem; background: var(--oaka-surface); border: 1px solid var(--oaka-border); border-radius: var(--oaka-radius-admin); }
.ap-help-title { font-size: .95rem; font-weight: 800; margin: 0 0 .5rem; }
.ap-keys { display: grid; grid-template-columns: repeat(auto-fit, minmax(18rem, 1fr)); gap: .35rem 1.5rem; margin: 0; }
.ap-keys > div { display: flex; gap: .6rem; align-items: baseline; }
.ap-keys dt { flex: 0 0 5rem; font-weight: 700; white-space: nowrap; }
.ap-keys dd { margin: 0; }
.ap-flash { margin-bottom: .75rem; padding: .55rem .85rem; border-radius: var(--oaka-radius-admin); border: 1px solid var(--oaka-border); background: var(--oaka-surface); }
.ap-flash p { margin: 0; }
.ap-flash p + p { margin-top: .2rem; }
.ap-flash--ok { border-color: rgba(var(--oaka-accent-rgb), .6); background: rgba(var(--oaka-accent-rgb), .12); }
.ap-flash--warn { border-color: #e0b84a; background: #fff7e0; }
/* 21 Oct 2026: the screen updates in place (assets/js/approve.js) - a warning shown beside the item it is about,
   and a quiet busy state while a form is on its way. */
.ap-flash--inline { margin: .5rem 0; }
.ap.is-busy { cursor: progress; }
.ap.is-busy form button { pointer-events: none; }
.ap-flash--error { border-color: #d9807a; background: #fdecea; }
.ap-bar { display: flex; flex-wrap: wrap; gap: .75rem; justify-content: space-between; align-items: center; margin-bottom: .5rem; }
.ap-tabs { display: flex; flex-wrap: wrap; gap: .3rem; }
.ap-tab { padding: .3rem .75rem; font-size: .88rem; font-weight: 700; text-decoration: none; color: var(--oaka-text); background: var(--oaka-surface); border: 1px solid var(--oaka-border); border-radius: 999px; }
.ap-tab:hover { border-color: var(--oaka-brand); }
.ap-tab.is-active { color: #fff; background: var(--oaka-brand); border-color: var(--oaka-brand); }
.ap-tab-n { opacity: .75; font-weight: 600; }
.ap-tab--needs:not(.is-active) .ap-tab-n { color: #b3261e; opacity: 1; }
.ap-strip { display: flex; flex-wrap: wrap; gap: .25rem; margin-bottom: .9rem; }
.ap-dot { min-width: 2rem; padding: .15rem .35rem; text-align: center; font-size: .78rem; font-weight: 700; text-decoration: none; color: var(--oaka-text); background: var(--oaka-surface); border: 1.5px solid var(--oaka-border); border-radius: .45rem; }
.ap-dot--needs { background: #fdecea; border-color: #d9807a; }
.ap-dot--ready { background: #fff7e0; border-color: #e0b84a; }
.ap-dot--waiting { background: var(--oaka-tint); }
.ap-dot--approved { background: rgba(var(--oaka-accent-rgb), .18); border-color: rgba(var(--oaka-accent-rgb), .7); }
.ap-dot.is-current { outline: 2px solid var(--oaka-brand); outline-offset: 1px; }
.ap-empty { padding: 2rem 1rem; text-align: center; color: var(--oaka-muted); background: var(--oaka-surface); border: 1px dashed var(--oaka-border); border-radius: var(--oaka-radius-surface); }
.ap-block { background: var(--oaka-surface); border: 1px solid var(--oaka-border); border-left-width: 5px; border-radius: var(--oaka-radius-surface); padding: 1rem 1.1rem 1.25rem; box-shadow: var(--oaka-shadow-soft); }
.ap-block--needs { border-left-color: #d9807a; }
.ap-block--ready { border-left-color: #e0b84a; }
.ap-block--approved { border-left-color: rgba(var(--oaka-accent-rgb), .9); }
.ap-block--waiting { border-left-color: var(--oaka-border); }
.ap-block-head { display: flex; flex-wrap: wrap; gap: .75rem 1.25rem; justify-content: space-between; align-items: center; padding-bottom: .75rem; margin-bottom: .9rem; border-bottom: 1px solid var(--oaka-border); }
.ap-block-title { font-size: 1.15rem; font-weight: 800; margin: 0; }
.ap-block-pos { margin: .15rem 0 0; font-size: .85rem; color: var(--oaka-muted); }
.ap-block-nav { display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; }
.ap-approve-block { margin: 0; }
.ap-chip { display: inline-block; padding: .08rem .55rem; font-size: .72rem; font-weight: 800; letter-spacing: .01em; border-radius: 999px; border: 1px solid var(--oaka-border); background: var(--oaka-tint); color: var(--oaka-text); }
.ap-chip--needs { background: #fdecea; border-color: #d9807a; color: #8c1d18; }
.ap-chip--ready { background: #fff7e0; border-color: #e0b84a; color: #6b4e00; }
.ap-chip--approved { background: rgba(var(--oaka-accent-rgb), .18); border-color: rgba(var(--oaka-accent-rgb), .7); color: #3d5400; }
.ap-chip--waiting, .ap-chip--hidden { color: var(--oaka-muted); }
.ap-section { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 1.25rem; align-items: start; }
@media (max-width: 900px) { .ap-section { grid-template-columns: 1fr; } }
.ap-image-col { position: sticky; top: 4.5rem; }
@media (max-width: 900px) { .ap-image-col { position: static; } }
.ap-image-wrap { overflow: auto; max-height: calc(100vh - 8rem); border: 1px solid var(--oaka-border); border-radius: var(--oaka-radius-admin); background: #fff; }
.ap-image-wrap.is-zoomed { position: fixed; inset: 3rem 1rem 1rem; z-index: 1050; max-height: none; box-shadow: var(--oaka-shadow-lift); }
.ap-image { display: block; width: 100%; height: auto; }
.ap-image-wrap.is-zoomed .ap-image { width: auto; max-width: none; min-width: 100%; }
.ap-image-links { margin: .35rem 0 0; font-size: .82rem; color: var(--oaka-muted); }
.ap-noimage { padding: 2rem 1rem; text-align: center; color: var(--oaka-muted); }
.ap-state-row { display: flex; flex-wrap: wrap; gap: .4rem .6rem; align-items: center; margin-bottom: .5rem; }
.ap-reason { font-size: .85rem; color: var(--oaka-text); }
.ap-approval { font-size: .8rem; color: var(--oaka-muted); }
.ap-approval--bulk, .ap-approval--legacy, .ap-approval--changed { color: #8a5a00; }
.ap-fc { margin: .25rem 0 .75rem; padding: .5rem .75rem; font-size: .88rem; border: 1px solid var(--oaka-border); border-left-width: 4px; border-radius: var(--oaka-radius-admin); background: var(--oaka-bg); }
.ap-fc-head { margin: 0; }
.ap-fc-models { margin-left: .4rem; font-size: .75rem; color: var(--oaka-muted); }
.ap-fc--clean { border-left-color: rgba(var(--oaka-accent-rgb), .9); }
.ap-fc--overruled { border-left-color: #9bb86a; }
.ap-fc--concern { border-left-color: #c9362d; background: #fdf3f2; }
.ap-fc--unsure { border-left-color: #e08a00; background: #fff8ea; }
.ap-fc--bad { border-left-color: #c9362d; }
.ap-fc--wait { border-left-color: var(--oaka-border); }
/* 21 Oct 2026: one short line per point that needs a person; full wording behind "Why"; overruled points folded. */
.ap-fc-head { cursor: default; }
.ap-fc-points { list-style: none; margin: .35rem 0 0; padding: 0; }
.ap-fc-point { padding: .4rem 0 .3rem; border-top: 1px solid var(--oaka-border); }
.ap-fc-line { margin: 0; display: flex; flex-wrap: wrap; align-items: baseline; gap: .4rem; }
.ap-fc-line .badge { font-size: .78rem; }
.ap-fc-about { font-weight: 700; }
.ap-fc-summary { margin: .15rem 0 0; }
.ap-fc-why, .ap-fc-overruled { margin-top: .2rem; }
.ap-fc-why summary, .ap-fc-overruled summary { cursor: pointer; font-size: .8rem; color: var(--oaka-muted); }
.ap-fc-overruled { margin-top: .35rem; }
.ap-fc-detail, .ap-fc-arbiter { margin: .2rem 0 0; font-size: .84rem; }
.ap-fc-arbiter { color: var(--oaka-muted); }
.ap-fc-resolved { margin: .35rem 0 0; font-size: .8rem; color: var(--oaka-muted); }
.ap-heading { font-size: 1.1rem; font-weight: 800; margin: .5rem 0; }
.ap-missing { color: var(--oaka-muted); }
.ap-label { margin: .9rem 0 .3rem; font-size: .78rem; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; color: var(--oaka-muted); }
.ap-terms { margin: 0; display: grid; gap: .25rem; }
.ap-terms > div { display: flex; flex-wrap: wrap; gap: .1rem .6rem; }
.ap-terms dt { font-weight: 800; min-width: 7rem; }
.ap-terms dd { margin: 0; flex: 1 1 14rem; }
.ap-facts { margin: 0; padding-left: 0; list-style: none; display: grid; gap: .3rem; }
.ap-fact-id { display: inline-block; min-width: 1.8rem; font-size: .72rem; font-weight: 800; color: var(--oaka-brand); }
.ap-script { margin: 0; padding: .55rem .75rem; background: var(--oaka-bg); border-radius: var(--oaka-radius-admin); }
.ap-transcription { margin-top: .6rem; font-size: .85rem; color: var(--oaka-muted); }
.ap-transcription summary { cursor: pointer; }
.ap-flags { margin: .6rem 0 0; font-size: .82rem; color: var(--oaka-muted); }
.ap-flag { display: inline-block; margin: 0 .25rem; padding: 0 .45rem; border: 1px solid #e0b84a; background: #fff7e0; border-radius: 999px; color: #6b4e00; font-weight: 700; }
.ap-audio { margin-top: .75rem; padding: .6rem .75rem; border: 1px solid var(--oaka-border); border-radius: var(--oaka-radius-admin); }
.ap-audio-player { width: 100%; max-width: 28rem; }
.ap-audio-terms { margin: .4rem 0; font-size: .85rem; }
.ap-note { font-size: .8rem; color: var(--oaka-muted); }
.ap-actions { display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; margin: .6rem 0; }
.ap-actions form { margin: 0; }
.ap-anyway { display: flex; flex-wrap: wrap; gap: .4rem .6rem; align-items: center; padding: .4rem .6rem; border: 1px dashed #e0b84a; background: #fffaf0; border-radius: var(--oaka-radius-admin); }
.ap-anyway-tick { font-size: .85rem; font-weight: 700; margin: 0; }
.ap-anyway-note { width: 14rem; max-width: 100%; }
.ap-edit { margin: .5rem 0; }
.ap-edit > summary { display: inline-block; cursor: pointer; list-style: none; }
.ap-edit > summary::-webkit-details-marker { display: none; }
.ap-edit-form { margin-top: .6rem; padding: .75rem; background: var(--oaka-bg); border: 1px solid var(--oaka-border); border-radius: var(--oaka-radius-admin); }
.ap-choice-edit { display: flex; gap: .5rem; align-items: center; margin-bottom: .25rem; }
.ap-sub { margin: 1.4rem 0 .5rem; padding-top: .9rem; border-top: 1px solid var(--oaka-border); font-size: .95rem; font-weight: 800; }
.ap-sub-n { margin-left: .35rem; font-size: .78rem; font-weight: 700; color: var(--oaka-muted); }
.ap-none { margin-top: 1rem; color: var(--oaka-muted); font-size: .88rem; }
.ap-item { margin-bottom: .75rem; padding: .7rem .9rem; border: 1px solid var(--oaka-border); border-left-width: 4px; border-radius: var(--oaka-radius-admin); background: var(--oaka-surface); }
.ap-item--needs { border-left-color: #d9807a; }
.ap-item--ready { border-left-color: #e0b84a; }
.ap-item--approved { border-left-color: rgba(var(--oaka-accent-rgb), .9); }
.ap-item--waiting, .ap-item--hidden { border-left-color: var(--oaka-border); }
.ap-item--hidden { opacity: .75; }
.ap-sentence { margin: .2rem 0 .35rem; font-size: 1.02rem; }
.ap-gap { display: inline-block; margin: 0 .2rem; padding: 0 .5rem; font-weight: 800; color: var(--oaka-brand-dark); background: var(--oaka-tint); border-bottom: 2px solid var(--oaka-brand); border-radius: .25rem; }
.ap-distractors, .ap-source, .ap-qa-issues { margin: .2rem 0; font-size: .85rem; color: var(--oaka-muted); }
.ap-chipword { display: inline-block; margin: 0 .2rem; padding: 0 .5rem; border: 1px solid var(--oaka-border); border-radius: 999px; background: var(--oaka-bg); color: var(--oaka-text); }
.ap-prompt { margin: .2rem 0 .35rem; font-weight: 700; }
.ap-choices { list-style: none; margin: 0 0 .4rem; padding: 0; display: grid; gap: .15rem; }
.ap-choices li.is-correct { font-weight: 800; color: #3d5400; }
.ap-choice-mark { display: inline-block; width: 1.2rem; text-align: center; }
/* 21 Oct 2026: "Flag for later", "Rewrite this" and "Report a booklet error" on the approval screen.
   Small folded forms (<details class="ap-mini">) in the action row; notes above the item. */
.ap-chip--parked { background: #fff1d6; border-color: #e08a00; color: #6b4400; }
.ap-dot--parked { background: #fff1d6; border-color: #e08a00; }
.ap-block--parked { border-left-color: #e08a00; }
.ap-item--parked { border-left-color: #e08a00; }
.ap-mini { display: inline-block; }
.ap-mini > summary { display: inline-block; cursor: pointer; list-style: none; }
.ap-mini > summary::-webkit-details-marker { display: none; }
.ap-mini[open] { display: block; flex: 1 0 100%; }
.ap-mini-form { display: grid; gap: .35rem; justify-items: start; margin-top: .45rem; padding: .6rem .75rem; max-width: 40rem; background: var(--oaka-bg); border: 1px solid var(--oaka-border); border-radius: var(--oaka-radius-admin); }
.ap-mini-form .form-control { width: 100%; }
.ap-flagnote { display: flex; flex-wrap: wrap; gap: .4rem .75rem; align-items: center; justify-content: space-between; margin: 0 0 .6rem; padding: .45rem .7rem; font-size: .88rem; background: #fff1d6; border: 1px solid #e0b84a; border-left: 4px solid #e08a00; border-radius: var(--oaka-radius-admin); }
.ap-flagnote form { margin: 0; }
.ap-rewrite { margin: 0 0 .6rem; padding: .5rem .75rem; font-size: .88rem; background: var(--oaka-tint); border: 1px solid var(--oaka-border); border-left: 4px solid var(--oaka-brand); border-radius: var(--oaka-radius-admin); }
.ap-rewrite--pending { border-left-color: var(--oaka-muted); }
.ap-rewrite form { margin: .4rem 0 0; }
.ap-rewrite-head { margin: 0 0 .35rem; }
.ap-rewrite-old { padding: .4rem .6rem; background: var(--oaka-surface); border: 1px dashed var(--oaka-border); border-radius: var(--oaka-radius-admin); }
.ap-rewrite-old .ap-label { display: block; margin: 0 0 .2rem; }
.ap-rewrite-refused { margin: 0 0 .6rem; font-size: .85rem; color: #8a5a00; }
.ap-rewrite-no { flex: 1 0 100%; }
.ap-berr { margin-top: .5rem; }
.ap-berr-list { margin: 0 0 .5rem; padding-left: 1.1rem; font-size: .88rem; }
.ap-berr-list li { margin-bottom: .3rem; }
.ap-berr-what { font-weight: 700; }
.ap-berr-fix { display: block; }
.ap-berr-list .ap-note { display: block; }

/* Development-mode banner (20 Oct 2026, Content\EditorialMode): shown on every admin page while
   learners can see content nobody has approved yet. Calm amber, never dismissible. */
.dev-banner { padding: .35rem 0; font-size: .85rem; color: #6b4e00; background: #fff4d6; border-bottom: 1px solid #e8cf86; }
.dev-banner a { margin-left: .5rem; color: inherit; font-weight: 700; }

/* Topic hub: the "Approve content" call-to-action above the step list (20 Oct 2026). */
.approve-callout { display: flex; flex-wrap: wrap; gap: 1rem; align-items: center; justify-content: space-between; margin-bottom: 1.25rem; padding: 1rem 1.25rem; background: var(--oaka-surface); border: 1px solid var(--oaka-border); border-left: 5px solid var(--oaka-brand); border-radius: var(--oaka-radius-surface); box-shadow: var(--oaka-shadow-soft); }
.approve-callout-title { margin: 0 0 .15rem; font-size: 1.1rem; font-weight: 800; }
.approve-callout-line { margin: 0; color: var(--oaka-muted); }
.approve-callout-auto { flex: 1 0 100%; margin: .15rem 0 0; font-size: .85rem; color: var(--oaka-muted); }

/* Approval screen: the glossary panel (21 Oct 2026). */
.ap-glossary { margin: 0 0 .75rem; padding: .6rem .9rem; background: var(--oaka-surface); border: 1px solid var(--oaka-border); border-radius: var(--oaka-radius-admin); display: flex; flex-wrap: wrap; align-items: center; gap: .4rem 1rem; }
.ap-glossary-line { margin: 0; flex: 1 1 24rem; font-size: .9rem; }
.ap-glossary-list { flex: 1 1 100%; order: 3; font-size: .875rem; }
.ap-glossary-list summary { cursor: pointer; color: var(--oaka-brand); font-weight: 600; }
.ap-glossary-list dl { margin: .5rem 0 0; max-height: 22rem; overflow-y: auto; display: grid; gap: .3rem; }
.ap-glossary-list dl > div { display: grid; grid-template-columns: minmax(8rem, 14rem) 1fr; gap: .75rem; padding: .25rem 0; border-bottom: 1px solid var(--oaka-border); }
.ap-glossary-list dt { font-weight: 700; }
.ap-glossary-list dd { margin: 0; }
.ap-glossary-form { margin: 0; }

/* Approval screen: the parts panel (21 Oct 2026, migration 041) - same look as the glossary panel. */
.ap-parts { margin: 0 0 .75rem; padding: .6rem .9rem; background: var(--oaka-surface); border: 1px solid var(--oaka-border); border-radius: var(--oaka-radius-admin); }
.ap-parts-head { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem 1rem; }
.ap-parts-line { margin: 0; flex: 1 1 24rem; font-size: .9rem; }
.ap-parts-refused { color: #8c1d18; }
.ap-parts-actions { display: flex; flex-wrap: wrap; gap: .4rem; }
.ap-parts-form { margin: 0; }
.ap-parts-list { list-style: none; margin: .6rem 0 0; padding: 0; display: grid; gap: .45rem; }
.ap-part { padding: .45rem 0 .1rem; border-top: 1px solid var(--oaka-border); }
.ap-part-form { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; margin: 0; }
.ap-part-n { flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: center; width: 1.7rem; height: 1.7rem; border-radius: 999px; background: var(--oaka-tint); color: var(--oaka-brand); font-weight: 800; font-size: .85rem; }
.ap-part-title { flex: 1 1 16rem; max-width: 28rem; font-weight: 700; }
.ap-part-meta { margin: .25rem 0 0 2.1rem; font-size: .85rem; color: var(--oaka-muted); }
.ap-part-why { color: var(--oaka-text); }

/* Approval screen: "N items are with the AI right now" (21 Oct 2026). */
.ap-waiting { margin: 0 0 .75rem; padding: .55rem .9rem; background: var(--oaka-tint); border: 1px solid var(--oaka-border); border-radius: var(--oaka-radius-admin); display: flex; flex-wrap: wrap; align-items: center; gap: .4rem 1rem; }
.ap-waiting-line { margin: 0; flex: 1 1 28rem; font-size: .9rem; }
.ap-waiting-form { margin: 0; }

/* Approve Everything That Passed (24 Oct 2026, topic pack flow step 6): the approval screen's main action, above the tabs. */
.ap-passed { margin: 0 0 .75rem; padding: .7rem .9rem; background: var(--oaka-surface); border: 1px solid var(--oaka-border); border-left: 4px solid var(--oaka-accent); border-radius: var(--oaka-radius-admin); display: flex; flex-wrap: wrap; align-items: center; gap: .6rem 1.25rem; }
.ap-passed-main { flex: 1 1 28rem; min-width: 0; }
.ap-passed-line { margin: 0 0 .2rem; font-size: .92rem; }
.ap-passed-actions { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; }
.ap-passed-actions form { margin: 0; }
.ap-passed-models { list-style: none; margin: .5rem 0 0; padding: 0; display: grid; gap: .35rem; font-size: .875rem; }
.ap-passed-models li { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; }
.ap-passed-models img { width: 64px; height: 40px; object-fit: cover; border: 1px solid var(--oaka-border); border-radius: 6px; background: var(--oaka-tint); }
.ap-ref { display: inline-block; margin-left: .25rem; padding: 0 .45rem; font-size: .75rem; font-weight: 700; color: var(--oaka-muted); background: var(--oaka-tint); border: 1px solid var(--oaka-border); border-radius: 999px; white-space: nowrap; }
@media (max-width: 575.98px) {
  .ap-passed-actions, .ap-passed-actions form, .ap-passed-actions .btn { width: 100%; }
}
.ap-parts-more > summary { cursor: pointer; color: var(--oaka-brand); font-weight: 600; font-size: .875rem; margin-top: .25rem; }

/* The approval screen takes over the rest (topic pack flow step 8, 25 Oct 2026): the folded panels for the quizzes, the
   whole glossary and the optional 3D models (partials/approve_panel_*.php), a section's new reading in its own block
   (partials/approve_proposal.php) and a person's latest edit (partials/approve_notes.php). */
.ap-panel { margin: 0 0 .75rem; padding: .55rem .9rem; background: var(--oaka-surface); border: 1px solid var(--oaka-border); border-radius: var(--oaka-radius-admin); }
.ap-panel[open] { padding-bottom: .8rem; }
.ap-panel-head { display: flex; flex-wrap: wrap; align-items: center; gap: .3rem .8rem; cursor: pointer; list-style: none; font-size: .9rem; }
.ap-panel-head::-webkit-details-marker { display: none; }
.ap-panel-head::before { content: "\25B8"; color: var(--oaka-brand); font-size: .8rem; transition: transform .15s ease; }
.ap-panel[open] > .ap-panel-head::before { transform: rotate(90deg); }
.ap-panel-title { font-weight: 800; color: var(--oaka-brand); }
.ap-panel-sub { font-weight: 600; color: var(--oaka-muted); font-size: .8rem; }
.ap-panel-line { flex: 1 1 18rem; min-width: 0; color: var(--oaka-text); }
.ap-panel > .ap-note:first-of-type { margin-top: .5rem; }
.ap-quiz-list { list-style: none; margin: .5rem 0 0; padding: 0; display: grid; gap: .5rem; }
.ap-quiz { padding: .5rem .65rem; border: 1px solid var(--oaka-border); border-radius: var(--oaka-radius-admin); }
.ap-quiz.is-out { background: var(--oaka-bg); }
.ap-quiz-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .4rem .8rem; }
.ap-quiz-main { display: flex; flex-wrap: wrap; align-items: center; gap: .3rem .55rem; min-width: 0; flex: 1 1 22rem; font-size: .9rem; }
.ap-quiz-actions { display: flex; flex-wrap: wrap; gap: .4rem; }
.ap-quiz-actions form { margin: 0; }
.ap-quiz-questions { margin-top: .4rem; font-size: .85rem; }
.ap-quiz-questions > summary { cursor: pointer; color: var(--oaka-brand); font-weight: 600; }
.ap-quiz-qs { margin: .4rem 0 0; padding-left: 1.3rem; display: grid; gap: .25rem; max-height: 24rem; overflow-y: auto; }
.ap-gloss-list { display: grid; gap: .5rem; margin-bottom: .5rem; }
.ap-gloss { padding: .5rem .7rem; border: 1px solid var(--oaka-border); border-left: 4px solid #d9807a; border-radius: var(--oaka-radius-admin); }
.ap-gloss-entry { margin: 0 0 .15rem; font-size: .92rem; overflow-wrap: anywhere; }
.ap-gloss-reading { margin: 0 0 .2rem; font-size: .85rem; padding: .2rem .5rem; background: var(--oaka-tint); border-radius: 6px; overflow-wrap: anywhere; }
.ap-gloss-reading .ap-label { display: inline; margin-right: .35rem; }
.ap-gloss .ap-actions { margin-top: .4rem; }
.ap-panel .ap-glossary-list { margin-top: .4rem; }
.ap-model { display: grid; grid-template-columns: minmax(0, 13rem) minmax(0, 1fr); gap: .9rem; padding: .65rem 0; border-top: 1px solid var(--oaka-border); }
.ap-model:first-of-type { border-top: 0; }
.ap-model-pic img { display: block; width: 100%; aspect-ratio: 16 / 10; object-fit: cover; background: var(--oaka-tint); border: 1px solid var(--oaka-border); border-radius: var(--oaka-radius-admin); }
.ap-model-title { font-size: 1rem; font-weight: 800; margin: 0 0 .3rem; }
.ap-model-labels { margin: .4rem 0; font-size: .875rem; }
.ap-model-labels > summary { cursor: pointer; color: var(--oaka-brand); font-weight: 600; }
.ap-model-labels ol { margin: .4rem 0 0; padding-left: 1.3rem; display: grid; gap: .35rem; }
.ap-model-quote { display: block; color: var(--oaka-muted); }
@media (max-width: 575.98px) {
  .ap-model { grid-template-columns: 1fr; }
  .ap-quiz-actions, .ap-quiz-actions form, .ap-quiz-actions .btn { width: 100%; }
}
.ap-proposal { margin: .6rem 0; padding: .6rem .8rem; background: #fff7e0; border: 1px solid #e0b84a; border-left: 4px solid #e0b84a; border-radius: var(--oaka-radius-admin); font-size: .9rem; }
.ap-proposal-head { margin: 0 0 .5rem; }
.ap-proposal-table { display: grid; gap: .55rem; }
.ap-proposal-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: .25rem .75rem; }
.ap-proposal-row > .ap-label { grid-column: 1 / -1; margin: 0; }
.ap-proposal-old, .ap-proposal-new { padding: .35rem .55rem; background: var(--oaka-surface); border: 1px solid var(--oaka-border); border-radius: 6px; min-width: 0; overflow-wrap: anywhere; }
.ap-proposal-new { border-color: #e0b84a; }
.ap-proposal-old p, .ap-proposal-new p { margin: .15rem 0 0; white-space: normal; }
.ap-proposal-tag { font-size: .72rem; font-weight: 800; text-transform: uppercase; letter-spacing: .03em; color: var(--oaka-muted); }
.ap-proposal .ap-actions { margin-top: .6rem; }
@media (max-width: 767.98px) { .ap-proposal-row { grid-template-columns: 1fr; } }
.ap-editnote { margin: 0 0 .6rem; padding: .4rem .7rem; font-size: .86rem; background: var(--oaka-tint); border: 1px solid var(--oaka-border); border-left: 4px solid var(--oaka-brand); border-radius: var(--oaka-radius-admin); }
.ap-editnote--look { border-left-color: #d9807a; }

/* Emails preview page, /admin/emails.php (21 Oct 2026). The email itself is drawn inside the iframe by
   Mail\Layout's own inline styles; these rules only lay out the list and size the frame. */
.email-list-item { padding: .7rem 1rem; border-top: 1px solid var(--oaka-border); border-left: 3px solid transparent; }
.email-list-item:first-child { border-top: 0; }
.email-list-item.is-selected { border-left-color: var(--oaka-brand); background: var(--oaka-tint); }
.email-list-link { display: block; text-decoration: none; color: var(--oaka-text); }
.email-list-link:hover .email-list-label { text-decoration: underline; }
.email-list-label { display: block; font-weight: 800; color: var(--oaka-brand); }
.email-list-subject { display: block; font-size: .875rem; font-weight: 600; }
.email-list-preheader { display: block; font-size: .8125rem; color: var(--oaka-muted); }
.email-list-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .3rem .75rem; margin-top: .4rem; }
.email-list-when { flex: 1 1 12rem; font-size: .75rem; color: var(--oaka-muted); }
.email-list-form { margin: 0; }
.email-frame-wrap { background: var(--oaka-bg); border: 1px solid var(--oaka-border); border-radius: var(--oaka-radius-admin); padding: 1rem; overflow-x: auto; }
.email-frame { display: block; margin: 0 auto; height: 52rem; border: 1px solid var(--oaka-border); border-radius: .75rem; background: #fff; }
.email-frame--phone { width: 375px; max-width: 100%; }
.email-frame--tablet { width: 768px; }
.email-frame--desktop { width: 100%; min-width: 640px; }
.email-text { white-space: pre-wrap; word-break: break-word; max-height: 28rem; overflow: auto; padding: .9rem 1rem; font-size: .8125rem;
  background: var(--oaka-surface); border: 1px solid var(--oaka-border); border-radius: var(--oaka-radius-admin); }

/* 21 Oct 2026, deleting accounts: the narrow "type DELETE" box beside each archived pupil (/school/pupils). */
.delete-word-input { width: 6.5rem; flex: 0 0 auto; }

/* 22 Oct 2026, legal pages: the small row of links at the foot of a page (partials/legal_footer.php), drawn by both
   layouts, so it lives here, in the one stylesheet both load. Quiet on purpose: muted text, no box. */
.site-footer {
  max-width: 76rem;
  margin: 0 auto;
  padding: 1.25rem 1rem 2rem;
  text-align: center;
  font-size: .85rem;
  color: var(--oaka-muted);
}
.site-footer-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: .25rem 1.25rem;
  margin-bottom: .35rem;
}
.site-footer-links a { color: var(--oaka-muted); font-weight: 600; text-decoration: underline; text-underline-offset: .15em; }
.site-footer-links a:hover { color: var(--oaka-brand); }
.site-footer-who { margin: 0; }
/* The account-creating forms: the agree line's links (partials/legal_agree.php). */
.legal-agree a { color: var(--oaka-brand); font-weight: 600; }

/* ---------------------------------------------- Help button (22 Oct 2026) --- */
/* The Help Centre's button in every top bar, beside Report a Problem (views/layout.php, layout-learner.php). Same
   shape as the report button (report.css), defined here because Help shows even when the report button can't. */
.oaka-help-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
  min-height: 34px; padding: .25rem .75rem;
  border: 1px solid rgba(255, 255, 255, .55); border-radius: var(--oaka-radius-pill);
  background: transparent; color: #fff;
  font-size: .875rem; font-weight: 700; white-space: nowrap; text-decoration: none;
}
.oaka-help-btn:hover, .oaka-help-btn:focus-visible { background: rgba(255, 255, 255, .16); border-color: #fff; color: #fff; }
.help-btn-icon { flex: none; width: 1.1rem; height: 1.1rem; }
.oaka-help-btn--icon { width: 38px; height: 38px; min-height: 0; padding: 0; margin-left: auto; margin-right: .4rem; }
.oaka-help-btn--icon + .oaka-report-btn--icon { margin-left: 0; }
.oaka-help-btn--icon.oaka-help-btn--alone { margin-right: .5rem; }
.oaka-help-btn--round { width: 36px; height: 36px; min-height: 0; padding: 0; }

/* The learner top bar's Help (layout-learner.php): icon only on a phone, "Help" beside it from 992px. */
.learner-topbar-help {
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
  flex: none;
  min-width: 34px; height: 34px; padding: 0;
  margin-left: auto;
  border-radius: var(--oaka-radius-pill);
  background: rgba(255, 255, 255, .16); color: #fff;
  font-size: .85rem; font-weight: 700; white-space: nowrap; text-decoration: none;
}
.learner-topbar-help:hover, .learner-topbar-help:focus-visible { background: rgba(255, 255, 255, .3); color: #fff; }
.learner-topbar-tools + .learner-topbar-help { margin-left: .5rem; }
.learner-topbar-help + .learner-topbar-report { margin-left: .5rem; }
.learner-topbar-help + .learner-topbar-home { margin-left: .5rem; }
.learner-topbar-help-text { display: none; }
@media (min-width: 992px) {
  .learner-topbar-help { padding: 0 .85rem 0 .7rem; }
  .learner-topbar-help-text { display: inline; }
}
body.presenting .learner-topbar-help { display: none; }
/* On a phone, the section viewer's top bar is already full (Back to Topic, Auto-Listen, Report, Home), so Help steps
   aside there; it is on every other learner page. */
@media (max-width: 575.98px) {
  .learner-topbar:has(.learner-topbar-tools) .learner-topbar-help { display: none; }
}

/* ---------------- narration players (22 Oct 2026, partials/narration_player.php, assets/js/narration.js) --- */
/* The Help Centre's articles and the learner welcome panel, recorded with ElevenLabs (Help\Narration). Listen and
   Speed look like the section viewer's (.listen-btn / .speed-btn in learner.css), which this page may not load. */

.narration {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .5rem;
  margin: 1rem 0 0;
}
.narration-listen,
.narration-speed {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .4rem;
  min-height: 44px;
  padding: .45rem .9rem;
  border-radius: var(--oaka-radius-pill);
  background: var(--oaka-surface);
  color: var(--oaka-brand);
  font-weight: 700;
  line-height: 1.15;
}
.narration-listen { border: 1.5px solid var(--oaka-brand); }
.narration-speed { min-width: 44px; border: 1.5px solid var(--oaka-border); }
.narration-speed:hover { border-color: var(--oaka-brand); }
.narration-listen:focus-visible,
.narration-speed:focus-visible { outline: 2px solid var(--oaka-brand); outline-offset: 2px; }
.narration-listen-icon { flex: none; width: 1.1rem; height: 1.1rem; }
.narration-listen--playing { background: var(--oaka-brand); color: #fff; }
.narration-progress {
  display: flex;
  align-items: center;
  gap: .5rem;
  flex: 1 1 12rem;
  min-width: 10rem;
}
.narration-progress[hidden] { display: none; }
.narration-seek { flex: 1 1 auto; min-width: 0; accent-color: var(--oaka-brand); }
.narration-time {
  font-size: .85rem;
  color: var(--oaka-muted);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
@media print {
  .narration { display: none !important; }
}

/* ---------------------------- "?" links to a page's help article (22 Oct 2026, partials/help_link.php) --- */
.help-link { display: inline-flex; align-items: center; gap: .35rem; }
.help-link-icon { flex: none; width: 1rem; height: 1rem; }
.chip.chip--help { color: var(--oaka-brand); background: transparent; border: 1px solid var(--oaka-border); text-decoration: none; }
.chip.chip--help:hover, .chip.chip--help:focus-visible { background: var(--oaka-tint); color: var(--oaka-brand-dark); }
.chip.chip--help .help-link-icon { width: .95rem; height: .95rem; }
.help-inline-link { color: var(--oaka-brand); font-weight: 700; white-space: nowrap; }

/* Approval screen: Next That Needs You (27 Oct 2026), a floating button drawn by approve.js. */
.ap-next-attention {
  position: fixed; right: 1.25rem; bottom: 1.25rem; z-index: 1030;
  display: inline-flex; align-items: center; gap: .5rem;
  padding: .6rem 1rem; border: 0; border-radius: var(--oaka-radius-pill);
  background: var(--oaka-brand); color: #fff; font-weight: 700; font-size: .95rem;
  box-shadow: var(--oaka-shadow-lift); cursor: pointer;
}
.ap-next-attention:hover, .ap-next-attention:focus-visible { background: var(--oaka-brand-dark); }
.ap-next-attention::after { content: "\2193"; font-weight: 800; }
.ap-next-count {
  display: inline-flex; align-items: center; justify-content: center; min-width: 1.6rem; height: 1.6rem; padding: 0 .4rem;
  border-radius: var(--oaka-radius-pill); background: #fff; color: var(--oaka-brand); font-size: .8rem;
}
.ap-attention-flash { animation: ap-attention-flash 1.6s ease-out; }
@keyframes ap-attention-flash { 0%, 30% { box-shadow: 0 0 0 4px var(--oaka-accent); } 100% { box-shadow: 0 0 0 4px transparent; } }
@media (prefers-reduced-motion: reduce) { .ap-attention-flash { animation: none; } }
@media (max-width: 575.98px) { .ap-next-attention { right: .75rem; bottom: .75rem; font-size: .88rem; } }
body.has-ap-next .oaka-toast-host { bottom: 4.5rem; }

/* Subscripts and superscripts in content words (27 Oct 2026, Content\SubSup and oaka.subsup in app.js): CO₂, O²⁻ and
   Mᵣ drawn as <sub class="ss">/<sup class="ss"> with ordinary characters, so they use our own font, without making
   the line taller. */
sub.ss, sup.ss { font-size: .72em; line-height: 0; position: relative; vertical-align: baseline; }
sup.ss { top: -.45em; }
sub.ss { bottom: -.24em; }

/* ------------------------------------------------------------------------------------------------------------------
   Quiz repeats and the question editor's answers (27 Oct 2026): the approval screen's Possible Repeats panel
   (partials/approve_panel_repeats.php) and the answers of a quiz question being edited, on the approval screen and the
   quiz editor (partials/question_answers_edit.php, assets/js/question-edit.js).
   ------------------------------------------------------------------------------------------------------------------ */
.ap-rep { margin: .6rem 0 0; padding: .6rem .7rem; border: 1px solid var(--oaka-border); border-radius: var(--oaka-radius-admin); background: var(--oaka-bg); }
.ap-rep-why { margin: 0 0 .5rem; font-size: .88rem; }
.ap-rep-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr)); gap: .6rem; }
.ap-rep-q { display: flex; flex-direction: column; gap: .3rem; padding: .55rem .65rem; background: var(--oaka-surface); border: 1px solid var(--oaka-border); border-radius: var(--oaka-radius-admin); min-width: 0; }
.ap-rep-q .ap-prompt { margin: 0; }
.ap-rep-q form { margin-top: auto; }
.ap-rep-quiz { margin: 0; display: flex; flex-wrap: wrap; align-items: center; gap: .3rem .5rem; font-size: .85rem; }
.ap-rep-warn { margin: 0; font-size: .8rem; color: #8c4a00; }
.ap-rep-not { display: flex; flex-wrap: wrap; align-items: center; gap: .3rem .6rem; margin-top: .5rem; }
.ap-rep-judge { margin-top: .6rem; }
.ap-rep-out { margin-top: .6rem; font-size: .88rem; }
.ap-rep-out > summary { cursor: pointer; font-weight: 700; color: var(--oaka-brand); }
.ap-rep-out-list { list-style: none; margin: .4rem 0 0; padding: 0; display: grid; gap: .35rem; }
.ap-rep-out-list li { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .3rem .6rem; padding: .35rem .5rem; border: 1px solid var(--oaka-border); border-radius: var(--oaka-radius-admin); background: var(--oaka-surface); }
.ap-rep-out-list li > span { flex: 1 1 16rem; min-width: 0; }

/* "Not About This Topic" (28 Oct 2026, migration 083): an old-site question the checkers think belongs elsewhere. */
.ap-offtopic { margin: .5rem 0; padding: .55rem .7rem; border: 1px solid #e8b56a; border-left-width: 4px; border-radius: var(--oaka-radius-admin); background: #fff8ec; }
.ap-offtopic-title { margin: 0 0 .25rem; font-size: .95rem; font-weight: 800; color: #6b3a00; }
.ap-offtopic p { margin: 0 0 .35rem; font-size: .88rem; }
.ap-offtopic .ap-actions { margin-top: .35rem; }

.qe-warn { margin: 0 0 .5rem; padding: .4rem .6rem; font-size: .85rem; color: #6b3a00; background: #fff4e0; border: 1px solid #e8b56a; border-radius: var(--oaka-radius-admin); }
.qe-multi { display: flex; align-items: center; gap: .5rem; margin: .1rem 0 .1rem; padding-left: 0; min-height: 0; font-size: .9rem; }
.qe-multi .form-check-input { float: none; margin: 0; flex-shrink: 0; }
.qe-multi .form-check-label { margin: 0; font-weight: 600; }
.qe-help { margin: .1rem 0 .45rem; font-size: .78rem; line-height: 1.35; color: var(--oaka-muted); }
.qe-rows { display: grid; gap: .35rem; margin-bottom: .15rem; }
.qe-row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: .45rem; }
.qe-row[hidden] { display: none; }
.qe-field { display: flex; align-items: center; gap: .4rem; min-width: 0; }
.qe-field .form-control { flex: 1 1 auto; min-width: 0; }
.qe-bin-space { width: 5.6rem; }

/* The "Right" tick: a real checkbox kept for the keyboard and the form, drawn as a round tick (pick one) or a square one
   (pick all that apply). */
.qe-tick, .qe-bin { position: relative; display: inline-flex; align-items: center; gap: .3rem; margin: 0; cursor: pointer; user-select: none; }
.qe-tick-input, .qe-bin-input { position: absolute; opacity: 0; width: 1px; height: 1px; margin: 0; pointer-events: none; }
.qe-tick-box { display: inline-flex; align-items: center; justify-content: center; width: 1.45rem; height: 1.45rem; flex-shrink: 0;
  border: 2px solid var(--oaka-border); border-radius: 50%; background: var(--oaka-surface); color: transparent; transition: background .12s ease, border-color .12s ease; }
.qe-tick-box svg { width: 1rem; height: 1rem; }
.qe:has(.qe-multi-input:checked) .qe-tick-box { border-radius: 5px; }
.qe-tick-word { font-size: .78rem; font-weight: 700; color: var(--oaka-muted); min-width: 2.2rem; }
.qe-tick:hover .qe-tick-box { border-color: var(--oaka-accent); }
.qe-tick-input:checked + .qe-tick-box { background: var(--oaka-accent); border-color: var(--oaka-accent); color: #fff; }
.qe-tick-input:checked ~ .qe-tick-word { color: #3d5400; }
.qe-tick-input:focus-visible + .qe-tick-box, .qe-bin-input:focus-visible + .qe-bin-face { outline: 2px solid var(--oaka-brand); outline-offset: 2px; }

/* Remove: a small button-like toggle; ticked, it turns red and the answer is struck through. */
.qe-bin-face { display: inline-flex; align-items: center; justify-content: center; gap: .25rem; min-width: 5.6rem; padding: .2rem .5rem; font-size: .78rem; font-weight: 600; color: var(--oaka-muted);
  border: 1px solid var(--oaka-border); border-radius: var(--oaka-radius-admin); background: var(--oaka-surface); white-space: nowrap; }
.qe-bin-face svg { width: .95rem; height: .95rem; }
.qe-bin:hover .qe-bin-face { border-color: #d9807a; color: #8c1d18; }
.qe-bin-input:checked + .qe-bin-face { background: #fdecea; border-color: #d9807a; color: #8c1d18; }
.qe-row:has(.qe-bin-input:checked) .qe-text { text-decoration: line-through; opacity: .55; }
.qe-row:has(.qe-bin-input:checked) .qe-tick { opacity: .45; }
.qe-add { padding: 0; font-weight: 700; text-decoration: none; }
@media (max-width: 480px) {
  .qe-tick-word { display: none; }
  .qe-bin-face span { display: none; }
  .qe-bin-face { padding: .25rem .4rem; min-width: 2rem; }
  .qe-bin-space { width: 2rem; }
}

/* 28 Oct 2026: "Buy the Printed Topic Pack" beside a topic, for parents, teachers and admins only
   (partials/printed_pack_link.php, Commerce\PrintedPacks). Small and quiet: a way to the shop, not an advert. */
.printed-pack-link { display: inline-flex; align-items: center; gap: .3rem; font-size: .82rem; font-weight: 600; color: var(--oaka-brand); text-decoration: none; }
.printed-pack-link:hover, .printed-pack-link:focus-visible { text-decoration: underline; }
.printed-pack-icon { width: .95rem; height: .95rem; flex: 0 0 auto; }

/* ---- Replace Picture (17 Nov 2026, Content\ReplacePicture): a section's new picture, waiting beside its own ---- */
.ap-new-picture,
.replace-picture-new { margin: .75rem 0 0; padding: .5rem; border: 2px dashed var(--oaka-stage-booklet-fg); border-radius: var(--oaka-radius-admin); background: var(--oaka-stage-booklet-bg); }
.ap-new-picture img,
.replace-picture-new img { display: block; width: 100%; height: auto; border-radius: 6px; background: #fff; }
.ap-new-picture-label,
.replace-picture-label { margin: 0 0 .4rem; font-size: .8rem; font-weight: 700; color: var(--oaka-stage-booklet-fg); }
.ap-new-picture .ap-note { margin: .4rem 0 0; }
.bk-box-newpic { color: var(--oaka-stage-booklet-fg); font-weight: 700; }
.bk-box-link + .bk-box-link { margin-left: .5rem; }

/* 3D Models to Check (/admin/models) and the approval screen's 3D Models panel: one line a model. */
.mr-row { display: flex; align-items: center; gap: .75rem; padding: .45rem 0; border-top: 1px solid var(--oaka-border); }
.mr-row:first-child { border-top: 0; }
.mr-row-pic { width: 4.5rem; height: 2.8rem; flex: 0 0 auto; object-fit: cover; border-radius: var(--oaka-radius-admin); background: var(--oaka-tint); }
.mr-row-body { flex: 1 1 auto; min-width: 0; display: flex; flex-wrap: wrap; align-items: baseline; gap: .15rem .5rem; }
.mr-row-title { font-weight: 600; }
.mr-row-line { flex: 1 1 100%; font-size: .85rem; color: var(--oaka-muted); }
.mr-chip { display: inline-block; padding: .05rem .5rem; border-radius: var(--oaka-radius-pill); font-size: .75rem; font-weight: 700; }
.mr-chip--good { background: var(--oaka-stage-published-bg); color: var(--oaka-stage-published-fg); }
.mr-chip--problem { background: var(--oaka-stage-stuck-bg); color: var(--oaka-stage-stuck-fg); }
.mr-chip--wait { background: var(--oaka-stage-machine-bg); color: var(--oaka-stage-machine-fg); }
