:root {
  --brand: #760000;
  --brand-hover: #5a0000;
  --brand-soft: rgba(184, 57, 79, 0.22);
  --brand-text: #f3a2ab;
  --brand-text-hover: #f9ccd2;
  --brand-line: #b8394f;
  --brand-edge: #b8394f;
  --on-brand: #ffffff;
  --bg: #000000;
  --bg-2: #121212;
  --ink: #fbeff2;
  --muted: #d9b3b9;
  --line: rgba(251, 239, 242, 0.14);
  --radius: 14px;
  --font-display: "Sora", system-ui, sans-serif;
  --font-text: "Inter", "Noto Sans Thai", system-ui, sans-serif;
  --container: 1120px;
  --gutter: clamp(16px, 4vw, 32px);
  /* Alpha mask (not a painted colour): fades the right edge of the sub-nav while links sit off-screen. */
  --nav-fade-mask: linear-gradient(to right, #000 calc(100% - 28px), transparent);
}
html[data-scheme="light"] {
  --brand: #760000;
  --brand-hover: #5a0000;
  --brand-soft: rgba(118, 0, 0, 0.06);
  --brand-text: #760000;
  --brand-text-hover: #5a0000;
  --brand-line: #760000;
  --brand-edge: transparent;
  --on-brand: #ffffff;
  --bg: #ffffff;
  --bg-2: #dceeff;
  --ink: #222222;
  --muted: #666666;
  --line: rgba(34, 34, 34, 0.14);
}

/* ============================================================
   PGCS programme pages (T-742, T-752): a standalone theme, dark by default
   with a light scheme.

   The two token blocks above hold every colour: :root is the dark scheme
   (the default), html[data-scheme="light"] the light one. The BioCE shell's
   scheme toggle sets data-scheme="light" on <html> (lang-prepaint.js sets it
   before first paint from localStorage 'bioce-scheme'); no attribute means
   dark. Change a colour in BOTH blocks; every rule below reads it through
   var(), and the tests refuse a colour literal anywhere else in this file.
   deploy/check_contrast.py checks the text pairs of both schemes against
   WCAG 2.1 AA (4.5:1) and the pressed planner filter ring against 3:1.

   --brand / --brand-hover fill buttons, tags and the live rows (white
   --on-brand text). --brand-text is accent TEXT (headings, links, badges):
   a light wine tint on the dark scheme, the brand itself on the light one.
   --brand-line paints accent rules, markers and borders; --brand-edge
   outlines the primary button on the dark scheme only.

   T-816 (owner 2026-10-21: "black, real black, not red"): the dark --bg is
   pure black and --bg-2 a near-black neutral for cards and bands; the text
   tokens did not move. The pages are LIGHT by default: both carry
   data-scheme="light" on <html> in the markup (the shell reads it as the
   page default and shows Light), and lang-prepaint.js removes it before
   first paint when the stored bioce-scheme is dark. The PGCE page keeps
   dark as its default. Any new dark value must keep check_contrast.py at 28/28.

   The BioCE shell header (/assets/bioce-shell/shell.css) keeps its own
   tokens and is not styled here.
   ============================================================ */

/* Form controls and scrollbars follow the scheme: dark by default whatever the OS prefers (the
   pages' <meta name="color-scheme"> says "dark" only), light once the shell sets data-scheme.
   Only <html> carries data-scheme, so the bare attribute selector targets the same element as
   html[data-scheme="light"] and outranks `html`; it keeps that selector to the one token block. */
html { color-scheme: dark; }
[data-scheme="light"] { color-scheme: light; }

/* ---------- Language: the shell's ไทย/EN choice (html[data-lang]) ----------
   Each piece of copy is written twice, <span class="en"> and <span class="th">.
   With no stored choice and no JavaScript the page is English. */
html[data-lang="th"] .en,
html:not([data-lang="th"]) .th { display: none !important; }
html[data-lang="th"] body { line-height: 1.8; }
/* Thai copy is set in Noto Sans Thai (the text stack), headings included. */
.th { font-family: var(--font-text); }
html[data-lang="th"] :is(h1, h2, h3, h4) { line-height: 1.45; letter-spacing: 0; }

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-text);
  font-size: 1rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
h1, h2, h3, h4 {
  margin: 0;
  font-family: var(--font-display);
  line-height: 1.2;
  color: var(--ink);
}
p, ol, ul, figure { margin: 0; }
ol, ul { padding: 0; list-style: none; }
img, svg { display: block; max-width: 100%; }
strong { font-weight: 600; }
a {
  color: var(--brand-text);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}
a:hover { color: var(--brand-text-hover); }
:focus-visible {
  outline: 3px solid var(--brand-text);
  outline-offset: 3px;
  border-radius: 4px;
}
main:focus { outline: none; }
main [id] { scroll-margin-top: 4.75rem; }
[hidden] { display: none !important; }

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

.skip-link {
  position: absolute;
  top: 0;
  left: var(--gutter);
  z-index: 2000;
  padding: 0.75rem 1.1rem;
  border-radius: 0 0 10px 10px;
  background: var(--brand);
  color: var(--on-brand);
  font-weight: 600;
  text-decoration: none;
  transform: translateY(-120%);
  transition: transform 0.2s ease;
}
.skip-link:focus,
.skip-link:focus-visible { transform: none; color: var(--on-brand); outline-color: var(--ink); }

.container {
  width: 100%;
  max-width: calc(var(--container) + 2 * var(--gutter));
  margin-inline: auto;
  padding-inline: var(--gutter);
}

/* ---------- Programme sub-nav: below the shell, sticky once the shell scrolls away ---------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 900;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
}
.nav-inner {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  width: 100%;
  max-width: calc(var(--container) + 2 * var(--gutter));
  min-height: 60px;
  margin-inline: auto;
  padding-inline: var(--gutter);
}
.nav-logo {
  display: inline-flex;
  align-items: center;
  flex: none;
  min-height: 44px;
  color: var(--brand-text);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: 0.02em;
  text-decoration: none;
  white-space: nowrap;
}
.nav-links {
  display: flex;
  gap: 0.15rem;
  min-width: 0;
  margin-left: auto;
  overflow-x: auto;
  scrollbar-width: none;
}
.nav-links::-webkit-scrollbar { display: none; }
.nav-links a {
  position: relative;
  display: inline-flex;
  align-items: center;
  flex: none;
  min-height: 44px;
  padding: 0 0.8rem;
  border-radius: 8px;
  color: var(--ink);
  font-weight: 500;
  font-size: 0.95rem;
  text-decoration: none;
  white-space: nowrap;
}
.nav-links a:hover { color: var(--brand-text); background: var(--brand-soft); }
.nav-links a[aria-current="page"] { color: var(--brand-text); font-weight: 600; }
.nav-links a[aria-current="page"]::after {
  content: "";
  position: absolute;
  left: 0.8rem;
  right: 0.8rem;
  bottom: 6px;
  height: 2px;
  background: var(--brand-text);
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 44px;
  padding: 0.65rem 1.35rem;
  border: 1px solid transparent;
  border-radius: 10px;
  font-family: var(--font-text);
  font-weight: 600;
  font-size: 1rem;
  line-height: 1.25;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}
.btn-primary { background: var(--brand); color: var(--on-brand); border-color: var(--brand-edge); }
.btn-primary:hover { background: var(--brand-hover); color: var(--on-brand); }
.btn-ghost { background: var(--bg); color: var(--brand-text); border-color: var(--brand-line); }
.btn-ghost:hover { background: var(--brand-soft); color: var(--brand-text-hover); border-color: var(--brand-text-hover); }

/* ---------- Sections ----------
   T-752: the heading scale follows the PGCE public page (PGCE website
   app/web/assets/css/main.css): .hero-title, .section-head h2, .eyebrow,
   .hero-kicker, .hero-support (PGCE .hero-tagline), .hero-tagline (PGCE
   .hero-sub), card h3, .fact-num (PGCE .stat-value) and the schedule block
   titles (PGCE #schedule .section-title) use its sizes and weights. */
.section { padding-block: clamp(3.5rem, 8vw, 6rem); }
.section + .section { border-top: 1px solid var(--line); }
.section-head { max-width: 48rem; margin-bottom: clamp(2rem, 4vw, 3rem); }
.eyebrow {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  margin-bottom: 0.85rem;
  color: var(--brand-text);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}
.eyebrow::before {
  content: "";
  flex: none;
  width: 24px;
  height: 2px;
  background: var(--brand-line);
}
html[data-lang="th"] .eyebrow { font-size: 0.9rem; letter-spacing: 0.02em; }
.section-head h2 {
  color: var(--brand-text);
  font-size: clamp(1.9rem, 4.2vw, 3.1rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.15;
}
.section-head h3 {
  margin-top: 1rem;
  font-size: clamp(1.2rem, 2.4vw, 1.45rem);
  font-weight: 600;
}
.h2-sep { color: var(--muted); }
.subtitle {
  margin-top: 0.6rem;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(1.05rem, 2vw, 1.2rem);
  color: var(--ink);
}
.lede { max-width: 68ch; margin-top: 1rem; font-size: 1.05rem; color: var(--ink); }
.lede + .lede { margin-top: 0.85rem; }

/* ---------- 1 · Hero ---------- */
.hero {
  padding-block: clamp(3.5rem, 9vw, 7rem) clamp(3rem, 7vw, 5.5rem);
  border-bottom: 1px solid var(--line);
}
.hero-inner { display: flex; flex-direction: column; align-items: flex-start; }
.pgcs-banner {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 2rem;
  padding: 0.4rem 1rem 0.4rem 0.4rem;
  border: 1px solid var(--brand-line);
  border-radius: 999px;
  background: var(--brand-soft);
  color: var(--ink);
  font-weight: 600;
  line-height: 1.3;
  text-decoration: none;
  transition: background-color 0.2s ease;
}
.pgcs-banner:hover { color: var(--ink); background: var(--bg); }
.pgcs-banner-tag {
  padding: 0.35rem 0.8rem;
  border-radius: 999px;
  background: var(--brand);
  color: var(--on-brand);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
/* T-764: when the pill wraps at phone widths the text sits on its own line, so it carries its own
   0.6rem left inset instead of leaning on the tag; the column gap drops to 0.15rem so the one-line
   spacing stays 0.75rem (0.15 + 0.6), exactly what the single 0.75rem gap gave before. */
.pgcs-banner { gap: 0.35rem 0.15rem; }
.pgcs-banner-text { font-size: 0.95rem; padding-left: 0.6rem; }
/* The closed-state twins (and, after the close, the open-state spans) stay out of the pill. */
.pgcs-banner [hidden] { display: none; }
/* T-764: lang-prepaint.js flags html[data-pgcs-applications="closed"] before first paint once the
   close instant has passed, so the closed twins show before the deferred nav.js removes their
   hidden flags. The closed rule needs !important because the global [hidden] rule above has it. */
html[data-pgcs-applications="closed"] .pgcs-banner [data-banner-state="open"] { display: none; }
html[data-pgcs-applications="closed"] .pgcs-banner [data-banner-state="closed"] { display: inline !important; }
.hero-kicker {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  color: var(--brand-text);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}
.hero-kicker::before {
  content: "";
  flex: none;
  width: 28px;
  height: 2px;
  background: var(--brand-line);
}
.hero-title {
  max-width: 20ch;
  margin-top: 1rem;
  color: var(--brand-text);
  font-size: clamp(3.1rem, 10vw, 7.5rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.02;
}
html[data-lang="th"] .hero-title { max-width: 22ch; line-height: 1.32; }
.hero-support {
  margin-top: 1.5rem;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(1.3rem, 3vw, 2rem);
  letter-spacing: -0.01em;
  line-height: 1.18;
  color: var(--ink);
}
.hero-tagline {
  margin-top: 0.4rem;
  color: var(--brand-text);
  font-size: clamp(1.02rem, 1.6vw, 1.2rem);
  font-weight: 600;
  letter-spacing: 0.01em;
}
.hero-actions { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 2.25rem; }

/* ---------- 2 · Program ---------- */
.program-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
  gap: clamp(2rem, 5vw, 4rem);
  align-items: start;
}
.program-intro p { font-size: 1.05rem; }
.program-intro p + p { margin-top: 1rem; }
.program-aside {
  padding: clamp(1.4rem, 3vw, 2rem);
  border: 1px solid var(--line);
  border-top: 4px solid var(--brand-line);
  border-radius: var(--radius);
}
.program-aside h3 { font-size: 1.1rem; font-weight: 700; }
.program-aside h3 + p { margin-top: 0.5rem; color: var(--muted); }
.program-aside p + h3 { margin-top: 1.5rem; }
.outcomes { display: grid; gap: 0.85rem; margin-top: 0.85rem; }
.outcomes li {
  position: relative;
  padding-left: 1.6rem;
  color: var(--muted);
  font-size: 0.95rem;
}
.outcomes li::before {
  content: "";
  position: absolute;
  left: 0.1rem;
  top: 0.42em;
  width: 0.7rem;
  height: 0.38rem;
  border-left: 2px solid var(--brand-line);
  border-bottom: 2px solid var(--brand-line);
  transform: rotate(-45deg);
}
.outcomes strong { display: block; color: var(--ink); }
.fact-row {
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem 2rem;
  margin-top: clamp(2.5rem, 5vw, 3.5rem);
}
.fact {
  flex: 1 1 9rem;
  padding-top: 1rem;
  border-top: 2px solid var(--brand-line);
}
.fact-num {
  display: block;
  color: var(--brand-text);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(2.6rem, 5.5vw, 4rem);
  letter-spacing: -0.02em;
  line-height: 1.05;
}
.fact-label { display: block; margin-top: 0.5rem; color: var(--muted); font-size: 0.92rem; line-height: 1.4; }

/* ---------- 3 · Course schedule ---------- */
.schedule-period { margin-top: 0.85rem; color: var(--muted); }
.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem 1.75rem;
  margin-bottom: 2rem;
  font-size: 0.92rem;
}
.legend li { display: inline-flex; align-items: center; gap: 0.55rem; }
.swatch {
  flex: none;
  width: 1.1rem;
  height: 1.1rem;
  border: 1px solid var(--line);
  border-radius: 4px;
}
.swatch-video { background: var(--bg-2); }
.swatch-live { background: var(--brand); border-color: var(--brand-line); }
.swatch-onsite { background: var(--brand-soft); border: 1px dashed var(--brand-line); }

.sched-blocks { display: grid; gap: clamp(2.25rem, 4vw, 3rem); }
.sched-block-head {
  display: grid;
  gap: 0.3rem;
  margin-bottom: 1rem;
  padding-left: 1rem;
  border-left: 4px solid var(--brand-line);
}
.sched-block-tag {
  color: var(--brand-text);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.sched-block-head h3 { font-size: clamp(1.25rem, 2.8vw, 1.75rem); font-weight: 800; line-height: 1.25; }
.sched-block-facts { color: var(--muted); font-size: 0.95rem; }
.sched-block-live { color: var(--brand-text); font-size: 0.95rem; font-weight: 600; }

/* The one element allowed to be wider than the screen: it scrolls inside its box. */
.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.week-table { width: 100%; border-collapse: collapse; font-size: 0.95rem; }
.week-table th,
.week-table td {
  padding: 0.8rem 1rem;
  border-top: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}
.week-table thead th {
  border-top: 0;
  background: var(--bg);
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
}
html[data-lang="th"] .week-table thead th { font-size: 0.88rem; letter-spacing: 0; }
.week-table .col-week { width: 5.5rem; }
.week-table tbody .col-week {
  color: var(--ink);
  font-family: var(--font-display);
  font-weight: 700;
}
.week-table .row-week .col-week { background: var(--bg-2); }
.week-table .col-window { width: 13rem; white-space: nowrap; font-variant-numeric: tabular-nums; }
.week-table .col-hours { width: 6rem; text-align: right; font-variant-numeric: tabular-nums; }
.week-table tbody .col-hours { font-weight: 600; }
.week-topics summary {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  min-height: 44px;
  margin-block: -0.6rem;
  color: var(--brand-text);
  font-weight: 600;
  cursor: pointer;
  list-style: none;
}
.week-topics summary::-webkit-details-marker { display: none; }
.week-topics summary::after {
  content: "";
  width: 0.45rem;
  height: 0.45rem;
  margin-top: -0.2rem;
  border-right: 2px solid var(--brand-text);
  border-bottom: 2px solid var(--brand-text);
  transform: rotate(45deg);
  transition: transform 0.2s ease;
}
.week-topics[open] summary::after { margin-top: 0.2rem; transform: rotate(-135deg); }
.week-topics summary:hover { color: var(--brand-text-hover); }
.week-topics ol {
  display: grid;
  gap: 0.35rem;
  margin: 0.75rem 0 0.2rem;
  padding-left: 1.3rem;
  list-style: decimal;
}
.week-topics li::marker { color: var(--muted); }
.topic-hours { color: var(--muted); font-size: 0.9em; white-space: nowrap; font-variant-numeric: tabular-nums; }
.week-topics .topic-hours::before { content: "("; }
.week-topics .topic-hours::after { content: ")"; }
.week-table .row-live th,
.week-table .row-live td {
  border-top-color: var(--brand);
  background: var(--brand);
  color: var(--on-brand);
  font-weight: 600;
}
.week-table .row-onsite th,
.week-table .row-onsite td {
  border-top: 1px dashed var(--brand-line);
  background: var(--brand-soft);
  color: var(--brand-text);
  font-weight: 600;
}
.sched-note { margin-top: 1.5rem; color: var(--muted); font-size: 0.95rem; }

.key-dates { margin-top: clamp(2.75rem, 6vw, 4rem); }
.key-dates-title { font-size: clamp(1.15rem, 2.4vw, 1.4rem); font-weight: 700; }
.date-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(17rem, 100%), 1fr));
  gap: 1rem;
  margin-top: 1.5rem;
}
.date-item {
  padding: 1.4rem 1.5rem;
  border: 1px solid var(--line);
  border-top: 3px solid var(--brand-line);
  border-radius: var(--radius);
  background: var(--bg);
}
.date-when {
  margin-bottom: 0.5rem;
  color: var(--brand-text);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.05rem;
  line-height: 1.3;
  font-variant-numeric: tabular-nums;
}
.date-item h4 { margin-bottom: 0.4rem; font-size: 1.05rem; font-weight: 600; }
.date-item > p:not(.date-when) { color: var(--muted); font-size: 0.95rem; }
.date-item > p + p { margin-top: 0.6rem; }
.date-sub { display: grid; gap: 0.3rem; margin-top: 0.75rem; }
.date-sub li {
  position: relative;
  padding-left: 1.1rem;
  font-size: 0.93rem;
  font-variant-numeric: tabular-nums;
}
.date-sub li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.62em;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--brand-line);
}
.schedule-links { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 2rem; }

/* ---------- 4 · Curriculum ---------- */
.cur-list { display: grid; gap: 1rem; }
.cur-section {
  border: 1px solid var(--line);
  border-left: 4px solid var(--brand-line);
  border-radius: var(--radius);
  background: var(--bg);
}
.cur-section > summary {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto auto;
  grid-template-areas: "num title hours icon";
  align-items: center;
  gap: 0.4rem 1.25rem;
  min-height: 44px;
  padding: 1.2rem 1.5rem;
  cursor: pointer;
  list-style: none;
}
.cur-section > summary::-webkit-details-marker { display: none; }
.cur-section > summary::after {
  content: "";
  grid-area: icon;
  justify-self: end;
  width: 0.6rem;
  height: 0.6rem;
  margin-top: -0.25rem;
  border-right: 2px solid var(--brand-text);
  border-bottom: 2px solid var(--brand-text);
  transform: rotate(45deg);
  transition: transform 0.2s ease;
}
.cur-section[open] > summary::after { margin-top: 0.25rem; transform: rotate(-135deg); }
.cur-section > summary:hover .cur-title { color: var(--brand-text); }
.cur-num {
  grid-area: num;
  color: var(--brand-text);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  white-space: nowrap;
}
.cur-title {
  grid-area: title;
  color: var(--ink);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(1.05rem, 2.2vw, 1.25rem);
  line-height: 1.3;
}
.cur-hours {
  grid-area: hours;
  justify-self: start;
  padding: 0.3rem 0.8rem;
  border-radius: 999px;
  background: var(--brand-soft);
  color: var(--brand-text);
  font-size: 0.88rem;
  font-weight: 600;
  white-space: nowrap;
}
.cur-body { padding: 0.2rem 1.5rem 1.5rem; border-top: 1px solid var(--line); }
.cur-body h4 { margin-top: 1.3rem; font-size: 0.98rem; font-weight: 600; }
.cur-topics { margin-top: 0.4rem; }
.cur-topics li {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  padding: 0.55rem 0;
  border-bottom: 1px solid var(--line);
}
.cur-topics li:last-child { border-bottom: 0; }

/* ---------- 5 · Software ---------- */
/* The --bg-2 band keeps the section distinct from the curriculum; the cards sit on --bg with the
   accent line on top (white cards on the light scheme, deep dark cards on the dark one). */
#software { background: var(--bg-2); }
.sw-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.25rem;
  align-items: stretch;
}
.sw-card {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  padding: clamp(1.5rem, 3vw, 2.1rem);
  border: 1px solid var(--line);
  border-top: 4px solid var(--brand-line);
  border-radius: var(--radius);
  background: var(--bg);
}
.sw-card h3 { font-size: 1.45rem; font-weight: 700; }
.sw-notice {
  padding: 0.8rem 1rem;
  border-left: 3px solid var(--brand-line);
  border-radius: 0 8px 8px 0;
  background: var(--bg-2);
  color: var(--ink);
  font-weight: 600;
}
.sw-actions { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: auto; padding-top: 0.4rem; }

/* ---------- 6 · How it works ---------- */
.how-track {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1rem;
}
.step-card,
.feature-card {
  padding: 1.4rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg);
}
.step-num {
  display: block;
  color: var(--brand-text);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  margin: 0.8rem 0 0.75rem;
  border-radius: 10px;
  background: var(--brand-soft);
  color: var(--brand-text);
}
.feature-card .icon { margin-top: 0; }
.icon svg { width: 1.4rem; height: 1.4rem; }
.step-card h3,
.feature-card h3 { margin-bottom: 0.35rem; font-size: 1.12rem; font-weight: 600; }
.step-card p,
.feature-card > p { color: var(--muted); font-size: 0.95rem; }

/* ---------- 7 · Assessment ---------- */
.features-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
  align-items: start;
}
.rounds { display: grid; gap: 0.4rem; margin-top: 0.9rem; }
.rounds li {
  display: flex;
  flex-wrap: wrap;
  gap: 0.2rem 0.6rem;
  padding: 0.55rem 0.8rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  font-size: 0.9rem;
  font-variant-numeric: tabular-nums;
}
.rounds .round-name { color: var(--brand-text); font-weight: 600; }

/* ---------- 8 · Fees and payment ---------- */
.fees-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  align-items: start;
}
.fees-panel {
  padding: clamp(1.4rem, 3vw, 2rem);
  border: 1px solid var(--line);
  border-top: 4px solid var(--brand-line);
  border-radius: var(--radius);
}
/* Dormant online-payment slot: a label only (no form, no script, no link). */
.pay-slot {
  padding: clamp(1.4rem, 3vw, 2rem);
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  color: var(--muted);
}
.pay-slot p + p { margin-top: 0.4rem; }
.pay-slot-label { color: var(--ink); font-weight: 600; }

/* ---------- 9 · Apply ---------- */
.access-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}
.access-panel {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.85rem;
  padding: clamp(1.5rem, 3vw, 2.1rem);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
/* T-813: the portal door is one full-width card (the two-column grid stays for the channels). */
.access-grid-one { grid-template-columns: minmax(0, 1fr); }
.access-panel:first-child { border-top: 4px solid var(--brand-line); }
.access-panel h3 { font-size: 1.25rem; font-weight: 700; }
.micro { color: var(--muted); font-size: 0.9rem; }
/* T-789 (owner announcement 2026-10-14): fee tiers in section 8, the two registration
   channels before the portal doors in section 9, phone and LINE in section 10. Tokens only. */
.fees-panel h3 { font-size: 1.25rem; font-weight: 700; margin-bottom: 0.9rem; }
.fee-list { list-style: none; margin: 0 0 1rem; padding: 0; display: grid; gap: 0.55rem; }
.fee-list li {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.35rem 1rem;
  padding-bottom: 0.55rem;
  border-bottom: 1px solid var(--line);
}
.fee-list li:last-child { padding-bottom: 0; border-bottom: 0; }
.fee-who { flex: 1 1 12rem; }
.fee-amount { margin-left: auto; color: var(--brand-text); font-weight: 700; white-space: nowrap; }
.channel-grid { margin-bottom: 0.5rem; }
.channel-grid .access-panel { border-top: 4px solid var(--brand-line); }
.channel-fee { color: var(--brand-text); font-weight: 700; }
.access-sub { margin: 1.75rem 0 0.9rem; }

/* ---------- 10 · Contact and footer ---------- */
.contact-mail {
  font-family: var(--font-display);
  font-size: clamp(1.2rem, 3vw, 1.6rem);
  font-weight: 600;
}
.contact-mail a { overflow-wrap: anywhere; text-underline-offset: 5px; }
.contact-channels { list-style: none; margin: 1.25rem 0 0; padding: 0; display: grid; gap: 0.75rem; }
.contact-channels li { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.3rem 0.9rem; }
.contact-channels a { font-weight: 600; text-underline-offset: 5px; }
.contact-label { min-width: 11rem; color: var(--muted); font-size: 0.9rem; }
.footer { padding-block: 2.5rem; background: var(--bg-2); }
.footer-inner { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 1.5rem; }
.footer-brand { color: var(--brand-text); font-family: var(--font-display); font-weight: 600; }
.footer-note,
.footer-meta { color: var(--muted); font-size: 0.92rem; }
.footer-note { margin-top: 0.3rem; }
.footer-meta p + p { margin-top: 0.3rem; }

/* ---------- Course schedule page (course-schedule.html) ---------- */
.page-head { padding-top: clamp(3rem, 7vw, 5rem); }
.page-head h1 {
  color: var(--brand-text);
  font-size: clamp(2rem, 4.6vw, 3.1rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.15;
}
.page-head .eyebrow a { color: var(--brand-text); }
.planner-intro {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem;
  margin-bottom: 0.75rem;
  padding: 1.4rem 1.6rem;
  border-radius: var(--radius);
  background: var(--bg-2);
}
.planner-intro > div { flex: 1 1 18rem; min-width: 0; }
.planner-kicker { color: var(--brand-text); font-family: var(--font-display); font-weight: 700; }
.planner-intro-copy { margin-top: 0.25rem; }
.planner-download { flex: 0 1 auto; min-width: min(100%, 14rem); }
.planner-calendar-note { max-width: 76ch; color: var(--muted); font-size: 0.9rem; line-height: 1.6; }
.planner-jump { display: flex; flex-wrap: wrap; align-items: center; gap: 0.55rem; margin: 1.75rem 0; }
.planner-jump-label { margin-right: 0.3rem; color: var(--muted); }
.planner-jump a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0.35rem 0.95rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink);
  text-decoration: none;
}
.planner-jump a:hover { border-color: var(--brand-line); color: var(--brand-text); }
.planner-controls {
  margin-bottom: 1.5rem;
  padding: clamp(1.2rem, 3vw, 1.8rem);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.planner-search-label {
  display: block;
  margin-bottom: 0.55rem;
  font-family: var(--font-display);
  font-weight: 600;
}
.planner-search {
  width: 100%;
  min-height: 48px;
  padding: 0.75rem 1rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--bg);
  color: var(--ink);
  font: inherit;
}
.planner-search::placeholder { color: var(--muted); }
.planner-search:focus-visible { border-color: var(--brand-line); }
.planner-help { margin-top: 0.5rem; color: var(--muted); font-size: 0.9rem; }
.planner-filter-row { display: flex; flex-wrap: wrap; align-items: center; gap: 0.45rem; margin-top: 1.25rem; }
.planner-filter-label { margin-right: 0.35rem; }
.planner-filter,
.planner-reset {
  min-height: 44px;
  border: 1px solid var(--line);
  background: var(--bg);
  color: var(--ink);
  font: inherit;
  cursor: pointer;
}
.planner-filter { padding: 0.35rem 1rem; border-radius: 999px; }
.planner-filter:hover,
.planner-reset:hover { border-color: var(--brand-line); color: var(--brand-text); }
/* T-752: the pressed state is marked by a 2px --brand-text ring (border plus inset shadow), not by the
   fill alone: the --brand fill is 1.64:1 on the dark --bg, below the 3:1 a state indicator needs
   (WCAG 1.4.11). --brand-text is the brand itself on the light scheme, so light looks unchanged.
   deploy/check_contrast.py pins the ring as "brand-text ring on bg" (3:1). */
.planner-filter[aria-pressed="true"] {
  border-color: var(--brand-text);
  background: var(--brand);
  box-shadow: inset 0 0 0 1px var(--brand-text);
  color: var(--on-brand);
  font-weight: 600;
}
.planner-result { margin-top: 1rem; font-weight: 600; }
.planner-empty { margin-top: 1rem; padding: 1rem; border: 1px solid var(--line); border-radius: 10px; }
.planner-reset { margin-top: 0.55rem; padding: 0.4rem 0.9rem; border-radius: 10px; }
.sched-sections { display: grid; gap: 1.25rem; }
.sched-section {
  padding: clamp(1.4rem, 3vw, 2.2rem);
  border: 1px solid var(--line);
  border-left: 4px solid var(--brand-line);
  border-radius: var(--radius);
}
.sched-section-head {
  margin-bottom: 1.2rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--line);
}
.sched-section-head h2 {
  color: var(--brand-text);
  font-size: clamp(1.35rem, 3vw, 1.8rem);
  font-weight: 700;
}
.sched-title { margin-top: 0.2rem; font-family: var(--font-display); font-weight: 600; font-size: 1.1rem; }
.sched-meta { margin-top: 0.4rem; color: var(--muted); }
.sched-live { margin-top: 0.2rem; color: var(--brand-text); font-weight: 600; }
.sched-week + .sched-week { margin-top: 1.3rem; }
.sched-week h3 { margin-bottom: 0.5rem; font-size: 1rem; font-weight: 600; }
.sched-topics {
  display: grid;
  gap: 0.3rem;
  padding-left: 1.6rem;
  list-style: decimal;
}
.sched-topics li::marker { color: var(--muted); }
/* The onsite session closes the week-by-week list, styled like the landing table's onsite row. */
.sched-onsite {
  padding: clamp(1.2rem, 3vw, 1.6rem) clamp(1.4rem, 3vw, 2.2rem);
  border: 1px dashed var(--brand-line);
  border-radius: var(--radius);
  background: var(--brand-soft);
  color: var(--brand-text);
  font-weight: 600;
}
.sched-onsite h2 { color: var(--brand-text); font-size: clamp(1.35rem, 3vw, 1.8rem); font-weight: 700; }
.sched-onsite p { margin-top: 0.3rem; }
.page-actions { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 2rem; }

/* ---------- Narrow screens: grids stack, the week table becomes cards ---------- */
@media (max-width: 959.98px) {
  .how-track { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .features-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 719.98px) {
  .program-grid,
  .sw-grid,
  .how-track,
  .features-grid,
  .fees-grid,
  .access-grid { grid-template-columns: minmax(0, 1fr); }
  .nav-inner { gap: 0.5rem; }
  /* The shared BioCE header above already brands the page; the five links get the whole row. */
  .nav-logo { display: none; }
  .nav-links { width: 100%; gap: 0; margin-left: 0; justify-content: space-between; }
  .nav-links a { padding: 0 0.35rem; font-size: 0.85rem; }
  .nav-links a[aria-current="page"]::after { left: 0.35rem; right: 0.35rem; }
  /* nav.js sets .is-overflowing while links sit off to the right; the edge fades as a cue. */
  .nav-links.is-overflowing {
    -webkit-mask-image: var(--nav-fade-mask);
    mask-image: var(--nav-fade-mask);
  }
  .hero-actions .btn,
  .schedule-links .btn { flex: 1 1 100%; }

  .cur-section > summary {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas: "num icon" "title icon" "hours icon";
    padding: 1.1rem 1.15rem;
  }
  .cur-body { padding: 0.2rem 1.15rem 1.2rem; }

  .table-wrap { overflow: visible; border: 0; border-radius: 0; }
  .week-table,
  .week-table tbody,
  .week-table tr,
  .week-table th,
  .week-table td { display: block; width: auto; }
  .week-table thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
  }
  .week-table tr {
    margin-bottom: 0.75rem;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: var(--radius);
  }
  .week-table th,
  .week-table td { padding: 0.6rem 1rem; border-top: 0; white-space: normal; }
  .week-table .col-week,
  .week-table .col-window,
  .week-table .col-hours { width: auto; text-align: left; }
  /* A week card: the week on top, release window and hours side by side, then the topics. */
  .week-table tr.row-week { display: grid; grid-template-columns: minmax(0, 1fr) auto; }
  .week-table .row-week .col-week { grid-column: 1 / -1; }
  .week-table .row-week .col-window { grid-row: 2; grid-column: 1; }
  .week-table .row-week .col-hours { grid-row: 2; grid-column: 2; text-align: right; }
  .week-table .row-week .col-topics { grid-row: 3; grid-column: 1 / -1; padding-bottom: 0.9rem; }
  .week-table td[data-label]::before {
    content: attr(data-label);
    display: block;
    color: var(--muted);
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
  }
  .week-table th[data-label]::before { content: attr(data-label) " "; }
  html[data-lang="th"] .week-table td[data-label]::before {
    content: attr(data-label-th);
    font-size: 0.85rem;
    letter-spacing: 0;
    text-transform: none;
  }
  html[data-lang="th"] .week-table th[data-label]::before { content: attr(data-label-th) " "; }
  .week-table .row-live td[data-label]::before { color: var(--on-brand); }
  .week-table .row-onsite td[data-label]::before { color: var(--brand-text); }
  .week-table .row-live,
  .week-table .row-onsite { border-color: var(--brand-line); }
  .week-topics summary { margin-block: 0; }
}

/* ---------- Reduced motion: mirrors motion.js, which plays nothing then ---------- */
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
