/* Ndex.
 *
 * One cream page, ink type, gold as
 * the only accent, pill buttons, cards at 17px, panels at 22px. The skeleton is
 * fixed: a left rail on the site's panel colour, a cream conversation canvas,
 * a 768px reading column. What varies per school is only its mark -- the
 * full-colour logo the site carries in its marquee, written onto :root from
 * school.json at load. Demo University carries the Nu mark. */

@font-face {
  font-family: "Satoshi";
  src: url("/assets/fonts/Satoshi-Variable.woff2") format("woff2"), url("/assets/fonts/Satoshi-Variable.woff") format("woff");
  font-weight: 300 900;
  font-style: normal;
  font-display: swap;
}

/* OpenDyslexic (Bitstream Vera license), for the accessibility menu's readable
 * font. Only a page that turns it on downloads the files. */
@font-face {
  font-family: "OpenDyslexic";
  src: url("/assets/fonts/opendyslexic/OpenDyslexic-Regular.woff") format("woff");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "OpenDyslexic";
  src: url("/assets/fonts/opendyslexic/OpenDyslexic-Bold.woff") format("woff");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

:root {
  --page: #edeae2;
  --card: #e2ddd0;
  --card-2: #e0ded8;
  --panel: #f7f5f0;
  --ink: #151105;
  --ink-2: #261d04;
  --ink-3: #3b3110;
  --text: #484030;
  --text-2: #3a362a;
  --muted: #666;
  --gold: #cab98c;
  --gold-text: #75663b;
  --btn: #1a1504;
  --btn-soft: #e3e0d6;
  --btn-soft-text: #524f44;
  --lavender: #d5c6ff;
  --green: #2f7a3e;
  --line: rgba(144, 139, 116, 0.25);
  --line-strong: rgba(72, 64, 48, 0.3);
  --white-veil: rgba(255, 255, 255, 0.5);
  --white-veil-strong: rgba(255, 255, 255, 0.75);
  --ink-veil: rgba(26, 21, 4, 0.06);
  --ink-veil-strong: rgba(26, 21, 4, 0.1);
  --shadow-card: 0 18px 40px rgba(40, 30, 0, 0.08);
  --shadow-panel: 0 20px 50px rgba(30, 20, 0, 0.12);
  --shadow-modal: 0 30px 80px rgba(0, 0, 0, 0.3);
  --scrim: rgba(21, 17, 5, 0.55);
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);

  /* Identity. Only the mark is written from data -- app.js sets --mark-image
   * (the colour logo) and --mark-mono (its single-colour cut, for the rail's
   * watermark) on :root when a school is selected. */
  --mark-image: none;
  --mark-mono: none;

  --font: "Satoshi", "Indivisible", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  --text-caption: 14px;
  --text-body: 16px;
  --text-heading: 30px;

  --radius: 12px;
  --radius-card: 17px;
  --radius-panel: 22px;
  --rail-width: 284px;
  --column: 768px;
}

* {
  box-sizing: border-box;
}

/* A class-level display rule outranks the UA's [hidden] {display:none}, and
 * both the lock screen and the shell set one -- so make hidden win. */
[hidden] {
  display: none !important;
}

html,
body {
  height: 100%;
  margin: 0;
  overflow: hidden;
  overscroll-behavior: none;
}

body {
  font-family: var(--font);
  font-size: var(--text-body);
  font-weight: 500;
  line-height: 1.5;
  color: var(--text);
  background: var(--page);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  animation: pageIn 400ms ease both;
}

button,
input,
textarea,
select {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
}

a {
  color: inherit;
  text-decoration: none;
}

h1,
h2,
h3,
h4 {
  margin: 0;
  color: var(--ink);
  font-weight: 800;
  letter-spacing: -0.015em;
}

strong {
  font-weight: 700;
}

:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 3px;
  border-radius: 4px;
}

svg {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* Lucide icons from /assets/icons.svg (scripts/icons.mjs). They're drawn on a
 * 24-unit grid, so their strokes run heavier than the 16-unit marks above;
 * where a rule below sets a width for one, it's in those units, scaled by
 * --icon-weight so the whole set can be made heavier or lighter at once. */
:root {
  --icon-weight: 1.5;
}

.icon {
  stroke-width: calc(2 * var(--icon-weight));
}

/* Text size (the accessibility menu) zooms the whole app by --z. Zoom scales
 * viewport units too, so every dvh/vw size in this file is divided by it. */
body {
  zoom: var(--z, 1);
}

.shell {
  display: flex;
  height: calc(100dvh / var(--z, 1));
  overflow: hidden;
}

/* ------------------------------------------------------------------ *
 * Buttons and badges -- straight from the site
 * ------------------------------------------------------------------ */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 48px;
  padding: 0 35px;
  border-radius: 40px;
  border: 2px solid var(--btn);
  background: var(--btn);
  color: #fff;
  font-size: 16px;
  font-weight: 600;
  white-space: nowrap;
  transition:
    opacity 160ms ease,
    background 160ms ease,
    transform 220ms var(--ease),
    box-shadow 220ms ease;
}

.btn:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 10px 24px rgba(26, 21, 4, 0.18);
}

.btn:active:not(:disabled) {
  transform: translateY(0);
  box-shadow: none;
}

.btn:disabled {
  opacity: 0.55;
  cursor: default;
}

.btn.outline {
  background: transparent;
  color: var(--btn);
}

.btn.outline:hover:not(:disabled) {
  background: var(--ink-veil);
}

.btn.sm {
  height: 38px;
  padding: 0 18px;
  font-size: 14px;
  border-width: 0;
}

.btn.soft {
  background: var(--btn-soft);
  color: var(--btn-soft-text);
  border-color: var(--btn-soft);
}

.btn.soft:hover:not(:disabled) {
  background: #dad7cc;
}

.btn svg {
  width: 16px;
  height: 16px;
  flex: none;
}

.badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  font-style: normal;
  letter-spacing: 0.04em;
  line-height: 1;
  background: var(--gold);
  color: #fff;
  padding: 3px 6px;
  border-radius: 6px;
  vertical-align: middle;
}

.badge.live {
  background: var(--green);
}

/* ------------------------------------------------------------------ *
 * Passcode gate -- the site's sign-in modal, full screen
 * ------------------------------------------------------------------ */

.lock {
  position: fixed;
  inset: 0;
  z-index: 20;
  background: var(--page);
  display: grid;
  place-items: center;
  padding: 20px;
}

.lock-card {
  position: relative;
  width: min(100%, 440px);
  margin: 0;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-panel);
  padding: 34px 30px 26px;
  box-shadow: var(--shadow-panel);
  text-align: center;
  animation: popIn 200ms var(--ease);
}

.lock-card.is-wrong {
  animation: shake 320ms ease;
}

.lock-seal {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  margin: 0 auto 14px;
  background: #fff;
  border: 1px solid var(--line);
  display: grid;
  place-items: center;
}

.lock-seal img {
  width: 58%;
  height: 58%;
  object-fit: contain;
}

.lock-card h1 {
  font-size: 30px;
  line-height: 1.1;
  margin-bottom: 6px;
}

.lock-help {
  margin: 0 0 20px;
  font-size: 15px;
  color: var(--text);
}

.lock-field {
  display: grid;
  gap: 6px;
  text-align: left;
  font-size: 14px;
  color: var(--ink);
  font-weight: 700;
  margin-bottom: 14px;
}

.lock-field input {
  height: 48px;
  width: 100%;
  padding: 0 16px;
  border-radius: var(--radius);
  border: 1px solid var(--line-strong);
  background: #fff;
  font-weight: 600;
  color: var(--ink);
  letter-spacing: 0.18em;
}

.lock-field input::placeholder {
  letter-spacing: 0.18em;
  color: #b3ab98;
}

.lock-field input:focus {
  outline: 2px solid var(--ink);
  outline-offset: 0;
  border-color: transparent;
}

.lock-card .btn {
  width: 100%;
  margin-top: 4px;
}

.lock-error {
  margin: 10px 0 0;
  font-size: 14px;
  color: #a33;
}

.lock-note {
  margin: 18px 0 0;
  font-size: 13px;
  color: var(--muted);
}

/* ------------------------------------------------------------------ *
 * Left rail
 * ------------------------------------------------------------------ */

/* The rail is the site's panel colour against the cream canvas, with a
 * hairline between them: one step lighter, not a coloured field. The school
 * lives in a chip below the lockup rather than in the rail's colour. */
.sidebar {
  position: relative;
  width: var(--rail-width);
  flex: 0 0 var(--rail-width);
  background: var(--panel);
  border-right: 1px solid var(--line);
  color: var(--ink);
  display: flex;
  flex-direction: column;
  /* `clip`, not `hidden`: the watermark below hangs past the bottom edge, and
   * `hidden` would make the rail a scroll container that could be scrolled
   * programmatically. `clip` cuts the overflow without creating a scroll box. */
  overflow: clip;
  transition: margin-left 0.22s var(--ease);
}

/* The mark again, oversized and ghosted across the foot of the rail, bleeding
 * off the left edge. It is the school's own artwork used as texture: the mono
 * cut at 6% reads as an emboss in the panel rather than as a second logo. */
.sidebar::before {
  content: "";
  position: absolute;
  left: -70px;
  bottom: -40px;
  width: 300px;
  height: 300px;
  background: var(--mark-mono) center / contain no-repeat;
  opacity: 0.06;
  pointer-events: none;
}

.sidebar > * {
  position: relative;
}

.shell.collapsed .sidebar {
  margin-left: calc(var(--rail-width) * -1);
}

.sidebar-head {
  height: 76px;
  flex: 0 0 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 10px 0 18px;
}

/* Loading. Above the lock and the shell, on the page colour, so first paint
 * is the mark alone: an ink outline that traces itself round (pathLength
 * normalises the dash to one unit, whatever the path measures), fills, holds,
 * fades, and goes again. The wordmark and a reload hint fade in on delays --
 * the hint late enough that a normal load never shows it. app.js adds
 * .is-done to fade the overlay out and hides it when that finishes. */
.boot {
  position: fixed;
  inset: 0;
  z-index: 30;
  background: var(--page);
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 14px;
  padding: 20px;
  transition: opacity 360ms var(--ease);
}

.boot.is-done {
  opacity: 0;
  pointer-events: none;
}

.boot-mark {
  width: 96px;
  height: 96px;
  overflow: visible;
  animation: bootBreathe 2600ms var(--ease) infinite;
}

.boot-mark path {
  fill: var(--ink);
  fill-opacity: 0;
  stroke: var(--ink);
  stroke-width: 7;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
  animation: bootDraw 2600ms var(--ease) infinite;
}

.boot-name {
  font-size: 29px;
  font-weight: 900;
  letter-spacing: -0.03em;
  line-height: 1;
  color: #000;
  animation: fadeIn 600ms var(--ease) 900ms both;
}

.boot-hint {
  margin: 10px 0 0;
  font-size: var(--text-caption);
  color: var(--muted);
  animation: fadeIn 400ms var(--ease) 9s both;
}

.boot-hint a {
  color: inherit;
}

@keyframes bootDraw {
  0% {
    stroke-dashoffset: 1;
    fill-opacity: 0;
    opacity: 1;
  }
  52% {
    stroke-dashoffset: 0;
    fill-opacity: 0;
  }
  68% {
    stroke-dashoffset: 0;
    fill-opacity: 1;
  }
  86% {
    fill-opacity: 1;
    opacity: 1;
  }
  100% {
    stroke-dashoffset: 0;
    fill-opacity: 1;
    opacity: 0;
  }
}

@keyframes bootBreathe {
  0%,
  100% {
    transform: scale(0.96);
  }
  68% {
    transform: scale(1);
  }
}

/* The site's logo lockup: mark plus wordmark, with the product named under. */
.brand {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  color: #000;
}

.brand-mark {
  flex: 0 0 42px;
  width: 42px;
  height: 42px;
  position: relative;
  top: 1px;
  background: url("brand/nu-mark.svg") center / contain no-repeat;
  transition: transform 300ms var(--ease);
}

.brand:hover .brand-mark {
  transform: rotate(-8deg) scale(1.06);
}

.brand-name {
  font-size: 29px;
  font-weight: 900;
  letter-spacing: -0.03em;
  line-height: 1;
}

.sidebar-actions {
  padding: 6px 12px 6px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.rail-item {
  box-sizing: border-box;
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 9px 12px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: var(--ink);
  font-size: var(--text-caption);
  font-weight: 600;
  text-align: left;
  cursor: pointer;
  transition: background 160ms ease;
}

.rail-item:hover {
  background: var(--white-veil);
}

.rail-item svg {
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  color: var(--text);
}

/* Search leads the rail, as the site's own field: white, a hairline. */
.rail-search {
  cursor: text;
  background: #fff;
  border: 1px solid var(--line);
  margin-bottom: 4px;
}

.rail-search:hover {
  background: #fff;
}

.rail-search:focus-within {
  border-color: var(--ink);
  box-shadow: 0 0 0 1px var(--ink);
}

.rail-search input {
  flex: 1;
  min-width: 0;
  border: 0;
  background: transparent;
  outline: none;
  font-size: var(--text-caption);
  font-weight: 500;
  color: var(--ink);
}

.rail-search input::placeholder {
  color: var(--muted);
}

.chat-list {
  flex: 1;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 4px 12px 12px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  scrollbar-width: thin;
  scrollbar-color: rgba(72, 64, 48, 0.25) transparent;
}

.chat-group-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--gold-text);
  padding: 16px 12px 6px;
}

.chat-row {
  position: relative;
  display: flex;
  align-items: center;
  gap: 6px;
  border-radius: 12px;
  border: 1px solid transparent;
  padding: 8px 8px 8px 12px;
  cursor: pointer;
  transition: background 160ms ease, border-color 160ms ease;
}

.chat-row:hover {
  background: var(--white-veil);
}

/* The open thread is the site's ink pill. */
.chat-row.active,
.chat-row.active:hover {
  background: var(--ink);
  border-color: var(--ink);
}

.chat-row-title {
  flex: 1;
  min-width: 0;
  font-size: var(--text-caption);
  font-weight: 600;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chat-row.active .chat-row-title {
  color: #fff;
}

.chat-row.active .chat-row-delete {
  color: rgba(255, 255, 255, 0.7);
}

.chat-row.active .chat-row-delete:hover {
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
}

.chat-row-delete {
  opacity: 0;
  border: 0;
  background: transparent;
  color: var(--muted);
  border-radius: 8px;
  padding: 3px;
  cursor: pointer;
  display: grid;
  place-items: center;
}

.chat-row:hover .chat-row-delete,
.chat-row-delete:focus-visible {
  opacity: 1;
}

.chat-row-delete:hover {
  background: var(--ink-veil-strong);
  color: var(--ink);
}

.chat-row-delete svg {
  width: 14px;
  height: 14px;
}

.chat-empty {
  font-size: 13px;
  color: var(--muted);
  padding: 10px 12px;
}

/* The account row closes the rail, the way an app's own does: identity last,
 * under everything it applies to. */
.account {
  position: relative;
  border-top: 1px solid var(--line);
  padding: 10px 12px 12px;
}

.profile-bar {
  display: flex;
  align-items: center;
  gap: 11px;
  width: 100%;
  padding: 8px 10px;
  border: 0;
  border-radius: 14px;
  background: transparent;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
  transition: background 160ms ease;
}

.profile-bar:hover,
.profile-bar[aria-expanded="true"] {
  background: var(--white-veil);
}

.profile-avatar {
  flex: 0 0 34px;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--ink);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.3px;
  display: grid;
  place-items: center;
}

.profile-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
  gap: 1px;
}

.profile-name {
  font-size: var(--text-caption);
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.profile-chevron {
  margin-left: auto;
  flex: 0 0 14px;
  width: 14px;
  height: 14px;
  stroke: var(--muted);
  stroke-width: calc(2.2 * var(--icon-weight));
}

/* The site's mega-menu card, rising from the row rather than dropping, because
 * the row is already at the bottom of the window. */
.account-menu {
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: calc(100% - 4px);
  z-index: 12;
  background: var(--panel);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: var(--radius-panel);
  box-shadow: var(--shadow-panel);
  padding: 8px;
  animation: menuIn 220ms var(--ease);
}

.menu-field {
  display: block;
  padding: 8px 8px 10px;
}

.menu-label {
  display: block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--gold-text);
  margin-bottom: 6px;
}

.menu-field input {
  width: 100%;
  height: 42px;
  padding: 0 14px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: #fff;
  color: var(--ink);
  font-weight: 600;
  outline: none;
  font-size: 14px;
}

.menu-field input:focus {
  outline: 2px solid var(--ink);
  outline-offset: 0;
  border-color: transparent;
}

.menu-sep {
  height: 1px;
  background: var(--line);
  margin: 4px 6px;
}

.menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 10px;
  border: 0;
  border-radius: 14px;
  background: transparent;
  color: var(--ink);
  font-size: 14px;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
  transition: background 160ms ease, transform 220ms var(--ease);
}

.menu-item:hover {
  background: var(--white-veil-strong);
  transform: translateY(-1px);
}

.menu-item svg {
  flex: 0 0 18px;
  width: 18px;
  height: 18px;
  stroke: var(--text);
  stroke-width: calc(1.9 * var(--icon-weight));
}

.menu-item-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
  gap: 1px;
}

.menu-item-note {
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ------------------------------------------------------------------ *
 * Main column
 * ------------------------------------------------------------------ */

.main {
  position: relative;
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  background: var(--page);
}

.icon-btn {
  border: 0;
  background: transparent;
  color: var(--text);
  border-radius: 10px;
  width: 36px;
  height: 36px;
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: background 160ms ease;
}

.icon-btn:hover {
  background: var(--white-veil);
  color: var(--ink);
}

.icon-btn svg {
  width: 18px;
  height: 18px;
}

/* There is no header bar to hang this off, and hiding the rail must not be a
 * one-way door -- on a phone the rail starts hidden. So it floats over the top
 * of the canvas, and only while the rail is actually gone. */
.rail-toggle {
  position: absolute;
  z-index: 3;
  top: 15px;
  left: 16px;
  display: none;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
  color: var(--ink);
  cursor: pointer;
  transition: background 160ms ease;
}

.shell.collapsed .rail-toggle {
  display: grid;
}

.rail-toggle:hover {
  background: #fff;
}

.rail-toggle svg {
  width: 18px;
  height: 18px;
}

.summarize-btn {
  position: absolute;
  z-index: 4;
  top: 15px;
  right: 16px;
}

.summarize-btn svg {
  stroke-width: calc(1.8 * var(--icon-weight));
}

.school-select {
  appearance: none;
  -webkit-appearance: none;
  height: 42px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: #fff;
  padding: 0 40px 0 14px;
  font-size: var(--text-caption);
  font-weight: 600;
  color: var(--ink);
  cursor: pointer;
  max-width: 320px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 16 16' fill='none' stroke='%23151105' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 6l5 5 5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
}

.school-select:focus {
  outline: 2px solid var(--ink);
  outline-offset: 0;
  border-color: transparent;
}

.thread-scroll {
  flex: 1;
  overflow-y: auto;
  overscroll-behavior: contain;
  scroll-behavior: smooth;
}

/* Nothing to read yet, so nothing to scroll: the empty state is exactly one
 * screen and should sit still under the cursor. */
.thread-scroll:has(.welcome:not(.hidden)) {
  overflow-y: hidden;
}

.thread {
  max-width: var(--column);
  margin: 0 auto;
  /* The Summarize button floats over this column, so the first message starts
   * below it rather than under it. */
  padding: 68px 20px 24px;
  display: flex;
  flex-direction: column;
  gap: 26px;
}

.thread:empty {
  padding: 0;
}

/* Welcome state -- the site's hero, in a column ------------------ */

/* Sits in the upper third, the way Claude's and ChatGPT's empty states do,
 * rather than dead centre: the eye lands on the input without hunting. */
.welcome {
  max-width: var(--column);
  margin: 0 auto;
  min-height: 100%;
  padding: clamp(64px, 20vh, 210px) 20px 32px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  text-align: center;
}

.welcome.hidden {
  display: none;
}

.hero {
  position: relative;
  display: grid;
  place-items: center;
  width: max-content;
  margin: 0 auto 22px;
  animation: fadeUp 700ms var(--ease) 40ms both;
}

.welcome h1 {
  margin: 0;
  font-size: clamp(34px, 3.6vw, 52px);
  line-height: 1.05;
  font-weight: 800;
  letter-spacing: -0.02em;
  max-width: 18ch;
  animation: fadeUp 800ms var(--ease) 180ms both;
}

.welcome .lead {
  margin: 20px 0 0;
  font-size: clamp(16px, 0.5vw + 12px, 19px);
  color: var(--text);
  max-width: 44ch;
  animation: fadeUp 700ms var(--ease) 360ms both;
}

/* Messages --------------------------------------------------------- */

/* The site's chat: the student's turn is an ink bubble, right-aligned. */
.msg-user {
  align-self: flex-end;
  max-width: 78%;
  background: var(--ink);
  color: #fff;
  border-radius: 18px;
  border-bottom-right-radius: 6px;
  padding: 11px 16px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  animation: fadeUp 240ms ease both;
}

/* The answer is prose in the column, the school's mark standing in for a
 * speaker avatar -- long answers read better as a page than as a bubble. */
.msg-assistant {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  animation: fadeUp 240ms ease both;
}

.msg-body {
  flex: 1;
  min-width: 0;
  padding-top: 3px;
}

/* The thinking process -- tool lookups and the model's reasoning -- folded
 * into one line. A chevron opens it; the answer never depends on it. */
.thinking {
  margin-bottom: 12px;
}

.thinking summary,
.citations summary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 700;
  color: var(--muted);
  cursor: pointer;
  list-style: none;
  user-select: none;
  transition: color 0.12s ease;
}

.thinking summary::-webkit-details-marker,
.citations summary::-webkit-details-marker {
  display: none;
}

.thinking summary:hover,
.citations summary:hover {
  color: var(--ink);
}

.thinking summary .chev,
.citations summary .chev {
  width: 12px;
  height: 12px;
  stroke-width: calc(2.6 * var(--icon-weight));
  transition: transform 0.18s ease;
}

/* Timed but with nothing to open yet -- no lookups, no reasoning shown -- the
 * line is only the clock. */
.thinking-label {
  font-variant-numeric: tabular-nums;
}

.thinking-empty summary {
  pointer-events: none;
}

.thinking-empty summary .chev {
  display: none;
}

.thinking[open] summary .chev,
.citations[open] summary .chev {
  transform: rotate(180deg);
}

.thinking-body {
  margin-top: 8px;
  padding-left: 14px;
  border-left: 3px solid var(--gold);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.trace {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.trace-line {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--muted);
}

.trace-line::before {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--gold);
  flex: 0 0 5px;
}

.thinking-text {
  font-size: var(--text-caption);
  line-height: 1.5;
  color: var(--text);
  white-space: pre-wrap;
}

/* Rendered answer */

.prose {
  color: var(--text-2);
  line-height: 1.6;
}

.prose > *:first-child {
  margin-top: 0;
}

.prose > *:last-child {
  margin-bottom: 0;
}

.prose p {
  margin: 0 0 14px;
}

.prose h2,
.prose h3 {
  font-size: var(--text-body);
  font-weight: 800;
  margin: 22px 0 8px;
  color: var(--ink);
}

.prose ul,
.prose ol {
  margin: 0 0 14px;
  padding-left: 22px;
}

.prose li {
  margin-bottom: 6px;
}

/* A link out to the school's own catalog page. The site's link colour. */
.prose a {
  color: var(--gold-text);
  text-decoration: underline;
  text-underline-offset: 3px;
  overflow-wrap: anywhere;
}

.prose a:hover {
  color: var(--ink);
}

.prose code {
  font-family: var(--mono);
  font-size: 0.88em;
  background: var(--white-veil);
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 1px 5px;
}

.prose pre {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px 14px;
  overflow-x: auto;
  margin: 0 0 14px;
}

.prose pre code {
  background: none;
  border: 0;
  padding: 0;
  font-size: 13px;
}

.prose blockquote {
  margin: 0 0 14px;
  padding: 8px 14px;
  border-left: 3px solid var(--gold);
  background: rgba(255, 255, 255, 0.4);
  border-radius: 0 10px 10px 0;
  color: var(--muted);
}

.prose hr {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 20px 0;
}

.prose table {
  border-collapse: separate;
  border-spacing: 0;
  width: 100%;
  margin: 0 0 14px;
  font-size: var(--text-caption);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}

.prose th,
.prose td {
  border-top: 1px solid var(--line);
  padding: 8px 12px;
  text-align: left;
}

.prose tr:first-child th,
.prose tr:first-child td {
  border-top: 0;
}

.prose th {
  background: var(--panel);
  font-weight: 700;
  color: var(--ink);
}

.caret {
  display: inline-block;
  width: 7px;
  height: 15px;
  margin-left: 2px;
  vertical-align: -2px;
  background: var(--ink);
  border-radius: 1px;
  animation: blink 1s steps(2, start) infinite;
}

@keyframes blink {
  to {
    visibility: hidden;
  }
}

/* Copy fades in on hover. */
.msg-actions {
  margin-top: 10px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.msg-actions button {
  opacity: 0;
  border: 1px solid var(--ink);
  background: transparent;
  color: var(--ink);
  font-size: 13px;
  font-weight: 600;
  padding: 5px 11px;
  border-radius: 20px;
  cursor: pointer;
  transition: opacity 0.12s ease, background 160ms ease, color 160ms ease;
}

.msg-assistant:hover .msg-actions button,
.msg-actions button:focus-visible {
  opacity: 1;
}

.msg-actions button:hover {
  background: var(--ink);
  color: #fff;
}

/* Which lane answered, and what it cost. A dev readout, not decoration. */
.lane {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 1px 8px;
}

.usage {
  font-size: 12px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.error-note {
  border-left: 3px solid #a33;
  background: rgba(255, 255, 255, 0.4);
  border-radius: 0 10px 10px 0;
  padding: 10px 14px;
  font-size: var(--text-caption);
  color: var(--text);
}

/* Citations under a reply: where each claim came from. */
.citations {
  margin: 12px 0 0;
}

.citations ol {
  margin: 8px 0 0;
  padding-left: 14px;
  border-left: 3px solid var(--gold);
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.citations li {
  font-size: 13px;
  line-height: 1.45;
}

.citations a {
  color: var(--gold-text);
  text-decoration: underline;
  text-underline-offset: 3px;
  overflow-wrap: anywhere;
}

.citations a:hover {
  color: var(--ink);
}

/* Composer --------------------------------------------------------- *
 *
 * One element, two homes: centred under the greeting while a chat is empty,
 * pinned at the foot once there is a thread. Moving it in the DOM rather than
 * duplicating it keeps one textarea, one draft, one set of listeners. */

.composer-slot {
  display: contents;
}

/* Opacity only: a transform here would become the containing block for the
 * pinned disclaimer below. */
.welcome .composer-slot {
  display: block;
  width: 100%;
  margin-top: 30px;
  animation: fadeIn 700ms var(--ease) 480ms both;
}

.composer-wrap {
  flex: 0 0 auto;
  padding: 0 20px 10px;
}

.welcome .composer-wrap {
  padding: 0;
}

/* Starters: three boxes above the composer, only while the chat is empty. */
.starters {
  display: none;
}

/* Pages of three on a track. The chevron starts at the right edge and each
 * press slides the track one page left; on the last page the chevron crosses
 * to the left edge and turns to point back. Left and margin are animated (not a flip of order) so it moves
 * rather than jumps. The view's 2px padding keeps the hover lift unclipped. */
.welcome .starters {
  --more: 40px;
  --more-gap: 10px;
  position: relative;
  display: block;
  max-width: var(--column);
  margin: -2px auto 10px;
}

.starters-view {
  overflow: hidden;
  padding: 2px 0;
  margin: 0 calc(var(--more) + var(--more-gap)) 0 0;
  transition: margin 420ms var(--ease);
}

.starters-track {
  display: flex;
  gap: 10px;
  transition: transform 420ms var(--ease);
}

.starters-page {
  flex: 0 0 100%;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.starters-more {
  position: absolute;
  top: 2px;
  bottom: 2px;
  left: calc(100% - var(--more));
  width: var(--more);
  display: grid;
  place-items: center;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-card);
  background: var(--white-veil);
  color: var(--ink);
  cursor: pointer;
  transition: left 420ms var(--ease), background 160ms ease, border-color 160ms ease;
}

.starters-more:hover {
  background: #fff;
  border-color: var(--ink);
}

.starters-more svg {
  width: 18px;
  height: 18px;
  transition: transform 420ms var(--ease);
}

.starters.at-end .starters-view {
  margin: 0 0 0 calc(var(--more) + var(--more-gap));
}

.starters.paged .starters-track {
  transform: translateX(calc(var(--page, 1) * (-100% - 10px)));
}

.starters.at-end .starters-more {
  left: 0;
}

.starters.at-end .starters-more svg {
  transform: rotate(180deg);
}

.starter {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-card);
  background: var(--white-veil);
  color: var(--ink);
  font-size: var(--text-caption);
  font-weight: 600;
  text-align: left;
  cursor: pointer;
  transition: background 160ms ease, border-color 160ms ease, transform 220ms var(--ease);
}

.starter:hover {
  background: #fff;
  border-color: var(--ink);
  transform: translateY(-1px);
}

.starter svg {
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
}

@media (max-width: 600px) {
  .starters-page {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .starter {
    padding: 11px 14px;
  }
}

/* The site's form field, grown into a card: white, a hairline, the ink focus
 * ring. The disclaimer sits inside it so the two read as one object. */
.composer {
  max-width: var(--column);
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 14px 14px 10px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-panel);
  background: #fff;
  box-shadow: 0 10px 40px rgba(40, 30, 0, 0.06);
  text-align: left;
  transition: box-shadow 220ms ease, border-color 160ms ease;
}

.composer:focus-within {
  border-color: var(--ink);
  box-shadow: 0 0 0 1px var(--ink), 0 10px 40px rgba(40, 30, 0, 0.08);
}

.welcome .composer {
  padding: 18px 16px 12px;
}

.composer textarea {
  width: 100%;
  border: 0;
  outline: none;
  resize: none;
  background: transparent;
  padding: 4px 4px 0;
  max-height: 200px;
  line-height: 1.5;
  color: var(--ink);
  font-weight: 500;
}

.welcome .composer textarea {
  min-height: 52px;
}

.composer textarea::placeholder {
  color: var(--muted);
}

.composer-tools {
  display: flex;
  align-items: center;
  gap: 6px;
}

.composer-spacer {
  flex: 1;
}

/* The site's chat chips. */
.tool-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--ink);
  border-radius: 20px;
  background: transparent;
  color: var(--ink);
  font-size: 13px;
  font-weight: 600;
  padding: 6px 12px 6px 10px;
  cursor: pointer;
  transition: background 160ms ease, color 160ms ease;
}

.tool-btn:hover {
  background: var(--ink);
  color: #fff;
}

.tool-btn svg {
  width: 15px;
  height: 15px;
}

.icon-tool {
  border: 0;
  background: transparent;
  color: var(--text);
  border-radius: 50%;
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: background 160ms ease, color 160ms ease;
}

.icon-tool:hover {
  background: var(--ink-veil);
  color: var(--ink);
}

.icon-tool svg {
  width: 17px;
  height: 17px;
}

/* Dictation is live: the button holds the state so it is obvious the
 * microphone is open. */
.icon-tool.recording {
  background: #a33;
  color: #fff;
}

/* The site's chat send button. */
.send-btn {
  flex: 0 0 40px;
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 50%;
  background: var(--ink);
  color: #fff;
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: background-color 0.15s ease, transform 220ms var(--ease), opacity 160ms ease;
}

.send-btn:hover:not(:disabled) {
  background: #000;
  transform: translateY(-1px);
}

.send-btn:disabled {
  background: #cfc9ba;
  color: #fff;
  cursor: default;
}

.send-btn svg {
  width: 17px;
  height: 17px;
  stroke-width: calc(2.6 * var(--icon-weight));
}

.send-btn .icon-stop {
  display: none;
  fill: currentColor;
  stroke: none;
}

body.streaming .send-btn .icon-stop {
  display: block;
}

body.streaming .send-btn .icon-send {
  display: none;
}

/* Accessibility and the tour: two round buttons beside "Add files", drawn
 * like it (an ink hairline) so the three read as one group. The icon nearly
 * fills its circle. */
.round-tool {
  flex: 0 0 36px;
  width: 36px;
  height: 36px;
  border: 1px solid var(--ink);
  border-radius: 50%;
  background: transparent;
  color: var(--ink);
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: background 160ms ease, color 160ms ease;
}

.round-tool:hover,
.round-tool[aria-expanded="true"] {
  background: var(--ink);
  color: var(--page);
}

/* The markup gives these icons the same size, so a stale stylesheet can never
 * draw them at an SVG's default 300x150. */
.round-tool svg {
  width: 22px;
  height: 22px;
}

/* The accessibility menu rises from the composer, over whatever is above it. */
.composer {
  position: relative;
}

.a11y-menu {
  position: absolute;
  left: 0;
  bottom: calc(100% + 10px);
  z-index: 12;
  width: min(340px, 100%);
  padding: 8px 8px 12px;
  background: var(--panel);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: var(--radius-panel);
  box-shadow: var(--shadow-panel);
  animation: menuIn 220ms var(--ease);
}

.a11y-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 8px 4px 6px 12px;
}

.a11y-head h3 {
  margin: 0;
  font-size: 17px;
  font-weight: 800;
}

.a11y-head p {
  margin: 2px 0 0;
  font-size: 12px;
  color: var(--muted);
}

.a11y-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 14px;
}

.a11y-row:hover {
  background: var(--white-veil);
}

.a11y-label {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  font-weight: 600;
}

.a11y-label svg {
  flex: 0 0 20px;
  width: 20px;
  height: 20px;
}

.a11y-label small {
  display: block;
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
}

/* The site's switch and stepper. */
.switch {
  flex: none;
  position: relative;
  width: 44px;
  height: 26px;
  border: 0;
  border-radius: 13px;
  background: #cfc9ba;
  cursor: pointer;
  transition: background 160ms ease;
}

.switch::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
  transition: transform 180ms var(--ease);
}

.switch[aria-checked="true"] {
  background: var(--ink);
}

.switch[aria-checked="true"]::after {
  transform: translateX(18px);
  background: var(--page);
}

.stepper {
  flex: none;
  display: inline-flex;
  border: 1px solid var(--ink);
  border-radius: 20px;
  overflow: hidden;
}

.stepper button {
  width: 34px;
  height: 30px;
  border: 0;
  background: transparent;
  color: var(--ink);
  font-weight: 700;
  cursor: pointer;
}

.stepper button:hover:not(:disabled) {
  background: var(--ink);
  color: var(--page);
}

.stepper button:disabled {
  opacity: 0.35;
  cursor: default;
}

.stepper span {
  min-width: 48px;
  display: grid;
  place-items: center;
  font-size: 13px;
  font-weight: 600;
  border-left: 1px solid var(--ink);
  border-right: 1px solid var(--ink);
}

.a11y-reset {
  margin: 6px 12px 0;
  padding: 0;
  border: 0;
  background: none;
  font-size: 13px;
  color: var(--gold-text);
  text-decoration: underline;
  cursor: pointer;
}

/* The tour. The spot is a hole: a rounded box whose enormous shadow is the
 * dimmed page. The layer above everything takes the clicks, so the page
 * underneath can't be used mid-tour. */
.tour {
  position: fixed;
  inset: 0;
  z-index: 30;
}

.tour-spot {
  position: fixed;
  border-radius: 18px;
  box-shadow: 0 0 0 200vmax rgba(8, 8, 10, 0.62);
  outline: 2px solid var(--ink);
  outline-offset: 2px;
  transition: top 320ms var(--ease), left 320ms var(--ease), width 320ms var(--ease), height 320ms var(--ease);
}

.tour-card {
  position: fixed;
  width: min(340px, calc(100vw / var(--z, 1) - 32px));
  padding: 20px 20px 16px;
  background: var(--page);
  color: var(--ink);
  border-radius: var(--radius-panel);
  box-shadow: var(--shadow-modal);
  transition: top 320ms var(--ease), left 320ms var(--ease);
}

.tour-card h2 {
  margin: 0 0 6px;
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.01em;
}

.tour-text {
  margin: 0 0 16px;
  font-size: 14px;
  line-height: 1.55;
  color: var(--text);
}

/* The disclaimer, under the card: the last line on the screen. On the empty
 * state the card sits mid-screen, so the note is pinned to the foot of the
 * column instead of trailing it. */
.composer-note {
  margin: 8px 0 0;
  font-size: 12px;
  color: var(--muted);
  text-align: center;
}

.welcome .composer-note {
  position: absolute;
  left: 20px;
  right: 20px;
  bottom: 12px;
  margin: 0;
}

/* Modal -- the site's sign-in card ------------------------------- */

.scrim {
  position: fixed;
  inset: 0;
  background: var(--scrim);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 10;
}

.modal {
  position: fixed;
  z-index: 11;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: min(520px, calc(100vw / var(--z, 1) - 40px));
  max-height: min(calc(80dvh / var(--z, 1)), 640px);
  overflow-y: auto;
  background: var(--page);
  border-radius: var(--radius-panel);
  padding: 30px 30px 26px;
  box-shadow: var(--shadow-modal);
  animation: popIn 200ms var(--ease);
}

.modal h2 {
  margin: 0 0 8px;
  font-size: var(--text-heading);
  line-height: 1.15;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.modal-body {
  font-size: 15px;
  line-height: 1.55;
  color: var(--text);
  margin-bottom: 20px;
}

.modal-body p {
  margin: 0 0 12px;
}

.modal-body strong {
  color: var(--ink);
}

.modal-body code {
  font-family: var(--mono);
  font-size: 0.88em;
  background: var(--white-veil);
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 1px 5px;
}

.modal .modal-btn {
  width: 100%;
}

/* Dev panel */

.dev-field {
  display: grid;
  gap: 6px;
  margin: 14px 0 10px;
}

.dev-label {
  font-size: 14px;
  font-weight: 700;
  color: var(--ink);
}

.dev-field .school-select {
  width: 100%;
  max-width: none;
}

.dev-note {
  margin: 0 0 18px;
  font-size: 13px;
  line-height: 1.45;
  color: var(--muted);
}

/* Label left, value right, hairline between -- a readout, not a form. */
.dev-facts {
  margin: 0 0 22px;
  display: grid;
  grid-template-columns: auto 1fr;
  font-size: 13px;
  background: rgba(255, 255, 255, 0.4);
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  padding: 4px 16px;
}

.dev-facts dt {
  color: var(--muted);
  font-weight: 600;
  padding: 8px 16px 8px 0;
  border-top: 1px solid var(--line);
  white-space: nowrap;
}

.dev-facts dd {
  margin: 0;
  padding: 8px 0;
  border-top: 1px solid var(--line);
  text-align: right;
  color: var(--ink);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}

.dev-facts dt:first-of-type,
.dev-facts dd:first-of-type {
  border-top: 0;
}

/* ------------------------------------------------------------------ *
 * The mark
 *
 * One component, three sizes, no per-school CSS. The logo arrives as a custom
 * property written from school.json, and the box takes the mark's real
 * proportions: a wide VT and a square hawk are scaled to hold the same *area*
 * whatever their shape -- --mark-scale is 1/sqrt(aspect), written from the
 * theme -- so every school's mark lands with the same weight on the page. A
 * school with no logo falls through to the text inside the element: its
 * initials, in a ring.
 * ------------------------------------------------------------------ */

.mark {
  position: relative;
  flex: 0 0 auto;
  width: calc(var(--size) * var(--mark-scale, 1) * var(--mark-aspect, 1));
  height: calc(var(--size) * var(--mark-scale, 1));
  display: grid;
  place-items: center;
  user-select: none;
}

.mark::after {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--mark-image) center / contain no-repeat;
}

.mark-monogram {
  width: var(--size);
  height: var(--size);
  box-shadow: inset 0 0 0 2px var(--ink);
  border-radius: 50%;
  color: var(--ink);
  font-size: calc(var(--size) * 0.36);
  font-weight: 800;
  letter-spacing: 0.02em;
}

/* Beside an answer: the school's own mark stands in for a speaker avatar, on
 * a white disc like the site's school seals. */
.mark-avatar {
  --size: 22px;
  box-sizing: content-box;
  padding: 7px;
  border-radius: 50%;
  background: #fff;
  border: 1px solid var(--line);
}

.mark-avatar::after {
  inset: 7px;
}

.mark-avatar.mark-monogram {
  font-size: 10px;
  box-shadow: none;
}

/* In the conversation -- the empty state and beside every answer -- the
 * speaker is Ndex, so the mark is Ndex's whatever the school. The school's
 * own mark stays in the rail. */
.mark-nu {
  --mark-image: url("brand/nu-mark.svg");
  --mark-aspect: 1;
  --mark-scale: 1;
}

/* Beside an answer the Nu mark stands bare, like the rail's lockup: no disc,
 * and larger than the disc it replaced, level with the rail's lockup. */
.mark-avatar.mark-nu {
  --size: 38px;
  padding: 0;
  background: transparent;
  border-color: transparent;
}

.mark-avatar.mark-nu::after {
  inset: 0;
}

/* Drop the answer's first line to the middle of the larger mark. */
.msg-assistant:has(.mark-nu) .msg-body {
  padding-top: 8px;
}

/* The empty state: the mark once, at size. */
.mark-lg {
  --size: 96px;
}

/* ------------------------------------------------------------------ *
 * Motion
 * ------------------------------------------------------------------ */

@keyframes pageIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(24px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes menuIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes popIn {
  from {
    opacity: 0;
    transform: translate(-50%, -50%) translateY(10px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translate(-50%, -50%);
  }
}

/* The lock card is not centred by transform, so it gets the plain version. */
.lock-card {
  animation-name: popInPlain;
}

@keyframes popInPlain {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes shake {
  0%,
  100% {
    transform: translateX(0);
  }
  20% {
    transform: translateX(-10px);
  }
  40% {
    transform: translateX(8px);
  }
  60% {
    transform: translateX(-5px);
  }
  80% {
    transform: translateX(3px);
  }
}

/* Accessibility modes, set on <html> by the head script and the menu. ----- */

/* High contrast, cream look: the site's darker text and stronger borders. */
html.a11y-contrast:not(.glass) {
  --text: #1a1408;
  --text-2: #1a1408;
  --muted: #3a3424;
  --line: rgba(21, 17, 5, 0.45);
  --line-strong: rgba(21, 17, 5, 0.7);
  --btn-soft-text: #1a1408;
}

/* Reduce motion: the OS setting's rule below, on demand. */
html.a11y-motion *,
html.a11y-motion *::before,
html.a11y-motion *::after {
  transition-duration: 0.01ms !important;
  animation-duration: 0.01ms !important;
  animation-iteration-count: 1 !important;
  scroll-behavior: auto !important;
}

/* Readable font. OpenDyslexic runs wide, so the tightest type loosens. */
html.a11y-dyslexic body,
html.a11y-dyslexic button,
html.a11y-dyslexic input,
html.a11y-dyslexic select,
html.a11y-dyslexic textarea {
  font-family: "OpenDyslexic", "Comic Sans MS", system-ui, sans-serif;
}

html.a11y-dyslexic body {
  line-height: 1.6;
  letter-spacing: 0.01em;
}

html.a11y-dyslexic h1,
html.a11y-dyslexic h2,
html.a11y-dyslexic h3 {
  letter-spacing: 0;
}

html.a11y-dyslexic .welcome h1 {
  font-size: clamp(28px, 3vw, 42px);
}

/* Larger text: the empty state can outgrow one screen, so it scrolls, and the
 * disclaimer follows the composer instead of being pinned over it. */
html.a11y-text .thread-scroll:has(.welcome:not(.hidden)) {
  overflow-y: auto;
}

html.a11y-text .welcome .composer-note {
  position: static;
  margin-top: 10px;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }

  .boot-mark,
  .boot-mark path {
    animation: none !important;
  }

  .boot-mark path {
    fill-opacity: 1;
    stroke: none;
  }
}

/* Small screens ---------------------------------------------------- */

@media (max-width: 860px) {
  .sidebar {
    position: fixed;
    z-index: 12;
    top: 0;
    bottom: 0;
    left: 0;
  }

  .shell:not(.collapsed) .sidebar {
    box-shadow: 0 0 0 100vmax var(--scrim);
  }

  .mark-lg {
    --size: 88px;
  }

  .welcome h1 {
    font-size: 34px;
  }

  .msg-user {
    max-width: 88%;
  }

  /* The floating toggle is always present at this width. */
  .thread {
    padding-top: 68px;
  }

  .summarize-btn span {
    display: none;
  }

  .summarize-btn {
    width: 38px;
    padding: 0;
  }
}

@media (max-width: 600px) {
  .lock-card {
    padding: 28px 20px 20px;
  }

  .modal {
    padding: 26px 20px 20px;
  }

  .welcome {
    padding-top: 72px;
  }
}

/* ------------------------------------------------------------------ *
 * Standalone Mac app
 * ------------------------------------------------------------------ *
 * The window draws its own content right up to the top edge -- there is no
 * titlebar strip to sit below -- so the top-left corner belongs to the close,
 * minimise and zoom buttons and nothing of ours may be under them. The Swift
 * host sets data-platform="mac" before first paint; in a browser none of this
 * applies. The same strip is where the window is dragged from, which is the
 * other reason to keep it empty. */

:root[data-platform="mac"] {
  --titlebar: 30px;
}

:root[data-platform="mac"] .sidebar-head {
  height: calc(76px + var(--titlebar));
  flex-basis: calc(76px + var(--titlebar));
  padding-top: var(--titlebar);
}

/* With the rail hidden the buttons sit over the canvas instead, where this
 * is the only thing in the corner. */
:root[data-platform="mac"] .rail-toggle {
  top: calc(12px + var(--titlebar));
}

/* Nothing is in the passcode card's corner, but the card itself should not
 * ride up under the buttons either. */
:root[data-platform="mac"] .lock {
  padding-top: calc(20px + var(--titlebar));
}

/* In the app the button sits in the window's own title row, level with the
 * traffic lights on the other side. */
:root[data-platform="mac"] .summarize-btn {
  top: 7px;
}

:root[data-platform="mac"] .thread {
  padding-top: 56px;
}

/* ------------------------------------------------------------------ *
 * Sign-in: the two-step email flow and Google, on the same card.
 * ------------------------------------------------------------------ */

.lock-card .btn.outline {
  width: 100%;
  margin-top: 0;
  gap: 10px;
}

.lock-card .btn.soft.sm {
  width: auto;
  margin: 12px auto 0;
  display: inline-flex;
}

.lock-or {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 14px 0;
  color: var(--muted);
  font-size: 13px;
}

.lock-or::before,
.lock-or::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line);
}

.g-mark {
  width: 18px;
  height: 18px;
  stroke: none !important;
}

.lock-wait {
  margin: 0 0 8px;
  font-size: 15px;
  line-height: 1.55;
  color: var(--text);
  text-align: left;
}

.lock-note a {
  color: inherit;
  text-decoration: underline;
}

/* ------------------------------------------------------------------ *
 * Account menu: the profile summary line
 * ------------------------------------------------------------------ */

.menu-profile {
  padding: 0 8px 8px;
  font-size: 13px;
  line-height: 1.45;
  color: var(--text);
}

.menu-profile b {
  color: var(--ink);
  font-weight: 600;
}

/* ------------------------------------------------------------------ *
 * Onboarding and confirmations
 * ------------------------------------------------------------------ */

.onboarding {
  width: min(560px, calc(100vw / var(--z, 1) - 40px));
}

.ob-step {
  margin: 0 0 6px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--gold-text);
}

.ob-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 6px;
}

.ob-field {
  display: grid;
  gap: 6px;
  margin-bottom: 16px;
  text-align: left;
}

.ob-field > span {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-3);
}

.ob-field input,
.ob-field select {
  width: 100%;
  height: 44px;
  padding: 0 14px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: #fff;
  color: var(--ink);
  font-size: 15px;
  font-weight: 500;
  outline: none;
}

.ob-field input:focus,
.ob-field select:focus {
  outline: 2px solid var(--ink);
  outline-offset: 0;
  border-color: transparent;
}

.ob-hint {
  font-size: 13px;
  color: var(--muted);
  margin: -8px 0 14px;
}

.ob-results {
  display: grid;
  gap: 4px;
  max-height: 200px;
  overflow-y: auto;
  margin: -8px 0 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  padding: 4px;
}

.ob-results:empty {
  display: none;
}

.ob-result {
  text-align: left;
  padding: 8px 10px;
  border-radius: 8px;
  font-size: 14px;
  line-height: 1.35;
  color: var(--ink);
  background: transparent;
  border: 0;
  cursor: pointer;
}

.ob-result:hover {
  background: var(--ink-veil);
}

.ob-result small {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 14px;
}

.chips:empty {
  display: none;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px 6px 12px;
  border-radius: 999px;
  background: var(--card);
  color: var(--ink);
  font-size: 13px;
  font-weight: 600;
}

.chip button {
  border: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 15px;
  line-height: 1;
  padding: 0 2px;
}

.chip button:hover {
  color: var(--ink);
}

/* Report a wrong answer */

.report-kinds {
  border: 0;
  margin: 14px 0 4px;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.report-kinds legend {
  margin-bottom: 8px;
}

.report-kind {
  position: relative;
  cursor: pointer;
}

.report-kind input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.report-kind span {
  display: inline-block;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  transition: background 160ms ease, color 160ms ease;
}

.report-kind input:checked + span {
  background: var(--ink);
  border-color: var(--ink);
  color: #fff;
}

.report-kind input:focus-visible + span {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
}

.report-text {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: #fff;
  color: var(--ink);
  font-size: 15px;
  line-height: 1.45;
  resize: vertical;
  outline: none;
}

.report-text:focus {
  outline: 2px solid var(--ink);
  outline-offset: 0;
  border-color: transparent;
}

.report-optional {
  font-weight: 400;
  color: var(--muted);
}

.msg-actions button.reported,
.msg-assistant:hover .msg-actions button.reported {
  opacity: 1;
  border-color: var(--line-strong);
  color: var(--muted);
  cursor: default;
}

.msg-actions button.reported:hover {
  background: transparent;
  color: var(--muted);
}

.report-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 10px;
}

.report-list li {
  background: var(--card);
  border-radius: var(--radius);
  padding: 10px 14px;
  font-size: 14px;
}

.report-list .report-q {
  color: var(--ink);
  font-weight: 600;
}

.report-list .report-meta {
  color: var(--muted);
  font-size: 13px;
  margin-top: 2px;
}

/* Seat alerts */

.seats-row {
  display: flex;
  gap: 8px;
}

.seats-row .confirm-input {
  margin-bottom: 0;
  font-family: var(--mono);
  letter-spacing: 0.06em;
}

.seats-list {
  list-style: none;
  margin: 14px 0 0;
  padding: 0;
  display: grid;
  gap: 8px;
}

.seats-list:empty {
  display: none;
}

.seats-list li {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--card);
  border-radius: var(--radius);
  padding: 10px 14px;
  font-size: 14px;
}

.seats-list .seats-what {
  flex: 1;
  min-width: 0;
}

.seats-list .seats-course {
  color: var(--ink);
  font-weight: 600;
}

.seats-list .seats-meta {
  color: var(--muted);
  font-size: 13px;
  margin-top: 2px;
}

.seats-list li.ended {
  opacity: 0.6;
}

.seats-fine {
  font-size: 13px;
  color: var(--muted);
  margin-top: 14px;
}

/* Calendar subscribe links */

.cal-links {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 8px;
  margin: 14px 0;
}

.cal-links .btn {
  text-decoration: none;
  justify-content: center;
}

.cal-copy code {
  word-break: break-all;
}

.btn.danger {
  background: #8f1f1f;
  border-color: #8f1f1f;
}

.confirm-input {
  width: 100%;
  height: 44px;
  padding: 0 14px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: #fff;
  color: var(--ink);
  font-size: 15px;
  outline: none;
  margin-bottom: 10px;
}

.confirm-input:focus {
  outline: 2px solid var(--ink);
  outline-offset: 0;
  border-color: transparent;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  z-index: 30;
  background: var(--ink);
  color: #fff;
  padding: 10px 16px;
  border-radius: 999px;
  font-size: 14px;
  box-shadow: var(--shadow-panel);
  animation: popIn 160ms var(--ease);
  max-width: min(560px, calc(100vw / var(--z, 1) - 40px));
}

/* ------------------------------------------------------------------ *
 * The record flow: upload, review table, My record
 * ------------------------------------------------------------------ */

.record-modal {
  width: min(860px, calc(100vw / var(--z, 1) - 40px));
  max-height: min(calc(88dvh / var(--z, 1)), 820px);
}

.modal-x {
  position: absolute;
  top: 14px;
  right: 14px;
}

.notice {
  background: var(--card);
  border-radius: var(--radius);
  padding: 12px 14px;
  margin: 12px 0;
  font-size: 14px;
}

.notice p:last-child {
  margin-bottom: 0;
}

.check {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  font-size: 14px;
  margin: 10px 0;
  cursor: pointer;
}

.check input {
  margin-top: 3px;
}

.drop {
  margin-top: 14px;
  border: 2px dashed var(--line-strong);
  border-radius: var(--radius);
  padding: 26px 16px;
  text-align: center;
  font-weight: 600;
  color: var(--ink-3);
  cursor: pointer;
  background: var(--white-veil);
}

.drop.over,
.drop:hover {
  background: #fff;
  border-color: var(--ink);
}

.progress {
  list-style: none;
  padding: 0;
  margin: 8px 0 16px;
  display: grid;
  gap: 8px;
}

.progress li {
  padding-left: 26px;
  position: relative;
  color: var(--muted);
}

.progress li::before {
  content: "";
  position: absolute;
  left: 4px;
  top: 6px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 2px solid var(--line-strong);
}

.progress li.done {
  color: var(--ink);
}

.progress li.done::before {
  background: var(--green);
  border-color: var(--green);
}

.review-summary {
  display: grid;
  gap: 4px;
  background: var(--card);
  border-radius: var(--radius);
  padding: 12px 14px;
  margin-bottom: 12px;
  font-size: 14px;
}

.record-h {
  margin: 16px 0 8px;
  font-size: 15px;
  font-weight: 600;
}

.record-h:first-child {
  margin-top: 0;
}

/* A tag under an input, not beside it: the input takes the cell's width. */
.review-table td > input + .tag {
  display: block;
  width: fit-content;
  margin: 2px 0 0 6px;
}

.review-table .tag.src {
  display: block;
  width: fit-content;
  margin-top: 4px;
}

.review-summary .warn {
  color: #8f1f1f;
  font-weight: 600;
}

.warnings {
  margin: 0 0 12px;
  padding-left: 18px;
  font-size: 13px;
  color: #8f1f1f;
}

.review-table-wrap {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  margin-bottom: 10px;
  max-height: calc(46dvh / var(--z, 1));
}

.review-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.review-table th {
  position: sticky;
  top: 0;
  background: var(--panel);
  text-align: left;
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--gold-text);
  padding: 8px 8px;
  border-bottom: 1px solid var(--line);
}

.review-table td {
  padding: 4px 6px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
  white-space: nowrap;
}

.review-table td:nth-child(3) {
  white-space: normal;
  min-width: 180px;
}

.review-table input,
.review-table select {
  width: 100%;
  min-width: 40px;
  height: 30px;
  padding: 0 6px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  font: inherit;
  color: var(--ink);
}

.review-table input:hover,
.review-table select:hover {
  border-color: var(--line);
}

.review-table input:focus,
.review-table select:focus {
  outline: 2px solid var(--ink);
  outline-offset: -1px;
  background: #fff;
}

.review-table input.code {
  font-family: var(--mono);
  font-size: 12px;
}

.review-table .unmatched-row td {
  background: #fff6e5;
}

.tag {
  display: inline-block;
  margin-left: 6px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #8a5a00;
  background: #ffe8b8;
  border-radius: 999px;
  padding: 2px 7px;
}

.row-del {
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  padding: 2px 6px;
}

.row-del:hover {
  color: #8f1f1f;
}

.unmatched {
  margin-top: 12px;
  font-size: 13px;
}

.unmatched summary {
  cursor: pointer;
  font-weight: 600;
}

.unmatched code {
  font-size: 12px;
}

@media (max-width: 640px) {
  .record-modal {
    width: calc(100vw / var(--z, 1) - 16px);
    padding: 22px 16px 18px;
  }
  .review-table-wrap {
    max-height: calc(40dvh / var(--z, 1));
  }
}

/* ------------------------------------------------------------------ *
 * Answer cards (cards.js) -- what a tool read, drawn: a grade bar, a
 * week grid, an audit checklist. They sit above the answer's words.
 * Status is always an icon and a word; colour only reinforces it.
 * ------------------------------------------------------------------ */

:root {
  --cc-bg: rgba(214, 208, 192, 0.72);
  --cc-bg-2: rgba(255, 255, 255, 0.7);
  --cc-inset: rgba(26, 21, 4, 0.06);
  --tone-good: #2f7a3e;
  --tone-info: #2a6fb8;
  --tone-warn: #8f5d00;
  --tone-serious: #a84a1f;
  --tone-bad: #b42323;
  /* Categorical, fixed order (dataviz reference palette, light steps). */
  --series-1: #2a78d6;
  --series-2: #eb6834;
  --series-3: #1baf7a;
  --series-4: #eda100;
  --series-5: #e87ba4;
  --series-6: #4a3aa7;
  /* Grades A..F: one gold hue, ordinal, darkest first (validated, light). */
  --grade-0: #4a3b10;
  --grade-1: #6e5a22;
  --grade-2: #927a3a;
  --grade-3: #b09656;
  --grade-4: #c4ab6a;
  --grade-ink-0: #fff;
  --grade-ink-1: #fff;
  --grade-ink-2: #fff;
}

.cards,
.gal-stage {
  container: cards / inline-size;
}

.cards {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 14px;
}

/* What Ndex read besides the answer's own card: chips that open in place. */
.cc-checked {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}

.cc-checked-label {
  font-size: 12px;
  color: var(--muted);
}

.cc-checked-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.cc-checked-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 100%;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: transparent;
  color: var(--text-2);
  font: inherit;
  font-size: 13px;
  cursor: pointer;
}

.cc-checked-chip span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cc-checked-chip .icon {
  width: 14px;
  height: 14px;
  flex: 0 0 auto;
  color: var(--muted);
}

.cc-checked-chip .chev {
  transition: transform 160ms ease;
}

.cc-checked-chip[aria-expanded="true"] {
  border-color: var(--ink);
  color: var(--ink);
}

.cc-checked-chip[aria-expanded="true"] .chev {
  transform: rotate(180deg);
}

.cc-checked-open:empty {
  display: none;
}

/* The answer's follow-ups. */
.next-slot:empty {
  display: none;
}

.next-steps {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.next-step {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: var(--cc-bg);
  color: var(--ink);
  font: inherit;
  font-size: 13.5px;
  cursor: pointer;
  text-align: left;
}

.next-step:hover {
  border-color: var(--ink);
}

.next-step .icon {
  width: 14px;
  height: 14px;
  color: var(--muted);
  flex: 0 0 auto;
}

body.streaming .next-step {
  opacity: 0.5;
  pointer-events: none;
}

.cc-open .cc-chip {
  font-weight: 500;
}

.cc-pw {
  margin-top: 4px;
  font-size: 11.5px;
  padding: 1px 7px;
}

.cc {
  background: var(--cc-bg);
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  padding: 14px 16px 12px;
  font-size: 14px;
  line-height: 1.45;
  color: var(--text-2);
  animation: fadeUp 240ms ease both;
  min-width: 0;
}

.cc .icon {
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
}

.cc-head {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.cc-glyph {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: var(--ink-veil);
  color: var(--gold-text);
  flex: 0 0 34px;
}

.cc-glyph .icon {
  width: 18px;
  height: 18px;
}

.cc-heading {
  min-width: 0;
  flex: 1;
}

.cc-kicker {
  display: flex;
  gap: 8px;
  align-items: center;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}

.cc-tier {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.cc-tier .icon {
  width: 13px;
  height: 13px;
}

.cc-tier.tier-opinion {
  color: var(--tone-serious);
}

.cc-title {
  font-size: 16px;
  font-weight: 800;
  color: var(--ink);
  margin: 1px 0 0;
  overflow-wrap: anywhere;
}

.cc-title-x {
  font-weight: 600;
  color: var(--text);
}

.cc-sub {
  font-size: 13px;
  color: var(--muted);
}

.cc-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 10px 0 0;
  align-items: center;
}

.cc-body {
  margin-top: 12px;
  min-width: 0;
}

.cc-chip,
.cc-stat,
.cc-status,
.cc-finish {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--cc-bg-2);
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
}

.cc-chip .icon,
.cc-stat .icon,
.cc-status .icon,
.cc-finish .icon {
  width: 13px;
  height: 13px;
}

.cc-stat b,
.cc-finish b {
  color: var(--ink);
  font-weight: 800;
}

.cc-finish {
  border-color: var(--gold);
  font-size: 13px;
}

.cc-finish em {
  font-style: normal;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--tone-warn);
}

.cc-trust.trust-estimate,
.cc-thin {
  color: var(--tone-warn);
}

.cc-trust.trust-unverified {
  color: var(--muted);
}

.cc-trust.trust-checked,
.cc-trust.trust-reviewed {
  color: var(--tone-good);
}

.tone-good { --tone: var(--tone-good); }
.tone-info { --tone: var(--tone-info); }
.tone-warn { --tone: var(--tone-warn); }
.tone-serious { --tone: var(--tone-serious); }
.tone-bad { --tone: var(--tone-bad); }
.tone-muted { --tone: var(--muted); }

.cc-status {
  color: var(--tone);
  border-color: color-mix(in srgb, var(--tone) 35%, transparent);
}

.cc-chip.tone-good,
.cc-chip.tone-warn {
  color: var(--tone);
}

.cc-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

.cc-source,
.cc-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--gold-text);
}

.cc-source:hover,
.cc-link:hover {
  color: var(--ink);
}

.cc-source .icon,
.cc-link .icon {
  width: 13px;
  height: 13px;
}

.cc-fine,
.cc-more {
  display: flex;
  gap: 6px;
  align-items: flex-start;
  font-size: 12.5px;
  color: var(--muted);
  margin: 10px 0 0;
}

.cc-fine .icon,
.cc-more .icon {
  width: 14px;
  height: 14px;
  margin-top: 1px;
}

.cc-muted {
  color: var(--muted);
}

.cc-empty {
  display: flex;
  gap: 8px;
  align-items: center;
  margin: 0;
  color: var(--text);
}

.cc-label {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
  margin-right: 4px;
}

.cc-label .icon {
  width: 13px;
  height: 13px;
}

.cc-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--line-strong);
  background: var(--cc-bg-2);
  border-radius: 999px;
  padding: 5px 12px;
  font-size: 13px;
  font-weight: 700;
  color: var(--ink);
  transition: background 0.12s ease, border-color 0.12s ease;
}

.cc-btn:hover {
  border-color: var(--gold);
}

.cc-btn.sm {
  padding: 3px 10px;
  font-size: 12px;
}

.cc-btn.sm .icon {
  width: 13px;
  height: 13px;
}

.cc-btn[disabled] {
  opacity: 0.6;
  cursor: default;
}

.cc-icon-btn {
  display: inline-grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  padding: 0;
  flex: 0 0 26px;
}

.cc-icon-btn:hover {
  background: var(--ink-veil);
  color: var(--ink);
}

.cc-icon-btn .icon {
  width: 15px;
  height: 15px;
}

/* A segmented control: options, terms, sort order. */
.cc-seg-ctl {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 2px;
  padding: 2px;
  border-radius: 10px;
  background: var(--ink-veil);
}

.cc-seg-ctl button {
  border: 0;
  background: transparent;
  border-radius: 8px;
  padding: 4px 10px;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--muted);
  display: inline-flex;
  gap: 6px;
  align-items: baseline;
}

.cc-seg-ctl button small {
  font-weight: 600;
  opacity: 0.8;
}

.cc-seg-ctl button[aria-pressed="true"] {
  background: var(--cc-bg-2);
  color: var(--ink);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
}

.cc-body > .cc-seg-ctl {
  margin-bottom: 10px;
}

/* Course chips, with the icon for their kind of class. */
.cc-chip.is-missing {
  border-style: dashed;
  border-color: var(--tone-bad);
  color: var(--ink);
}

.cc-chip.is-option {
  background: transparent;
}

.cc-chip.is-now {
  border-color: var(--tone-info);
}

.cc-chip-x {
  font-weight: 700;
  color: var(--muted);
  font-size: 11.5px;
}

.cc-gline {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  align-items: center;
  margin-top: 6px;
}

.cc-cond {
  color: var(--tone-warn);
  font-size: 13px;
  gap: 6px;
}

.cc-tooltip {
  position: fixed;
  z-index: 200;
  max-width: 280px;
  padding: 6px 10px;
  border-radius: 8px;
  background: var(--btn);
  color: var(--page);
  font-size: 12.5px;
  font-weight: 600;
  line-height: 1.35;
  pointer-events: none;
  box-shadow: var(--shadow-card);
}

.glass .cc-tooltip {
  background: #f6f4ef;
  color: #16171b;
}

/* Tables inside cards. */
.cc-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.cc-table th,
.cc-table td {
  text-align: left;
  padding: 7px 8px;
  border-top: 1px solid var(--line);
  vertical-align: top;
}

.cc-table thead th {
  border-top: 0;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}

.cc-table .num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.cc-table small {
  display: block;
  color: var(--muted);
}

.cc-table td > .icon,
.cc-table td[aria-hidden] .icon {
  color: var(--muted);
}

/* --- grades --- */
.cc-grows {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.cc-grow {
  display: grid;
  grid-template-columns: minmax(110px, 30%) 1fr 44px;
  gap: 10px;
  align-items: center;
}

.cc-gname {
  font-weight: 700;
  color: var(--ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cc-gname small {
  display: block;
  font-weight: 500;
  font-size: 11.5px;
  color: var(--muted);
}

.cc-grow.is-overall .cc-bar {
  height: 22px;
}

.cc-gdivider {
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
  border-top: 1px solid var(--line);
  padding-top: 8px;
  margin-top: 2px;
}

.cc-bar {
  display: flex;
  gap: 2px;
  height: 16px;
  min-width: 0;
}

.cc-seg {
  flex-basis: 0;
  min-width: 2px;
  border-radius: 2px;
  display: grid;
  place-items: center;
  font-size: 10.5px;
}

.cc-seg:first-child {
  border-radius: 4px 2px 2px 4px;
}

.cc-seg:last-child {
  border-radius: 2px 4px 4px 2px;
}

.cc-seg b {
  font-weight: 800;
}

.cc-seg.g0, .cc-legend i.g0 { background: var(--grade-0); color: var(--grade-ink-0); }
.cc-seg.g1, .cc-legend i.g1 { background: var(--grade-1); color: var(--grade-ink-1); }
.cc-seg.g2, .cc-legend i.g2 { background: var(--grade-2); color: var(--grade-ink-2); }
.cc-seg.g3, .cc-legend i.g3 { background: var(--grade-3); color: var(--ink); }
.cc-seg.g4, .cc-legend i.g4 { background: var(--grade-4); color: var(--ink); }

.cc-gpa {
  text-align: right;
  font-weight: 800;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

.cc-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 10px;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
}

.cc-legend span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.cc-legend i {
  width: 10px;
  height: 10px;
  border-radius: 3px;
  display: inline-block;
}

.cc-legend-icons .icon {
  width: 13px;
  height: 13px;
}

/* --- ratings --- */
.cc-profs {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 10px;
}

.cc-prof {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 10px 12px;
  background: var(--cc-inset);
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.cc-prof-head {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: flex-start;
}

.cc-prof-head b {
  color: var(--ink);
  display: block;
}

.cc-prof-head small {
  color: var(--muted);
}

.cc-meter {
  display: grid;
  grid-template-columns: 110px 1fr 42px;
  gap: 8px;
  align-items: center;
  font-size: 12.5px;
}

.cc-meter b {
  text-align: right;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

.cc-meter-label {
  color: var(--muted);
  font-weight: 600;
}

.cc-meter-track {
  height: 6px;
  border-radius: 999px;
  background: var(--ink-veil-strong);
  overflow: hidden;
}

.cc-meter-track span {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: var(--gold-text);
}

.cc-meter.invert .cc-meter-track span {
  background: var(--muted);
}

.cc-prof-course {
  display: flex;
  gap: 6px;
  align-items: center;
  font-size: 12.5px;
  margin: 2px 0 0;
}

.cc-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.cc-tags span {
  font-size: 11.5px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--ink-veil);
}

.cc-reviews summary,
.cc-done summary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--muted);
  cursor: pointer;
  list-style: none;
}

.cc-reviews summary::-webkit-details-marker,
.cc-done summary::-webkit-details-marker,
.cc-req summary::-webkit-details-marker {
  display: none;
}

.cc-reviews summary:hover,
.cc-done summary:hover {
  color: var(--ink);
}

.cc .chev {
  width: 12px;
  height: 12px;
  transition: transform 0.18s ease;
}

.cc details[open] > summary .chev {
  transform: rotate(180deg);
}

.cc-reviews blockquote {
  margin: 8px 0 0;
  padding: 6px 10px;
  border-left: 3px solid var(--gold);
  font-size: 13px;
}

.cc-reviews blockquote p {
  margin: 0;
}

.cc-reviews cite {
  font-style: normal;
  font-size: 11.5px;
  color: var(--muted);
}

.cc-done {
  margin-top: 10px;
}

/* --- schedule week --- */
.cc-week {
  display: grid;
  grid-template-columns: 40px repeat(5, minmax(0, 1fr));
  gap: 4px;
  --hour: 34px;
}

.cc-week-times {
  position: relative;
  margin-top: 22px;
  height: calc(var(--rows) * var(--hour));
}

.cc-week-times span {
  position: absolute;
  right: 4px;
  transform: translateY(-50%);
  font-size: 10.5px;
  font-weight: 600;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.cc-week-dname {
  height: 22px;
  text-align: center;
  font-size: 11.5px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.cc-week-col {
  position: relative;
  height: calc(var(--rows) * var(--hour));
  border-radius: 8px;
  background: var(--cc-inset);
}

.cc-week-col > i {
  position: absolute;
  left: 0;
  right: 0;
  border-top: 1px solid var(--line);
}

.cc-block {
  position: absolute;
  left: 2px;
  right: 2px;
  border-radius: 6px;
  padding: 3px 5px;
  overflow: hidden;
  background: color-mix(in srgb, var(--series) 22%, var(--cc-bg-2));
  border-left: 3px solid var(--series);
  color: var(--ink);
  font-size: 11px;
  line-height: 1.2;
}

.cc-block b {
  display: block;
  font-weight: 800;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cc-block span {
  display: block;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cc-block .cc-walk {
  position: absolute;
  top: 3px;
  right: 3px;
  width: 13px;
  height: 13px;
}

.cc-block.walk-far {
  outline: 2px solid var(--tone-bad);
  outline-offset: -1px;
}

.cc-block.walk-far .cc-walk {
  color: var(--tone-bad);
}

.cc-block.walk-tight .cc-walk {
  color: var(--tone-warn);
}

.s1 { --series: var(--series-1); }
.s2 { --series: var(--series-2); }
.s3 { --series: var(--series-3); }
.s4 { --series: var(--series-4); }
.s5 { --series: var(--series-5); }
.s6 { --series: var(--series-6); }

.cc-walks {
  list-style: none;
  padding: 0;
  margin: 10px 0 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 13px;
}

.cc-walks li {
  display: flex;
  gap: 8px;
  align-items: flex-start;
}

.cc-walks .icon {
  color: var(--tone);
  margin-top: 2px;
}

.cc-slist {
  list-style: none;
  padding: 0;
  margin: 12px 0 0;
  display: flex;
  flex-direction: column;
}

.cc-srow {
  display: grid;
  grid-template-columns: 10px auto auto 1fr auto auto;
  gap: 8px;
  align-items: center;
  padding: 6px 0;
  border-top: 1px solid var(--line);
  font-size: 13px;
}

.cc-swatch {
  width: 10px;
  height: 10px;
  border-radius: 3px;
  background: var(--series);
}

.cc-crn {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  font-family: var(--mono);
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink);
}

.cc-crn .cc-icon-btn {
  width: 22px;
  height: 22px;
  flex-basis: 22px;
}

.cc-crn .cc-icon-btn .icon {
  width: 13px;
  height: 13px;
}

.cc-when {
  font-variant-numeric: tabular-nums;
}

.cc-where {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--muted);
  white-space: nowrap;
}

.cc-where .icon {
  width: 13px;
  height: 13px;
}

.cc-leftout {
  margin-top: 12px;
}

.cc-leftout ul {
  list-style: none;
  padding: 0;
  margin: 6px 0 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.cc-leftout li {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  font-size: 13px;
  color: var(--text);
}

/* --- sections --- */
.cc-meet {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 10px;
  align-items: center;
  font-variant-numeric: tabular-nums;
}

.cc-meet + .cc-meet {
  margin-top: 3px;
}

.cc-days {
  display: inline-flex;
  gap: 2px;
}

.cc-days i {
  font-style: normal;
  font-size: 10.5px;
  font-weight: 800;
  width: 17px;
  height: 17px;
  display: grid;
  place-items: center;
  border-radius: 5px;
  color: var(--muted);
  opacity: 0.45;
}

.cc-days i.on {
  background: var(--gold);
  color: #1a1504;
  opacity: 1;
}

.cc-type {
  font-size: 11px;
}

/* --- plan --- */
.cc-terms {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(200px, 1fr);
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 4px;
  scroll-snap-type: x proximity;
}

.cc-term {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--cc-inset);
  padding: 10px;
  scroll-snap-align: start;
  min-width: 0;
}

.cc-term.is-last {
  border-color: var(--gold);
}

.cc-term header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 6px;
}

.cc-term header b {
  color: var(--ink);
}

.cc-term header span {
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
}

.cc-term ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.cc-term li {
  display: grid;
  grid-template-columns: 18px 1fr auto 16px;
  gap: 6px;
  align-items: center;
  font-size: 13px;
  padding: 3px 0;
}

.cc-term-ic .icon {
  width: 15px;
  height: 15px;
  color: var(--gold-text);
}

.cc-term-name {
  font-weight: 700;
  color: var(--ink);
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cc-term-name.is-label {
  font-weight: 600;
  color: var(--text);
}

.cc-term-cr {
  font-size: 12px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.cc-term-off .icon {
  width: 13px;
  height: 13px;
  color: var(--muted);
}

.cc-why {
  margin-top: 12px;
  padding: 8px 12px;
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--tone-warn) 9%, transparent);
}

.cc-why .cc-label {
  color: var(--tone-warn);
}

.cc-why ul {
  margin: 4px 0 0;
  padding-left: 18px;
  font-size: 13px;
}

/* --- audit / progress --- */
.cc-progress {
  margin-bottom: 10px;
}

.cc-progress-track {
  display: flex;
  gap: 2px;
  height: 10px;
  border-radius: 999px;
  background: var(--ink-veil-strong);
  overflow: hidden;
}

.cc-progress-track span.done {
  background: var(--gold-text);
  border-radius: 999px 2px 2px 999px;
}

.cc-progress-track span.prog {
  background: repeating-linear-gradient(135deg, var(--gold) 0 4px, color-mix(in srgb, var(--gold) 50%, transparent) 4px 8px);
  border-radius: 2px;
}

.cc-progress-key {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 14px;
  margin-top: 6px;
  font-size: 12.5px;
}

.cc-progress-key span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.cc-progress-key b {
  color: var(--ink);
}

.cc-progress-key i {
  width: 10px;
  height: 10px;
  border-radius: 3px;
}

.cc-progress-key i.done {
  background: var(--gold-text);
}

.cc-progress-key i.prog {
  background: repeating-linear-gradient(135deg, var(--gold) 0 3px, color-mix(in srgb, var(--gold) 50%, transparent) 3px 6px);
}

.cc-reqs {
  display: flex;
  flex-direction: column;
}

.cc-req {
  border-top: 1px solid var(--line);
}

.cc-reqs:first-child .cc-req:first-child {
  border-top: 0;
}

.cc-req summary {
  display: grid;
  grid-template-columns: 18px 18px 1fr auto 14px;
  gap: 8px;
  align-items: center;
  padding: 8px 0;
  cursor: pointer;
  list-style: none;
}

.cc-req[data-empty] summary {
  cursor: default;
  grid-template-columns: 18px 18px 1fr auto;
}

.cc-req-st .icon {
  color: var(--tone);
}

.cc-req-ic .icon {
  color: var(--muted);
  width: 15px;
  height: 15px;
}

.cc-req-title {
  font-weight: 700;
  color: var(--ink);
  min-width: 0;
}

.cc-req-title small {
  display: block;
  font-weight: 500;
  font-size: 12.5px;
  color: var(--muted);
}

.cc-req-count {
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.cc-req-body {
  padding: 0 0 10px 52px;
}

.cc-notes {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 8px;
  font-size: 13px;
}

.cc-notes b {
  color: var(--ink);
}

.cc-notes p {
  margin: 2px 0 0;
}

/* --- pathways --- */
.cc-concepts {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 8px;
}

.cc-concept {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 9px 10px;
  background: var(--cc-inset);
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.cc-concept-head {
  display: flex;
  align-items: center;
  gap: 6px;
}

.cc-concept-ic .icon {
  color: var(--gold-text);
}

.cc-concept-n {
  font-weight: 800;
  color: var(--muted);
  font-size: 12px;
}

.cc-concept-st {
  margin-left: auto;
}

.cc-concept-st .icon {
  color: var(--tone);
}

.cc-concept-name {
  font-size: 13px;
  color: var(--ink);
  line-height: 1.25;
}

.cc-concept small {
  font-size: 12px;
  color: var(--muted);
}

.cc-mini {
  height: 5px;
  border-radius: 999px;
  background: var(--ink-veil-strong);
  overflow: hidden;
}

.cc-mini span {
  display: block;
  height: 100%;
  background: var(--tone);
  border-radius: 999px;
}

.cc-concept.tone-muted .cc-mini span {
  background: var(--muted);
}

.cc-concept-courses {
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
}

.cc-concept-courses span {
  font-size: 11px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 999px;
  background: var(--ink-veil);
}

.cc-concept-courses span.is-now {
  outline: 1px solid var(--tone-info);
}

.cc-integr {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 10px;
  font-size: 13px;
}

.cc-integr div {
  display: flex;
  gap: 6px;
  align-items: center;
  flex-wrap: wrap;
}

.cc-integr span {
  color: var(--muted);
}

/* --- graduation / prereqs --- */
.cc-checks,
ul.cc-prereqs {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
}

.cc-check {
  display: grid;
  grid-template-columns: 112px 1fr auto;
  gap: 10px;
  align-items: start;
  padding: 8px 0;
  border-top: 1px solid var(--line);
}

.cc-checks:first-child > .cc-check:first-child {
  border-top: 0;
}

.cc-check b {
  color: var(--ink);
}

.cc-check p {
  margin: 1px 0 0;
  font-size: 13px;
}

.cc-check .cc-status {
  justify-self: start;
}

ul.cc-prereqs li {
  padding: 8px 0;
  border-top: 1px solid var(--line);
}

ul.cc-prereqs li:first-child {
  border-top: 0;
  padding-top: 0;
}

.cc-pr-head {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.cc-pr-title {
  font-weight: 700;
  color: var(--ink);
  flex: 1;
  min-width: 120px;
}

.cc-pr-rule {
  display: flex;
  gap: 6px;
  align-items: flex-start;
  margin: 6px 0 0;
  font-size: 13px;
  font-family: var(--mono);
  color: var(--text);
}

.cc-pr-rule .icon {
  color: var(--muted);
  margin-top: 1px;
}

/* --- dates --- */
.cc-dates {
  list-style: none;
  padding: 0;
  margin: 6px 0 0;
  display: flex;
  flex-direction: column;
}

.cc-dates li {
  display: grid;
  grid-template-columns: 44px 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 6px 0;
  border-top: 1px solid var(--line);
}

.cc-dates li:first-child {
  border-top: 0;
}

.cc-dates li.is-past {
  opacity: 0.55;
}

.cc-date {
  display: flex;
  flex-direction: column;
  align-items: center;
  border-radius: 9px;
  background: var(--ink-veil);
  padding: 3px 0;
  font-size: 15px;
  font-weight: 800;
  line-height: 1.1;
  color: var(--ink);
}

.cc-date b {
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--gold-text);
}

.cc-dates li.is-soon .cc-date {
  background: color-mix(in srgb, var(--gold) 35%, transparent);
}

.cc-dates li > span:nth-child(2) b,
.cc-ev b {
  color: var(--ink);
  font-weight: 700;
}

.cc-dates small {
  display: block;
  font-size: 12px;
  color: var(--muted);
}

.cc-ev {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  min-width: 0;
}

.cc-ev-ic .icon {
  color: var(--muted);
  margin-top: 2px;
}

/* --- what-if --- */
.cc-compare th:first-child {
  color: var(--text);
  font-weight: 700;
}

.cc-compare tr.is-changed td b {
  color: var(--gold-text);
}

.cc-tto {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  flex-wrap: wrap;
}

.cc-tto em {
  font-style: normal;
  font-size: 11px;
}

/* --- record --- */
.cc-spark {
  display: flex;
  gap: 8px;
  align-items: flex-end;
  height: 104px;
  padding-top: 4px;
}

.cc-spark > div {
  flex: 1;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: center;
  gap: 4px;
  max-width: 56px;
}

.cc-spark span {
  width: 100%;
  border-radius: 4px 4px 0 0;
  background: var(--gold-text);
}

.cc-spark b {
  font-size: 11.5px;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

.cc-spark small {
  font-size: 10.5px;
  font-weight: 700;
  color: var(--muted);
  white-space: nowrap;
}

/* Inline citations: the URL becomes a numbered mark that opens the page and
 * matches its line in the sources list. */
.cite {
  display: inline-grid;
  place-items: center;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  margin: 0 0 0 2px;
  border-radius: 6px;
  background: var(--ink-veil-strong);
  color: var(--gold-text);
  font-size: 11px;
  font-weight: 800;
  line-height: 1;
  vertical-align: 2px;
  text-decoration: none !important;
}

.prose a.cite:hover {
  background: var(--gold);
  color: #1a1504;
}

.citations ol {
  counter-reset: none;
}

/* Narrow: the cards answer to the width they are given (the chat column,
 * the gallery's phone preview), not the window. */
@container cards (max-width: 560px) {
  .cc {
    padding: 12px 12px 10px;
  }
  .cc-glyph {
    display: none;
  }
  .cc-week {
    --hour: 30px;
    grid-template-columns: 30px repeat(5, minmax(0, 1fr));
  }
  .cc-block span {
    display: none;
  }
  .cc-srow {
    grid-template-columns: 10px auto 1fr auto;
  }
  .cc-srow .cc-when,
  .cc-srow .cc-where {
    grid-column: 2 / -1;
  }
  .cc-check {
    grid-template-columns: 1fr auto;
  }
  .cc-check .cc-status {
    grid-column: 1 / -1;
  }
  .cc-grow {
    grid-template-columns: 1fr 40px;
  }
  .cc-grow .cc-bar {
    grid-column: 1 / -1;
    grid-row: 2;
  }
  .cc-req-body {
    padding-left: 26px;
  }
  .cc-meter {
    grid-template-columns: 96px 1fr 38px;
  }
}

.prose .table-wrap {
  overflow-x: auto;
  margin: 0 0 14px;
}

.prose .table-wrap table {
  margin: 0;
}

.menu-item.is-soon .menu-item-note {
  color: var(--gold-text);
  font-weight: 700;
}

.ob-note {
  display: block;
  margin-top: 6px;
  font-size: 12.5px;
  color: var(--muted);
}

/* ------------------------------------------------------------------ *
 * UI gallery (gallery.js): a full-screen review page in Dev tools.
 * ------------------------------------------------------------------ */

.gallery {
  position: fixed;
  inset: 0;
  z-index: 25;
  display: grid;
  grid-template-columns: 270px 1fr;
  background: var(--page);
  color: var(--text);
}

.glass .gallery {
  background: #16171b;
}

.glass .gallery::before {
  content: "";
  position: absolute;
  inset: -60px;
  z-index: -1;
  background: var(--backdrop-image) center / cover no-repeat;
  filter: blur(var(--backdrop-blur)) saturate(1.25) brightness(0.45);
}

.gallery.is-behind {
  z-index: 9;
}

.gal-nav {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 18px 14px;
  border-right: 1px solid var(--line);
  background: var(--panel);
  min-height: 0;
}

.gal-brand {
  display: flex;
  gap: 8px;
  align-items: center;
  color: var(--ink);
  font-size: 16px;
}

.gal-brand .icon {
  width: 18px;
  height: 18px;
  color: var(--gold-text);
}

.gal-tools {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.gal-tools .cc-seg-ctl {
  align-self: flex-start;
}

.gal-links {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 1px;
  font-size: 13px;
  margin: 0 -6px;
}

.gal-links a {
  display: flex;
  gap: 8px;
  padding: 4px 6px;
  border-radius: 7px;
  color: var(--text);
}

.gal-links a:hover {
  background: var(--ink-veil);
  color: var(--ink);
}

.gal-links a span {
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--muted);
  min-width: 30px;
}

.gal-links .gal-link-head {
  margin-top: 10px;
  font-size: 11.5px;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted);
}

.gal-foot {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.gal-foot .cc-btn {
  justify-content: center;
}

.gal-main {
  overflow-y: auto;
  min-height: 0;
  padding: 28px 24px 80px;
}

.gal-column {
  max-width: var(--column);
  margin: 0 auto;
  transition: max-width 300ms var(--ease);
}

.gallery.is-phone .gal-column {
  max-width: 390px;
}

.gal-section {
  margin: 34px 0 14px;
  scroll-margin-top: 20px;
}

.gal-section:first-child {
  margin-top: 0;
}

.gal-section h2 {
  font-size: 24px;
}

.gal-section p {
  margin: 4px 0 0;
  color: var(--muted);
}

.gal-piece {
  margin: 0 0 22px;
  scroll-margin-top: 20px;
}

.gal-piece-head {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin-bottom: 8px;
}

.gal-piece-head h3 {
  font-size: 15px;
}

.gal-piece-head p {
  margin: 1px 0 0;
  font-size: 13px;
  color: var(--muted);
}

.gal-tool {
  display: inline-flex;
  gap: 5px;
  align-items: center;
  font-family: var(--mono);
  font-size: 12px !important;
}

.gal-tool .icon {
  width: 12px;
  height: 12px;
}

.gal-id {
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 6px;
  background: var(--gold);
  color: #1a1504;
  margin-top: 1px;
}

.gal-stage {
  padding: 14px;
  border-radius: var(--radius-panel);
  border: 1px dashed var(--line-strong);
}

.gal-thread {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.gal-thread .msg-user {
  align-self: flex-end;
}

.gal-note {
  display: block;
  margin-top: 8px;
}

.gal-note span {
  display: inline-flex;
  gap: 5px;
  align-items: center;
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
}

.gal-note .icon {
  width: 12px;
  height: 12px;
}

.gal-note textarea {
  display: block;
  width: 100%;
  margin-top: 4px;
  padding: 8px 10px;
  border-radius: var(--radius);
  border: 1px solid var(--line-strong);
  background: var(--cc-bg);
  resize: vertical;
  font-size: 13.5px;
}

.dev-gallery {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-bottom: 8px;
}

@media (max-width: 760px) {
  .gallery {
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr;
  }
  .gal-nav {
    border-right: 0;
    border-bottom: 1px solid var(--line);
    padding: 10px 12px;
  }
  .gal-links {
    display: none;
  }
  .gal-foot {
    flex-direction: row;
    flex-wrap: wrap;
  }
  .gal-main {
    padding: 18px 12px 60px;
  }
}

/* Buttons and controls from cards.js used outside a card (the gallery). */
.cc-btn .icon,
.gal-nav .icon,
.gal-stage > .cc-btn .icon {
  width: 15px;
  height: 15px;
  flex: 0 0 auto;
}
