/* fonts.css and tokens.css are linked from base.html, each with its own
 * cache-busting version: an @import here would be cached forever. */

/* FRED — the whole component layer. Hand-authored, no framework, no build step.
 *
 * Components are CSS classes applied to inline markup, not Jinja macros. That
 * is a deliberate choice inherited from BEE-BOSS: it keeps the markup on the
 * page you are reading, and the cost — some repetition — is cheaper than the
 * indirection of chasing a macro to find out what a card actually renders.
 *
 * Sections: Reset · Type · Layout · Card · Status · Buttons · Forms · Table ·
 *           Alerts · Shell · Auth · Wordmark · Import · Utilities
 */

/* ------------------------------------------------------------------ Reset */

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-ui);
  font-size: var(--text-base);
  font-weight: 600;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  /* Tabular figures everywhere: a column of marks or percentages that jitters
     as digits change is hard to scan down. */
  font-variant-numeric: tabular-nums;
}

h1, h2, h3, h4, p, figure, blockquote, dl, dd { margin: 0; }
ul, ol { margin: 0; padding: 0; }
img, svg { max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }

h1, h2, h3, h4, p, li, td, th, label, dd, dt {
  overflow-wrap: break-word;
}

:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: var(--space-2);
  z-index: 100;
  padding: var(--space-2) var(--space-4);
  background: var(--brand);
  color: var(--brand-on);
  border-radius: var(--radius);
  font-weight: 600;
}
.skip-link:focus { left: var(--space-2); }

/* ------------------------------------------------------------------- Type */

/* Poppins for titles and headings, sentence case, 600. */
h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: -0.015em;
}
h1 { font-size: 2.125rem; line-height: 1.1; }
h2 { font-size: 1.5rem; line-height: 1.2; }
h3 { font-size: 1.25rem; line-height: 1.25; }

/* Links are teal, never red: red is for the primary action and the active
   nav item only. --teal-shadow is the darker teal that clears contrast. */
a { color: var(--teal-shadow); text-decoration-thickness: 2px; text-underline-offset: 3px; }
a:hover { color: var(--ink); }

.eyebrow {
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--teal-shadow);
}
.eyebrow-muted { color: var(--ink-soft); }
.eyebrow-coach { color: var(--navy); }

.lede { font-size: var(--text-lg); color: var(--text-muted); }
.muted { color: var(--text-muted); }
.subtle { color: var(--text-subtle); font-size: var(--text-sm); }
.mono { font-family: var(--font-mono); font-size: var(--text-sm); }
.prose { max-width: 62ch; }

.metric {
  font-family: var(--font-display);
  font-size: 3.25rem;
  font-weight: 600;
  line-height: 1;
  letter-spacing: -0.015em;
  color: var(--ink);
}
.metric-ink { color: var(--text); }

.stat-label {
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  color: var(--text-muted);
}

/* ----------------------------------------------------------------- Layout */

.container {
  width: 100%;
  max-width: var(--layout-max);
  margin-inline: auto;
  padding: var(--space-6) var(--space-5) var(--space-8);
}

/* Owl selectors: spacing is a property of the stack, not of each child, so a
   component can be dropped anywhere without carrying margins with it. */
.stack > * + * { margin-top: var(--space-4); }
.stack-sm > * + * { margin-top: var(--space-2); }
.stack-lg > * + * { margin-top: 1.5rem; }

.row { display: flex; align-items: center; gap: var(--space-3); }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); }
.row-wrap { display: flex; align-items: center; gap: var(--space-3); flex-wrap: wrap; }
.row-top { align-items: flex-start; }

.grid { display: grid; gap: var(--space-4); }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.grid-4 { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }

/* ------------------------------------------------------------------- Card */

.card {
  background: var(--surface);
  border: 2px solid var(--line);
  border-radius: var(--radius-card);
  padding: 24px;
  box-shadow: var(--block-card);   /* solid offset, no blur: a physical block */
}
.card-tight { padding: var(--space-4); }
.card-flush { padding: 0; overflow: hidden; }

.card-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-3);
  flex-wrap: wrap;
}

/* The Today's Lesson panel and anything else that wants the sidebar's weight. */
.card-dark {
  background: var(--dark);
  color: var(--dark-on);
  border: 2px solid var(--dark);
  border-radius: var(--radius-card);
  box-shadow: 0 5px 0 var(--dark-raised);
  padding: var(--space-6);
}
.card-dark .muted { color: var(--dark-on-muted); }
.card-dark h1, .card-dark h2 { color: var(--dark-on); }

/* ----------------------------------------------------------------- Status */

/* Never colour alone: every status renders a dot AND its word. Roughly 8% of
   boys have a colour vision deficiency, which in a class of thirty is two of
   them, and red/green is the specific pair they cannot separate. */
.status {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: 2px var(--space-3) 2px var(--space-2);
  border-radius: var(--radius-pill);
  font-size: var(--text-xs);
  font-weight: 600;
  white-space: nowrap;
}
/* No contrast ring on the dot: the token set already guarantees each dot
   clears 3:1 against its own fill, so a ring would only muddy the colour. */
.status::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex: none;
}

.status-ok   { background: var(--teal-tint); color: var(--ink); }
.status-ok::before   { background: var(--teal); }
/* Overdue is ink with an amber marker, never red. */
.status-late { background: var(--ink); color: #fff; }
.status-late::before { background: var(--amber); }
.status-due  { background: var(--due-soft);  color: var(--due-deep); }
.status-due::before  { background: var(--due-dot); }
.status-idle { background: var(--idle-soft); color: var(--idle-deep); }
.status-idle::before { background: var(--idle-dot); }

/* ---------------------------------------------------------------- Buttons */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  min-height: 52px;
  padding: 0 26px;
  border: 2px solid transparent;
  border-radius: var(--radius-btn);
  background: none;
  font-family: var(--font-ui);
  font-size: 1rem;
  font-weight: 800;
  cursor: pointer;
  text-decoration: none;
  transition: transform var(--dur-fast) var(--ease), box-shadow var(--dur-fast) var(--ease),
              background var(--dur) var(--ease);
}
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* Every solid button is a block that presses down: the shadow shrinks as the
   face moves onto it. */
.btn-primary { background: var(--red); color: #fff; box-shadow: 0 6px 0 var(--red-shadow); }
.btn-primary:hover:not(:disabled) { color: #fff; }
.btn-primary:active:not(:disabled) { transform: translateY(5px); box-shadow: 0 1px 0 var(--red-shadow); }

/* Ghost: white, ink text, a quiet line. The everyday secondary action. */
.btn-secondary {
  background: var(--surface);
  border-color: var(--line);
  color: var(--ink);
  padding: 0 18px;
  box-shadow: 0 5px 0 var(--line-strong);
}
.btn-secondary:hover:not(:disabled) { color: var(--ink); background: var(--paper); }
.btn-secondary:active:not(:disabled) { transform: translateY(4px); box-shadow: 0 1px 0 var(--line-strong); }

/* Coach: anything the coach set or says. Navy on white. */
.btn-coach {
  background: var(--surface);
  border-color: var(--navy);
  color: var(--navy);
  padding: 0 18px;
  box-shadow: 0 5px 0 var(--navy-shadow);
}
.btn-coach:hover:not(:disabled) { color: var(--navy); background: var(--navy-tint); }
.btn-coach:active:not(:disabled) { transform: translateY(4px); box-shadow: 0 1px 0 var(--navy-shadow); }


.btn-ghost { color: var(--ink-soft); }
.btn-ghost:hover:not(:disabled) { background: var(--empty); color: var(--ink); }


/* Small stays a 44px target: only the type and padding shrink. */
.btn-sm { min-height: 44px; padding: 0 16px; font-size: 0.875rem; }
.btn-block { width: 100%; }

/* ------------------------------------------------------------------ Forms */

.field { display: flex; flex-direction: column; gap: var(--space-2); }
.field label { font-size: var(--text-sm); font-weight: 700; }

.input, .textarea, .select {
  width: 100%;
  min-height: 44px;
  padding: var(--space-2) var(--space-3);
  border: 2px solid var(--line-strong);
  border-radius: var(--radius-input);
  background: var(--surface);
  color: var(--text);
  transition: border-color var(--dur) var(--ease);
}
.input:hover, .textarea:hover, .select:hover { border-color: var(--ink-faint); }
.textarea { min-height: 120px; resize: vertical; line-height: var(--leading-normal); }

.field-hint { font-size: var(--text-sm); color: var(--text-muted); }
.field-error { font-size: var(--text-sm); color: var(--ink); font-weight: 800; }

.file-input {
  padding: var(--space-4);
  border: 2px dashed var(--border-strong);
  border-radius: var(--radius);
  background: var(--bg-sunken);
  width: 100%;
}

/* A file chosen for a hand-in: its name and size, and a button to take it away. */
.file-pick { display: flex; flex-direction: column; gap: var(--space-2); }
.file-chosen { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: var(--space-2) var(--space-3); }
.file-chosen[hidden], .file-pick [hidden], [data-sending][hidden] { display: none; }
.file-chosen-line { margin: 0; min-width: 0; overflow-wrap: anywhere; }

/* ------------------------------------------------------------------ Table */

.table-wrap { position: relative; overflow-x: auto; border: 2px solid var(--line); border-radius: 18px; }

.table { width: 100%; border-collapse: collapse; font-size: var(--text-sm); background: var(--bg-raised); }
.table th, .table td { padding: var(--space-3) var(--space-4); text-align: left; }
.table thead th {
  position: sticky;
  top: 0;
  background: var(--bg-sunken);
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.table tbody tr + tr td { border-top: 1px solid var(--border); }
.table tbody tr:hover td { background: var(--bg-sunken); }
.table .num { text-align: right; }

.row-bad td { background: var(--amber-tint); }
.row-bad:hover td { background: var(--amber-tint); }
.row-skip td { color: var(--text-muted); }

/* ----------------------------------------------------------------- Alerts */

.alert {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  padding: var(--space-4);
  border-radius: var(--radius);
  border: 1px solid;
  font-size: var(--text-sm);
}
.alert svg { flex: none; width: 20px; height: 20px; margin-top: 1px; }
.alert-error   { background: var(--amber-tint); border-color: var(--amber); color: var(--ink); }
.alert-success { background: var(--ok-soft);   border-color: var(--ok-dot);   color: var(--ok-deep); }
.alert-info    { background: var(--bg-sunken); border-color: var(--border-strong); color: var(--text); }
.alert-warn    { background: var(--due-soft);  border-color: var(--due-dot);  color: var(--due-deep); }

/* ------------------------------------------------------------------ Shell */

.shell {
  display: grid;
  grid-template-areas: "bar" "main";
  grid-template-columns: 1fr;
  min-height: 100dvh;
}

.nav-badge {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 var(--space-2);
  border-radius: var(--radius-pill);
  background: var(--brand);
  color: #fff;
  font-size: var(--text-xs);
  font-weight: 700;
  flex: none;
}
.avatar {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  flex: none;
  border-radius: 50%;
  background: var(--empty);
  color: var(--ink);
  font-size: var(--text-sm);
  font-weight: 800;
}
.avatar-own { background: var(--red); color: #fff; }
.avatar-coach { background: var(--navy); color: #fff; }
.avatar-photo {
  border-radius: 50%;
  object-fit: cover;
  flex: none;
}

.shell-main { grid-area: main; min-width: 0; }

/* ------------------------------------------------------------------- Auth */

.auth {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: var(--space-5);
  background: var(--paper);
  color: var(--ink);
}
.auth-inner { width: 100%; max-width: 26rem; }
.auth-head { text-align: center; margin-bottom: var(--space-5); }
.auth-head .tagline { color: var(--ink-soft); font-size: var(--text-sm); margin-top: var(--space-3); }
.auth-logo { display: block; width: 200px; height: auto; margin-inline: auto; }
.auth-card {
  background: var(--surface);
  color: var(--ink);
  border: 2px solid var(--line);
  border-radius: var(--radius-card);
  padding: var(--space-6);
  box-shadow: var(--block-card);
}
.auth-foot { margin-top: var(--space-5); text-align: center; font-size: var(--text-sm); color: var(--ink-soft); }
.auth-foot a { color: var(--teal-shadow); font-weight: 600; }

/* --------------------------------------------------------------- Wordmark */

/* Letters take currentColor so the mark works on the dark sidebar and on
   paper; only the full stop is locked to brand red. */

/* ----------------------------------------------------------------- Import */

.import-summary {
  display: grid;
  gap: var(--space-3);
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
}
.import-tally {
  padding: var(--space-4);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-raised);
}
.import-tally .n { font-size: var(--text-2xl); font-weight: 700; line-height: 1; }
.import-tally.is-create .n { color: var(--ok-deep); }
.import-tally.is-skip .n { color: var(--text-muted); }
.import-tally.is-error .n { color: var(--ink); }

.link-list { list-style: none; font-size: var(--text-sm); }
.link-list li { padding: var(--space-2) 0; border-top: 1px solid var(--border); }
.link-list li:first-child { border-top: none; }
.link-list code { font-family: var(--font-mono); font-size: var(--text-xs); word-break: break-all; }

/* ------------------------------------------------------------ The lesson */

/* The lesson: one column of content with the Idea Journal under it. The steps of the lesson sit above it
   as a row of stepping stones (below). */
.lesson-layout { display: grid; gap: var(--space-4); grid-template-columns: minmax(0, 1fr); }
.lesson-main { display: flex; flex-direction: column; gap: var(--space-4); min-width: 0; }

/* The steps of a lesson, as stepping stones across the page, wrapping onto the next row when there are
   many. The same look as the programme's blocks: teal when done, red for the step you are on. */
.lesson-path-stones { list-style: none; display: flex; flex-wrap: wrap; gap: var(--space-5) var(--space-2); padding: 0 0 var(--space-2); margin: 0; }
.lesson-stone { flex: 0 0 auto; width: 5.75rem; }
.lesson-stone-link { display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center; text-decoration: none; color: inherit; }
.lesson-stone-link:hover { color: inherit; }
.lesson-stone-dot {
  display: grid; place-items: center; width: 48px; height: 48px; border-radius: 16px;
  font-family: var(--font-display); font-weight: 700; font-size: var(--text-lg);
  background: var(--empty); color: var(--ink-soft);
  box-shadow: 0 5px 0 var(--line-strong);
  transition: transform var(--dur) var(--ease);
}
/* Every other stone sits a little lower, so the row reads as a path and not a table. */
.lesson-stone:nth-child(even) .lesson-stone-dot { margin-top: 8px; }
.lesson-stone-link:hover .lesson-stone-dot { transform: translateY(-2px); }
.lesson-stone.is-done .lesson-stone-dot { background: var(--teal); color: var(--ink); box-shadow: 0 5px 0 var(--teal-shadow); }
.lesson-stone.is-current .lesson-stone-dot { background: var(--red); color: #fff; box-shadow: 0 5px 0 var(--red-shadow), 0 0 0 5px var(--red-tint); }
.lesson-stone-label {
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow: hidden;
  font-size: var(--text-xs); font-weight: 700; line-height: 1.25;
}
.lesson-stone-kind { font-size: var(--text-xs); color: var(--text-muted); line-height: 1.2; }
.lesson-stone.is-current .lesson-stone-kind { color: var(--ink); font-weight: 800; }
/* On a phone the stones are a little smaller, so four fit on a row. */
@media (max-width: 40rem) {
  .lesson-path-stones { gap: var(--space-4) var(--space-1); }
  .lesson-stone { width: 4.7rem; }
  .lesson-stone-dot { width: 40px; height: 40px; border-radius: 13px; font-size: var(--text-base); }
  .lesson-stone-label, .lesson-stone-kind { font-size: 0.6875rem; }
}
@media (prefers-reduced-motion: reduce) { .lesson-stone-dot { transition: none; } .lesson-stone-link:hover .lesson-stone-dot { transform: none; } }
}

/* A notebook, not a form: soft surfaces throughout, no boxed input border. */
.lesson-notes { background: var(--paper); border: 2px solid var(--line); border-radius: 18px; padding: var(--space-4); }
.notes-details summary {
  cursor: pointer;
  font-weight: 600;
  list-style: none;
}
.notes-details summary::-webkit-details-marker { display: none; }
.notes-body { margin-top: var(--space-3); }

.coach-avatar {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--navy);
  color: #fff;
  flex: none;
}

.notes-textarea {
  display: block;
  width: 100%;
  min-height: 10rem;
  resize: vertical;
  border: none;
  background: var(--bg-raised);
  border-radius: var(--radius);
  padding: var(--space-3);
  font: inherit;
  line-height: var(--leading-normal);
  color: var(--text);
}
.notes-textarea:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 2px;
}

.task-card {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  min-height: 44px;
  background: var(--surface);
  border: 2px solid var(--line);
  border-radius: 18px;
  box-shadow: 0 4px 0 var(--line);
  text-decoration: none;
  color: inherit;
  transition: border-color var(--dur) var(--ease), background var(--dur) var(--ease);
}
.task-card:hover { border-color: var(--border-strong); color: inherit; }
.task-card.is-current {
  border-color: var(--teal);
  background: var(--teal-tint);
}

.task-title { display: block; font-weight: 600; font-size: var(--text-sm); }
.task-kind { display: block; font-size: var(--text-xs); color: var(--text-muted); }

/* The tick is an outline until the work is done, so an unfinished lesson reads
   as a column of empty circles waiting to be filled. */
.task-tick {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  flex: none;
  margin-top: 1px;
  border-radius: 50%;
  border: 2px solid var(--border-strong);
  color: transparent;
}
.task-tick.is-done {
  background: var(--teal);
  border-color: var(--teal);
  color: var(--ink);
}

.lesson-row {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  min-height: 44px;
  background: var(--surface);
  border: 2px solid var(--line);
  border-radius: 18px;
  box-shadow: 0 4px 0 var(--line);
  text-decoration: none;
  color: inherit;
  transition: border-color var(--dur) var(--ease);
}
a.lesson-row:hover { border-color: var(--teal); color: inherit; }
/* Locked is dimmed but still legible: a learner should be able to read what is
   coming, just not open it. Hiding it would make the programme feel shorter
   than it is. */
.lesson-row.is-locked { opacity: 0.6; background: var(--bg-sunken); }

/* 16:9, and the iframe fills it. Drive's player needs a real box. */
.embed {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: var(--bg-sunken);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.embed iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

/* -------------------------------------------------------------- Utilities */

.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.divider { height: 1px; background: var(--border); border: none; margin: 0; }
.pill {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: 2px var(--space-3);
  border-radius: var(--radius-pill);
  background: var(--bg-sunken);
  border: 1px solid var(--border);
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--text-muted);
}
.pill-brand { background: var(--empty); border-color: var(--line); color: var(--ink); }

.text-right { text-align: right; }
.nowrap { white-space: nowrap; }

/* --------------------------------------------------- Dashboard: the blocks */

/* Spec 4 asks for blocks rather than a percentage bar. Each cell is a fixed
   shape whose colour, caption and screen-reader text all say the same thing —
   the colour is never the only carrier of the state. */

.quote {
  margin: 0;
  font-size: var(--text-lg);
  line-height: 1.45;
  color: var(--text);
  border-left: 3px solid var(--teal);
  padding-left: var(--space-4);
}

/* Total progress, as a filled proportion rather than a digit — the bar itself
   is the headline, the count underneath is the detail. Shared by Home's
   Programme Progress box and every module card on the Progress tab —
   partials/progress_bar.html is the one place that renders it. */
.progress-bar-wrap {
  position: relative;
  /* Half the marker's overhang above and below the 20px track. */
  padding: 10px 0;
}
.progress-bar {
  height: 20px;
  border-radius: var(--radius-pill);
  background: var(--empty);
  overflow: hidden;
}
.progress-bar-fill {
  height: 100%;
  background: var(--teal);
  box-shadow: inset 0 -4px 0 var(--teal-shadow);
  border-radius: var(--radius-pill);
  transition: width var(--dur-slow) var(--ease);
}
/* The marker sits outside `.progress-bar`, not inside the fill, so it is never
   clipped by the track's rounded corners. Its box is a fixed size: an auto
   width fights the global `svg { max-width: 100% }` reset and collapses to
   zero inside an absolutely positioned parent. Clamped so it stays inside the
   track at 0% and 100%. */
.progress-bar-marker {
  position: absolute;
  top: 1px;
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--surface);
  border: 3px solid var(--teal);
  color: var(--red);
  transform: translateX(-50%) rotate(45deg);
  transition: left var(--dur-slow) var(--ease);
}

/* --------------------------------------------------- The Personal Profile */

.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  border-bottom: 1px solid var(--border);
  padding-bottom: var(--space-3);
}
.tab {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  min-height: 40px;
  padding: 0 var(--space-4);
  border-radius: var(--radius-pill);
  border: 1px solid var(--border);
  background: var(--bg-raised);
  color: var(--text-muted);
  font-size: var(--text-sm);
  font-weight: 600;
  text-decoration: none;
}
.tab:hover { color: var(--text); border-color: var(--border-strong); }
.tab.is-current { background: var(--ink); border-color: var(--ink); color: #fff; }

/* An entry and its edit field are the same thing. The old app made editing a
   separate journey, which is how it ended up with no journey at all. */
.entry { display: flex; align-items: flex-start; gap: var(--space-2); }


.card-chosen { border-color: var(--ok-dot); box-shadow: inset 3px 0 0 var(--ok-dot); }

/* The canvas keeps Osterwalder's shape where there is room for it, and falls
   back to a single column on a phone rather than shrinking nine boxes into
   unreadable slivers. */
.canvas-grid { display: grid; gap: var(--space-3); grid-template-columns: 1fr; }
.canvas-box { gap: var(--space-3); display: flex; flex-direction: column; }
/* The boxes in a row are different heights by nature — nine prompts of
   different lengths — so the writing area takes the slack rather than leaving
   a ragged column of textareas. */
.canvas-box form { flex: 1; display: flex; flex-direction: column; }
.canvas-box .textarea { flex: 1; }
.canvas-box button { align-self: flex-start; }

@media (min-width: 48rem) {
  .canvas-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 72rem) {
  .canvas-grid {
    grid-template-columns: repeat(4, 1fr);
    grid-template-areas:
      "partners activities value  segments"
      "partners resources  value  relations"
      "channels channels   costs  revenue";
  }
  .canvas-key_partners           { grid-area: partners; }
  .canvas-key_activities         { grid-area: activities; }
  .canvas-key_resources          { grid-area: resources; }
  .canvas-value_propositions     { grid-area: value; }
  .canvas-customer_segments      { grid-area: segments; }
  .canvas-customer_relationships { grid-area: relations; }
  .canvas-channels               { grid-area: channels; }
  .canvas-cost_structure         { grid-area: costs; }
  .canvas-revenue_streams        { grid-area: revenue; }
}

/* ------------------------------------------------------------ Leaderboard */

/* A learner scanning a class list is looking for one row. Marking it costs a
   tint and a left edge — enough to find, not enough to shout. */
.row-me td {
  background: var(--teal-tint);
  font-weight: 600;
}
.row-me td:first-child { box-shadow: inset 3px 0 0 var(--teal); }

/* ------------------------------------------------------------- Tutor chat */

.chat {
  display: grid;
  gap: var(--space-3);
  max-height: 28rem;
  overflow-y: auto;
  padding: var(--space-2);
  background: var(--bg-sunken);
  border-radius: var(--radius);
}

.bubble {
  max-width: 52ch;
  padding: var(--space-3) var(--space-4);
  border-radius: 18px;
  font-size: var(--text-sm);
  line-height: var(--leading-normal);
}
/* Only the message itself keeps its line breaks, never the template's. */
.bubble-body { white-space: pre-wrap; overflow-wrap: anywhere; }
.bubble-who {
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  opacity: .75;
  margin-bottom: 2px;
}
/* The learner's own words on the right, the tutor's on the left — the
   convention every messaging app has trained them on. */
.bubble-user {
  justify-self: end;
  background: var(--teal);
  color: var(--ink);
  border-bottom-right-radius: var(--radius-sm);
}
.bubble-assistant {
  justify-self: start;
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-bottom-left-radius: var(--radius-sm);
}

/* Instruction text written as lines (a numbered list, short paragraphs) keeps its line breaks. */
.prose-lines { white-space: pre-line; }

/* A task's instructions: headings, steps, lists and notes with room to breathe (app/text_format.py). */
.instructions { max-width: 68ch; font-size: var(--text-base); line-height: var(--leading-normal); }
.instructions > * { margin: 0; }
.instructions > * + * { margin-top: var(--space-4); }
.instructions-title { font-size: var(--text-xl); line-height: var(--leading-snug); margin: 0; }
.instructions-heading {
  font-size: var(--text-lg); line-height: var(--leading-snug);
  margin: 0; padding-top: var(--space-3); border-top: 1px solid var(--border);
}
.instructions > .instructions-title + *, .instructions > .instructions-heading + *, .instructions > .instructions-subheading + * { margin-top: var(--space-3); }
.instructions > .instructions-heading { margin-top: var(--space-6); }
.instructions-subheading { font-size: var(--text-base); margin: 0; color: var(--text); }
.instructions-subheading { margin-top: var(--space-5); }
.instructions-list { padding-left: 1.4rem; }
.instructions-list li { padding-left: 0.2rem; }
.instructions-list li + li { margin-top: var(--space-2); }
.instructions-list .instructions-list { margin-top: var(--space-2); }
ul.instructions-list { list-style: disc; }
ul.instructions-list ul.instructions-list { list-style: circle; }
.instructions-note { margin-top: var(--space-5); }
.instructions-note p { margin: 0; }

/* Coach FRED leading the chat: his robot beside what he says, and an introduction before it starts. */
.tutor-head { display: flex; align-items: center; gap: var(--space-3); }
.tutor-avatar {
  width: 44px; height: 44px; flex: none;
  border-radius: 50%;
  object-fit: cover; object-position: top;
  background: var(--teal-tint);
  border: 1px solid var(--border);
}
.bubble-row { display: flex; align-items: flex-end; gap: var(--space-2); justify-self: start; max-width: 100%; }
.tutor-intro {
  display: flex; align-items: center; gap: var(--space-5);
  padding: var(--space-4) var(--space-5);
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.tutor-intro-img { width: 120px; height: auto; flex: none; }
/* Quick / In-depth: how much Coach FRED says. Two plain radio buttons dressed as chips, no script. */
.pace { display: inline-flex; gap: var(--space-2); border: 0; padding: 0; margin: 0 var(--space-3) 0 0; }
.pace-choice input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.pace-choice span {
  display: inline-block; padding: 6px 14px; border-radius: var(--radius-chip, 999px);
  border: 1px solid var(--border); background: var(--bg-raised); font-size: var(--text-sm); cursor: pointer;
}
.pace-choice input:checked + span { background: var(--navy); color: #fff; border-color: var(--navy); }
.pace-choice input:focus-visible + span { outline: 2px solid var(--teal); outline-offset: 2px; }
@media (max-width: 599.98px) {
  .tutor-intro { flex-direction: column; text-align: center; }
  .tutor-intro-img { width: 96px; }
}

/* ------------------------------------------------- Design system: chips etc. */

.chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 11px;
  border-radius: var(--radius-chip);
  font-size: 0.8125rem;
  font-weight: 800;
  line-height: 1.2;
  color: var(--ink);
  white-space: nowrap;
}
.chip svg { width: 15px; height: 15px; flex: none; }
.chip-done     { background: var(--teal-tint); }
.chip-progress { background: var(--amber-tint); }
.chip-todo     { background: var(--empty); }
.chip-coach    { background: var(--navy-tint); }
/* Overdue is ink, not red: red never means a problem here. */
.chip-overdue  { background: var(--ink); color: #fff; }
.chip-overdue svg { color: var(--amber); }

/* Block progress grid: one square per activity, grouped by module colour. */
.block-grid { display: flex; flex-wrap: wrap; gap: 5px; }
.block-cell { width: 22px; height: 22px; border-radius: 6px; background: var(--empty); }
.block-done.block-tone-0 { background: var(--navy); }
.block-done.block-tone-1 { background: var(--teal); }
.block-done.block-tone-2 { background: var(--amber); }
.block-done.block-tone-3 { background: var(--red); }
.block-next {
  background: var(--surface);
  border: 3px dashed var(--amber);
  animation: block-pulse 1.8s var(--ease) infinite;
}
@keyframes block-pulse {
  0%, 100% { transform: scale(1); }
  50%      { transform: scale(1.14); }
}

/* Badge tile. */
.badge-tile {
  display: inline-grid;
  place-items: center;
  flex: none;
  box-shadow: 0 5px 0 rgb(34 21 19 / 0.18);
  color: #fff;
}
.badge-sm { width: 52px; height: 52px; border-radius: 15px; }
.badge-lg { width: 72px; height: 72px; border-radius: 20px; }
.badge-navy  { background: var(--navy); }
.badge-red   { background: var(--red); }
.badge-teal  { background: var(--teal); color: var(--ink); }
.badge-amber { background: var(--amber); color: var(--ink); }
.badge-number { font-family: var(--font-display); font-weight: 700; font-size: 1.5rem; line-height: 1; }
.badge-lg .badge-number { font-size: 2rem; }
.badge-locked {
  background: var(--empty);
  border: 2px dashed var(--line-strong);
  color: var(--ink-faint);
  box-shadow: none;
}

/* Coach FRED and his speech bubble. One per page. */
.coach-fred { display: flex; align-items: flex-end; gap: var(--space-4); }
.coach-fred-img {
  width: 120px;
  height: auto;
  flex: none;
  animation: coach-float 3.2s ease-in-out infinite;
}
@keyframes coach-float {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-8px); }
}
.coach-fred-bubble {
  max-width: 28ch;
  margin-bottom: var(--space-6);
  padding: 11px 14px;
  border-radius: 18px;
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.35;
}
.coach-fred-on-light .coach-fred-bubble { background: var(--navy); color: #fff; }
.coach-fred-on-navy  .coach-fred-bubble { background: var(--surface); color: var(--ink); }

@media (prefers-reduced-motion: reduce) {
  .coach-fred-img, .block-next { animation: none; }
}

/* ----------------------------------------------- Design system: the sidebar */

.shell-student { background: var(--paper); }
.shell-student .container {
  max-width: 1180px;
  padding: 32px 44px 64px;
}

.side {
  background: var(--surface);
  border-right: 2px solid var(--line);
  display: none;
  flex-direction: column;
  gap: var(--space-5);
  padding: 26px 16px;
  overflow-y: auto;
}
.side-logo { display: block; padding: 0 var(--space-2); }
.side-logo img { display: block; width: 128px; height: auto; }
.side-close { display: none; }

.side-list { list-style: none; display: flex; flex-direction: column; gap: var(--space-1); }
.side-link {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 48px;
  padding: 12px 14px;
  border-radius: var(--radius-nav);
  color: var(--ink);
  font-size: 0.9375rem;
  font-weight: 700;
  text-decoration: none;
}
.side-link svg { width: 22px; height: 22px; flex: none; }
.side-link:hover { background: var(--paper); color: var(--ink); }
.side-link.is-active { background: var(--red); color: #fff; box-shadow: 0 4px 0 var(--red-shadow); }
.side-link .nav-badge { background: var(--navy); color: #fff; }
.side-link.is-active .nav-badge { background: var(--navy); color: #fff; }

.side-foot { margin-top: auto; display: flex; flex-direction: column; gap: var(--space-3); }

.coach-card {
  background: var(--navy);
  color: #fff;
  border-radius: 20px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}
.coach-card-who { display: flex; align-items: center; gap: var(--space-3); }
.coach-card-avatar {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  flex: none;
  border-radius: 50%;
  background: var(--navy-tint);
  color: var(--navy);
  font-weight: 800;
}
.coach-card-eyebrow {
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--amber);
}
.coach-card-name { font-weight: 800; line-height: 1.25; }
.coach-card-link { color: #fff; font-weight: 800; font-size: 0.9375rem; }
.coach-card-link:hover { color: var(--amber); }

.learner-chip { display: flex; align-items: center; gap: var(--space-3); padding: 0 var(--space-2); }
.learner-chip-name { font-weight: 800; font-size: 0.9375rem; line-height: 1.25; }

.topbar { display: none; }

/* Wide: persistent sidebar. */
@media (min-width: 860px) {
  .shell-student {
    grid-template-areas: "nav main";
    grid-template-columns: 248px 1fr;
  }
  .shell-student .side {
    display: flex;
    grid-area: nav;
    position: sticky;
    top: 0;
    height: 100dvh;
  }
}

/* Narrow: a slim top bar, and the sidebar opens as a drawer. No JavaScript:
   the menu button is a link to #sidebar and :target does the rest. */
@media (max-width: 859.98px) {
  .shell-student { grid-template-areas: "bar" "main"; grid-template-columns: 1fr; }
  .shell-student .container { padding: 20px 16px 48px; }
  .topbar {
    grid-area: bar;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 20;
    padding: 10px 16px;
    background: var(--surface);
    border-bottom: 2px solid var(--line);
  }
  .topbar img { display: block; width: 96px; height: auto; }
  .topbar-menu {
    display: grid;
    place-items: center;
    width: 48px;
    height: 48px;
    border-radius: var(--radius-nav);
    border: 2px solid var(--line);
    color: var(--ink);
    box-shadow: 0 4px 0 var(--line-strong);
  }
  .shell-student .side:target {
    display: flex;
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 50;
    width: min(300px, 100%);
    border-right: 2px solid var(--line-strong);
  }
  .shell-student .side:target .side-close {
    display: grid;
    place-items: center;
    position: absolute;
    top: 14px;
    right: 14px;
    width: 44px;
    height: 44px;
    border-radius: var(--radius-nav);
    color: var(--ink);
  }
}

/* An empty stat shows the next small step in words, never a lone dash or 0%. */
.metric-empty {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: 600;
  line-height: 1.3;
  color: var(--ink-soft);
}

/* Teal eyebrows fail contrast on a dark card; amber is the achievement colour
   and reads cleanly on it. */
.card-dark .eyebrow { color: var(--amber); }

/* ------------------------------------------------------- Design system: Home */

.chip-teal  { background: var(--teal);  color: var(--ink); }
.chip-amber { background: var(--amber); color: var(--ink); }
.chip-white { background: var(--surface); border: 2px solid var(--line); }

.coach-fred-stack { flex-direction: column-reverse; align-items: center; gap: var(--space-2); }
.coach-fred-stack .coach-fred-bubble { margin-bottom: 0; text-align: center; }
.coach-fred-stack .coach-fred-img { width: 140px; }

.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: var(--space-4); flex-wrap: wrap; }
.page-head h1 { font-size: 2.125rem; margin-top: var(--space-1); }
.page-sub { color: var(--ink-soft); font-size: 1rem; margin-top: var(--space-1); }

.pts-pill {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: 8px 18px;
  background: var(--surface);
  border: 2px solid var(--line);
  border-radius: var(--radius-pill);
  box-shadow: 0 4px 0 var(--line);
  font-weight: 800;
  color: var(--ink);
  text-decoration: none;
}
.pts-pill svg { color: var(--amber); fill: var(--amber); }
.pts-pill strong { font-family: var(--font-display); font-size: 1.375rem; font-weight: 600; line-height: 1.2; }

.two-col { display: grid; gap: 24px; grid-template-columns: 1.75fr 1fr; align-items: stretch; }
.three-col { display: grid; gap: 24px; grid-template-columns: repeat(3, 1fr); }
@media (max-width: 1099.98px) {
  .two-col, .three-col { grid-template-columns: 1fr; }
}

/* The Up next hero. */
.up-next {
  position: relative;
  overflow: hidden;
  display: flex;
  gap: var(--space-5);
  justify-content: space-between;
  min-height: 320px;
  padding: 32px 34px;
  background: var(--navy);
  color: #fff;
  border-radius: 26px;
  box-shadow: 0 7px 0 var(--navy-shadow);
}
.up-next-body { position: relative; z-index: 1; display: flex; flex-direction: column; gap: var(--space-4); align-items: flex-start; flex: 1; min-width: 0; }
.up-next-chips { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.up-next h2 { font-size: 2.25rem; line-height: 1.1; color: #fff; }
.up-next .eyebrow { color: var(--amber); }
.up-next-desc { color: var(--navy-tint); max-width: 46ch; }
.up-next-body .btn { margin-top: auto; }
.up-next-coach { position: relative; z-index: 1; align-self: flex-end; flex: none; }
.up-next-coach .coach-fred-bubble { background: #fff; color: var(--ink); }
.up-next-blocks { position: absolute; right: 18px; bottom: 0; display: flex; align-items: flex-end; gap: 10px; z-index: 0; }
.up-next-blocks span { width: 54px; border-radius: 16px 16px 0 0; background: rgb(255 255 255 / 0.12); }
.up-next-blocks span:nth-child(1) { height: 90px; }
.up-next-blocks span:nth-child(2) { height: 150px; }
.up-next-blocks span:nth-child(3) { height: 210px; }
@media (max-width: 859.98px) {
  .up-next-coach { display: none; }
  .up-next h2 { font-size: 1.75rem; }
  .up-next { padding: 24px 22px; min-height: 0; }
}

/* Coach-set task. */
.card-coach { border-color: var(--navy); box-shadow: 0 6px 0 var(--navy); display: flex; flex-direction: column; gap: var(--space-3); }
.card-coach .eyebrow { color: var(--navy); }
.card-coach h2 { font-size: 1.5rem; }
.card-coach .btn { margin-top: auto; align-self: flex-start; }

/* Your build so far. */
.build-row { display: grid; grid-template-columns: 210px 1fr auto; gap: var(--space-4); align-items: center; padding: 14px 0; border-top: 2px solid var(--line); }
.build-row:first-of-type { border-top: 0; }
.build-row-name { font-weight: 800; line-height: 1.25; }
.build-row-name small { display: block; font-weight: 600; color: var(--ink-soft); font-size: 0.8125rem; }
.build-row-count { font-weight: 800; color: var(--ink-soft); min-width: 3.5rem; text-align: right; }
.build-row-count.is-done { color: var(--teal-shadow); }
@media (max-width: 699.98px) {
  .build-row { grid-template-columns: 1fr auto; }
  .build-row .block-grid { grid-column: 1 / -1; order: 3; }
}
.big-count { font-family: var(--font-display); font-size: 1.625rem; font-weight: 600; line-height: 1.1; }

.card-link { display: block; color: inherit; text-decoration: none; }
.card-link:hover { color: inherit; }
.rank-number { font-family: var(--font-display); font-size: 3.5rem; font-weight: 600; line-height: 1; letter-spacing: -0.02em; }
.callout-amber { display: flex; gap: var(--space-2); align-items: center; padding: 10px 12px; background: var(--amber-tint); border: 2px solid var(--amber-tint-border); border-radius: 14px; font-weight: 700; font-size: 0.9375rem; }
.callout-amber svg { flex: none; color: var(--ink); }
.badge-row { display: flex; flex-wrap: wrap; gap: 14px; padding: 4px 0 8px; }

.segments { display: flex; flex-wrap: wrap; gap: 4px; }
.segment { flex: 1 1 0; min-width: 8px; height: 12px; border-radius: 4px; background: var(--empty); }
.segment-done { background: var(--teal); }
.segment-doing { background: var(--surface); border: 2px dashed var(--amber); }

.quote-strip { display: flex; flex-wrap: wrap; gap: var(--space-2) var(--space-5); align-items: baseline; padding: 16px 22px; background: var(--amber-tint); border-radius: 18px; }
.quote-strip .eyebrow { color: var(--ink); }
.quote-strip q { font-family: var(--font-display); font-weight: 600; font-size: 1.0625rem; quotes: none; }
.quote-strip strong { font-weight: 800; }

/* ------------------------------------------------- Design system: Programmes */

.programme-hero { display: grid; grid-template-columns: 1fr 300px; gap: var(--space-5); padding: 0; border-radius: 26px; overflow: hidden; }
.programme-hero-body { display: flex; flex-direction: column; gap: var(--space-4); padding: 32px 34px; align-items: flex-start; }
.programme-hero-body > * { max-width: 100%; }
.programme-hero-body > div:not(.row-wrap) { width: 100%; }
.programme-hero h2 { font-size: 2rem; line-height: 1.15; }
.programme-desc { max-width: 560px; }
.programme-skyline { display: flex; align-items: flex-end; gap: 12px; padding: 28px 28px 0; background: var(--navy); }
.programme-skyline span { flex: 1; border-radius: 14px 14px 0 0; }
@media (max-width: 859.98px) {
  .programme-hero { grid-template-columns: 1fr; }
  .programme-skyline { display: none; }
  .programme-hero-body { padding: 24px 22px; }
}
.two-col-programme { grid-template-columns: 1.6fr 1fr; align-items: start; }
@media (max-width: 1099.98px) { .two-col-programme { grid-template-columns: 1fr; } }

.module-row {
  display: flex; align-items: center; gap: var(--space-4);
  padding: 14px 18px;
  background: var(--surface);
  border: 2px solid var(--line);
  border-radius: 18px;
  box-shadow: 0 4px 0 var(--line);
  color: var(--ink);
  text-decoration: none;
}
.module-row:hover { color: var(--ink); background: var(--paper); }
.module-row-current { border-color: var(--teal); box-shadow: 0 5px 0 var(--teal); }
.module-num {
  display: grid; place-items: center; flex: none;
  width: 56px; height: 56px; border-radius: 16px;
  font-family: var(--font-display); font-weight: 700; font-size: 1.375rem;
  background: var(--empty); color: var(--ink);
}
.module-num-done { background: var(--teal); }
/* The current module stands out in ink: red is kept for the one main button. */
.module-num-current { background: var(--ink); color: #fff; }
.module-row-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.module-row-name { font-family: var(--font-display); font-weight: 600; font-size: 1.125rem; line-height: 1.25; }
.module-row-counts { display: flex; flex-wrap: wrap; gap: 4px 14px; color: var(--ink-soft); font-size: 0.875rem; font-weight: 700; }
.module-row-counts span { display: inline-flex; align-items: center; gap: 6px; }
@media (max-width: 559.98px) { .module-row { flex-wrap: wrap; } .module-row .chip { margin-left: 72px; } }

.next-card { position: relative; overflow: hidden; display: flex; flex-direction: column; gap: var(--space-3); align-items: flex-start; padding: 24px 24px 28px; background: var(--amber-tint); border: 2px solid var(--amber-tint-border); border-radius: 22px; box-shadow: 0 5px 0 var(--amber-tint-border); }
.next-card .eyebrow { color: var(--ink); }
.next-card > *:not(.next-card-coach) { position: relative; z-index: 1; max-width: calc(100% - 70px); }
.next-card h3 { font-size: 1.5rem; }
.next-card-coach { position: absolute; right: 6px; bottom: -14px; width: 92px; height: auto; z-index: 0; }
.how-list { list-style: none; display: flex; flex-direction: column; gap: var(--space-3); }
.how-list li { display: flex; gap: var(--space-3); align-items: flex-start; }
.how-list svg { flex: none; color: var(--teal-shadow); }

/* ------------------------------------------------ Design system: Leaderboard */

.podium { background: var(--navy); border-radius: 28px; box-shadow: 0 7px 0 var(--navy-shadow); padding: 34px 40px 0; color: #fff; overflow: hidden; }
.podium-inner { display: flex; align-items: flex-end; justify-content: center; gap: 12px; max-width: 700px; margin-inline: auto; }
.podium-col { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; align-items: center; text-align: center; }
.podium-crown { color: var(--amber); margin-bottom: 4px; line-height: 0; }
.podium-crown svg { fill: var(--amber); }
.podium-ring { display: inline-flex; padding: 4px; border-radius: 50%; border: 4px solid var(--navy-tint); margin-bottom: 10px; }
.podium-rank-1 .podium-ring { border-color: var(--amber); }
.podium-rank-2 .podium-ring { border-color: var(--teal); }
.podium-name { font-family: var(--font-display); font-weight: 600; font-size: 1rem; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.podium-points { font-family: var(--font-display); font-weight: 500; font-size: 0.9375rem; color: var(--navy-tint); margin-bottom: 10px; }
.podium-block { width: 100%; display: flex; justify-content: center; padding-top: 14px; border-radius: 16px 16px 0 0; font-family: var(--font-display); font-weight: 600; }
.podium-rank { font-size: 2rem; line-height: 1; }
.podium-rank-1 .podium-block { height: 176px; background: var(--amber); color: var(--ink); }
.podium-rank-1 .podium-rank { font-size: 3.25rem; }
.podium-rank-2 .podium-block { height: 125px; background: var(--teal); color: var(--ink); }
.podium-rank-3 .podium-block { height: 96px; background: #fff; color: var(--navy); }
@media (max-width: 559.98px) { .podium { padding: 24px 16px 0; } .podium-inner { gap: 6px; } }

.two-col-lb { grid-template-columns: 1.2fr 1fr; align-items: start; }
@media (max-width: 1099.98px) { .two-col-lb { grid-template-columns: 1fr; } }

.board-list { list-style: none; display: flex; flex-direction: column; gap: var(--space-2); }
.board-row { display: flex; align-items: center; gap: var(--space-3); padding: 8px 12px; border: 2px solid transparent; border-radius: 16px; }
.board-row-me { background: var(--red-tint); border-color: var(--red); }
.board-rank { width: 2rem; font-family: var(--font-display); font-weight: 600; font-size: 1.25rem; text-align: center; flex: none; }
.board-name { flex: 1; min-width: 0; font-weight: 800; }
.board-points { min-width: 3.5rem; text-align: right; font-family: var(--font-display); font-weight: 600; font-size: 1.125rem; }

.callout-paper { display: flex; gap: var(--space-3); align-items: flex-start; padding: 14px 18px; background: var(--paper); border: 2px solid var(--line); border-radius: 18px; font-weight: 700; }
.callout-paper svg { flex: none; color: var(--teal-shadow); }

.cheer-card { display: flex; align-items: center; gap: var(--space-4); padding: 20px 24px; background: var(--amber-tint); border: 2px solid var(--amber-tint-border); border-radius: 22px; box-shadow: 0 5px 0 var(--amber-tint-border); }
.cheer-card img { width: 104px; height: auto; flex: none; }
.cheer-line { font-family: var(--font-display); font-weight: 600; font-size: 1.3125rem; line-height: 1.25; margin-bottom: var(--space-1); }

.badge-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px 10px; padding-top: 6px; }
.badge-cell { position: relative; display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; outline-offset: 6px; }
.badge-cell-name { font-weight: 800; font-size: 0.8125rem; line-height: 1.2; }
.badge-tip { display: none; position: absolute; bottom: calc(100% + 4px); left: 50%; transform: translateX(-50%); z-index: 5; width: 180px; padding: 8px 12px; border-radius: 12px; background: var(--ink); color: #fff; font-size: 0.8125rem; font-weight: 700; line-height: 1.3; }
.badge-cell:hover .badge-tip, .badge-cell:focus .badge-tip { display: block; }

/* ------------------------------------------------ Design system: Assessments */

.two-col-assess { grid-template-columns: 1.5fr 1fr; align-items: stretch; }
@media (max-width: 1099.98px) { .two-col-assess { grid-template-columns: 1fr; } }

.femi-card { position: relative; display: flex; gap: var(--space-4); padding: 32px 34px; background: var(--navy); color: #fff; border-radius: 26px; box-shadow: 0 7px 0 var(--navy-shadow); }
.femi-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: var(--space-3); }
.femi-card .eyebrow { color: var(--amber); }
.femi-card h2 { color: #fff; font-size: 1.75rem; line-height: 1.15; max-width: 22ch; }
.femi-line { color: var(--navy-tint); }
.femi-tiles { display: flex; flex-wrap: wrap; gap: var(--space-3); margin-top: var(--space-2); }
.femi-tile { flex: 1 1 180px; display: flex; flex-direction: column; align-items: flex-start; gap: var(--space-2); padding: 16px 18px; background: rgb(255 255 255 / 0.12); border-radius: 18px; }
.femi-tile-later { background: transparent; border: 2px dashed rgb(255 255 255 / 0.55); }
.femi-tile-title { font-weight: 800; }
.femi-coach { flex: none; align-self: flex-start; width: 150px; }
@media (max-width: 859.98px) { .femi-coach { display: none; } .femi-card { padding: 24px 22px; } }

.stat-tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--space-2); }
.stat-tile { display: flex; flex-direction: column; gap: 2px; padding: 12px 14px; border-radius: 16px; background: var(--empty); font-weight: 800; font-size: 0.875rem; }
.stat-tile-done { background: var(--teal-tint); }
.stat-tile-marking { background: var(--amber-tint); }

.seg { display: inline-flex; padding: 4px; background: var(--surface); border: 2px solid var(--line); border-radius: var(--radius-pill); }
.seg-option { display: inline-flex; align-items: center; min-height: 40px; padding: 0 18px; border-radius: var(--radius-pill); color: var(--ink); font-weight: 800; font-size: 0.875rem; text-decoration: none; }
.seg-option:hover { color: var(--ink); background: var(--paper); }
.seg-option.is-on { background: var(--ink); color: #fff; }

.assess-row { display: flex; align-items: center; gap: var(--space-4); padding: 14px 18px; background: var(--surface); border: 2px solid var(--line); border-radius: 20px; box-shadow: 0 4px 0 var(--line); color: var(--ink); text-decoration: none; }
a.assess-row:hover { color: var(--ink); background: var(--paper); }
.assess-row.is-next { border-color: var(--red); box-shadow: 0 5px 0 var(--red); }
.assess-icon { display: grid; place-items: center; flex: none; width: 52px; height: 52px; border-radius: 16px; background: var(--empty); color: var(--ink-faint); }
.assess-icon.is-marked { background: var(--teal); color: var(--ink); }
.assess-icon.is-next { background: var(--red); color: #fff; }
.assess-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.assess-title { font-weight: 800; font-size: 1rem; }
.assess-meta { color: var(--ink-soft); font-size: 0.8125rem; font-weight: 700; }
.score-block { flex: none; width: 112px; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 8px; border-radius: 16px; background: var(--empty); text-align: center; line-height: 1.15; }
.score-block strong { font-family: var(--font-display); font-weight: 600; font-size: 1.25rem; }
.score-block small { font-weight: 800; color: var(--ink-soft); font-size: 0.75rem; }
.score-marked { background: var(--teal-tint); }
.score-marked small { color: var(--ink); }
.score-next { background: var(--surface); border: 3px solid var(--red); }
@media (max-width: 699.98px) {
  .assess-row { flex-wrap: wrap; }
  .assess-main { flex-basis: calc(100% - 80px); }
  .score-block { width: auto; flex-direction: row; gap: 8px; margin-left: auto; }
}

/* ---------------------------------------------------- Design system: Library */

.seg-option svg { margin-right: 6px; }
.two-col-library { grid-template-columns: 1.6fr 1fr; align-items: start; }
@media (max-width: 1099.98px) { .two-col-library { grid-template-columns: 1fr; } }

.sub-card { padding: 0; overflow: hidden; }
.sub-top { display: flex; gap: var(--space-5); padding: 24px; align-items: stretch; }
.sub-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: var(--space-3); align-items: flex-start; }
.sub-title { font-size: 1.5rem; line-height: 1.2; }
.file-pill { display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; background: var(--surface); border: 2px solid var(--line); border-radius: var(--radius-pill); box-shadow: 0 3px 0 var(--line-strong); color: var(--ink); font-weight: 800; font-size: 0.875rem; text-decoration: none; }
.file-pill:hover { color: var(--ink); background: var(--paper); }
.sub-mark { flex: none; width: 150px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: var(--space-2); padding: 16px; background: var(--teal); color: var(--ink); border-radius: 18px; }
.sub-mark-num { font-family: var(--font-display); font-weight: 600; font-size: 2.75rem; line-height: 1; }
.sub-mark-out { font-family: var(--font-display); font-weight: 600; font-size: 1.375rem; }
.sub-mark-pct { padding: 4px 14px; background: #fff; border-radius: var(--radius-pill); font-weight: 800; }
.sub-soon { flex: none; width: 150px; display: grid; place-items: center; text-align: center; border: 3px dashed var(--amber); border-radius: 18px; padding: 16px; font-family: var(--font-display); font-weight: 600; }
.sub-feedback { padding: 20px 24px; background: var(--paper); border-top: 2px solid var(--line); display: flex; flex-direction: column; gap: var(--space-3); }
.coach-msg { display: flex; gap: var(--space-3); align-items: flex-start; }
.coach-msg .coach-card-avatar { background: var(--navy); color: #fff; width: 40px; height: 40px; }
.coach-bubble { background: var(--navy); color: #fff; border-radius: 6px 18px 18px 18px; padding: 12px 16px; max-width: 78%; }
.coach-bubble-eyebrow { font-size: 0.75rem; font-weight: 800; letter-spacing: 0.12em; text-transform: uppercase; color: var(--amber); margin-bottom: 4px; }
.sub-detail summary { cursor: pointer; font-weight: 800; color: var(--teal-shadow); min-height: 44px; display: flex; align-items: center; }
@media (max-width: 699.98px) { .sub-top { flex-direction: column; } .sub-mark, .sub-soon { width: 100%; flex-direction: row; justify-content: center; } .coach-bubble { max-width: 100%; } }

.empty-library img { width: 120px; height: auto; }

.shelf { display: flex; align-items: flex-end; gap: 8px; padding: 12px 8px 0; border-bottom: 6px solid var(--line-strong); min-height: 100px; flex-wrap: wrap; }
.shelf-block { flex: 0 0 26px; border-radius: 8px 8px 0 0; }
.shelf-tone-0 { background: var(--teal); }
.shelf-tone-1 { background: var(--amber); }
.shelf-tone-2 { background: var(--navy); }
.shelf-tone-3 { background: var(--red); }
.shelf-empty { background: transparent; border: 3px dashed var(--line-strong); border-bottom: 0; }

.module-chip { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; font-family: var(--font-display); font-weight: 700; color: var(--ink); }
.module-chip-0 { background: var(--navy-tint); }
.module-chip-1 { background: var(--teal-tint); }
.module-chip-2 { background: var(--amber-tint); }
.module-chip-3 { background: var(--red-tint); }
.note-card { display: flex; flex-direction: column; gap: 6px; padding: 14px 18px; background: var(--surface); border: 2px solid var(--line); border-radius: 6px 18px 18px 18px; box-shadow: 0 4px 0 var(--line); color: var(--ink); text-decoration: none; }
a.note-card:hover { color: var(--ink); background: var(--paper); }
.note-preview { color: var(--ink-soft); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.note-card-empty { background: transparent; border-style: dashed; box-shadow: none; align-items: flex-start; }
.journal-side img { width: 110px; height: auto; }

/* -------------------------------------------------- Design system: Community */

.toggle-pair { display: flex; gap: var(--space-3); }
.toggle-btn { display: inline-flex; align-items: center; gap: 8px; min-height: 48px; padding: 0 20px; background: var(--surface); border: 2px solid var(--line); border-radius: 14px; color: var(--ink); font-weight: 800; text-decoration: none; }
.toggle-btn:hover { color: var(--ink); background: var(--paper); }
.toggle-cohort.is-on { background: var(--teal); border-color: var(--teal); color: var(--ink); box-shadow: 0 4px 0 var(--teal-shadow); }
.toggle-coach.is-on { background: var(--navy); border-color: var(--navy); color: #fff; box-shadow: 0 4px 0 var(--navy-shadow); }
.toggle-pill { display: inline-grid; place-items: center; min-width: 22px; height: 22px; padding: 0 7px; border-radius: var(--radius-pill); background: var(--amber); color: var(--ink); font-size: 0.75rem; font-weight: 800; }

.community-grid { display: grid; grid-template-columns: 1fr 300px; gap: 24px; align-items: start; }
@media (max-width: 1099.98px) { .community-grid { grid-template-columns: 1fr; } .community-side { display: none; } }

.chat-card { padding: 0; min-height: 640px; display: flex; flex-direction: column; overflow: hidden; }
.chat-head { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); padding: 16px 22px; }
.chat-head-cohort { background: var(--teal-tint); }
.chat-head-coach { background: var(--navy); color: #fff; justify-content: flex-start; }
.chat-head-coach p { color: var(--navy-tint); font-size: 0.875rem; }

.question-banner { display: flex; gap: var(--space-3); align-items: flex-start; padding: 16px 22px; background: var(--navy); color: #fff; }
.question-banner .eyebrow { color: var(--amber); }
.question-pin { color: var(--amber); flex: none; margin-top: 2px; }
.question-text { font-family: var(--font-display); font-weight: 600; font-size: 1.125rem; line-height: 1.3; }

.chat-scroll { flex: 1; display: flex; flex-direction: column; gap: 14px; padding: 20px 22px; max-height: 560px; overflow-y: auto; }
.day-sep { align-self: center; color: var(--ink-soft); font-size: 0.75rem; font-weight: 800; }
.chat-empty { margin: auto; text-align: center; color: var(--ink-soft); font-weight: 700; }
.msg { display: flex; gap: 10px; align-items: flex-end; max-width: 100%; }
.msg-mine { flex-direction: row-reverse; }
.msg-col { max-width: 78%; display: flex; flex-direction: column; gap: 3px; }
.msg-mine .msg-col { align-items: flex-end; }
.msg-meta { color: var(--ink-soft); font-size: 0.75rem; font-weight: 700; }
.msg-meta.is-coach { color: var(--navy); }
.msg-bubble { padding: 12px 16px; border-radius: 18px 18px 18px 6px; background: var(--empty); font-size: 0.9375rem; overflow-wrap: anywhere; }
.msg-coach .msg-bubble { background: var(--navy-tint); }
.msg-mine .msg-bubble { background: var(--teal); color: var(--ink); border-radius: 18px 18px 6px 18px; }
.msg-report { opacity: 0; transition: opacity var(--dur) var(--ease); align-self: center; }
.msg:hover .msg-report, .msg:focus-within .msg-report { opacity: 1; }
@media (hover: none) { .msg-report { opacity: 0.7; } }
.msg-report button { display: grid; place-items: center; width: 36px; height: 36px; border: 0; border-radius: 50%; background: transparent; color: var(--ink-soft); cursor: pointer; }
.msg-report button:hover:not(:disabled) { background: var(--empty); color: var(--ink); }
.msg-report button:disabled { color: var(--ink-faint); cursor: default; }

.composer { display: flex; gap: var(--space-3); padding: 16px 22px; border-top: 2px solid var(--line); }
.composer-input { flex: 1; min-height: 48px; border-radius: 14px; background: var(--paper); }

.classmates { display: flex; flex-wrap: wrap; gap: 6px; }
.classmate { display: inline-flex; border-radius: 50%; }
.guidelines img { width: 84px; height: auto; }

/* ------------------------------------------------ Design system: Profile tabs */

.profile-card { display: flex; gap: var(--space-5); align-items: flex-start; flex-wrap: wrap; }
.profile-photo { position: relative; flex: none; width: 104px; height: 104px; }
.profile-photo-img, .profile-photo-initials { width: 104px; height: 104px; border-radius: 30px; box-shadow: 0 6px 0 var(--red-shadow); }
.profile-photo-img { object-fit: cover; }
.profile-photo-initials { display: grid; place-items: center; background: var(--red); color: #fff; font-family: var(--font-display); font-weight: 600; font-size: 2.25rem; }
.photo-btn { position: absolute; right: -8px; bottom: -8px; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: var(--surface); border: 2px solid var(--line); box-shadow: 0 3px 0 var(--line-strong); color: var(--ink); cursor: pointer; }
.photo-btn:hover { background: var(--paper); }
.profile-card-details { flex: 1; min-width: 16rem; display: flex; flex-direction: column; gap: var(--space-4); }
.profile-name { font-size: 2rem; }
.profile-facts { display: flex; flex-wrap: wrap; gap: var(--space-5); align-items: flex-end; }
.fact { font-weight: 800; display: flex; align-items: center; gap: 8px; }
.coach-square { width: 12px; height: 12px; border-radius: 3px; background: var(--navy); flex: none; }
.language-select { min-width: 13rem; margin-top: 4px; }

.profile-slim { display: flex; align-items: center; gap: var(--space-4); }
.profile-slim-img, .profile-slim-initials { width: 56px; height: 56px; border-radius: 18px; flex: none; }
.profile-slim-img { object-fit: cover; }
.profile-slim-initials { display: grid; place-items: center; background: var(--red); color: #fff; font-family: var(--font-display); font-weight: 600; font-size: 1.25rem; }
.profile-slim-name { font-size: 1.625rem; }

.pill-tabs { display: flex; gap: var(--space-2); overflow-x: auto; padding: 2px 2px 8px; scrollbar-width: thin; }
.pill-tab { display: inline-flex; align-items: center; gap: 8px; flex: none; min-height: 44px; padding: 0 18px; background: var(--surface); border: 2px solid var(--line); border-radius: 14px; color: var(--ink); font-weight: 800; font-size: 0.875rem; text-decoration: none; white-space: nowrap; }
.pill-tab:hover { color: var(--ink); background: var(--paper); }
.pill-tab.is-on { background: var(--ink); border-color: var(--ink); color: #fff; }
.tab-badge { display: inline-grid; place-items: center; min-width: 22px; height: 22px; padding: 0 7px; border-radius: var(--radius-pill); background: var(--amber); color: var(--ink); font-size: 0.75rem; font-weight: 800; }

/* About Me as a workbook. */
.workbook { display: grid; grid-template-columns: 300px 1fr; gap: 24px; align-items: start; }
@media (max-width: 999.98px) { .workbook { grid-template-columns: 1fr; } }
.checklist { display: flex; flex-direction: column; gap: var(--space-3); padding: 20px; }
.checklist-rows { list-style: none; display: flex; flex-direction: column; gap: 6px; }
.check-row { display: flex; align-items: center; gap: 12px; padding: 8px 10px; border: 2px solid transparent; border-radius: 16px; color: var(--ink); text-decoration: none; }
.check-row:hover { color: var(--ink); background: var(--paper); }
.check-row.is-here { background: var(--surface); border-color: var(--teal); box-shadow: 0 4px 0 var(--teal); }
.check-num { display: grid; place-items: center; flex: none; width: 40px; height: 40px; border-radius: 12px; background: var(--empty); font-family: var(--font-display); font-weight: 700; }
.check-num.is-teal { background: var(--teal); color: var(--ink); }
.check-main { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.25; }
.check-name { font-weight: 800; font-size: 0.9375rem; }
.check-goal { color: var(--ink-soft); font-size: 0.75rem; font-weight: 700; }
.check-count { color: var(--ink-soft); font-weight: 800; font-size: 0.8125rem; }

.section-card { padding: 28px 32px; display: flex; flex-direction: column; gap: var(--space-5); }
.section-top { display: flex; gap: var(--space-4); align-items: flex-start; }
.section-title { font-size: 2rem; line-height: 1.15; }
.section-prompt { font-size: 1.0625rem; }
.section-coach { flex: none; width: 150px; display: flex; flex-direction: column; align-items: center; gap: var(--space-2); }
.section-coach img { width: 92px; height: auto; animation: coach-float 3.2s ease-in-out infinite; }
.section-tip { background: var(--navy); color: #fff; font-size: 0.8125rem; text-align: center; margin: 0; }
@media (max-width: 699.98px) { .section-top { flex-direction: column; } .section-coach { display: none; } .section-card { padding: 22px 18px; } }

.stickers { list-style: none; display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
@media (max-width: 559.98px) { .stickers { grid-template-columns: 1fr; } }
.sticker, .sticker-slot { min-height: 64px; border-radius: 16px; padding: 12px 16px; }
.sticker { position: relative; display: flex; align-items: center; gap: 10px; background: var(--teal-tint); font-weight: 800; font-size: 1rem; }
.sticker.is-tilt-a { transform: rotate(-1deg); }
.sticker.is-tilt-b { transform: rotate(1deg); }
.sticker-star { flex: none; color: var(--teal-shadow); }
.sticker-text { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.sticker-actions { display: flex; gap: 2px; opacity: 0; transition: opacity var(--dur) var(--ease); }
.sticker:hover .sticker-actions, .sticker:focus-within .sticker-actions, .sticker-actions:has(details[open]) { opacity: 1; }
@media (hover: none) { .sticker-actions { opacity: 1; } }
.sticker-actions form { display: contents; }
.icon-btn, .sticker-edit summary { display: grid; place-items: center; width: 36px; height: 36px; border: 0; border-radius: 50%; background: transparent; color: var(--ink); cursor: pointer; list-style: none; }
.icon-btn:hover, .sticker-edit summary:hover { background: rgb(255 255 255 / 0.7); }
.sticker-edit summary::-webkit-details-marker { display: none; }
.sticker-edit { position: relative; }
.sticker-edit-form { position: absolute; right: 0; top: 40px; z-index: 5; display: flex; gap: 6px; width: min(22rem, 70vw); padding: 10px; background: var(--surface); border: 2px solid var(--line); border-radius: 16px; box-shadow: 0 5px 0 var(--line); }
.sticker-slot { display: flex; align-items: center; border: 3px dashed var(--line-strong); color: var(--ink-faint); font-weight: 800; }
.add-row { display: flex; gap: var(--space-3); }
.add-input { min-height: 52px; border-radius: 16px; background: var(--paper); }
.add-row .btn { flex: none; }

.notebook, .notebook-area, .notebook-line { width: 100%; border: 0; background: transparent; color: var(--ink); font-family: var(--font-ui); font-weight: 600; }
.notebook { font-size: 1.0625rem; line-height: 2rem; padding: 0 4px; resize: vertical; min-height: 16rem; background-image: repeating-linear-gradient(transparent, transparent calc(2rem - 2px), var(--line) calc(2rem - 2px), var(--line) 2rem); background-attachment: local; }
.notebook:focus { outline: none; }
.word-count { font-weight: 800; color: var(--ink-soft); }
.word-count.is-reached { color: var(--teal-shadow); }
.section-foot { display: flex; flex-wrap: wrap; justify-content: space-between; gap: var(--space-3); padding-top: var(--space-4); border-top: 2px solid var(--line); }

/* Business Profile. */
.brand-hero { display: flex; border-radius: 28px; border: 2px solid var(--teal-shadow); box-shadow: 0 7px 0 var(--teal-shadow); overflow: hidden; background: var(--teal); }
.brand-hero-main { flex: 1; min-width: 0; display: flex; gap: var(--space-5); align-items: center; padding: 32px; background: var(--teal); }
.logo-drop { display: grid; place-items: center; align-content: center; gap: 2px; flex: none; width: 96px; height: 96px; border-radius: 24px; background: #fff; border: 3px dashed var(--teal-shadow); color: var(--teal-shadow); font-weight: 800; font-size: 0.8125rem; cursor: pointer; overflow: hidden; }
.logo-drop img { width: 100%; height: 100%; object-fit: cover; }
.brand-hero-text { display: flex; flex-direction: column; gap: var(--space-2); align-items: flex-start; min-width: 0; }
.brand-hero .eyebrow { color: var(--ink); }
.brand-name { font-family: var(--font-display); font-weight: 700; font-size: 2.875rem; line-height: 1.05; color: var(--ink); overflow-wrap: anywhere; }
.brand-slogan { font-family: var(--font-display); font-weight: 500; font-size: 1.25rem; color: var(--ink); }
.brand-hero-side { flex: none; width: 320px; padding: 28px; background: var(--paper); display: flex; flex-direction: column; gap: var(--space-4); }
.progress-line { display: flex; flex-direction: column; gap: 6px; }
.progress-line .segment { flex: 1 1 0; }
@media (max-width: 859.98px) { .brand-hero-side { display: none; } .brand-hero-main { padding: 22px; flex-wrap: wrap; } .brand-name { font-size: 2.125rem; } }

.two-col-business { grid-template-columns: 1fr 1fr; align-items: stretch; }
.two-col-info { grid-template-columns: 1.6fr 1fr; align-items: start; }
@media (max-width: 1099.98px) { .two-col-business, .two-col-info { grid-template-columns: 1fr; } }
.notebook-field { display: flex; flex-direction: column; gap: 4px; }
.notebook-field label { font-weight: 800; font-size: 0.875rem; }
.notebook-line { font-size: 1.0625rem; padding: 6px 0; border-bottom: 3px solid var(--line); border-radius: 0; resize: vertical; }
.notebook-line:focus { outline: none; border-bottom-color: var(--teal); }
.problem-card { display: flex; flex-direction: column; gap: var(--space-3); align-items: flex-start; padding: 24px; background: var(--amber-tint); border: 2px solid var(--amber-tint-border); border-radius: 22px; box-shadow: 0 5px 0 var(--amber-tint-border); }
.problem-quote { font-family: var(--font-display); font-weight: 600; font-size: 1.375rem; line-height: 1.35; }
.problem-empty { color: var(--ink-soft); font-size: 1.0625rem; }
.founder-card { display: flex; flex-direction: column; gap: var(--space-2); border-top-width: 6px; }
.founder-navy { border-top-color: var(--navy); }
.founder-teal { border-top-color: var(--teal); }
.founder-amber { border-top-color: var(--amber); }
.founder-card .eyebrow { color: var(--teal-shadow); }
.notebook-area { font-size: 1.0625rem; line-height: 1.6; padding: 6px 8px; margin: 0 -8px; border-radius: 12px; resize: vertical; }
.notebook-area:hover { background: var(--paper); }
.notebook-area:focus { outline: 2px solid var(--teal); background: var(--surface); }

/* My Information. */
.consent-list { padding: 0; overflow: hidden; }
.consent-row { display: flex; align-items: center; gap: var(--space-4); padding: 18px 22px; border-top: 2px solid var(--line); }
.consent-row:first-child { border-top: 0; }
.consent-icon { display: grid; place-items: center; flex: none; width: 52px; height: 52px; border-radius: 16px; background: var(--empty); color: var(--ink); }
.consent-icon-navy { background: var(--navy-tint); color: var(--navy); }
.consent-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.consent-title { font-weight: 800; }
.consent-line { color: var(--ink-soft); font-size: 0.875rem; font-weight: 600; }
.consent-control { flex: none; display: flex; align-items: center; gap: 10px; }
.link-btn { background: none; border: 0; padding: 0; color: var(--teal-shadow); font: inherit; font-weight: 800; text-decoration: underline; text-decoration-thickness: 2px; cursor: pointer; min-height: 44px; }
.switch { position: relative; flex: none; width: 54px; height: 32px; border: 0; border-radius: var(--radius-pill); background: var(--line-strong); cursor: pointer; transition: background var(--dur) var(--ease); }
.switch[aria-pressed="true"] { background: var(--teal); }
.switch-knob { position: absolute; top: 4px; left: 4px; width: 24px; height: 24px; border-radius: 50%; background: #fff; transition: transform var(--dur) var(--ease); }
.switch[aria-pressed="true"] .switch-knob { transform: translateX(22px); }
.switch-text { min-width: 4.5rem; font-weight: 800; font-size: 0.875rem; }
@media (max-width: 639.98px) { .consent-row { flex-wrap: wrap; } .consent-control { margin-left: 68px; } }

/* Grid and flex children may shrink below their content, so a long name or a
   wide row can never push a page sideways. */
.two-col > *, .three-col > *, .community-grid > *, .workbook > *,
.programme-hero > *, .brand-hero > * { min-width: 0; }

/* A scroll container is also the containing block for the visually-hidden
   text inside it; otherwise that text is positioned against the page and
   widens it. */
.pill-tabs, .seg, .toggle-pair, .stat-tiles { position: relative; }

.huddle-layout { grid-template-columns: minmax(0, 1fr); max-width: 52rem; }
.huddle-facts { display: grid; gap: var(--space-4); }

/* Friendly error pages. */
.error-page { min-height: 100dvh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: var(--space-5); padding: var(--space-5) 16px; }
.error-logo { display: block; width: 120px; height: auto; }
.error-card { display: flex; align-items: center; gap: var(--space-5); max-width: 40rem; width: 100%; padding: 28px; }
.error-coach { width: 120px; height: auto; flex: none; }
@media (max-width: 559.98px) { .error-card { flex-direction: column; text-align: center; } .error-coach { width: 96px; } }

.lesson-row.is-next { border-color: var(--red); box-shadow: 0 4px 0 var(--red); }
.task-row .assess-icon { flex: none; }

.file-preview { display: block; max-width: 100%; max-height: 220px; min-width: 64px; min-height: 64px; object-fit: contain; border: 2px solid var(--line); border-radius: 14px; background: var(--paper); image-rendering: pixelated; }

/* Coach sidebar: the Setup group sits lower down, smaller. */
.side-group { margin-top: var(--space-5); padding: 0 14px 4px; font-size: 0.75rem; font-weight: 800; letter-spacing: 0.16em; text-transform: uppercase; color: var(--ink-soft); }
.side-group + li .side-link { min-height: 44px; }

/* Class picker and the class bar at the top of coach pages. */
.class-grid { display: grid; gap: 20px; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.class-card { display: flex; flex-direction: column; gap: var(--space-2); text-decoration: none; color: var(--ink); }
.class-card:hover { color: var(--ink); background: var(--paper); }
.class-card h2 { font-size: 1.375rem; }
.class-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-3); }
.class-bar-name { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2) var(--space-3); min-width: 0; max-width: 100%; }
.class-bar-name .chip { white-space: normal; text-align: left; }

/* The Register: session lists and the attendance choice */
.register-list { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--space-3); }
.register-row {
  display: grid; grid-template-columns: 11rem 1fr auto; gap: var(--space-4); align-items: center;
  background: var(--surface); border: 2px solid var(--line); border-radius: var(--radius-card);
  box-shadow: var(--block-card); padding: var(--space-4);
}
.register-row > * { min-width: 0; }
.register-row.is-cancelled { opacity: .75; box-shadow: none; }
.register-when { display: grid; gap: 2px; min-width: 0; }
.register-day { font-weight: 700; }
.register-title { font-weight: 700; margin: 0; }
.register-actions { display: flex; gap: var(--space-2); flex-wrap: wrap; justify-content: flex-end; }
.register-choice { border: 0; margin: 0; padding: 0; min-width: 0; display: flex; flex-wrap: wrap; gap: var(--space-3); }
@media (max-width: 720px) {
  .register-row { grid-template-columns: 1fr; }
  .register-actions { justify-content: flex-start; }
}

/* ---------------------------------------------- Admin: the working version */

/* Admins use the same shell as everyone else. These rules are scoped to
   .shell-staff so that tuning them calms the admin pages without touching what
   a learner or coach sees. Nothing here introduces a colour, font or shadow
   that is not already a token. */

.side-role {
  margin: calc(var(--space-4) * -1) 0 0;
  padding: 0 var(--space-2);
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink);
}
.side-role-coach { color: var(--navy); }

/* A count waiting on an admin is amber with ink text, never red or white. */
.side-link .nav-badge.nav-badge-amber,
.side-link.is-active .nav-badge.nav-badge-amber { background: var(--amber); color: var(--ink); }

/* Page header: eyebrow, title, one line, and the main action on the right. */
.page-head-main { display: flex; flex-direction: column; gap: var(--space-1); min-width: 0; flex: 1 1 20rem; }
.page-head-main h1 { margin-top: 0; }
.page-head-actions { display: flex; flex-wrap: wrap; gap: var(--space-3); align-items: center; }

/* ------------------------------------------------ Shared: the data table */

/* One table for every coach and admin list: a white block card, an eyebrow
   header row on paper, comfortable rows, chips for status. Rows scroll
   sideways inside the card on a phone rather than breaking the page. */
.data-scroll {
  position: relative;
  overflow-x: auto;
  max-width: 100%;
  background: var(--surface);
  border: 2px solid var(--line);
  border-radius: var(--radius-card);
  box-shadow: var(--block-card);
}
.data-scroll-long { max-height: 70vh; overflow: auto; }
.data-table { width: 100%; border-collapse: collapse; font-size: 0.9375rem; background: var(--surface); }
.data-table th,
.data-table td { padding: 14px 16px; text-align: left; vertical-align: middle; }
.data-table thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--paper);
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-soft);
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
.data-table tbody tr + tr > * { border-top: 1px solid var(--line); }
.data-table tbody tr:hover > * { background: var(--paper); }
.data-table tbody th { font-weight: 800; }
.data-table .num { text-align: right; }
.data-table .btn { white-space: nowrap; }
.data-table .row-skip > * { color: var(--ink-soft); }
.data-table .row-bad > *,
.data-table .row-bad:hover > * { background: var(--amber-tint); }
/* A table sitting inside another card should not draw a second heavy frame. */
.card .data-scroll { box-shadow: none; border-width: 1px; border-radius: var(--radius-lg); }
.card-flush > .data-scroll { border: 0; border-radius: 0; box-shadow: none; background: transparent; }

/* A person in a list: their avatar, then their name. */
.person { display: flex; align-items: center; gap: 12px; min-width: 0; }
.person-name { font-weight: 800; }

/* Forms: labels above, paper fields, a teal focus. */
.shell-staff .field label { font-size: 0.875rem; font-weight: 800; }
.shell-staff .input,
.shell-staff .textarea,
.shell-staff .select {
  min-height: 48px;
  background: var(--paper);
  border: 2px solid var(--line);
  border-radius: var(--radius-input);
}
.shell-staff .textarea { min-height: 120px; }
.shell-staff .input:hover,
.shell-staff .textarea:hover,
.shell-staff .select:hover { border-color: var(--line-strong); }
.shell-staff .input:focus,
.shell-staff .textarea:focus,
.shell-staff .select:focus {
  border-color: var(--teal);
  outline: 3px solid var(--teal-tint);
  outline-offset: 0;
}
.shell-staff .field-hint { color: var(--ink-soft); }
.shell-staff .field-error { display: flex; align-items: center; gap: 6px; }

/* Errors read as ink on amber with an amber triangle, not red. */
.shell-staff .alert-error { background: var(--amber-tint); border-color: var(--amber); border-radius: var(--radius-lg); color: var(--ink); }
.shell-staff .alert-error svg { color: var(--amber-shadow); }
.shell-staff .alert-success { background: var(--teal-tint); border-color: var(--teal); border-radius: var(--radius-lg); color: var(--ink); }
.shell-staff .alert-info,
.shell-staff .alert-warn { background: var(--paper); border-color: var(--line-strong); border-radius: var(--radius-lg); color: var(--ink); }

/* Status chips: teal for done, approved, published and active; amber for
   waiting; neutral for retired or idle; ink with an amber triangle for a
   problem. Always a mark and a word, never colour alone. */
.shell-staff .status {
  gap: 6px;
  padding: 5px 11px;
  border-radius: var(--radius-chip);
  font-size: 0.8125rem;
  font-weight: 800;
  color: var(--ink);
}
.shell-staff .status-due { background: var(--amber-tint); color: var(--ink); }
.shell-staff .status-due::before { background: var(--amber); }
.shell-staff .status-idle { background: var(--empty); color: var(--ink); }
.shell-staff .status-idle::before { background: var(--ink-faint); }
.shell-staff .status-late { background: var(--ink); color: #fff; }
.shell-staff .status-late::before {
  width: 14px;
  height: 14px;
  border-radius: 0;
  background: var(--amber);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 3.5 2.8 19.5h18.4z'/%3E%3Cpath d='M12 10v4.5M12 17.2h.01'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 3.5 2.8 19.5h18.4z'/%3E%3Cpath d='M12 10v4.5M12 17.2h.01'/%3E%3C/svg%3E") center / contain no-repeat;
}

/* Counts and tabs sit quietly. */
.shell-staff .pill { border-radius: var(--radius-chip); font-weight: 800; color: var(--ink); background: var(--empty); border-color: transparent; }
.shell-staff .tabs { border-bottom: 2px solid var(--line); }
.shell-staff .tab { border: 2px solid var(--line); font-weight: 800; border-radius: var(--radius-btn); }
.shell-staff .tab.is-current { background: var(--ink); border-color: var(--ink); color: #fff; }

/* Empty state: one friendly line and the next action. */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-3);
  text-align: center;
  padding: var(--space-7) var(--space-5);
}
.empty-state img { width: 96px; height: auto; display: block; }
.empty-state p { max-width: 46ch; }

/* Stat cards: an eyebrow and one Poppins number. */
.stat-card { display: flex; flex-direction: column; gap: var(--space-2); }
.stat-card .metric { font-size: 2.5rem; }

/* A table inside a flush card should not draw a second frame. */
.shell-staff .card-flush { box-shadow: var(--block-card); }

.shell-staff .file-input {
  background: var(--paper);
  border: 2px dashed var(--line-strong);
  border-radius: var(--radius-lg);
}

/* The import tallies are small stat cards. */
.shell-staff .import-tally {
  background: var(--surface);
  border: 2px solid var(--line);
  border-radius: var(--radius-card);
  box-shadow: var(--block-card);
  padding: var(--space-4) var(--space-5);
}
.shell-staff .import-tally .n { font-family: var(--font-display); font-weight: 600; font-size: 2rem; color: var(--ink); }
.shell-staff .import-tally.is-create { background: var(--teal-tint); border-color: var(--teal); }
.shell-staff .import-tally.is-create .n,
.shell-staff .import-tally.is-skip .n,
.shell-staff .import-tally.is-error .n { color: var(--ink); }
.shell-staff .import-tally.is-skip { background: var(--paper); }
.shell-staff .import-tally.is-error { background: var(--amber-tint); border-color: var(--amber); }
.shell-staff .import-tally .stat-label { color: var(--ink-soft); font-weight: 800; letter-spacing: 0.16em; }
.shell-staff .link-list li { border-color: var(--line); }

/* The programme builder: the same numbered squares as the learner's
   Programmes page, without any learner progress. */
.admin-heading { display: flex; align-items: flex-start; gap: var(--space-4); min-width: 0; flex: 1 1 20rem; }
.admin-heading > div { min-width: 0; }
.lesson-num {
  display: grid; place-items: center; flex: none;
  width: 40px; height: 40px; border-radius: 12px;
  font-family: var(--font-display); font-weight: 700; font-size: 1.0625rem;
  background: var(--surface); color: var(--ink);
}
.shell-staff .admin-lesson { background: var(--paper); box-shadow: none; border-color: var(--line); }
.shell-staff .admin-task { background: var(--surface); box-shadow: none; }
.admin-task-title { font-weight: 800; margin-top: 4px; }
.shell-staff summary { list-style: none; cursor: pointer; }
.shell-staff summary::-webkit-details-marker { display: none; }
.shell-staff summary.btn { width: fit-content; }

/* Warnings share the error treatment: ink on amber, with an amber triangle. */
.shell-staff .alert-warn { background: var(--amber-tint); border-color: var(--amber); }
.shell-staff .alert-warn svg { color: var(--amber-shadow); }
.shell-staff .alert-info svg { color: var(--ink-soft); }

/* A selected filter reads as ink, never red. */
.shell-staff .pill-brand { background: var(--ink); border-color: var(--ink); color: #fff; }

/* Admin pages keep one calm hero at most, in white. The dark card used for a
   coach's or learner's headline becomes a white block card here. */
.shell-admin .card-dark {
  background: var(--surface);
  color: var(--ink);
  border: 2px solid var(--line);
  box-shadow: var(--block-card);
}
.shell-admin .card-dark .muted { color: var(--ink-soft); }
.shell-admin .card-dark h1,
.shell-admin .card-dark h2 { color: var(--ink); }
.shell-admin .card-dark .eyebrow { color: var(--teal-shadow); }

/* A coach's headline card is navy: it is the coach's own voice. One per page. */
.shell-coach .card-dark {
  background: var(--navy);
  color: #fff;
  border: 2px solid var(--navy);
  border-radius: var(--radius-hero);
  box-shadow: 0 6px 0 var(--navy-shadow);
}
.shell-coach .card-dark .muted { color: var(--navy-tint); }
.shell-coach .card-dark h1,
.shell-coach .card-dark h2 { color: #fff; }
.shell-coach .card-dark .eyebrow { color: var(--amber); }

.shell-staff .row { flex-wrap: wrap; }

/* The progress matrix is a data table whose cells are the learner's own chips. */
.matrix .matrix-name { min-width: 12rem; }
.matrix td { white-space: nowrap; }
.matrix .grid-module { display: block; font-size: 0.8125rem; color: var(--ink); font-weight: 800; letter-spacing: 0.04em; }
.matrix .grid-topic {
  display: block; max-width: 9rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font-size: 0.75rem; letter-spacing: 0; text-transform: none; font-weight: 700; color: var(--ink-soft);
}

/* Coach and admin chat: the learner's bubbles, with the coach's own in navy tint. */
.shell-staff .msg-mine .msg-bubble { background: var(--navy-tint); color: var(--ink); }
.shell-staff .msg-col form { margin-top: 6px; }
.shell-staff .chat-scroll { max-height: 520px; }
.people-list { list-style: none; display: grid; gap: var(--space-1); }
.people-link { min-height: 48px; padding: 4px 8px; border-radius: var(--radius-nav); text-decoration: none; color: var(--ink); }
.people-link:hover { background: var(--paper); color: var(--ink); }

/* The Register and marking are used on a phone in a classroom: every choice is a 44px target. */
.register-choice label { min-height: 44px; padding: 0 12px; border: 2px solid var(--line); border-radius: var(--radius-nav); background: var(--surface); align-items: center; cursor: pointer; }
.register-choice label:has(input:checked) { border-color: var(--ink); background: var(--paper); }
.register-choice input[type="radio"] { width: 22px; height: 22px; accent-color: var(--teal-shadow); }

/* A file to download, with its size and version beside it. */
.download-card {
  display: flex; align-items: center; justify-content: space-between; gap: var(--space-4); flex-wrap: wrap;
  padding: var(--space-4) var(--space-5);
  background: var(--surface); border: 2px solid var(--line); border-radius: var(--radius-card);
  box-shadow: var(--block-card);
}
.download-card-main { min-width: 0; flex: 1 1 14rem; }
.download-card-title { font-family: var(--font-display); font-weight: 600; font-size: 1.0625rem; }

/* ===========================================================================
   Programme operations: certification, results grid, print.
   =========================================================================== */

.cert-list { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--space-2); }
.cert-row { display: flex; justify-content: space-between; align-items: center; gap: var(--space-4);
  padding: var(--space-3) 0; border-top: 2px solid var(--line); }
.cert-row:first-child { border-top: 0; }
.criterion { border-top: 2px solid var(--line); padding: var(--space-3) 0; }
.criterion summary { cursor: pointer; min-height: 44px; display: flex; align-items: center; gap: var(--space-2); }

/* The results screen: a row per learner, one column per activity. Away
   learners are greyed rather than hidden, so the class still reads as a class. */
.results-table th[scope="row"] { white-space: nowrap; }
.results-table tr.is-away { background: var(--empty); color: var(--ink-soft); }
.results-table .mark-input { text-align: center; }
.results-table input[type="checkbox"], .check input[type="checkbox"], .check input[type="radio"] { width: 22px; height: 22px; }
.results-table .check { min-height: 44px; display: inline-flex; align-items: center; gap: var(--space-2); }

.certificate { background: var(--surface); border: 6px double var(--ink); border-radius: var(--radius-lg, 16px);
  padding: var(--space-7) var(--space-6); text-align: center; display: grid; gap: var(--space-4); max-width: 52rem; margin: 0 auto; }
.certificate-logo { margin: 0 auto; }
.certificate-eyebrow { color: var(--ink-soft); font-weight: 700; margin: 0; }
.certificate-name { font-size: clamp(2rem, 6vw, 3rem); margin: 0; }
.certificate-level { font-size: clamp(1.5rem, 4vw, 2.25rem); margin: 0; color: var(--navy, var(--ink)); }
.certificate-foot { display: flex; justify-content: space-around; gap: var(--space-4); margin-top: var(--space-5); }

.print-table td, .print-table th { padding: 10px 14px; }
.print-table td:last-child { min-width: 14rem; }

@media print {
  .side, .topbar, .no-print, .skip-link, .tabs, .page-head-actions, .btn { display: none !important; }
  .shell, .shell-student { display: block !important; }
  main, #main { padding: 0 !important; margin: 0 !important; max-width: none !important; }
  body { background: #fff !important; }
  .certificate { border-color: #000; break-inside: avoid; }
  .print-table, .print-table td, .print-table th { border: 1px solid #000; border-collapse: collapse; }
}
.results-table th[scope="row"] { position: sticky; left: 0; background: var(--surface); z-index: 1; }
.results-table tr.is-away th[scope="row"] { background: var(--empty); }

/* ===========================================================================
   The lesson tracker: one student to a row, 44px tap targets, a Save that stays
   in reach on a phone.
   =========================================================================== */
.tracker-list { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--space-3); }
.tracker-row { display: grid; gap: var(--space-3); }
.tracker-who { margin: 0; }
.tracker-attendance { display: flex; gap: var(--space-2); border: 0; padding: 0; margin: 0; }
.tracker-choice { flex: 1; }
.tracker-choice input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.tracker-choice span {
  display: flex; align-items: center; justify-content: center; min-height: 44px;
  border: 2px solid var(--line); border-radius: var(--radius); background: var(--surface); font-weight: 700;
}
.tracker-choice input:checked + span { background: var(--ink); border-color: var(--ink); color: #fff; }
.tracker-choice input:focus-visible + span { outline: 3px solid var(--navy, var(--ink)); outline-offset: 2px; }
.tracker-marks { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: var(--space-3); align-items: end; }
.tracker-field { display: grid; gap: 4px; }
.tracker-field .input { min-height: 44px; }
.tracker-tick { display: inline-flex; align-items: center; gap: var(--space-2); min-height: 44px; }
.tracker-tick input { width: 24px; height: 24px; }
.tracker-catchup summary { cursor: pointer; min-height: 44px; display: flex; align-items: center; font-weight: 700; }
.tracker-row:has(input[type="radio"][value="a"]:checked) .tracker-marks { opacity: 0.45; }
.tracker-save {
  position: sticky; bottom: 0; background: var(--bg, #faf7f2); padding: var(--space-3) 0;
  border-top: 2px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: var(--space-3);
}
.tracker-save .btn { min-height: 44px; min-width: 7rem; }

.progress-cells { display: inline-flex; gap: 4px; flex-wrap: wrap; }
.progress-cell { width: 18px; height: 18px; border-radius: 4px; border: 1px solid var(--line); display: inline-block; }
.progress-cell.is-done { background: var(--teal); border-color: var(--teal); }
.progress-cell.is-partial { background: var(--amber); border-color: var(--amber); }
.progress-cell.is-absent { background: var(--ink); border-color: var(--ink); }


/* The organisation switcher at the top of the admin sidebar. */
.org-switch, .org-current { margin: 0 var(--space-3) var(--space-3); }
.org-switch > summary, .org-current { display: grid; gap: 2px; cursor: pointer; list-style: none;
  border: 2px solid var(--line); border-radius: var(--radius-btn); padding: var(--space-2) var(--space-3); background: var(--surface); }
.org-current { cursor: default; }
.org-switch > summary::-webkit-details-marker { display: none; }
.org-switch > summary strong, .org-current strong { font-size: var(--text-sm); overflow-wrap: anywhere; }
.org-switch > summary::after { content: "Switch"; font-size: var(--text-xs); font-weight: 800; color: var(--teal, #1a7f6b); }
.org-switch-list { list-style: none; margin: var(--space-2) 0 0; padding: 0; display: grid; gap: var(--space-1); }
.org-switch-item { display: block; width: 100%; text-align: left; padding: var(--space-2) var(--space-3); border: 2px solid var(--line);
  border-radius: var(--radius-btn); background: var(--surface); font: inherit; font-weight: 700; color: inherit; text-decoration: none; cursor: pointer; }
.org-switch-item:hover { background: var(--tint, #f5efe9); }


/* ------------------------------------------------------------ Coach redesign
   Tinted tiles, boxes and cohort cards built from the same tokens as the
   learner pages, so a coach's screens feel like the same app. */

.learner-chip-link { text-decoration: none; color: var(--ink); padding: 8px 12px; border-radius: var(--radius-nav); }
.learner-chip-link:hover { background: var(--paper); color: var(--ink); }
.learner-chip-link.is-active { background: var(--red); color: #fff; box-shadow: 0 4px 0 var(--red-shadow); }
.learner-chip-link.is-active .learner-chip-name { color: #fff; }

.tiles { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }
.tile { display: flex; flex-direction: column; gap: 4px; padding: 16px 18px; border-radius: 20px; border: 2px solid transparent; }
.tile-label { font-weight: 800; font-size: 0.8125rem; letter-spacing: 0.04em; text-transform: uppercase; color: var(--ink); opacity: 0.75; }
.tile-value { font-family: var(--font-display); font-weight: 600; font-size: 2.5rem; line-height: 1.05; color: var(--ink); }
.tile-sub { font-size: 0.8125rem; font-weight: 700; color: var(--ink); opacity: 0.8; }
.tile-teal { background: var(--teal-tint); border-color: var(--teal); box-shadow: 0 5px 0 var(--teal); }
.tile-amber { background: var(--amber-tint); border-color: var(--amber-tint-border); box-shadow: 0 5px 0 var(--amber-tint-border); }
.tile-navy { background: var(--navy-tint); border-color: var(--navy); box-shadow: 0 5px 0 var(--navy); }
.tile-red { background: var(--red-tint); border-color: #f4b6b6; box-shadow: 0 5px 0 #f4b6b6; }
.tile-white { background: var(--surface); border-color: var(--line); box-shadow: 0 5px 0 var(--line); }

.boxes { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.box { border-radius: 20px; padding: 16px 18px; border: 2px solid var(--line); display: flex; flex-direction: column; gap: 8px; }
.box .eyebrow { margin: 0; }
.box ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.box a { font-weight: 800; }
.box-teal { background: var(--teal-tint); border-color: var(--teal); }
.box-amber { background: var(--amber-tint); border-color: var(--amber-tint-border); }
.box-navy { background: var(--navy-tint); border-color: var(--navy); }
.box-white { background: var(--surface); }

.cohort-card { padding: 0; overflow: hidden; border-radius: 24px; }
.cohort-card .cc-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 16px 22px; background: var(--navy); color: #fff; flex-wrap: wrap; }
.cohort-card .cc-head h3 { color: #fff; }
.cohort-card .cc-head a { color: #fff; text-decoration: none; }
.cohort-card .cc-head .subtle { color: var(--navy-tint); }
.cohort-card.cc-in .cc-head { background: var(--teal-shadow); }
.cohort-card .cc-body { padding: 20px 22px 24px; display: grid; gap: 18px; }

.mini-blocks { display: flex; flex-direction: column; gap: 4px; min-width: 7rem; }
.mini-blocks .block-grid { gap: 3px; }
.mini-blocks .block-cell { width: 13px; height: 13px; border-radius: 4px; }

/* Notifications under the bell: a <details>, so it opens without any script */
.page-tools { display: flex; justify-content: flex-end; padding: 10px 24px 0; position: relative; }
.notif { position: relative; }
.notif-bell { list-style: none; position: relative; display: grid; place-items: center; width: 46px; height: 46px; cursor: pointer; background: var(--surface); border: 2px solid var(--line); border-radius: 14px; box-shadow: 0 4px 0 var(--line); }
.notif-bell::-webkit-details-marker { display: none; }
.notif-dot { position: absolute; top: -6px; right: -6px; min-width: 20px; height: 20px; padding: 0 4px; display: grid; place-items: center; border-radius: 999px; background: var(--red); color: #fff; font-size: 0.6875rem; font-weight: 800; }
.notif-pop { position: absolute; top: 56px; right: 0; width: min(380px, 92vw); z-index: 60; background: var(--surface); border: 2px solid var(--line-strong); border-radius: 18px; box-shadow: 0 8px 0 var(--line); padding: 12px; display: grid; gap: 6px; }
.notif-item { display: grid; gap: 2px; padding: 10px; border-radius: 12px; }
.notif-item.unread { background: var(--amber-tint); }
.notif-item small { color: var(--ink-soft); font-weight: 700; }

/* While a coach is still on their first-login page the rest of the menu is not available yet */
.side.is-locked .side-list, .side.is-locked .notif { opacity: 0.4; pointer-events: none; }


/* ------------------------------------------------------- Coach visual layer
   The mockup's finishing touches, built from the same tokens as the learner pages: hero buttons,
   step cards, module rows, the session journey, certificate badges and plain lists. */

.hero-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: auto; }
.btn-on-navy { background: #fff; color: var(--ink); border-color: #fff; box-shadow: 0 5px 0 var(--navy-tint); }
.btn-xs { padding: 4px 10px; font-size: 0.8125rem; }
.tile { position: relative; overflow: hidden; }
.tile-ico { position: absolute; right: 12px; top: 12px; opacity: 0.35; }

/* Step cards: the Training overview and "what you need to complete" */
.req { display: grid; grid-template-columns: auto 1fr auto; gap: 16px; align-items: center; background: var(--surface); border: 2px solid var(--line); border-radius: 22px; box-shadow: 0 5px 0 var(--line); padding: 16px 20px; }
.req .req-n { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 14px; background: var(--amber); font-family: var(--font-display); font-weight: 700; font-size: 1.2rem; }
.req.is-done .req-n { background: var(--teal); }
.req.is-locked { background: var(--paper); box-shadow: none; }
.req.is-locked .req-n { background: var(--empty); color: var(--ink-soft); }
.req h3 { font-size: 1.1rem; }
.req-bar { margin-top: 8px; max-width: 340px; }

/* Module and lesson rows, as on the learner Journey page */
.mod-block { background: var(--surface); border: 2px solid var(--line); border-radius: 22px; box-shadow: 0 5px 0 var(--line); padding: 18px 20px; }
.mod-block > summary { list-style: none; cursor: pointer; display: flex; gap: 16px; align-items: center; }
.mod-block > summary::-webkit-details-marker { display: none; }
.mod-num { display: grid; place-items: center; width: 48px; height: 48px; border-radius: 14px; font-family: var(--font-display); font-weight: 700; font-size: 1.3rem; flex: none; }
.mod-num.t0 { background: var(--navy-tint); } .mod-num.t1 { background: var(--teal-tint); } .mod-num.t2 { background: var(--amber-tint); } .mod-num.t3 { background: var(--red-tint); }
.mod-num.done { background: var(--teal); }
.mod-main { flex: 1; min-width: 0; }
.mod-main h3 { font-size: 1.1rem; }
.lesson-lines { list-style: none; margin: 14px 0 0; padding: 0; display: grid; gap: 8px; }
.lesson-line { display: flex; gap: 12px; align-items: center; justify-content: space-between; padding: 10px 14px; border: 2px solid var(--line); border-radius: 14px; background: var(--paper); }
.lesson-line.is-done { background: var(--teal-tint); border-color: var(--teal); }

/* The session journey: one stone per session of the plan */
.stones { list-style: none; display: flex; flex-wrap: wrap; gap: 22px 6px; padding: 8px 0 6px; margin: 0; }
.stone { width: 5rem; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 4px; color: inherit; }
.stone .dot { display: grid; place-items: center; width: 54px; height: 54px; border-radius: 50%; background: var(--empty); font-family: var(--font-display); font-weight: 600; font-size: 1.15rem; box-shadow: 0 5px 0 var(--line-strong); color: var(--ink); }
.stone:nth-child(even) .dot { margin-top: 8px; }
.stone.is-done .dot { background: var(--teal); box-shadow: 0 5px 0 var(--teal-shadow); }
.stone.is-current .dot { background: var(--red); color: #fff; box-shadow: 0 5px 0 var(--red-shadow), 0 0 0 5px var(--red-tint); }
.stone.is-eir .dot { background: var(--amber); box-shadow: 0 5px 0 var(--amber-shadow); }
.stone.is-catch .dot { background: var(--navy-tint); box-shadow: 0 5px 0 var(--navy); }
.stone.is-comp .dot { background: var(--navy); color: #fff; box-shadow: 0 5px 0 var(--ink); }
.stone.is-cancel .dot { background: var(--idle-soft); text-decoration: line-through; }
.stone .lbl { font-size: 0.6875rem; font-weight: 800; line-height: 1.2; color: var(--ink-soft); }
.stone.is-current .lbl { color: var(--ink); }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 0.8125rem; font-weight: 700; color: var(--ink-soft); }
.legend i { display: inline-block; width: 12px; height: 12px; border-radius: 50%; margin-right: 6px; vertical-align: -1px; }

/* Certificate badges, a plain list and a short note beneath a card */
.cert-badges { display: flex; gap: 18px; flex-wrap: wrap; }
.cert-badge { display: flex; flex-direction: column; align-items: center; gap: 6px; width: 120px; text-align: center; font-weight: 800; font-size: 0.8125rem; }
.rest-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.rest-list li { display: flex; justify-content: space-between; align-items: center; padding: 10px 16px; border: 2px solid var(--line); border-radius: 14px; background: var(--surface); }

@media (max-width: 700px) {
  .req { grid-template-columns: auto 1fr; } .req .req-act { grid-column: 1 / -1; }
}

/* A label and its answer, in rows (the About this cohort card) */
.kv { display: grid; grid-template-columns: minmax(8rem, 12rem) 1fr; gap: 10px 20px; margin: 0; }
.kv dt { font-weight: 800; color: var(--ink-soft); }
.kv dd { margin: 0; font-weight: 700; }
@media (max-width: 600px) { .kv { grid-template-columns: 1fr; gap: 2px 0; } .kv dd { margin-bottom: 8px; } }

/* A short checklist with a small icon beside each line */
.tick-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.tick-list li { display: flex; gap: 10px; align-items: flex-start; font-weight: 700; }
.tick-list svg { flex: none; margin-top: 2px; color: var(--teal-shadow); }

/* The competition: the rubric to download, and a main column beside a short note */
.rubric-card { display: flex; gap: 16px; align-items: center; justify-content: space-between; flex-wrap: wrap; padding: 18px 22px; background: var(--amber-tint); border: 2px solid var(--amber-tint-border); border-radius: 22px; box-shadow: 0 5px 0 var(--amber-tint-border); }
.rubric-card .rc-ico { display: grid; place-items: center; width: 56px; height: 56px; border-radius: 16px; background: var(--amber); }
.cols-2 { display: grid; gap: 20px; grid-template-columns: 1.4fr 1fr; align-items: start; }
@media (max-width: 1000px) { .cols-2 { grid-template-columns: 1fr; } }

/* The session plan's rows: one expandable row for each numbered session */
.sess-row { border: 2px solid var(--line); border-radius: 16px; padding: 12px 16px; background: var(--surface); }
.sess-row.is-current { border-color: var(--teal); box-shadow: 0 4px 0 var(--teal-tint); }
.sess-row.is-cancelled { opacity: 0.6; }
.sess-row > summary { list-style: none; cursor: pointer; }
.sess-row > summary::-webkit-details-marker { display: none; }
.sess-num { font-family: var(--font-display); font-weight: 600; font-size: 1.25rem; min-width: 2.2rem; }

/* The dashed upload box, and a quiet note */
.drop { border: 2px dashed var(--line-strong); border-radius: var(--radius-lg); padding: 16px; background: var(--paper-sunken); display: grid; gap: 8px; }
.drop input[type=file] { max-width: 100%; }
.file-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; }
.file-list li { display: flex; align-items: center; gap: 8px; background: var(--surface); border: 2px solid var(--line); border-radius: 10px; padding: 6px 10px; font-size: 0.875rem; }
.num-input { width: 5.5rem; }

/* A plain thin bar, for the Training step cards */
.bar { height: 14px; border-radius: 999px; background: var(--empty); overflow: hidden; }
.bar > span { display: block; height: 100%; background: var(--teal); }
.bar.warn > span { background: var(--amber); }


/* Present, Absent and Excused each have a colour, with a dot and the word as well, so colour never stands alone.
   Present is teal, Absent is red, Excused is amber. The chosen one is filled in. */
.tracker-choice span::before { content: ""; width: 10px; height: 10px; border-radius: 50%; margin-right: 8px; background: currentColor; opacity: 0.55; }
.tracker-choice.choice-p span { background: var(--teal-tint); border-color: var(--teal); }
.tracker-choice.choice-a span { background: var(--red-tint); border-color: #f4b6b6; }
.tracker-choice.choice-e span { background: var(--amber-tint); border-color: var(--amber-tint-border); }
.tracker-choice.choice-p span::before { background: var(--teal-shadow); opacity: 1; }
.tracker-choice.choice-a span::before { background: var(--red); opacity: 1; }
.tracker-choice.choice-e span::before { background: var(--amber-shadow); opacity: 1; }
.tracker-choice.choice-p input:checked + span { background: var(--teal); border-color: var(--teal-shadow); color: var(--ink); box-shadow: 0 3px 0 var(--teal-shadow); }
.tracker-choice.choice-a input:checked + span { background: var(--red); border-color: var(--red-shadow); color: #fff; box-shadow: 0 3px 0 var(--red-shadow); }
.tracker-choice.choice-e input:checked + span { background: var(--amber); border-color: var(--amber-shadow); color: var(--ink); box-shadow: 0 3px 0 var(--amber-shadow); }
.tracker-choice.choice-a input:checked + span::before { background: #fff; }
.tracker-choice.choice-p input:checked + span::before, .tracker-choice.choice-e input:checked + span::before { background: var(--ink); }

/* A value still to be confirmed. */
.ph { color: var(--text-subtle); font-style: italic; }
