/* ============================================================
   SI 658 W27 — App styles (Wayfinding)
   Typographic system:
   - Display: 800wt, tracking -0.02em, leading 1.08, wrap-balanced
   - Section heads: 800wt, tracking -0.01em, leading 1.2
   - Card heads: 750wt, leading 1.3, wrap-balanced
   - Body: 17px, leading 1.55; ledes 1.65 (long measure needs air)
   - Labels (one voice app-wide): mono 700wt, .8rem, tracking .14em,
     uppercase, tabular figures
   - Measures capped: ledes 62ch, card text 68ch
   ============================================================ */

* { margin: 0; padding: 0; box-sizing: border-box; }

html { font-size: 100%; }
body {
  font-family: var(--sans);
  font-size: var(--text-base);
  background: var(--bg);
  color: var(--blue);
  line-height: 1.55;
  -webkit-text-size-adjust: 100%;
  font-kerning: normal;
}

/* Links keep course blue even when visited — no browser purple */
main a, main a:visited { color: var(--blue); }

/* Every link that leaves the app announces it */
a[target="_blank"]::after {
  content: "\00a0\2197";
  font-size: .85em; font-weight: 700;
}

/* One label voice, everywhere */
.label, .wk, .mod-head .kicker, .board-title, .cal thead th,
.person .role, .mod-facts li span, .cal .wk-cell, .ticker .flag {
  font-family: var(--mono);
  font-weight: 700;
  font-size: .8rem;
  letter-spacing: .14em;
  text-transform: uppercase;
  font-variant-numeric: tabular-nums;
}

/* Dates & figures align app-wide */
.wk, .wk-cell, .due, .due-cell, .mod-facts, time {
  font-variant-numeric: tabular-nums;
}

/* ---------- Accessibility primitives ---------- */
.sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip-link {
  position: absolute; left: 8px; top: -48px; z-index: 100;
  background: var(--maize); color: var(--blue);
  font-weight: 800; padding: 10px 16px; text-decoration: none;
  transition: top .15s ease;
}
.skip-link:focus { top: calc(8px + env(safe-area-inset-top, 0px)); }

:focus-visible { outline: var(--focus-on-light); outline-offset: 2px; }
header :focus-visible, footer :focus-visible, .on-blue :focus-visible {
  outline: var(--focus-on-blue); outline-offset: 2px;
}

/* ---------- Announcements ---------- */
.alerts { max-width: var(--maxw); margin: 0 auto; padding: 20px 24px 0; display: grid; gap: 12px; }
.alerts[hidden] { display: none; }
.alert {
  display: flex; gap: 16px; align-items: flex-start;
  background: var(--white); border: 2px solid var(--blue);
  padding: 16px 18px;
}
.alert-info { border-left: 12px solid var(--blue); }
.alert-warning { border-left: 12px solid var(--maize); background: #FFF6D6; }
.alert-urgent { border: 3px solid var(--blue); border-left: 12px solid var(--maize); background: var(--maize); }
.alert-text { flex: 1; }
.alert-title { font-weight: 800; font-size: 1.05rem; line-height: 1.35; }
.alert-msg { font-size: .94rem; line-height: 1.5; color: var(--blue-secondary); margin-top: 4px; max-width: 68ch; }
.alert-urgent .alert-msg { color: var(--blue); }
.alert-action { display: inline-block; margin-top: 8px; font-weight: 700; font-size: .92rem; color: var(--blue); text-underline-offset: 3px; }
.alert-dismiss {
  flex: none; font: inherit; font-size: 1.3rem; font-weight: 700; line-height: 1;
  background: transparent; color: var(--blue); border: 0; cursor: pointer;
  padding: 4px 8px;
}
.alert-dismiss:hover { background: var(--blue-15); }

/* ---------- Header / signage ---------- */
header.app-header {
  background: var(--blue); color: var(--white);
  padding-top: env(safe-area-inset-top, 0px); /* clear the iOS status bar */
}
.head-in { max-width: var(--maxw); margin: 0 auto; padding: 20px 24px 0; }
.sign { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.sign .blockm { height: 32px; width: auto; display: block; }
.sign .block {
  background: var(--maize); color: var(--blue);
  font-weight: 800; font-size: 1.5rem; padding: 5px 14px;
  letter-spacing: .04em; line-height: 1.2;
}
.sign .line { font-weight: 300; font-size: 1.1rem; letter-spacing: .01em; }
.head-icons { margin-left: auto; display: flex; gap: 8px; }
.head-icons button {
  background: transparent; border: 0; cursor: pointer;
  color: var(--paper-on-blue); padding: 8px; line-height: 0;
}
.head-icons svg { width: 22px; height: 22px; }
.head-icons button:hover { color: var(--maize); }
.head-icons button[aria-pressed="true"] { color: var(--maize); }
.head-icons button:focus-visible { outline: var(--focus-on-blue); outline-offset: 2px; }

nav.app-nav { display: flex; flex-wrap: wrap; margin-top: 16px; }
nav.app-nav a {
  color: var(--white); text-decoration: none; font-weight: 700; font-size: .92rem;
  letter-spacing: .02em; line-height: 1.2;
  padding: 13px 16px; border-top: 4px solid transparent;
}
nav.app-nav a[aria-current="page"] {
  background: var(--bg); color: var(--blue); border-top-color: var(--maize);
}
nav.app-nav a:hover:not([aria-current="page"]) { border-top-color: var(--blue-secondary); }
/* focus ring drawn inside the tab — an outset ring bleeds below the header edge */
nav.app-nav a:focus-visible { outline: 3px solid var(--maize); outline-offset: -3px; }
nav.app-nav a[aria-current="page"]:focus-visible { outline-color: var(--blue); }
/* Safari focuses clicked links; never show their ring for mouse interaction */
nav.app-nav a:focus:not(:focus-visible) { outline: none; }

/* ---------- Section subnav: same surface as the page, so the active tab
   flows into its section unbroken (folder tab + sheet) ---------- */
.subnav {
  background: var(--bg);
  border-bottom: 2px solid var(--blue-15);
  display: flex; overflow-x: auto; scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  padding-left: max(24px, calc((100% - var(--maxw)) / 2 + 24px));
  padding-right: 24px;
}
.subnav::-webkit-scrollbar { display: none; }
.subnav[hidden] { display: none; }
.subnav a {
  display: flex; align-items: baseline; gap: 8px;
  color: var(--blue-secondary); font-weight: 700; font-size: .85rem;
  text-decoration: none; white-space: nowrap;
  padding: 11px 14px 9px; border-bottom: 3px solid transparent;
  margin-bottom: -2px; /* active underline sits on the band's own hairline */
}
.subnav a:hover { color: var(--blue); }
.subnav a[aria-current="page"] { color: var(--blue); border-bottom-color: var(--maize); }
.subnav a:focus-visible { outline: var(--focus-on-light); outline-offset: -3px; }
.sub-num {
  font-family: var(--mono); font-size: .7rem; font-weight: 700;
  color: var(--blue); border: 1px solid rgba(0, 39, 76, .35);
  padding: 1px 6px; border-radius: 2px;
}

/* ---------- Main / display type ---------- */
main {
  max-width: var(--maxw); margin: 0 auto; padding: 48px 24px 88px;
  min-height: 72vh; /* reserve space before JS renders — keeps the footer from jumping (CLS) */
}
main h1 {
  font-size: clamp(2rem, 5vw, 3.25rem); font-weight: 800;
  line-height: 1.08; letter-spacing: -0.02em; max-width: 20ch;
  text-wrap: balance;
}
main h1:focus { outline: none; }
/* #main receives programmatic focus on route change (for screen-reader
   announcement). Safari draws a ring for programmatic focus; suppress it —
   a ring around the entire content region is noise, not wayfinding. */
main:focus, main:focus-visible { outline: none; }
main h2 { text-wrap: balance; }

.section-head { /* section-level h2s (Troika, Grading, …) */
  font-size: 1.5rem; font-weight: 800; letter-spacing: -0.01em;
  line-height: 1.2; margin-top: 56px;
}

.lede {
  margin-top: 22px; font-size: 1.1rem; line-height: 1.65;
  max-width: 62ch; color: var(--blue-secondary); text-wrap: pretty;
}
.lede b, .lede strong { color: var(--blue); }
.lede + .lede { margin-top: 14px; }
.blank { color: transparent; -webkit-text-stroke: 2px var(--blue); border-bottom: 6px solid var(--maize); }
p + p { margin-top: 12px; }

/* ---------- Now ticker ---------- */
.ticker { margin-top: 52px; display: flex; align-items: stretch; border: 2px solid var(--blue); background: var(--white); }
.ticker .flag {
  background: var(--maize); color: var(--blue); display: flex; align-items: center;
  padding: 18px 20px; white-space: nowrap;
}
.ticker .body { padding: 18px 22px 20px; }
.ticker .body h2 { font-size: 1.3rem; font-weight: 800; line-height: 1.3; }
.ticker .body p { font-size: .96rem; line-height: 1.5; color: var(--blue-secondary); margin-top: 6px; max-width: 68ch; }
.ticker .body p b { color: var(--blue); }

/* ---------- Featured reading (Read this first) ---------- */
.featured-reading {
  margin-top: 24px; background: var(--maize); color: var(--blue);
  border: 2px solid var(--blue); padding: 22px 26px 24px;
}
.featured-reading .fr-label { letter-spacing: .14em; margin-bottom: 8px; }
.featured-reading h2 { font-size: 1.55rem; font-weight: 800; letter-spacing: -0.01em; line-height: 1.2; }
.featured-reading h2 a { color: var(--blue); text-decoration-thickness: 3px; text-underline-offset: 4px; }
.featured-reading .fr-byline { font-weight: 700; font-size: .95rem; margin-top: 6px; }
.featured-reading .fr-blurb { margin-top: 10px; font-size: .98rem; line-height: 1.6; max-width: 62ch; }

/* ---------- Directory board ---------- */
.board { margin-top: 56px; background: var(--white); border: 2px solid var(--blue); }
.board-title {
  background: var(--blue); color: var(--white); padding: 11px 20px 10px;
  display: flex; justify-content: space-between;
}
.row {
  display: grid; grid-template-columns: 96px 1fr auto 40px;
  align-items: center; gap: 20px; padding: 22px 24px;
  border-top: 2px solid var(--blue-15); text-decoration: none; color: inherit;
}
.row:first-of-type { border-top: 0; }
.row:hover { background: var(--blue-15); }
.row .wks { color: var(--blue-secondary); line-height: 1.5; }
.row .wks b { display: block; font-size: 1.05rem; color: var(--blue); letter-spacing: .06em; }
.row h2, .row h3 {
  font-size: 1.8rem; font-weight: 800; letter-spacing: -0.015em; line-height: 1.15;
}
.row .epi {
  display: block; font-size: .95rem; line-height: 1.45;
  color: var(--blue-secondary); font-style: italic; margin-top: 4px; max-width: 44ch;
}
.row .due { text-align: right; font-size: .82rem; line-height: 1.5; color: var(--blue-secondary); }
.row .due b { display: block; font-size: 1.05rem; color: var(--blue); margin-top: 2px; }
.row .arrow { font-size: 1.6rem; font-weight: 800; text-align: center; }

/* ---------- Module page ---------- */
.mod-head { border-bottom: 6px solid var(--maize); padding-bottom: 24px; }
.mod-head .kicker { color: var(--blue-secondary); margin-bottom: 14px; }
.mod-head .epi {
  font-size: 1.25rem; line-height: 1.45; font-style: italic;
  color: var(--blue-secondary); margin-top: 14px; max-width: 48ch; text-wrap: pretty;
}
.mod-desc { margin-top: 28px; max-width: 66ch; }
/* At-a-glance card: a different material from the white session cards —
   UMMA Tan body, Arboretum Blue title (both brand-approved pairings) */
.mod-aside { margin-top: 28px; }
.aside-card { background: var(--umma-tan); max-width: 480px; }
.aside-title {
  background: var(--arboretum); color: var(--white);
  font-family: var(--mono); font-weight: 700; font-size: .74rem;
  letter-spacing: .18em; text-transform: uppercase;
  padding: 8px 18px 7px;
}
.mod-facts { margin: 0; padding: 6px 18px 14px; }
.mod-facts .fact {
  display: grid; grid-template-columns: 92px 1fr; gap: 14px;
  padding: 10px 0 11px; border-bottom: 1px solid rgba(0, 39, 76, .3);
  align-items: baseline;
}
.mod-facts .fact:last-child { border-bottom: 0; }
.mod-facts dt {
  font-family: var(--mono); font-weight: 700; font-size: .72rem;
  letter-spacing: .12em; text-transform: uppercase;
  color: var(--blue);
}
.mod-facts dd { font-size: .92rem; line-height: 1.5; color: var(--blue); }
.mod-facts dd b { font-weight: 700; }
.aside-card a, .aside-card a:visited { color: var(--blue); }

@media (min-width: 980px) {
  .mod-layout {
    display: grid; grid-template-columns: minmax(0, 1fr) 340px;
    grid-template-areas: "desc aside" "sessions aside";
    gap: 0 40px; align-items: start;
  }
  .mod-desc-block { grid-area: desc; }
  .mod-sessions-block { grid-area: sessions; }
  .mod-aside { position: sticky; top: 16px; }
  .mod-layout .mod-aside { grid-area: aside; } /* named area exists only in mod-layout */

  .how-layout {
    display: grid; grid-template-columns: minmax(0, 1fr) 380px;
    gap: 0 40px; align-items: start;
  }
}

/* ---------- Session cards ---------- */
.sessions { margin-top: 44px; display: grid; gap: 20px; }
.session {
  background: var(--white); border: 2px solid var(--blue); padding: 24px 26px 26px;
  display: block; text-decoration: none; color: inherit;
}
.session .wk { color: var(--blue-secondary); }
.session .stype {
  margin-top: 6px;
  font-size: 1.02rem; font-weight: 700; color: var(--blue);
  border-bottom: 3px solid var(--maize);
  display: inline-block; padding-bottom: 1px;
}
.session h3, .session h2 {
  font-size: 1.35rem; font-weight: 750; line-height: 1.3;
  letter-spacing: -0.005em; margin: 12px 0 14px; max-width: 40ch; text-wrap: balance;
}
.session ul { list-style: none; }
.session li {
  padding: 7px 0; font-size: .96rem; line-height: 1.5;
  color: var(--blue-secondary); display: flex; gap: 12px; align-items: baseline; max-width: 68ch;
}
.session li b { color: var(--blue); }
.session .note { margin-top: 12px; font-size: .9rem; line-height: 1.5; font-style: italic; color: var(--blue-secondary); max-width: 60ch; }
.kind {
  flex: none; font-family: var(--mono); font-size: .68rem; font-weight: 800;
  letter-spacing: .1em; padding: 3px 8px 2px; border-radius: var(--radius);
  text-transform: uppercase; line-height: 1.3;
}
.kind-activity { background: var(--blue-15); color: var(--blue); }
.kind-listen, .kind-watch { background: var(--maize); color: var(--blue); }
.kind-reading { background: var(--blue); color: var(--white); }
.kind-critique { background: var(--maize); color: var(--blue); }
.kind-due { background: var(--blue-deep); color: var(--maize); }

/* ---------- Audio player + karaoke transcript ---------- */
.video-frame {
  margin-top: 36px; max-width: 640px;
  border: 2px solid var(--blue); background: #000; line-height: 0;
}
.video-frame video { width: 100%; height: auto; cursor: pointer; }
.video-frame + .player { margin-top: 0; border-top: 0; }

/* Video pages: player and transcript side by side on wide screens */
@media (min-width: 980px) {
  .av-layout {
    margin-top: 36px;
    display: grid; grid-template-columns: minmax(0, 640px) minmax(320px, 460px);
    gap: 0 24px; align-items: stretch;
  }
  .av-layout .video-frame, .av-layout .player { margin-top: 0; }
  .av-layout { align-items: start; }
  .av-side { display: flex; flex-direction: column; min-height: 0; }
  .av-side .follow-row { margin: 0 0 10px; }
  .av-side .transcript { margin-top: 0; min-height: 200px; }
  .av-layout + .source-row { max-width: calc(640px + 24px + 460px); }
}
.pdf-frame {
  margin-top: 36px; max-width: 820px; height: 78vh; overflow-y: auto;
  border: 2px solid var(--blue); background: var(--blue-15);
}
.pdf-frame canvas { display: block; width: 100%; margin-bottom: 8px; background: var(--white); }
.pdf-page-pending { height: 90vh; margin-bottom: 8px; background: var(--white); }
.pdf-fallback { padding: 24px; }
.player {
  margin-top: 36px; background: var(--blue); color: var(--paper-on-blue);
  padding: 20px 22px 18px; max-width: 640px;
}
.player-controls { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.player-controls button {
  font: inherit; font-weight: 700; cursor: pointer;
  background: transparent; color: var(--white);
  border: 2px solid var(--white); padding: 8px 14px; min-width: 52px;
}
.player-controls button:hover { border-color: var(--maize); color: var(--maize); }
.player-controls .pl-main {
  background: var(--maize); color: var(--blue); border-color: var(--maize);
  font-size: 1.1rem; min-width: 60px;
}
.player-controls .pl-main:hover { background: var(--white); border-color: var(--white); color: var(--blue); }
.pl-time { font-family: var(--mono); font-size: .9rem; margin-left: auto; font-variant-numeric: tabular-nums; }
#pl-seek { width: 100%; margin-top: 16px; accent-color: var(--maize); height: 6px; }
.player :focus-visible { outline: var(--focus-on-blue); outline-offset: 2px; }

.follow-row { display: flex; gap: 10px; align-items: baseline; margin: 18px 0 0; max-width: 640px; }
.follow-row input { width: 18px; height: 18px; flex: none; accent-color: var(--blue); }
.follow-row label { font-size: .92rem; color: var(--blue-secondary); }

.transcript {
  margin-top: 20px; max-width: 640px; position: relative;
  background: var(--white); border: 2px solid var(--blue);
  padding: 10px 0; max-height: 52vh; overflow-y: auto;
}
.cue {
  display: grid; grid-template-columns: 52px 1fr; gap: 14px; width: 100%;
  font: inherit; font-size: .98rem; line-height: 1.55; text-align: left;
  background: transparent; color: var(--blue-secondary);
  border: 0; border-left: 6px solid transparent;
  padding: 8px 18px 8px 14px; cursor: pointer;
}
.cue:hover { background: var(--blue-15); color: var(--blue); }
.cue .cue-t { font-family: var(--mono); font-size: .74rem; font-weight: 700; color: var(--blue-secondary); padding-top: 4px; font-variant-numeric: tabular-nums; }
.cue.active { border-left-color: var(--maize); background: #FFF6D6; color: var(--blue); font-weight: 600; }

.source-row {
  max-width: 640px; margin-top: 20px;
  display: flex; gap: 12px; justify-content: center; flex-wrap: wrap;
}
.source-row.wide { max-width: 820px; }
.source-row a {
  display: inline-block; background: var(--white); color: var(--blue);
  border: 2px solid var(--blue); padding: 10px 18px 11px;
  font-size: .92rem; font-weight: 700; text-decoration: none; line-height: 1.3;
}
.source-row a:hover { background: var(--blue); color: var(--white); }

/* ---------- Technique tool links ---------- */
.tool-links { margin-top: 24px; list-style: none; display: grid; gap: 12px; max-width: 62ch; }
.tool-links li {
  background: var(--white); border: 2px solid var(--blue);
  padding: 14px 18px 16px; line-height: 1.5;
}
.tool-links a { color: var(--blue); font-size: 1.02rem; text-underline-offset: 3px; }
.tool-links span { display: block; margin-top: 4px; font-size: .92rem; color: var(--blue-secondary); }

/* ---------- People ---------- */
.people { margin-top: 44px; display: grid; gap: 20px; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.person { background: var(--white); border: 2px solid var(--blue); padding: 26px 28px 28px; }
.person .headshot { width: 100%; max-width: 280px; height: auto; border: 2px solid var(--blue); margin-bottom: 18px; }
.person h2 { font-size: 1.5rem; font-weight: 800; letter-spacing: -0.01em; line-height: 1.2; }
.person .role {
  display: inline-block; background: var(--maize); color: var(--blue);
  font-size: .68rem; padding: 3px 10px 2px; margin: 10px 0 14px;
}
.person p { font-size: .96rem; line-height: 1.6; color: var(--blue-secondary); max-width: 58ch; }
.person p b { color: var(--blue); }
.person a { color: var(--blue); font-weight: 700; text-underline-offset: 2px; }
.person dl { margin-top: 18px; font-size: .92rem; line-height: 1.5; }
.person dt {
  font-family: var(--mono); font-weight: 700; font-size: .68rem;
  letter-spacing: .14em; text-transform: uppercase;
  color: var(--blue-secondary); margin-top: 10px;
}

/* ---------- Calendar ---------- */
.cal { margin-top: 44px; border: 2px solid var(--blue); background: var(--white); width: 100%; border-collapse: collapse; }
.cal caption { text-align: left; padding: 0 0 12px; font-weight: 700; color: var(--blue-secondary); }
.cal th, .cal td {
  text-align: left; padding: 13px 16px 14px;
  border-top: 2px solid var(--blue-15); vertical-align: top;
  font-size: .94rem; line-height: 1.5;
}
.cal thead th { background: var(--blue); color: var(--white); border-top: 0; padding-top: 11px; padding-bottom: 10px; }
.cal .wk-cell { white-space: nowrap; width: 1%; color: var(--blue-secondary); }
.cal .wk-cell b { color: var(--blue); }
.cal td[data-label="Session"] { width: 16%; }
.cal td[data-label="Question"] { width: 32%; font-weight: 600; }
.cal .reading-cell { width: 24%; font-size: .88rem; }
.cal .reading-cell a {
  font-weight: 600;
  display: inline-block; padding: 4px 0; /* WCAG 2.2 target-size: keep stacked links ≥24px tall */
}
.cal .due-cell { width: 17%; }
.cal .mod-band td {
  background: var(--blue-15); font-weight: 800; letter-spacing: .02em;
  line-height: 1.4; padding: 14px 16px;
}
.band-motto {
  display: block; font-weight: 400; font-style: italic;
  font-size: .98rem; line-height: 1.45; color: var(--blue);
  margin-top: 3px;
  border-bottom: 1px solid var(--blue-secondary);
  padding-bottom: 8px;
}
.trip-where { font-size: .86rem; color: var(--blue-secondary); font-style: italic; }
.band-suggested {
  display: block; font-weight: 400; font-size: .86rem;
  color: var(--blue-secondary); margin-top: 6px;
}
.cal .due-cell:not(.is-empty) { font-weight: 700; }
.cal a { color: var(--blue); text-underline-offset: 2px; }

/* ---------- Grading table ---------- */
.grades { margin-top: 24px; width: 100%; max-width: 560px; border-collapse: collapse; }
.grades th, .grades td {
  text-align: left; padding: 11px 12px 12px;
  border-bottom: 2px solid var(--blue-15); font-size: .95rem; line-height: 1.45;
}
.grades td:last-child { text-align: right; font-weight: 800; font-variant-numeric: tabular-nums; }

.linklike {
  font: inherit; background: none; border: 0; cursor: pointer;
  color: var(--blue); font-weight: 700;
  text-decoration: underline; text-underline-offset: 3px; padding: 0;
}
#bib-h:focus { outline: none; }

/* ---------- Stacked item lists (deliverables, bibliography, etc.) ---------- */
.stack-list { list-style: none; max-width: 66ch; margin-top: 8px; }
.stack-item {
  padding: 16px 0 18px; border-bottom: 1px solid var(--blue-15);
  display: flex; justify-content: space-between; gap: 24px; align-items: center;
}
.stack-main { min-width: 0; }
.stack-item .wk { color: var(--blue-secondary); }
.stack-weight {
  flex: none; font-family: var(--mono); font-weight: 700;
  font-size: 1.35rem; color: var(--blue); font-variant-numeric: tabular-nums;
}
.stack-name {
  margin-top: 5px; font-size: 1.15rem; font-weight: 750;
  letter-spacing: -0.005em; line-height: 1.3;
}
.stack-name a { color: var(--blue); text-underline-offset: 3px; }
.stack-detail { margin-top: 4px; font-size: .95rem; line-height: 1.5; color: var(--blue-secondary); max-width: 58ch; }

/* ---------- Bibliography ---------- */
.bib-sub {
  font-family: var(--mono); font-weight: 700; font-size: .8rem;
  letter-spacing: .14em; text-transform: uppercase;
  color: var(--blue-secondary); margin: 28px 0 10px;
}
.bib-list { list-style: none; max-width: 66ch; }
.bib-list li {
  display: flex; gap: 14px; align-items: baseline;
  padding: 8px 0; border-bottom: 1px solid var(--blue-15);
  font-size: .96rem; line-height: 1.5;
}
.bib-list .bib-wk {
  flex: none; width: 44px; font-family: var(--mono); font-weight: 700;
  font-size: .74rem; letter-spacing: .08em; color: var(--blue-secondary);
  font-variant-numeric: tabular-nums;
}
.bib-list a { color: var(--blue); font-weight: 600; text-underline-offset: 3px; display: inline-block; padding: 2px 0; }

/* ---------- Footer ---------- */
footer.app-footer {
  background: var(--blue); color: var(--paper-on-blue);
  border-top: 6px solid var(--maize); margin-top: 0;
}
.foot-in {
  max-width: var(--maxw); margin: 0 auto;
  padding: 36px 24px 28px;
  display: flex; justify-content: space-between; align-items: flex-start;
  gap: 32px; flex-wrap: wrap;
}
.foot-id { display: flex; gap: 16px; align-items: flex-start; }
.foot-id .blockm { height: 30px; width: auto; flex: none; margin-top: 2px; }
.foot-id p { font-size: .92rem; line-height: 1.5; color: var(--blue-15); }
.foot-id b { color: var(--white); font-weight: 700; }
.foot-links { display: flex; flex-direction: column; gap: 10px; align-items: flex-start; }
.foot-links a {
  color: var(--white); font-weight: 700; font-size: .92rem;
  text-decoration: none; border-bottom: 2px solid var(--maize);
  padding-bottom: 1px;
}
.foot-links a:hover { color: var(--maize); }
.foot-links button {
  font: inherit; font-size: .88rem; font-weight: 700;
  background: transparent; color: var(--maize);
  border: 2px solid var(--maize); padding: 6px 14px; cursor: pointer; margin-top: 4px;
}
.foot-links button:hover { background: var(--maize); color: var(--blue); }
.foot-meta {
  max-width: var(--maxw); margin: 0 auto;
  border-top: 1px solid var(--blue-secondary);
  padding: 14px 24px calc(16px + env(safe-area-inset-bottom, 0px));
  display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  font-family: var(--mono); font-size: .72rem; letter-spacing: .1em;
  color: var(--blue-15);
}

/* ---------- Status (offline / update) — bottom toast, clear of the
   iOS status bar / Dynamic Island and reachable by thumb ---------- */
.status-bar {
  position: fixed; z-index: 150;
  left: 16px; right: 16px;
  bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  max-width: 480px; margin: 0 auto;
  background: var(--blue-deep); color: var(--maize); text-align: center;
  border: 2px solid var(--maize);
  padding: 10px 16px; font-size: .88rem; font-weight: 700; letter-spacing: .02em;
  box-shadow: 0 4px 24px rgba(0, 26, 51, .45);
}
.status-bar[hidden] { display: none; }
.status-bar .status-action {
  font: inherit; font-weight: 700; color: var(--maize); background: transparent;
  border: 0; cursor: pointer; text-decoration: underline; text-underline-offset: 3px;
  padding: 2px 4px;
}
.reset-btn {
  font: inherit; font-weight: 800; background: var(--blue); color: var(--white);
  border: 0; padding: 12px 22px; cursor: pointer;
}
.reset-btn:hover { background: var(--blue-deep); }

/* ---------- Help form ---------- */
.help-form { margin-top: 28px; max-width: 560px; }
.help-form .field { margin-bottom: 18px; }
.help-form label { display: block; font-weight: 700; margin-bottom: 6px; font-size: .95rem; }
.help-form input[type="text"], .help-form input[type="email"], .help-form textarea {
  font: inherit; width: 100%; padding: 10px 12px;
  border: 2px solid var(--blue); background: var(--white); color: var(--blue);
}
.help-form textarea { resize: vertical; line-height: 1.5; }
.field-urgent { display: flex; gap: 12px; align-items: baseline; }
.field-urgent input { width: 20px; height: 20px; flex: none; accent-color: var(--blue); }
.field-urgent label { font-weight: 400; font-size: .92rem; line-height: 1.5; color: var(--blue-secondary); margin: 0; }
.field-urgent label b { color: var(--blue); }
.hp-field { position: absolute; left: -9999px; top: auto; }
.form-status { min-height: 1.5em; font-size: .95rem; font-weight: 700; margin-bottom: 12px; }
.form-status a { color: var(--blue); }

.form-success {
  margin-top: 28px; max-width: 560px;
  background: var(--white); border: 2px solid var(--blue);
  border-left: 14px solid var(--maize);
  padding: 26px 28px 28px;
}
.form-success:focus { outline: none; }
.form-success .check {
  width: 44px; height: 44px; border-radius: 50%;
  background: var(--blue); color: var(--maize);
  font-size: 1.5rem; font-weight: 800; line-height: 44px; text-align: center;
  margin-bottom: 14px;
}
.form-success h3 { font-size: 1.35rem; font-weight: 800; margin-bottom: 8px; }
.form-success p { font-size: .98rem; line-height: 1.6; color: var(--blue-secondary); max-width: 48ch; }
.form-success .send-another {
  font: inherit; font-weight: 700; margin-top: 14px; cursor: pointer;
  background: transparent; color: var(--blue);
  border: 2px solid var(--blue); padding: 8px 16px;
}
.form-success .send-another:hover { background: var(--blue); color: var(--white); }

/* ---------- Performance popover ---------- */
.perf-link {
  font: inherit; font-size: .88rem; font-weight: 700; cursor: pointer;
  background: transparent; color: var(--blue);
  border: 2px solid var(--maize); border-left-width: 10px;
  padding: 6px 12px; margin-top: 10px; text-align: left;
}
.perf-link:hover { background: var(--maize); }
#perf-dialog {
  margin: auto; /* the global reset kills the UA's dialog centering — restore it */
  border: 0; padding: 16px; max-width: min(560px, calc(100vw - 32px));
  max-height: calc(100vh - 48px); overflow: auto;
  background: var(--blue); color: var(--paper-on-blue);
  border-top: 10px solid var(--maize);
}
.perf-flyer { display: block; width: 100%; height: auto; }
.perf-body-slim { padding: 16px 2px 2px; }
.perf-body-slim form { margin: 0; }
.perf-actions { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.perf-tickets { color: var(--maize); font-weight: 700; font-size: .95rem; text-underline-offset: 3px; }
.perf-tickets:hover { color: var(--white); }
#perf-dialog::backdrop { background: rgba(0, 26, 51, .7); }
.perf-body { padding: 32px 34px 30px; }
.perf-body h2 { font-size: 2rem; font-weight: 800; letter-spacing: -0.01em; line-height: 1.15; color: var(--white); }
.perf-tagline { margin-top: 10px; font-weight: 700; color: var(--maize); }
.perf-meta { margin-top: 8px; font-size: .92rem; line-height: 1.55; }
.perf-times { list-style: none; margin: 20px 0; border-top: 1px solid var(--blue-secondary); border-bottom: 1px solid var(--blue-secondary); padding: 12px 0; }
.perf-times li { font-size: 1.12rem; font-weight: 700; color: var(--white); padding: 4px 0; }
.perf-venue { font-size: .95rem; line-height: 1.6; }
.perf-venue b { color: var(--maize); }
.perf-desc { margin-top: 14px; font-size: .92rem; line-height: 1.6; }
.perf-body form { margin-top: 20px; }
.perf-body .reset-btn { background: var(--maize); color: var(--blue); }
.perf-body .reset-btn:hover { background: var(--white); }

/* ---------- Debug panel (/?debug) ---------- */
#debug-panel {
  position: fixed; right: 12px; bottom: 12px; z-index: 200;
  width: min(420px, calc(100vw - 24px)); max-height: 70vh; overflow: auto;
  background: var(--blue-deep); color: var(--paper-on-blue);
  border: 2px solid var(--maize); padding: 16px 18px;
  font-family: var(--mono); font-size: .78rem; line-height: 1.5;
}
#debug-panel h2 { font-size: .85rem; color: var(--maize); letter-spacing: .1em; text-transform: uppercase; margin-bottom: 10px; }
#debug-panel dl div { display: grid; grid-template-columns: 130px 1fr; gap: 8px; padding: 2px 0; }
#debug-panel dt { color: var(--m3); }
#debug-panel dd { word-break: break-all; }
.debug-actions { margin-top: 14px; display: flex; gap: 8px; flex-wrap: wrap; }
.debug-actions button {
  font: inherit; font-size: .74rem; font-weight: 700; cursor: pointer;
  background: transparent; color: var(--maize); border: 1px solid var(--maize);
  padding: 5px 10px;
}
.debug-actions button:hover { background: var(--maize); color: var(--blue); }
.debug-actions button.danger { color: #FF9C9C; border-color: #FF9C9C; }
.debug-actions button.danger:hover { background: #FF9C9C; color: var(--blue-deep); }

/* ---------- Responsive ---------- */
@media (max-width: 760px) {
  main { padding-top: 40px; }
  main h1 { line-height: 1.12; }
  .row { grid-template-columns: 1fr 40px; }
  .row .wks, .row .due { display: none; }
  .row h2, .row h3 { font-size: 1.3rem; line-height: 1.2; }
  .row .epi { margin-top: 6px; }
  .ticker { flex-direction: column; }
  .ticker .flag { padding: 10px 20px 9px; }
  .session { padding: 20px 20px 22px; }
  .person { padding: 22px 22px 24px; }

  /* Compact header: one identity row (icons inline), course line small
     beneath, nav as a single scrollable row */
  .head-in { padding: 14px 16px 0; }
  .sign { gap: 12px; }
  .sign .blockm { height: 26px; }
  .sign .block { font-size: 1.15rem; padding: 4px 10px; }
  .sign .line { order: 4; flex-basis: 100%; font-size: .9rem; color: var(--blue-15); margin-top: 2px; }
  .head-icons button { padding: 6px; }
  .head-icons svg { width: 20px; height: 20px; }
  nav.app-nav {
    margin-top: 10px; flex-wrap: nowrap; overflow-x: auto;
    -webkit-overflow-scrolling: touch; scrollbar-width: none;
  }
  nav.app-nav::-webkit-scrollbar { display: none; }
  nav.app-nav a { white-space: nowrap; padding: 12px 12px; font-size: .88rem; }
}

/* Calendar: linearize into stacked cards on narrow screens.
   role attributes in the markup preserve table semantics for screen readers. */
@media (max-width: 640px) {
  .cal, .cal tbody, .cal tr, .cal td { display: block; width: 100%; }
  .cal thead { position: absolute; width: 1px; height: 1px; margin: -1px;
               overflow: hidden; clip: rect(0 0 0 0); }
  .cal tr { border-top: 2px solid var(--blue-15); padding: 14px 16px 16px; }
  .cal tr.mod-band { padding: 0; }
  .cal .mod-band td { padding: 14px 16px; }
  .cal td { border: 0; padding: 3px 0; font-size: .95rem; line-height: 1.45; }
  .cal .wk-cell { white-space: normal; width: auto; margin-bottom: 2px; }
  .cal td[data-label] { width: auto; }
  .cal td[data-label]::before {
    content: attr(data-label) ": ";
    font-family: var(--mono); font-weight: 700; font-size: .68rem;
    letter-spacing: .14em; text-transform: uppercase; color: var(--blue-secondary);
  }
  .cal td[data-label="Question"] { font-weight: 700; line-height: 1.35; padding-top: 6px; }
  .cal td[data-label="Question"]::before { content: ""; }
  .cal .due-cell.is-empty { display: none; }
  .cal .due-cell { color: var(--blue); }
}
