/* ============================================================================
   HPS 459/559 — Management of Global Public Health Emergencies
   Design system. Mobile-first; breakpoints at 640 / 900 / 1100.
   Colours are the official University of Arizona palette.
   ========================================================================= */

:root {
  /* --- University of Arizona palette ------------------------------------ */
  --az-blue:        #0c234b;   /* Arizona Blue   (primary) */
  --az-red:         #ab0520;   /* Arizona Red    (primary) */
  --tinta:          #03132e;   /* Tinta */
  --azurite:        #1e5288;   /* Azurite */
  --arroyo:         #106ab1;   /* Arroyo Blue */
  --rain:           #81ceeb;   /* Rain */
  --sonoran:        #850000;   /* Sonoran Red */
  --bougainvillea:  #c62840;   /* Bougainvillea */
  --saguaro:        #7f8b5a;   /* Saguaro */
  --shade:          #3f7a7a;   /* Shade */
  --brick:          #85372b;   /* Brick */
  --cloud:          #e5eff7;   /* Cloud */
  --caliche:        #f2efea;   /* Caliche */
  --white:          #ffffff;

  /* --- semantic ---------------------------------------------------------- */
  --bg:           #f8f6f2;
  --surface:      var(--white);
  --surface-sunk: #fbf9f6;
  --ink:          var(--tinta);
  --ink-2:        #2b3747;
  --muted:        #6a7280;
  --line:         #e6e0d6;
  --line-soft:    #efebe3;
  --line-strong:  #d7cfc1;

  --tint-blue:  var(--cloud);
  --tint-red:   #fbeaed;
  --tint-green: #edf1e5;
  --tint-teal:  #e6f0f0;
  --tint-clay:  #f6ebe7;

  /* --- shape and depth --------------------------------------------------- */
  --r-xs: 4px;  --r-s: 7px;  --r-m: 11px;  --r-l: 16px;  --r-xl: 22px;
  --r-pill: 999px;
  --sh-1: 0 1px 2px rgba(3,19,46,.05);
  --sh-2: 0 1px 2px rgba(3,19,46,.05), 0 6px 16px -6px rgba(3,19,46,.10);
  --sh-3: 0 2px 4px rgba(3,19,46,.06), 0 14px 32px -12px rgba(3,19,46,.18);
  --ring: 0 0 0 3px rgba(30,82,136,.35);

  --font: 'Inter Tight', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --mono: 'IBM Plex Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  --wrap: 1180px;
  --ease: cubic-bezier(.2, .7, .3, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important;
                           transition-duration: .001ms !important; }
}
body {
  margin: 0; background: var(--bg); color: var(--ink-2);
  font-family: var(--font); font-size: 16px; line-height: 1.55;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
img, svg, video { max-width: 100%; height: auto; display: block; }
a { color: var(--azurite); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { color: var(--az-red); }
h1, h2, h3, h4 { color: var(--ink); line-height: 1.16; margin: 0 0 .5em; font-weight: 600; letter-spacing: -.014em; }
h1 { font-size: clamp(1.8rem, 5.2vw, 2.95rem); }
h2 { font-size: clamp(1.3rem, 3.4vw, 1.85rem); }
h3 { font-size: 1.1rem; }
p  { margin: 0 0 1em; }
ul, ol { margin: 0 0 1em; }
code, .mono { font-family: var(--mono); font-size: .85em; }
hr { border: 0; border-top: 1px solid var(--line); margin: 2rem 0; }
::selection { background: var(--rain); color: var(--tinta); }

:where(a, button, input, select, textarea, summary, [tabindex]):focus-visible {
  outline: 2px solid var(--azurite); outline-offset: 2px; border-radius: var(--r-xs);
}

/* ------------------------------------------------------------------ layout */
.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 16px; }
.section { padding: 2.25rem 0; }
.section-tight { padding: 1.25rem 0; }
@media (min-width: 900px) { .wrap { padding: 0 32px; } .section { padding: 3.5rem 0; } }

.section-head {
  display: flex; flex-wrap: wrap; gap: .5rem 1rem;
  align-items: baseline; justify-content: space-between; margin-bottom: 1.1rem;
}
.section-head h2 { margin: 0; }

.muted { color: var(--muted); }
.small { font-size: .875rem; }
.xsmall { font-size: .8rem; }
.lead { font-size: 1.05rem; color: var(--ink-2); max-width: 64ch; }
@media (min-width: 640px) { .lead { font-size: 1.15rem; } }
.measure { max-width: 68ch; }
.center { text-align: center; }
.nowrap { white-space: nowrap; }
.stack > * + * { margin-top: 1rem; }
.stack-sm > * + * { margin-top: .5rem; }
.num { font-variant-numeric: tabular-nums; }

.grid { display: grid; gap: 1rem; }
.grid-2, .grid-3 { grid-template-columns: 1fr; }
@media (min-width: 640px) { .grid-2, .grid-3 { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1000px) { .grid-3 { grid-template-columns: repeat(3, 1fr); } }

/* ------------------------------------------------------------------ header */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(1.5) blur(12px);
  -webkit-backdrop-filter: saturate(1.5) blur(12px);
  border-bottom: 1px solid var(--line);
}
.header-row { display: flex; align-items: center; gap: .75rem; min-height: 60px; }
.brand {
  display: flex; align-items: center; gap: .65rem; text-decoration: none;
  color: var(--ink); flex: 1 1 auto; min-width: 0; padding: .25rem 0;
}
.brand:hover { color: var(--ink); }
.brand img { width: 27px; height: auto; flex: none; }
.brand-text { display: flex; flex-direction: column; min-width: 0; }
.brand-code {
  font-size: .7rem; letter-spacing: .1em; text-transform: uppercase;
  color: var(--az-red); font-weight: 600; line-height: 1.3;
}
.brand-name {
  font-size: .92rem; font-weight: 600; line-height: 1.2;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
@media (min-width: 900px) { .brand-name { font-size: 1rem; } }

.nav-toggle {
  flex: none; display: inline-flex; align-items: center; gap: .45rem;
  background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--r-pill);
  padding: .5rem .85rem; font: inherit; font-size: .85rem; font-weight: 500;
  cursor: pointer; color: var(--ink); min-height: 40px;
  transition: border-color .15s var(--ease), background .15s var(--ease);
}
.nav-toggle:hover { border-color: var(--az-blue); background: var(--cloud); }
.nav-toggle::before {
  content: ""; width: 14px; height: 10px; flex: none;
  background: currentColor;
  -webkit-mask: linear-gradient(currentColor 0 0) top/100% 2px no-repeat,
                linear-gradient(currentColor 0 0) center/100% 2px no-repeat,
                linear-gradient(currentColor 0 0) bottom/100% 2px no-repeat;
          mask: linear-gradient(currentColor 0 0) top/100% 2px no-repeat,
                linear-gradient(currentColor 0 0) center/100% 2px no-repeat,
                linear-gradient(currentColor 0 0) bottom/100% 2px no-repeat;
}
.nav-toggle[aria-expanded="true"]::before {
  -webkit-mask: linear-gradient(currentColor 0 0) center/100% 2px no-repeat;
          mask: linear-gradient(currentColor 0 0) center/100% 2px no-repeat;
}
@media (min-width: 900px) { .nav-toggle { display: none; } }

.nav { display: none; width: 100%; padding: .4rem 0 1rem; border-top: 1px solid var(--line-soft); }
.nav.is-open { display: block; animation: navIn .18s var(--ease); }
@keyframes navIn { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
.nav ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.nav a {
  display: block; padding: .62rem .75rem; border-radius: var(--r-s);
  color: var(--ink-2); text-decoration: none; font-size: .95rem; font-weight: 500;
  transition: background .13s var(--ease), color .13s var(--ease);
}
.nav a:hover { background: var(--caliche); color: var(--ink); }
.nav a.is-active { color: var(--az-blue); background: var(--cloud); }
.nav-sep { height: 1px; background: var(--line-soft); margin: .45rem 0; }
.nav-form { padding: .35rem .75rem 0; }
@media (min-width: 900px) {
  .nav { display: block !important; width: auto; padding: 0; border: 0; }
  .nav ul { flex-direction: row; align-items: center; gap: 1px; }
  .nav a { padding: .45rem .72rem; font-size: .9rem; border-radius: var(--r-pill); position: relative; }
  .nav a.is-active { background: transparent; }
  .nav a.is-active::after {
    content: ""; position: absolute; left: .72rem; right: .72rem; bottom: .05rem;
    height: 2px; background: var(--az-red); border-radius: 2px;
  }
  .nav-sep { width: 1px; height: 22px; margin: 0 .45rem; }
  .nav-form { padding: 0 0 0 .4rem; }
}

/* -------------------------------------------------------------------- hero */
.hero {
  position: relative; overflow: hidden; color: #fff;
  background:
    radial-gradient(90rem 40rem at 78% 18%, rgba(30,82,136,.55), transparent 60%),
    linear-gradient(165deg, var(--az-blue) 0%, #0a1d40 55%, var(--tinta) 100%);
  display: flex; flex-direction: column-reverse;
}
.hero-inner { position: relative; z-index: 2; padding: 2.5rem 0 1.5rem; }
.hero h1 { color: #fff; margin-bottom: .55rem; text-wrap: balance; }
.hero .lead { color: #c3d0e4; }
.hero-kicker {
  display: inline-flex; align-items: center; gap: .5rem;
  font-size: .72rem; letter-spacing: .1em; text-transform: uppercase; font-weight: 500;
  background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.22);
  padding: .34rem .78rem; border-radius: var(--r-pill); margin-bottom: 1.1rem;
  backdrop-filter: blur(4px);
}
.hero-kicker::before {
  content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--rain);
  box-shadow: 0 0 0 0 rgba(129,206,235,.7); animation: beacon 2.4s infinite;
}
@keyframes beacon {
  0%   { box-shadow: 0 0 0 0 rgba(129,206,235,.65); }
  70%  { box-shadow: 0 0 0 7px rgba(129,206,235,0); }
  100% { box-shadow: 0 0 0 0 rgba(129,206,235,0); }
}
.hero-globe {
  position: relative; z-index: 1; height: 290px; width: 100%;
  -webkit-mask-image: radial-gradient(ellipse at 50% 55%, #000 48%, transparent 78%);
          mask-image: radial-gradient(ellipse at 50% 55%, #000 48%, transparent 78%);
}
.hero-actions { display: flex; flex-wrap: wrap; gap: .6rem; margin-top: 1.5rem; }
.hero-note { margin-top: 1.6rem; font-size: .78rem; color: #8fa0bd; max-width: 38em; }
@media (min-width: 900px) {
  .hero { display: block; }
  .hero-inner { padding: 4.75rem 0 4.25rem; max-width: 640px; }
  .hero-globe {
    position: absolute; inset: 0; left: 38%; height: auto; width: auto;
    -webkit-mask-image: linear-gradient(to right, transparent, #000 32%);
            mask-image: linear-gradient(to right, transparent, #000 32%);
  }
}

/* ----------------------------------------------------------------- buttons */
.btn {
  --btn-bg: var(--az-blue); --btn-fg: #fff; --btn-bd: var(--az-blue);
  display: inline-flex; align-items: center; justify-content: center; gap: .45rem;
  padding: .7rem 1.15rem; min-height: 44px;
  border: 1px solid var(--btn-bd); border-radius: var(--r-pill);
  background: var(--btn-bg); color: var(--btn-fg);
  font: inherit; font-size: .92rem; font-weight: 500; line-height: 1.2;
  text-decoration: none; cursor: pointer; white-space: nowrap;
  transition: background .15s var(--ease), border-color .15s var(--ease),
              color .15s var(--ease), transform .08s var(--ease), box-shadow .15s var(--ease);
}
.btn:hover { --btn-bg: var(--azurite); --btn-bd: var(--azurite); color: #fff; box-shadow: var(--sh-2); }
.btn:active { transform: translateY(1px); box-shadow: none; }
.btn-red       { --btn-bg: var(--az-red); --btn-bd: var(--az-red); }
.btn-red:hover { --btn-bg: var(--bougainvillea); --btn-bd: var(--bougainvillea); }
.btn-ghost {
  --btn-bg: transparent; --btn-fg: var(--ink); --btn-bd: var(--line-strong);
}
.btn-ghost:hover { --btn-bg: var(--cloud); --btn-bd: var(--az-blue); --btn-fg: var(--az-blue); color: var(--az-blue); }
.btn-quiet {
  --btn-bg: transparent; --btn-fg: var(--ink-2); --btn-bd: transparent;
  padding-left: .6rem; padding-right: .6rem;
}
.btn-quiet:hover { --btn-bg: var(--caliche); --btn-fg: var(--ink); color: var(--ink); box-shadow: none; }
.hero .btn-ghost { --btn-fg: #fff; --btn-bd: rgba(255,255,255,.38); }
.hero .btn-ghost:hover { --btn-bg: rgba(255,255,255,.14); --btn-bd: #fff; --btn-fg: #fff; color: #fff; }
.btn-small { padding: .42rem .82rem; font-size: .83rem; min-height: 36px; }
.btn-lg { padding: .85rem 1.5rem; font-size: 1rem; min-height: 50px; }
.btn-block { width: 100%; }
.btn[disabled], .btn.is-disabled { opacity: .42; pointer-events: none; box-shadow: none; }
.btn-arrow::after {
  content: ""; width: 15px; height: 15px; flex: none; background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M5 12h13M12 5l7 7-7 7' fill='none' stroke='%23000' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'/%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'%3E%3Cpath d='M5 12h13M12 5l7 7-7 7' fill='none' stroke='%23000' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center/contain no-repeat;
  transition: transform .18s var(--ease);
}
.btn-arrow:hover::after { transform: translateX(3px); }
.btn-row { display: flex; flex-wrap: wrap; gap: .55rem; align-items: center; }

/* ------------------------------------------------------------------- cards */
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-l);
  padding: 1.15rem; box-shadow: var(--sh-1);
}
@media (min-width: 640px) { .card { padding: 1.45rem; } }
.card-link {
  text-decoration: none; color: inherit; display: block;
  transition: border-color .16s var(--ease), box-shadow .16s var(--ease), transform .16s var(--ease);
}
.card-link:hover {
  border-color: var(--line-strong); color: inherit;
  box-shadow: var(--sh-3); transform: translateY(-2px);
}
.card-accent { position: relative; overflow: hidden; }
.card-accent::before {
  content: ""; position: absolute; inset: 0 0 auto 0; height: 3px;
  background: var(--accent, var(--az-blue));
}
.card-head { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; justify-content: space-between; }
.card-title { font-size: 1.1rem; margin: .7rem 0 .35rem; }
.card-sunk { background: var(--surface-sunk); }

/* ------------------------------------------------------- labels and chips */
.label {
  display: inline-block; font-size: .7rem; letter-spacing: .07em; text-transform: uppercase;
  font-weight: 600; color: var(--azurite); background: var(--tint-blue);
  padding: .26rem .56rem; border-radius: var(--r-xs); line-height: 1.35;
}
.label-red    { color: var(--az-red);   background: var(--tint-red); }
.label-ok     { color: #4d5a32;         background: var(--tint-green); }
.label-teal   { color: #2c5c5c;         background: var(--tint-teal); }
.label-clay   { color: var(--brick);    background: var(--tint-clay); }
.label-muted  { color: var(--muted);    background: var(--line-soft); }

.pill {
  display: inline-flex; align-items: center; gap: .32rem;
  font-size: .78rem; padding: .24rem .62rem; line-height: 1.4;
  border: 1px solid var(--line); border-radius: var(--r-pill);
  color: var(--ink-2); background: var(--surface);
}
.pill-dot::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .75; }
.tagrow { display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; }

/* ---------------------------------------------------------------- notices */
.notice {
  --nc: var(--azurite); --nbg: var(--tint-blue);
  border: 1px solid var(--line); border-left: 3px solid var(--nc);
  background: var(--nbg); color: var(--ink-2);
  padding: .85rem 1rem; border-radius: var(--r-m); margin: 0 0 1.25rem; font-size: .93rem;
}
.notice strong { color: var(--ink); }
.notice :last-child { margin-bottom: 0; }
.notice-success { --nc: var(--saguaro); --nbg: var(--tint-green); }
.notice-error   { --nc: var(--az-red);  --nbg: var(--tint-red); }
.notice-warn    { --nc: var(--brick);   --nbg: var(--tint-clay); }
.flashes { padding-top: 1rem; }

.preview-bar { background: var(--az-red); color: #fff; font-size: .86rem; }
.preview-bar .wrap {
  display: flex; flex-wrap: wrap; gap: .5rem; align-items: center;
  justify-content: space-between; padding-top: .5rem; padding-bottom: .5rem;
}
.preview-bar form { margin: 0; }
.preview-bar button {
  background: #fff; color: var(--az-red); border: 0; border-radius: var(--r-pill);
  padding: .32rem .85rem; font: inherit; font-size: .82rem; font-weight: 600; cursor: pointer;
  min-height: 32px;
}
.preview-bar button:hover { background: var(--caliche); }

/* ------------------------------------------------------------- week rows */
.week-list { display: grid; gap: .7rem; }
.week-row {
  display: grid; grid-template-columns: auto 1fr; gap: .2rem 1rem; align-items: start;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-l);
  padding: 1rem; text-decoration: none; color: inherit; box-shadow: var(--sh-1);
  transition: border-color .16s var(--ease), box-shadow .16s var(--ease), transform .16s var(--ease);
}
.week-row:hover {
  color: inherit; border-color: var(--line-strong);
  box-shadow: var(--sh-3); transform: translateY(-2px);
}
.week-num {
  grid-row: span 2; width: 46px; height: 46px; border-radius: 50%; flex: none;
  display: grid; place-items: center; font-weight: 600; font-size: 1.02rem;
  background: var(--cloud); color: var(--az-blue);
  border: 1px solid transparent; transition: background .16s var(--ease);
}
.week-row:hover .week-num { background: var(--az-blue); color: #fff; }
.week-row.is-locked { background: var(--surface-sunk); }
.week-row.is-locked .week-num { background: var(--line-soft); color: var(--muted); }
.week-row.is-locked:hover .week-num { background: var(--line-strong); color: var(--ink); }
.week-head { display: flex; flex-wrap: wrap; gap: .3rem .7rem; align-items: baseline; }
.week-title { font-weight: 600; font-size: 1.03rem; color: var(--ink); }
.week-meta { display: flex; flex-wrap: wrap; gap: .35rem; margin-top: .5rem; }

/* per-week accents, drawn from the secondary and accent palettes */
.wk-1 { --accent: var(--azurite); }
.wk-2 { --accent: var(--arroyo); }
.wk-3 { --accent: var(--shade); }
.wk-4 { --accent: var(--saguaro); }
.wk-5 { --accent: var(--brick); }
.wk-6 { --accent: var(--bougainvillea); }

/* ------------------------------------------------------------------ video */
.video-grid { display: grid; gap: 1rem; grid-template-columns: 1fr; }
@media (min-width: 700px)  { .video-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1050px) { .video-grid { grid-template-columns: repeat(3, 1fr); } }
.video-card { display: flex; flex-direction: column; overflow: hidden; padding: 0; }
.video-card:hover .video-thumb .play { transform: scale(1.08); }
.video-thumb {
  aspect-ratio: 16 / 9; position: relative; display: grid; place-items: center; color: #fff;
  background:
    radial-gradient(60% 80% at 20% 15%, rgba(255,255,255,.16), transparent 60%),
    linear-gradient(145deg, var(--accent, var(--azurite)) 0%, var(--az-blue) 62%, var(--tinta) 100%);
}
.video-thumb::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background-image: radial-gradient(rgba(255,255,255,.14) 1px, transparent 1px);
  background-size: 14px 14px; opacity: .5;
  -webkit-mask-image: linear-gradient(135deg, #000, transparent 70%);
          mask-image: linear-gradient(135deg, #000, transparent 70%);
}
/* A real frame from the lecture, with a scrim so the play button stays readable. */
.video-thumb.has-poster { background-size: cover; background-position: center 35%; }
.video-thumb.has-poster::after {
  background-image: linear-gradient(180deg, rgba(3,19,46,.42) 0%, rgba(3,19,46,.12) 45%, rgba(3,19,46,.55) 100%);
  background-size: auto; opacity: 1;
  -webkit-mask-image: none; mask-image: none;
}
.video-thumb.is-locked { background: linear-gradient(145deg, #6f7682, #474d58 65%, #343a44); }
.video-thumb .play {
  position: relative; z-index: 1;
  width: 56px; height: 56px; border-radius: 50%; background: rgba(255,255,255,.96);
  display: grid; place-items: center; box-shadow: 0 6px 18px rgba(3,19,46,.3);
  transition: transform .18s var(--ease);
}
.video-thumb .play svg { width: 20px; height: 20px; fill: var(--az-blue); margin-left: 3px; }
.video-thumb .week-tag {
  position: absolute; z-index: 1; top: .65rem; left: .65rem;
  font-size: .68rem; letter-spacing: .09em; text-transform: uppercase; font-weight: 600;
  background: rgba(3,19,46,.45); padding: .22rem .58rem; border-radius: var(--r-xs);
  backdrop-filter: blur(3px);
}
.video-thumb .lock-note { position: relative; z-index: 1; font-size: .85rem; opacity: .95; }
.video-body { padding: 1rem 1.1rem 1.1rem; display: flex; flex-direction: column; gap: .4rem; flex: 1; }
.video-body h3 { margin: 0; font-size: 1rem; }
.video-body h3 a { color: inherit; text-decoration: none; }
.video-body h3 a:hover { color: var(--az-red); }
.video-foot { margin-top: auto; padding-top: .65rem; }

.player-shell {
  background: #000; border-radius: var(--r-l); overflow: hidden;
  box-shadow: var(--sh-3); border: 1px solid var(--line);
}
.player-shell video { width: 100%; display: block; aspect-ratio: 16/9; background: #000; }
.player-missing {
  aspect-ratio: 16/9; display: grid; place-items: center; text-align: center; padding: 1.5rem;
  background: linear-gradient(145deg, #1b2434, #11182a); color: #c2cada;
}
.player-missing strong { color: #fff; }

/* ------------------------------------------------------------------ notes */
@media (min-width: 1000px) {
  .video-layout {
    display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(330px, 1fr);
    gap: 1.5rem; align-items: start;
  }
  .video-layout > aside { position: sticky; top: 76px; }
}
.notes-panel { display: grid; gap: 1rem; }
.note {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-m);
  padding: .8rem .95rem; transition: border-color .15s var(--ease);
}
.note:hover { border-color: var(--line-strong); }
.note-head {
  display: flex; flex-wrap: wrap; gap: .4rem; align-items: center;
  justify-content: space-between; margin-bottom: .35rem;
}
.note-body { white-space: pre-wrap; font-size: .93rem; color: var(--ink-2); }
.note form { margin: 0; }
.linkbtn {
  background: none; border: 0; color: var(--muted); font: inherit; font-size: .8rem;
  cursor: pointer; padding: .2rem; text-decoration: underline; text-underline-offset: 2px;
}
.linkbtn:hover { color: var(--az-red); }

.rec-row { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.rec-dot {
  width: 9px; height: 9px; border-radius: 50%; background: var(--line-strong);
  display: inline-block; flex: none; transition: background .2s var(--ease);
}
.is-recording .rec-dot { background: var(--az-red); animation: recPulse 1.1s infinite; }
@keyframes recPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(171,5,32,.55); }
  60%      { box-shadow: 0 0 0 7px rgba(171,5,32,0); }
}
.rec-status { font-size: .82rem; color: var(--muted); margin: 0; }
.saved-flag { font-size: .8rem; color: #4d5a32; }

/* ------------------------------------------------------------------ forms */
textarea, input[type=text], input[type=email], input[type=password], input[type=search], select {
  width: 100%; font: inherit; font-size: 1rem; color: var(--ink);
  background: var(--surface); border: 1px solid var(--line-strong);
  border-radius: var(--r-m); padding: .68rem .8rem; min-height: 44px;
  transition: border-color .14s var(--ease), box-shadow .14s var(--ease);
  -webkit-appearance: none; appearance: none;
}
textarea { min-height: 140px; resize: vertical; line-height: 1.55; }
textarea::placeholder, input::placeholder { color: #9aa1ad; }
textarea:focus, input:focus, select:focus {
  outline: none; border-color: var(--azurite); box-shadow: var(--ring);
}
select {
  padding-right: 2.2rem;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M6 9l6 6 6-6' fill='none' stroke='%236a7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right .7rem center; background-size: 18px;
}
label { display: block; font-size: .85rem; font-weight: 600; color: var(--ink); margin-bottom: .32rem; }
.field { margin-bottom: 1.05rem; }
.hint { font-size: .82rem; color: var(--muted); margin-top: .32rem; }
fieldset { border: 0; padding: 0; margin: 0 0 1rem; }
input[type=checkbox], input[type=radio] {
  width: 18px; height: 18px; min-height: 0; flex: none; accent-color: var(--az-blue); cursor: pointer;
}
.choice {
  display: inline-flex; align-items: center; gap: .45rem; margin: 0;
  font-weight: 400; font-size: .9rem; cursor: pointer;
  border: 1px solid var(--line); border-radius: var(--r-pill);
  padding: .38rem .75rem .38rem .6rem; background: var(--surface);
  transition: border-color .14s var(--ease), background .14s var(--ease);
}
.choice:hover { border-color: var(--line-strong); background: var(--surface-sunk); }
.choice:has(input:checked) { border-color: var(--az-blue); background: var(--cloud); color: var(--az-blue); font-weight: 500; }
.check-list { display: grid; gap: .55rem; }
.check-item {
  display: flex; gap: .6rem; align-items: flex-start; font-weight: 400;
  margin: 0; padding: .55rem .7rem; border-radius: var(--r-s);
  transition: background .14s var(--ease);
}
.check-item:hover { background: var(--surface-sunk); }
.check-item input { margin-top: .2rem; }

/* --------------------------------------------------------------- readings */
.paper { border-bottom: 1px solid var(--line-soft); padding: 1.15rem 0; }
.paper:first-child { padding-top: .2rem; }
.paper:last-child { border-bottom: 0; padding-bottom: .2rem; }
.paper h3 { margin: .25rem 0 .3rem; font-size: 1.04rem; line-height: 1.32; }
.paper-meta { font-size: .85rem; color: var(--muted); margin-bottom: .5rem; }
.paper-abstract { font-size: .93rem; color: var(--ink-2); margin-bottom: .75rem; max-width: 72ch; }
.paper-actions { display: flex; flex-wrap: wrap; gap: .45rem; align-items: center; }
.paper-n {
  font-family: var(--mono); font-size: .72rem; color: var(--muted);
  letter-spacing: .04em;
}

/* ------------------------------------------------------------------ guide */
.progress-bar {
  height: 9px; border-radius: var(--r-pill); background: var(--line-soft);
  overflow: hidden; box-shadow: inset 0 1px 2px rgba(3,19,46,.06);
}
.progress-bar span {
  display: block; height: 100%; border-radius: var(--r-pill);
  background: linear-gradient(90deg, var(--azurite), var(--az-blue));
  transition: width .4s var(--ease);
}
.progress-inline {
  display: inline-block; width: 64px; height: 7px; vertical-align: middle; margin-left: .45rem;
  border-radius: var(--r-pill); background: var(--line-soft); overflow: hidden;
}
.progress-inline span { display: block; height: 100%; background: var(--azurite); }

/* ------------------------------------------------------- loading component
   For work that runs server-side across a full page POST and takes long
   enough that a still page looks broken. The spinner and the elapsed count
   are honest; the step list only claims what has actually been reached. */
.loading-card {
  display: grid; grid-template-columns: auto 1fr; gap: 0 1rem;
  align-items: start; padding: 1.15rem 1.25rem;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-m); box-shadow: 0 1px 3px rgba(3,19,46,.05);
}
.loading-card[hidden] { display: none; }
.spinner {
  width: 26px; height: 26px; border-radius: 50%; margin-top: .15rem;
  border: 2.5px solid var(--line); border-top-color: var(--azurite);
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loading-card h3 {
  margin: 0; font-size: 1rem; font-weight: 600; color: var(--ink);
  display: flex; justify-content: space-between; align-items: baseline; gap: 1rem;
}
.loading-card h3 time {
  font-variant-numeric: tabular-nums; font-weight: 500; font-size: .85rem; color: var(--muted);
}
.loading-steps { list-style: none; margin: .6rem 0 0; padding: 0; display: grid; gap: .3rem; }
.loading-steps li {
  font-size: .85rem; color: var(--muted); padding-left: 1.35rem; position: relative;
  transition: color .25s var(--ease);
}
.loading-steps li::before {
  content: ""; position: absolute; left: .25rem; top: .45rem;
  width: 6px; height: 6px; border-radius: 50%; background: var(--line-strong);
  transition: background .25s var(--ease), box-shadow .25s var(--ease);
}
.loading-steps li.is-now { color: var(--ink-2); font-weight: 500; }
.loading-steps li.is-now::before {
  background: var(--azurite); box-shadow: 0 0 0 3px rgba(30,82,136,.16);
}
.loading-steps li.is-done { color: var(--ink-2); }
.loading-steps li.is-done::before {
  background: none; box-shadow: none; left: .1rem; top: .2rem;
  width: auto; height: auto; content: "\2713"; color: var(--saguaro); font-size: .8rem;
}
@media (prefers-reduced-motion: reduce) {
  .spinner { animation-duration: 2.4s; }
}
@media (max-width: 480px) {
  .loading-card { grid-template-columns: 1fr; gap: .6rem; }
}

/* A share that is worth a second look, not progress towards something good. */
.progress-bar.progress-flag span {
  background: linear-gradient(90deg, var(--brick), var(--sonoran));
}

.plan-row {
  display: grid; gap: .5rem; padding: 1.05rem;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-m);
  transition: border-color .15s var(--ease), box-shadow .15s var(--ease);
}
.plan-row:hover { border-color: var(--line-strong); box-shadow: var(--sh-2); }
.plan-row + .plan-row { margin-top: .6rem; }
.plan-head { display: flex; flex-wrap: wrap; gap: .5rem; align-items: baseline; justify-content: space-between; }
.plan-title { font-weight: 600; color: var(--ink); }
.plan-excerpt {
  margin: 0; font-size: .9rem; color: var(--ink-2);
  padding-left: .7rem; border-left: 2px solid var(--line);
}
.plan-foot { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; justify-content: space-between; }
.status-chip {
  font-size: .75rem; font-weight: 500; padding: .2rem .6rem; border-radius: var(--r-pill);
  border: 1px solid var(--line); color: var(--muted); background: var(--surface);
  display: inline-flex; align-items: center; gap: .35rem; white-space: nowrap;
}
.status-chip::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.status-done     { background: var(--tint-green); color: #4d5a32; border-color: #cdd6bb; }
.status-review   { background: var(--tint-clay);  color: var(--brick); border-color: #e4cdc4; }
.status-drafting { background: var(--tint-blue);  color: var(--azurite); border-color: #c8dcee; }

/* ----------------------------------------------------------------- tables */
.table-scroll {
  overflow-x: auto; -webkit-overflow-scrolling: touch;
  border: 1px solid var(--line); border-radius: var(--r-m); background: var(--surface);
  box-shadow: var(--sh-1);
}
table.data { width: 100%; border-collapse: collapse; font-size: .9rem; min-width: 560px; }
table.data th, table.data td {
  text-align: left; padding: .65rem .8rem; border-bottom: 1px solid var(--line-soft); vertical-align: top;
}
table.data thead th {
  position: sticky; top: 0; z-index: 1;
  font-size: .72rem; letter-spacing: .06em; text-transform: uppercase;
  color: var(--muted); font-weight: 600; white-space: nowrap;
  background: var(--surface-sunk); border-bottom: 1px solid var(--line);
}
table.data tbody tr { transition: background .12s var(--ease); }
table.data tbody tr:hover { background: var(--cloud); }
table.data tr:last-child td { border-bottom: 0; }
table.data td.num, table.data th.num { text-align: right; font-variant-numeric: tabular-nums; }

/* Tiles size themselves to however many there are, so a row of four does not
   get squeezed into a six-column grid. */
.stat-row {
  display: grid; gap: .7rem;
  grid-template-columns: repeat(auto-fit, minmax(142px, 1fr));
}
.stat {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-m);
  padding: .8rem .9rem .85rem 1rem; position: relative; overflow: hidden;
  box-shadow: var(--sh-1); display: flex; flex-direction: column; gap: .1rem;
  min-width: 0;
}
.stat::before {
  content: ""; position: absolute; inset: 0 auto 0 0; width: 3px;
  background: var(--accent, var(--azurite)); opacity: .85;
}
.stat b {
  display: block; font-size: clamp(1.15rem, 1.1rem + .6vw, 1.5rem); line-height: 1.15;
  font-weight: 600; color: var(--ink); font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere; hyphens: auto;
}
/* A word rather than a number: smaller, so it never clips. */
.stat-word b { font-size: 1.05rem; line-height: 1.25; letter-spacing: -.005em; }
.stat span {
  font-size: .765rem; line-height: 1.3; color: var(--muted);
  text-wrap: balance; overflow-wrap: anywhere;
}

/* ----------------------------------------------------------- empty states */
.empty {
  text-align: center; padding: 2.25rem 1.25rem; border-radius: var(--r-l);
  border: 1px dashed var(--line-strong); background: var(--surface-sunk); color: var(--muted);
}
.empty strong { display: block; color: var(--ink); margin-bottom: .3rem; font-size: 1rem; }

/* ----------------------------------------------------------------- footer */
.site-footer {
  border-top: 1px solid var(--line); margin-top: 3rem; padding: 2.25rem 0 2.75rem;
  font-size: .86rem; color: var(--muted); background: var(--caliche);
}
.footer-grid { display: grid; gap: 1.4rem; }
@media (min-width: 800px) { .footer-grid { grid-template-columns: 1.5fr 1fr 1fr; } }
.footer-logo { max-width: 230px; }
.site-footer a { color: var(--ink-2); }
.site-footer a:hover { color: var(--az-red); }
.site-footer strong { color: var(--ink); display: block; margin-bottom: .35rem; }

.skip { position: absolute; left: -9999px; }
.skip:focus {
  left: 1rem; top: .5rem; z-index: 100; background: #fff; color: var(--ink);
  padding: .55rem .85rem; border-radius: var(--r-s); box-shadow: var(--sh-3);
}

@media print {
  .site-header, .site-footer, .nav, .btn, .preview-bar, .hero-globe { display: none !important; }
  body { background: #fff; color: #000; }
  .card, .plan-row, .table-scroll { border: 0; box-shadow: none; padding: 0; }
  a[href]::after { content: " (" attr(href) ")"; font-size: .8em; color: #555; }
}

/* --------------------------------------------------------------- syllabus */
/* Grid children default to min-width:auto, so a wide table inside one can stretch
   the whole column. Pin them to zero and let .table-scroll do the scrolling. */
.syllabus-layout { display: grid; gap: 1.5rem; }
.syllabus-layout > *, .video-layout > *, .grid > * { min-width: 0; }
.table-scroll { max-width: 100%; }
@media (min-width: 1000px) {
  .syllabus-layout { grid-template-columns: 230px minmax(0, 1fr); gap: 2.5rem; align-items: start; }
  .syllabus-toc { position: sticky; top: 80px; }
}
.syllabus-toc nav { display: flex; flex-direction: column; gap: 1px; }
.syllabus-toc a {
  display: block; padding: .42rem .65rem; border-radius: var(--r-s);
  font-size: .87rem; color: var(--ink-2); text-decoration: none;
  border-left: 2px solid var(--line); transition: background .13s var(--ease), color .13s var(--ease), border-color .13s var(--ease);
}
.syllabus-toc a:hover { background: var(--cloud); color: var(--az-blue); border-left-color: var(--azurite); }
@media (max-width: 999px) {
  .syllabus-toc nav { flex-direction: row; flex-wrap: wrap; gap: .35rem; }
  .syllabus-toc a {
    border-left: 0; border: 1px solid var(--line); border-radius: var(--r-pill);
    background: var(--surface); font-size: .82rem; padding: .35rem .7rem;
  }
}
.syllabus-body .block { scroll-margin-top: 80px; padding-bottom: .5rem; }
.syllabus-body .block + .block { margin-top: 2.5rem; padding-top: 2rem; border-top: 1px solid var(--line); }
.syllabus-body h2 { font-size: clamp(1.25rem, 3vw, 1.6rem); }
.syllabus-body h3 { font-size: 1.02rem; margin-top: 1.5rem; color: var(--az-blue); }
.syllabus-body p, .syllabus-body li { max-width: 74ch; }
.syl-list { padding-left: 1.2rem; }
.syl-list li { margin-bottom: .45rem; }
.syl-list li::marker { color: var(--azurite); font-weight: 600; }

/* ------------------------------------------------------------ demo banner */
.demo-bar {
  background: var(--shade); color: #fff; font-size: .86rem;
}
.demo-bar .wrap {
  display: flex; flex-wrap: wrap; gap: .5rem; align-items: center;
  justify-content: space-between; padding-top: .5rem; padding-bottom: .5rem;
}
.demo-bar strong { color: #fff; }

/* ------------------------------------------------------------- transcript */
.transcript { max-width: 74ch; }
.tr-block { display: grid; grid-template-columns: 4.2rem minmax(0, 1fr); gap: .25rem 1rem; margin-bottom: 1.1rem; }
.tr-block p { margin: 0; }
.tr-stamp {
  font-family: var(--mono); font-size: .76rem; color: var(--muted);
  text-decoration: none; padding-top: .28rem; white-space: nowrap;
}
a.tr-stamp:hover { color: var(--az-red); text-decoration: underline; }
.tr-block:target p, .tr-block.is-current p { background: var(--tint-blue); border-radius: var(--r-s); }
@media (max-width: 600px) {
  .tr-block { grid-template-columns: 1fr; gap: .1rem; }
  .tr-stamp { padding-top: 0; }
}
.player-meta {
  display: flex; flex-wrap: wrap; gap: .5rem; align-items: center;
  margin-top: .75rem; padding: .6rem .2rem;
}

/* --------------------------------------------------------- caption toggle */
.cc-toggle { gap: .4rem; }
.cc-badge {
  font-size: .62rem; font-weight: 700; letter-spacing: .04em; line-height: 1;
  border: 1.5px solid currentColor; border-radius: 3px; padding: .18rem .22rem;
}
.cc-toggle.is-on {
  background: var(--az-blue); border-color: var(--az-blue); color: #fff;
}
.cc-toggle.is-on:hover { background: var(--azurite); border-color: var(--azurite); color: #fff; }

/* ============================================================================
   Feedback widget and the compiled feedback view
   ========================================================================= */

.nav-badge {
  display: inline-block; min-width: 18px; margin-left: .35rem; padding: 0 5px;
  background: var(--az-red); color: #fff; border-radius: var(--r-pill);
  font-size: .7rem; font-weight: 600; line-height: 18px; text-align: center; vertical-align: 1px;
}

.fb { position: fixed; right: 14px; bottom: 14px; z-index: 60; font-size: 16px; }
.fb-launch {
  display: inline-flex; align-items: center; gap: .4rem;
  padding: .6rem .95rem; min-height: 44px;
  background: var(--az-blue); color: #fff; border: 1px solid var(--az-blue);
  border-radius: var(--r-pill); box-shadow: var(--sh-3);
  font: 500 .88rem/1 var(--font); cursor: pointer;
  transition: background .18s var(--ease), transform .18s var(--ease);
}
.fb-launch:hover { background: var(--azurite); border-color: var(--azurite); }
.fb-launch:active { transform: translateY(1px); }
.fb-launch svg { flex: none; }
.fb.is-open .fb-launch { background: var(--azurite); border-color: var(--azurite); }

.fb-panel {
  position: absolute; right: 0; bottom: calc(100% + .55rem);
  width: min(380px, calc(100vw - 28px));
  max-height: min(78vh, 640px); overflow-y: auto; overscroll-behavior: contain;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-l); box-shadow: var(--sh-3); padding: 1.05rem 1.1rem 1.1rem;
}
.fb-panel[hidden] { display: none; }
.fb-panel-head { display: flex; align-items: start; justify-content: space-between; gap: .5rem; margin-bottom: .85rem; }
.fb-panel-head h2 { margin: 0; font-size: 1.05rem; }
.fb-x {
  background: none; border: 0; color: var(--muted); font-size: 1.5rem; line-height: 1;
  padding: 0 .15rem; cursor: pointer;
}
.fb-x:hover { color: var(--az-red); }
.fb-panel .field { margin-bottom: .85rem; }
.fb-panel label { display: block; font-size: .82rem; font-weight: 500; color: var(--ink); margin-bottom: .28rem; }
.fb-panel select, .fb-panel textarea { font-size: .93rem; }
.fb-panel textarea { min-height: 96px; }
.fb-note {
  margin: .85rem 0 0; padding-top: .7rem; border-top: 1px solid var(--line-soft);
  font-size: .76rem; line-height: 1.45; color: var(--muted);
}
.fb-note strong { color: var(--ink-2); }
.fb-status { margin: .6rem 0 0; font-size: .84rem; color: var(--muted); }
.fb-status:empty { display: none; }
.fb-status.is-ok { color: #4d5a32; }
.fb-status.is-error { color: var(--az-red); }

/* pointing at a part of the page */
body.fb-picking, body.fb-picking * { cursor: crosshair !important; }
body.fb-picking { -webkit-user-select: none; user-select: none; }
.fb-marker {
  position: absolute; z-index: 58; pointer-events: none; display: none;
  border: 2px solid var(--az-red); border-radius: var(--r-s);
  background: rgba(171, 5, 32, .07);
}
.fb-marker.is-on { display: block; }
.fb-marker-tag {
  position: absolute; left: -2px; top: -1.45rem; max-width: 100%;
  padding: .1rem .45rem; background: var(--az-red); color: #fff;
  border-radius: var(--r-xs) var(--r-xs) 0 0;
  font: 500 .72rem/1.4 var(--font); white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.fb-pick-hint {
  position: fixed; left: 50%; top: 14px; transform: translateX(-50%); z-index: 61;
  max-width: calc(100vw - 28px); padding: .5rem .9rem;
  background: var(--tinta); color: #fff; border-radius: var(--r-pill);
  font-size: .82rem; box-shadow: var(--sh-3); text-align: center;
}

@media (max-width: 560px) {
  .fb { right: 10px; bottom: 10px; }
  .fb-launch { padding: .55rem .8rem; }
  .fb-panel { position: fixed; left: 10px; right: 10px; bottom: 66px; width: auto; max-height: 72vh; }
}
@media print { .fb { display: none; } }

/* --- the instructor's compiled view ------------------------------------- */

.fb-filters {
  display: grid; gap: .7rem; margin-top: 1.25rem;
  grid-template-columns: 1fr;
}
@media (min-width: 700px)  { .fb-filters { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 1050px) { .fb-filters { grid-template-columns: repeat(6, 1fr); } }
.fb-filters > * { min-width: 0; }
.fb-filters label { display: block; margin-bottom: .2rem; }
.fb-filters .btn-row { align-items: end; }

.fb-group { margin-top: 1.75rem; }
.fb-group-head {
  display: flex; flex-wrap: wrap; gap: .3rem 1rem; align-items: baseline; justify-content: space-between;
  padding-bottom: .5rem; border-bottom: 2px solid var(--az-blue); margin-bottom: .85rem;
}
.fb-group-head code { font-size: .78rem; color: var(--muted); }

.fb-item {
  background: var(--surface); border: 1px solid var(--line); border-left: 3px solid var(--line-strong);
  border-radius: var(--r-m); padding: .95rem 1.05rem; box-shadow: var(--sh-1);
  scroll-margin-top: 90px;
}
.fb-item + .fb-item { margin-top: .7rem; }
.fb-item.is-new { border-left-color: var(--az-red); background: var(--surface); }
.fb-item:target { box-shadow: var(--ring); }
.fb-item-head {
  display: flex; flex-wrap: wrap; gap: .4rem .75rem; align-items: center;
  justify-content: space-between; margin-bottom: .15rem;
}
.fb-item-head strong { color: var(--ink); }
.fb-reply {
  margin-top: .8rem; padding: .7rem .85rem;
  background: var(--cloud); border-radius: var(--r-s); border-left: 3px solid var(--azurite);
}
.fb-actions { display: flex; flex-wrap: wrap; gap: .45rem; align-items: center; margin-top: .85rem; }
.fb-actions form { margin: 0; }
.fb-reply-toggle { margin: 0; }
.fb-reply-toggle > summary { list-style: none; cursor: pointer; }
.fb-reply-toggle > summary::-webkit-details-marker { display: none; }
.fb-reply-toggle[open] > summary { margin-bottom: .6rem; }
.fb-reply-toggle textarea { font-size: .92rem; margin-bottom: .5rem; }
.fb-reply-toggle[open] { flex-basis: 100%; }

/* a section arrived at from a feedback link */
.fb-landed { animation: fbLanded 2.4s var(--ease); border-radius: var(--r-s); }
@keyframes fbLanded {
  0%, 60% { background: var(--tint-red); box-shadow: 0 0 0 6px var(--tint-red); }
  100%    { background: transparent; box-shadow: 0 0 0 6px transparent; }
}
.fb-pick-hint { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; justify-content: center; }
.fb-pick-cancel {
  background: rgba(255,255,255,.16); color: #fff; border: 1px solid rgba(255,255,255,.35);
  border-radius: var(--r-pill); padding: .15rem .6rem; font: 500 .78rem/1.5 var(--font); cursor: pointer;
}
.fb-pick-cancel:hover { background: rgba(255,255,255,.28); }

/* a code or key meant to be read aloud and typed */
.code-display {
  display: inline-block; margin: 0; padding: .55rem 1rem;
  background: var(--tinta); color: #fff; border-radius: var(--r-s);
  font-family: var(--mono); font-size: 1.35rem; font-weight: 500; letter-spacing: .12em;
  user-select: all;
}

/* read-only observer account */
.observer-bar {
  background: var(--shade); color: #fff; font-size: .86rem; padding: .5rem 0;
}
.observer-bar .wrap { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; justify-content: center; text-align: center; }
.observer-bar strong { color: #fff; }
/* Style only what readonly.js actually disabled, so the actions an observer may
   still take — signing out, their own password, student preview — look live. */
body[data-readonly] button[disabled], body[data-readonly] input[type=submit][disabled] {
  opacity: .42; cursor: not-allowed; box-shadow: none;
}

/* ============================================================================
   Course assistant
   ========================================================================= */

.ask-budget { margin: 1.4rem 0 1rem; }
.ask-thread {
  display: grid; gap: .8rem; margin-bottom: 1rem;
  min-height: 120px;
}
.ask-empty { background: var(--surface-sunk); border: 1px dashed var(--line-strong);
             border-radius: var(--r-m); padding: 1rem 1.1rem; }
.ask-empty strong { color: var(--ink); font-size: .9rem; }

.ask-msg { display: grid; gap: .3rem; }
.ask-body { white-space: pre-wrap; line-height: 1.6; }
.ask-me .ask-body {
  justify-self: end; max-width: 85%;
  background: var(--az-blue); color: #fff;
  padding: .6rem .9rem; border-radius: var(--r-l) var(--r-l) var(--r-xs) var(--r-l);
  font-size: .95rem;
}
.ask-bot .ask-body {
  background: var(--surface); border: 1px solid var(--line); border-left: 3px solid var(--azurite);
  padding: .85rem 1rem; border-radius: var(--r-s) var(--r-m) var(--r-m) var(--r-s);
  box-shadow: var(--sh-1);
}
.ask-msg.is-pending .ask-body { color: var(--muted); font-style: italic; }
.ask-msg.ask-error .ask-body { border-left-color: var(--az-red); background: var(--tint-red); }
.ask-msg.ask-ungrounded .ask-body { border-left-color: var(--brick); }

.ask-cite {
  display: inline-block; margin: 0 .1rem; padding: 0 .3rem;
  background: var(--cloud); color: var(--azurite); border-radius: var(--r-xs);
  font: 500 .76em/1.5 var(--mono); text-decoration: none; vertical-align: 1px;
}
.ask-cite:hover { background: var(--azurite); color: #fff; }
.ask-sources { padding-left: .2rem; line-height: 1.5; }
.ask-sources a { word-break: break-word; }

.ask-form textarea { min-height: 72px; font-size: .95rem; }
@media (max-width: 560px) { .ask-me .ask-body { max-width: 95%; } }

/* --- the assistant as a floating widget --------------------------------- */

/* Stacked above the feedback pill, which keeps the bottom-right corner. */
.askw { position: fixed; right: 14px; bottom: 66px; z-index: 60; font-size: 16px; }
.askw-launch {
  display: inline-flex; align-items: center; gap: .4rem;
  padding: .6rem .95rem; min-height: 44px;
  background: var(--shade); color: #fff; border: 1px solid var(--shade);
  border-radius: var(--r-pill); box-shadow: var(--sh-3);
  font: 500 .88rem/1 var(--font); cursor: pointer;
  transition: background .18s var(--ease), transform .18s var(--ease);
}
.askw-launch:hover { background: #356868; border-color: #356868; }
.askw-launch:active { transform: translateY(1px); }
.askw-launch svg { flex: none; }
.askw.is-open .askw-launch { background: #356868; border-color: #356868; }

.askw-panel {
  position: absolute; right: 0; bottom: calc(100% + .55rem);
  width: min(430px, calc(100vw - 28px));
  display: flex; flex-direction: column;
  max-height: min(76vh, 640px);
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-l); box-shadow: var(--sh-3); padding: 1rem 1.05rem 1.05rem;
}
.askw-panel[hidden] { display: none; }
.askw-head { display: flex; align-items: start; justify-content: space-between; gap: .5rem; margin-bottom: .7rem; }
.askw-head h2 { margin: 0; font-size: 1.02rem; }
.askw-thread {
  flex: 1; overflow-y: auto; overscroll-behavior: contain;
  min-height: 90px; margin-bottom: .75rem; padding-right: .2rem;
}
.askw-thread .ask-body { font-size: .9rem; }
.askw-panel .ask-form textarea { min-height: 58px; font-size: .92rem; }
.askw-meter { margin-top: .75rem; padding-top: .6rem; border-top: 1px solid var(--line-soft); }

@media (max-width: 560px) {
  .askw { right: 10px; bottom: 60px; }
  .askw-launch { padding: .55rem .8rem; }
  .askw-panel { position: fixed; left: 10px; right: 10px; bottom: 112px; width: auto; max-height: 68vh; }
}
@media print { .askw { display: none; } }

/* standing beta notice on the assistant */
.ask-beta {
  margin: 0 0 .8rem; padding: .5rem .7rem;
  background: var(--tint-clay); border-left: 3px solid var(--brick);
  border-radius: var(--r-xs);
  font-size: .78rem; line-height: 1.45; color: var(--ink-2);
}
.ask-beta strong { color: var(--brick); }
.ask-beta-page { font-size: .85rem; padding: .7rem .9rem; margin: 1.25rem 0 0; }
.askw-beta-tag {
  margin-left: .1rem; padding: 0 .3rem;
  background: rgba(255,255,255,.22); border-radius: var(--r-xs);
  font-size: .62rem; font-weight: 600; letter-spacing: .04em; text-transform: uppercase;
}

/* answer check: per-sentence grounding */
.ac-line { padding: .55rem .8rem; border-left: 3px solid var(--line-strong); border-radius: var(--r-xs);
           background: var(--surface); }
.ac-inconclusive { border-left-color: var(--line-strong); background: var(--surface); }
.ac-outside      { border-left-color: var(--az-red); background: var(--tint-red); }
.ac-para { padding: .6rem .7rem; border-radius: var(--r-s); }
.ac-para.is-flagged { background: var(--surface-sunk); border: 1px solid var(--line-strong); }
.ac-para .ac-line + .ac-line { margin-top: .35rem; }

/* Provenance as the model labelled it, sentence by sentence. The deterministic
   unknown-name flag (.ac-outside, red) stays on top of these when it fires. */
.ac-src-course  { border-left-color: var(--line-strong); background: var(--surface); }
.ac-src-mixed   { border-left-color: var(--saguaro);     background: var(--tint-green); }
.ac-src-outside { border-left-color: var(--brick);       background: var(--tint-clay); }
.ac-src-none    { border-left-color: var(--line-soft);   background: var(--surface); color: var(--ink-2); }
.ac-has-error   { box-shadow: inset 0 0 0 1px var(--az-red); }
.ac-marks { display: flex; flex-wrap: wrap; gap: .35rem; margin: .3rem 0 0; }
.ac-marks .label { font-size: .68rem; }

/* The criteria table from the marking guide. */
.ac-crit td:first-child { font-weight: 600; }
.ac-crit .pts { font-variant-numeric: tabular-nums; white-space: nowrap; }
.ac-err { border-left: 3px solid var(--az-red); padding: .6rem .9rem; background: var(--tint-red);
  border-radius: var(--r-xs); }
.ac-err + .ac-err { margin-top: .5rem; }
.ac-err q { font-style: italic; }
.ac-score b { font-size: 2.1rem; line-height: 1; letter-spacing: -.02em; }
.ac-score small { font-size: 1rem; color: var(--muted); font-weight: 500; }

/* The loading state for the result fields. Shown in place of the previous
   result from the moment a check is submitted until the page comes back, so
   no number on the page can be read as the new student's while the model
   runs. A shimmering bar where each value will be; the labels stay. */
.ac-skeleton[hidden] { display: none; }
.skel {
  display: inline-block; vertical-align: middle; border-radius: var(--r-xs);
  background: linear-gradient(90deg, var(--line-soft) 0%, var(--line) 40%, var(--line-soft) 80%);
  background-size: 200% 100%; animation: skel 1.3s linear infinite;
}
@keyframes skel { from { background-position: 100% 0; } to { background-position: -100% 0; } }
/* Sized from the figure each one stands in for: the tile's <b>, the share
   card's 1.45rem percentage, the 2.1rem score. Without the explicit font size
   the tile placeholder inherits the .stat span label size and comes out tiny. */
.stat b .skel-val { font-size: inherit; line-height: 1; width: 3.4ch; height: 1em; vertical-align: baseline; }
.skel-pct   { font-size: 1.45rem; line-height: 1; width: 3ch; height: 1em; flex: none; }  /* a flex item: never squeezed at phone width */
.skel-score { font-size: 2.1rem; line-height: 1; width: 2.2ch; height: 1em; }
.skel-pill  { width: 9ch; height: 1.35em; border-radius: var(--r-pill); }
.skel-line  { display: block; height: .7em; }
.skel-text  { display: grid; gap: .55em; }
.skel-pill + .skel-text { margin-top: .8rem; }
.ac-skeleton td .skel-line { margin: .25em 0; }
.stat.is-loading::before { background: var(--line-strong); }

/* Signs of AI writing: marks in the text, and the scale between the references. */
mark.sign { background: none; color: inherit; border-radius: 3px; padding: 0 .1em;
  box-shadow: inset 0 0 0 1px var(--line-strong); }
mark.sign-disc { background: var(--tint-clay); box-shadow: inset 0 0 0 1px var(--brick); }
.sign-scale { position: relative; height: 14px; margin: .75rem .5rem .25rem; border-radius: var(--r-pill);
  background: linear-gradient(90deg, var(--line-soft), var(--tint-clay)); }
.sign-tick { position: absolute; top: -4px; width: 2px; height: 22px; margin-left: -1px; border-radius: 1px; }
.sign-tick-ref { background: var(--azurite); }
.sign-tick-machine { background: var(--brick); }
.sign-dot { position: absolute; top: -2px; width: 18px; height: 18px; margin-left: -9px; border-radius: 50%;
  background: var(--ink); border: 3px solid var(--surface); box-shadow: 0 1px 3px rgba(3,19,46,.35); }
.sign-key { display: inline-block; width: 10px; height: 10px; border-radius: 2px; vertical-align: -1px; margin-right: .2rem; }
.sign-key-ref { background: var(--azurite); }
.sign-key-machine { background: var(--brick); }
.sign-key-dot { background: var(--ink); border-radius: 50%; }
.sign-tick-class { background: var(--saguaro); }
.sign-key-class { background: var(--saguaro); }
.sign-scale-labels { position: relative; height: 1.1rem; margin: .2rem .5rem 0; }
.sign-scale-labels span { position: absolute; transform: translateX(-50%); white-space: nowrap; }

.sign-cats { display: grid; gap: .7rem; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.sign-cat { padding: .7rem .85rem; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-s); }
.sign-cat-head { display: flex; justify-content: space-between; gap: .5rem; margin-bottom: .35rem; font-weight: 600; }
.sign-cat .progress-bar { height: 7px; }

/* Scatter plots on the ranking page. */
.corr-plot { width: 100%; height: auto; display: block; font-family: inherit; }
.corr-grid { stroke: var(--line-soft); stroke-width: 1; }
.corr-tick { font-size: 10px; fill: var(--muted); }
.corr-axis { font-size: 11px; fill: var(--ink-2); font-weight: 600; }
.corr-dot { fill: var(--azurite); fill-opacity: .8; stroke: var(--surface); stroke-width: 1.5; }
.corr-dot:hover { fill: var(--brick); fill-opacity: 1; }
.corr-dot-declared { fill: var(--surface); fill-opacity: 1; stroke: var(--brick); stroke-width: 2; }
.corr-name { font-size: 9.5px; fill: var(--muted); pointer-events: none; }
