/* Six Strategic Views — learner interface.
 *
 * A reading-heavy screen: the guide writes several sentences per turn and the
 * final evaluation is a page of prose. Measure, line height and contrast are
 * therefore doing more work here than layout is.
 *
 * Two voices, told apart by type rather than by bubbles. The guide, the case
 * and the headings are set in Newsreader, a serif drawn for reading on screen,
 * so the coaching reads like a note from a mentor rather than a system
 * message. The learner's own writing, and every control, is in Geist, a
 * neutral sans. Micro-labels are Geist Mono. All three are self-hosted from
 * fonts/ (SIL Open Font License, texts beside them) rather than linked from a
 * font CDN, so a learner's browser asks nobody but this server for anything.
 *
 * The recurring mark is the lens: one side of a polygon per view, filled in
 * as the session moves through them. It is drawn by lens.py on the server and
 * by app.js in the browser; its colours are the --lens-* tokens below.
 *
 * Palette is University of Michigan blue/maize on a warm off-white. Every
 * colour that carries text, a focus ring, or a control boundary is a token
 * (--accent and --accent-ink flip between navy-on-white and maize-on-navy per
 * colour scheme) so contrast holds in both modes rather than being tuned once
 * for light mode and hoped for in dark mode. The ratios quoted in this file
 * were computed with the WCAG 2 formula, not estimated.
 */

@font-face {
  font-family: "Newsreader";
  src: url("fonts/newsreader-latin-opsz-normal.f94a697b1650.woff2") format("woff2");
  font-style: normal;
  font-weight: 200 800;
  font-display: swap;
}
@font-face {
  font-family: "Newsreader";
  src: url("fonts/newsreader-latin-opsz-italic.e97067eb043b.woff2") format("woff2");
  font-style: italic;
  font-weight: 200 800;
  font-display: swap;
}
@font-face {
  font-family: "Geist";
  src: url("fonts/geist-latin-wght-normal.a147f99cd533.woff2") format("woff2");
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
}
@font-face {
  font-family: "Geist Mono";
  src: url("fonts/geist-mono-latin-wght-normal.a15f9d568fb0.woff2") format("woff2");
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
}

:root {
  /* Lets the UA paint form controls, scrollbars and the checkbox in the same
   * scheme as the page instead of forcing light widgets onto a dark ground. */
  color-scheme: light dark;

  /* Each stack falls back to something of the same kind, so a font that has
   * not arrived yet (font-display: swap) leaves the page readable, not blank. */
  --font-display: "Newsreader", "Iowan Old Style", Charter, Georgia, serif;
  --font-body: "Geist", -apple-system, BlinkMacSystemFont, "Segoe UI",
    "Helvetica Neue", Arial, sans-serif;
  --font-mono: "Geist Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

  --ink:        #15181d;
  --ink-soft:   #4b5561;
  /* Text tokens are split by the job they do, because one grey cannot pass
   * contrast everywhere it was being used. --ink-faint is for ordinary small
   * print (5.39:1 on --page, 5.93:1 on --card, 5.33:1 on --current-bg);
   * --ink-meta is for the uppercase micro-labels and table headers, which are
   * small enough to want the extra headroom (6.89:1 on --page). */
  --ink-faint:  #5b6570;
  --ink-meta:   #4b5561;
  --page:       #f6f4ee;
  --card:       #ffffff;
  /* The case column, a shade off the page so it reads as a separate thing to
   * refer to rather than more of the conversation. */
  --panel:      #fbfaf6;
  /* --line is decorative hairline only, and exempt from contrast. Anything
   * that bounds a control uses --line-control, which clears 3:1 against both
   * --page (3.88:1) and --card (4.27:1). */
  --line:         #e4e0d6;
  --line-control: #767b80;

  /* Brand: Michigan navy carries text/UI at 13.2:1 on --page, so every
   * accent role (links, focus rings, primary buttons) can point at one
   * token. --maize is decorative only (rules, badge fills, the current side of
   * the lens) — it is never used for text on its own, since maize-on-light
   * and white-on-maize both fail 4.5:1. */
  --accent:      #00275c;
  --accent-ink:  #ffffff;
  --accent-tint: #e8edf5;
  --maize:       #ffcb05;

  /* The session's "Proceed to next view" card: Michigan Blue (#00274c, as
   * asked for on 20 October 2026) with white words, 15.06:1, in both colour
   * schemes. Its edge is the fill itself here (13.69:1 on --page); dark mode
   * gives it a lighter one. Hover darkens it to #001f3d (16.62:1). */
  --next-fill:  #00274c;
  --next-hover: #001f3d;
  --next-edge:  #00274c;
  /* Its "✓ Minimum reached" line: the dark-mode --success green, 7.57:1 on
   * the navy and 8.35:1 on its hover. The light-mode one is 2.38:1 there. */
  --next-ok:    #7fc79c;

  /* The learner's turns get a faint maize tint; the guide's get none, and are
   * told apart by their typeface instead. --ink holds 16.4:1 on the tint. */
  --learner-bg: #fff6d6;
  /* The current view's row in the rail. --accent holds 13.1:1 on it. */
  --current-bg: #fff3c4;
  /* Icon tiles on the consent card; navy holds 12.9:1 on it. */
  --tile:       #eef2f7;

  /* The lens. It never carries anything alone: the rail beside it says the
   * same position in words, and the review table prints a summary under each
   * one. That matters because maize, the current side, is only 1.38:1 against
   * the page -- it is there to be seen at a glance, not to be relied on.
   * Visited is 13.2:1, and the review's "left at the question limit" shade is
   * 5.49:1 against visited, so the two it has to tell apart differ in
   * lightness, not hue alone. */
  --lens-visited:  #00275c;
  --lens-current:  #ffcb05;
  --lens-upcoming: #e4e0d6;
  --lens-capped:   #8fa0bd;

  --danger:  #a3352b;
  --success: #2f6b46;

  --radius-lg: 20px;
  --radius: 16px;
  --radius-sm: 10px;
  --measure: 62ch;

  --shadow-sm: 0 1px 2px rgba(15, 23, 42, .06), 0 1px 1px rgba(15, 23, 42, .04);
  --shadow-md: 0 10px 30px rgba(15, 23, 42, .08), 0 2px 8px rgba(15, 23, 42, .05);
}

@media (prefers-color-scheme: dark) {
  :root {
    --ink:        #ece9e2;
    --ink-soft:   #b3bcc6;
    --ink-faint:  #a3adb8;
    --ink-meta:   #b3bcc6;
    --page:       #121417;
    --card:       #1d2126;
    --panel:      #16191d;
    --line:         #2a2f36;
    /* 4.86:1 on --page, 4.26:1 on --card. */
    --line-control: #7b848e;

    /* Navy vanishes against a near-black page, so dark mode flips the accent
     * role to maize (12.1:1 on --page) with navy ink on top of it -- the same
     * pairing as light mode, mirrored. */
    --accent:      #ffcb05;
    --accent-ink:  #00275c;
    --accent-tint: #1e2a3d;
    --maize:       #ffcb05;

    /* The navy card stays navy, as the evaluation's invitation card does, but
     * navy is 1.23:1 against this page, so its shape would go. A slate edge
     * (the visited side of the lens) is 5.91:1 against the page. */
    --next-edge:  #7c93b8;

    --learner-bg: #262216;
    /* --accent (maize) holds 9.8:1 on it. */
    --current-bg: #2b2718;
    --tile:       #1e2a3d;

    /* Navy would vanish here too; visited becomes a light slate (5.91:1 on
     * --page), and the current side stays maize. */
    --lens-visited:  #7c93b8;
    --lens-current:  #ffcb05;
    --lens-upcoming: #2c323a;
    --lens-capped:   #46556d;

    --danger:  #e2857a;
    --success: #7fc79c;

    --shadow-sm: 0 1px 2px rgba(0, 0, 0, .35), 0 1px 1px rgba(0, 0, 0, .25);
    --shadow-md: 0 10px 30px rgba(0, 0, 0, .45), 0 2px 8px rgba(0, 0, 0, .3);
  }
}

* { box-sizing: border-box; }

/* An author `display` rule beats the UA stylesheet's [hidden] rule, so any
 * element given a display here would ignore its own hidden attribute. */
[hidden] { display: none !important; }

html { color-scheme: light dark; }

body {
  margin: 0;
  background: var(--page);
  color: var(--ink);
  /* Not a fixed px size: the shorthand would override whatever the reader set
   * as their browser default. 100% honours it and every rem below scales. */
  font-family: var(--font-body);
  font-size: 100%;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  /* A word too long for its line breaks rather than running off the edge.
   * Without it, one pasted link in a response made the page 1,218px wide at
   * 320px (WCAG 1.4.10, review of 19 October 2026). break-word changes
   * nothing else: it acts only on a word that would otherwise overflow. */
  overflow-wrap: break-word;
}

/* break-word is not enough for a box that sizes itself to its content -- the
 * learner's turn, which sits to one side at its own width -- or for a grid
 * column, which grows to its widest word: both still widen to fit the long
 * word, and the page with them. `anywhere` lets that word count as breakable
 * when the box is sized, too. Only on the boxes that hold what learners and
 * the models write; on everything else it would let tables and button rows
 * squeeze words apart instead of wrapping or scrolling. */
.turn, .prose, .case-body { overflow-wrap: anywhere; }

::selection { background: var(--maize); color: #00275c; }

/* Without JS this page is six hidden sections and nothing else, so say so. */
noscript { display: block; padding: 2rem 1.25rem; }

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

/* A constant brand bar: navy holds 14.8:1 for white text regardless of the
 * reader's colour scheme, so unlike every other surface on the page it does
 * not need a dark-mode variant. It is decorative chrome, not a heading — the
 * screens beneath still carry their own <h1>. */
.site-header {
  display: flex;
  align-items: center;
  gap: .75rem;
  background: #00275c;
  color: #ffffff;
  padding: .55rem 1.5rem;
  min-height: 3.5rem;
  border-bottom: 3px solid #ffcb05;
}
/* The Block M as shipped: maize artwork on transparency, sitting directly on
 * the navy bar. That pairing is the university's own, which is why there is no
 * maize tile behind it any more — the letter it replaced needed one to be
 * legible, and a maize mark on a maize tile would not be.
 *
 * Height sets the size and width follows the artwork, so the mark keeps its
 * proportions whatever the file's pixel dimensions are; overriding the width
 * and height attributes in the markup is the point of setting both here. */
.site-header .brand-mark {
  flex: none;
  width: auto;
  height: 1.75rem;
}
.site-header .brand-name {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 1.25rem;
  letter-spacing: -.01em;
}
.site-header .brand-tag {
  font-size: .78rem;
  color: #cfe0f5;
  margin-left: .1rem;
}
@media (max-width: 30rem) { .site-header .brand-tag { display: none; } }

/* The navigation sits in the brand bar, so no page is more than one click
 * from any other page the account opens. Which links exist is decided in
 * access.NAV, never here and never in a template.
 *
 * Not the page's --accent: this bar is navy in both colour schemes (see
 * above), and --accent is chosen for contrast against a light card. Each link
 * is a pill at least 44px tall, so it is an easy target on a touchscreen. The
 * other links are a pale blue-grey (9.63:1 here); the current page is white on
 * a lighter pill with a maize rule under its text (9.55:1), so the marker is
 * a shape and a rule as well as a colour and never relies on weight alone. */
.site-nav {
  display: flex; align-items: center; gap: .25rem;
  margin-left: 1.25rem;
  font-size: .9rem;
}
.site-nav a {
  display: inline-flex; align-items: center;
  min-height: 2.75rem;
  padding: 0 1rem;
  border-radius: 999px;
  color: #c9d3e3;
  font-weight: 500;
  text-decoration: none;
}
.site-nav a:hover { color: #ffffff; background: rgba(255, 255, 255, .08); }
.site-nav a[aria-current="page"] {
  color: #ffffff;
  background: rgba(255, 255, 255, .14);
  text-decoration: underline;
  text-decoration-color: #ffcb05;
  text-decoration-thickness: 2px;
  text-underline-offset: 6px;
}
.site-nav a:focus-visible { outline: 2px solid #ffcb05; outline-offset: 2px; }

/* Pushed right as a group, so the account controls stay together however
 * many nav links there are. */
.site-account {
  display: flex; align-items: center; gap: .75rem;
  margin-left: auto;
  font-size: .8125rem;
}
.site-account .who { color: #cfe0f5; font-family: var(--font-mono); font-size: .8rem; }
.site-account form { margin: 0; }
/* Sign-out has to be a POST from Django 5 on, so it cannot be an <a>. It is
 * drawn as an outlined pill the height of the nav links beside it, which is
 * also what gives it a 44px target. */
.site-account button.linkish {
  min-height: 2.75rem;
  padding: 0 1rem;
  border: 1px solid rgba(255, 255, 255, .4);
  border-radius: 999px;
  background: none;
  font: inherit; font-size: .85rem; font-weight: 500;
  color: #ffffff; text-decoration: none; cursor: pointer;
}
.site-account button.linkish:hover { background: rgba(255, 255, 255, .08); }
.site-account button.linkish:focus-visible { outline: 2px solid #ffcb05; outline-offset: 2px; }

/* Narrow enough that the bar cannot hold both rows: wrap the links under the
 * brand rather than squeezing the name to nothing. */
@media (max-width: 34rem) {
  /* Two rows: the brand on the first, the links and Sign out on the second.
   * The username is the one thing dropped to make that fit -- the consent
   * card names the account in full, and a phone header three rows deep would
   * take a sixth of the screen for the whole session. */
  /* No forced break: the brand and the links do not fit one row at these
   * widths, so the links wrap on their own and Sign out follows them. */
  .site-header { flex-wrap: wrap; row-gap: .35rem; padding-inline: 1rem; }
  .site-nav { margin-left: -.75rem; }
  .site-nav a { padding: 0 .75rem; }
  .site-account .who { display: none; }
}

.shell { max-width: 60rem; margin: 0 auto; padding: 2rem 1.25rem 4rem; }

/* The chat screen alone is allowed to be wider. 60rem is a measure for a
 * single column of prose, which is what every other screen is; chat is two
 * columns, and the 13rem sidebar comes straight out of the reading column, so
 * the same cap leaves the case narrower than the pages either side of it.
 *
 * 68rem is not a round number picked for looks -- it is the widest the case
 * can be and still read at a sane measure. Card content is shell minus 320px
 * (shell padding, sidebar, gap, card padding), so 68rem gives the case 768px,
 * which at its 1rem size is ~76ch. Wider than this and the lines get too long
 * to track; the rest of a large monitor is deliberately margin. */
body[data-screen="chat"] .shell { max-width: 68rem; }
/* From 80rem the case moves out to a third column (see .chat below), and
 * that column's 21rem comes on top of the 68rem above rather than out of the
 * conversation -- which is what keeps the conversation at a reading measure
 * instead of squeezing it to make room.
 *
 * 88rem since 20 October 2026, when the two side columns lost 2rem each so
 * the session's choice-card titles fit on one line in a 1280px window (they
 * had 145px; "Proceed to next view" needs 156). The cap came down by the
 * same 4rem, so the widest the conversation gets on a large monitor is
 * unchanged; only windows from 1280px to about 1450px give it the room. */
@media (min-width: 80rem) {
  body[data-screen="chat"] .shell { max-width: 88rem; }
}
/* The consent screen is two columns -- the introduction and the consent card
 * -- and the evaluation puts the transcript beside the coaching, so both are
 * wider than a single column of prose. Each column inside still keeps its own
 * measure. */
body[data-screen="consent"] .shell { max-width: 80rem; padding-top: 3rem; }
body[data-screen="evaluation"] .shell { max-width: 76rem; padding-top: 3rem; }

/* Only the screen matching body[data-screen] is shown. */
.screen { display: none; }
body[data-screen="loading"]    .screen[data-for="loading"],
body[data-screen="consent"]    .screen[data-for="consent"],
body[data-screen="courses"]    .screen[data-for="courses"],
body[data-screen="chat"]       .screen[data-for="chat"],
body[data-screen="evaluation"] .screen[data-for="evaluation"],
body[data-screen="thanks"]     .screen[data-for="thanks"],
body[data-screen="notice"]     .screen[data-for="notice"] { display: block; }
body[data-screen="chat"] .screen[data-for="chat"],
body[data-screen="consent"] .screen[data-for="consent"] { display: grid; }

/* Screen changes move focus to the new heading so a screen reader announces
 * it. That focus is programmatic, not the keyboard landing somewhere, so it
 * must not paint a ring -- it reads as a stray box drawn around the heading.
 * Real controls still get their :focus-visible outlines. */
[tabindex="-1"]:focus { outline: none; }

/* Absolutely positioned, so it sits wherever its containing block says --
 * and a box that scrolls sideways clips only what it contains. Text hidden
 * this way inside a scroller whose containing block is further out escapes
 * the scroller and widens the whole page: at 320px the view strip's
 * "(not yet reached)" labels made the chat screen 762px wide, and the review
 * table's "none"s did the same to its page. So every box here that scrolls
 * sideways is also `position: relative` (.rail ol, and .table-wrap in
 * review.css), which makes it the containing block and keeps these inside. */
.sr-only {
  position: absolute; width: 1px; height: 1px; margin: -1px;
  padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
}

/* Off-screen until tabbed to: the first stop on every page skips the
 * brand bar/rail and lands on the content. */
.skip {
  position: absolute; left: .75rem; top: -3rem; z-index: 100;
  background: var(--card); color: var(--accent);
  padding: .6rem 1rem; border-radius: var(--radius-sm); border: 1px solid var(--accent);
  transition: top .15s;
}
.skip:focus { top: .75rem; }
@media (prefers-reduced-motion: reduce) { .skip { transition: none; } }

/* ---------------------------------------------------------- typography -- */

/* Headings are the serif's: they are the page's own voice, the same one the
 * guide speaks in. Weight 500, not bold -- a serif at 700 on a screen this
 * calm shouts. */
h1, h2 { font-family: var(--font-display); font-weight: 500; letter-spacing: -.015em; }
h1 { font-size: 2.25rem; line-height: 1.15; margin: 0 0 .5rem; }
h2 { font-size: 1.5rem; line-height: 1.25; margin: 0 0 .75rem; }
p  { margin: 0 0 1rem; max-width: var(--measure); }
ul { max-width: var(--measure); padding-left: 1.25rem; }
li { margin-bottom: .35rem; }

.masthead { margin-bottom: 1.5rem; }
.lede  { color: var(--ink-soft); font-size: 1.1rem; }
.muted { color: var(--ink-faint); }
.hint  { color: var(--ink-faint); font-size: .875rem; margin: .35rem 0 0; }
.error { color: var(--danger); font-size: .925rem; }

/* The small uppercase label over a thing: "The case", "View 4 of 6". Mono, so
 * it reads as a label rather than as a sentence that lost its case. Also used
 * on real headings (h1.eyebrow, h2.eyebrow), which is why it resets the
 * heading's font and size rather than assuming a span. */
.eyebrow {
  display: block;
  margin: 0;
  font-family: var(--font-mono);
  font-size: .75rem;
  font-weight: 500;
  line-height: 1.4;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--ink-meta);
}

/* The one display size, for the line that opens a screen. */
.display {
  font-size: clamp(2.5rem, 4.5vw + 1rem, 4.25rem);
  line-height: 1.04;
  letter-spacing: -.025em;
  margin: 0 0 1.25rem;
  max-width: 14em;
}
.display em { font-style: italic; font-weight: 400; color: var(--accent); }

.chips { display: flex; flex-wrap: wrap; gap: .5rem; margin: 0 0 1.5rem; }
.chip {
  display: inline-block;
  padding: .3rem .75rem;
  border: 1px solid var(--line-control);
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: .72rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--ink-soft);
}
.chip.solid { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: 1.75rem;
  margin-bottom: 1.25rem;
}
.card.centred {
  text-align: center;
  max-width: 34rem;
  margin-inline: auto;
}
.card.warn { border-left: 4px solid var(--danger); }
.card.warn p { margin: 0; }
.card.centred p { margin-inline: auto; }
.card.centred .muted { margin: 1.25rem 0 0; font-size: .9rem; }
/* The evaluation is a page of prose with section headings; richText() builds
 * real elements for it, so no pre-wrap is wanted. */
/* Set in the serif at a reading size: it is a page of coaching written to one
 * person, and should read like a letter rather than a report. */
.prose, .prose p { max-width: var(--measure); }
/* As a card, the box fills its column like the cards around it; the measure
 * is held by the paragraphs inside, which is where it does its work. */
.card.prose { max-width: none; }
.prose p { font-family: var(--font-display); font-size: 1.15rem; line-height: 1.65; }
.prose > :first-child { margin-top: 0; }
.prose h2 { font-size: 1.4rem; margin: 2rem 0 .5rem; }
.prose h3 { font-family: var(--font-body); font-size: 1rem; font-weight: 600; margin: 1.25rem 0 .4rem; }

/* -------------------------------------------------------------- forms -- */

.field { margin-bottom: 1.5rem; }
.field > label, legend {
  display: block; font-weight: 600; margin-bottom: .35rem; padding: 0;
}
fieldset.field { border: 0; margin-inline: 0; padding: 0; }

input[type="text"], input[type="password"], textarea {
  width: 100%;
  font: inherit;
  color: var(--ink);
  background: var(--card);
  border: 1px solid var(--line-control);
  border-radius: var(--radius-sm);
  padding: .7rem .85rem;
  resize: vertical;
  transition: border-color .12s ease;
}
/* Placeholders carry information here -- an example label, and the only
 * visible cue in the composer -- so they are text, and held to 4.5:1. Left to
 * the browser they were not: Chromium paints #757575 in both schemes (3.5:1
 * on the dark card), Firefox the text colour at 54% (3.84:1 on white).
 * Opacity 1 undoes Firefox's own dimming. --ink-faint is 5.93:1 on the light
 * card and 7.11:1 on the dark one. */
::placeholder { color: var(--ink-faint); opacity: 1; }

input[type="text"]:hover, input[type="password"]:hover, textarea:hover { border-color: var(--accent); }
input[type="text"]:focus-visible, input[type="password"]:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

.check { display: flex; gap: .6rem; align-items: flex-start; margin: 1.25rem 0; }
.check input { margin-top: .35rem; flex: none; }
.check span { max-width: var(--measure); }
/* The "Your courses" screen: one card per course, one row per case in it.
 * A row is the case's picture, what it is and where the learner stands, and
 * the buttons -- in a line on a wide window. Narrower, the buttons drop below
 * the text, lined up with it rather than with the picture. */
.course-groups { display: flex; flex-direction: column; gap: 1.25rem; }
.course-group {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 1.25rem 1.5rem .25rem;
}
.course-group > h2 {
  font-family: var(--font-display); font-size: 1.45rem; font-weight: 500;
  margin: 0 0 .5rem;
}
.course-term { font-size: 1rem; color: var(--ink-soft); }
/* max-width: none, or the global `ul { max-width: var(--measure) }` stops the
 * rows' dividing lines and buttons short of the card's edge. */
.case-rows { list-style: none; margin: 0; padding: 0; max-width: none; }
.case-row {
  display: grid;
  grid-template-columns: 3.5rem minmax(0, 1fr) auto;
  gap: .75rem 1rem;
  align-items: center;
  padding: 1rem 0;
  border-top: 1px solid var(--line);
  margin: 0;
}
.case-thumb {
  width: 3.5rem; height: 3.5rem;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--lens-visited);
  display: grid; place-items: center;
}
.case-thumb img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 25%; }
.case-thumb .lens-glyph { width: 2.2rem; height: 2.2rem; }
/* The gaps between the sides are the tile's own colour, as on a card they
 * are the card's. */
.case-thumb .lens-glyph polygon { stroke: var(--lens-visited); }
.case-what h3 { font-size: 1.05rem; line-height: 1.35; margin: 0 0 .25rem; }
.case-what p { margin: 0; font-size: .9rem; }
.case-what .chip { font-size: .68rem; padding: .1rem .5rem; margin-right: .45rem; }
.case-row .actions {
  display: flex; flex-wrap: wrap; gap: .75rem 1rem;
  align-items: center; justify-content: flex-end;
}
@media (max-width: 40rem) {
  .course-group { padding: 1rem 1.1rem .25rem; }
  .case-row { grid-template-columns: 3rem minmax(0, 1fr); align-items: start; }
  .case-thumb { width: 3rem; height: 3rem; }
  .case-row .actions { grid-column: 2; justify-content: flex-start; }
}

/* `a.primary` is here because signing in with U-M is a navigation, not a form
 * submit: it has to be a link so it works the way links do (middle-click, copy
 * address, the status bar showing where it goes). It should not look like a
 * different kind of control for that, so the two share one rule rather than
 * one being a copy of the other that drifts. The :disabled pair below stays
 * button-only -- a link has no disabled state to dim. */
button.primary,
a.primary {
  display: inline-block;
  text-decoration: none;
  text-align: center;
  font: inherit;
  font-weight: 600;
  background: var(--accent);
  color: var(--accent-ink);
  border: 0;
  border-radius: 12px;
  /* At least 44px tall at the default text size. */
  min-height: 2.75rem;
  padding: .7rem 1.35rem;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: background-color .12s ease, box-shadow .12s ease, transform .12s ease;
}
button.primary:hover:not(:disabled):not([aria-disabled="true"]),
a.primary:hover {
  background: color-mix(in srgb, var(--accent) 88%, black);
  box-shadow: var(--shadow-md);
}
button.primary:active:not(:disabled):not([aria-disabled="true"]),
a.primary:active { transform: translateY(1px); }
@media (prefers-reduced-motion: reduce) {
  button.primary, a.primary { transition: none; }
}
/* aria-disabled rather than disabled keeps the button in the tab order, so it
 * has to be dimmed here as well as by the UA's :disabled rule. */
button.primary:disabled,
button.primary[aria-disabled="true"] { opacity: .45; cursor: not-allowed; }
button.primary:focus-visible,
a.primary:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
/* The button is a filled shape with no border, and forced colours discard
 * the fill -- leaving "Begin the simulation" as a line of text with nothing
 * to say it can be pressed. The system's own button edge puts it back. */
@media (forced-colors: active) {
  button.primary, a.primary { border: 1px solid ButtonText; }
}
@media (prefers-color-scheme: dark) {
  /* The default outline colour is maize in dark mode, same as --accent, which
   * would sit invisibly on top of a maize button. Ring it in ink instead. */
  button.primary:focus-visible,
  a.primary:focus-visible { outline-color: var(--ink); }
}

/* The one action a card exists for -- Begin -- spans the card. */
button.primary.block { display: block; width: 100%; padding: .95rem 1.35rem; font-size: 1.05rem; border-radius: 14px; }

/* Anchors carry this class too (the raw-JSON link on the review page); without
 * them in the selector they fell back to the UA's default blue. */
.linkish, button.linkish {
  font: inherit;
  font-size: .9rem;
  background: none;
  border: 0;
  padding: 0;
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}
.linkish:focus-visible, button.linkish:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

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

/* Two independent columns: the patient and the view rail down the side, the
 * case and the conversation stacked beside them. The sidebar spans both rows
 * so its contents stack on their own rather than lining up with a row height
 * set by the case.
 *
 * Named areas rather than source order, so the markup can keep the case
 * first, where a screen reader and a no-CSS render both want it. */
.chat {
  grid-template-columns: 13rem 1fr;
  grid-template-areas:
    "aside case"
    "aside conversation";
  gap: 1.5rem 2rem;
  align-items: start;
}
.chat > .case-col     { grid-area: case; }
.chat > .sidebar      { grid-area: aside; }
.chat > .conversation { grid-area: conversation; }

/* The picture beside the case rather than above it, while there is room: the
 * case is the thing being read, and a picture on top of it pushes the text
 * down by its whole height. When the scenario has no picture the case takes
 * the full width -- the :has() below -- instead of starting in a column
 * sized for one. Between 60rem and 80rem an open case has the picture in
 * its top corner instead, with the text round it; see further down. */
.case-col {
  min-width: 0;
  display: grid;
  grid-template-columns: 11rem minmax(0, 1fr);
  gap: 1.25rem;
  align-items: start;
}
.case-col:has(> .case-figure[hidden]) { grid-template-columns: minmax(0, 1fr); }

/* Wide enough for three columns: progress, conversation, case. The case gets
 * a column of its own and stays in view while the conversation scrolls, which
 * is what a learner wants of it -- something to glance back at mid-sentence,
 * not something to scroll up to. It scrolls inside itself when it is taller
 * than the window; app.js gives it a tab stop only while it does. The shell
 * widens at the same breakpoint (above), so the conversation keeps roughly
 * the width it had in two columns. The sidebar is the 13rem it is in two
 * columns, and the case 21rem: until 20 October 2026 they were 15rem and
 * 23rem, and at 1280px that left the choice cards too narrow for their
 * titles (see the shell's cap above). */
@media (min-width: 80rem) {
  .chat {
    grid-template-columns: 13rem minmax(0, 1fr) 21rem;
    grid-template-areas: "aside conversation case";
    gap: 2.5rem;
  }
  .case-col {
    display: block;
    position: sticky;
    top: 1.5rem;
    max-height: calc(100vh - 3rem);
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 1.25rem;
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
  }
  .case-col .case-figure { margin: 0 0 1rem; }
  /* Already inside the column's own panel; a card inside a card is a box for
   * the sake of a box. */
  .case-col .case { background: none; border: 0; padding: 0; }
  .case-col .case[open] { padding-bottom: 0; }
  .case-col .case-body p { font-size: 1rem; }
}
.case-col:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Stack well before phone width. Two columns are only worth having while the
 * case column is wide enough to hold the case at its measure: below roughly
 * 60rem the sidebar's 13rem comes straight out of the case, and at 760px it
 * left the text a 438px column that clipped -- while the same window stacked
 * gave it 562px and showed the case whole. Measured, not guessed.
 *
 * Dropping this to 52rem was tried, to give the two-column layout a wider
 * flowing range now that the cap above lets it grow. It made things worse:
 * at 840px the case column is 518px against the 748px the same window gets
 * stacked, so widening the window past the breakpoint shrank the case by
 * 230px and made it 150px taller. The sidebar is a fixed 13rem, so every
 * pixel below 60rem comes out of the reading column. Left at 60rem. */
@media (max-width: 60rem) {
  .chat {
    grid-template-columns: 1fr;
    grid-template-areas: "aside" "case" "conversation";
    gap: 1rem;
  }
  /* The sidebar's `position: static` for this width belongs here with the
   * rest of the stacked layout, and cannot live here: the base `.sidebar`
   * rule further down sets `position: sticky` at the same specificity, and
   * the later rule wins. It is overridden just after that rule instead --
   * search for "Nothing to stick to up here". */
  /* Six names down the full width is a column of whitespace. Wrapped, they
   * are two short rows. */
  .rail ol { display: flex; flex-wrap: wrap; gap: .25rem 1rem; }
  /* The rail says where the learner is in words, and there is no column for
   * a picture of it at this width. */
  .sidebar .lens-wrap { display: none; }
}
/* Below the three-column width the picture and the case sit side by side at
 * the head of the conversation -- or, from 60rem, the picture inside the
 * case's corner (just below); the stacked phone layout puts the picture back
 * above the text (further down). */
@media (max-width: 46rem) {
  .case-col { display: block; }
  .case-figure { width: 9rem; margin: 0 0 .75rem; }
  /* Folded -- by the learner, or by app.js from view 2 on -- the case is one
   * line: a small picture of the patient beside its summary, so the face
   * stays in view and the current view is not a screen and a half down
   * (9 November 2026). */
  .case-col:has(> .case:not([open])) { display: flex; align-items: center; gap: .75rem; }
  .case-col:has(> .case:not([open])) > .case-figure { width: 3.25rem; margin: 0; flex: none; }
  .case-col:has(> .case:not([open])) > .case { flex: 1; min-width: 0; }
}

/* From 60rem up to the three columns -- 960px to 1280px wide -- the picture
 * sits in the open case card's top corner and the text wraps round it (29
 * October 2026). In a column of its own beside the card it left that column
 * empty under the picture for the whole length of the case: 515px of it at
 * 1100px, with the card 80px taller for being narrower, and the conversation
 * pushed down by the same.
 *
 * Only in this range, because only here do the lines under the picture stay
 * at the case's measure. The card is at most 808px wide here, so a full line
 * is at most the ~76 characters the chat shell's cap is chosen for. Below
 * 60rem the card is the width of the window, and at 959px a full line would
 * run to about 870px, some 87 characters.
 *
 * Only while the case is open, and the picture stays outside the card in the
 * markup: a collapsed case goes back to the picture beside it, so collapsing
 * the case still does not put the patient away. The float is inset by the
 * card's own padding and border so that it sits inside the card's edge; a
 * float paints over the card's background, and the card's lines wrap round
 * it. The summary is a flex box, which sits beside a float rather than
 * under it. */
@media (min-width: 60.001rem) and (max-width: 79.999rem) {
  .case-col:has(> .case[open]) { display: flow-root; }
  .case-col:has(> .case[open]) > .case-figure {
    float: left;
    width: 11rem;
    margin: calc(.85rem + 1px) 1.5rem .75rem calc(1.25rem + 1px);
  }
}

/* position: relative makes the list the containing block for the sr-only
 * state labels inside it; see .sr-only for what they did without it. */
.rail ol { list-style: none; margin: 0; padding: 0; font-size: .9rem; position: relative; }
/* Below 46rem the list is a strip that scrolls sideways, and app.js gives
 * it a tab stop while it does -- a box that scrolls but cannot be focused
 * cannot be scrolled from a keyboard. The stop needs a ring like any other. */
.rail ol:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.rail li {
  display: flex; gap: .6rem; align-items: baseline;
  padding: .4rem 0; color: var(--ink-faint);
}
/* Visited views are marked as visited, never as passed: a view can be left at
 * the probe cap without being passed, and the learner is not told which. */
.rail li::before {
  content: ""; flex: none;
  width: .55rem; height: .55rem; border-radius: 50%;
  border: 1.5px solid currentColor;
}
/* Above 60rem app.js builds each item as a disclosure -- the name is the
 * summary, the view's purpose is the panel, and the current one arrives open.
 * The dot stays on the li, so it keeps its baseline against the name and the
 * panel hangs below both. */
.rail details { flex: 1; min-width: 0; }
.rail summary {
  cursor: pointer;
  /* Kills the native triangle in Firefox; the ::-webkit- rule does WebKit.
   * The chevron below replaces it on the other side of the row, where it
   * cannot be read as a second status dot. */
  list-style: none;
  display: flex; align-items: baseline; gap: .5rem;
}
.rail summary::-webkit-details-marker { display: none; }
/* Empty alt text after the slash: without it a reader announces the glyph's
 * name before the view's. The state is already in the sr-only span. */
.rail summary::after {
  content: "\25BE" / "";
  margin-left: auto;
  /* .7em rendered a 10px triangle that read as a second, smaller dot rather
   * than as "this opens". Sized against the rail, not the row, so it does not
   * shrink further wherever the row does. */
  font-size: .8rem;
  /* currentColor, so the chevron carries the row's own state instead of
   * sitting at one faint grey against six different foregrounds. */
  transition: transform .15s ease;
}
.rail details:not([open]) summary::after { transform: rotate(-90deg); }
@media (prefers-reduced-motion: reduce) {
  .rail summary::after { transition: none; }
}
.rail summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
/* The current item is accent and 600 for its name; the prose under it must not
 * inherit either, or the reminder shouts louder than the rail it sits in. */
.rail details > p {
  margin: .45rem 0 .15rem;
  font-size: .85rem;
  line-height: 1.5;
  font-weight: 400;
  color: var(--ink-soft);
}
.rail li[data-state="visited"] { color: var(--ink-soft); }
.rail li[data-state="visited"]::before { background: currentColor; }
.rail li[data-state="current"] { color: var(--accent); font-weight: 600; }
/* The current dot is the lens's current side in small: maize, ringed in the
 * accent so it holds its edge on the maize-tinted row behind it. */
.rail li[data-state="current"]::before { background: var(--maize); border-color: var(--accent); }
/* Forced colours replace every fill with the page background, so all six
 * dots came out as the same empty ring and visited could not be told from
 * upcoming at all. Painted in system colours instead: filled for visited,
 * the highlight colour for current, an empty ring for the rest. */
@media (forced-colors: active) {
  .rail li::before { forced-color-adjust: none; border-color: CanvasText; background: Canvas; }
  .rail li[data-state="visited"]::before { background: CanvasText; }
  .rail li[data-state="current"]::before { background: Highlight; border-color: Highlight; }
}
/* In the column, the current view is a tinted row: the one place in the rail
 * the eye should land. Every row carries the same side padding, so the tinted
 * one's text stays aligned with the rows above and below without the tint
 * being pulled out past the column. Column only -- in the wrapped row and the
 * sideways strip below 60rem a tinted block would shove its neighbours
 * about. */
@media (min-width: 60.001rem) {
  .rail li { padding-inline: .75rem; }
  .rail li[data-state="current"] {
    background: var(--current-bg);
    border-radius: 12px;
    margin: .3rem 0;
    padding-block: .6rem;
  }
}

/* ---------------------------------------------------------------- lens -- */

/* Sides are coloured by the state their drawer gave them, and nothing else;
 * see the --lens-* tokens for why it is never the only carrier of any fact.
 * The stroke is the ground colour, which is what opens the gaps between
 * sides -- so anything drawing one on a card sets the stroke to the card. */
.lens { display: block; overflow: visible; }
.lens polygon {
  fill: var(--lens-upcoming);
  stroke: var(--page);
  stroke-width: 5;
  stroke-linejoin: round;
  transition: fill .6s ease;
}
.lens polygon[data-state="visited"],
.lens polygon[data-state="passed"],
.lens polygon[data-state="on"] { fill: var(--lens-visited); }
.lens polygon[data-state="current"] { fill: var(--lens-current); }
.lens polygon[data-state="capped"] { fill: var(--lens-capped); }
@media (prefers-reduced-motion: reduce) { .lens polygon { transition: none; } }

.lens-wrap {
  position: relative;
  width: 11rem;
  aspect-ratio: 1;
  margin: 0 auto 1.75rem;
  display: grid;
  place-items: center;
}
.lens-wrap .lens { position: absolute; inset: 0; width: 100%; height: 100%; }
.lens-count {
  position: relative;
  display: flex; flex-direction: column; align-items: center; gap: .35rem;
  line-height: 1;
}
.lens-count .n { font-family: var(--font-display); font-size: 2.6rem; font-weight: 500; }
.lens-count .of {
  font-family: var(--font-mono); font-size: .68rem;
  letter-spacing: .1em; text-transform: uppercase; color: var(--ink-faint);
}

/* Where the learner is, over the conversation. The rail says it too; this is
 * the version readable from across the room. It is the screen's h2, so the
 * h2 rules are reset here: the two lines inside carry their own type. */
.view-head { margin: 0 0 1.75rem; font-size: 1rem; line-height: 1.4; letter-spacing: normal; }
.view-title {
  display: block;
  font-family: var(--font-display); font-weight: 400;
  font-size: 2.4rem; line-height: 1.1; letter-spacing: -.02em;
  margin: .4rem 0 0;
}
@media (max-width: 46rem) {
  .view-head { margin-bottom: 1.25rem; }
  .view-title { font-size: 1.75rem; }
}

/* The heading again in one line, pinned to the top of the window once the
 * heading has scrolled up out of it (29 October 2026). app.js copies the
 * heading into it and adds .shown; see index.html for why it is aria-hidden.
 *
 * The wrapper is the sticky part and has no height, so it takes no room in
 * the column; the bar hangs below it, over the transcript, and is opaque so
 * the turns scroll out of sight under it. Sticky inside the conversation
 * column, so the bar is that column's width at every layout and never covers
 * the rail or the case beside it.
 *
 * This is also the only thing that holds the learner's place on a phone. The
 * rail's own sticky rule below 46rem lets go as soon as its column has
 * scrolled past, which is a few lines into the case. */
.view-pin { position: sticky; top: 0; height: 0; z-index: 5; }
.view-bar {
  display: flex; flex-wrap: wrap; align-items: center;
  justify-content: space-between; gap: .3rem 1.25rem;
  padding: .7rem 0 .6rem;
  background: var(--page);
  border-bottom: 1px solid var(--line);
  /* Hidden, not display:none: it keeps its size, and fades rather than
   * jumping in. visibility waits for the fade on the way out. */
  visibility: hidden; opacity: 0; transform: translateY(-.25rem);
  transition: opacity .15s ease, transform .15s ease, visibility 0s linear .15s;
}
.view-bar.shown {
  visibility: visible; opacity: 1; transform: none;
  transition: opacity .15s ease, transform .15s ease;
}
.view-bar-name { display: flex; align-items: baseline; flex-wrap: wrap; gap: 0 .75rem; min-width: 0; }
.view-bar-title {
  font-family: var(--font-display); font-weight: 400;
  font-size: 1.25rem; line-height: 1.2; letter-spacing: -.01em;
}
.view-bar .view-count { margin: 0; gap: .6rem; font-size: .85rem; }
@media (prefers-reduced-motion: reduce) {
  .view-bar, .view-bar.shown { transform: none; transition: none; }
}
@media (max-width: 46rem) {
  .view-bar { padding: .55rem 0 .5rem; }
  .view-bar-title { font-size: 1.1rem; }
  .view-bar .view-count { font-size: .8rem; }
}

/* The Case button, beside the pinned bar on a phone (9 November 2026; see
 * _view_head.html). It shows only while the bar does -- hidden, it is out of
 * the tab order too -- and the bar keeps room for it on the right. Above
 * 46rem the case is never far away, and the button is not drawn. */
.case-open { display: none; }
@media (max-width: 46rem) {
  .case-open {
    display: block; position: absolute; right: 0; top: .55rem; z-index: 1;
    font: 600 .85rem/1 var(--font-body);
    padding: .55rem .8rem; min-height: 2.25rem;
    color: var(--accent); background: var(--card);
    border: 1px solid var(--line-control); border-radius: 999px;
    cursor: pointer;
    visibility: hidden; opacity: 0;
    transition: opacity .15s ease, visibility 0s linear .15s;
  }
  .view-pin:has(> .view-bar.shown) > .case-open {
    visibility: visible; opacity: 1;
    transition: opacity .15s ease;
  }
  /* Room for it beside the view's name only: the name's row is as tall as
   * the button and leaves its width free, and the count has the whole width
   * of the row under it. */
  .view-pin:has(> .case-open) > .view-bar .view-bar-name {
    flex-basis: 100%; box-sizing: border-box;
    min-height: 2.25rem; align-items: center; padding-right: 6.5rem;
  }
  .case-open:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
}
@media (prefers-reduced-motion: reduce) {
  .case-open, .view-pin:has(> .view-bar.shown) > .case-open { transition: none; }
}

/* The case as a dialog: on a phone, a sheet the height of the window, its
 * text scrolling under a header that keeps Close in reach. */
.case-dialog {
  width: min(40rem, 100vw); max-width: 100vw;
  height: min(100dvh, 60rem); max-height: 100dvh;
  margin: auto; padding: 0;
  border: 0; border-radius: var(--radius-lg);
  background: var(--card); color: var(--ink);
}
.case-dialog[open] { display: flex; flex-direction: column; }
.case-dialog::backdrop { background: rgba(10, 20, 35, .55); }
.case-dialog-head {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: .75rem 1rem .75rem 1.25rem; border-bottom: 1px solid var(--line);
}
.case-dialog-head h2 { margin: 0; font-size: 1.35rem; }
.case-dialog-head h2:focus { outline: none; }
.case-dialog-body { flex: 1; overflow-y: auto; padding: 1rem 1.25rem 1.5rem; }
.case-dialog-body img {
  display: block; width: 100%; height: auto; max-height: 14rem; object-fit: cover;
  object-position: 50% 25%; margin: 0 0 1rem;
  border-radius: var(--radius-sm); border: 1px solid var(--line);
}
.case-dialog-body .case-body { margin-top: 0; }
@media (max-width: 46rem) {
  .case-dialog { width: 100vw; height: 100dvh; border-radius: 0; }
}
/* Forced colours keep the bar's background opaque, but its only edge against
 * the text scrolling under it is the border, so give that the system's text
 * colour rather than relying on the engine to force it. */
@media (forced-colors: active) {
  .view-bar { border-bottom-color: CanvasText; }
}
/* What the browser scrolls into view -- a new reply, a focused choice card
 * -- lands below the bar rather than under it, with room for a focus ring.
 * --view-bar-h is the bar's measured height (app.js); the fallback is a
 * one-line bar's. */
html:has(> body[data-screen="chat"]) {
  scroll-padding-top: calc(var(--view-bar-h, 3rem) + 1rem);
}
/* The short-window rule further down unpins the rail and the case, because
 * anything held at the top of a window this short takes too much of it. The
 * same goes for the bar. */
@media (max-height: 30rem) {
  .view-pin { display: none; }
  html:has(> body[data-screen="chat"]) { scroll-padding-top: 0; }
}
@media print { .view-pin { display: none; } }
/* Upcoming views used to be display:none below 46rem. That predated the
 * sideways-scrolling rail further down, and the two worked against each
 * other: the scroller exists so a row too long for the screen can still be
 * reached, and this removed two thirds of the row before it could be. It
 * cost more than room -- display:none takes the items out of the
 * accessibility tree too, so a nav announcing itself as "Progress through
 * the six views" offered two of them, and the "(not yet reached)" wording
 * app.js writes for each one was never read. All six stay; the rail scrolls,
 * and renderRail keeps the current one in view. */

/* The reminder for windows at or below 60rem, where the rail is a band above
 * the case and cannot hold the prose itself. Above 60rem app.js leaves this
 * hidden and the rail's own disclosures carry it -- see narrowRail there.
 *
 * Directly under the rail and ruled off from it: the two read as one block,
 * the rail naming the view and this saying what it is for.
 *
 * The eyebrow deliberately does not repeat the view's name. It sits under a
 * rail entry already in accent and bold, and at these widths the rail is a
 * wrapped row or a scrolling strip -- a second copy of "Human Experience View"
 * would be the same words twice within an inch. */
.view-purpose {
  margin-top: 1rem;
  padding-top: .9rem;
  border-top: 1px solid var(--line);
}
.view-purpose h2 {
  font-family: var(--font-mono); font-weight: 500;
  font-size: .72rem; letter-spacing: .1em;
  text-transform: uppercase; color: var(--ink-meta);
  margin: 0 0 .4rem;
}
.view-purpose p {
  margin: 0;
  font-size: .85rem;
  line-height: 1.5;
  color: var(--ink-soft);
}

/* The rail and the case follow the learner down the page. Six lenses over
 * fifteen-odd turns is a long scroll to lose your place in. */
.sidebar {
  position: sticky;
  top: 1.5rem;
  align-self: start;
  /* A grid item's automatic minimum size is its content, so without this the
   * sidebar refuses to be narrower than the rail's widest possible row. Below
   * 46rem that row is `white-space: nowrap` and 625px long, which pushed the
   * 1fr track to 625px on a 320px screen -- the case and the conversation
   * went with it, and the whole page scrolled sideways. The rail's own
   * overflow-x could never engage, because the rail was never the thing being
   * squeezed. Same reason .conversation and .eval-aside carry it.
   *
   * This was latent until the upcoming views stopped being display:none: two
   * items fit, six do not. */
  min-width: 0;
}
/* Nothing to stick to up here: stacked, the sidebar is a band above the case
 * rather than a column beside it, so there is nothing for it to follow.
 *
 * This has to sit after the rule above rather than up in the (max-width:
 * 60rem) block with the rest of the stacked layout, and that is not
 * cosmetic. Both selectors are `.sidebar`, so the cascade falls to source
 * order and the later one wins. Up there it was dead: between 46rem and
 * 60rem the sidebar stayed sticky inside a single-column grid and pinned
 * itself over the case the moment the learner scrolled -- a reload appeared
 * to fix it only because a page at scroll 0 has nothing to overlap yet. The
 * 46rem and max-height overrides below always worked for the same reason
 * this one now does: they come after. */
@media (max-width: 60rem) {
  .sidebar { position: static; }
}

/* At 400% zoom, or on a short landscape window, a sticky sidebar eats the
 * viewport it is pinned to. Let it scroll away instead. */
@media (max-height: 30rem) {
  .sidebar { position: static; }
  /* The case column likewise: capped to a viewport this short, it would be a
   * letterbox of a few lines. Let it run long and scroll with the page. */
  .case-col { position: static; max-height: none; overflow: visible; }
}

/* A card now that it leads the screen, rather than a bordered-off scrap in
 * the sidebar. The padding shrinks when collapsed so a closed case is a
 * single quiet line, not an empty box holding the conversation down. */
.case {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: .85rem 1.25rem;
}
.case[open] { padding-bottom: 1.25rem; }
.case > summary {
  cursor: pointer;
  font-size: .9rem;
  font-weight: 600;
  color: var(--accent);
  list-style: none;
  display: flex;
  align-items: center;
  gap: .45rem;
}
.case > summary::-webkit-details-marker { display: none; }
/* The empty alt text after the slash keeps the disclosure triangle decorative:
 * without it a screen reader reads the glyph's name out before "The case". */
.case > summary::before { content: "\25B8" / ""; }
.case[open] > summary::before { content: "\25BE" / ""; }
.case > summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
/* Beside the case, or at the top of its column on a wide window. Outside the
 * case card on purpose: collapsing the case to free up room should not also
 * put the patient away, and he is the thing the whole session is about. */
.case-figure { margin: 0 0 1.25rem; min-width: 0; }
.case-figure img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
}

/* Fills the card, and never scrolls inside it.
 *
 * The width cap was --measure, from when the case sat in the sidebar. Now
 * that it leads the screen as a full-width card, that cap left every line
 * stopping 97px short of the card's right edge -- a ragged column of text in
 * a box plainly wider than it. Nothing caps the text here any more; what
 * holds the measure is the chat shell's 68rem above, which is chosen so the
 * card hands the case ~76ch and no more.
 *
 * The height cap is gone with it. min(70vh, 34rem) resolved to 490px for
 * case01's 494px of text on a 700px-tall window: a scrollbar, a pair of
 * scroll shadows and a keyboard tab stop, all bought for the last sliver of
 * one line. The case is a <details> the learner can collapse in a click, and
 * that is the better escape hatch from a long case -- the same trade the
 * narrow layout below has always made. */
.case-body {
  margin-top: .8rem;
  /* Was .9rem, the smallest type on the screen, on the most-read text on it.
   * The size is also what lets the column be as wide as it now is: at .9rem
   * the case's 768px would run to ~85ch, and at 1rem it is ~76ch. Bigger type
   * and a wider column buy each other. */
  font-size: 1rem;
  /* The serif, like the guide: the case is written to be read, as the
   * coaching is, and the learner's own words are the sans beside both. */
  font-family: var(--font-display);
  line-height: 1.65;
}
/* max-width:none is doing the real work here. Clearing the cap on .case-body
 * alone only widened the container: the global `p { max-width: var(--measure) }`
 * still capped each paragraph inside it, so the box grew to the card's width
 * while the text stayed at 562px and the gap on the right survived untouched.
 * Measure the paragraph, not the wrapper, when checking this. */
.case-body p { margin-bottom: .7rem; max-width: none; }
.case-body p:last-child { margin-bottom: 0; }

@media (max-width: 46rem) {
  /* Stacked, the sidebar stays pinned to the top of the viewport instead of
   * the top of the column -- losing your place is the same problem on a
   * phone. It earns the space by staying to one short row: the rail scrolls
   * sideways rather than wrapping. The case now sits above it and scrolls
   * away, which is the right trade on a small screen -- it is a page of text
   * that would otherwise pin half the viewport for the whole session, and it
   * is one tap on the summary to get back. */
  /* The rail is what pins here, not the whole sidebar. With the patient in
   * it, a sticky sidebar would hold a picture at the top of a phone screen
   * for the entire session; this lets the image scroll away and keeps the
   * one-line rail.
   *
   * Measured 29 October 2026, it does not stay: a sticky box cannot leave its
   * parent, and the sidebar ends just below the rail, so the rail lets go
   * within a few lines of reaching the top (at 375px it was 1,160px above the
   * window by the start of the conversation). What holds the learner's place
   * on a phone is the pinned view bar, .view-pin. */
  .sidebar { position: static; }
  .rail {
    position: sticky;
    top: 0;
    z-index: 10;
    background: var(--page);
    padding: .6rem 0 .5rem;
    border-bottom: 1px solid var(--line);
  }
  /* The image stays in flow above the rail rather than floated beside it.
   * Floated, the sticky rail -- which needs an opaque background to cover
   * the text it pins over -- drew straight over the picture, leaving only
   * the strip that hung below it. In flow it simply scrolls away under the
   * rail, which is what sticky is for. */
  /* The scrollbar is left visible on purpose: hiding it left this strip
   * scrollable by touch and by nothing else. */
  .rail ol {
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: .15rem;
  }
  .rail li { white-space: nowrap; }
  /* The rail carries its own border-bottom once it is the sticky strip, so
   * this one's border-top would draw a second rule directly under it. The
   * block still reads as attached to the rail -- it is the next thing on the
   * screen -- so drop the rule and keep the gap tight. */
  .view-purpose { margin-top: .75rem; padding-top: 0; border-top: 0; }
  .case { padding: .7rem 1rem; }
  .case[open] { padding-bottom: 1rem; }
}
/* The (max-height: 30rem) rule above unpins the sidebar and the case at 400%
 * zoom, but the strip is pinned by the block just above, which comes later
 * and so wins. At 320x256 -- a 1280x1024 screen at 400% -- it held 62px, a
 * quarter of the window, over the conversation for the whole session. Here,
 * after it, so the short-window rule actually applies to it too.
 *
 * The same two cases -- that short window, and anything 20rem (320px) wide or
 * narrower -- also stop the strip being a one-line sideways scroller. At 320px
 * it was 895px long in a 280px box, so seeing how the later views stood meant
 * scrolling sideways, which WCAG 1.4.10 does not allow for a list (review of
 * 19 October 2026). There it wraps instead, and is not pinned: three or four
 * lines held at the top of a screen that small would cover too much of it. */
@media (max-width: 20rem), (max-width: 46rem) and (max-height: 30rem) {
  .rail { position: static; }
  .rail ol { flex-wrap: wrap; overflow-x: visible; }
  .rail li { white-space: normal; }
}

.conversation { min-width: 0; }

/* Two voices, told apart by type. The guide's turns are not boxed at all:
 * set in the serif at a reading size, they read as the page speaking. The
 * learner's are the sans in a maize-tinted card, pulled to the right. Each
 * still says who is speaking in words (.who), so nothing rests on the
 * typeface alone. */
.transcript { display: flex; flex-direction: column; gap: 1.75rem; margin-bottom: 1.5rem; }
.turn { border-radius: var(--radius); max-width: var(--measure); }
.turn.agent { padding: 0; }
.turn.agent p { font-family: var(--font-display); font-size: 1.25rem; line-height: 1.55; }
.turn.learner {
  background: var(--learner-bg);
  border: 1px solid transparent;
  border-radius: 18px 18px 6px 18px;
  padding: 1rem 1.25rem;
  align-self: flex-end;
  max-width: min(36rem, 100%);
}
/* Forced colours drop the tint, and with it the only edge the learner's turn
 * has. Give it a real one there, in the system's own text colour. */
@media (forced-colors: active) {
  .turn.learner { border-color: CanvasText; }
}
.turn p { margin: 0 0 .6rem; }
.turn p:last-child { margin-bottom: 0; }
.turn .who {
  display: flex; align-items: center; gap: .45rem;
  font-family: var(--font-mono); font-size: .7rem; letter-spacing: .12em;
  text-transform: uppercase; color: var(--ink-meta); margin-bottom: .45rem;
}
/* A small square in the accent before the guide's name: the same mark in the
 * same place on every guide turn, so a long scroll of them has a rhythm. */
.turn.agent .who::before {
  content: ""; width: .5rem; height: .5rem; border-radius: 2px;
  background: var(--accent);
}
@media (max-width: 46rem) {
  .transcript { gap: 1.25rem; }
  .turn.agent p { font-size: 1.125rem; }
}

.waiting { display: flex; align-items: center; gap: .6rem; color: var(--ink-faint); margin-bottom: 1rem; }
.waiting > .who { display: none; }
/* A reply on its way looks like the guide's next turn starting: the same
 * label a guide turn opens with, then the dots, in the place the reply will
 * take -- so when it lands nothing moves but the dots turning into words.
 * The label and square come from `.turn .who` above; `.waiting` is not a
 * turn, so they are restated for it here. */
/* The space above matches the gap between turns -- 1.75rem, or 1.25rem on a
 * phone -- so the reply's label lands where the indicator's was. It collapses
 * with the transcript's 1.5rem bottom margin: the larger of two positive
 * margins wins, and a negative one is subtracted, hence the two values. */
.waiting.reply {
  flex-direction: column; align-items: flex-start; gap: 0;
  margin-top: 1.75rem; margin-bottom: 1.5rem;
}
@media (max-width: 46rem) { .waiting.reply { margin-top: -.25rem; } }
.waiting.reply > .who {
  display: flex; align-items: center; gap: .45rem;
  font-family: var(--font-mono); font-size: .7rem; letter-spacing: .12em;
  text-transform: uppercase; color: var(--ink-meta); margin-bottom: .45rem;
}
.waiting.reply > .who::before {
  content: ""; width: .5rem; height: .5rem; border-radius: 2px;
  background: var(--accent);
}
.waiting-note {
  font-family: var(--font-body); font-size: .8rem; letter-spacing: 0;
  text-transform: none; color: var(--ink-faint);
}
.waiting.reply .dots { gap: .35rem; padding: .35rem 0 .1rem; }
.waiting.reply .dots i { width: .55rem; height: .55rem; }
.waiting.reply #waiting-text { display: none; }
.dots { display: inline-flex; gap: .25rem; }
.dots i {
  width: .4rem; height: .4rem; border-radius: 50%;
  background: currentColor; animation: pulse 1.2s infinite ease-in-out;
}
.dots i:nth-child(2) { animation-delay: .18s; }
.dots i:nth-child(3) { animation-delay: .36s; }
@keyframes pulse { 0%, 60%, 100% { opacity: .25; } 30% { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .dots i { animation: none; opacity: .6; } }

/* The composer is one card: the textarea sits borderless inside it, and the
 * card takes the focus ring when anything in it has focus -- so the ring goes
 * round everything the learner is working with, send button included. */
.composer {
  background: var(--card);
  border: 1px solid var(--line-control);
  border-radius: var(--radius-lg);
  padding: .75rem .85rem .65rem 1.1rem;
  box-shadow: var(--shadow-md);
}
.composer:focus-within { outline: 2px solid var(--accent); outline-offset: 2px; }
.composer textarea {
  border: 0;
  border-radius: 0;
  padding: .3rem 0;
  background: transparent;
}
.composer textarea:focus-visible { outline: none; }
/* The error states itself in words above the form; this is the edge a
 * sighted learner sees on the box it belongs to. */
.composer:has(textarea[aria-invalid="true"]) { border-color: var(--danger); }
.composer-foot {
  display: flex; justify-content: space-between; align-items: center;
  gap: 1rem; margin-top: .35rem;
}
.composer-foot .hint { margin: 0; }
/* The final step's button says what it does in four words (setFinalStep in
 * app.js), and squeezed in beside the hint it broke one word to a line on a
 * phone. In that step the two may wrap: the hint keeps a line of its own and
 * the button sits under it, at the right. */
.composer.final .composer-foot { flex-wrap: wrap; }
.composer.final .composer-foot .primary { margin-left: auto; }

/* --------------------------------------------------------- evaluation -- */

/* The coaching walks through the session lens by lens, so the transcript sits
 * beside it: being told what to do differently is easier to act on next to
 * what you actually wrote. */
.eval-body {
  display: grid;
  grid-template-columns: 1fr 22rem;
  gap: 2.5rem;
  align-items: start;
}
@media (max-width: 62rem) { .eval-body { grid-template-columns: 1fr; gap: 1.5rem; } }

.eval-aside { position: sticky; top: 1.5rem; min-width: 0; }
@media (max-width: 62rem) { .eval-aside { position: static; } }
.eval-aside h2 {
  font-family: var(--font-mono); font-weight: 500;
  font-size: .72rem; letter-spacing: .1em; text-transform: uppercase;
  color: var(--ink-meta); margin-bottom: .75rem;
}
.eval-aside .transcript { gap: 1rem; }
.eval-aside .turn { font-size: .85rem; max-width: none; }
.eval-aside .turn.learner { padding: .7rem .85rem; }
.eval-aside .turn.agent p { font-size: 1rem; }
.lens-marker {
  margin: 1.25rem 0 .25rem;
  font-family: var(--font-mono);
  font-size: .7rem; letter-spacing: .1em; text-transform: uppercase;
  color: var(--accent); font-weight: 500;
  border-top: 1px solid var(--line); padding-top: .75rem;
}
.transcript > .lens-marker:first-child { margin-top: 0; border-top: 0; padding-top: 0; }
.eval-aside .turn.learner { align-self: stretch; }

.scroller {
  max-height: 68vh;
  overflow-y: auto;
  padding-right: .6rem;
}
/* This box scrolls and holds no focusable content, so it is given
 * tabindex="0" in the markup; that tab stop has to be visible when it lands. */
.scroller:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
@media (max-width: 62rem) { .scroller { max-height: 40vh; } }

/* The result, large, with the lens beside it. The h1 is the eyebrow ("Your
 * evaluation") so that is what a screen reader lands on and announces; the
 * tier is the display line under it. */
.eval-hero {
  display: grid;
  grid-template-columns: 13rem minmax(0, 1fr);
  gap: 3rem;
  align-items: center;
  margin-bottom: 3rem;
}
.eval-hero .lens-wrap { width: 13rem; margin: 0; }
@media (max-width: 46rem) {
  .eval-hero { grid-template-columns: 1fr; gap: 1.5rem; margin-bottom: 2rem; }
  .eval-hero .lens-wrap { width: 8rem; }
}
.tier-display {
  font-family: var(--font-display);
  font-size: clamp(2.25rem, 4vw + 1rem, 3.75rem);
  font-weight: 500;
  line-height: 1.05;
  letter-spacing: -.025em;
  margin: .5rem 0 1.25rem;
  max-width: none;
}

/* Where the tier sits among the three. The current step is marked three ways
 * -- a filled bar, bold accent text and aria-current -- so no one of them has
 * to carry it alone. */
.tier-track {
  list-style: none; padding: 0; margin: 0 0 1.5rem;
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .4rem;
  max-width: 40rem;
}
.tier-track li { display: flex; flex-direction: column; gap: .5rem; margin: 0; }
.tier-track .bar { height: .5rem; border-radius: 999px; background: var(--line); }
.tier-track .label { font-size: .85rem; line-height: 1.35; color: var(--ink-faint); }
.tier-track li[aria-current] .bar { background: var(--accent); }
.tier-track li[aria-current] .label { color: var(--accent); font-weight: 600; }
/* The empty bars are --line, which is decorative and exempt; give them a real
 * edge where forced colours would otherwise leave three identical blanks. */
@media (forced-colors: active) {
  .tier-track .bar { border: 1px solid CanvasText; }
  .tier-track li[aria-current] .bar { background: Highlight; }
}

/* A <dl>, each pill a <div> holding its <dt> and <dd>. As spans in divs the
 * four pills on the review page reached a screen reader as one run of words
 * -- "Overall Needs Improvement Best next step Strong Observations credited
 * 12 / 21" -- with nothing to say which value went with which name. */
.ratings { display: flex; gap: .75rem; flex-wrap: wrap; margin: 0; }
.rating .v { margin: 0; }
.rating {
  display: inline-flex; align-items: baseline; gap: .6rem;
  padding: .5rem 1rem;
  background: var(--card);
  border: 1px solid var(--line-control);
  border-radius: 999px;
}
.rating .k { font-size: .9rem; color: var(--ink-soft); }
.rating .v { font-weight: 600; color: var(--accent); }

/* Done, under the evaluation: the way on to the closing screen. */
.eval-done { margin: 1.5rem 0 1rem; }

/* ----------------------------------------------------------- sections -- */

/* A long page folded into a column of headings (20 October 2026, mockup B):
 * the learner's evaluation, built by app.js (fillFeedback), and the
 * instructor's session page, rendered folded by review/detail.html. Each
 * heading is an h2 holding a button -- the disclosure pattern that keeps
 * heading navigation working, which a <summary> does not in every screen
 * reader. The line at the right of a heading says what is inside, so a
 * closed section is not a guess. The first section starts open.
 *
 * --ink-soft on --card, the hint's colour, is 7.58:1 light and 8.42:1 dark;
 * the chevron is --accent, 14.54:1 light and 10.63:1 dark on --card (WCAG 2
 * formula, computed 20 Oct 2026). It repeats what aria-expanded and the
 * open section already say. */
p.acc-tools { display: flex; justify-content: flex-end; margin: 0 0 .5rem; max-width: none; }
.card.acc { padding: 0; overflow: hidden; }
.acc-item + .acc-item, .acc-lead + .acc-item { border-top: 1px solid var(--line); }
.acc-lead { padding: 1.5rem 1.75rem .5rem; }
.acc .acc-head { margin: 0; font-size: inherit; line-height: inherit; }
.acc-btn {
  display: flex; align-items: center; gap: 1rem; width: 100%;
  margin: 0; padding: 1.15rem 1.75rem; min-height: 2.75rem;
  font: inherit; color: var(--ink); text-align: left;
  background: none; border: 0; border-radius: 0; cursor: pointer;
}
.acc-title {
  flex: 1; min-width: 0;
  font: 500 1.35rem/1.25 var(--font-display); letter-spacing: -.015em;
}
.acc-btn:hover .acc-title { color: var(--accent); }
.acc-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: -4px; }
.acc-hint { font: 500 .9rem/1.3 var(--font-body); color: var(--ink-soft); text-align: right; }
.chev {
  flex: none; width: .6rem; height: .6rem; margin-right: .2rem;
  border-right: 2px solid var(--accent); border-bottom: 2px solid var(--accent);
  transform: translateY(-3px) rotate(45deg);
}
.acc-btn[aria-expanded="true"] .chev { transform: translateY(2px) rotate(-135deg); }
@media (prefers-reduced-motion: no-preference) {
  .chev { transition: transform .15s ease; }
}
.acc-body { padding: 0 1.75rem 1.5rem; }
@media (max-width: 46rem) {
  /* The hint drops under the title, so a long title is not squeezed. */
  .acc-btn { flex-wrap: wrap; gap: .2rem .75rem; padding: 1rem 1.1rem; }
  .acc-title { flex-basis: calc(100% - 2rem); font-size: 1.2rem; }
  .chev { order: 2; }
  .acc-hint { order: 3; flex-basis: 100%; text-align: left; }
  .acc-body { padding: 0 1.1rem 1.25rem; }
  .acc-lead { padding: 1.25rem 1.1rem .25rem; }
}
/* On paper nothing can be opened, so everything is. After the [hidden] rule
 * at the top of this file, and more specific, so it wins. */
@media print {
  .acc-body[hidden] { display: block !important; }
  .acc-tools, .chev { display: none !important; }
}

/* ------------------------------------------------------------ consent -- */

/* The introduction on the left, the case and the consent card on the right.
 * Stacked below 62rem, introduction first, as it is in the document. */
.consent {
  grid-template-columns: minmax(0, 1fr) minmax(0, 32rem);
  gap: 4rem;
  align-items: start;
}
@media (max-width: 62rem) {
  .consent { grid-template-columns: minmax(0, 1fr); gap: 2.5rem; }
}

/* The headline at the size the sign-in page uses for the same line. At the
 * one display size (4.25rem) it took three lines and, with the six views as
 * tall cards under it, put Begin about 1,390px down a 1440x900 window
 * (design review, 9 November 2026). */
.consent .display { font-size: clamp(2.4rem, 2.2vw + 1.25rem, 3.4rem); max-width: none; }
.consent .display em { display: block; }

.views-intro { margin-top: 2.25rem; }
.views-intro .eyebrow { margin-bottom: .5rem; }
/* The six views as a list, two to a row: the same names, order and purposes
 * the cards had, without the card around each. */
.view-list {
  list-style: none; margin: 0; padding: 0; max-width: none;
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 2rem;
}
.view-list li {
  display: grid; grid-template-columns: 2.25rem minmax(0, 1fr);
  gap: .1rem .85rem; align-content: start;
  margin: 0; padding: .85rem 0; border-top: 1px solid var(--line);
}
.view-list li:nth-child(-n+2) { border-top: 0; padding-top: .25rem; }
.view-list .lens-glyph { grid-row: 1 / span 2; margin-top: .15rem; }
/* On the page now, not on a card: the gaps between sides are the page's. */
.view-list .lens-glyph polygon { stroke: var(--page); }
.view-list h3 {
  font-family: var(--font-display); font-weight: 500;
  font-size: 1.15rem; line-height: 1.25; letter-spacing: -.01em; margin: 0;
}
.view-list p { margin: 0; font-size: .88rem; line-height: 1.5; color: var(--ink-soft); }
@media (max-width: 40rem) {
  .view-list { grid-template-columns: minmax(0, 1fr); }
  .view-list li:nth-child(2) { border-top: 1px solid var(--line); padding-top: .85rem; }
}
.view-num {
  font-family: var(--font-mono); font-size: .72rem; letter-spacing: .05em;
  color: var(--accent); margin-right: .45rem; vertical-align: .15em;
}
/* Small, so the empty sides are a shade darker than in the big lens: with the
 * page's pale --lens-upcoming a 36px ring of five blanks and one filled side
 * read as a loading spinner, not as one side of a shape. */
.lens-glyph { width: 2.25rem; height: 2.25rem; }
.lens-glyph polygon { stroke: var(--card); stroke-width: 8; }
.lens-glyph polygon[data-state="off"] { fill: #d6d1c4; }
@media (prefers-color-scheme: dark) {
  .lens-glyph polygon[data-state="off"] { fill: #3a414a; }
}
/* The case as a row: a thumbnail, and its title with the course over it.
 * The full picture waits for the session, where it stays beside the
 * conversation. With no picture the caption takes the whole row. */
.case-card {
  display: flex; gap: 1rem; align-items: center;
  margin: 0 0 1rem; padding: .75rem;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
}
.case-card img {
  flex: none; display: block; width: 6.5rem; height: 5rem;
  object-fit: cover; object-position: 50% 25%; border-radius: 12px;
}
.case-card figcaption { display: flex; flex-direction: column; gap: .2rem; min-width: 0; padding: .25rem .5rem; }
.case-card-title {
  font-family: var(--font-display); font-size: 1.2rem; line-height: 1.25;
  font-weight: 500; letter-spacing: -.01em;
}

.consent-card { margin-bottom: 0; }
.consent-card h2 { font-size: 1.65rem; }
.consent-card .lead { font-size: .98rem; margin: 0 0 1rem; }
/* What is being consented to, as three labelled facts: who can read it, what
 * is recorded, how long it is kept. A description list, so each value is
 * read with its name. */
.facts { margin: 0 0 1rem; display: grid; gap: .7rem; }
.fact {
  display: grid; grid-template-columns: 2.25rem minmax(0, 1fr);
  gap: .1rem .85rem; align-items: start;
}
.fact .icon {
  grid-row: 1 / span 2; box-sizing: border-box;
  width: 2.25rem; height: 2.25rem; padding: .55rem;
  border-radius: 10px; background: var(--tile);
  fill: none; stroke: var(--accent); stroke-width: 1.8;
  stroke-linecap: round; stroke-linejoin: round;
}
.fact dt { font-weight: 600; font-size: .92rem; line-height: 1.35; }
.fact dd { margin: 0; font-size: .88rem; line-height: 1.45; color: var(--ink-soft); }
.aside-note {
  margin: 0 0 1.25rem;
  padding: .9rem 1rem;
  border-radius: 12px;
  background: var(--page);
  font-size: .88rem; line-height: 1.5; color: var(--ink-soft);
}
.aside-note strong { color: var(--ink); }
/* The consent box at a size that can be found and hit: 18px, in the accent,
 * not the browser's 13px default. */
.consent-card .check input,
.group-consent .check input { width: 1.15rem; height: 1.15rem; margin-top: .2rem; accent-color: var(--accent); }

/* ------------------------------------------------------------ sign-in -- */

/* The first page anyone sees, and the one place the exercise is described
 * before it asks for anything. It speaks the consent screen's language a page
 * early -- the serif display line, the lens as the mark -- so signing in and
 * starting read as one product rather than as a form stood in front of one.
 * It used to borrow the review pages' card, which is why it looked like an
 * admin screen. */
body[data-screen="signin"] .shell { max-width: 76rem; padding-top: 4rem; }

.front {
  display: grid;
  grid-template-columns: minmax(0, 28rem) minmax(0, 1fr);
  gap: 3.25rem;
  align-items: center;
}
.front .eyebrow { margin-bottom: 1.1rem; }
/* Two lines by construction rather than by wrapping: the italic line is its
 * own block, so it never breaks mid-phrase at some width in between. Sized so
 * "One case. Six views." holds one line in the 28rem column. */
.front .display { font-size: clamp(2.4rem, 2.2vw + 1.25rem, 3.4rem); max-width: none; }
.front .display em { display: block; }
.front .lede { font-size: 1.15rem; }

.signin {
  display: flex; flex-wrap: wrap; align-items: center;
  gap: .75rem 1.25rem;
  margin-top: 2.25rem;
}
.signin p { margin: 0; }
.signin .hint { font-size: .9rem; }
/* The page's one action, a size up from the buttons inside the exercise. */
.signin a.primary { padding: .95rem 1.7rem; font-size: 1.05rem; border-radius: 14px; }

/* The lens, large, with the six views set round it in the order they run:
 * the first at the top right, then clockwise, the way the sides fill. */
.orbit-card {
  padding: 2rem 1.75rem 2.5rem;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 28px;
  box-shadow: var(--shadow-md);
}
.orbit-card > .eyebrow { text-align: center; margin-bottom: 1.75rem; }
.orbit { position: relative; }
/* Three columns with the middle one left empty for the lens. The lens is
 * centred over it rather than placed in it, so the list stays one list:
 * `display: contents` on the <ol> would have let the lens into this grid, at
 * the price of the list's semantics in some browsers. */
.orbit ol {
  list-style: none; margin: 0; padding: 0; max-width: none;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 16rem minmax(0, 1fr);
  grid-template-rows: repeat(3, auto);
  align-items: center;
  gap: 2.4rem 1.25rem;
  min-height: 16rem;
}
.orbit li { margin: 0; display: flex; flex-direction: column; gap: .1rem; }
/* 01-03 down the right, 04-06 back up the left: clockwise from the top. */
.orbit li:nth-child(-n + 3) { grid-column: 3; }
.orbit li:nth-child(n + 4) { grid-column: 1; text-align: right; align-items: flex-end; }
.orbit li:nth-child(1), .orbit li:nth-child(6) { grid-row: 1; }
.orbit li:nth-child(2), .orbit li:nth-child(5) { grid-row: 2; }
.orbit li:nth-child(3), .orbit li:nth-child(4) { grid-row: 3; }
.orbit .lens-wrap {
  position: absolute; left: 50%; top: 50%;
  width: 16rem; margin: 0;
  transform: translate(-50%, -50%);
}
/* On the card, so the gaps between sides are cut in card colour. */
.orbit .lens polygon { stroke: var(--card); stroke-width: 4; }
.orbit .lens-count .n { font-size: 3rem; color: var(--accent); }
.orbit .num { font-family: var(--font-mono); font-size: .72rem; letter-spacing: .1em; color: var(--accent); }
.orbit .name {
  font-family: var(--font-display); font-weight: 500;
  font-size: 1.3rem; line-height: 1.2; letter-spacing: -.01em;
}
.orbit .gloss { font-size: .85rem; line-height: 1.4; color: var(--ink-soft); }
/* Why the first side is lit, in words -- the lens never carries a fact
 * alone. The current view's own tint and ink, as in the rail: 13.1:1, and
 * 9.8:1 in dark mode. */
.orbit .start {
  align-self: flex-start;
  margin-top: .3rem;
  padding: .12rem .5rem;
  border-radius: 999px;
  background: var(--current-bg);
  color: var(--accent);
  font-family: var(--font-mono); font-size: .68rem;
  letter-spacing: .1em; text-transform: uppercase;
}

/* How a session goes, in three steps. Its heading is for a screen reader
 * moving by heading; to the eye the rule and the step labels say it. */
.steps {
  list-style: none; margin: 4.5rem 0 0; padding: 2.25rem 0 0; max-width: none;
  border-top: 1px solid var(--line);
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 2.5rem;
}
.steps li { margin: 0; }
.steps h3 {
  font-family: var(--font-display); font-weight: 500;
  font-size: 1.35rem; line-height: 1.25; letter-spacing: -.01em;
  margin: .45rem 0 .4rem;
}
.steps p { margin: 0; font-size: .95rem; color: var(--ink-soft); }

/* Where to write with a question or a problem. The same width and side
 * padding as the page above it, so the line starts where the content does. */
.site-footer { border-top: 1px solid var(--line); }
.site-footer p {
  max-width: 76rem;
  margin: 0 auto;
  padding: 1.5rem 1.25rem 2.5rem;
  font-size: .9rem;
  color: var(--ink-soft);
}
.site-footer a { color: var(--accent); text-underline-offset: 3px; }
.site-footer a:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

/* Stacked well before the steps are: the ring needs room either side of it
 * for the names. Side by side at 1024px the card left each name a 66px
 * column, four lines of gloss apiece; stacked, the same window gives the
 * whole card to the ring. Measured, not guessed. */
@media (max-width: 75rem) {
  .front { grid-template-columns: minmax(0, 1fr); gap: 3rem; }
}
@media (max-width: 62rem) {
  .steps { grid-template-columns: minmax(0, 1fr); gap: 1.5rem; margin-top: 3rem; }
}
/* A phone: the button first and full width, then the views as two columns
 * under a smaller lens. There is no room to set six names round a ring. */
@media (max-width: 40rem) {
  body[data-screen="signin"] .shell { padding-top: 2rem; }
  .front .display { font-size: 2.6rem; }
  .front .lede { font-size: 1.05rem; }
  .signin a.primary { width: 100%; }
  .orbit-card { padding: 1.5rem 1.25rem 1.75rem; border-radius: 22px; }
  /* Back in the flow above the list. Relative, not static: the ring inside
   * is absolutely positioned against this box, and a static box hands that
   * job to .orbit -- which drew the ring across the whole list. */
  .orbit .lens-wrap {
    position: relative; left: auto; top: auto; transform: none;
    width: 9rem; margin: 0 auto 1.25rem;
  }
  /* Top-aligned: centred rows were only for lining names up with the
   * ring's sides, and here a pair with one tall cell left the other
   * floating halfway down it. */
  .orbit ol {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    grid-template-rows: none;
    align-items: start;
    gap: 1.1rem 1rem;
    min-height: 0;
  }
  .orbit li:nth-child(n) { grid-column: auto; grid-row: auto; text-align: left; align-items: flex-start; }
  .orbit .name { font-size: 1.1rem; }
  .orbit .lens-count .n { font-size: 2rem; }
}

/* ------------------------------------------- counts, moving on, challenges -- */

/* Since 9 October 2026 the learner sees how many of a view's key points they
 * have found. Counts only: the server never sends which points they are.
 * Every count is said in words, so nothing here rests on colour. */

/* The labels under a guide reply: what the last move earned. */
.receipt { display: flex; flex-wrap: wrap; gap: .4rem; margin: .75rem 0 0; }
.pill {
  font: 600 .8rem/1.3 var(--font-body);
  padding: .3rem .7rem; border-radius: 999px;
  border: 1px solid var(--line-control); background: var(--card); color: var(--ink);
}
/* --accent on --accent-tint is 12.36:1 light, 9.49:1 dark; --danger on --card
 * is 6.77:1 light, 6.06:1 dark (WCAG 2 formula, computed 13 Oct 2026). */
.pill.ok { background: var(--accent-tint); border-color: transparent; color: var(--accent); }
.pill.warn { border-color: var(--danger); color: var(--danger); }
@media (forced-colors: active) {
  .pill, .pill.ok { border-color: CanvasText; }
}

/* A button press -- moved on, no challenge -- as a quiet line, not a bubble. */
.turn.action {
  align-self: flex-end; color: var(--ink-faint);
  font: italic .9rem var(--font-body);
}
.turn.learner.challenge { border-color: var(--line-control); }

/* The count beside each name in the rail. */
.rail-count {
  margin-left: .5rem; font: 600 .78rem var(--font-mono);
  letter-spacing: 0; text-transform: none; color: var(--ink-soft);
}

/* Under the view's name: a strip of one segment per key point, a maize mark
 * where the minimum falls, and the same numbers in words. */
.view-count {
  display: flex; align-items: center; gap: .75rem; flex-wrap: wrap;
  margin-top: .6rem; font: 500 .95rem var(--font-body); color: var(--ink-soft);
}
.meter { display: inline-flex; gap: 4px; align-items: center; }
.meter i {
  width: 20px; height: 9px; border-radius: 3px; position: relative;
  background: var(--lens-upcoming);
}
.meter i.on { background: var(--accent); }
.meter i.min::after {
  content: ""; position: absolute; right: -3px; top: -5px; bottom: -5px;
  width: 2px; background: var(--maize);
}
@media (forced-colors: active) {
  .meter i { forced-color-adjust: none; border: 1px solid CanvasText; background: Canvas; }
  .meter i.on { background: CanvasText; }
}

/* The choices under the last reply: three cards -- add more key points,
 * challenge, move on -- each saying what it does and what it costs (16 October 2026,
 * mockup C). The text carries every state; the dashed border of a choice that
 * is not open yet, and the tinted fill of the one whose box is open, repeat
 * what it says. The move card is filled navy whenever it can be taken, and
 * its fill and edge are the same whether or not the minimum has just been
 * reached (20 October 2026: a heavier outline at that moment read as the
 * page choosing); only its "✓ Minimum reached" line turns green. */
.decision { max-width: var(--measure); margin: -.5rem 0 1.25rem; }
.decision .eyebrow { margin: 0 0 .55rem; }
.choices { display: grid; grid-template-columns: repeat(3, 1fr); gap: .65rem; }
.choice {
  display: flex; flex-direction: column; gap: .3rem;
  margin: 0; padding: .85rem .95rem .9rem; text-align: left;
  font: inherit; color: var(--ink); background: var(--card);
  border: 1.5px solid var(--line-control); border-radius: var(--radius);
  box-shadow: var(--shadow-sm); cursor: pointer;
}
.choice:hover:not([aria-disabled="true"]) { border-color: var(--accent); }
.choice:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.choice-title { font: 600 1.05rem/1.2 var(--font-display); color: var(--accent); }
.choice-body { font-size: .9rem; line-height: 1.35; color: var(--ink-soft); }
.choice-meta {
  margin-top: auto; padding-top: .35rem;
  font: 600 .82rem/1.3 var(--font-body); color: var(--ink-soft);
}
/* A card not open yet has no fill, so its --ink-soft text is on --page,
 * 6.89:1 light, 9.6:1 dark (WCAG 2 formula, computed 16 Oct 2026). */
.choice.next:not([aria-disabled="true"]) {
  background: var(--next-fill); border-color: var(--next-edge);
}
.choice.next:not([aria-disabled="true"]):hover { background: var(--next-hover); }
.choice.next:not([aria-disabled="true"]) :is(.choice-title, .choice-body, .choice-meta) {
  color: #ffffff;
}
.choice.next:not([aria-disabled="true"]) .choice-meta .ok { color: var(--next-ok); }
/* The arrow follows the last word of the line under the title, the one
 * naming where the card goes, rather than sitting on the title's own line,
 * so the title has the card's whole width (20 October 2026). With no space
 * before it, it wraps together with that word instead of on its own. A line
 * height of 0 keeps the large glyph from making the line taller. */
.choice-arrow { font: 600 2.25rem/0 var(--font-body); margin-left: .35rem; vertical-align: -.06em; }
.choice[aria-expanded="true"] {
  border-color: var(--accent); background: var(--accent-tint);
  box-shadow: inset 0 0 0 1px var(--accent);
}
/* Not open yet. Still a focusable button (aria-disabled, not disabled), so a
 * keyboard or screen reader finds it and hears why. */
.choice[aria-disabled="true"] {
  cursor: not-allowed; background: transparent; border-style: dashed; box-shadow: none;
}
.choice[aria-disabled="true"] .choice-title { color: var(--ink-soft); }
/* Forced colours drop the navy fill; the card keeps its border like the
 * others, and its words say what it does.
 *
 * The arrow gets its line height back there. In forced colours the browser
 * paints a solid backplate behind each run of text, sized from the font
 * rather than the line, so the 2.25rem arrow on its zero-height line painted
 * one over the title above it: "Proceed to next view" showed only the tops of
 * its letters (Chromium, measured 20 October 2026). */
@media (forced-colors: active) {
  .choice[aria-expanded="true"] { border-width: 3px; }
  .choice-arrow { line-height: normal; }
}
@media (max-width: 46rem) {
  /* Stacked, one row each, with what it costs at the right: three tall
   * cards would push the response box a screen down after every reply. */
  .choices { grid-template-columns: 1fr; gap: .5rem; }
  .choice {
    display: grid; grid-template-columns: 1fr auto; column-gap: .75rem;
    padding: .7rem .9rem;
  }
  .choice-meta {
    grid-column: 2; grid-row: 1 / span 2; align-self: center;
    margin: 0; padding: 0; text-align: right; max-width: 9rem;
  }
}

/* The challenge form, opened from its card. */
.challenge-form {
  margin-top: .75rem; padding: 1rem 1.1rem;
  border-radius: var(--radius); background: var(--panel); border: 1px solid var(--line);
}
.challenge-form h3 { font: 600 1.15rem/1.3 var(--font-display); margin: 0 0 .3rem; }
.challenge-form .hint { margin: 0 0 .75rem; }
.challenge-form textarea { margin: 0 0 .85rem; }
.decision-row { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; }
.decision-row .hint { margin: 0 0 0 .25rem; }

button.secondary {
  font: inherit; font-weight: 600;
  min-height: 2.75rem; padding: .65rem 1.2rem; border-radius: 12px;
  background: var(--card); color: var(--ink);
  border: 1.5px solid var(--line-control); cursor: pointer;
}
button.secondary:hover:not(:disabled) { border-color: var(--accent); }
button.secondary:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
button.secondary:disabled { opacity: .45; cursor: not-allowed; }
@media (max-width: 46rem) {
  .decision-row button { width: 100%; }
}

/* A course link's page (roster/join.html): one card, what joining means,
 * and the one button. The card's own width rather than the shell's, so the
 * two sentences that matter stay a readable line long. */
.join-card { max-width: 36rem; margin: 1rem auto 0; }
.join-card h1 { font-size: 2rem; }
.join-card .course-facts { margin: 0 0 1.25rem; color: var(--ink-soft); }
.join-card ul.terms { margin: 0 0 1.5rem; padding-left: 1.2rem; }
.join-card ul.terms li { margin-bottom: .5rem; max-width: 60ch; }
.join-card .after { margin-top: 1rem; text-align: center; }

/* ---------------------------------------------------------------------------
 * The group page (group.html, group.js; build plan step 4, direction A:
 * rounds in the conversation, chosen 4 November 2026). The exercise page's
 * layout and voices, with the group's parts added: who is here, each round's
 * posts under their writers' names, the round being gathered, the votes.
 * ------------------------------------------------------------------------ */

/* The consent card stands alone here: one column, not the exercise's two. */
.group-consent .consent-card { max-width: 40rem; margin-inline: auto; }
.gc-case { display: flex; align-items: center; gap: 1rem; margin: .75rem 0 1rem; }
.gc-case img { width: 7rem; border-radius: var(--radius); border: 1px solid var(--line); }
.gc-title { margin: 0; font: 600 1.2rem/1.3 var(--font-display); }

/* Who is here, pinned at the top of the conversation -- under the view's
 * pinned bar once that shows. Words carry every state; the dot repeats it. */
.who-bar {
  position: sticky; top: 0; z-index: 4;
  display: flex; flex-wrap: wrap; gap: .45rem;
  margin: 0 0 1rem; padding: .5rem 0; background: var(--page);
}
.group-chat:has(.view-bar.shown) .who-bar { top: var(--view-bar-h, 0); }
.who-bar .member {
  display: inline-flex; align-items: center; gap: .3rem;
  padding: .3rem .7rem; border: 1px solid var(--line); border-radius: 999px;
  background: var(--card); font-size: .85rem; color: var(--ink);
}
.who-bar .member.away { color: var(--ink-faint); background: transparent; }
.who-bar .what { color: var(--ink-faint); font-size: .8rem; }
/* What is scrolled to or focused lands below both pinned bars, not under
 * them. --who-bar-h is the strip's measured height (group.js). */
html:has(> body[data-screen="chat"] .who-bar) {
  scroll-padding-top: calc(var(--view-bar-h, 3rem) + var(--who-bar-h, 3rem) + 1rem);
}
/* On a phone the view's bar and the strip together took two fifths of the
 * screen. The strip stays at the top of the conversation instead; each
 * round's box already says who has posted, passed, is typing or is away. */
@media (max-width: 46rem) {
  .who-bar { position: static; }
  html:has(> body[data-screen="chat"] .who-bar) {
    scroll-padding-top: calc(var(--view-bar-h, 3rem) + 1rem);
  }
}
@media (max-height: 30rem) {
  html:has(> body[data-screen="chat"] .who-bar) { scroll-padding-top: 0; }
  .who-bar { position: static; }
}
.dot { display: inline-block; width: .55rem; height: .55rem; border-radius: 50%;
  flex: none; background: var(--success); }
.dot.away { background: transparent; border: 1.5px solid var(--line-control); }
@media (forced-colors: active) {
  .dot { background: CanvasText; }
  .dot.away { background: Canvas; border-color: CanvasText; }
}

/* A sent round: its posts, each under its writer's name, together. Your own
 * on the right in the learner's tint, as on the exercise page; the others'
 * on the left. */
.round-done { display: flex; flex-direction: column; gap: .9rem;
  border-left: 3px solid var(--line); padding-left: 1rem; }
.turn.learner.other {
  align-self: flex-start; background: var(--card); border: 1px solid var(--line);
  border-radius: 18px 18px 18px 6px;
}
.turn .who .you { color: var(--accent); }
.passed-line, .group-action {
  margin: 0; font-family: var(--font-mono); font-size: .75rem; letter-spacing: .08em;
  text-transform: uppercase; color: var(--ink-faint);
}

/* The choices after a reply: the exercise page's cards, with the vote. */
.choice .vote { display: block; font-weight: 600; }
/* On a phone a card's cost sits at its right; a vote is too long for that
 * column, so it goes under the card's title instead. */
@media (max-width: 46rem) {
  .choice:has(.vote) > * { grid-column: 1 / -1; }
  .choice:has(.vote) .choice-meta {
    grid-row: auto; margin-top: .4rem; text-align: left; max-width: none;
  }
}
.proposal {
  margin-top: .75rem; padding: .85rem 1rem; background: var(--card);
  border: 1px solid var(--line-control); border-radius: var(--radius);
}
.proposal p { margin: 0 0 .5rem; }
.proposal .quote { font-family: var(--font-display); font-size: 1.05rem; }
.btn-row { display: flex; gap: .6rem; justify-content: flex-end; flex-wrap: wrap;
  align-items: center; }

/* The round being gathered. */
.tray {
  margin: 1.5rem 0 1rem; padding: 1rem 1.1rem 1.1rem;
  background: var(--panel); border: 1.5px solid var(--line-control);
  border-radius: var(--radius-lg);
}
.tray-head { display: flex; justify-content: space-between; align-items: baseline;
  gap: .75rem; margin-bottom: .75rem; flex-wrap: wrap; }
.tray-title { margin: 0; font: 600 1.15rem/1.2 var(--font-display); color: var(--accent); }
.tray-row { display: grid; grid-template-columns: 9.5rem 1fr; gap: .75rem;
  padding: .6rem 0; border-top: 1px solid var(--line); align-items: start; }
.tray-row .name { font-weight: 600; font-size: .92rem; overflow-wrap: anywhere; }
.tray-row .post { margin: 0; font-family: var(--font-display); font-size: 1.05rem;
  line-height: 1.45; overflow-wrap: anywhere; }
.tray-mine { margin: .75rem 0 0; padding: .75rem 1rem; background: var(--learner-bg);
  border-radius: var(--radius); }
.tray .composer { margin-top: .75rem; box-shadow: none; }
.tray .composer-foot .btn-row { margin-left: auto; }
#send-anyway-row { margin-top: .6rem; }
.status { font-size: .85rem; color: var(--ink-faint); }
.status.ok { color: var(--accent); font-weight: 600; }
.typing { font-style: italic; color: var(--ink-faint); }
.typing .dots { margin-left: .3rem; }
@media (max-width: 46rem) {
  .tray-row { grid-template-columns: 1fr; gap: .2rem; }
  /* The hint on a line of its own, the two buttons under it at the right. */
  .tray .composer-foot { flex-wrap: wrap; }
}

/* The lobby. */
.lobby { padding: 1.4rem 1.5rem; }
.lobby h2 { margin: 0 0 .35rem; font: 600 1.6rem/1.2 var(--font-display); }
.lobby .lede { margin: 0 0 1.1rem; color: var(--ink-soft); }
.lobby-count { font-weight: 600; color: var(--accent); margin: 0 0 .8rem; }
.lobby-members { list-style: none; padding: 0; margin: 0 0 1.25rem; display: grid; gap: .55rem; }
.lobby-members li { display: flex; justify-content: space-between; align-items: center;
  gap: .75rem; padding: .65rem .85rem; border: 1px solid var(--line);
  border-radius: var(--radius); background: var(--panel); }
.lobby-members li > span:first-child { display: inline-flex; align-items: center; gap: .4rem; }
.lobby-buttons { justify-content: flex-start; margin-bottom: .5rem; }

/* The best next step. */
.next-step { margin: 1.5rem 0 1rem; padding: 1.1rem 1.2rem; }
.next-step h2 { margin: 0 0 .3rem; font: 600 1.3rem/1.25 var(--font-display); }
.ns-draft { margin: .75rem 0; padding: .85rem 1rem; background: var(--learner-bg);
  border-radius: var(--radius); }
.ns-draft p { margin: 0 0 .5rem; }
#ns-form textarea { width: 100%; margin: .75rem 0; }
