:root {
  /* Departure board: in the light theme a plain white one (2026-10-27: "白天应该是纯白色的"); the dark theme keeps the navy board */
  --board: #ffffff;
  --board-2: #f6f8fb; /* white with the faintest cool tint toward the list (2026-10-27: "不要太寡淡 底色微微有一点") */
  --board-line: #e1e5eb;
  --board-ink: #141821;
  --board-muted: #5e6572;
  --board-accent: #141821; /* the board's chosen values: ink (2026-10-29: amber is kept for the logo, the main button, the cart count and ＋) */
  --amber: #f5b544;
  --on-amber: #0e1726; /* words on an amber fill */
  --glass: 20, 24, 33; /* the tint of a fill or a hover on the board: ink on white, white on navy */
  --card-edge: #dfe3ea;
  --board-text: #2b313c; /* the board's sentence and notes */
  --board-edge: #c9ced8; /* an outlined button on the board */

  /* Page */
  --bg: #f3f5f8; /* a cool, barely-there tint under white cards: the cards and their words stand out */
  --surface: #ffffff;
  --surface-2: #f4f6f9;
  --ink: #0f131a;
  --muted: #4b5261; /* 7:1 on white, 6:1 on the tinted fills the small grey text sits on */
  --line: #e1e5eb;
  --accent: #0f131a; /* links and small accents: ink, underlined (2026-10-29) */
  --focus: #2563eb;

  /* Verdicts */
  --ok: #13703d;
  --ok-bg: #dcf3e5;
  --ok-solid: #22a05a;
  --ok-fill: #13703d; /* a fill that carries white text (6:1); the dot greens above are for marks, not for words, and neither theme changes it */
  --check: #2459a6; /* "Check first": blue on a pale blue (2026-10-29) */
  --check-bg: #e4ecf8;
  --check-solid: #4a7bd0;
  --no: #a8434a; /* "Doesn't fit": a soft red, quieter than a warning */
  --no-bg: #fbecee;
  --no-solid: #e0868b;
  --no-fill: #b0232f; /* the same for a red button */

  /* 24-hour bars */
  --track: #eef0f3;
  --night: #dfe2e7;
  --window: rgba(34, 160, 90, 0.16);
  --window-edge: rgba(34, 160, 90, 0.55);
  --sec-s: 62%; /* shortlist week chart: one hue per section */
  --sec-l: 46%;

  --shadow: 0 1px 2px rgba(20, 24, 33, 0.05), 0 6px 20px rgba(20, 24, 33, 0.06);
  --radius: 16px;
  --display: "Space Grotesk", "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;
  color-scheme: light;
}

/* dark: follows the system unless the visitor picked light (html[data-theme]); the copy after it is their own pick */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --board-line: #24324d;
    --board-ink: #f3efe6;
    --board-muted: #93a0b8;
    --board-accent: #f3efe6;
    --on-amber: #0a111e;
    --glass: 255, 255, 255;
    --card-edge: transparent;
    --board-text: #d9dfea;
    --board-edge: rgba(243, 239, 230, 0.6);
    --board: #0a111e;
    --board-2: #121c30;
    --bg: #0d1119;
    --surface: #151b27;
    --surface-2: #1a2130;
    --ink: #ece9e2;
    --muted: #98a0ad;
    --line: #262e3d;
    --accent: #ece9e2;
    --focus: #7aa2ff;
    --ok: #6fd69a;
    --ok-bg: #12301f;
    --check: #9dbdf2;
    --check-bg: #172640;
    --check-solid: #5b8be0;
    --no: #f68b91;
    --no-bg: #3a1619;
    --track: #232b3a;
    --night: #1b2230;
    --window: rgba(34, 160, 90, 0.22);
    --window-edge: rgba(111, 214, 154, 0.6);
    --sec-l: 60%;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.35), 0 8px 24px rgba(0, 0, 0, 0.3);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
    --board-line: #24324d;
    --board-ink: #f3efe6;
    --board-muted: #93a0b8;
    --board-accent: #f5b544;
    --on-amber: #0a111e;
    --glass: 255, 255, 255;
    --card-edge: transparent;
    --board-text: #d9dfea;
    --board-edge: rgba(243, 239, 230, 0.6);
    --board: #0a111e;
    --board-2: #121c30;
    --bg: #0d1119;
    --surface: #151b27;
    --surface-2: #1a2130;
    --ink: #ece9e2;
    --muted: #98a0ad;
    --line: #262e3d;
    --accent: #4fc3b5;
    --focus: #7aa2ff;
    --ok: #6fd69a;
    --ok-bg: #12301f;
    --check: #f3c46a;
    --check-bg: #33270f;
    --no: #f68b91;
    --no-bg: #3a1619;
    --track: #232b3a;
    --night: #1b2230;
    --window: rgba(34, 160, 90, 0.22);
    --window-edge: rgba(111, 214, 154, 0.6);
    --sec-l: 60%;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.35), 0 8px 24px rgba(0, 0, 0, 0.3);
    color-scheme: dark;
  }

@media (prefers-color-scheme: dark) {
  :where(:root:not([data-theme="light"])) body { background: radial-gradient(1400px 700px at 70% 520px, rgba(80, 120, 255, 0.07), transparent 70%), var(--bg); }
  :where(:root:not([data-theme="light"])) .card, :where(:root:not([data-theme="light"])) .panel, :where(:root:not([data-theme="light"])) .blocker, :where(:root:not([data-theme="light"])) .search input { border-color: rgba(255, 255, 255, 0.06); }
  :where(:root:not([data-theme="light"])) .card { border: 1px solid rgba(255, 255, 255, 0.06); }
  :where(:root:not([data-theme="light"])) .card:hover { border-color: rgba(255, 255, 255, 0.14); }
  :where(:root:not([data-theme="light"])) .panel { box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.06), var(--shadow); }
}
:where(:root[data-theme="dark"]) body { background: radial-gradient(1400px 700px at 70% 520px, rgba(80, 120, 255, 0.07), transparent 70%), var(--bg); }
  :where(:root[data-theme="dark"]) .card, :where(:root[data-theme="dark"]) .panel, :where(:root[data-theme="dark"]) .blocker, :where(:root[data-theme="dark"]) .search input { border-color: rgba(255, 255, 255, 0.06); }
  :where(:root[data-theme="dark"]) .card { border: 1px solid rgba(255, 255, 255, 0.06); }
  :where(:root[data-theme="dark"]) .card:hover { border-color: rgba(255, 255, 255, 0.14); }
  :where(:root[data-theme="dark"]) .panel { box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.06), var(--shadow); }

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 15px/1.5 var(--sans); -webkit-font-smoothing: antialiased;
}
button { font: inherit; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Board (header) ---------- */
.board {
  background: linear-gradient(180deg, var(--board) 0%, var(--board-2) 100%);
  color: var(--board-ink);
  border-bottom: 1px solid var(--board-line);
}
.board-inner { max-width: 1280px; margin: 0 auto; padding: 22px 28px 26px; }

.brand { display: flex; align-items: center; gap: 10px; min-height: 44px; color: inherit; text-decoration: none; cursor: pointer; border-radius: 12px; }
.brand:focus-visible { outline: 2px solid var(--amber); outline-offset: 4px; }
.logo {
  width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center;
  background: var(--amber); color: var(--on-amber); font-weight: 800; font-size: 18px;
}
.name { font-family: var(--display); font-size: 22px; font-weight: 700; letter-spacing: -0.01em; }
.for {
  font-size: 12px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--board-muted);
  border: 1px solid var(--board-line); border-radius: 999px; padding: 2px 9px;
}

.clocks { display: flex; gap: 10px; flex-wrap: wrap; }

.board h1 {
  font-family: var(--display); font-weight: 700; letter-spacing: -0.025em; line-height: 1.05;
  font-size: clamp(28px, 3.6vw, 44px); margin: 30px 0 14px; max-width: 26ch; text-wrap: balance;
}
.board h1:lang(zh) { word-break: keep-all; }

.situation {
  display: flex; flex-wrap: wrap; align-items: baseline; column-gap: 9px; row-gap: 4px;
  font-size: clamp(17px, 1.9vw, 22px); line-height: 1.9; color: var(--board-text); max-width: 1000px;
}
.situation .break { flex-basis: 100%; height: 0; }
.field select {
  field-sizing: content; max-width: 70vw;
  font: inherit; font-weight: 600; color: var(--board-accent); background: transparent;
  border: none; border-bottom: 2px dashed rgba(245, 181, 68, 0.7); border-radius: 0;
  padding: 0 22px 0 2px; cursor: pointer; appearance: none; -webkit-appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--amber) 50%), linear-gradient(135deg, var(--amber) 50%, transparent 50%);
  background-position: calc(100% - 9px) 58%, calc(100% - 4px) 58%; background-size: 5px 5px; background-repeat: no-repeat;
}
.field select:hover { border-bottom-style: solid; }
.field select option, .field select optgroup { color: #141821; background: #fff; }

/* World map: a quiet backdrop in the right ~42% of the header, fading out to the left, never behind the text and form on the left.
   Land is faint (10% of one flat colour: the header's dimmest text, #93a0b8, still reads at 4.5:1 on a lit dot); the one bright dot is where the student will be. It does not animate. */
.board { position: relative; }
.board-inner { position: relative; z-index: 1; }

/* The text and the form keep to the left of the map: the left edge of .board-inner's content to 16px short of the map */
@media (min-width: 768px) {
  .board-inner { --board-left: max(28px, calc(50vw - 612px)); }
  .board h1,
.situation,
.busy-row,
.about-row { max-width: min(1000px, calc(58vw - var(--board-left) - 16px)); }
  .board h1 { max-width: min(26ch, calc(58vw - var(--board-left) - 16px)); }

  .board h1 { margin-top: 6px; }
}

/* Scoreboard tiles */
.scoreboard { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-top: 24px; }

.board-note { grid-column: 1 / -1; font-size: 13px; color: var(--board-muted); margin-top: 2px; }
.loading { grid-column: 1 / -1; display: grid; gap: 10px; padding: 14px 0 4px; color: var(--board-text); }
.loading .hint { font-size: 13px; color: var(--board-muted); }
.loading progress {
  width: 100%; max-width: 420px; height: 6px; border-radius: 999px; overflow: hidden;
  appearance: none; -webkit-appearance: none; border: none; background: var(--board-line);
}
.loading progress::-webkit-progress-bar { background: var(--board-line); }
.loading progress::-webkit-progress-value { background: var(--amber); border-radius: 999px; }
.loading progress::-moz-progress-bar { background: var(--amber); }

/* ---------- Banner ---------- */
.banner {
  max-width: 1224px; margin: 16px auto 0; padding: 11px 16px; border-radius: 12px;
  background: var(--check-bg); color: var(--check); font-weight: 600;
}

/* ---------- Layout ---------- */
.layout {
  max-width: 1280px; margin: 0 auto; padding: 12px 28px 56px;
  display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 28px; align-items: start;
}
.side { position: sticky; top: 18px; max-height: calc(100vh - 36px); overflow: auto; border-radius: var(--radius); }

.toolbar { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
/* The filters above the list (filters-ui.js, core/list-filters.js): the bar of four, the chips, and the "More filters" panel */
.sec-filters { flex: 1 1 100%; display: grid; gap: 10px; min-width: 0; }
.sec-filters[hidden] { display: none; }
.fbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; }
.fsel {
  display: inline-flex; align-items: center; gap: 8px; min-height: 40px; max-width: 100%; padding: 0 8px 0 14px;
  border: 1px solid var(--line); border-radius: 999px; background: var(--surface); box-shadow: var(--shadow);
  font-size: 13px; font-weight: 650; color: var(--muted);
}
.fsel:focus-within { outline: 2px solid var(--focus); outline-offset: 2px; }
.fsel-k { white-space: nowrap; }
.fsel select {
  min-width: 0; max-width: 250px; min-height: 40px; padding: 0 18px 0 2px; font: inherit; font-size: 14px; font-weight: 650; color: var(--ink);
  -webkit-appearance: none; appearance: none; cursor: pointer; text-overflow: ellipsis; border: 0; outline: none; border-radius: 0;
  background: transparent url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' fill='none' stroke='%238a909c' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M1 1l4 4 4-4'/%3E%3C/svg%3E") no-repeat right 4px center;
  field-sizing: content; /* as wide as the option shown, not the longest one (browsers without it use the longest) */
}
.fsel select option:disabled { color: var(--muted); }
.fbtn {
  display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 0 16px; font: inherit; font-size: 14px; font-weight: 650;
  white-space: nowrap; cursor: pointer; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: 999px; box-shadow: var(--shadow);
}
.fbtn:hover:not(:disabled) { border-color: var(--muted); }
.fbtn:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.fbtn .fn { font-weight: 500; color: var(--muted); font-variant-numeric: tabular-nums; }
.fbtn[aria-pressed="true"] { color: var(--accent); border-color: var(--accent); background: color-mix(in srgb, var(--accent) 12%, var(--surface)); }
.fbtn[aria-pressed="true"] .fn { color: inherit; }
.fbtn:disabled { opacity: 0.5; cursor: not-allowed; box-shadow: none; }
.fmore { margin-inline-start: auto; }
.fbtn-gpa .fl-long { display: none; } /* "低考试占比": half a phone's width cannot hold the full words (below) */
.fcount {
  display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px;
  background: var(--accent); color: var(--surface); font: 700 12px/1 var(--mono);
}
.fchips { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; }
.fchip { display: inline-flex; align-items: center; max-width: 100%; min-height: 30px; padding: 0; font: inherit; text-align: left; cursor: pointer; color: var(--ink); background: none; border: 0; }
.fchip-in {
  display: inline-flex; align-items: center; gap: 6px; min-height: 30px; max-width: 100%; padding: 0 8px 0 12px; font-size: 12.5px; font-weight: 650; border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--accent) 45%, var(--line)); background: color-mix(in srgb, var(--accent) 10%, var(--surface));
}
.fchip:focus-visible { outline: none; }
.fchip:focus-visible .fchip-in { outline: 2px solid var(--focus); outline-offset: 2px; }
.fchip:hover .fchip-in { border-color: var(--accent); }
.flink:focus-visible, .fp-close:focus-visible, .fp-opt:focus-visible, .fp-show:focus-visible, .fp-select:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.fchip .x { font-size: 16px; line-height: 1; color: var(--muted); }
.fchip:hover .x { color: var(--no); }
.fchip .vdot { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.vdot.takeable { background: var(--ok-solid); }
.vdot.check { background: var(--check-solid); }
.vdot.no { background: var(--no-solid); }
.flink { font: inherit; font-size: 13px; font-weight: 650; color: var(--accent); background: none; border: 0; padding: 6px 4px; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.flink[hidden] { display: none; }
/* "More filters": a panel that slides in from the right and leaves the cards beside it; a full-height sheet on a phone */
.filters-panel {
  /* a card floating at the right: it ends above the "Ask Takeable" button, which stays in reach, and leaves the cards beside it */
  position: fixed; top: 76px; right: 16px; bottom: 82px; z-index: 28; width: min(380px, calc(100vw - 32px)); display: flex; flex-direction: column;
  background: var(--surface); color: var(--ink); border: 1px solid var(--line); border-radius: 16px; box-shadow: 0 18px 50px rgba(14, 23, 38, 0.28); overflow: hidden;
  transform: translateX(calc(100% + 32px)); visibility: hidden; transition: transform 0.22s ease, visibility 0s linear 0.22s;
}
.filters-panel.open { transform: none; visibility: visible; transition: transform 0.22s ease; }
.fp-head { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.fp-head h2 { flex: 1; margin: 0; font-family: var(--display); font-size: 18px; }
.fp-close {
  display: grid; place-items: center; width: 40px; height: 40px; padding: 0; font-size: 24px; line-height: 1; color: var(--ink); cursor: pointer;
  background: var(--surface); border: 1px solid var(--line); border-radius: 50%;
}
.fp-body { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 4px 16px 16px; }
.fp-group { padding: 14px 0 2px; border-bottom: 1px solid var(--line); }
.fp-group > h3 { margin: 0 0 10px; font-family: var(--display); font-size: 12px; font-weight: 700; letter-spacing: 0.07em; text-transform: uppercase; color: var(--muted); }
.fp-field { margin: 0 0 14px; min-width: 0; }
.fp-label { display: block; margin: 0 0 7px; font-size: 13px; font-weight: 650; }
.fp-opts { display: flex; flex-wrap: wrap; gap: 7px; }
.fp-opt {
  display: inline-flex; align-items: center; gap: 8px; min-height: 36px; max-width: 100%; padding: 4px 12px; font: inherit; font-size: 13.5px; text-align: left; cursor: pointer;
  color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: 999px;
}
.fp-opt .n { flex: none; font-size: 12.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.fp-opt:hover:not(:disabled) { border-color: var(--muted); }
.fp-opt[aria-pressed="true"] { font-weight: 650; border-color: var(--accent); background: color-mix(in srgb, var(--accent) 12%, var(--surface)); }
.fp-opt[aria-pressed="true"] .n { color: inherit; }
.fp-opt:disabled { opacity: 0.45; cursor: not-allowed; background: var(--surface-2); }
.fp-select {
  width: 100%; min-height: 42px; padding: 0 10px; font: inherit; font-size: 14px; color: var(--ink);
  background: var(--surface); border: 1px solid var(--line); border-radius: 10px; text-overflow: ellipsis;
}
.fp-select option:disabled { color: var(--muted); }
.fp-note { margin: 14px 0 0; font-size: 12px; color: var(--muted); }
.fp-hint { margin: -4px 0 12px; font-size: 12px; line-height: 1.5; color: var(--muted); }
.fp-hint + .fp-hint { margin-top: -6px; }
.fp-foot {
  display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 16px calc(12px + env(safe-area-inset-bottom, 0px));
  border-top: 1px solid var(--line); background: var(--surface);
}
.fp-show { flex: 1 1 auto; min-height: 44px; padding: 0 18px; font: inherit; font-size: 14.5px; font-weight: 700; color: var(--board-ink); cursor: pointer; background: var(--board); border: 1px solid var(--board-line); border-radius: 12px; }
.fp-foot .flink[hidden] + .fp-show { margin-inline-start: auto; }
.filter-note:empty { display: none; }
@media (prefers-reduced-motion: reduce) { .filters-panel, .filters-panel.open { transition: none; } }
@media (pointer: coarse) { .fchips { gap: 0 6px; } .fsel select, .fbtn, .fsel, .fchip, .fp-opt, .flink, .fp-show { min-height: 44px; } .fp-close { width: 44px; height: 44px; } }
@media (max-width: 640px) {
  .fbar { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .fsel { min-width: 0; }
  .fsel select { flex: 1 1 auto; max-width: none; width: 100%; }
  .fmore { margin-inline-start: 0; justify-content: center; }
  .fbtn { justify-content: center; }
  .filters-panel { top: 0; right: 0; bottom: 0; width: 100vw; height: 100dvh; border: 0; border-radius: 0; box-shadow: none; transform: translateY(105%); }
  html.fp-open .chat-launcher { display: none; } /* the sheet is the screen: the chat button comes back when it closes */
  .filters-panel.open { transform: none; }
  html.fp-open { overflow: hidden; }
}
.search { position: relative; flex: 1 1 320px; }
.search-icon { position: absolute; left: 14px; top: 50%; transform: translateY(-52%); color: var(--muted); font-size: 18px; }
.search input {
  width: 100%; font: inherit; padding: 12px 14px 12px 40px; border-radius: 12px;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink); box-shadow: var(--shadow);
}
.filter-note { font-size: 14px; color: var(--muted); }
.filter-note button {
  border: none; background: var(--surface); color: var(--ink); border-radius: 999px; padding: 6px 12px;
  box-shadow: var(--shadow); cursor: pointer; font-weight: 600;
}

/* ---------- Groups and cards ---------- */
.group { margin-top: 26px; }
.group-head { display: flex; align-items: center; gap: 10px; margin: 0 2px 10px; }
.group-head h2 {
  margin: 0; font-family: var(--display); font-size: 15px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase;
}
.group-head .dot { width: 10px; height: 10px; border-radius: 50%; }
.group-head.takeable .dot { background: var(--ok-solid); }
.group-head.check .dot { background: var(--check-solid); }
.group-head.no .dot { background: var(--no-solid); }
.group-head .n { color: var(--muted); font-family: var(--mono); font-size: 13px; }
.group-head.school h2 { text-transform: none; letter-spacing: 0; font-size: 16px; }
.cards { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }

.card {
  position: relative; display: grid; grid-template-columns: minmax(0, 1fr) 270px auto; gap: 8px 22px; align-items: center;
  background: var(--surface); border-radius: 14px; box-shadow: var(--shadow); padding: 14px 16px 14px 20px; cursor: pointer;
  border: 1px solid var(--card-edge); transition: border-color 0.12s ease, transform 0.12s ease;
}
.card:hover { border-color: var(--line); transform: translateY(-1px); }
.card.open { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent), var(--shadow); }
.card:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }

.info { min-width: 0; display: grid; gap: 4px; }
.meta { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; font-size: 13.5px; color: var(--muted); }
.code {
  font-family: var(--mono); font-size: 13px; font-weight: 700; color: var(--ink);
  background: var(--surface-2); border: 1px solid var(--line); border-radius: 6px; padding: 1px 7px; white-space: nowrap;
}
/* a course's name, the line read first: larger and heavier than the lines under it (2026-10-27: "课程字体可以更清晰一些") */
.title { font-weight: 700; font-size: 17px; line-height: 1.3; letter-spacing: -0.005em; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.meta .sec { font-family: var(--mono); font-size: 13px; color: var(--muted); }
.why { display: flex; gap: 7px; align-items: baseline; font-size: 14.5px; color: var(--muted); }
.why .mark { font-weight: 800; font-size: 12px; }
.why.fail { color: var(--no); }
.why.check { color: var(--check); }
.why.pass { color: var(--ok); }
.why.info { color: var(--muted); }
.why.info .mark { font-style: italic; font-family: var(--mono); }
/* the next step after a reason, and the one-tap change that settles it */
.why .step, .reason-item .step { color: var(--muted); font-weight: 400; }
.why-action { margin-left: 8px; padding: 2px 10px; border-radius: 999px; border: 1px solid currentColor; background: transparent; color: inherit; font: inherit; font-size: 12.5px; font-weight: 650; cursor: pointer; vertical-align: baseline; }
.why-action:hover { background: var(--board-2); }
@media (pointer: coarse) { .why-action { min-height: 44px; margin: 6px 0 0; display: inline-flex; align-items: center; } }

.when { display: grid; gap: 5px; min-width: 0; }
.when-text { font-size: 13.5px; min-width: 0; }
.when-text .local { font-family: var(--mono); font-weight: 700; color: var(--ink); }
.ny-line { font-size: 12.5px; color: var(--muted); }
/* a class on another clock than the student's: its own clock's time first, the student's second, one line each so the names and the times
   line up (app.js clocksHtml, schedule-ui.js whenLine). The "·" between them is for lines that are not stacked. */
.when-text.clocks, .week-when { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 1px 8px; align-items: baseline; }
.week-when { display: inline-grid; vertical-align: top; }
.clock-pair { display: contents; }
.clock-name { font-size: 11.5px; font-weight: 650; color: var(--muted); white-space: nowrap; }
.when-text .site { font-family: var(--mono); color: var(--ink); }
.when-text.clocks .line-sep, .week-when .line-sep { display: none; }
.detail-clocks { font-size: 14px; } /* the details' time line on two clocks: the class's own, then the student's */

.right { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }

.chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 5px 11px; border-radius: 999px;
  font-size: 13.5px; font-weight: 700; white-space: nowrap; letter-spacing: 0.01em; border: 1px solid transparent;
}
/* a verdict reads first on the card: its own colour, a tinted fill and an edge in that colour */
.chip.takeable { color: var(--ok); background: var(--ok-bg); border-color: color-mix(in srgb, var(--ok) 28%, transparent); }
.chip.check { color: var(--check); background: var(--check-bg); border-color: color-mix(in srgb, var(--check) 28%, transparent); }
.chip.no { color: var(--no); background: var(--no-bg); border-color: color-mix(in srgb, var(--no) 28%, transparent); }

.star {
  border: none; background: transparent; cursor: pointer; font-size: 20px; line-height: 1; color: var(--muted);
  padding: 5px 7px; border-radius: 8px;
}
.star:hover { color: var(--ink); background: var(--surface-2); }
.star.on { color: var(--check); } /* the amber of the dots is 2.4:1 on white; the text amber is 6:1 */
.star.labelled {
  font-size: 13px; font-weight: 650; border: 1px solid var(--line); padding: 5px 12px; border-radius: 999px; color: var(--ink);
}
.star.labelled.on { color: var(--check); border-color: var(--check-solid); background: var(--check-bg); }

/* ---------- 24-hour bar ---------- */
.dial { position: relative; height: 20px; border-radius: 6px; background: var(--track); overflow: hidden; }
.dial .night { position: absolute; top: 0; bottom: 0; background: var(--night); }
.dial .window {
  position: absolute; top: 0; bottom: 0; background: var(--window);
  border-left: 1.5px dashed var(--window-edge); border-right: 1.5px dashed var(--window-edge);
}
.dial .block { position: absolute; top: 3px; bottom: 3px; border-radius: 4px; min-width: 3px; }
.dial .block.fit { background: linear-gradient(180deg, #34c06e, var(--ok-solid)); box-shadow: 0 0 10px rgba(34, 160, 90, 0.55); }
.dial .block.miss { background: linear-gradient(180deg, #f2646a, var(--no-solid)); box-shadow: 0 0 10px rgba(224, 72, 79, 0.55); }
.dial .block.anytime {
  left: 0; right: 0; top: 7px; bottom: 7px; border-radius: 999px; opacity: 0.85;
  background: repeating-linear-gradient(90deg, var(--ok-solid) 0 6px, transparent 6px 10px);
}
.dial .block.unknown { left: 0; right: 0; top: 8px; bottom: 8px; background: repeating-linear-gradient(90deg, var(--check-solid) 0 4px, transparent 4px 9px); }
.dial .now { position: absolute; top: -2px; bottom: -2px; width: 2px; background: var(--focus); opacity: 0.7; }
.ticks { display: flex; justify-content: space-between; font-family: var(--mono); font-size: 10px; color: var(--muted); margin-top: -2px; }

/* ---------- Side panels ---------- */
.panel { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px 22px; }
.panel-head { display: flex; justify-content: space-between; gap: 12px; align-items: start; }
.panel-head h3 { margin: 6px 0 0; font-family: var(--display); font-size: 21px; line-height: 1.2; letter-spacing: -0.01em; }
.icon-btn {
  border: none; background: var(--surface-2); color: var(--ink); width: 34px; height: 34px; border-radius: 50%;
  font-size: 20px; line-height: 1; cursor: pointer; flex: none;
}
.icon-btn:hover { background: var(--line); }
.icon-btn.small { width: 28px; height: 28px; font-size: 16px; }
.panel-verdict { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin: 14px 0 12px; }
.reasons { list-style: none; margin: 0; padding: 0; display: grid; gap: 9px; }
.reason-item { display: grid; grid-template-columns: 22px 1fr; gap: 9px; font-size: 14px; align-items: start; }
.reason-item .mark { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font-size: 11px; font-weight: 800; }
.reason-item.pass .mark { color: var(--ok); background: var(--ok-bg); }
.reason-item.check .mark { color: var(--check); background: var(--check-bg); }
.reason-item.fail .mark { color: var(--no); background: var(--no-bg); }
.reason-item.info { color: var(--muted); }
.reason-item.info .mark { color: var(--muted); background: var(--track); font-style: italic; font-family: var(--mono); }
.reason-item a, .links a, .footer a { color: var(--accent); }
.checked { color: var(--muted); font-size: 12px; }
.detail h4, .shortlist h4 {
  margin: 22px 0 8px; font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.1em; color: var(--muted); font-weight: 700;
}
.week { display: grid; grid-template-columns: 34px 1fr; gap: 6px 10px; align-items: center; }
.week .day { font-family: var(--mono); font-size: 11.5px; color: var(--muted); }
.week .day.on { color: var(--ink); font-weight: 700; }
.week .dial { height: 16px; }
.week .ticks { grid-column: 2; }
.week-legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12px; color: var(--muted); margin-top: 8px; }
.week-legend i { display: inline-block; width: 12px; height: 8px; border-radius: 2px; margin-right: 5px; vertical-align: 1px; }
.dial .block.sec, .week-key i.sec { background: hsl(var(--h) var(--sec-s) var(--sec-l)); }
.dial .block.sec { box-shadow: none; opacity: 0.88; }
.dial .block.clash, .week-legend i.clash {
  background: repeating-linear-gradient(135deg, var(--no-solid) 0 3px, transparent 3px 6px), color-mix(in srgb, var(--no-solid) 28%, transparent);
  box-shadow: inset 0 0 0 1.5px var(--no-solid);
}
.dial .block.clash { z-index: 1; top: 1px; bottom: 1px; border-radius: 3px; }
.week-key { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 4px; font-size: 12.5px; }
.week-key i { display: inline-block; width: 12px; height: 8px; border-radius: 2px; margin-right: 6px; vertical-align: 1px; }
.meetings { width: 100%; border-collapse: collapse; font-size: 13.5px; margin-top: 10px; }
.meetings th { text-align: left; font-weight: 600; color: var(--muted); font-size: 12px; padding: 4px 0; }
.meetings td, .meetings th { padding-right: 12px; }
.meetings td { padding-top: 6px; padding-bottom: 6px; border-top: 1px solid var(--line); }
.mono-num { font-family: var(--mono); font-size: 12.5px; white-space: nowrap; }
.muted { color: var(--muted); }
.facts { display: grid; grid-template-columns: auto 1fr; gap: 7px 16px; margin: 0; font-size: 14px; }
.facts-key { margin: 14px 0 6px; }
/* the details' folded sections: a heading row that opens, with a gist beside it */
.fold { border-top: 1px solid var(--line); }
.fold summary { cursor: pointer; list-style: none; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; min-height: 42px; font-weight: 650; font-size: 14px; }
.fold summary::-webkit-details-marker { display: none; }
.fold summary::before { content: "▸"; color: var(--muted); font-size: 11px; transition: transform 0.15s; }
.fold[open] > summary::before { transform: rotate(90deg); }
.fold-gist { color: var(--muted); font-weight: 400; font-size: 13px; }
.fold-body { padding: 0 0 14px; }
.fold-body > h4:first-child { margin-top: 4px; }
@media (pointer: coarse) { .fold summary { min-height: 44px; } }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; font-weight: 500; }
.mono { font-family: var(--mono); }
blockquote {
  margin: 0; padding: 11px 14px; border-left: 3px solid var(--check-solid); background: var(--surface-2);
  border-radius: 0 10px 10px 0; font-size: 14px;
}
.description { font-size: 14px; color: var(--muted); margin: 0; white-space: pre-line; }
.spinner {
  display: inline-block; width: 12px; height: 12px; margin-right: 8px; vertical-align: -2px; border-radius: 50%;
  border: 2px solid var(--line); border-top-color: var(--accent); animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.links { margin: 18px 0 0; font-size: 14px; font-weight: 600; }

/* Shortlist as a boarding pass */
.shortlist { padding: 0; overflow: hidden; }
.pass-head { background: var(--board); color: var(--board-ink); padding: 16px 20px 14px; }
.pass-head .kicker { display: block; font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--board-accent); font-weight: 700; }
.pass-head .pass-title { display: block; margin-top: 2px; font-family: var(--display); font-size: 20px; font-weight: 700; }
.sheet-toggle {
  all: unset; display: flex; align-items: center; justify-content: space-between; gap: 8px; width: 100%; cursor: default;
}
.badge {
  display: inline-grid; place-items: center; min-width: 24px; height: 24px; padding: 0 7px; border-radius: 999px;
  background: var(--amber); color: var(--on-amber); font-size: 12.5px; font-weight: 800; font-family: var(--mono);
}
.pass-body { padding: 8px 20px 18px; }
.pass-body > p { margin: 12px 0 4px; font-size: 14px; }
.short-items { list-style: none; margin: 0; padding: 0; }
.short-item { display: flex; align-items: center; gap: 6px; border-bottom: 1px dashed var(--line); }
.short-open {
  flex: 1; min-width: 0; text-align: left; border: none; background: transparent; color: inherit;
  padding: 11px 4px; cursor: pointer; display: grid; gap: 4px; border-radius: 8px;
}
.short-open:hover { background: var(--surface-2); }
.short-open .code { justify-self: start; }
.short-title { font-weight: 600; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.short-meta { display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: center; font-size: 12.5px; }
.short-item.clash { box-shadow: inset 3px 0 0 var(--no-solid); }
.short-item.clash .short-open { padding-left: 10px; }
.clash-tag { font-size: 11.5px; font-weight: 700; color: var(--no); background: var(--no-bg); border-radius: 999px; padding: 2px 8px; white-space: nowrap; }
.clashes { margin: 14px 0 0; padding: 10px 12px; border-radius: 10px; background: var(--no-bg); color: var(--no); font-size: 13px; }
.clashes > ul { list-style: none; margin: 6px 0 0; padding: 0; display: grid; gap: 6px; }
.clashes details ul { margin: 4px 0 0; padding-left: 18px; display: grid; gap: 3px; }
.clashes summary { cursor: pointer; list-style: none; }
.clashes summary::-webkit-details-marker { display: none; }
.more-count { font-weight: 700; white-space: nowrap; text-decoration: underline dotted; }
.more-count::after { content: " ▾"; }
details[open] .more-count::after { content: " ▴"; }
.short-meta .chip { font-size: 11.5px; padding: 2px 8px; }
.perforation { position: relative; height: 0; border-top: 2px dashed var(--line); margin: 14px -20px 0; }
.perforation::before, .perforation::after {
  content: ""; position: absolute; top: -11px; width: 20px; height: 20px; border-radius: 50%; background: var(--bg);
}
.perforation::before { left: -10px; }
.perforation::after { right: -10px; }
.short-total { display: flex; justify-content: space-between; align-items: baseline; padding: 14px 2px 12px; }
.short-total span { color: var(--muted); font-size: 13px; text-transform: uppercase; letter-spacing: 0.08em; font-weight: 600; }
.short-total b { font-family: var(--mono); font-size: 24px; }
.primary {
  width: 100%; border: none; border-radius: 12px; padding: 13px 14px; font-weight: 700; cursor: pointer;
  background: var(--board); color: var(--board-ink); letter-spacing: 0.01em;
}
.primary:hover { background: var(--board-2); }
.primary.done { background: var(--ok-fill); color: #fff; }
.pass-actions { display: grid; gap: 8px; }
.secondary {
  width: 100%; border: 1.5px solid var(--ink); border-radius: 12px; padding: 11px 14px; font-weight: 650; cursor: pointer;
  background: transparent; color: var(--ink); letter-spacing: 0.01em;
}
.secondary:hover { background: var(--surface-2); }
.secondary.done { background: var(--ok-fill); border-color: var(--ok-fill); color: #fff; }
.small { font-size: 12.5px !important; }
.pass-body .small { margin: 10px 0 0; }

/* Registration day: backups, permission numbers and the steps (collapsed until asked for) */
.regday { margin-top: 18px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-2); }
.reg-toggle {
  display: flex; align-items: center; justify-content: space-between; gap: 10px; width: 100%; padding: 12px 14px;
  border: none; background: transparent; color: inherit; font: inherit; text-align: left; cursor: pointer; border-radius: 12px;
}
.reg-toggle b { display: block; font-family: var(--display); font-size: 15px; }
.reg-hint { display: block; margin-top: 1px; font-size: 12.5px; color: var(--muted); }
.reg-chev::after { content: "▾"; color: var(--muted); }
.reg-toggle[aria-expanded="true"] .reg-chev::after { content: "▴"; }
.reg-body { padding: 2px 14px 14px; border-top: 1px dashed var(--line); }
.reg-body > .small { margin: 10px 0 0; }
.regday .code { background: var(--surface); }
.reg-body > .secondary { margin-top: 14px; }
.reg-items { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 16px; }
.reg-item { display: grid; gap: 6px; min-width: 0; }
.reg-item > p { margin: 0; }
.reg-head { display: flex; align-items: baseline; justify-content: space-between; gap: 4px 12px; flex-wrap: wrap; }
.reg-open { border: none; background: transparent; color: inherit; font: inherit; text-align: left; cursor: pointer; padding: 0; min-width: 0; }
.reg-head .reg-open { font-weight: 600; font-size: 14px; }
.reg-head .reg-open:hover .code { text-decoration: underline; }
.reg-crn { font-family: var(--mono); font-size: 13px; font-weight: 700; }
.reg-flags { list-style: none; margin: 0; padding: 0; display: grid; gap: 5px; }
.reg-flag { font-size: 13px; }
.reg-quote { color: var(--muted); font-style: italic; overflow-wrap: anywhere; }
.flag-tag {
  display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: 11.5px; font-weight: 700; white-space: nowrap;
  color: var(--check); background: var(--check-bg);
}
.flag-tag.corequisite { color: var(--ink); background: var(--track); }
.reg-label { font-size: 11px; text-transform: uppercase; letter-spacing: 0.1em; color: var(--muted); font-weight: 700; margin-top: 2px; }
.reg-backups { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.reg-backup { display: flex; align-items: center; gap: 4px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
.reg-backup .reg-open { flex: 1; display: grid; gap: 3px; padding: 8px 10px; border-radius: 10px; }
.reg-backup .reg-open:hover { background: var(--surface-2); }
.reg-line { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; font-size: 13px; }
.reg-line .chip { font-size: 11.5px; padding: 2px 8px; }
.reg-time { font-family: var(--mono); font-size: 12.5px; overflow-wrap: anywhere; }
.reg-tags { display: flex; flex-wrap: wrap; gap: 4px; }
.reg-backup .star { margin-right: 4px; }
.reg-steps { margin: 16px 0 0; padding-left: 20px; display: grid; gap: 8px; font-size: 13.5px; }
.reg-steps a, .reg-links a { color: var(--accent); white-space: nowrap; }
.reg-links { display: flex; flex-wrap: wrap; gap: 4px 16px; margin: 12px 0 0; font-size: 13.5px; font-weight: 600; }

/* Blocker and empty states */
.blocker {
  margin-top: 22px; padding: 16px 18px; border-radius: 14px; background: var(--surface); box-shadow: var(--shadow);
  display: flex; gap: 16px; align-items: center; justify-content: space-between; flex-wrap: wrap;
  border: 1px solid var(--no-bg);
}
.blocker .icon { font-size: 22px; }
.blocker p { margin: 0; flex: 1 1 320px; }
.ghost {
  border: 1.5px solid var(--ink); color: var(--ink); background: transparent; font-weight: 650;
  padding: 8px 15px; border-radius: 999px; cursor: pointer; white-space: nowrap;
}
.ghost:hover { background: var(--ink); color: var(--surface); }
.more {
  margin-top: 10px; width: 100%; padding: 12px; border-radius: 12px; border: 1px dashed var(--line);
  background: transparent; color: var(--ink); font-weight: 600; cursor: pointer;
}
.more:hover { background: var(--surface); }
.skeleton { margin-top: 26px; }
.ghost-card { height: 108px; cursor: default; background: linear-gradient(90deg, var(--surface) 0%, var(--surface-2) 50%, var(--surface) 100%); background-size: 200% 100%; animation: shimmer 1.4s linear infinite; }
.ghost-card::before { display: none; }
@keyframes shimmer { from { background-position: 100% 0; } to { background-position: -100% 0; } }
@media (prefers-reduced-motion: reduce) { .ghost-card, .spinner { animation: none; } .card { transition: none; } }

.empty {
  margin-top: 22px; padding: 30px; text-align: center; color: var(--muted);
  background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow);
}

/* Footer */
.footer { max-width: 1280px; margin: 0 auto; padding: 0 28px 36px; color: var(--muted); font-size: 13px; }

/* ---------- Responsive ---------- */
@media (max-width: 1060px) {
  .card { grid-template-columns: minmax(0, 1fr) auto; }
  .when { grid-column: 1 / -1; grid-row: 2; }
  .right { grid-row: 1; grid-column: 2; }
}
@media (max-width: 900px) {
  .layout { grid-template-columns: 1fr; }
  .side { position: static; max-height: none; }
  body.detail-open .side {
    position: fixed; left: 0; right: 0; bottom: 0; top: auto; z-index: 20; max-height: 86vh; overflow: auto;
    box-shadow: 0 -12px 40px rgba(0, 0, 0, 0.3); border-radius: 20px 20px 0 0;
  }
  body.detail-open .side .panel { border-radius: 20px 20px 0 0; }
  body:not(.detail-open) .side {
    position: fixed; left: 0; right: 0; bottom: 0; top: auto; z-index: 15; max-height: 72vh; overflow: auto;
    box-shadow: 0 -10px 30px rgba(0, 0, 0, 0.25); border-radius: 20px 20px 0 0;
  }
  body:not(.detail-open) .side .panel { border-radius: 20px 20px 0 0; }
  body:not(.detail-open):not(.sheet-open) .pass-body { display: none; }
  .sheet-toggle { cursor: pointer; }
  .sheet-toggle::after { content: "▴"; color: var(--board-muted); margin-left: auto; }
  body.sheet-open .sheet-toggle::after { content: "▾"; }
  .footer { padding-bottom: 110px; }
}

@media (max-width: 640px) {
  .board-inner { padding: 18px 16px 20px; }

  .board h1 { margin-top: 12px; max-width: none; }
  :lang(zh) .board h1 { word-break: keep-all; } /* the Chinese line breaks at its comma, not inside a phrase */
  .scoreboard { gap: 8px; }

  .layout { padding: 16px 16px 48px; }
  .footer { padding-left: 16px; padding-right: 16px; }
  .card { padding: 13px 13px 13px 17px; gap: 8px 12px; }
}

/* ---------- Ask Takeable: chat launcher and drawer (public/chat.js) ---------- */
.chat-launcher[hidden], .chat [hidden] { display: none !important; }
.chat-launcher {
  position: fixed; right: calc(var(--dock-w) + 20px); bottom: 20px; z-index: 12;
  display: inline-flex; align-items: center; gap: 9px; height: 46px; padding: 0 18px 0 14px;
  border: none; border-radius: 999px; cursor: pointer;
  background: var(--amber); color: var(--on-amber); font-weight: 700; font-size: 14.5px; letter-spacing: 0.01em;
  box-shadow: 0 1px 2px rgba(14, 23, 38, 0.25), 0 8px 24px rgba(14, 23, 38, 0.28);
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}
body.launcher-yields .chat-launcher { visibility: hidden; } /* landing-ui.js: it would cover the home page's main buttons */
.chat-launcher:hover { transform: translateY(-1px); box-shadow: 0 1px 2px rgba(14, 23, 38, 0.25), 0 12px 28px rgba(14, 23, 38, 0.34); }
.chat-launcher.unread::after {
  content: ""; width: 9px; height: 9px; border-radius: 50%; background: var(--no-solid); border: 2px solid var(--amber);
  box-sizing: content-box; position: absolute; top: -3px; right: -1px;
}
/* the side panel and footer end above the launcher instead of running under it */
@media (min-width: 901px) {
  .side { max-height: calc(100vh - 36px - 62px); }
  .footer { padding-bottom: 84px; }
}

.chat {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 30; width: min(var(--chat-eff), 100vw);
  display: flex; flex-direction: column; background: var(--bg); color: var(--ink);
  border-left: 1px solid var(--line); box-shadow: -14px 0 44px rgba(14, 23, 38, 0.22);
  transform: translateX(100%); visibility: hidden;
  transition: transform 0.22s ease, visibility 0s linear 0.22s;
}
.chat.open { transform: none; visibility: visible; transition: transform 0.22s ease; }
.chat-head {
  flex: none; display: flex; align-items: center; gap: 10px; padding: 14px 14px 13px 20px;
  background: var(--board); color: var(--board-ink); border-bottom: 1px solid var(--board-line);
}
.chat-title { flex: 1; min-width: 0; }
.chat-title .kicker { display: block; font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--board-accent); font-weight: 700; }
.chat-title h2 { margin: 1px 0 0; font-family: var(--display); font-size: 20px; line-height: 1.2; font-weight: 700; }
.chat-title .chat-model { margin: 2px 0 0; font-size: 12px; line-height: 1.3; color: var(--board-muted); }
.chat-new {
  border: 1px solid var(--board-line); background: rgba(var(--glass), 0.05); color: var(--board-ink);
  font-size: 13px; font-weight: 600; padding: 6px 12px; border-radius: 999px; cursor: pointer; white-space: nowrap;
}
.chat-new:hover { background: rgba(var(--glass), 0.12); }
.chat-head .icon-btn { background: rgba(var(--glass), 0.08); color: var(--board-ink); }

/* the history panel (chat-history-ui.js): over the conversation, which comes back as it was */
.chat.history-open .chat-log, .chat.history-open .chat-composer, .chat.history-open .chat-activity, .chat.history-open .chat-notice { display: none; }
.chat-history { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.chat-history-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.chat-history-head h3 { margin: 0; font-family: var(--display); font-size: 17px; }
.chat-new.dark, .chat-history-head .chat-new { border-color: var(--line); background: var(--surface); color: var(--ink); }
.chat-new.dark:hover, .chat-history-head .chat-new:hover { background: var(--surface-2); }
.chat-history-note { margin: 0; font-size: 13.5px; color: var(--muted); }
.chat-history-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.chat-history-item { display: flex; align-items: stretch; gap: 6px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 4px; }
.chat-history-item.current { border-color: var(--accent); }
.chat-history-open { flex: 1; min-width: 0; display: grid; gap: 2px; text-align: left; border: none; background: transparent; color: inherit; font: inherit; padding: 8px 10px; border-radius: 10px; cursor: pointer; }
.chat-history-open:hover { background: var(--surface-2); }
.chat-history-title { font-weight: 650; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-history-when { font-size: 12px; color: var(--muted); }
.chat-history-actions { display: flex; align-items: center; gap: 2px; flex: none; }
.chat-history-act { border: none; background: transparent; color: var(--muted); font: inherit; font-size: 12.5px; font-weight: 650; padding: 6px 8px; border-radius: 8px; cursor: pointer; }
.chat-history-act:hover { background: var(--surface-2); color: var(--ink); }
.chat-history-act.danger:hover { color: var(--no); }
.chat-history-form { flex: 1; display: flex; flex-wrap: wrap; gap: 6px; padding: 4px; }
.chat-history-rename { flex: 1 1 160px; min-width: 0; min-height: 36px; padding: 0 10px; font: inherit; font-size: 16px; color: var(--ink); background: var(--bg); border: 1px solid var(--line); border-radius: 10px; }
.chat-history-clear { align-self: flex-start; border: none; background: transparent; color: var(--no); font: inherit; font-size: 13px; font-weight: 650; padding: 6px 0; cursor: pointer; text-decoration: underline; }
.chat-import { flex: none; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; margin: 12px 16px 0; padding: 10px 12px; font-size: 13.5px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; }
.chat-import span { flex: 1 1 100%; }
.chat-head .icon-btn:hover { background: rgba(var(--glass), 0.18); }

.chat-log {
  flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 16px 16px 10px;
  display: flex; flex-direction: column; gap: 12px;
}
.chat-log:focus { outline: none; }
.chat-msg { display: flex; flex-direction: column; gap: 6px; max-width: 94%; min-width: 0; }
.chat-msg.user { align-self: flex-end; align-items: flex-end; max-width: 86%; }
.chat-msg.assistant { align-self: flex-start; align-items: flex-start; }
.chat-bubble { padding: 10px 14px; border-radius: 16px; font-size: 14.5px; line-height: 1.5; overflow-wrap: anywhere; min-width: 0; }
.chat-msg.user .chat-bubble {
  background: var(--board); color: var(--board-ink); border: 1px solid var(--board-line);
  border-bottom-right-radius: 5px; white-space: pre-wrap;
}
.chat-msg.assistant .chat-bubble {
  background: var(--surface); border: 1px solid var(--line); border-bottom-left-radius: 5px; box-shadow: var(--shadow);
}
.chat-bubble p { margin: 0; }
.chat-bubble p + p, .chat-bubble ul, .chat-bubble ol, .chat-bubble :is(ul, ol) + p { margin-top: 8px; }
.chat-bubble :is(ul, ol) { margin-bottom: 0; padding-left: 20px; }
.chat-bubble li + li { margin-top: 3px; }
.chat-bubble code {
  font-family: var(--mono); font-size: 0.88em; background: var(--surface-2); border: 1px solid var(--line);
  border-radius: 5px; padding: 0 5px;
}
.chat-chip {
  font: inherit; font-family: var(--mono); font-size: 0.86em; font-weight: 700; line-height: 1.4; white-space: nowrap;
  color: var(--accent); background: var(--surface-2); border: 1px solid var(--line); border-radius: 6px;
  padding: 0 6px; margin: 0 1px; cursor: pointer;
}
.chat-chip:hover { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 10%, var(--surface-2)); }

.chat-note { margin: 0; font-size: 12.5px; color: var(--muted); }
.chat-note.error {
  align-self: stretch; display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: center; font-size: 13.5px; line-height: 1.4;
  color: var(--no); background: var(--no-bg); padding: 9px 13px; border-radius: 12px;
}
.chat-note.error button {
  border: 1.5px solid currentColor; background: transparent; color: inherit; font-weight: 650; font-size: 13px;
  padding: 3px 11px; border-radius: 999px; cursor: pointer;
}

.chat-empty { display: grid; gap: 9px; }
.chat-empty p { margin: 0 0 4px; font-size: 14.5px; color: var(--muted); }
.chat-starter {
  text-align: left; font: inherit; font-size: 14.5px; font-weight: 550; line-height: 1.35; color: var(--ink); cursor: pointer;
  background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 11px 14px; box-shadow: var(--shadow);
}
.chat-starter:hover { border-color: var(--accent); }

.chat-notice { flex: 0 1 auto; min-height: 0; overflow-y: auto; margin: 16px; padding: 18px 20px; border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); align-self: stretch; font-size: 14.5px; }
.chat-notice h3 { margin: 0 0 8px; font-family: var(--display); font-size: 17px; }
.chat-notice p { margin: 0 0 10px; color: var(--muted); }
.chat-notice code { font-family: var(--mono); font-size: 0.88em; color: var(--ink); background: var(--surface-2); border: 1px solid var(--line); border-radius: 5px; padding: 0 5px; }
.chat-notice .secondary { width: auto; padding: 8px 16px; margin-top: 4px; }

.chat-activity { flex: none; min-height: 26px; padding: 2px 20px 4px; font-size: 12.5px; color: var(--muted); display: flex; align-items: center; gap: 8px; }
.chat-activity:not(:empty)::before {
  content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); flex: none; animation: chat-pulse 1.1s ease-in-out infinite;
}
@keyframes chat-pulse { 50% { opacity: 0.25; transform: scale(0.7); } }

.chat-composer {
  flex: none; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 8px; align-items: end;
  padding: 10px 14px calc(14px + env(safe-area-inset-bottom, 0px)); border-top: 1px solid var(--line); background: var(--bg);
}
.chat-composer textarea {
  font: inherit; font-size: 15px; line-height: 1.4; color: var(--ink); resize: none; min-height: 44px; max-height: calc(6 * 1.4em + 22px); overflow-y: auto; /* grows to six lines */
  padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); box-shadow: var(--shadow);
}
.chat-composer textarea:disabled { opacity: 0.6; }
.chat-composer textarea::placeholder { color: var(--muted); }
.chat-send, .chat-stop { height: 44px; padding: 0 16px; border-radius: 12px; font-weight: 700; cursor: pointer; }
.chat-send { border: none; background: var(--amber); color: var(--on-amber); }
.chat-send:hover { filter: brightness(1.05); }
.chat-stop { border: 1.5px solid var(--ink); background: transparent; color: var(--ink); }
.chat-stop:hover { background: var(--surface-2); }
.chat-add {
  display: grid; place-items: center; flex: none; width: 40px; height: 40px; margin-bottom: 2px; padding: 0; border-radius: 50%;
  color: var(--accent); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); cursor: pointer;
}
.chat-add:hover:not(:disabled) { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 10%, var(--surface)); }
.chat-add:disabled { opacity: 0.5; cursor: not-allowed; }
.chat-attached { grid-column: 1 / -1; min-width: 0; }
.chat-count { grid-column: 1 / -1; justify-self: end; margin-top: -2px; font-family: var(--mono); font-size: 12px; color: var(--muted); }
.chat-count.full { color: var(--no); font-weight: 700; }

@media (prefers-color-scheme: dark) {
  :where(:root:not([data-theme="light"])) .chat { border-left-color: rgba(255, 255, 255, 0.08); box-shadow: -14px 0 44px rgba(0, 0, 0, 0.5); }
  :where(:root:not([data-theme="light"])) .chat-msg.assistant .chat-bubble, :where(:root:not([data-theme="light"])) .chat-starter, :where(:root:not([data-theme="light"])) .chat-notice, :where(:root:not([data-theme="light"])) .chat-composer textarea, :where(:root:not([data-theme="light"])) .chat-add { border-color: rgba(255, 255, 255, 0.08); }
  :where(:root:not([data-theme="light"])) .chat-chip, :where(:root:not([data-theme="light"])) .chat-bubble code { border-color: rgba(255, 255, 255, 0.14); }
  :where(:root:not([data-theme="light"])) .chat-msg.user .chat-bubble { background: var(--board-2); border-color: rgba(255, 255, 255, 0.1); }
}
:where(:root[data-theme="dark"]) .chat { border-left-color: rgba(255, 255, 255, 0.08); box-shadow: -14px 0 44px rgba(0, 0, 0, 0.5); }
  :where(:root[data-theme="dark"]) .chat-msg.assistant .chat-bubble, :where(:root[data-theme="dark"]) .chat-starter, :where(:root[data-theme="dark"]) .chat-notice, :where(:root[data-theme="dark"]) .chat-composer textarea, :where(:root[data-theme="dark"]) .chat-add { border-color: rgba(255, 255, 255, 0.08); }
  :where(:root[data-theme="dark"]) .chat-chip, :where(:root[data-theme="dark"]) .chat-bubble code { border-color: rgba(255, 255, 255, 0.14); }
  :where(:root[data-theme="dark"]) .chat-msg.user .chat-bubble { background: var(--board-2); border-color: rgba(255, 255, 255, 0.1); }

@media (max-width: 900px) {
  /* above the shortlist's collapsed bottom sheet; the open sheet and the details panel cover it instead */
  .chat-launcher { right: calc(var(--dock-w) + 16px); bottom: calc(env(safe-area-inset-bottom, 0px) + 86px); z-index: 14; }
  .footer { padding-bottom: 170px; }
}
@media (max-width: 767px) {
  .chat {
    top: 0; left: 0; right: 0; bottom: auto; width: 100%; height: var(--chat-height, 100dvh);
    border-left: none; box-shadow: none; transform: translateY(100%);
  }
  .chat-head { padding-left: 16px; }
  .chat-log { padding: 14px 12px 8px; }
  .chat-composer { padding: 10px 12px calc(12px + env(safe-area-inset-bottom, 0px)); }
  .chat-composer textarea { font-size: 16px; } /* 16px keeps iOS from zooming the page on focus */
  .chat-composer textarea::placeholder { font-size: 14px; } /* the + takes room: the hint stays on one line at 375px */
  .chat-notice { margin: 12px; }
}
@media (prefers-reduced-motion: reduce) {
  .chat, .chat.open, .chat-launcher { transition: none; }
  .chat-activity:not(:empty)::before { animation: none; }
}

/* ---------- Your record (public/record-ui.js) ---------- */
/* the small pills under the header's sentence ("About you") */
.record-pill {
  display: inline-flex; align-items: center; gap: 7px; min-height: 30px; padding: 3px 13px 3px 10px; cursor: pointer;
  font: inherit; font-size: 13.5px; font-weight: 600; color: var(--board-ink);
  background: rgba(var(--glass), 0.04); border: 1px dashed var(--board-line); border-radius: 999px;
}
.record-pill::before { content: "+"; font-weight: 700; font-size: 15px; line-height: 1; color: var(--board-accent); }
.record-pill:hover { background: rgba(var(--glass), 0.09); border-color: rgba(245, 181, 68, 0.6); }
.record-pill.set { border-style: solid; border-color: rgba(245, 181, 68, 0.5); }
.record-pill.set::before { content: "✓"; font-size: 13px; }
/* ---------- The header's buttons: one primary, one secondary with the import menu (record-ui.js) ---------- */

.hero-primary, .hero-secondary {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 48px; padding: 0 26px;
  border-radius: 999px; font: inherit; font-size: 16px; font-weight: 700; cursor: pointer;
}
.hero-primary { background: var(--amber); color: #1b1404; border: 1px solid var(--amber); box-shadow: 0 4px 16px rgba(245, 181, 68, 0.22); }
.hero-primary:hover { filter: brightness(1.07); }
.hero-secondary { background: transparent; color: var(--board-ink); border: 1.5px solid var(--board-edge); font-weight: 650; }
.hero-secondary:hover, .hero-secondary[aria-expanded="true"] { background: rgba(var(--glass), 0.08); border-color: var(--board-ink); }
.hero-secondary.set::before { content: "✓"; color: var(--board-accent); font-weight: 800; }
.hero-secondary svg { flex: none; }
.hero-secondary[aria-expanded="true"] svg { transform: rotate(180deg); }
.hero-primary:focus-visible, .hero-secondary:focus-visible { outline: 2px solid var(--amber); outline-offset: 3px; }
.import-wrap { position: relative; }
.import-menu {
  position: absolute; z-index: 20; top: calc(100% + 8px); left: 0; min-width: 100%; width: max-content; max-width: min(340px, calc(100vw - 32px));
  display: grid; gap: 2px; padding: 6px; border-radius: 14px; background: var(--surface); color: var(--ink);
  border: 1px solid var(--line); box-shadow: 0 12px 32px rgba(0, 0, 0, 0.35);
}
.import-menu[hidden] { display: none; }
.import-menu button {
  display: flex; align-items: center; justify-content: space-between; gap: 14px; min-height: 44px; padding: 0 14px;
  border: none; border-radius: 10px; background: transparent; color: inherit; font: inherit; font-size: 14.5px; font-weight: 600;
  text-align: left; cursor: pointer;
}
.import-menu button:hover, .import-menu button:focus-visible { background: var(--surface-2); }
.import-menu button:focus-visible { outline: 2px solid var(--focus); outline-offset: -2px; }
.import-count { font-size: 12.5px; font-weight: 600; color: var(--muted); white-space: nowrap; }
.import-count:empty { display: none; }
@media (max-width: 560px) {

  .hero-primary, .hero-secondary { width: 100%; }
  .import-menu { right: 0; width: auto; max-width: none; }
}

dialog.record {
  padding: 0; border: 1px solid var(--line); border-radius: 20px; background: var(--bg); color: var(--ink);
  width: min(580px, calc(100vw - 24px)); max-height: min(90vh, 780px); overflow: hidden;
  box-shadow: 0 24px 80px rgba(14, 23, 38, 0.4);
}
dialog.record[open] { display: flex; }
dialog.record::backdrop { background: rgba(10, 17, 30, 0.62); }
.record-panel { display: grid; align-content: start; gap: 14px; width: 100%; padding: 0 22px; overflow-y: auto; overscroll-behavior: contain; }
.record-head {
  display: flex; align-items: center; gap: 10px; margin: 0 -22px; padding: 14px 14px 13px 22px;
  background: var(--board); color: var(--board-ink); border-bottom: 1px solid var(--board-line);
}
.record-head > div { flex: 1; min-width: 0; }
.record-head .kicker { display: block; font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--board-accent); font-weight: 700; }
.record-head h2 { margin: 1px 0 0; font-family: var(--display); font-size: 20px; line-height: 1.2; font-weight: 700; }
.record-head .icon-btn { background: rgba(var(--glass), 0.08); color: var(--board-ink); }
.record-head .icon-btn:hover { background: rgba(var(--glass), 0.18); }
.record-privacy { margin: 0; font-size: 13.5px; color: var(--muted); }

.record-drop {
  display: grid; gap: 3px; justify-items: center; text-align: center; padding: 20px 16px; cursor: pointer;
  border: 2px dashed var(--line); border-radius: 14px; background: var(--surface);
}
.record-drop strong { font-size: 15px; }
.record-drop span { font-size: 13px; color: var(--muted); }
.record-drop:hover, .record-drop.over { border-color: var(--accent); background: var(--surface-2); }
.record-drop:has(:focus-visible), .record-drop:focus-within { border-color: var(--focus); }
.record-drop.busy { opacity: 0.6; cursor: progress; }
#recordFile:focus-visible + * { outline: none; }
.record-label { font-size: 13px; font-weight: 600; color: var(--muted); margin-bottom: -8px; }
#recordText, #albertText, .record-add input, .record-add select {
  font: inherit; font-size: 15px; color: var(--ink); border: 1px solid var(--line); border-radius: 12px; background: var(--surface); padding: 10px 12px;
}
#recordText, #albertText { width: 100%; resize: vertical; min-height: 84px; line-height: 1.4; font-family: var(--mono); font-size: 13px; }
#recordText::placeholder, #albertText::placeholder, .record-add input::placeholder { color: var(--muted); font-family: var(--sans); }
.record-actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: -4px; }
.record-find, .record-add button {
  height: 40px; padding: 0 16px; border-radius: 12px; font-weight: 650; cursor: pointer;
  border: 1.5px solid var(--ink); background: transparent; color: var(--ink);
}
.record-find:hover, .record-add button:hover { background: var(--surface-2); }
.record-status { flex: 1 1 200px; font-size: 13.5px; color: var(--muted); min-height: 20px; }
.record-status[data-tone="ok"] { color: var(--ok); }
.record-status[data-tone="warn"] { color: var(--check); }

.record-lists { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.record-list { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px 14px; min-width: 0; }
.record-list h3 { display: flex; align-items: center; gap: 8px; margin: 0 0 8px; font-family: var(--display); font-size: 14.5px; }
.record-list h3 span { font-family: var(--mono); font-size: 12px; font-weight: 600; color: var(--muted); background: var(--surface-2); border-radius: 999px; padding: 0 8px; }
.record-empty { margin: 0; font-size: 13.5px; color: var(--muted); }
.rchips { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; max-height: 190px; overflow-y: auto; }
.rchip {
  display: inline-flex; align-items: center; gap: 2px; padding: 2px 3px 2px 10px; border-radius: 999px;
  font-family: var(--mono); font-size: 12.5px; font-weight: 600; color: var(--ok); background: var(--ok-bg);
}
.record-list:nth-child(2) .rchip { color: var(--check); background: var(--check-bg); }
.rchip button {
  width: 22px; height: 22px; border: none; border-radius: 50%; background: transparent; color: inherit; font-size: 15px; line-height: 1; cursor: pointer; opacity: 0.75;
}
.rchip button:hover { opacity: 1; background: rgba(127, 127, 127, 0.22); }
.record-list.needed { grid-column: 1 / -1; }
.rreqs { list-style: none; margin: 0; padding: 0; }
.rreq { display: grid; gap: 6px; padding: 9px 0; border-bottom: 1px dashed var(--line); }
.rreq:first-child { padding-top: 0; }
.rreq:last-child { padding-bottom: 0; border-bottom: none; }
.rreq-head { display: flex; align-items: baseline; justify-content: space-between; gap: 4px 10px; flex-wrap: wrap; font-size: 14px; }
.rreq-head strong { flex: 1 1 auto; min-width: 0; overflow-wrap: anywhere; }
.rreq-need { font-family: var(--mono); font-size: 12px; font-weight: 600; color: var(--muted); white-space: nowrap; }
.rreq-head button {
  align-self: center; width: 22px; height: 22px; border: none; border-radius: 50%; background: transparent; color: var(--muted); font-size: 15px; line-height: 1; cursor: pointer;
}
.rreq-head button:hover { background: rgba(127, 127, 127, 0.22); color: var(--ink); }
.rreq .rchips { max-height: 96px; }
.rreq .rchip { padding: 2px 10px; color: var(--ink); background: var(--surface-2); }
.rreq.done .rreq-head strong { color: var(--muted); font-weight: 600; }
.rreq.done .rreq-need { color: var(--ok, #15803d); }
.rreq.done .rchips { opacity: 0.6; }
.runread { margin-top: 10px; font-size: 13px; color: var(--check); }
.runread summary { cursor: pointer; font-weight: 650; }
.runread ul { margin: 6px 0 0; padding-left: 18px; display: grid; gap: 3px; color: var(--muted); font-family: var(--mono); font-size: 12px; overflow-wrap: anywhere; }

.record-add { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 8px; }
.record-add input { min-width: 0; text-transform: uppercase; }
.record-add input::placeholder { text-transform: none; }
.record-add select { height: 40px; padding: 0 10px; }
.record-add input { height: 40px; padding-top: 0; padding-bottom: 0; }

.record-foot {
  position: sticky; bottom: 0; display: flex; align-items: center; gap: 12px; margin: 0 -22px; padding: 12px 22px calc(14px + env(safe-area-inset-bottom, 0px));
  background: var(--bg); border-top: 1px solid var(--line);
}
.record-dirty { flex: 1; text-align: right; font-size: 13px; color: var(--check); }
.record-foot .record-save { margin-left: auto; }
.record-dirty:not([hidden]) + .record-save { margin-left: 0; }
.record-save { height: 42px; padding: 0 24px; border: none; border-radius: 12px; font-weight: 700; cursor: pointer; background: var(--amber); color: var(--on-amber); }
.record-save:hover { filter: brightness(1.05); }
.record-clear { height: 42px; padding: 0 14px; border: 1px solid var(--line); border-radius: 12px; background: transparent; color: var(--no); font-weight: 650; cursor: pointer; }
.record-clear:hover:not(:disabled) { background: var(--no-bg); }
.record-clear:disabled { opacity: 0.4; cursor: default; }

@media (prefers-color-scheme: dark) {
  :where(:root:not([data-theme="light"])) dialog.record, :where(:root:not([data-theme="light"])) .record-list, :where(:root:not([data-theme="light"])) .record-drop, :where(:root:not([data-theme="light"])) #recordText, :where(:root:not([data-theme="light"])) #albertText, :where(:root:not([data-theme="light"])) .record-add input, :where(:root:not([data-theme="light"])) .record-add select { border-color: rgba(255, 255, 255, 0.1); }
}
:where(:root[data-theme="dark"]) dialog.record, :where(:root[data-theme="dark"]) .record-list, :where(:root[data-theme="dark"]) .record-drop, :where(:root[data-theme="dark"]) #recordText, :where(:root[data-theme="dark"]) #albertText, :where(:root[data-theme="dark"]) .record-add input, :where(:root[data-theme="dark"]) .record-add select { border-color: rgba(255, 255, 255, 0.1); }
@media (max-width: 560px) {
  .record-panel { padding: 0 16px; }
  .record-head { margin: 0 -16px; padding-left: 16px; }
  .record-foot { margin: 0 -16px; padding-left: 16px; padding-right: 16px; }
  .record-lists { grid-template-columns: 1fr; }
  .record-add { grid-template-columns: minmax(0, 1fr) auto; }
  .record-add input { grid-column: 1 / -1; }
}

/* ---- assistant cards, suggestions, proposals ---- */
.chat-extras { display: grid; gap: 8px; min-width: 0; width: 100%; }
.chat-unverified { margin: 0; color: var(--check); font-size: 12.5px; overflow-wrap: anywhere; }
.chat-section-card, .chat-proposal {
  min-width: 0; border: 1px solid var(--line); border-radius: 12px;
  background: var(--surface); color: var(--ink); overflow-wrap: anywhere;
}
.chat-section-open {
  display: grid; gap: 4px; width: 100%; padding: 12px 12px 6px; text-align: left;
  font: inherit; font-size: 13px; color: inherit; background: none; border: 0; border-radius: 12px; cursor: pointer;
}
.chat-section-open strong { font-family: var(--mono); font-size: 13px; }
.chat-section-time { color: var(--muted); font-size: 12px; }
.chat-section-meta { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 0 8px 8px 12px; }
.chat-section-meta .star { min-width: 44px; min-height: 44px; }
.chat-proposal { padding: 12px; font-size: 13px; }
.chat-proposal p { margin: 0 0 8px; }
.chat-proposal-actions, .chat-suggestions { display: flex; flex-wrap: wrap; gap: 7px; }
.chat-proposal-actions button, .chat-suggestions button, .chat-undo button {
  min-height: 40px; padding: 8px 12px; font: inherit; font-size: 12.5px; font-weight: 650;
  color: var(--accent); background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px;
  cursor: pointer; max-width: 100%; overflow-wrap: anywhere;
}
.chat-proposal-actions button:first-child { background: var(--amber); color: var(--on-amber); border-color: transparent; }
.chat-extras button:hover, .chat-undo button:hover { outline: 1px solid var(--accent); }
.chat-extras button:focus-visible, .chat-undo button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.chat-extras button:disabled { opacity: 0.55; cursor: wait; }
.chat-undo { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex: none; padding: 8px 16px; font-size: 13px; background: var(--surface-2); border-top: 1px solid var(--line); }
/* A card of another term than the page's (chat.js otherTermCard): it says its term */
.chat-section-card.other-term .chat-section-open { cursor: default; }
.term-chip { background: var(--surface-2); color: var(--ink); border: 1px solid var(--line); font-weight: 650; }

/* A course card's two lines: how it is assessed, and the instructor's Rate My Professors rating (app.js assessHtml, professorHtml) */
.card-line { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 6px; margin-top: 4px; font-size: 13.5px; line-height: 1.5; color: var(--ink); }
.card-line .line-label { flex: none; font-size: 12.5px; font-weight: 650; color: var(--muted); margin-right: 2px; }
.card-line .line-sep { color: var(--muted); }
:is(.card-line, .instructors) .prof { display: inline-flex; flex-wrap: wrap; align-items: baseline; gap: 2px 6px; }
:is(.card-line, .instructors) .prof + .prof::before { content: "；"; color: var(--muted); }
/* the name is a button that opens the professor's details (professors-ui.js); it still reads as the name, on a card, in the details and in the cart */
:is(.card-line, .instructors) .prof-name {
  padding: 0; border: none; background: transparent; font: inherit; font-weight: 650; color: var(--ink); cursor: pointer;
  text-decoration: underline dotted; text-decoration-color: var(--muted); text-underline-offset: 2px;
}
:is(.card-line, .instructors) .prof-name:hover { color: var(--accent); }
:is(.card-line, .instructors) .prof-name:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 4px; }
/* "4.0/5 · 87 ratings": the score and its number of ratings read the same size and weight; the words where there is no score are quiet */
:is(.card-line, .instructors) .prof-rate { font-weight: 700; font-variant-numeric: tabular-nums; }
:is(.card-line, .instructors) .prof-state { font-size: 11.5px; color: var(--muted); }

/* The line at the top of a conversation whose earlier part was folded (chat.js summaryNote) */
.chat-summary { margin: 0 0 10px; font-size: 12px; color: var(--muted); }
.chat-summary summary { cursor: pointer; }
.chat-summary p { white-space: pre-wrap; margin: 6px 0 0; padding: 8px 10px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; color: var(--ink); }
.chat-history-tools { display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0 12px; }

/* "Was this helpful?" under an answer (chat.js renderRating) */
.chat-rate { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; margin-top: 6px; font-size: 12.5px; color: var(--muted); }
.chat-rate button {
  min-height: 34px; padding: 5px 10px; font: inherit; font-weight: 600; color: var(--ink);
  background: transparent; border: 1px solid var(--line); border-radius: 999px; cursor: pointer;
}
.chat-rate button:hover { outline: 1px solid var(--accent); }
.chat-rate button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.chat-rate button:disabled { opacity: 0.55; cursor: wait; }
.chat-rate-why { display: flex; gap: 6px; flex: 1 1 100%; }
.chat-rate-why input { flex: 1; min-width: 0; min-height: 34px; padding: 5px 10px; font: inherit; color: var(--ink); background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; }
@media (max-width: 640px) {
  .chat-proposal-actions button, .chat-suggestions button, .chat-undo button { min-height: 44px; }
  .chat-rate button, .chat-rate-why input { min-height: 44px; }
}

/* ---- share link, prerequisites ---- */
/* The bar above the page: a shared plan being looked at (public/share-ui.js), or a note about a link */
.shared-bar[hidden] { display: none; }
.shared-bar {
  width: min(1224px, calc(100% - 32px)); margin: 16px auto 0; padding: 12px 16px; border-radius: 12px;
  display: flex; align-items: center; justify-content: space-between; gap: 10px 16px; flex-wrap: wrap;
  background: color-mix(in srgb, var(--accent) 12%, var(--surface)); color: var(--ink);
  border: 1px solid color-mix(in srgb, var(--accent) 38%, transparent);
}
.shared-bar p { margin: 0; flex: 1 1 260px; min-width: 0; font-size: 15px; overflow-wrap: anywhere; }
.shared-bar.error { background: var(--no-bg); color: var(--no); border-color: transparent; }
.shared-bar.ok { background: var(--ok-bg); color: var(--ok); border-color: transparent; }
.shared-ro {
  display: inline-block; margin-left: 6px; padding: 1px 9px; border-radius: 999px; vertical-align: 1px;
  font-size: 11.5px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; color: var(--accent);
  background: var(--surface); border: 1px solid color-mix(in srgb, var(--accent) 38%, transparent);
}
.shared-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.shared-actions .primary, .shared-actions .secondary { width: auto; padding: 9px 16px; }
.shared-actions .secondary { color: inherit; border-color: currentColor; }
.shared-actions button:disabled { opacity: 0.5; cursor: not-allowed; }
/* a shared plan is read-only: nothing here changes the student's own situation, shortlist or record */
body.sharing [data-action="star"],
body.sharing .about-row,
body.sharing .chat-launcher { display: none; }
body.sharing .field select { border-bottom-style: solid; cursor: default; }
.share-link {
  width: 100%; margin-top: 8px; padding: 9px 11px; border-radius: 10px; border: 1px solid var(--line);
  background: var(--surface-2); color: var(--ink); font-family: var(--mono); font-size: 12px;
}
.share-gone { margin: 14px 0 0; padding: 10px 12px; border-radius: 10px; background: var(--check-bg); color: var(--check); font-size: 13px; }
.share-gone ul { list-style: none; margin: 6px 0 0; padding: 0; display: grid; gap: 3px; }
.share-gone .muted { color: inherit; opacity: 0.85; }
.share-gone p { margin: 8px 0 0; }

/* Prerequisites: the dialog, and the block in a section's detail panel */
.record-link {
  justify-self: start; border: none; background: transparent; padding: 0; cursor: pointer; text-align: left;
  font: inherit; font-size: 13.5px; font-weight: 650; color: var(--accent); text-decoration: underline;
}
.prereq-body { display: grid; gap: 14px; padding-bottom: 22px; min-width: 0; }
.prereq-lead, .prereq-cover { margin: 0; font-size: 13.5px; color: var(--muted); }
.prereq-cover { color: var(--ink); }
.prereq-prompt { display: grid; gap: 10px; padding: 14px 16px; background: var(--surface); border: 1px dashed var(--line); border-radius: 14px; }
.prereq-prompt p { margin: 0; font-size: 14px; }
.prereq-prompt .record-find { justify-self: start; }
.prereq-group { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px 14px; min-width: 0; }
.prereq-group h3 { display: flex; align-items: center; gap: 8px; margin: 0 0 6px; font-family: var(--display); font-size: 14.5px; }
.prereq-group h3 span { font-family: var(--mono); font-size: 12px; font-weight: 600; color: var(--muted); background: var(--surface-2); border-radius: 999px; padding: 0 8px; }
.prereq-hint { margin: 0 0 8px; font-size: 13px; color: var(--muted); }
.prereq-empty { margin: 0; font-size: 13.5px; color: var(--muted); }
.prereq-item { border-top: 1px dashed var(--line); }
.prereq-hint + .prereq-item, .prereq-group h3 + .prereq-item { border-top: none; }
.prereq-item > summary, .prereq-all > summary { cursor: pointer; list-style: none; }
.prereq-item > summary::-webkit-details-marker, .prereq-all > summary::-webkit-details-marker { display: none; }
.prereq-item > summary { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; padding: 9px 0; }
.prereq-item > summary::before, .prereq-all > summary::before { content: "▸"; color: var(--muted); font-size: 11px; }
.prereq-item[open] > summary::before, .prereq-all[open] > summary::before { content: "▾"; }
.prereq-count { font-size: 12.5px; color: var(--muted); }
.prereq-all > summary { padding: 4px 2px; font-size: 13.5px; font-weight: 600; color: var(--muted); }
.prereq-all[open] > summary { margin-bottom: 8px; }
.prereq-all .prereq-group { margin: 0; }
.prereq-secs { list-style: none; margin: 0 0 8px; padding: 0; display: grid; gap: 6px; }
.prereq-sec {
  display: grid; gap: 2px; width: 100%; padding: 9px 12px; text-align: left; font: inherit; color: inherit; cursor: pointer;
  background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px;
}
.prereq-sec:hover { border-color: var(--accent); }
.prereq-line { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 8px; }
.prereq-title { font-size: 14px; font-weight: 600; overflow-wrap: anywhere; }
.prereq-star { font-size: 11.5px; font-weight: 700; color: var(--check); background: var(--check-bg); border-radius: 999px; padding: 1px 8px; }
.prereq-need { font-size: 12.5px; font-weight: 600; color: var(--ok); }
.prereq-other { font-size: 12.5px; color: var(--muted); font-style: italic; overflow-wrap: anywhere; }
.prereq-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 7px; font-size: 14px; }
.prereq-list li { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 8px; min-width: 0; overflow-wrap: anywhere; }
.prereq-list li.check { display: grid; gap: 3px; }
.check-tag { font-size: 11.5px; font-weight: 800; color: var(--check); background: var(--check-bg); border-radius: 999px; padding: 1px 8px; }
.rec { font-size: 13px; font-weight: 650; }
.rec.yes { color: var(--ok); }
.rec.no { color: var(--no); }
.rec-list { font-size: 12.5px; color: var(--muted); }
.prereq-ask { margin: 8px 0 0; }
.prereq-status { margin: 0 0 8px; font-size: 14px; font-weight: 700; }
.prereq-status.met { color: var(--ok); }
.prereq-status.missing { color: var(--no); }
.prereq-status.check { color: var(--check); }
.prereq-more { margin: 8px 0 0; font-size: 13.5px; }
.plan-pick-prereq { margin: 3px 0 0 !important; font-size: 12.5px; font-weight: 650; }
.plan-pick-prereq.met { color: var(--ok); }
.plan-pick-prereq.missing { color: var(--no); }
.plan-pick-prereq.check, .plan-pick-prereq.pending { color: var(--check); }
.record-hint { margin: 0; padding: 10px 12px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--line); font-size: 13px; color: var(--ink); }
.record-hint[hidden] { display: none; }
.link-btn { border: none; background: transparent; padding: 0; cursor: pointer; font: inherit; font-weight: 650; color: var(--accent); text-decoration: underline; }
@media (prefers-color-scheme: dark) {
  :where(:root:not([data-theme="light"])) .prereq-group, :where(:root:not([data-theme="light"])) .prereq-sec, :where(:root:not([data-theme="light"])) .prereq-prompt, :where(:root:not([data-theme="light"])) .share-link { border-color: rgba(255, 255, 255, 0.1); }
}
:where(:root[data-theme="dark"]) .prereq-group, :where(:root[data-theme="dark"]) .prereq-sec, :where(:root[data-theme="dark"]) .prereq-prompt, :where(:root[data-theme="dark"]) .share-link { border-color: rgba(255, 255, 255, 0.1); }

/* ---- registration: slots, countdown, changes ---- */
/* "A, else B": alternatives under a shortlisted class */
.reg-alts { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.reg-alt { display: flex; align-items: center; gap: 8px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); padding-left: 10px; }
.reg-alt-rank { flex: none; font-size: 11px; text-transform: uppercase; letter-spacing: 0.1em; color: var(--muted); font-weight: 700; }
.reg-alt-main { flex: 1; min-width: 0; display: grid; gap: 3px; padding: 8px 4px; border-radius: 10px; }
button.reg-alt-main:hover { background: var(--surface-2); }
.reg-alt.clash { box-shadow: inset 3px 0 0 var(--no-solid); }
.reg-alt.missing { border-style: dashed; background: transparent; }
.reg-alt-tools { display: flex; flex: none; gap: 2px; padding-right: 4px; }
.reg-alt-tools .icon-btn:disabled { opacity: 0.35; cursor: default; }
.reg-add {
  justify-self: start; border: 1.5px dashed var(--line); border-radius: 10px; background: transparent; color: var(--accent);
  font-weight: 650; font-size: 13.5px; padding: 7px 12px; cursor: pointer;
}
.reg-add:hover { background: var(--surface); }
.alt-picker { display: grid; gap: 8px; padding: 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
.alt-picker-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 13.5px; }
.alt-query, .appt-fields input {
  width: 100%; min-width: 0; font: inherit; padding: 9px 11px; border: 1px solid var(--line); border-radius: 10px;
  background: var(--surface-2); color: var(--ink);
}
.alt-results { display: grid; gap: 6px; }
.alt-results > p { margin: 0; }
.alt-options { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.alt-option {
  width: 100%; display: grid; gap: 3px; text-align: left; border: 1px solid var(--line); border-radius: 10px;
  background: var(--surface-2); color: inherit; font: inherit; padding: 8px 10px; cursor: pointer;
}
.alt-option:hover { background: var(--track); }
.alt-title { font-weight: 600; font-size: 13.5px; overflow-wrap: anywhere; }

/* Enrollment appointment and its countdown */
.appt { margin-top: 14px; display: grid; gap: 8px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
.appt .reg-label { margin-top: 0; }
.appt .small { margin: 0; }
.appt-fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 8px; }
.appt-fields label { display: grid; gap: 3px; min-width: 0; font-size: 12.5px; font-weight: 600; color: var(--muted); }
.appt-readout:empty { display: none; }
.appt-readout { display: grid; gap: 8px; }
.appt-count { margin: 0; font-size: 13.5px; }
.appt-count b { margin-right: 6px; font-family: var(--mono); font-size: 18px; }
.appt-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; }
.appt-actions .secondary { width: auto; padding: 8px 14px; }
.appt-clear { border: none; background: transparent; color: var(--muted); font-size: 13px; text-decoration: underline; cursor: pointer; padding: 6px 4px; }

/* Changes since the last visit */
.changes { padding: 12px 20px 14px; background: var(--check-bg); color: var(--ink); font-size: 13px; border-bottom: 1px solid var(--line); }
.changes-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.changes-head .icon-btn { background: transparent; margin: -4px -6px 0 0; }
.changes-head .icon-btn:hover { background: rgba(127, 127, 127, 0.2); }
.changes ul { margin: 6px 0 0; padding-left: 18px; display: grid; gap: 4px; }
.changes .reg-open { font-weight: 700; text-decoration: underline dotted; }
.changes-new { margin: 6px 0 0; font-weight: 650; }
@media (max-width: 420px) {
  .changes { padding-left: 16px; padding-right: 16px; }
  .reg-alt { flex-wrap: wrap; padding: 6px 8px; }
  .reg-alt-main { flex-basis: calc(100% - 52px); order: 1; }
  .reg-alt-rank { order: 0; }
  .reg-alt-tools { order: 2; margin-left: auto; padding-right: 0; }
}

/* ---- schedules: compare, busy times ---- */

/* Busy times: a pill, a chip for each, and the gap between classes, under the situation sentence */
.busy-row { margin: 2px 0 0; }
.busy-line { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
.busy-pill {
  display: inline-flex; align-items: center; gap: 7px; min-height: 30px; padding: 3px 13px 3px 10px; cursor: pointer;
  font: inherit; font-size: 13.5px; font-weight: 600; color: var(--board-ink);
  background: rgba(var(--glass), 0.04); border: 1px dashed var(--board-line); border-radius: 999px;
}
.busy-pill::before { content: "+"; font-weight: 700; font-size: 15px; line-height: 1; color: var(--board-accent); }
.busy-pill:hover:not(:disabled) { background: rgba(var(--glass), 0.09); border-color: rgba(245, 181, 68, 0.6); }
.busy-pill[aria-expanded="true"] { border-style: solid; border-color: rgba(245, 181, 68, 0.5); }
.busy-pill:disabled { opacity: 0.5; cursor: default; }
.busy-chips { display: contents; list-style: none; margin: 0; padding: 0; }
.busy-chip {
  display: inline-flex; align-items: center; gap: 2px; min-height: 30px; padding: 2px 3px 2px 12px; border-radius: 999px;
  font-size: 13.5px; color: var(--board-ink); background: rgba(245, 181, 68, 0.14); border: 1px solid rgba(245, 181, 68, 0.45);
}
.busy-chip b { font-weight: 700; color: var(--board-accent); }
.busy-chip button {
  width: 24px; height: 24px; border: none; border-radius: 50%; background: transparent; color: inherit; font-size: 16px; line-height: 1; cursor: pointer; opacity: 0.75;
}
.busy-chip button:hover { opacity: 1; background: rgba(var(--glass), 0.16); }
/* the gap between classes reads like the sentence above it: the same words and the same menu as the class hours */
.gap-field { font-size: clamp(17px, 1.9vw, 22px); line-height: 1.9; color: var(--board-text); white-space: nowrap; }
.busy-form, .about-form {
  display: grid; gap: 12px; margin-top: 10px; max-width: 620px; padding: 14px 16px;
  background: rgba(var(--glass), 0.05); border: 1px solid var(--board-line); border-radius: 14px; font-size: 14px; color: var(--board-text);
}
.busy-days { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0; border: none; min-width: 0; }
.busy-days legend { float: left; margin: 0 8px 0 0; padding: 0; line-height: 32px; color: var(--board-muted); font-size: 13px; }
.daychip { position: relative; }
.daychip input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.daychip span {
  display: inline-grid; place-items: center; min-width: 46px; height: 32px; padding: 0 8px; border-radius: 999px; cursor: pointer;
  font-size: 13px; font-weight: 650; border: 1px solid var(--board-line); background: rgba(var(--glass), 0.04);
}
.daychip input:checked + span { background: var(--amber); border-color: var(--board-accent); color: var(--on-amber); }
.daychip input:focus-visible + span { outline: 2px solid var(--focus); outline-offset: 2px; }
.busy-times { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; }
.busy-times label { display: inline-flex; align-items: center; gap: 8px; color: var(--board-muted); font-size: 13px; }
.busy-times select, .busy-label input {
  height: 34px; padding: 0 10px; font: inherit; font-size: 14px; color: var(--board-ink); background: var(--board); border: 1px solid var(--board-line); border-radius: 10px;
}
.busy-label { flex: 1 1 180px; }
.busy-label input { flex: 1; min-width: 0; }
.busy-label input::placeholder { color: var(--board-muted); }
.busy-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; }
.busy-save, .busy-cancel { height: 36px; padding: 0 16px; border-radius: 10px; font-weight: 650; cursor: pointer; }
.busy-save { border: none; background: var(--amber); color: var(--on-amber); }
.busy-save:hover { filter: brightness(1.05); }
.busy-cancel { border: 1px solid var(--board-line); background: transparent; color: var(--board-ink); }
.busy-cancel:hover { background: rgba(var(--glass), 0.08); }
.busy-error { flex: 1 1 180px; font-size: 13px; color: #ff9ba0; }

/* Busy times in the week charts, and a tight gap in the clash box */
.dial .block.busy, .week-legend i.busy {
  background: repeating-linear-gradient(135deg, var(--muted) 0 2px, transparent 2px 5px), color-mix(in srgb, var(--muted) 18%, transparent);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--muted) 55%, transparent);
}
.dial .block.busy { top: 1px; bottom: 1px; border-radius: 3px; }
.clashes.gaps-only { background: var(--check-bg); color: var(--check); }
.compare-open { margin-top: 12px; }
.short-needs { font-size: 12.5px; font-weight: 400; color: var(--muted); }

/* Compare schedules: a dialog with two or three columns, stacked on a phone */
dialog.compare {
  padding: 0; border: 1px solid var(--line); border-radius: 20px; background: var(--bg); color: var(--ink);
  width: min(1040px, calc(100vw - 24px)); max-height: min(92vh, 900px); overflow: hidden;
  box-shadow: 0 24px 80px rgba(14, 23, 38, 0.4);
}
dialog.compare[open] { display: flex; }
dialog.compare::backdrop { background: rgba(10, 17, 30, 0.62); }
.compare-panel { display: block; width: 100%; padding: 0 22px 22px; overflow-y: auto; overscroll-behavior: contain; }
.compare-head {
  position: sticky; top: 0; z-index: 2; display: flex; align-items: center; gap: 10px; margin: 0 -22px; padding: 14px 14px 13px 22px;
  background: var(--board); color: var(--board-ink); border-bottom: 1px solid var(--board-line);
}
.compare-head > div { flex: 1; min-width: 0; }
.compare-head .kicker { display: block; font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--board-accent); font-weight: 700; }
.compare-head h2 { margin: 1px 0 0; font-family: var(--display); font-size: 20px; line-height: 1.2; font-weight: 700; outline: none; }
.compare-head .icon-btn { background: rgba(var(--glass), 0.08); color: var(--board-ink); }
.compare-head .icon-btn:hover { background: rgba(var(--glass), 0.18); }
.compare-sub { margin: 14px 0 0; font-size: 14px; color: var(--muted); }
.compare-cols { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin-top: 16px; align-items: start; }
.compare-cols[data-count="1"] { grid-template-columns: minmax(0, 420px); }
.compare-cols[data-count="2"], .compare-cols[data-count="4"] { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.compare-prefs { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 14px; }
.pref { position: relative; }
.pref input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.pref span {
  display: inline-block; padding: 6px 12px; border-radius: 999px; cursor: pointer; font-size: 13px; font-weight: 650;
  border: 1.5px solid var(--line); background: var(--surface); color: var(--ink);
}
.pref:hover span { background: var(--surface-2); }
.pref input:checked + span { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.pref input:focus-visible + span { outline: 2px solid var(--focus); outline-offset: 2px; }
.pref-sep { width: 1px; align-self: stretch; margin: 2px 4px; background: var(--line); }
.compare-note { margin: 10px 0 0; padding: 8px 12px; font-size: 13px; color: var(--check); background: var(--check-bg); border-radius: 10px; }
.plan { display: grid; gap: 12px; min-width: 0; padding: 14px 16px 16px; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow); }
.plan.current { border-color: var(--accent); }
.plan header { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; }
.plan h3 { margin: 0 auto 0 0; font-family: var(--display); font-size: 16px; }
.plan-tag { font-size: 11.5px; font-weight: 700; padding: 2px 9px; border-radius: 999px; color: var(--ok); background: var(--ok-bg); white-space: nowrap; }
.plan-tag.mine { color: var(--ink); background: var(--track); }
.plan-sections { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.plan-sections li { display: grid; gap: 2px; min-width: 0; padding-bottom: 10px; border-bottom: 1px dashed var(--line); }
.plan-sections li:last-child { border-bottom: none; padding-bottom: 0; }
.plan-line { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; font-size: 12.5px; }
.plan-line .chip { font-size: 11.5px; padding: 2px 8px; }
.plan-title { font-weight: 600; font-size: 14px; overflow-wrap: anywhere; }
.plan-when { font-size: 13px; color: var(--muted); }
.plan-metrics { display: grid; grid-template-columns: auto 1fr; gap: 5px 14px; margin: 0; padding: 10px 12px; font-size: 13px; background: var(--surface-2); border-radius: 12px; }
.plan-metrics dt { color: var(--muted); }
.plan-metrics dd { margin: 0; font-weight: 600; text-align: right; font-family: var(--mono); font-size: 12.5px; }
.plan-metrics dd.best { color: var(--ok); }
.plan-metrics dd.best::after { content: " ✓"; }
.plan-week { gap: 4px 8px; }
.plan-week .dial { height: 10px; }
.plan-week .dial .block { top: 1px; bottom: 1px; }
.plan-key { margin-top: 0; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); }
.plan-action .primary { width: 100%; }
.plan-note { margin: 0; font-size: 13px; color: var(--muted); text-align: center; }
.plan-confirm { display: grid; gap: 8px; }
.plan-confirm p { margin: 0; font-size: 13.5px; }

/* When nothing fits: what is in the way, and buttons for the smallest changes */
.nofit h4 { margin: 20px 0 8px; font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.1em; color: var(--muted); font-weight: 700; }
.nofit-why, .nofit-fixes { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.nofit-why li { padding: 10px 12px; font-size: 14px; background: var(--no-bg); color: var(--no); border-radius: 10px; }
.fix {
  display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; width: 100%; padding: 12px 14px; text-align: left; font-size: 14px; cursor: pointer;
  color: var(--ink); background: var(--surface); border: 1.5px solid var(--ink); border-radius: 12px;
}
.fix:hover { background: var(--surface-2); }
.fix .arrow { color: var(--muted); }

@media (prefers-color-scheme: dark) {
  :where(:root:not([data-theme="light"])) dialog.compare, :where(:root:not([data-theme="light"])) .plan { border-color: rgba(255, 255, 255, 0.1); }
  :where(:root:not([data-theme="light"])) .busy-form, :where(:root:not([data-theme="light"])) .about-form { border-color: rgba(255, 255, 255, 0.12); }
}
:where(:root[data-theme="dark"]) dialog.compare, :where(:root[data-theme="dark"]) .plan { border-color: rgba(255, 255, 255, 0.1); }
  :where(:root[data-theme="dark"]) .busy-form, :where(:root[data-theme="dark"]) .about-form { border-color: rgba(255, 255, 255, 0.12); }
@media (max-width: 860px) {
  .compare-cols, .compare-cols[data-count] { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 560px) {
  dialog.compare { width: 100vw; max-width: 100vw; max-height: 100dvh; height: 100dvh; border-radius: 0; border: none; }
  .compare-panel { padding: 0 16px 24px; }
  .compare-head { margin: 0 -16px; padding-left: 16px; }
  .pref-sep { display: none; }
  .busy-form, .about-form { padding: 12px; }
}

/* Language controls remain usable with a keyboard and on narrow Chinese layouts. */
.language-switch { display:flex; align-items:center; gap:5px; margin-left:auto; font-size:12px; }
.language-switch button { color:inherit; background:transparent; border:1px solid transparent; border-radius:5px; padding:5px 7px; cursor:pointer; font:inherit; }
.language-switch button[aria-pressed="true"] { border-color:currentColor; font-weight:700; }
.language-switch button:focus-visible { outline:2px solid var(--amber); outline-offset:3px; }
html[lang="zh-CN"] { word-break:normal; overflow-wrap:anywhere; }
html[lang="zh-CN"] .situation { gap:8px; }
html[lang="zh-CN"] .situation .field { max-width:100%; }
html[lang="zh-CN"] select { max-width:100%; }
html[lang="zh-CN"] .week { grid-template-columns:32px minmax(0,1fr); }
@media (max-width: 420px) {

  html[lang="zh-CN"] .clocks { flex-wrap:wrap; }

  html[lang="zh-CN"] .busy-times, html[lang="zh-CN"] .appt-fields { flex-wrap:wrap; }
  html[lang="zh-CN"] .reg-alt-main, html[lang="zh-CN"] .reg-line { min-width:0; }
}

/* ---------- The 水课／保 GPA button beside the search box (gpa-picks-ui.js) and the marks of the older Grading facts (gpa-ui.js) ---------- */
.gpa-toggle {
  font: inherit; font-size: 14px; font-weight: 650; cursor: pointer; white-space: nowrap;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink); border-radius: 999px; padding: 9px 16px; box-shadow: var(--shadow);
}
.gpa-toggle:hover { border-color: var(--muted); }
.gpa-toggle:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.gpa-toggle[hidden] { display: none; }
.gpa-marks { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: baseline; }
.gpa-badge {
  font-size: 11.5px; font-weight: 700; letter-spacing: 0.01em; white-space: nowrap; color: var(--accent);
  background: color-mix(in srgb, var(--accent) 12%, transparent); border-radius: 999px; padding: 2px 9px;
}
.gpa-line { font-size: 12.5px; color: var(--muted); cursor: help; }
/* A section copied from Albert (lib/albert-sections.mjs): NYU's public class search does not list it. */
.albert-badge {
  font-size: 11px; font-weight: 700; letter-spacing: 0.01em; white-space: nowrap; color: var(--check); cursor: help;
  background: var(--check-bg); border-radius: 999px; padding: 1px 8px;
}
/* Albert's word on whether a class has room (core/seats.js): shown only when it is not open. */
.seats-chip {
  font-size: 11px; font-weight: 700; letter-spacing: 0.01em; white-space: nowrap; cursor: help; align-self: center;
  border-radius: 999px; padding: 1px 8px; color: var(--check); background: var(--check-bg);
}
.seats-chip.cancelled { color: var(--no); background: var(--no-bg); }
.panel-verdict .seats-chip, .short-meta .seats-chip { font-size: 11.5px; padding: 2px 8px; }
.class-tag { font-family: var(--mono); cursor: help; text-decoration: underline dotted; text-underline-offset: 2px; }
.reg-title { font-weight: 600; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.missing-badge { color: var(--no); background: var(--no-bg); }
.law-badge { color: var(--accent); background: color-mix(in srgb, var(--accent) 13%, transparent); }
.albert-note { margin: 0; font-size: 13.5px; line-height: 1.45; }
.albert-note .albert-badge { margin-right: 4px; }
.card .gpa-marks { margin-top: 1px; }
.short-open .gpa-marks { margin-top: 1px; }
.panel .gpa-line { cursor: auto; font-size: 13.5px; }

/* ---------- Instructors: "Instructor: J. Yeo", from NYU departments' public schedules ---------- */
.instructors { font-size: 12.5px; color: var(--muted); }
.instructors .inst-label::after { content: ":"; }
:lang(zh) .instructors .inst-label::after { content: "："; }
.inst > [translate="no"] { color: var(--ink); font-weight: 600; }
.facts .instructors { font-size: inherit; color: inherit; }
.facts .inst > [translate="no"] { font-weight: 500; }
.facts .inst-course { grid-column: 1 / -1; }
.facts .inst-course .inst-label { color: var(--muted); font-weight: 400; }
.short-item { flex-wrap: wrap; }
.short-instructors { flex: 1 0 100%; padding: 0 4px 10px; margin-top: -4px; }
.short-item.clash .short-instructors { padding-left: 10px; }

/* ---------- About you: under the record pills ---------- */
.about-row { margin: 8px 0 0; }
.about-line { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; font-size: 13.5px; color: var(--board-muted); }
.about-label { font-weight: 650; color: var(--board-ink); }
.about-parts { display: flex; flex-wrap: wrap; list-style: none; margin: 0; padding: 0; }
.about-parts li + li::before { content: "·"; margin: 0 7px; }
/* the student's limit on days on campus, as a small chip with its own × */
.campus-chip { display: inline-flex; align-items: center; gap: 2px; padding: 1px 3px 1px 9px; border-radius: 999px; border: 1px solid rgba(245, 181, 68, 0.55); color: var(--board-ink); }
.campus-chip button { position: relative; width: 20px; height: 20px; padding: 0; border: 0; border-radius: 50%; background: transparent; color: inherit; font: inherit; line-height: 1; cursor: pointer; }
.campus-chip button::after { content: ""; position: absolute; inset: -12px; } /* a 44px touch target around the small ×, which would otherwise stretch the chip */
.campus-chip button:hover { background: rgba(var(--glass), 0.14); }
.campus-chip button:focus-visible { outline: 2px solid var(--focus); outline-offset: 1px; }
.about-edit {
  min-height: 26px; padding: 0 12px; font: inherit; font-size: 12.5px; font-weight: 650; cursor: pointer;
  color: var(--board-ink); background: transparent; border: 1px solid var(--board-line); border-radius: 999px;
}
.about-edit:hover { background: rgba(var(--glass), 0.08); border-color: rgba(245, 181, 68, 0.6); }
.about-fields { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; }
.about-fields label { display: inline-flex; align-items: center; gap: 8px; color: var(--board-muted); font-size: 13px; }
.about-fields select, .about-fields input {
  height: 34px; padding: 0 10px; font: inherit; font-size: 14px; color: var(--board-ink); background: var(--board); border: 1px solid var(--board-line); border-radius: 10px;
}
.about-fields input[type="number"] { width: 84px; }
.about-fields input::placeholder { color: var(--board-muted); }
.about-major { flex: 1 1 200px; }
.about-major input { flex: 1; min-width: 0; }
.about-check { display: inline-flex; align-items: center; gap: 8px; justify-self: start; font-size: 14px; color: var(--board-ink); cursor: pointer; }
.about-check input { width: 18px; height: 18px; margin: 0; accent-color: var(--board-accent); }
.about-hint { margin: -6px 0 0; font-size: 12.5px; color: var(--board-muted); }

/* ---------- Rate My Professors scores and "Paste from Albert" (public/rmp-ui.js, public/albert-ui.js) ---------- */
.instructors:has(.scored) { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 8px; }
.inst.scored { display: inline-flex; flex-wrap: wrap; align-items: baseline; gap: 2px 3px; }
/* not a link: the numbers are shown here, the score and its number of ratings (.rmp-main) in the same weight, the rest quieter */
.rmp-score { display: inline-block; max-width: 100%; margin-left: 3px; font-size: 12.5px; line-height: 1.45; color: var(--ink); }
.inst.scored .rmp-score { margin-left: 0; }
.rmp-parts > span + span::before { content: " · "; white-space: pre; }
.rmp-main { font-weight: 700; }
.rmp-parts > span:not(.rmp-main) { color: var(--muted); }
.rmp-score.several, .rmp-score.none, .rmp-score.unrated, .rmp-score.unavailable { font-size: 11.5px; color: var(--muted); }
.rmp-source { margin: 6px 0 0; }

.albert-out { display: grid; gap: 10px; min-width: 0; }
.albert-out:empty { display: none; }
.albert-facts { display: flex; flex-wrap: wrap; gap: 6px 20px; margin: 0; padding: 10px 14px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; }
.albert-facts div { display: grid; gap: 1px; min-width: 0; }
.albert-facts dt { font-size: 11.5px; color: var(--muted); }
.albert-facts dd { margin: 0; font-size: 14.5px; font-weight: 700; }
.albert-warn { margin: 0; padding: 9px 12px; border-radius: 10px; background: var(--check-bg); color: var(--check); font-size: 13.5px; overflow-wrap: anywhere; }
.albert-switch {
  margin-left: 4px; padding: 3px 12px; font: inherit; font-size: 12.5px; font-weight: 650; cursor: pointer;
  color: inherit; background: transparent; border: 1.5px solid currentColor; border-radius: 999px;
}
.albert-secs { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; max-height: 340px; overflow-y: auto; overscroll-behavior: contain; }
.albert-sec { display: grid; gap: 3px; min-width: 0; padding: 9px 12px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; }
.albert-sec.unmatched { border-style: dashed; }
.albert-sec-line { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 10px; font-size: 13px; }
.albert-sec-line .code { font-family: var(--mono); font-weight: 700; }
.albert-tag { padding: 0 8px; font-size: 11px; font-weight: 700; color: var(--check); background: var(--check-bg); border-radius: 999px; cursor: help; }
.albert-sec-title { font-size: 13.5px; overflow-wrap: anywhere; }
.albert-names { display: grid; gap: 2px; font-size: 13px; }
.albert-names .inst { display: block; }
.albert-names .inst > [translate="no"] { color: var(--ink); font-weight: 600; }
.albert-row { margin: 10px 0 0; }
.chat-msg.has-albert { align-self: stretch; align-items: stretch; max-width: 100%; }
.chat-albert { display: grid; gap: 8px; min-width: 0; padding: 12px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; overflow-wrap: anywhere; }
.chat-albert .kicker { font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--accent); font-weight: 700; }
.chat-albert .albert-card { display: grid; gap: 8px; }
.chat-albert .albert-secs { max-height: 280px; }
.chat-albert .albert-sec { background: var(--surface-2); }

/* a file added in the chat: the chip over the text box, the same chip under the question, the audit card, the drop hint */
.chat-file-chip {
  display: inline-flex; align-items: center; gap: 6px; max-width: 100%; min-width: 0; padding: 4px 6px 4px 10px;
  font-size: 12.5px; line-height: 1.3; color: var(--ink); background: var(--surface-2); border: 1px solid var(--line); border-radius: 999px;
}
.chat-file-chip .file-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 650; }
.chat-file-chip .file-size { flex: none; color: var(--muted); white-space: nowrap; }
.chat-file-chip button {
  flex: none; display: grid; place-items: center; width: 28px; height: 28px; padding: 0; font: inherit; font-size: 16px; line-height: 1;
  color: var(--muted); background: transparent; border: 0; border-radius: 50%; cursor: pointer;
}
.chat-file-chip button:hover { color: var(--ink); background: color-mix(in srgb, var(--ink) 10%, transparent); }
.chat-file-chip.sent { padding-right: 10px; }
.chat-attached .chat-file-chip { margin-bottom: 2px; }
.chat-msg.has-card { align-self: stretch; align-items: stretch; max-width: 100%; }
.chat-audit { display: grid; gap: 8px; min-width: 0; padding: 12px; font-size: 13.5px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; overflow-wrap: anywhere; }
.chat-audit .kicker { font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--accent); font-weight: 700; }
.chat-audit .audit-counts { margin: 0; font-weight: 650; }
.chat-audit .audit-reqs { margin: 0; padding-left: 18px; color: var(--muted); }
.chat-audit .audit-reqs li + li { margin-top: 2px; }
.chat-audit .audit-reqs .audit-more { list-style: none; margin-left: -18px; }
.chat-audit .audit-status { margin: 0; color: var(--muted); }
.chat-audit .audit-actions { display: flex; flex-wrap: wrap; gap: 7px; }
.chat-audit .audit-actions button {
  min-height: 40px; padding: 8px 12px; font: inherit; font-size: 12.5px; font-weight: 650; cursor: pointer; max-width: 100%;
  color: var(--accent); background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px;
}
.chat-audit .audit-actions button:first-child { background: var(--amber); color: var(--on-amber); border-color: transparent; }
.chat-audit .audit-actions button:hover { outline: 1px solid var(--accent); }
.chat-drop {
  position: absolute; inset: 0; z-index: 2; display: grid; place-items: center; padding: 24px; text-align: center; pointer-events: none;
  font-size: 16px; font-weight: 700; color: var(--ink); background: color-mix(in srgb, var(--bg) 88%, transparent);
  border: 2px dashed var(--accent); border-radius: 12px; margin: 8px;
}
@media (max-width: 640px) {
  .chat-add { width: 44px; height: 44px; margin-bottom: 0; }
  .chat-file-chip button { width: 32px; height: 32px; }
  .chat-audit .audit-actions button { min-height: 44px; }
}
@media (max-width: 560px) {
  .albert-facts { gap: 6px 14px; padding: 9px 12px; }
  .albert-secs { max-height: 260px; }
}

/* ---------- Cart and account (public/cart-ui.js) ---------- */
/* The top bar: brand, language, account and cart stay in view on every screen. */
.topbar { position: sticky; top: 0; z-index: 25; background: var(--board); color: var(--board-ink); border-bottom: 1px solid var(--board-line); }
.topbar-inner { max-width: 1280px; margin: 0 auto; padding: 8px 28px; min-height: 60px; display: flex; align-items: center; gap: 10px; }
.topbar .language-switch { margin-left: auto; }

.topbar-btn {
  position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 8px; flex: none;
  min-width: 44px; min-height: 44px; padding: 0 13px; border-radius: 12px; cursor: pointer;
  font: inherit; font-size: 13.5px; font-weight: 650; color: var(--board-ink);
  background: rgba(var(--glass), 0.05); border: 1px solid var(--board-line);
}
.topbar-btn:hover { background: rgba(var(--glass), 0.12); border-color: rgba(245, 181, 68, 0.6); }
.topbar-btn:focus-visible { outline: 2px solid var(--amber); outline-offset: 2px; }
.topbar-btn.signed-in svg { color: var(--board-accent); }
/* light or dark (public/theme.js): the moon offers dark, the sun offers light */
.theme-btn .theme-sun { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-btn .theme-sun { display: block; }
  :root:not([data-theme="light"]) .theme-btn .theme-moon { display: none; }
}
:root[data-theme="dark"] .theme-btn .theme-sun { display: block; }
:root[data-theme="dark"] .theme-btn .theme-moon { display: none; }
.topbar-label { max-width: 190px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cart-badge {
  display: inline-grid; place-items: center; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 999px;
  background: var(--amber); color: var(--on-amber); font: 800 12.5px/1 var(--mono);
}
.cart-badge[data-count="0"] { background: rgba(var(--glass), 0.16); color: var(--board-muted); }
/* Find classmates (找课友): only its ways in are styled here; its page brings its own stylesheet (buddies.css) when it is opened */
.buddy-dot {
  position: absolute; top: -7px; right: -7px; display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 5px;
  border: 2px solid var(--board); border-radius: 999px; background: var(--no-fill); color: #fff; font: 800 11.5px/1 var(--mono);
}
body:has(#sharedBar.viewing) .buddy-dot { display: none; } /* a shared plan on screen shows nothing of it */
.buddy-entry-row { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 10px; margin: 2px 0 0; }
.buddy-entry { display: inline-flex; align-items: center; gap: 6px; min-width: 44px; min-height: 44px; padding: 0; border: none; background: transparent; font: inherit; font-size: 14px; font-weight: 700; color: var(--accent); text-decoration: underline; cursor: pointer; }
.buddy-entry-count { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 999px; background: var(--no-fill); color: #fff; font: 800 11.5px/1 var(--mono); text-decoration: none; }
.buddy-entry:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.links.buddy-link { margin-top: 6px; }
@keyframes cart-bump { 0% { transform: scale(1); } 35% { transform: scale(1.6); } 70% { transform: scale(0.92); } 100% { transform: scale(1); } }
@media (prefers-reduced-motion: no-preference) {
  .cart-badge.bump { animation: cart-bump 0.45s ease; transform-origin: 100% 0; } /* grows toward the page, not past its right edge */
  .cart-toast { transition: opacity 0.18s ease, transform 0.18s ease; }
}
@media (max-width: 640px) {
  .topbar-inner { padding: 6px 12px; gap: 6px; }
  .topbar .brand { gap: 7px; min-width: 0; }
  .topbar .brand .for, .topbar-label { display: none; }
  .topbar .name { font-size: 20px; }
}
/* a narrow phone: the logo alone, so the language, light/dark, account and cart buttons keep their 44 px in one row */
@media (max-width: 420px) {
  .topbar .name { display: none; }
  .topbar .brand { min-width: 44px; justify-content: center; }
  .cart-badge { position: absolute; top: -7px; right: -7px; border: 2px solid var(--board); box-sizing: content-box; }
  .topbar-btn { padding: 0; }
}

/* the sticky bar covers the top 60px: the side panel starts below it */
@media (min-width: 901px) {
  .side { top: 78px; max-height: calc(100vh - 78px - 18px - 62px); }
}

/* Add to cart, on a card and in the detail panel */
.cart-add {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 40px; padding: 0 14px;
  border-radius: 999px; border: 1px solid var(--board); background: var(--board); color: var(--board-ink);
  font-size: 13px; font-weight: 700; white-space: nowrap; cursor: pointer;
}
.cart-add svg { color: var(--board-accent); }
.cart-add:hover { background: var(--board-2); }
.cart-add.added { background: var(--ok-bg); border-color: var(--ok-solid); color: var(--ok); }
.cart-add.large { min-height: 44px; padding: 0 18px; font-size: 14px; }
@media (prefers-color-scheme: dark) {
  :where(:root:not([data-theme="light"])) .cart-add:not(.added) { background: var(--amber); border-color: var(--board-accent); color: var(--on-amber); }
  :where(:root:not([data-theme="light"])) .cart-add:not(.added) svg { color: var(--on-amber); }
  :where(:root:not([data-theme="light"])) .cart-add:not(.added):hover { background: var(--amber); filter: brightness(1.07); }
}
:where(:root[data-theme="dark"]) .cart-add:not(.added) { background: var(--amber); border-color: var(--board-accent); color: var(--on-amber); }
  :where(:root[data-theme="dark"]) .cart-add:not(.added) svg { color: var(--on-amber); }
  :where(:root[data-theme="dark"]) .cart-add:not(.added):hover { background: var(--amber); filter: brightness(1.07); }
body.sharing [data-action="cart-add"], body.sharing [data-action="cart-toggle"] { display: none; }

/* The toast under the top bar */
.cart-toast {
  position: fixed; z-index: 40; top: 70px; right: calc(var(--dock-w) + 20px); max-width: min(480px, calc(100vw - 24px)); /* beside an open panel, never over it */
  display: flex; align-items: center; flex-wrap: wrap; gap: 8px 10px; padding: 10px 10px 10px 16px;
  border-radius: 14px; background: var(--board); color: var(--board-ink); border: 1px solid var(--board-line);
  box-shadow: 0 12px 40px rgba(14, 23, 38, 0.4); font-size: 14px;
  opacity: 0; pointer-events: none; transform: translateY(-8px);
}
.cart-toast:empty { display: none; }
.cart-toast.show { opacity: 1; pointer-events: auto; transform: none; }
.cart-toast-text { flex: 1 1 180px; font-weight: 650; white-space: pre-line; }
/* the school and the major disagree: a warning line with its two answers */
.school-conflict { margin: 4px 0 14px; max-width: 760px; padding: 12px 16px; border: 1px solid var(--check-solid); border-radius: 12px; background: #fcefd2; color: #6b4500; }
.school-conflict[hidden] { display: none; }
.school-conflict p { margin: 0 0 8px; font-weight: 650; }
.school-conflict-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.school-conflict-actions button { min-height: 40px; padding: 0 14px; border-radius: 999px; border: 1px solid #b07a12; background: #fff8e8; color: #4a3000; font-weight: 650; cursor: pointer; }
.school-conflict-actions button:first-child { background: #e3a21a; border-color: #e3a21a; color: #241600; }
@media (pointer: coarse) { .school-conflict-actions button { min-height: 44px; } }
/* another section of the course is in the cart: said in words on the card, so a ✓ is never read as this section's */
.cart-other-line, .chat-cart-other { margin: 4px 0 0; font-size: 12.5px; color: var(--check, var(--muted)); font-weight: 600; }
.chat-cart-other { flex-basis: 100%; }
.cart-add.cart-quick.other { border-style: dashed; }
.cart-toast-btn {
  min-height: 40px; padding: 0 16px; border-radius: 999px; cursor: pointer; font-weight: 700; font-size: 13.5px;
  color: inherit; background: rgba(var(--glass), 0.1); border: 1px solid var(--board-line);
}
.cart-toast-btn:hover { background: rgba(var(--glass), 0.18); }
.cart-toast-btn.primary-action { background: var(--amber); color: var(--on-amber); border-color: transparent; }
.cart-toast-x { width: 40px; height: 40px; border: none; border-radius: 50%; background: transparent; color: var(--board-muted); font-size: 20px; cursor: pointer; }
.cart-toast-x:hover { background: rgba(var(--glass), 0.12); color: var(--board-ink); }
.cart-toast button:focus-visible { outline: 2px solid var(--amber); outline-offset: 2px; }
@media (max-width: 640px) { .cart-toast { top: 64px; left: 12px; right: 12px; max-width: none; } }

/* The cart view: replaces the page body while the address is #cart */
.cart-view[hidden] { display: none; }
.cart-inner { max-width: 920px; margin: 0 auto; padding: 18px 28px 40px; }
.cart-head { display: grid; gap: 4px; }
.cart-back {
  justify-self: start; min-height: 44px; margin-left: -6px; padding: 0 12px 0 6px; border: none; background: transparent;
  color: var(--accent); font-size: 14.5px; font-weight: 650; cursor: pointer;
}
.cart-back:hover { text-decoration: underline; }
.cart-title-row { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 6px 18px; }
.cart-title-row .kicker { display: block; font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--accent); font-weight: 700; }
.cart-title { margin: 2px 0 0; font-family: var(--display); font-size: 30px; line-height: 1.15; letter-spacing: -0.01em; }
.cart-title:focus { outline: none; }
.cart-sync { margin: 0; font-size: 13.5px; color: var(--muted); }
.cart-sync.saved::before { content: "✓ "; color: var(--ok); font-weight: 800; }
.cart-link { border: none; background: transparent; padding: 0; min-height: 32px; font: inherit; font-weight: 650; color: var(--accent); text-decoration: underline; cursor: pointer; }
.cart-link.danger { color: var(--no); }
.cart-tools { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 14px; font-size: 14px; }
.cart-confirm { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; padding: 8px 12px; border-radius: 12px; background: var(--no-bg); color: var(--no); font-weight: 650; }
.cart-danger { min-height: 40px; padding: 0 14px; border: none; border-radius: 10px; background: var(--no-fill); color: #fff; font-weight: 700; cursor: pointer; }
.cart-confirm .secondary { width: auto; min-height: 40px; padding: 0 14px; color: var(--ink); }
.cart-items { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 12px; }
.cart-item { position: relative; display: grid; gap: 8px; padding: 14px 8px 14px 16px; border-radius: 14px; background: var(--surface); box-shadow: var(--shadow); }
.cart-item-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding-right: 40px; min-height: 36px; } /* the × sits in the corner: chips that fill the row wrap beside it, not under it */
.cart-item-credits { font-family: var(--mono); font-size: 13px; }
.cart-remove { position: absolute; top: 2px; right: 2px; width: 44px; height: 44px; font-size: 24px; }
.cart-item-title { justify-self: start; max-width: 100%; margin-top: -4px; padding: 0; border: none; background: transparent; text-align: left; font: 650 17px/1.3 var(--sans); color: var(--ink); cursor: pointer; }
.cart-item-title:hover { text-decoration: underline; }
.cart-item .instructors { font-size: 13px; }
.cart-secs { list-style: none; margin: 4px 8px 0 0; padding: 10px 0 0; border-top: 1px dashed var(--line); display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 12px 24px; }
.cart-sec { display: grid; gap: 6px; min-width: 0; align-content: start; }
.cart-sec-meta { display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: baseline; font-size: 12.5px; }
.cart-foot {
  position: sticky; bottom: 0; z-index: 3; margin-top: 18px; display: flex; align-items: center; justify-content: space-between; gap: 12px 20px; flex-wrap: wrap;
  padding: 14px 16px calc(14px + env(safe-area-inset-bottom, 0px)); border-radius: 16px; background: var(--surface); border: 1px solid var(--line);
  box-shadow: 0 -8px 30px rgba(20, 24, 33, 0.14);
}
.cart-total { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 12px; }
.cart-total > span:first-child { color: var(--muted); font-size: 13px; text-transform: uppercase; letter-spacing: 0.08em; font-weight: 600; }
.cart-total b { font-family: var(--mono); font-size: 26px; }
.primary.cart-generate { width: auto; min-height: 56px; padding: 0 30px; font-size: 17px; background: var(--amber); color: var(--on-amber); }
.primary.cart-generate:hover { background: var(--amber); filter: brightness(1.07); }
.cart-empty { display: grid; justify-items: center; gap: 6px; padding: 64px 16px 80px; text-align: center; }
.cart-empty-title { margin: 0; font-family: var(--display); font-size: 22px; font-weight: 700; }
.cart-empty p { margin: 0; }
.primary.cart-find { width: auto; min-height: 48px; margin-top: 14px; padding: 0 26px; }
.cart-view button:focus-visible, .cart-view .cart-item-title:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
@media (max-width: 640px) {
  .cart-inner { padding: 8px 16px 28px; }
  .cart-title { font-size: 25px; }
  .cart-secs { grid-template-columns: minmax(0, 1fr); }
  .cart-foot { margin-left: -4px; margin-right: -4px; }
  .primary.cart-generate { width: 100%; }
  .cart-tools { flex-wrap: wrap; }
}

/* Sign in / create an account: the record dialog's frame, a short form */
.account-body { display: grid; gap: 14px; padding-bottom: 22px; }
.auth-form { display: grid; gap: 12px; }
.auth-field { display: grid; gap: 5px; font-size: 13px; font-weight: 650; color: var(--muted); }
.auth-field small { font-weight: 500; }
.auth-field textarea { width: 100%; min-height: 120px; padding: 10px 12px; font: inherit; font-size: 16px; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: 12px; resize: vertical; }
.auth-ok { margin: 0; color: var(--ok); font-size: 13px; font-weight: 650; }
.footer .link-btn { font-size: inherit; min-height: 44px; }
/* the ICP filing number: centred at the very bottom, a 44 px target like the rest */
.footer .icp { margin: 10px 0 0; text-align: center; font-size: 12px; }
.footer .icp a { color: var(--muted); text-decoration: none; display: inline-flex; align-items: center; min-height: 44px; padding: 0 8px; }
.footer .icp a:hover { text-decoration: underline; }
.auth-field input { width: 100%; min-height: 44px; padding: 0 12px; font: inherit; font-size: 16px; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: 12px; }
.auth-error { min-height: 20px; margin: 0; font-size: 13.5px; font-weight: 650; color: var(--no); }
.auth-lead { margin: 0; font-size: 14.5px; line-height: 1.5; color: var(--muted); }
.auth-lead b { color: var(--ink); font-weight: 650; overflow-wrap: anywhere; }
.auth-go { width: 100%; min-height: 46px; }
.auth-go:disabled { opacity: 0.6; cursor: default; }
.auth-or { display: flex; align-items: center; gap: 10px; margin: 4px 0; font-size: 13px; color: var(--muted); }
.auth-or::before, .auth-or::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.auth-alt { display: flex; align-items: center; justify-content: center; gap: 9px; width: 100%; min-height: 44px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); color: var(--ink); font: inherit; font-weight: 650; font-size: 14.5px; cursor: pointer; }
.auth-who { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 44px; padding: 0 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-2); font-size: 14.5px; font-weight: 650; color: var(--ink); }
.auth-who span { overflow-wrap: anywhere; }
/* One real input lies over the six cells, so a phone's offer of the code, a paste and the keyboard all reach it. */
.otp { position: relative; }
.otp input { position: absolute; inset: 0; z-index: 1; width: 100%; height: 100%; padding: 0; border: none; outline: none; background: transparent; color: transparent; caret-color: transparent; font-size: 16px; }
.otp input::selection { background: transparent; }
.otp-cells { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px; }
.otp-cells i { display: flex; align-items: center; justify-content: center; height: 52px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); font: 700 22px/1 ui-monospace, Menlo, monospace; font-style: normal; color: var(--ink); }
.otp-cells i.on { border-color: var(--ink); box-shadow: 0 0 0 2px color-mix(in srgb, var(--ink) 18%, transparent); }
.auth-row { display: flex; flex-wrap: wrap; gap: 6px 18px; align-items: center; }
.auth-row .cart-link { font-size: 13.5px; }
.auth-row .cart-link:disabled { color: var(--muted); cursor: default; text-decoration: none; }
.set-rows { display: grid; gap: 0; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.set-rows > div { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 14px; border-top: 1px solid var(--line); background: var(--surface); }
.set-rows > div:first-child { border-top: none; }
.set-rows > div:empty { display: none; }
.set-rows p { margin: 0; font-size: 14.5px; font-weight: 650; color: var(--ink); }
.set-rows small { display: block; margin-top: 2px; font-size: 13px; font-weight: 500; color: var(--muted); overflow-wrap: anywhere; }
.set-ok { color: var(--ok); font-weight: 650; }
.auth-note { margin: 0; min-height: 0; font-size: 13.5px; color: var(--muted); }
.auth-note:empty { display: none; }
.auth-account-actions { justify-content: space-between; align-items: center; flex-wrap: wrap; }
.auth-account-actions .cart-link { font-size: 13.5px; }
.auth-actions .cart-danger { flex: 1; min-height: 42px; }
.auth-actions .cart-danger:disabled { opacity: 0.6; cursor: default; }
.auth-phone { display: flex; gap: 8px; align-items: stretch; }
.auth-field .auth-phone select { flex: none; width: 88px; min-height: 44px; padding: 0 8px; font: inherit; font-size: 16px; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: 12px; }
.auth-phone .auth-cc { flex: none; display: inline-flex; align-items: center; padding: 0 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-2); color: var(--ink); font-weight: 650; }
.auth-field .auth-phone input { flex: 1; width: auto; min-width: 0; }
.auth-error.ok { color: var(--ok); }
.auth-terms { display: flex; gap: 10px; align-items: flex-start; font-size: 13.5px; line-height: 1.45; color: var(--muted); cursor: pointer; }
.auth-terms input { flex: none; width: 20px; height: 20px; margin: 0; accent-color: var(--accent); }
.auth-terms a { color: var(--accent); font-weight: 650; }
@media (pointer: coarse) { .auth-terms { min-height: 44px; align-items: center; } }
.auth-actions { display: flex; gap: 10px; }
.auth-actions .record-save { width: 100%; }
.auth-actions .secondary { width: auto; min-height: 42px; padding: 0 20px; }
.auth-line { margin: 0; font-size: 15px; overflow-wrap: anywhere; }
@media (prefers-color-scheme: dark) { :where(:root:not([data-theme="light"])) dialog.account { border-color: rgba(255, 255, 255, 0.1); } }
:where(:root[data-theme="dark"]) dialog.account { border-color: rgba(255, 255, 255, 0.1); }
@keyframes cart-bump-soft { 0% { transform: scale(1); } 40% { transform: scale(1.05); } 100% { transform: scale(1); } }
@media (prefers-reduced-motion: no-preference) { .record-pill.cart-pill.bump { animation: cart-bump-soft 0.35s ease; } }
/* ---------- The panels from the right: the chat sidebar and the cart drawer (chat.js, cart-ui.js, dock.js) ----------
   One is open at a time. On a desktop the page makes room for it (body padding), so the course list is never covered; below 768px
   the panel is the whole screen. --chat-w is the sidebar's width (35% of the window, at least 420px, or what the student dragged). */
:root {
  --chat-w: max(420px, 35vw);
  --chat-eff: min(var(--chat-w), max(420px, calc(100vw - 360px))); /* the list keeps at least 360px beside it */
  --cart-w: 440px;
  --dock-w: 0px; /* the width of the panel that is open */
}
@media (min-width: 768px) {
  body.chat-open:not(.chat-full) { --dock-w: var(--chat-eff); }
  body.cart-open { --dock-w: var(--cart-w); }
  body { padding-right: var(--dock-w); }
}
@media (prefers-reduced-motion: no-preference) {
  body { transition: padding-right 0.22s ease; }
  body.chat-resizing { transition: none; }
}
body.chat-resizing { user-select: none; cursor: col-resize; }
body.chat-resizing .chat { transition: none; }

/* a card narrower than its desktop layout (the panel takes room): the 24-hour bar drops under the text */
body.dock-open .card { grid-template-columns: minmax(0, 1fr) auto; }
body.dock-open .when { grid-column: 1 / -1; grid-row: 2; }
body.dock-open .right { grid-row: 1; grid-column: 2; }
/* what is left is too narrow for the list and the side panel side by side: the layout of a small screen (the 900px rules above) */
body.dock-narrow .layout { grid-template-columns: 1fr; }
body.dock-narrow .side { position: static; max-height: none; }
body.dock-narrow.detail-open .side {
  position: fixed; left: 0; right: var(--dock-w); bottom: 0; top: auto; z-index: 20; max-height: 86vh; overflow: auto;
  box-shadow: 0 -12px 40px rgba(0, 0, 0, 0.3); border-radius: 20px 20px 0 0;
}
body.dock-narrow.detail-open .side .panel { border-radius: 20px 20px 0 0; }
body.dock-narrow:not(.detail-open) .side {
  position: fixed; left: 0; right: var(--dock-w); bottom: 0; top: auto; z-index: 15; max-height: 72vh; overflow: auto;
  box-shadow: 0 -10px 30px rgba(0, 0, 0, 0.25); border-radius: 20px 20px 0 0;
}
body.dock-narrow:not(.detail-open) .side .panel { border-radius: 20px 20px 0 0; }
body.dock-narrow:not(.detail-open):not(.sheet-open) .pass-body { display: none; }
body.dock-narrow .sheet-toggle { cursor: pointer; }
body.dock-narrow .sheet-toggle::after { content: "▴"; color: var(--board-muted); margin-left: auto; }
body.dock-narrow.sheet-open .sheet-toggle::after { content: "▾"; }
body.dock-narrow .footer { padding-bottom: 170px; }
body.dock-narrow .chat-launcher { bottom: calc(env(safe-area-inset-bottom, 0px) + 86px); z-index: 14; }

/* the launcher: the chat sidebar has its own close button; the cart drawer leaves the launcher beside it; a phone's panel is the screen */
body.chat-open .chat-launcher { display: none; }
@media (max-width: 767px) { body.cart-open .chat-launcher { display: none; } }

/* ---- the chat sidebar ---- */
.chat-resize {
  position: absolute; left: -5px; top: 0; bottom: 0; z-index: 3; width: 11px; cursor: col-resize; touch-action: none;
}
.chat-resize::after { content: ""; position: absolute; left: 4px; top: 0; bottom: 0; width: 3px; background: transparent; transition: background 0.12s ease; }
.chat-resize:hover::after, .chat-resize:focus-visible::after, body.chat-resizing .chat-resize::after { background: var(--amber); }
.chat-resize:focus-visible { outline: none; }
.chat-full svg { display: block; margin: auto; }
.chat-full[aria-pressed="true"] { background: rgba(var(--glass), 0.22); }
body.chat-full .chat { width: 100vw; border-left: none; }
body.chat-full .chat-resize { display: none; }
/* full screen on a wide monitor: the conversation keeps a readable width in the middle */
body.chat-full .chat-head, body.chat-full .chat-log, body.chat-full .chat-composer, body.chat-full .chat-activity {
  padding-left: max(20px, calc(50vw - 460px)); padding-right: max(20px, calc(50vw - 460px));
}
body.chat-full .chat-history, body.chat-full .chat-notice { margin-left: max(16px, calc(50vw - 460px)); margin-right: max(16px, calc(50vw - 460px)); }
@media (max-width: 767px) {
  .chat-resize, .chat-full { display: none; }
  .chat-launcher { right: 16px; }
}

/* the sections the assistant recommends: cards like the course list's, with ＋ Add to cart on each */
.chat-section-card { position: relative; overflow: hidden; box-shadow: var(--shadow); }
.chat-section-card::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--line); }
.chat-section-card.takeable::before { background: var(--ok-solid); }
.chat-section-card.check::before { background: var(--check-solid); }
.chat-section-card.no::before { background: var(--no-solid); }
.chat-section-card .chat-section-open { padding-left: 16px; }
.chat-section-card .chat-section-meta { padding-left: 16px; }
.chat-section-meta .chat-cart:not(.on):not(.other):not(:disabled)::before { content: "＋"; margin-right: 5px; font-weight: 800; }

/* ---- the course card's ＋ / ✓ ---- */
.card:has(> .cart-quick) { padding-right: 62px; }
.cart-add.cart-quick {
  position: absolute; top: 10px; right: 10px; z-index: 1; width: 40px; height: 40px; min-height: 0; padding: 0; border-radius: 50%;
  transition: transform 0.12s ease, background 0.12s ease;
}
.cart-add.cart-quick svg { display: block; color: inherit; }
.cart-add.cart-quick:not(.added) svg { color: var(--board-accent); }
.cart-add.cart-quick:hover { transform: scale(1.08); }
.cart-add.cart-quick:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
@media (prefers-color-scheme: dark) { :where(:root:not([data-theme="light"])) .cart-add.cart-quick:not(.added) svg { color: var(--on-amber); } }
:where(:root[data-theme="dark"]) .cart-add.cart-quick:not(.added) svg { color: var(--on-amber); }
@media (pointer: coarse), (max-width: 767px) {
  .cart-add.cart-quick { width: 44px; height: 44px; top: 8px; right: 8px; }
}
/* a card laid out in two columns (a small screen, or the page made narrower by a panel): the verdict chip sits under the corner button */
@media (max-width: 1060px) {
  .card:has(> .cart-quick) { padding-right: 16px; }
  .card:has(> .cart-quick) .right { align-self: start; padding-top: 42px; }
}
body.dock-open .card:has(> .cart-quick) { padding-right: 16px; }
body.dock-open .card:has(> .cart-quick) .right { align-self: start; padding-top: 42px; }

/* ---- the small hint under the cart icon, and the +1 ---- */
.cart-toast.compact { top: 62px; padding: 7px 16px; gap: 6px 10px; border-radius: 999px; font-size: 13.5px; box-shadow: 0 6px 22px rgba(14, 23, 38, 0.32); }
.cart-toast.compact:has(button) { padding: 6px 6px 6px 16px; border-radius: 16px; flex-wrap: nowrap; }
.cart-toast.compact .cart-toast-text { flex: 0 1 auto; }
.cart-toast.compact:has(button) .cart-toast-text { flex: 1 1 0; min-width: 0; } /* a question: the words wrap, the buttons stay on one line */
.cart-btn { position: relative; }
.cart-plus {
  position: absolute; left: 50%; top: 50%; z-index: 3; margin: -11px 0 0 -16px; padding: 3px 8px; border-radius: 999px; pointer-events: none;
  background: var(--ok-fill); color: #fff; font: 800 13px/1.2 var(--mono); box-shadow: 0 2px 10px rgba(0, 0, 0, 0.4);
  animation: cart-plus 1.1s ease-out both;
}
@keyframes cart-plus { 0% { opacity: 0; transform: scale(0.5); } 20% { opacity: 1; transform: scale(1.2); } 40% { opacity: 1; transform: translateY(-2px) scale(1); } 100% { opacity: 0; transform: translateY(-16px) scale(1); } }
@media (prefers-reduced-motion: reduce) { .cart-plus { animation: none; } }
@media (max-width: 640px) {
  .cart-toast.compact { left: auto; right: 12px; top: 60px; }
}
/* a phone's panel is the whole screen: the hint sits under its header instead of over its close button */
@media (max-width: 767px) {
  body.chat-open .cart-toast { top: 76px; }
  body.cart-open .cart-toast { top: 104px; }
}

/* ---- the cart drawer ---- */
.cart-drawer {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 30; width: min(var(--cart-w), 100vw);
  display: flex; flex-direction: column; background: var(--bg); color: var(--ink);
  border-left: 1px solid var(--line); box-shadow: -14px 0 44px rgba(14, 23, 38, 0.22);
}
.cart-drawer[hidden] { display: none; }
@media (prefers-reduced-motion: no-preference) { .cart-drawer:not([hidden]) { animation: drawer-in 0.22s ease; } }
@keyframes drawer-in { from { transform: translateX(100%); } }
@media (prefers-color-scheme: dark) { :where(:root:not([data-theme="light"])) .cart-drawer { border-left-color: rgba(255, 255, 255, 0.08); box-shadow: -14px 0 44px rgba(0, 0, 0, 0.5); } }
:where(:root[data-theme="dark"]) .cart-drawer { border-left-color: rgba(255, 255, 255, 0.08); box-shadow: -14px 0 44px rgba(0, 0, 0, 0.5); }
.cart-drawer .cart-inner { flex: 1; min-height: 0; max-width: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.cart-drawer .cart-head {
  flex: none; gap: 4px; padding: 14px 14px 12px 20px; background: var(--board); color: var(--board-ink); border-bottom: 1px solid var(--board-line);
}
.cart-drawer .cart-title-row { flex-wrap: nowrap; align-items: center; gap: 10px; }
.cart-drawer .cart-title-row > div { min-width: 0; }
.cart-drawer .cart-title-row .kicker { color: var(--board-accent); }
.cart-drawer .cart-title { margin: 1px 0 0; font-size: 21px; line-height: 1.2; font-weight: 700; color: var(--board-ink); }
.cart-drawer .cart-back {
  flex: none; justify-self: auto; width: 34px; height: 34px; min-height: 0; margin: 0; padding: 0; border-radius: 50%;
  background: rgba(var(--glass), 0.08); color: var(--board-ink); font-size: 20px; line-height: 1;
}
.cart-drawer .cart-back:hover { background: rgba(var(--glass), 0.18); text-decoration: none; }
@media (pointer: coarse) { .cart-drawer .cart-back { width: 44px; height: 44px; padding: 5px; background-clip: content-box; } } /* 44px to touch, the circle stays 34px */
.cart-drawer .cart-sync { color: var(--board-muted); font-size: 13px; }
.cart-drawer .cart-sync.saved::before { color: var(--board-accent); }
.cart-drawer .cart-sync .cart-link { color: var(--board-accent); }
.cart-drawer .cart-sync .muted { color: var(--board-ink); }
.cart-drawer .cart-head button:focus-visible { outline-color: var(--board-accent); }
.cart-drawer .buddy-entry { color: var(--board-accent); }
.cart-drawer .buddy-entry-row .muted { color: var(--board-muted); font-size: 12.5px; }
.cart-scroll { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 0 16px 16px; }
.cart-drawer .cart-tools { margin-top: 12px; }
.cart-drawer .cart-items { margin-top: 10px; }
.cart-drawer .cart-item { padding: 12px 6px 12px 14px; }
.cart-drawer .cart-item.clash { box-shadow: inset 3px 0 0 var(--no-solid), var(--shadow); }
.cart-drawer .cart-item-head .clash-tag { margin-left: 2px; }
.cart-drawer .clashes { margin-top: 12px; }
.cart-drawer .cart-foot {
  position: static; flex: none; margin: 0; flex-direction: column; align-items: stretch; flex-wrap: nowrap; gap: 10px; border-radius: 0; border: none;
  border-top: 1px solid var(--line); box-shadow: 0 -8px 24px rgba(20, 24, 33, 0.08); padding: 14px 16px calc(14px + env(safe-area-inset-bottom, 0px));
}
.cart-drawer .primary.cart-generate { width: 100%; min-height: 52px; padding: 0 20px; font-size: 16.5px; }
.cart-drawer .cart-empty { padding: 48px 12px 56px; }
@media (max-width: 767px) {
  /* below the top bar (60px and its border), so the logo and the cart button stay there to press */
  .cart-drawer { width: 100%; top: 61px; }
  .cart-drawer .cart-head { padding-top: 14px; padding-left: 16px; }
  .cart-scroll { padding: 0 12px 12px; }
}

/* ---------- One-click timetable (schedule-ui.js) ---------- */
.tt-body { display: block; }
.tt-empty { margin: 18px 0 0; color: var(--muted); }
.tt-empty .tt-actions { margin-top: 14px; max-width: 320px; }
.tt-notes { list-style: none; margin: 0; padding: 0; }
/* the student's limit on days on campus: theirs to set, changed or removed right here */
.tt-campus { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin-top: 12px; padding: 8px 12px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); }
.tt-campus.set { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 8%, var(--surface)); }
.tt-campus-label { font-size: 13px; font-weight: 650; color: var(--ink); }
.tt-campus select { height: 34px; padding: 0 10px; font: inherit; font-size: 14px; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: 10px; }
.tt-campus-hint { flex: 1 1 100%; margin: 0; font-size: 12.5px; color: var(--muted); }
.tt-campus:not(.set) .tt-campus-hint { display: none; }
.tt-campus-none .tt-conflict p { font-weight: 500; }
.tt-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.tt-tab {
  display: grid; gap: 1px; text-align: left; cursor: pointer; padding: 8px 16px; border-radius: 14px;
  border: 1.5px solid var(--line); background: var(--surface); color: var(--ink);
}
.tt-tab b { font-size: 14.5px; }
.tt-tab span { font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.tt-tab:hover { background: var(--surface-2); }
.tt-tab.on { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.tt-tab.on span { color: inherit; opacity: 0.85; }
.tt-tags { margin: 14px 0 0; display: flex; gap: 6px; }
.tt-tag { font-size: 11.5px; font-weight: 700; padding: 2px 9px; border-radius: 999px; color: var(--ok); background: var(--ok-bg); white-space: nowrap; }
.tt-tag.mine { color: var(--ink); background: var(--track); }
/* the option's numbers as labelled tiles: what it is, the number, what it covers */
.tt-stats { margin: 14px 0 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; }
.tt-stats div { padding: 10px 14px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); }
.tt-stats dt { font-size: 12.5px; font-weight: 600; color: var(--muted); }
.tt-stats dd { margin: 2px 0 0; font-size: 19px; font-weight: 700; color: var(--ink); font-variant-numeric: tabular-nums; }
.tt-stats small { display: block; margin-top: 1px; font-size: 12.5px; font-weight: 500; color: var(--muted); }

.tt-conflicts { margin-top: 14px; padding: 12px 14px; border-radius: 14px; background: var(--no-bg); border: 1.5px solid var(--no-solid); }
.tt-conflicts h3 { margin: 0 0 4px; font-size: 15px; color: var(--no); }
.tt-conflicts h4 { margin: 14px 0 6px; font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.1em; color: var(--muted); font-weight: 700; }
.tt-conflicts p { margin: 0; font-size: 13.5px; }
.tt-conflict-list, .tt-fixes { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 6px; }
.tt-conflict { padding: 8px 10px; background: var(--surface); border-radius: 10px; }
.tt-conflict > p { color: var(--no); }
.tt-conflict .tt-fixes { margin-top: 6px; }
.tt-fix {
  display: block; width: 100%; padding: 9px 12px; text-align: left; font-size: 13.5px; cursor: pointer;
  color: var(--ink); background: var(--surface); border: 1.5px solid var(--ink); border-radius: 10px;
}
.tt-fix:hover { background: var(--surface-2); }

.tt-grid { --row: 32px; margin-top: 14px; padding: 0 8px 10px 0; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; }
.tt-line { display: flex; }
.tt-corner, .tt-ruler { flex: 0 0 52px; }
.tt-heads {
  position: sticky; top: 61px; z-index: 3; background: var(--surface); border-bottom: 1px solid var(--line); border-radius: 14px 14px 0 0;
}
.tt-dayhead { flex: 1 1 0; min-width: 0; padding: 9px 0; text-align: center; font-size: 14px; font-weight: 700; color: var(--ink); }
.tt-dayhead.off { color: var(--muted); font-weight: 500; }
.tt-main { padding-top: 10px; }
.tt-ruler { position: relative; height: calc(var(--rows) * var(--row)); }
.tt-ruler span { position: absolute; right: 8px; transform: translateY(-50%); font-family: var(--mono); font-size: 12px; color: var(--muted); white-space: nowrap; }
.tt-col {
  position: relative; flex: 1 1 0; min-width: 0; height: calc(var(--rows) * var(--row)); border-left: 1px solid var(--line);
  background-image:
    repeating-linear-gradient(to bottom, var(--line) 0 1px, transparent 1px calc(var(--row) * 2)),
    repeating-linear-gradient(to bottom, color-mix(in srgb, var(--line) 45%, transparent) 0 1px, transparent 1px var(--row));
}
.tt-block {
  position: absolute; z-index: 1; display: flex; flex-direction: column; overflow: hidden; container-type: size; text-align: left;
  padding: 5px 6px 4px 8px; font: inherit; color: var(--ink); cursor: pointer;
  background: hsl(var(--h) 70% 91%); border: 0; border-left: 4px solid hsl(var(--h) 60% 42%); border-radius: 6px;
}
.tt-block:hover { filter: brightness(0.97); }
.tt-block.on { z-index: 3; outline: 2px solid var(--focus); outline-offset: 1px; }
/* a block: the English title first (two lines at most), then code and kind, then the time */
.tt-name {
  font-size: 13.5px; font-weight: 700; line-height: 1.25; overflow: hidden; overflow-wrap: break-word; hyphens: auto;
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2;
}
.tt-code, .tt-time { font-size: 12px; line-height: 1.3; overflow-wrap: anywhere; }
.tt-code { opacity: 0.8; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tt-time { font-weight: 600; font-variant-numeric: tabular-nums; }
@container (max-height: 60px) { .tt-code { display: none; } }
@container (max-height: 40px) { .tt-time { display: none; } .tt-name { -webkit-line-clamp: 1; } }
@container (max-width: 90px) { .tt-name { font-size: 12px; -webkit-line-clamp: 3; } .tt-code { display: none; } .tt-time { font-size: 11.5px; } }
.tt-text { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
@container (max-width: 44px) { .tt-text { writing-mode: vertical-rl; } .tt-code, .tt-time { display: none; } .tt-name { font-size: 11.5px; -webkit-line-clamp: 1; } } /* two classes side by side on a phone: the title reads sideways */
.tt-block.clash {
  border-left-color: var(--no-solid); box-shadow: inset 0 0 0 1.5px var(--no-solid);
  background-color: color-mix(in srgb, var(--no-solid) 16%, hsl(var(--h) 70% 91%));
}
.tt-overlap {
  position: absolute; left: 0; right: 0; z-index: 2; pointer-events: none; box-shadow: inset 0 0 0 1.5px var(--no-solid);
  background: repeating-linear-gradient(135deg, color-mix(in srgb, var(--no-solid) 40%, transparent) 0 2px, transparent 2px 7px), color-mix(in srgb, var(--no-solid) 8%, transparent);
}

.tt-detail {
  position: sticky; bottom: 8px; z-index: 4; margin-top: 12px; padding: 12px 14px; background: var(--surface);
  border: 1.5px solid hsl(var(--h, 215) 55% 45%); border-radius: 14px; box-shadow: var(--shadow);
}
.tt-detail-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.tt-detail-name { font-size: 16px; font-weight: 700; line-height: 1.3; }
.tt-detail-sub { margin: 2px 0 8px; font-size: 13.5px; color: var(--muted); }
.tt-detail dl { display: grid; grid-template-columns: auto 1fr; gap: 2px 14px; margin: 0; font-size: 13.5px; }
.tt-detail dt { color: var(--muted); }
.tt-detail dd { margin: 0; }
.tt-detail-clashes { margin: 8px 0 0; padding-left: 18px; color: var(--no); font-size: 13.5px; }
/* every course of the week: name, kind and Albert's numbers, when, credits */
.tt-key-box h3, .tt-agenda h3 { margin: 20px 0 8px; font-family: var(--display); font-size: 16px; }
.tt-key { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 10px; }
.tt-key > li { display: flex; gap: 10px; padding: 12px 14px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); }
.tt-key i { flex: none; width: 5px; border-radius: 3px; background: hsl(var(--h) 60% 45%); }
.tt-key p { margin: 0; }
.tt-key-name { font-size: 15px; font-weight: 700; line-height: 1.3; }
.tt-key-sub { margin-top: 2px !important; font-size: 13px; color: var(--muted); }
.tt-when { margin-top: 4px !important; font-size: 13.5px; font-weight: 600; color: var(--ink); }
.tt-key-why { margin-top: 4px !important; font-size: 12.5px; color: var(--ok); }
.tt-key .tt-tag { margin-left: 8px; vertical-align: 1px; cursor: help; }
/* the week day by day: shown on a phone, where the grid's columns are narrow */
.tt-agenda { display: none; }
.tt-agenda > ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.tt-agenda h4 { margin: 0 0 6px; font-size: 14px; }
.tt-agenda ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.tt-agenda ol li { display: grid; gap: 1px; padding: 9px 12px; border-radius: 10px; background: hsl(var(--h) 70% 95%); border-left: 4px solid hsl(var(--h) 60% 42%); }
.tt-agenda ol li.clash { border-left-color: var(--no-solid); background: var(--no-bg); }
.tt-ag-time { font-size: 13px; font-weight: 700; font-variant-numeric: tabular-nums; }
.tt-ag-name { font-size: 15px; font-weight: 700; line-height: 1.3; }
.tt-ag-sub { font-size: 12.5px; color: var(--muted); }
.tt-actions { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 8px; margin-top: 18px; }
.tt-saved { margin: 8px 0 0; }
/* A switch of section (schedule-swaps.js, swap-view.js): this class -> that class, what changes in it, and the locks that keep a section as it is */
.lock-btns { display: inline-flex; flex-wrap: wrap; gap: 6px; }
.lock-btn { display: inline-flex; align-items: center; gap: 5px; min-height: 28px; padding: 3px 10px; font: inherit; font-size: 12.5px; font-weight: 600; color: var(--muted); background: var(--surface); border: 1px solid var(--line); border-radius: 999px; cursor: pointer; }
.lock-btn:hover { color: var(--ink); background: var(--surface-2); }
@media (pointer: coarse) { .lock-btn { min-height: 44px; padding: 3px 14px; } } /* 44px to touch on a phone */
.lock-btn.on { color: var(--ink); background: var(--track); border-color: var(--ink); }
.lock-btn[aria-disabled="true"] { cursor: default; opacity: 0.75; }
.lock-btn svg { flex: none; }
.cart-sec .lock-btns { margin-top: 2px; }
.tt-swaps { margin-top: 14px; padding: 12px 14px 14px; border-radius: 14px; background: var(--check-bg); border: 1.5px solid var(--check-solid); }
.tt-swaps h3 { margin: 0 0 2px; font-size: 15px; color: var(--check); }
.tt-swaps-intro { margin: 0; font-size: 13.5px; color: var(--ink); }
.tt-swap-list { list-style: none; margin: 10px 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 10px; }
.tt-swap { padding: 10px 12px; border-radius: 10px; background: var(--surface); border: 1px solid var(--line); display: grid; gap: 6px; align-content: start; }
.tt-swap p { margin: 0; }
.tt-swap-course { font-size: 14.5px; font-weight: 700; line-height: 1.3; }
.tt-swap-move { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px; font-size: 15px; font-weight: 700; font-variant-numeric: tabular-nums; }
.tt-from { color: var(--muted); text-decoration: line-through; text-decoration-thickness: 1px; }
.tt-to { color: var(--ink); }
.tt-swap-lines { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; font-size: 13.5px; }
.tt-swap-lines li { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 8px; }
.tt-swap-lines li.same { color: var(--muted); }
.tt-swap-lines li.chg { color: var(--ink); font-weight: 600; }
.tt-chg { font-size: 11px; font-weight: 700; padding: 1px 8px; border-radius: 999px; color: var(--check); background: var(--check-bg); border: 1px solid var(--check-solid); white-space: nowrap; }
.tt-swap-warn { display: flex; gap: 6px; padding: 7px 10px; border-radius: 8px; font-size: 13px; color: var(--no); background: var(--no-bg); }
.tt-swap-warn span:first-child { flex: none; }
.tt-swap-keep { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; padding-top: 6px; border-top: 1px dashed var(--line); font-size: 12.5px; color: var(--muted); }
.tt-swaps-more { margin: 8px 0 0; font-size: 13px; }
.tt-applied { margin-top: 14px; padding: 10px 14px; border-radius: 12px; background: var(--ok-bg); border: 1px solid var(--ok-solid); color: var(--ok); }
.tt-applied h3 { margin: 0 0 4px; font-size: 14px; }
.tt-applied ul { margin: 0; padding-left: 18px; font-size: 13.5px; }
.tt-locked-note { display: flex; align-items: center; gap: 6px; margin: 6px 0 0 !important; font-weight: 600; color: var(--ink); }
.tt-fix-changes { list-style: none; margin: 2px 0 0; padding: 0 0 0 12px; display: grid; gap: 1px; font-size: 12.5px; color: var(--muted); }
.tt-fix-changes .warn { color: var(--no); }
.tt-key-locks { margin-top: 6px; }
@media (prefers-color-scheme: dark) {
  :where(:root:not([data-theme="light"])) .tt-block { background: hsl(var(--h) 35% 24%); border-left-color: hsl(var(--h) 55% 62%); }
  :where(:root:not([data-theme="light"])) .tt-block.clash { border-left-color: var(--no-solid); background-color: color-mix(in srgb, var(--no-solid) 24%, hsl(var(--h) 35% 24%)); }
  :where(:root:not([data-theme="light"])) .tt-key i { background: hsl(var(--h) 55% 60%); }
  :where(:root:not([data-theme="light"])) .tt-agenda ol li { background: hsl(var(--h) 30% 20%); border-left-color: hsl(var(--h) 55% 62%); }
  :where(:root:not([data-theme="light"])) .tt-grid, :where(:root:not([data-theme="light"])) .tt-conflict { border-color: rgba(255, 255, 255, 0.1); }
}
:where(:root[data-theme="dark"]) .tt-block { background: hsl(var(--h) 35% 24%); border-left-color: hsl(var(--h) 55% 62%); }
  :where(:root[data-theme="dark"]) .tt-block.clash { border-left-color: var(--no-solid); background-color: color-mix(in srgb, var(--no-solid) 24%, hsl(var(--h) 35% 24%)); }
  :where(:root[data-theme="dark"]) .tt-key i { background: hsl(var(--h) 55% 60%); }
  :where(:root[data-theme="dark"]) .tt-agenda ol li { background: hsl(var(--h) 30% 20%); border-left-color: hsl(var(--h) 55% 62%); }
  :where(:root[data-theme="dark"]) .tt-grid, :where(:root[data-theme="dark"]) .tt-conflict { border-color: rgba(255, 255, 255, 0.1); }
@media (max-width: 640px) {
  .tt-dayhead.off, .tt-col.off { display: none; } /* a phone shows only the days with classes: the tiles above name them */
  .tt-grid { --row: 32px; padding-right: 4px; }
  .tt-block { padding: 3px 3px 3px 5px; border-left-width: 3px; }
  .tt-corner, .tt-ruler { flex-basis: 42px; }
  .tt-ruler span { right: 5px; font-size: 11.5px; }
  .tt-dayhead { font-size: 13px; }
  .tt-name { font-size: 12px; }
  .tt-time { font-size: 11.5px; }
  .tt-key { grid-template-columns: minmax(0, 1fr); }
  .tt-agenda { display: block; }
  .tt-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
  .tt-stats div { padding: 8px 10px; }
  .tt-stats dt { font-size: 11.5px; }
  .tt-stats dd { font-size: 15.5px; }
  .tt-stats small { font-size: 11.5px; }
}
/* ---------- The older Grading facts (gpa-ui.js): the basis line, the three conditions ---------- */
.gpa-marks .gpa-line, .gpa-notes .gpa-line { cursor: default; }
.gpa-facts-line { display: flex; flex-wrap: wrap; align-items: baseline; font-size: 12.5px; color: var(--muted); }
.gpa-sep { white-space: pre; }
.gpa-via { margin-inline-start: 0.3em; }
.gpa-source { color: var(--accent); font-weight: 600; text-underline-offset: 2px; }
a.gpa-source:hover { text-decoration: underline; }
.gpa-unofficial { font-style: italic; }
.gpa-tag {
  font-size: 11.5px; font-weight: 700; letter-spacing: 0.01em; white-space: nowrap; border-radius: 999px; padding: 2px 9px;
  color: var(--muted); background: color-mix(in srgb, var(--muted) 14%, transparent);
}
.gpa-tag.ok { color: var(--ok); background: var(--ok-bg); }
.gpa-tag.pending { color: var(--check); background: var(--check-bg); }
.gpa-tag.out { color: var(--no); background: var(--no-bg); }
.gpa-neutral { font-size: 12.5px; color: var(--muted); cursor: help; }
.gpa-status { margin: 0 0 6px; display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: baseline; }
.gpa-facts { margin: 0 0 6px; padding: 8px 12px; display: grid; gap: 6px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; }
.gpa-facts div { display: grid; grid-template-columns: 6.5em minmax(0, 1fr); gap: 2px 10px; align-items: baseline; }
.gpa-facts dt { font-size: 12px; color: var(--muted); }
.gpa-facts dd { margin: 0; font-size: 13.5px; display: flex; flex-wrap: wrap; align-items: baseline; }
.gpa-notes { margin: 0 0 6px; display: grid; gap: 2px; }
.gpa-tag.ref { color: var(--muted); }
.gpa-syl { margin: 8px 0 6px; }
.gpa-syl h4 { margin-bottom: 4px; }
.gpa-syl-line { margin: 0 0 4px; font-size: 13.5px; line-height: 1.5; }
.gpa-refs { margin: 0; padding: 0; list-style: none; display: grid; gap: 4px; }
.gpa-ref { font-size: 13px; line-height: 1.5; }
.gpa-ref .gpa-line { cursor: default; }
.chat-syllabus-quotes { margin: 6px 0 8px; padding: 6px 10px; border-left: 3px solid var(--line); font-size: 12px; color: var(--muted); display: grid; gap: 3px; }
.chat-syllabus-quotes q { quotes: none; }
.chat-syllabus-why { margin: 0 0 8px; color: var(--check); font-size: 12.5px; }
@media (max-width: 560px) {
  .gpa-facts div { grid-template-columns: minmax(0, 1fr); }
}
/* ---------- Files added in the chat: the paperclip menu, a card for each file over the text box, thumbnails in a message (public/chat.js) ---------- */
.chat-composer { position: relative; }
.chat-add svg { display: block; }
.chat-add-menu {
  position: absolute; left: 14px; bottom: calc(100% + 2px); z-index: 4; min-width: 200px; overflow: hidden;
  background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 10px 32px rgba(14, 23, 38, 0.24);
}
.chat-add-menu button {
  display: block; width: 100%; min-height: 48px; padding: 0 18px; text-align: left; font: inherit; font-size: 15px; font-weight: 550;
  color: var(--ink); background: transparent; border: 0; cursor: pointer;
}
.chat-add-menu button + button { border-top: 1px solid var(--line); }
.chat-add-menu button:hover, .chat-add-menu button:focus-visible { background: color-mix(in srgb, var(--accent) 10%, var(--surface)); }

.chat-attached { display: grid; gap: 5px; }
.chat-file-row { display: flex; gap: 8px; overflow-x: auto; padding: 1px 0 4px; overscroll-behavior-x: contain; scroll-snap-type: x proximity; }
.chat-file-card {
  flex: 0 0 min(230px, 84%); display: flex; align-items: center; gap: 9px; min-width: 0; padding: 6px 4px 6px 6px; scroll-snap-align: start;
  background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow);
}
.chat-file-card.error { background: var(--no-bg); border-color: color-mix(in srgb, var(--no) 45%, var(--line)); }
.chat-file-card .file-thumb {
  flex: none; display: grid; place-items: center; width: 44px; height: 44px; overflow: hidden; border-radius: 9px;
  font-family: var(--mono); font-size: 10.5px; font-weight: 700; letter-spacing: 0.04em; color: var(--accent);
  background: var(--surface-2); border: 1px solid var(--line);
}
.chat-file-card .file-thumb img { display: block; width: 100%; height: 100%; object-fit: cover; }
.chat-file-card .file-body { flex: 1; min-width: 0; display: grid; gap: 2px; }
.chat-file-card .file-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; font-weight: 650; }
.chat-file-card .file-sub { display: flex; flex-wrap: wrap; gap: 0 6px; font-size: 11.5px; line-height: 1.3; color: var(--muted); }
.chat-file-card .file-sub.problem { color: var(--no); font-weight: 550; }
.chat-file-card .file-ready { color: var(--ok); font-weight: 700; }
.file-progress { width: 100%; height: 4px; margin-top: 1px; appearance: none; border: 0; border-radius: 2px; overflow: hidden; background: var(--track); }
.file-progress::-webkit-progress-bar { background: var(--track); }
.file-progress::-webkit-progress-value { background: var(--accent); transition: width 0.15s linear; }
.file-progress::-moz-progress-bar { background: var(--accent); }
.chat-file-card .file-remove, .chat-file-card .file-retry { flex: none; cursor: pointer; font: inherit; }
.chat-file-card .file-remove { display: grid; place-items: center; width: 32px; height: 32px; padding: 0; font-size: 18px; line-height: 1; color: var(--muted); background: transparent; border: 0; border-radius: 50%; }
.chat-file-card .file-remove:hover { color: var(--ink); background: color-mix(in srgb, var(--ink) 10%, transparent); }
.chat-file-card .file-retry { min-height: 32px; padding: 0 11px; font-size: 12.5px; font-weight: 650; color: var(--no); background: transparent; border: 1.5px solid currentColor; border-radius: 999px; }
.chat-attach-note { margin: 0; font-size: 11.5px; line-height: 1.35; color: var(--muted); }

.chat-files { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; }
.chat-msg.assistant .chat-files { justify-content: flex-start; }
.chat-file-thumb { display: block; width: 72px; height: 72px; object-fit: cover; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line); }

@media (pointer: coarse), (max-width: 640px) {
  .chat-add { width: 44px; height: 44px; margin-bottom: 0; }
  .chat-file-card .file-remove { width: 44px; height: 44px; }
  .chat-file-card .file-retry { min-height: 44px; padding: 0 14px; }
  .chat-add-menu button { min-height: 52px; }
}
@media (prefers-color-scheme: dark) {
  :where(:root:not([data-theme="light"])) .chat-add-menu, :where(:root:not([data-theme="light"])) .chat-file-card, :where(:root:not([data-theme="light"])) .chat-file-thumb { border-color: rgba(255, 255, 255, 0.1); }
  :where(:root:not([data-theme="light"])) .chat-file-card.error { border-color: color-mix(in srgb, var(--no) 55%, transparent); }
}
:where(:root[data-theme="dark"]) .chat-add-menu, :where(:root[data-theme="dark"]) .chat-file-card, :where(:root[data-theme="dark"]) .chat-file-thumb { border-color: rgba(255, 255, 255, 0.1); }
  :where(:root[data-theme="dark"]) .chat-file-card.error { border-color: color-mix(in srgb, var(--no) 55%, transparent); }

/* ---------- The cart in the chat: "Add to cart" on a section card, and the line that points to the cart (public/chat.js) ---------- */
.chat-section-meta .chat-cart {
  margin-left: auto; min-height: 36px; padding: 0 12px; font: inherit; font-size: 12.5px; font-weight: 700; white-space: nowrap; cursor: pointer;
  color: var(--on-amber); background: var(--amber); border: 0; border-radius: 999px;
}
.chat-section-meta .chat-cart:hover:not(:disabled) { filter: brightness(1.06); }
.chat-section-meta .chat-cart.on { color: var(--ok); background: var(--ok-bg); cursor: default; }
.chat-cart-open {
  align-self: flex-start; min-height: 40px; padding: 0 16px; font: inherit; font-size: 13.5px; font-weight: 700; cursor: pointer;
  color: var(--on-amber); background: var(--amber); border: 0; border-radius: 999px;
}
.chat-cart-open:hover { filter: brightness(1.06); }
@media (pointer: coarse), (max-width: 640px) {
  .chat-section-meta .chat-cart, .chat-cart-open { min-height: 44px; }
}

/* ---------- 水课／保 GPA: the reviewed list as a page of its own, like the cart (#picks, public/gpa-picks-ui.js) ---------- */
.picks-toggle { white-space: normal; text-align: left; line-height: 1.25; }
.picks-view[hidden] { display: none; }
body.picks-open .board, body.picks-open .banner, body.picks-open .shared-bar, body.picks-open .layout, body.picks-open .footer { display: none; }
/* ---------- Plan my next term (plan-ui.js): major, year, what is done, what to take ---------- */
body.plan-open .board, body.plan-open .banner, body.plan-open .shared-bar, body.plan-open .layout, body.plan-open .footer { display: none; }
@media (max-width: 900px) { body.plan-open .chat-launcher { bottom: calc(env(safe-area-inset-bottom, 0px) + 16px); } }
.plan-steps { list-style: none; margin: 14px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 13.5px; color: var(--muted); }
.plan-steps li { display: inline-flex; align-items: center; gap: 7px; font-weight: 600; }
.plan-steps span { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; font-size: 12px; background: var(--track); color: var(--muted); }
@media (max-width: 640px) { .plan-steps { gap: 6px 10px; font-size: 12.5px; } .plan-steps li { gap: 5px; } .plan-steps span { width: 20px; height: 20px; } }
.plan-steps li.on { color: var(--ink); }
.plan-steps li.on span { background: var(--ink); color: var(--bg); }
.plan-steps li.done span { background: var(--ok-fill); color: #fff; }
.plan-chosen { margin: 12px 0 0; font-size: 14px; }
.plan-step { margin-top: 18px; }
.plan-q { margin: 0 0 4px; font-family: var(--display); font-size: 22px; }
.plan-step > .muted { margin: 0 0 12px; font-size: 14px; }
.plan-status { margin-top: 18px; }
.plan-search { max-width: none; margin: 4px 0 14px; }
.plan-school h3 { margin: 18px 0 8px; font-size: 14.5px; }
.plan-school .n { font-weight: 500; color: var(--muted); font-size: 12.5px; margin-left: 6px; }
.plan-majors { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 8px; }
.plan-majors > li { display: grid; } /* the two cards of a row stand equally tall */
.plan-major, .plan-choice {
  display: grid; gap: 2px; width: 100%; min-height: 48px; padding: 10px 14px; text-align: left; cursor: pointer; font: inherit; font-size: 14.5px;
  color: var(--ink); background: var(--surface); border: 1.5px solid var(--line); border-radius: 12px;
}
.plan-major:hover, .plan-choice:hover { border-color: color-mix(in srgb, var(--ink) 40%, var(--line)); }
.plan-major.on, .plan-choice.on { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.plan-choices { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin: 8px 0 12px; }
.plan-choices.tracks { grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); }
.plan-choice b { font-size: 16px; }
.plan-choice span { font-size: 13px; color: var(--muted); }
.plan-choice.muted-choice { border-style: dashed; color: var(--muted); }
.plan-record { width: auto; padding: 9px 16px; font-size: 13.5px; }
.plan-columns { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-top: 14px; align-items: start; }
.plan-col { padding: 12px; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--line); }
.plan-col h4 { margin: 0 0 8px; font-size: 14.5px; }
.plan-col .n, .plan-checks .n { font-weight: 600; color: var(--muted); margin-left: 4px; }
.plan-col.needed { border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); background: var(--surface); }
/* a guess from the student's year: its own colour, apart from what they gave, until they answer it */
.plan-col.inferred { border-color: color-mix(in srgb, var(--check-solid) 55%, var(--line)); background: var(--check-bg); }
.plan-item.inferred { flex-direction: column; align-items: stretch; border-style: dashed; border-color: color-mix(in srgb, var(--check-solid) 60%, var(--line)); }
.plan-confirm { display: flex; gap: 8px; }
.plan-confirm button { flex: 1; min-height: 36px; padding: 6px 10px; border-radius: 10px; font: inherit; font-size: 13px; font-weight: 650; cursor: pointer; }
.plan-yes { border: 1.5px solid var(--ok-fill); background: var(--ok-fill); color: #fff; } /* white on the dot green was 3.4:1 */
.plan-no { border: 1.5px solid var(--line); background: var(--surface); color: var(--ink); }
.plan-yes:hover { filter: brightness(1.06); }
.plan-no:hover { border-color: color-mix(in srgb, var(--ink) 40%, var(--line)); }
.plan-by { font-weight: 650; color: var(--ok); }
.plan-banner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 14px; margin: 4px 0 6px; padding: 10px 14px; border-radius: 12px; background: var(--check-bg); border: 1px solid color-mix(in srgb, var(--check-solid) 55%, var(--line)); }
.plan-banner p { margin: 0; flex: 1 1 260px; font-size: 13.5px; font-weight: 600; line-height: 1.4; color: var(--check); }
.plan-banner .secondary { width: auto; padding: 8px 16px; font-size: 13.5px; }
.plan-items { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.plan-item { display: flex; gap: 10px; justify-content: space-between; align-items: flex-start; padding: 10px 12px; border-radius: 10px; background: var(--surface); border: 1px solid var(--line); }
.plan-item-main { min-width: 0; }
.plan-item p { margin: 0; }
.plan-item-head { font-size: 14px; font-weight: 650; line-height: 1.35; }
.plan-options { margin-top: 3px !important; font-size: 13px; line-height: 1.4; }
.plan-item-meta { margin-top: 3px !important; display: flex; flex-wrap: wrap; gap: 2px 10px; font-size: 12px; color: var(--muted); }
.plan-term { font-size: 12px; font-weight: 600; color: var(--accent); white-space: nowrap; }
.plan-need { font-size: 12.5px; font-weight: 600; color: var(--muted); margin-left: 4px; }
.plan-tick { flex: none; display: inline-flex; align-items: center; gap: 5px; font-size: 12.5px; color: var(--muted); cursor: pointer; white-space: nowrap; }
.plan-tick input { width: 17px; height: 17px; accent-color: var(--ok-solid); }
.plan-none { margin: 0; font-size: 13px; }
.plan-checks { margin-top: 14px; padding: 0 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.plan-checks > summary { min-height: 44px; display: flex; align-items: center; cursor: pointer; font-weight: 650; font-size: 14px; }
.plan-checks .plan-items { padding-bottom: 12px; }
.plan-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 18px; }
.plan-actions .primary, .plan-actions .secondary { width: auto; min-height: 46px; padding: 0 22px; }
.plan-goal { margin: 6px 0 4px; padding: 12px 14px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); }
.plan-goal p { margin: 8px 0 0; font-size: 14px; }
.plan-goal-bar { height: 8px; border-radius: 999px; background: var(--track); overflow: hidden; }
.plan-goal-bar span { display: block; height: 100%; background: var(--ok-solid); border-radius: inherit; }
.plan-group h4 { margin: 22px 0 8px; font-family: var(--display); font-size: 16px; }
.plan-group.now h4 { color: var(--accent); }
.plan-reqs { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.plan-req { padding: 12px 14px; border-radius: 14px; background: var(--surface); box-shadow: var(--shadow); }
.plan-req > p { margin: 0; }
.plan-req-head { font-size: 15px; font-weight: 700; line-height: 1.35; }
.plan-covered { margin-top: 6px !important; font-size: 13px; color: var(--ok); font-weight: 600; }
.plan-picks { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 6px; }
.plan-pick { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 9px 10px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--line); }
.plan-pick p { margin: 0; }
.plan-pick-name { font-size: 14.5px; font-weight: 650; line-height: 1.3; }
.plan-pick-meta { margin-top: 3px !important; display: flex; flex-wrap: wrap; gap: 2px 10px; font-size: 12.5px; color: var(--muted); }
.plan-verdict { font-weight: 700; }
.plan-verdict.takeable { color: var(--ok); }
.plan-verdict.check { color: var(--check); }
.plan-verdict.no { color: var(--no); }
.plan-more { margin: 6px 0 0 !important; font-size: 12.5px; }
.plan-blocked > summary { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; cursor: pointer; list-style: none; font-size: 14px; color: var(--muted); }
.plan-blocked > summary::-webkit-details-marker { display: none; }
.plan-blocked > summary::after { content: "▾"; transition: transform 0.15s; }
.plan-blocked:not([open]) > summary::after { transform: rotate(-90deg); }
.plan-blocked > .plan-reqs { margin-top: 6px; }
.plan-years { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 8px 0; font-size: 13px; color: var(--muted); }
.plan-year { border: 1px solid var(--line); background: var(--surface); color: var(--ink); font: inherit; font-size: 12.5px; font-weight: 650; padding: 4px 10px; border-radius: 999px; cursor: pointer; }
.plan-year.on { border-color: var(--accent); color: var(--accent); }
.plan-status-line { margin: 6px 0; font-size: 13px; font-weight: 600; }
.plan-status-line.verified { color: var(--ok); }
.plan-status-line.partial { color: var(--muted); }
.plan-status-line.conflict { color: var(--no); }
.plan-majors.ranked { grid-template-columns: 1fr; }
@media (pointer: coarse) { .plan-year { min-height: 44px; } }
.plan-source { margin: 26px 0 0; padding-top: 12px; border-top: 1px solid var(--line); font-size: 13px; }
.plan-source p { margin: 0 0 4px; }
.plan-source a { color: var(--accent); font-weight: 600; }
@media (max-width: 760px) {
  .plan-columns { grid-template-columns: minmax(0, 1fr); }
  .plan-pick { flex-direction: column; align-items: stretch; }
  .plan-q { font-size: 19px; }
}
.picks-inner { max-width: 1040px; padding-bottom: 96px; }
.picks-head { margin-bottom: 4px; }
.picks-lead { display: grid; gap: 6px; margin-top: 10px; padding: 14px 16px; border-radius: 14px; background: var(--surface); box-shadow: var(--shadow); font-size: 14px; }
.picks-lead p, .picks-head .picks-meaning { margin: 0; }
.picks-policy b { display: block; font-weight: 700; margin-bottom: 2px; }
.picks-meaning { color: var(--muted); font-size: 13.5px; }
.picks-meta { color: var(--muted); font-size: 13px; display: flex; flex-wrap: wrap; gap: 2px 8px; }
@media (max-width: 640px) { .picks-meta { flex-direction: column; } .picks-meta [aria-hidden="true"] { display: none; } }
.picks-counts { font-size: 13.5px; font-weight: 600; }
.picks-head .picks-meaning { margin-top: 6px; }
.picks-status { margin-top: 18px; }
.picks-filters { display: grid; gap: 10px; margin-top: 16px; }
.picks-search { max-width: none; flex: none; }
.picks-more { border: 1px solid var(--line); border-radius: 14px; background: var(--surface); padding: 0 14px; }
.picks-more > summary { min-height: 44px; display: flex; align-items: center; cursor: pointer; font-weight: 650; font-size: 14px; list-style: none; }
.picks-more > summary::-webkit-details-marker { display: none; }
.picks-more > summary::after { content: "▾"; margin-inline-start: auto; color: var(--muted); }
.picks-more[open] > summary::after { content: "▴"; }
.picks-more > summary:focus-visible, .picks-open:focus-visible, .pick-chip:focus-visible, .pick-see:focus-visible, .picks-view .link-btn:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.picks-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px 16px; padding: 4px 0 14px; }
.picks-field { display: grid; gap: 5px; font-size: 13px; font-weight: 650; color: var(--muted); align-content: start; }
.picks-field select, .picks-field input[type="search"] {
  width: 100%; min-height: 44px; padding: 0 10px; font: inherit; font-size: 15px; font-weight: 500; color: var(--ink);
  background: var(--surface); border: 1px solid var(--line); border-radius: 12px;
}
.picks-field input:focus-visible, .picks-field select:focus-visible, .picks-search input:focus-visible, .picks-exam input:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.picks-pair { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; gap: 6px; }
.picks-exam { grid-column: span 2; }
.picks-exam input[type="range"] { width: 100%; min-height: 44px; accent-color: var(--accent); }
.picks-exam small { font-weight: 400; font-size: 12px; }
.picks-clear { justify-self: start; min-height: 36px; }
.picks-shown { margin: 0; font-size: 13.5px; color: var(--muted); }
/* a heading or the count on the left, the copy button on the right */
.picks-tools { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px 12px; margin: 14px 2px 0; }
.picks-secs .picks-tools { margin: 20px 2px 10px; }
.picks-secs .picks-tools h3 { margin: 0; }
/* copying: a quiet icon beside a code or a class number, a small pill beside a heading, a tick once it is on the clipboard */
.copy-btn {
  display: inline-grid; place-items: center; width: 26px; height: 26px; margin: -6px 0 -6px 3px; padding: 0; vertical-align: middle;
  border: none; border-radius: 8px; background: transparent; color: var(--muted); cursor: pointer; transition: color 0.15s, background-color 0.15s;
}
@media (hover: hover) { .copy-btn:hover { color: var(--ink); background: color-mix(in srgb, var(--muted) 14%, transparent); } }
.copy-text-btn {
  display: inline-flex; align-items: center; gap: 6px; min-height: 32px; padding: 0 13px; white-space: nowrap; cursor: pointer;
  font: inherit; font-size: 13px; font-weight: 650; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: 999px;
  transition: color 0.15s, background-color 0.15s, border-color 0.15s;
}
@media (hover: hover) { .copy-text-btn:hover { background: var(--surface-2); border-color: color-mix(in srgb, var(--muted) 45%, var(--line)); } }
.copy-text-btn[hidden] { display: none; }
.copy-btn .ic, .copy-text-btn .ic { display: block; flex: none; }
.copy-btn .ic-done, .copy-text-btn .ic-done, .copy-text-btn .when-done { display: none; }
.copy-btn.copied, .copy-text-btn.copied { color: var(--ok); }
.copy-text-btn.copied { border-color: color-mix(in srgb, var(--ok) 40%, var(--line)); background: var(--ok-bg); }
.copy-btn.copied .ic-copy, .copy-text-btn.copied .ic-copy, .copy-text-btn.copied .when-idle { display: none; }
.copy-btn.copied .ic-done, .copy-text-btn.copied .ic-done { display: block; }
.copy-text-btn.copied .when-done { display: inline; }
.pick-code-wrap { display: inline-flex; align-items: center; }
.cart-title-row .kicker .copy-btn { margin-block: -8px; }
@media (pointer: coarse) {
  .copy-btn { width: 36px; height: 36px; margin: -11px -5px -11px 0; }
  .copy-text-btn { min-height: 40px; }
}
/* says what was copied, low in the middle of the screen, then fades */
.picks-toast {
  position: fixed; z-index: 45; left: 50%; bottom: calc(env(safe-area-inset-bottom, 0px) + 28px); max-width: min(420px, calc(100vw - 32px));
  padding: 9px 18px; border-radius: 999px; background: var(--board); color: var(--board-ink); border: 1px solid var(--board-line);
  box-shadow: 0 12px 40px rgba(14, 23, 38, 0.32); font-size: 13.5px; font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  opacity: 0; pointer-events: none; transform: translate(-50%, 8px); transition: opacity 0.18s, transform 0.18s;
}
.picks-toast:empty { display: none; }
.picks-toast.show { opacity: 1; transform: translate(-50%, 0); }
@media (max-width: 900px) { .picks-toast { bottom: calc(env(safe-area-inset-bottom, 0px) + 88px); } } /* above the chat button */
@media (prefers-reduced-motion: reduce) { .copy-btn, .copy-text-btn, .picks-toast { transition: none; } }
.picks-group { margin-top: 20px; }
.picks-cards { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 440px), 1fr)); gap: 12px; align-items: start; }
.pick-card { display: grid; gap: 8px; padding: 14px 16px; border-radius: 14px; background: var(--surface); box-shadow: var(--shadow); border: 1px solid transparent; cursor: pointer; }
.pick-card:hover { border-color: var(--line); }
.pick-card-top { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.pick-card-title { margin: 0; font-size: 17px; line-height: 1.3; font-weight: 650; min-width: 0; }
.pick-open { padding: 0; border: none; background: transparent; text-align: left; font: inherit; font-weight: 650; color: var(--ink); cursor: pointer; }
.pick-open:hover { text-decoration: underline; }
.pick-topic, .pick-topic-h { font-size: 13.5px; font-weight: 500; color: var(--muted); margin-inline-start: 0.4em; }
.pick-credits { margin: 0; font-size: 13px; white-space: nowrap; }
.pick-card-meta { display: flex; flex-wrap: wrap; gap: 2px 12px; font-size: 12.5px; color: var(--muted); }
.pick-code { font-weight: 600; color: var(--ink); }
.pick-profs { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.pick-prof { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; padding-top: 6px; border-top: 1px dashed var(--line); font-size: 13.5px; }
.pick-prof-name { font-weight: 650; }
.pick-exam b { font-family: var(--mono); font-weight: 700; margin-inline-start: 0.15em; }
.pick-term { font-family: var(--mono); font-size: 12.5px; color: var(--muted); }
.pick-more { font-size: 12.5px; color: var(--muted); }
.pick-see { justify-self: start; width: auto; min-height: 40px; padding: 0 16px; font-size: 13.5px; }
.pick-tag {
  font-size: 11.5px; font-weight: 700; letter-spacing: 0.01em; white-space: nowrap; border-radius: 999px; padding: 2px 9px;
  color: var(--muted); background: color-mix(in srgb, var(--muted) 14%, transparent);
}
.pick-tag.current { color: var(--ok); background: var(--ok-bg); }
.pick-tag.undated, .pick-tag.draft { color: var(--check); background: var(--check-bg); }
.pick-tag.conflict { color: var(--no); background: var(--no-bg); }
.pick-tag.upload { color: var(--check); background: var(--check-bg); }
.pick-quote-at { font-size: 11.5px; white-space: nowrap; }
.pick-tag.private { color: #6d28d9; background: color-mix(in srgb, #7c3aed 13%, transparent); }
.pick-tag.variation { color: color-mix(in srgb, var(--accent) 78%, var(--ink)); background: color-mix(in srgb, var(--accent) 13%, transparent); cursor: help; }
.pick-chip {
  font: inherit; font-size: 11.5px; font-weight: 700; letter-spacing: 0.01em; cursor: pointer; border: none; border-radius: 999px; padding: 3px 10px;
  color: color-mix(in srgb, var(--accent) 78%, var(--ink)); background: color-mix(in srgb, var(--accent) 13%, transparent); /* the tint under the text is 4.5:1 with it */
}
.pick-chip:hover { background: color-mix(in srgb, var(--accent) 22%, transparent); }
@media (pointer: coarse) { .pick-chip { min-height: 44px; padding: 6px 12px; } }
/* The chip's evidence in brief (gpa-picks-ui.js popHtml): a small card over the list, placed beside the chip */
.pick-pop {
  position: fixed; z-index: 40; max-height: calc(100dvh - 24px); overflow-y: auto; display: grid; gap: 8px; padding: 12px 14px 14px;
  color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 18px 50px rgba(14, 23, 38, 0.28);
}
.pick-pop[hidden] { display: none; }
.pick-pop:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.pick-pop-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.pick-pop-head h3 { margin: 4px 0 0; font-family: var(--display); font-size: 15px; color: var(--accent); }
.pick-pop-x {
  flex: none; display: grid; place-items: center; width: 32px; height: 32px; padding: 0; font-size: 20px; line-height: 1; cursor: pointer;
  color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: 50%;
}
.pick-pop-x:focus-visible, .pick-pop-foot button:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.pick-pop-course { margin: 0; font-size: 13px; color: var(--muted); }
.pick-pop-facts div { grid-template-columns: 6.5em minmax(0, 1fr); font-size: 13.5px; }
.pick-pop-note { margin: 0; font-size: 12.5px; line-height: 1.5; color: var(--muted); }
.pick-pop-foot { margin: 2px 0 0; }
.pick-pop-foot button { min-height: 40px; }
@media (pointer: coarse) { .pick-pop-x { width: 44px; height: 44px; } .pick-pop-foot button { min-height: 44px; } }
.picks-secs h3 { margin: 20px 2px 10px; font-family: var(--display); font-size: 17px; }
.picks-sec-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.pick-sec { display: grid; gap: 8px; padding: 14px 16px; border-radius: 14px; background: var(--surface); box-shadow: var(--shadow); border-left: 5px solid var(--ok-solid); }
.pick-sec.is-other { border-left-color: var(--line); background: var(--surface-2); box-shadow: none; border-top: 1px solid var(--line); border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.pick-sec { scroll-margin-top: 76px; } /* below the top bar when a chip or a link lands on one */
.pick-sec:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.pick-sec-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 12px; }
.pick-mark { margin: 0; font-weight: 700; font-size: 15px; }
.pick-mark.ok { color: var(--ok); }
.pick-mark.no { color: var(--no); }
.pick-sec-line { margin: 0; font-size: 13.5px; display: flex; flex-wrap: wrap; gap: 2px 12px; }
.pick-facts { margin: 0; display: grid; gap: 6px; }
.pick-facts div { display: grid; grid-template-columns: 7.5em minmax(0, 1fr); gap: 2px 14px; align-items: baseline; font-size: 14px; }
.pick-facts dt { color: var(--muted); font-size: 13px; }
.pick-facts dd { margin: 0; overflow-wrap: anywhere; }
.pick-meetings { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.pick-h { margin: 8px 0 0; font-family: var(--display); font-size: 14px; }
.pick-h5 { margin: 8px 0 4px; font-size: 13px; color: var(--muted); font-weight: 700; }
.pick-notes { margin: 0; font-size: 13.5px; }
.pick-warn, .pick-warn-line { margin: 0; padding: 8px 12px; border-radius: 10px; background: var(--check-bg); color: var(--check); font-size: 13.5px; }
.pick-warn p { margin: 4px 0 0; }
.pick-variation { margin: 0; font-size: 13.5px; }
.pick-evidence { border: 1px solid var(--line); border-radius: 12px; padding: 0 12px; background: var(--surface); }
.pick-evidence > summary { min-height: 44px; display: flex; align-items: center; cursor: pointer; font-weight: 650; font-size: 14px; }
.pick-evidence > summary:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.pick-ev-list { display: grid; gap: 10px; padding: 4px 0 12px; }
.pick-ev { display: grid; gap: 6px; padding: 12px 14px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line); font-size: 13.5px; }
.pick-ev.reject { border-color: var(--no); background: var(--no-bg); }
.pick-ev.pending { border-color: var(--check); }
.pick-ev p { margin: 0; }
.pick-ev-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 12px; }
.pick-ev-share b { font-size: 20px; }
.pick-verdict { font-weight: 700; font-size: 13px; }
.pick-verdict.pass { color: var(--ok); }
.pick-verdict.reject { color: var(--no); }
.pick-verdict.pending { color: var(--check); }
.pick-ev-labels { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px; }
.pick-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.pick-table th { text-align: left; font-weight: 650; color: var(--muted); padding: 4px 8px 4px 0; border-bottom: 1px solid var(--line); }
.pick-table td { padding: 5px 8px 5px 0; border-bottom: 1px solid var(--line); vertical-align: baseline; overflow-wrap: anywhere; }
.pick-total { font-size: 12.5px; color: var(--muted); }
.pick-quote { margin: 0 0 6px; padding: 6px 10px; font-size: 12.5px; }
.pick-sources { display: flex; flex-wrap: wrap; gap: 2px 12px; align-items: baseline; }
.pick-sources a { color: var(--accent); font-weight: 600; overflow-wrap: anywhere; }
.pick-panel { display: grid; gap: 6px; }
.pick-panel p { margin: 0; }
.pick-panel-line { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; font-size: 13.5px; }
.pick-sec-foot { margin: 0; }
.pick-sec.is-private { border-left-color: #8b5cf6; }
.pick-basis { display: grid; gap: 4px; padding: 10px 12px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line); font-size: 13.5px; }
.pick-basis p { margin: 0; }
.picks-route-rule { margin: 4px 0 0; font-size: 13.5px; }
.picks-more-btn { margin-top: 16px; }
:is(.picks-conditional, .picks-pending) { margin-top: 28px; padding: 14px 16px; border-radius: 14px; border: 1px dashed var(--check); background: var(--surface); }
:is(.picks-conditional, .picks-pending) h3 { margin: 0 0 4px; font-family: var(--display); font-size: 16px; }
:is(.picks-conditional, .picks-pending) > p { margin: 0 0 8px; font-size: 13px; }
.pick-cond-items { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.pick-cond { display: grid; gap: 6px; }
.pick-cond-head { margin: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; font-weight: 650; }
.pick-cond-list { margin: 0; padding-left: 1.2em; font-size: 13.5px; }
.picks-view button:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
@media (max-width: 900px) { body.picks-open .chat-launcher { bottom: calc(env(safe-area-inset-bottom, 0px) + 16px); } }
@media (max-width: 640px) {
  .picks-inner { padding: 8px 16px 96px; }
  .picks-grid { grid-template-columns: minmax(0, 1fr); }
  .picks-exam { grid-column: auto; }
  .pick-facts div { grid-template-columns: minmax(0, 1fr); }
  .pick-card { padding: 12px 14px; }
  .pick-see { width: 100%; }
  .pick-ev { padding: 10px 12px; }
}

/* ---------- All professors, a page of its own like the picks (#professors), and a professor's details (professors-ui.js) ---------- */
.profs-toggle { white-space: normal; text-align: left; line-height: 1.25; }
body.profs-open .board, body.profs-open .banner, body.profs-open .shared-bar, body.profs-open .layout, body.profs-open .footer { display: none; }
@media (max-width: 900px) { body.profs-open .chat-launcher { bottom: calc(env(safe-area-inset-bottom, 0px) + 16px); } }
.profs-coverage { line-height: 1.5; }
.profs-note { margin: 10px 0 0; font-size: 13px; }
.profs-note:empty { display: none; }
.profs-list { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 8px; }
.prof-row {
  display: grid; gap: 3px; width: 100%; min-height: 48px; padding: 10px 14px; text-align: left; cursor: pointer; font: inherit; font-size: 13.5px;
  color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: 12px;
}
.prof-row:hover { border-color: color-mix(in srgb, var(--ink) 35%, var(--line)); }
.prof-row-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; }
.prof-row-name { font-size: 15px; font-weight: 700; overflow-wrap: anywhere; }
.prof-chip { font-size: 12px; font-weight: 650; padding: 1px 8px; border-radius: 999px; color: var(--muted); background: var(--surface-2); border: 1px solid var(--line); }
.prof-chip.possible, .prof-chip.verified { color: var(--accent); }
.prof-row-meta, .prof-row-teach { font-size: 12.5px; color: var(--muted); overflow-wrap: anywhere; }
.profs-filters .picks-clear { min-width: 44px; min-height: 44px; }
.profs-more { margin-top: 12px; }
.profs-more-btn { width: auto; min-height: 44px; padding: 0 20px; }
dialog.prof-detail { width: min(640px, calc(100vw - 24px)); }

/* ---------- "More cities…": the searchable list behind the city menu (public/city-picker.js) ---------- */
dialog.city-picker { height: min(82vh, 600px); }
.city-picker .record-panel { grid-template-rows: auto auto auto auto minmax(0, 1fr); padding-bottom: 16px; overflow: hidden; }
.city-count { margin: 0; min-height: 1.3em; }
.city-list { list-style: none; margin: 0 -22px; padding: 0 22px 2px; display: grid; align-content: start; gap: 6px; overflow-y: auto; min-height: 0; overscroll-behavior: contain; }
.city-pick {
  display: grid; gap: 1px; width: 100%; min-height: 44px; padding: 8px 12px; text-align: left; font: inherit; color: var(--ink);
  background: var(--surface); border: 1px solid var(--line); border-radius: 12px; cursor: pointer;
}
.city-pick:hover { border-color: var(--muted); }
.city-pick:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.city-pick.is-current { border-color: var(--accent); }
.city-pick-name { font-weight: 650; }
.city-pick-now { margin-left: 6px; font-size: 12px; font-weight: 650; color: var(--accent); }
.city-pick-sub { font-size: 12.5px; color: var(--muted); overflow-wrap: anywhere; }
.city-none { padding: 12px 0; color: var(--muted); }
.prof-detail .record-panel { gap: 12px; }
.prof-status { display: grid; gap: 4px; justify-items: start; padding: 12px 14px; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--line); font-size: 14px; }
.prof-status p { margin: 0; }
.prof-status.possible, .prof-status.verified { background: var(--surface); border-color: color-mix(in srgb, var(--accent) 40%, var(--line)); }
.prof-cards { display: grid; gap: 10px; }
.prof-card { display: grid; gap: 8px; padding: 12px 14px; border-radius: 14px; background: var(--surface); box-shadow: var(--shadow); }
.prof-card h3 { margin: 0; font-size: 15.5px; }
.prof-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px 16px; margin: 0; }
.prof-facts div { display: grid; gap: 1px; min-width: 0; }
.prof-facts dt { font-size: 12px; font-weight: 650; color: var(--muted); }
.prof-facts dd { margin: 0; font-size: 14px; overflow-wrap: anywhere; }
.prof-facts .prof-rating dd b { font-size: 17px; }
.prof-see { display: inline-flex; align-items: center; min-height: 44px; font-weight: 650; color: var(--accent); }
.prof-partial h3, .prof-teach h3 { margin: 0 0 6px; font-size: 14.5px; }
.prof-teach h3 .muted { margin-left: 6px; font-size: 12.5px; font-weight: 500; }
.prof-partial ul { margin: 0; padding-left: 1.2em; font-size: 13.5px; }
.prof-notes { display: grid; gap: 4px; padding: 10px 12px; border-radius: 12px; background: var(--check-bg); font-size: 13px; }
.prof-notes p { margin: 0; }
.prof-secs { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.prof-sec {
  display: grid; gap: 2px; width: 100%; min-height: 44px; padding: 8px 12px; text-align: left; cursor: pointer; font: inherit;
  color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: 10px;
}
.prof-sec:hover { border-color: var(--muted); }
.prof-sec-head { font-size: 14px; font-weight: 650; overflow-wrap: anywhere; }
.prof-sec-title { font-weight: 500; }
.prof-sec-meta { font-size: 12.5px; color: var(--muted); }
.prof-teach > p { margin: 6px 0 0; font-size: 13px; }
.prof-wait { margin: 0; }
.prof-foot .prof-to-page { min-height: 44px; }
.prof-detail button:focus-visible, .prof-detail a:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }

/* ---------- Touch screens: every control at least 44x44 CSS px (launch acceptance B) ---------- */
@media (pointer: coarse) {
  /* round icon buttons keep their 34px look; the button around them is 44px (the fill is clipped to the old circle) */
  .icon-btn { width: 44px; height: 44px; padding: 5px; background-clip: content-box; }
  .icon-btn.small { width: 44px; height: 44px; padding: 8px; }
  .cart-toast-x { width: 44px; height: 44px; }
  .language-switch button { min-width: 44px; min-height: 44px; }
  /* buttons that have a box of their own: taller */
  .record-pill, .hero-primary, .hero-secondary, .busy-pill, .gpa-toggle, .about-edit, .chat-new, .cart-add, .cart-toast-btn, .busy-save, .busy-cancel, .copy-text-btn,
  .pick-see, .cart-danger, .cart-confirm .secondary, .record-find, .record-add button, .record-save, .record-clear, .auth-tabs button,
  .auth-actions .secondary, .auth-row .cart-link, .auth-who .cart-link, .set-rows .cart-link, .auth-account-actions .cart-link, .plan-record, .prereq-item > summary { min-height: 44px; }
  .record-pill.cart-pill { min-height: 44px; }
  /* text fields and menus: an explicit height (WebKit on a Mac or phone ignores min-height on a <select>) */
  .busy-times select, .busy-label input, .about-fields select, .about-fields input, .record-add input, .record-add select,
  .picks-field select, .picks-pair select, .tt-campus select { height: 44px; }
  /* the menus inside the "I'm ... and I'll be in ..." sentence: the hit area grows upward, the text and its dashed underline stay where they are */
  .situation .field select, #busyRow .field select { padding-top: 10px; margin-top: -10px; background-position: right 9px bottom 12px, right 4px bottom 12px; }
  .gap-field select { padding-top: 10px; margin-top: -10px; background-position: right 9px bottom 12px, right 4px bottom 12px; }
  .more-settings .gap-field select { height: 44px; }
  /* links and link-looking buttons that stand on their own line */
  .cart-tools .cart-link, .cart-item-title, .pick-open, .links a, .pick-sources a, .gpa-facts a.gpa-source, :is(.card-line, .instructors) .prof-name, p > .link-btn:only-child, :is(.plan-actions, .pick-sec-foot) > .link-btn {
    display: inline-flex; align-items: center; min-height: 44px;
  }
  .cart-item-title { display: flex; }
  /* the small "x" and copy buttons: 44px to touch, the layout around them unchanged */
  .copy-btn { width: 44px; height: 44px; margin: -15px -9px -15px 0; }
  .rchip button { width: 44px; height: 44px; margin: -11px -3px -11px -11px; }
  .busy-chip button { width: 44px; height: 44px; margin: -10px -9px -10px -10px; }
  .chat-chip { display: inline-flex; align-items: center; min-height: 44px; padding: 0 10px; }
  .chat-history-act, .chat-history-clear, .chat-history-rename { min-height: 44px; }
  .chat-history-open { min-height: 44px; }
  .plan-tick, .about-check, .plan-confirm button, .plan-banner .secondary { min-height: 44px; }
  /* the timetable's fix buttons, "try these hours", the clash lines that open and "sign in to sync" */
  .ghost, .tt-fix, .clashes summary { min-height: 44px; }
  .cart-sync .cart-link { display: inline-flex; align-items: center; min-height: 44px; }
}

/* ---------- the tour for a new account (public/tour.js): the ring and the card ---------- */
.tour-shield { position: fixed; inset: 0; z-index: 1000; }
.tour-ring { position: fixed; z-index: 1001; border-radius: 14px; pointer-events: none; box-shadow: 0 0 0 3px var(--amber), 0 0 0 9999px rgba(6, 10, 18, 0.58); }
.tour-card {
  position: fixed; z-index: 1002; width: min(380px, calc(100vw - 24px)); padding: 12px 18px 14px; border-radius: 16px;
  background: var(--surface); color: var(--ink); border: 1px solid var(--line); box-shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
}
.tour-card:focus { outline: none; }
.tour-head { display: flex; align-items: center; justify-content: space-between; }
.tour-count { color: var(--muted); font-size: 13px; font-weight: 650; }
.tour-x { width: 44px; height: 44px; margin-right: -12px; border: 0; border-radius: 10px; background: transparent; color: var(--muted); font-size: 22px; cursor: pointer; }
.tour-card h2 { margin: 0 0 6px; font: 700 19px/1.3 var(--display); }
.tour-card p { margin: 0 0 12px; color: var(--muted); font-size: 14.5px; line-height: 1.55; }
.tour-more { margin-top: -6px !important; }
.tour-more a { display: inline-flex; align-items: center; min-height: 44px; color: var(--accent); font-weight: 650; }
.tour-actions { display: flex; justify-content: space-between; gap: 10px; }
.tour-back, .tour-next { min-height: 44px; padding: 0 18px; border-radius: 12px; font: inherit; font-weight: 700; cursor: pointer; }
.tour-back { border: 1px solid var(--line); background: transparent; color: var(--ink); }
.tour-next { border: 1px solid var(--amber); background: var(--amber); color: #0e1726; }
.tour-back:focus-visible, .tour-next:focus-visible, .tour-x:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
@media (max-width: 640px) { .tour-card { top: auto; left: 12px; right: 12px; bottom: 12px; width: auto; } }
@media (prefers-reduced-motion: no-preference) { .tour-ring { transition: top 0.2s ease, left 0.2s ease, width 0.2s ease, height 0.2s ease; } }

/* ---- phones (2026-10-29): the cart is one slim bar until it is opened; the chat button is a round icon above it that steps
   aside while the page scrolls, so neither covers the form or the cards ---- */
@media (max-width: 767px) {
  body:not(.detail-open):not(.sheet-open) .pass-head { padding: 9px 16px; }
  .sheet-toggle { min-height: 44px; }
  body:not(.detail-open):not(.sheet-open) .sheet-toggle > span:first-child { display: flex; align-items: baseline; gap: 8px; min-width: 0; }
  body:not(.detail-open):not(.sheet-open) .pass-head .kicker { display: inline; }
  body:not(.detail-open):not(.sheet-open) .pass-head .pass-title { margin-top: 0; font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .chat-launcher { right: 12px; min-height: 48px; padding: 0 16px; bottom: calc(env(safe-area-inset-bottom, 0px) + 64px); }
  body.landing-open .chat-launcher { bottom: calc(env(safe-area-inset-bottom, 0px) + 16px); }
  .chat-launcher { transition: opacity 0.18s ease, transform 0.18s ease; }
  body.page-scrolling .chat-launcher { opacity: 0; transform: translateY(14px); } /* a tap in those 0.7 s still opens the chat, never the card under it */
  .footer { padding-bottom: 130px; }
}
@media (max-width: 767px) and (prefers-reduced-motion: reduce) { .chat-launcher { transition: none; } }

/* ---------- The home page (landing-ui.js): the words and the settings on the left, a picture on the right, three real numbers under them ---------- */
body.landing-open .board, body.landing-open .banner, body.landing-open .shared-bar, body.landing-open .layout, body.landing-open .footer-data, body.landing-open #restartBtn { display: none; }
body.landing-open .cart-btn:has(.cart-badge[data-count="0"]) { display: none; } /* a cart with something in it stays within reach */
.footer-browse { display: none; }
body.landing-open .footer { display: flex; flex-wrap: wrap; align-items: center; gap: 0 22px; max-width: 1288px; padding: 8px 24px 36px; }
body.landing-open .footer-body { display: contents; }
body.landing-open .footer .link-btn { display: inline-flex; align-items: center; font-weight: 500; color: var(--muted); text-decoration: none; }
body.landing-open .footer .link-btn:hover { color: var(--ink); text-decoration: underline; }
body.landing-open .footer .footer-browse { font-weight: 650; color: var(--ink); }
body.landing-open .footer .footer-browse::after { content: "\2192"; margin-left: 6px; }
body.landing-open .footer .icp { flex-basis: 100%; margin: 6px 0 0; }
.landing { padding: clamp(28px, calc((100vh - 781px) / 2), 120px) 24px 8px; } /* on a tall screen the panel stands in the middle, not at the top */
.landing-panel { max-width: 1240px; margin: 0 auto; padding: 52px 56px 26px; border-radius: 28px; background: var(--surface); border: 1px solid var(--card-edge); box-shadow: var(--shadow); }
.landing-inner { display: grid; grid-template-columns: minmax(0, 1.08fr) minmax(0, 0.92fr); gap: 44px; align-items: center; }
.landing h1 { margin: 0 0 14px; font-family: var(--display); font-size: clamp(32px, 3.6vw, 50px); line-height: 1.1; font-weight: 700; letter-spacing: -0.02em; color: var(--ink); }
.landing h1 span { display: block; text-wrap: balance; } /* a line for each sentence */
.landing h1:lang(zh) { word-break: keep-all; }
.landing-sub { margin: 0 0 24px; max-width: 48ch; font-size: 17px; line-height: 1.5; color: var(--muted); }
.landing-settings .situation { display: flex; flex-wrap: wrap; gap: 10px; margin: 0 0 24px; max-width: none; font-size: 15px; line-height: 1.4; }
.set-field { display: inline-flex; align-items: center; gap: 8px; min-height: 46px; padding: 0 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); color: var(--muted); }
.set-field label { display: inline-flex; }
.set-field select {
  field-sizing: content; max-width: 62vw; min-height: 44px; padding: 0 16px 0 0; border: none; border-radius: 0; background: transparent; appearance: none; -webkit-appearance: none; cursor: pointer;
  font: inherit; font-size: 14.5px; font-weight: 600; color: var(--ink);
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 7px) 55%, calc(100% - 3px) 55%; background-size: 4px 4px; background-repeat: no-repeat;
}
.landing-actions { display: flex; flex-wrap: wrap; gap: 12px; }
.landing-go, .landing-import { min-height: 54px; padding: 0 26px; font-size: 16px; }
.landing-import { color: var(--ink); border-color: var(--board-edge); }

.landing-art { position: relative; min-height: 372px; }
.landing-art::before { content: ""; position: absolute; inset: 4% -2% 2% 4%; border-radius: 48% 52% 50% 50% / 56% 50% 50% 44%; background: color-mix(in srgb, var(--amber) 14%, var(--surface)); }
.art-cal, .art-list { position: absolute; isolation: isolate; background: var(--surface); border: 1px solid var(--line); box-shadow: 0 10px 30px rgba(15, 19, 26, 0.09); }
.art-cal { left: 0; top: 4%; width: 76%; padding: 14px 14px 12px; border-radius: 16px; }
.art-list { right: 0; bottom: 4%; width: 54%; padding: 14px; border-radius: 14px; }
.art-title { margin: 0 0 8px; font-size: 13.5px; font-weight: 700; color: var(--ink); }
/* Each card is one big button: the button is the card's title and its ::after covers the card, over the blocks and rows */
.art-go { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; width: 100%; padding: 0; border: none; background: transparent; font: inherit; color: inherit; text-align: left; cursor: pointer; }
.art-go::after { content: ""; position: absolute; inset: 0; z-index: 1; border-radius: 14px; }
.art-cal .art-go::after { border-radius: 16px; }
.art-go:focus-visible { outline: none; }
.art-go:focus-visible::after { outline: 2px solid var(--focus); outline-offset: 2px; }
.art-arrow { color: var(--muted); font-weight: 600; }
.art-cal:active, .art-list:active { border-color: var(--muted); }
@media (hover: hover) {
  .art-cal:hover, .art-list:hover { border-color: var(--muted); box-shadow: 0 14px 34px rgba(15, 19, 26, 0.15); }
  .art-cal:hover .art-arrow, .art-list:hover .art-arrow { color: var(--ink); }
}
.art-week { display: grid; grid-template-columns: 34px repeat(5, minmax(0, 1fr)); gap: 3px; }
.art-rail { display: flex; flex-direction: column; justify-content: space-between; height: 222px; margin-top: 20px; font-size: 9.5px; color: var(--muted); white-space: nowrap; }
.art-day > span { display: block; height: 20px; font-size: 10.5px; color: var(--muted); text-align: center; }
.art-col { position: relative; height: 222px; border-left: 1px solid var(--line); }
.art-block { position: absolute; left: 2px; right: 1px; padding: 2px 3px; border-radius: 5px; overflow: hidden; font-style: normal; font-size: 9.5px; line-height: 1.15; color: var(--ink); }
.art-block b { font-weight: 600; }
.art-block.a { background: color-mix(in srgb, var(--amber) 28%, var(--surface)); }
.art-block.b { background: var(--check-bg); }
.art-block.c { background: var(--ok-bg); }
.art-block.d { background: var(--no-bg); }
.art-list ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.art-list li { display: grid; grid-template-columns: 14px minmax(0, 1fr) auto; align-items: center; gap: 7px; font-size: 12px; }
.art-list b { font-weight: 600; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.art-tick { width: 14px; height: 14px; border-radius: 4px; background: var(--ok-fill); }
.art-tag { padding: 1px 6px; border-radius: 999px; font-size: 10px; font-weight: 700; white-space: nowrap; }
.art-tag.takeable { color: var(--ok); background: var(--ok-bg); }
.art-tag.check { color: var(--check); background: var(--check-bg); }

.landing-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); margin: 34px 0 0; padding-top: 22px; border-top: 1px solid var(--line); }
.landing-stats > div { text-align: center; border-left: 1px solid var(--line); }
.landing-stats > div:first-child { border-left: none; }
.landing-stats dd { margin: 0; font-size: 30px; font-weight: 650; letter-spacing: -0.015em; color: var(--ink); }
.landing-stats dt { margin-top: 2px; font-size: 13.5px; color: var(--muted); }
@media (max-width: 900px) {
  .landing { padding: 14px 12px 8px; }
  body.landing-open .footer { padding: 6px 14px 84px; gap: 0 16px; }
  .landing-panel { padding: 26px 18px 20px; border-radius: 20px; }
  .landing-inner { display: flex; flex-direction: column; align-items: stretch; gap: 24px; }
  .landing-settings .situation { flex-direction: column; }
  .set-field { width: 100%; }
  .set-field.set-hours select { max-width: 40vw; }
  .set-school select, .set-term select { flex: 1; field-sizing: auto; width: 100%; max-width: none; }
  .set-school, .set-term { display: flex; }
  .landing-actions { flex-direction: column; }
  .landing-go, .landing-import { width: 100%; padding: 0 12px; font-size: clamp(14px, 4.2vw, 16px); }
  .landing-go { white-space: nowrap; } /* the arrow stays with the words */
  .landing h1:lang(en) { font-size: clamp(26px, 7.4vw, 32px); } /* "See what you can take." on one line */
  /* the picture under the buttons, its two cards one under the other: a card over the calendar read as a sheet to swipe away */
  .landing-art { min-height: 0; padding-bottom: 12px; }
  .landing-art::before { inset: 0 -8px; }
  .art-cal, .art-list { position: relative; left: auto; right: auto; top: auto; bottom: auto; width: 100%; }
  .art-list { margin-top: 12px; }
  .art-rail, .art-col { height: 176px; }
  .landing-stats { margin-top: 18px; padding-top: 16px; }
  .landing-stats dd { font-size: 22px; }
  .landing-stats dt { font-size: 12px; padding: 0 4px; text-wrap: balance; }
}
/* A laptop's window is short: what can give way does, so the whole panel and the line under it fit without scrolling. --h is how far the
   window stands above 540 px: 0 there, 360 px from 900 px up, where this is the layout above. */
@media (min-width: 901px) {
  .landing { --h: clamp(0px, calc(100vh - 540px), 360px); padding-top: max(calc(10px + var(--h) * 0.05), min(calc((100vh - 781px) / 2), 120px)); }
  .landing-panel { padding: calc(20px + var(--h) * 0.089) clamp(32px, 3.9vw, 56px) calc(10px + var(--h) * 0.044); }
  .landing-inner { gap: clamp(26px, 3vw, 44px); }
  .landing h1 { margin-bottom: calc(8px + var(--h) * 0.017); font-size: min(3.6vw, calc(34px + var(--h) * 0.044)); }
  .landing-sub { margin-bottom: calc(12px + var(--h) * 0.033); font-size: calc(15px + var(--h) * 0.0056); }
  .landing .landing-settings .situation { margin-bottom: calc(14px + var(--h) * 0.028); }
  .landing .set-field { min-height: calc(40px + var(--h) * 0.017); }
  .landing .set-field select { min-height: calc(38px + var(--h) * 0.017); }
  .landing-go, .landing-import { min-height: calc(46px + var(--h) * 0.022); }
  .landing-art { min-height: min(372px, calc(300px + var(--h) * 0.6)); }
  .landing .art-rail, .landing .art-col { height: min(222px, calc(172px + var(--h) * 0.42)); }
  .landing-stats { margin-top: calc(12px + var(--h) * 0.061); padding-top: calc(10px + var(--h) * 0.033); }
  .landing-stats dd { font-size: calc(24px + var(--h) * 0.0167); }
  .landing-stats dt { margin-top: 0; }
}
/* the three settings keep to one line on a narrow laptop */
@media (min-width: 901px) and (max-width: 1240px) {
  .landing-inner { grid-template-columns: minmax(0, 1.18fr) minmax(0, 0.82fr); }
  .landing .landing-settings .situation { gap: 8px; }
  .landing .set-field { gap: 6px; padding: 0 10px; }
  .landing .set-field select { padding-right: 14px; font-size: 14px; }
  .landing-go, .landing-import { padding: 0 20px; font-size: 15px; }
  .art-list { width: 60%; }
}

/* ---------- The plan (plan-ui.js): the upload beside the majors, folding lists ---------- */
.plan-start { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 24px; align-items: start; }
.plan-upload { position: sticky; top: 84px; padding: 18px; border-radius: 16px; background: var(--surface); border: 1.5px solid color-mix(in srgb, var(--amber) 60%, var(--line)); }
.plan-upload h4 { margin: 8px 0 4px; font-size: 17px; }
.plan-upload p { margin: 0 0 14px; font-size: 14px; }
.plan-badge { display: inline-block; padding: 2px 10px; border-radius: 999px; background: color-mix(in srgb, var(--amber) 22%, transparent); color: var(--ink); font-size: 12.5px; font-weight: 700; }
details.plan-col > summary { list-style: none; cursor: pointer; display: flex; align-items: center; justify-content: space-between; min-height: 44px; }
details.plan-col > summary::-webkit-details-marker { display: none; }
details.plan-col > summary::after { content: "▾"; color: var(--muted); transition: transform 0.15s; }
details.plan-col:not([open]) > summary::after { transform: rotate(-90deg); }
details.plan-col > summary h4 { margin: 0; }
details.plan-col[open] > summary { margin-bottom: 8px; }
.plan-tag { padding: 1px 8px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line); font-size: 12px; }
@media (max-width: 860px) {
  .plan-start { grid-template-columns: minmax(0, 1fr); }
  .plan-upload { position: static; order: -1; }
}

/* ---------- The header's "Start over / Change major" ---------- */
.topbar-link { border: none; background: transparent; padding: 0 6px; min-height: 44px; font: inherit; font-size: 14px; font-weight: 600; color: var(--ink); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.topbar-link[hidden] { display: none; }
@media (max-width: 767px) { .topbar-link { display: none; } }

.plan-actions .hero-primary[disabled] { opacity: 0.5; cursor: default; filter: none; }

/* ---------- A course card in four lines at most (app.js cardHtml, 2026-10-29) ---------- */
.cards > .card { display: grid; grid-template-columns: minmax(0, 1fr); gap: 6px; align-items: start; padding: 12px 62px 12px 20px; }
.c-head { display: flex; align-items: baseline; gap: 10px; min-width: 0; }
.c-head .title { font-size: 16.5px; -webkit-line-clamp: 1; line-clamp: 1; }
.c-head .code { flex: none; }
.c-time, .list-ticks { display: grid; grid-template-columns: 236px minmax(140px, 300px) auto; gap: 14px; align-items: center; }
.c-time .when-text { font-size: 13.5px; }
.c-time .dial { height: 16px; }
.c-time .chip { justify-self: start; padding: 3px 10px; font-size: 13px; }
/* the list narrower than a card's row (an open chat, a small window): the time says it, without the bar or the hours above it, and nothing sticks out */
#list { container-type: inline-size; }
@container (max-width: 580px) {
  .c-time { grid-template-columns: minmax(0, 1fr) auto; gap: 6px 10px; }
  .c-time .dial { display: none; }
  .c-time .when-text { font-size: 12.5px; }
  .list-ticks { display: none; }
}
.list-ticks { padding: 0 62px 0 20px; }
.list-ticks .ticks { margin: 0; }
.c-facts { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 8px; font-size: 13.5px; color: var(--muted); }
.c-facts .prof-name { border: none; background: none; padding: 0; font: inherit; color: var(--ink); text-decoration: underline; text-underline-offset: 2px; cursor: pointer; }
.c-star { color: var(--ink); font-weight: 650; }
.c-facts .gpa-marks { margin: 0 0 0 4px; }
.c-now { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; font-size: 13.5px; }
.c-now .cart-other-line { margin: 0; }
.c-now .why { font-size: 13.5px; }
body.dock-open .cards > .card { grid-template-columns: minmax(0, 1fr); }
@media (max-width: 767px) {
  .cards > .card { padding: 12px 56px 12px 18px; }
  .c-time { grid-template-columns: minmax(0, 1fr) auto; gap: 6px 10px; }
  .c-time .dial { display: none; } /* a phone has no room for the bar beside the time: the time says it */
  .c-time .when-text { font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .c-time .when-text.clocks { white-space: normal; }
  .c-time .chip { padding: 2px 8px; font-size: 12.5px; }
  .list-ticks { display: none; }
}

/* ---------- The workspace's one line and the fold under it (the settings have one place) ---------- */
.board { padding: 0; background: var(--surface); border-bottom: 1px solid var(--line); }
.board-inner { padding: 10px 28px; }
.ws-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 18px; }
.ws-settings { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; max-width: 100%; padding: 0 14px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--ink); font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; text-align: left; }
.ws-settings:hover, .ws-settings[aria-expanded="true"] { background: var(--surface-2); }
.ws-settings svg { flex: none; color: var(--muted); }
.ws-links { display: flex; flex-wrap: wrap; align-items: center; gap: 0 18px; }
.ws-link { min-height: 44px; padding: 0; border: none; background: none; color: var(--ink); font: inherit; font-size: 14px; font-weight: 600; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.ws-link.set::before { content: "✓ "; color: var(--ok); font-weight: 800; }
.more-settings { display: grid; gap: 10px; margin: 8px 0 6px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface-2); }
.more-settings[hidden] { display: none; }
.more-settings .situation { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; margin: 0; max-width: none; font-size: 15px; line-height: 1.4; }
.more-settings .set-term { display: none; } /* the term is in the filter bar */
.more-settings .busy-row, .more-settings .about-row { margin: 0; max-width: none; }
.more-settings .gap-field { font-size: 15px; }
.scoreboard { display: block; margin: 0; }
.scoreboard:empty { display: none; }
.scoreboard .loading { margin-top: 8px; }
.board-note { margin: 6px 0 0; font-size: 13px; color: var(--muted); }
@media (max-width: 767px) {
  .board-inner { padding: 6px 12px; }
  .ws-settings { width: 100%; }
}
.c-time .when-text .local { white-space: nowrap; }
@media (max-width: 767px) {
  .c-time .when-text .local { font-family: inherit; font-weight: 650; }

}

/* ---------- Colours (2026-10-29): amber only on the logo, the main buttons, the cart count and ＋ ---------- */
.field select { border-bottom-color: color-mix(in srgb, var(--board-ink) 35%, transparent); background-image: linear-gradient(45deg, transparent 50%, var(--board-muted) 50%), linear-gradient(135deg, var(--board-muted) 50%, transparent 50%); }
.primary { background: var(--amber); color: var(--on-amber); }
.primary:hover { background: var(--amber); filter: brightness(1.07); }

.loading progress::-webkit-progress-value { background: var(--ok-solid); }
.loading progress::-moz-progress-bar { background: var(--ok-solid); }
:is(.record-pill,
.busy-pill,
.about-edit,
.topbar-btn):hover { border-color: var(--board-edge); }
.record-pill.set, .busy-pill[aria-expanded="true"] { border-color: var(--board-edge); }
.busy-chip { background: var(--surface-2); border-color: var(--line); }
.daychip input:checked + span { background: var(--board-ink); border-color: var(--board-ink); color: var(--board); }

.plan-upload { border-color: color-mix(in srgb, var(--ok-solid) 55%, var(--line)); }
.plan-badge { background: var(--ok-bg); color: var(--ok); }
.chat-launcher { background: var(--ink); color: var(--surface); }
.chat-launcher svg path[stroke] { stroke: var(--amber); }
a:not([class]), .link-btn { color: var(--ink); text-decoration: underline; text-underline-offset: 2px; }

/* ---------- The chat's welcome card (chat.js welcome) ---------- */
.chat-welcome { padding: 16px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); }
.chat-welcome h3 { margin: 0 0 10px; font-size: 17px; }
.chat-empty .chat-welcome-label { margin: 10px 0 4px; font-size: 12.5px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted); }
.chat-welcome .chat-welcome-label:first-of-type { margin-top: 0; }
.chat-know, .chat-can { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; font-size: 14px; }
.chat-know li { display: flex; flex-wrap: wrap; gap: 0 4px; color: var(--ink); font-weight: 600; }
.chat-can li { color: var(--ink); }
.chat-can li::before { content: "✓"; margin-right: 8px; color: var(--ok); font-weight: 800; }

/* ---------- Plan A and Plan B in the timetable (schedule-ui.js plansHtml) ---------- */
.tt-plans { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.tt-plan { min-height: 44px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); font: inherit; font-size: 14px; font-weight: 650; cursor: pointer; }
.tt-plan:hover { background: var(--surface-2); }
.tt-plan.on { background: var(--ink); border-color: var(--ink); color: var(--bg); }

/* The plan, from a file: the codes it read */
.plan-codes { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0; font-family: var(--mono); font-size: 12.5px; }
.plan-codes li { padding: 2px 8px; border-radius: 6px; background: var(--surface); border: 1px solid var(--line); color: var(--ink); }
.list-ticks { margin-top: 4px; }

/* ---------- The timetable, a page of its own under the top bar: the choices in a rail, the week filling the rest of the window ---------- */
/* whatever the cart was opened over (the plan, 高GPA, classmates) waits behind it, so the page is always the first thing in the window */
body.schedule-open .board, body.schedule-open .banner, body.schedule-open .shared-bar, body.schedule-open .layout, body.schedule-open .footer, body.schedule-open .landing, body.schedule-open .cart-view { display: none; }
body.schedule-open { transition: none; } /* the room the cart took comes back at once */
@media (max-width: 900px) { body.schedule-open .chat-launcher { bottom: calc(env(safe-area-inset-bottom, 0px) + 16px); } }
dialog.compare.schedule { position: static; display: none; width: 100%; max-width: 1288px; height: auto; max-height: none; margin: 0 auto; padding: 0 24px 28px; overflow: visible; color: var(--ink); background: transparent; border: none; border-radius: 0; box-shadow: none; }
dialog.compare.schedule[open] { display: block; }
.schedule-panel { padding: 0; overflow: visible; }
.tt-head { position: static; flex-wrap: wrap; gap: 2px 14px; margin: 0; padding: 6px 0; color: var(--ink); background: transparent; border-bottom: none; }
.tt-head > div { flex: 0 1 auto; }
.tt-head .kicker { color: var(--accent); }
.tt-head .compare-sub { margin: 0 0 0 auto; font-size: 13px; }
.tt-rail { min-width: 0; }
.tt-cue { align-self: flex-start; justify-self: start; font-size: 13px; }
@media (max-width: 900px) { .tt-cue { display: inline-flex; align-items: center; min-height: 44px; } }
.tt-page { display: flex; flex-direction: column; gap: 12px; }
.tt-page .tt-rail { display: contents; } /* on a phone: which week, the week, then what to do with it */
.tt-plans { order: 1; }
.tt-tabs { order: 2; margin-top: 0; }
.tt-rail .tt-tags, .tt-cue { order: 3; margin: 0; }
.tt-option { order: 4; min-width: 0; }
.tt-actions { order: 5; margin-top: 0; }
.tt-saved { order: 6; }
.tt-rail .tt-campus { order: 7; margin-top: 0; }
.tt-export { position: relative; }
.tt-export summary { display: flex; align-items: center; justify-content: center; gap: 6px; box-sizing: border-box; list-style: none; text-align: center; }
.tt-export summary::-webkit-details-marker { display: none; }
.tt-export summary::after { content: ""; width: 0; height: 0; border-left: 4px solid transparent; border-right: 4px solid transparent; border-top: 5px solid currentColor; }
.tt-export-menu { display: grid; gap: 6px; margin-top: 6px; }
@media (max-width: 900px) {
  dialog.compare.schedule { padding: 0 14px 88px; }
  .tt-head .compare-sub { flex-basis: 100%; margin-left: 0; }
  /* one line of options to swipe through, the week right under it, its numbers after */
  .tt-tabs { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  .tt-tab { flex: 0 0 auto; }
  .tt-option { display: contents; }
  .tt-page .tt-stats { order: 5; margin-top: 0; }
  .tt-page .tt-actions { order: 6; }
  .tt-page .tt-saved { order: 7; margin: 0; }
  .tt-rail .tt-campus { order: 8; }
  .tt-page .tt-swaps { order: 9; margin-top: 0; }
  .tt-page .tt-agenda { order: 10; }
  .tt-page .tt-key-box { order: 11; }
  .tt-page .tt-scroll, .tt-page .tt-applied, .tt-page .tt-conflicts, .tt-page .tt-notes, .tt-page .tt-detail { order: 4; margin-top: 0; }
  .tt-page .tt-grid { margin-top: 0; }
}
@media (min-width: 901px) {
  .tt-page { display: grid; grid-template-columns: 268px minmax(0, 1fr); gap: 16px; align-items: start; }
  .tt-page .tt-rail { position: sticky; top: 69px; z-index: 5; display: grid; gap: 10px; }
  .tt-rail .tt-plans { margin: 0; }
  .tt-rail .tt-tabs { display: grid; gap: 6px; }
  .tt-rail .tt-tab { padding: 6px 12px; border-radius: 12px; }
  .tt-rail .tt-tab b { font-size: 13.5px; }
  .tt-rail .tt-tab span { font-size: 12.5px; }
  /* save and export side by side, the three exports in a small menu, the cart under them */
  .tt-rail .tt-actions { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
  .tt-rail .tt-actions > button, .tt-rail .tt-export summary { min-height: 38px; padding: 5px 8px; font-size: 13.5px; line-height: 1.2; }
  .tt-rail .tt-actions > [data-tt="usecart"] { grid-column: 1 / -1; }
  .tt-export-menu { position: absolute; z-index: 5; top: 100%; right: 0; width: 200px; margin-top: 4px; padding: 6px; gap: 2px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); }
  .tt-export-menu button { min-height: 36px; padding: 6px 10px; font-size: 13.5px; font-weight: 600; text-align: left; border: none; border-radius: 8px; }
  .tt-rail .tt-saved { margin: -4px 0 0; font-size: 12px; }
  .tt-rail .tt-campus { padding: 6px 10px; }
  /* the option's numbers on one line above the week */
  .tt-stats { display: flex; flex-wrap: wrap; gap: 2px 12px; margin: 0; padding: 6px 12px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; }
  .tt-stats div { display: flex; align-items: baseline; gap: 6px; padding: 0; background: none; border: none; border-radius: 0; }
  .tt-stats dt { font-size: 12px; }
  .tt-stats dd { margin: 0; font-size: 14px; }
  .tt-stats small { display: none; }
  /* a half hour's height: what the window leaves for the week */
  .tt-grid { --row: clamp(12px, calc((100dvh - 218px) / var(--rows)), 38px); margin-top: 8px; }
  .tt-dayhead { padding: 6px 0; font-size: 13px; }
  .tt-dayhead.weekend.off, .tt-col.weekend.off { flex: 0 0 40px; }
  .tt-main { padding-top: 8px; }
}

/* Plan A and Plan B side by side: the numbers in one table, the two weeks on one clock; what differs stands out, what both hold fades */
.tt-body > .tt-plans { margin: 0 0 8px; }
.tt-cmp-table { display: grid; grid-template-columns: auto var(--cols); gap: 0 14px; padding: 6px 14px; font-size: 13px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; }
.tt-cmp-row { display: contents; }
.tt-cmp-table [role="cell"], .tt-cmp-table [role="rowheader"], .tt-cmp-table [role="columnheader"] { padding: 3px 0; min-width: 0; }
.tt-cmp-head { font-size: 12px; font-weight: 600; color: var(--muted); }
.tt-cmp-val { color: var(--muted); font-variant-numeric: tabular-nums; }
.tt-cmp-val.differs { color: var(--ink); font-weight: 700; }
.tt-cmp-link { font-size: inherit; font-weight: 700; }
.tt-cmp-note { margin: 6px 0 0; }
.tt-compare { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin-top: 6px; align-items: start; }
.tt-cmp-col { min-width: 0; }
.tt-cmp-title { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 0; font-size: 14px; }
.tt-compare .tt-grid { margin-top: 4px; --row: clamp(12px, calc((100dvh - 372px) / var(--rows)), 30px); }
.tt-compare .tt-heads { position: static; }
.tt-compare .tt-dayhead.weekend.off, .tt-compare .tt-col.weekend.off { display: none; } /* an empty weekend gives its room to the names */
.tt-compare .tt-block.same { opacity: 0.42; }
.tt-compare .tt-block.same:hover { opacity: 0.7; }
.tt-cmp-only { margin-top: 8px; padding: 8px 12px; font-size: 13px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; }
.tt-cmp-only ul { list-style: none; margin: 2px 0 0; padding: 0; display: grid; gap: 2px; color: var(--muted); }
@media (max-width: 900px) {
  /* a phone reads the table by number, not by plan: the same cells, one number to a line */
  .tt-cmp-table { grid-auto-flow: column; grid-template-columns: minmax(0, 1.25fr) repeat(2, minmax(0, 1fr)); grid-template-rows: var(--lines); gap: 0 8px; }
  .tt-compare { grid-template-columns: minmax(0, 1fr); }
  .tt-compare .tt-grid { --row: 24px; }
}


/* ---------- Email reminders (reminders-ui.js): one quiet line in the timetable's rail, a switch on a full class in the cart ---------- */
.tt-remind { margin: 10px 0 0; font-size: 13px; line-height: 1.5; }
.tt-remind .link-btn { font-size: 13px; }
.remind-ny, .remind-here { margin: 0; }
.seat-alert { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; margin-top: 6px; }
.seat-switch { display: inline-flex; align-items: center; gap: 8px; min-height: 32px; padding: 0 12px 0 8px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--muted); font: inherit; font-size: 13px; font-weight: 650; cursor: pointer; }
.seat-switch .seat-dot { width: 14px; height: 14px; border-radius: 50%; border: 2px solid currentColor; box-sizing: border-box; }
.seat-switch.on { color: var(--ink); border-color: var(--accent); background: color-mix(in srgb, var(--accent) 10%, var(--surface)); }
.seat-switch.on .seat-dot { background: var(--accent); border-color: var(--accent); }
.seat-switch:focus-visible, .tt-remind .link-btn:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
@media (pointer: coarse) { .seat-switch, .tt-remind .link-btn { min-height: 44px; } }
.auth-field select { width: 100%; min-height: 44px; padding: 0 12px; font: inherit; font-size: 16px; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: 12px; }
