:root {
  /* Departure board */
  --board: #0e1726;
  --board-2: #16223a;
  --board-line: #24324d;
  --board-ink: #f3efe6;
  --board-muted: #93a0b8;
  --amber: #f5b544;

  /* Page */
  --bg: #f3f0e9;
  --surface: #ffffff;
  --surface-2: #faf8f3;
  --ink: #141821;
  --muted: #646b78;
  --line: #e6e1d6;
  --accent: #0f766e;
  --focus: #2563eb;

  /* Verdicts */
  --ok: #13703d;
  --ok-bg: #dcf3e5;
  --ok-solid: #22a05a;
  --check: #8f5d00;
  --check-bg: #fcefd2;
  --check-solid: #e3a21a;
  --no: #b0232f;
  --no-bg: #fbe3e5;
  --no-solid: #e0484f;

  /* 24-hour bars */
  --track: #ece7dc;
  --night: #dcd6ca;
  --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;
}

@media (prefers-color-scheme: dark) {
  :root {
    --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) {
  body { background: radial-gradient(1400px 700px at 70% 520px, rgba(80, 120, 255, 0.07), transparent 70%), var(--bg); }
  .card, .panel, .blocker, .search input { border-color: rgba(255, 255, 255, 0.06); }
  .card { border: 1px solid rgba(255, 255, 255, 0.06); }
  .card:hover { border-color: rgba(255, 255, 255, 0.14); }
  .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:
    radial-gradient(1200px 400px at 85% -20%, rgba(245, 181, 68, 0.12), transparent 60%),
    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; }
.board-top { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 10px; }
.logo {
  width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center;
  background: var(--amber); color: var(--board); 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; }
.clock {
  display: grid; gap: 1px; padding: 7px 14px; border-radius: 12px;
  background: rgba(255, 255, 255, 0.04); border: 1px solid var(--board-line); min-width: 132px;
}
.clock .where { font-size: 11px; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; color: var(--board-muted); }
.clock .time { font-family: var(--mono); font-size: 20px; font-weight: 700; letter-spacing: 0.02em; }
.clock.you { border-color: rgba(245, 181, 68, 0.5); }
.clock.you .where { color: var(--amber); }
.clock .night { font-size: 13px; margin-left: 4px; }

.board h1 {
  font-family: var(--display); font-weight: 700; letter-spacing: -0.025em; line-height: 1.05;
  font-size: clamp(30px, 4.4vw, 50px); margin: 30px 0 14px; max-width: 18ch;
}

.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: #d9dfea; 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(--amber); 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; }
.guess {
  font-size: 12px; color: var(--board-muted); border: 1px dashed var(--board-line); padding: 0 9px; border-radius: 999px; line-height: 1.9;
}

/* World map: day and night right now, behind the headline */
.board-inner { position: relative; }
.board-inner > :not(.worldmap) { position: relative; z-index: 1; }
.worldmap {
  position: absolute; right: 0; top: 70px; width: 800px; height: 302px; pointer-events: none; z-index: 0;
  -webkit-mask-image: linear-gradient(90deg, transparent 0%, #000 30%, #000 92%, transparent 100%);
  mask-image: linear-gradient(90deg, transparent 0%, #000 30%, #000 92%, transparent 100%);
}
.worldmap svg { width: 100%; height: 100%; overflow: visible; }
.worldmap .nightside { fill: #01040c; opacity: 0.62; }
.worldmap .dots.day { fill: #ffd88a; opacity: 0.7; }
.worldmap .dots.dusk { fill: #f0a35e; opacity: 0.55; }
.worldmap .dots.night { fill: #7091ea; opacity: 0.38; }
.worldmap .arc { fill: none; stroke: var(--amber); stroke-width: 0.9; stroke-dasharray: 2.4 1.8; opacity: 0.95; }
.worldmap .pin .halo { fill: var(--amber); opacity: 0.2; }
.worldmap .pin .core { fill: #fff; stroke: var(--amber); stroke-width: 0.8; }
.worldmap .pin.you .core { fill: var(--amber); stroke: #fff; }
.worldmap .pin text {
  font: 700 6.4px var(--mono); fill: #f3efe6; letter-spacing: 0.02em;
  paint-order: stroke; stroke: rgba(10, 17, 30, 0.9); stroke-width: 1.8px;
}

/* Scoreboard tiles */
.scoreboard { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-top: 24px; }
.tile {
  text-align: left; cursor: pointer; color: var(--board-ink); position: relative; overflow: hidden;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.07), rgba(255, 255, 255, 0.02));
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), 0 18px 40px rgba(0, 0, 0, 0.28);
  border: 1px solid var(--board-line); border-radius: 14px;
  padding: 14px 16px 13px; display: grid; grid-template-columns: auto 1fr; column-gap: 14px; align-items: center;
  transition: transform 0.12s ease, background 0.12s ease, border-color 0.12s ease;
}
.tile:hover { background: rgba(255, 255, 255, 0.09); transform: translateY(-1px); }
.tile::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 3px; opacity: 0.9; }
.tile.takeable::before { background: linear-gradient(90deg, transparent, #5fd78f, transparent); }
.tile.check::before { background: linear-gradient(90deg, transparent, var(--amber), transparent); }
.tile.no::before { background: linear-gradient(90deg, transparent, #ff7d84, transparent); }
.tile .num { text-shadow: 0 0 24px currentColor; }
.tile .num { grid-row: span 2; font-family: var(--mono); font-weight: 700; font-size: 40px; line-height: 1; }
.tile .label { font-weight: 700; font-size: 14px; letter-spacing: 0.06em; text-transform: uppercase; }
.tile .sub { font-size: 13px; color: var(--board-muted); }
.tile.takeable .num, .tile.takeable .label { color: #5fd78f; }
.tile.check .num, .tile.check .label { color: var(--amber); }
.tile.no .num, .tile.no .label { color: #ff7d84; }
.tile[aria-pressed="true"] { background: rgba(255, 255, 255, 0.13); }
.tile.takeable[aria-pressed="true"] { border-color: #5fd78f; box-shadow: 0 0 0 2px #5fd78f; }
.tile.check[aria-pressed="true"] { border-color: var(--amber); box-shadow: 0 0 0 2px var(--amber); }
.tile.no[aria-pressed="true"] { border-color: #ff7d84; box-shadow: 0 0 0 2px #ff7d84; }
.tile[aria-pressed="true"] .sub::after { content: " · showing only these"; color: var(--board-ink); }
.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: #d9dfea; }
.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: 22px 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; }
/* school, campus, level and source under the search box (core/section-filters.js) */
.sec-filters { flex: 1 1 100%; }
.sec-filters-box { border: 1px solid var(--line); border-radius: 14px; background: var(--surface); padding: 0 14px; }
.sec-filters-box > summary { min-height: 40px; display: flex; align-items: center; cursor: pointer; font-weight: 650; font-size: 14px; list-style: none; }
.sec-filters-box > summary::-webkit-details-marker { display: none; }
.sec-filters-box > summary::after { content: "▾"; margin-inline-start: auto; color: var(--muted); }
.sec-filters-box[open] > summary::after { content: "▴"; }
.sec-filters-box > summary:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.sec-filters-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 10px 14px; padding: 2px 0 8px; }
.sec-filter { display: grid; gap: 4px; font-size: 12.5px; font-weight: 650; color: var(--muted); }
.sec-filter select {
  width: 100%; min-height: 40px; padding: 0 10px; font: inherit; font-size: 14px; font-weight: 500; color: var(--ink);
  background: var(--surface); border: 1px solid var(--line); border-radius: 10px;
}
.sec-filter select:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.sec-filters-note { margin: 0 0 10px; font-size: 12px; color: var(--muted); }
@media (pointer: coarse) { .sec-filter select { min-height: 44px; } }
.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: 10px; }

.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 transparent; transition: border-color 0.12s ease, transform 0.12s ease;
}
.card::before {
  content: ""; position: absolute; left: 0; top: 10px; bottom: 10px; width: 4px; border-radius: 0 4px 4px 0;
}
.card.takeable::before { background: var(--ok-solid); }
.card.check::before { background: var(--check-solid); }
.card.no::before { background: var(--no-solid); }
.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: 12.5px; color: var(--muted); }
.code {
  font-family: var(--mono); font-size: 12.5px; font-weight: 700; color: var(--ink);
  background: var(--surface-2); border: 1px solid var(--line); border-radius: 6px; padding: 1px 7px; white-space: nowrap;
}
.title { font-weight: 650; font-size: 15.5px; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.meta .sec { font-family: var(--mono); font-size: 12px; color: var(--muted); }
.why { display: flex; gap: 7px; align-items: baseline; font-size: 13.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); }

.when { display: grid; gap: 5px; min-width: 0; }
.when-text { font-size: 12.5px; min-width: 0; }
.when-text .local { font-family: var(--mono); font-weight: 700; color: var(--ink); }
.ny-line { font-size: 12px; color: var(--muted); }

.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: 12.5px; font-weight: 700; white-space: nowrap; letter-spacing: 0.01em;
}
.chip.takeable { color: var(--ok); background: var(--ok-bg); }
.chip.check { color: var(--check); background: var(--check-bg); }
.chip.no { color: var(--no); background: var(--no-bg); }

.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: #d99a06; }
.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 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(--amber); 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(--board); 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-solid); 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-solid); border-color: var(--ok-solid); 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; } .tile, .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: 760px) {
  .worldmap { display: none; }
}
@media (max-width: 640px) {
  .board-inner { padding: 18px 16px 20px; }
  .clock { min-width: 0; padding: 6px 10px; }
  .clock .time { font-size: 16px; }
  .board h1 { margin-top: 22px; }
  .scoreboard { gap: 8px; }
  .tile { grid-template-columns: 1fr; padding: 12px; }
  .tile .num { grid-row: auto; font-size: 30px; }
  .tile .label { font-size: 11.5px; }
  .tile .sub { display: none; }
  .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: 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(--board); 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;
}
.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(420px, 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(--amber); 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(255, 255, 255, 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(255, 255, 255, 0.12); }
.chat-head .icon-btn { background: rgba(255, 255, 255, 0.08); color: var(--board-ink); }
.chat-head .icon-btn:hover { background: rgba(255, 255, 255, 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: 140px;
  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(--board); }
.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) {
  .chat { border-left-color: rgba(255, 255, 255, 0.08); box-shadow: -14px 0 44px rgba(0, 0, 0, 0.5); }
  .chat-msg.assistant .chat-bubble, .chat-starter, .chat-notice, .chat-composer textarea, .chat-add { border-color: rgba(255, 255, 255, 0.08); }
  .chat-chip, .chat-bubble code { border-color: rgba(255, 255, 255, 0.14); }
  .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: 16px; bottom: calc(env(safe-area-inset-bottom, 0px) + 86px); z-index: 14; }
  .footer { padding-bottom: 170px; }
}
@media (max-width: 640px) {
  .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) ---------- */
.record-row { margin: 4px 0 0; }
.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(255, 255, 255, 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(--amber); }
.record-pill:hover { background: rgba(255, 255, 255, 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; }

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(--amber); 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(255, 255, 255, 0.08); color: var(--board-ink); }
.record-head .icon-btn:hover { background: rgba(255, 255, 255, 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); }
.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(--board); }
.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) {
  dialog.record, .record-list, .record-drop, #recordText, #albertText, .record-add input, .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(--board); 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); }
@media (max-width: 640px) {
  .chat-proposal-actions button, .chat-suggestions button, .chat-undo button { 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 .record-row, body.sharing .about-row, body.sharing .foryou, 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 pill beside "Your record", the dialog, and the block in a section's detail panel */
.record-row { display: flex; flex-wrap: wrap; gap: 8px; }
.record-pill.prereq-pill, .record-pill.albert-pill { border-style: solid; border-color: var(--board-line); }
.record-pill.prereq-pill::before { content: "→"; font-size: 14px; }
.record-pill.albert-pill::before { content: "↓"; font-size: 14px; }
.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; }
.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) {
  .prereq-group, .prereq-sec, .prereq-prompt, .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(255, 255, 255, 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(--amber); }
.busy-pill:hover:not(:disabled) { background: rgba(255, 255, 255, 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(--amber); }
.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(255, 255, 255, 0.16); }
.gap-field { font-size: 13.5px; color: var(--board-muted); white-space: nowrap; }
.gap-field select { font-size: 13.5px; }
.busy-form, .about-form {
  display: grid; gap: 12px; margin-top: 10px; max-width: 620px; padding: 14px 16px;
  background: rgba(255, 255, 255, 0.05); border: 1px solid var(--board-line); border-radius: 14px; font-size: 14px; color: #d9dfea;
}
.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(255, 255, 255, 0.04);
}
.daychip input:checked + span { background: var(--amber); border-color: var(--amber); color: var(--board); }
.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(--board); }
.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(255, 255, 255, 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(--amber); 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(255, 255, 255, 0.08); color: var(--board-ink); }
.compare-head .icon-btn:hover { background: rgba(255, 255, 255, 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) {
  dialog.compare, .plan { border-color: rgba(255, 255, 255, 0.1); }
  .busy-form, .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"] .board-top { gap:10px; }
  html[lang="zh-CN"] .clocks { flex-wrap:wrap; }
  html[lang="zh-CN"] .tile .label { white-space:normal; }
  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; }
.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 RMP ↗", 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; }
.rmp {
  font-size: 11px; font-weight: 700; white-space: nowrap; text-decoration: none; color: var(--accent);
  border: 1px solid color-mix(in srgb, var(--accent) 35%, transparent); border-radius: 999px; padding: 0 7px; margin-left: 3px;
}
.rmp:hover { background: color-mix(in srgb, var(--accent) 12%, transparent); }
.rmp:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.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; }
.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(255, 255, 255, 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(--amber); }
.about-hint { margin: -6px 0 0; font-size: 12.5px; color: var(--board-muted); }

/* ---------- Recommended for your requirements: above the list ---------- */
.foryou { margin-top: 14px; padding: 0; overflow: hidden; }
.foryou[hidden], .foryou-body[hidden] { display: none; }
.foryou-head { display: flex; align-items: center; gap: 12px; padding: 14px 18px 12px; background: var(--board); color: var(--board-ink); }
.foryou-head > div { flex: 1; min-width: 0; }
.foryou-head .kicker { display: block; font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--amber); font-weight: 700; }
.foryou-head h2 { margin: 1px 0 0; font-family: var(--display); font-size: 17px; line-height: 1.25; font-weight: 700; }
.foryou-toggle {
  flex: none; padding: 5px 13px; font: inherit; font-size: 13px; font-weight: 650; cursor: pointer;
  color: var(--board-ink); background: transparent; border: 1px solid var(--board-line); border-radius: 999px;
}
.foryou-toggle:hover { background: rgba(255, 255, 255, 0.08); border-color: rgba(245, 181, 68, 0.6); }
.foryou-body { padding: 4px 18px 16px; max-height: min(540px, 70vh); overflow-y: auto; overscroll-behavior: contain; }
.foryou-body > .muted { margin: 12px 0 0; }
.foryou-reqs { list-style: none; margin: 0; padding: 0; }
.foryou-req { padding: 13px 0; border-bottom: 1px dashed var(--line); }
.foryou-req:last-child { border-bottom: none; }
.foryou-req-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 2px 12px; }
.foryou-req-head strong { min-width: 0; font-family: var(--display); font-size: 15px; overflow-wrap: anywhere; }
.foryou-need { font-family: var(--mono); font-size: 12px; font-weight: 600; color: var(--muted); white-space: nowrap; }
.foryou-note { margin: 6px 0 0; font-size: 13.5px; outline: none; overflow-wrap: anywhere; }
.foryou-note.met { color: var(--ok); font-weight: 600; }
.foryou-note.none { color: var(--muted); }
.foryou-picks { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 8px; }
.foryou-pick {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 5px 12px; align-items: start;
  padding: 10px 12px; background: var(--surface-2); border-radius: 12px;
}
.foryou-pick > :not(.foryou-add) { grid-column: 1; }
.foryou-main { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 8px; min-width: 0; }
.foryou-title { min-width: 0; font-weight: 600; font-size: 14px; overflow-wrap: anywhere; }
.foryou-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; font-size: 12.5px; }
.foryou-meta .chip { font-size: 11.5px; padding: 2px 8px; }
.foryou-reasons { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 4px 6px; }
.foryou-reasons li { padding: 2px 9px; font-size: 11.5px; font-weight: 600; color: var(--ink); background: var(--track); border-radius: 999px; }
.foryou-reasons li.warn { color: var(--no); background: var(--no-bg); }
.foryou-why { margin: 0; font-size: 12.5px; color: var(--check); }
.foryou-add { grid-column: 2; grid-row: 1 / span 2; align-self: center; width: auto; padding: 7px 14px; font-size: 13px; white-space: nowrap; }
.foryou-foot { padding-top: 12px; }
.foryou-foot .compare-open { margin-top: 0; }
.foryou-foot p { margin: 0; }
@media (max-width: 560px) {
  .foryou-head { padding: 12px 14px 10px; }
  .foryou-body { padding: 2px 14px 14px; }
  .foryou-pick { grid-template-columns: minmax(0, 1fr); }
  .foryou-add { grid-column: 1; grid-row: auto; justify-self: start; }
}

/* ---------- 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; }
.inst.scored .rmp-score { margin-left: 0; }
.rmp-score {
  display: inline-block; max-width: 100%; margin-left: 3px; padding: 1px 8px; border-radius: 10px; font-size: 11.5px; line-height: 1.45; text-decoration: none; color: var(--accent);
  border: 1px solid color-mix(in srgb, var(--accent) 35%, transparent);
}
.rmp-score:hover { background: color-mix(in srgb, var(--accent) 12%, transparent); }
.rmp-score:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.rmp-parts > span + span::before { content: " · "; white-space: pre; }
.rmp-main { font-weight: 700; }
.rmp-score.several, .rmp-score.none, .rmp-score.unrated { color: var(--muted); border-style: dashed; }
.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(--board); 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; }
.board-top { justify-content: flex-end; }
.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(255, 255, 255, 0.05); border: 1px solid var(--board-line);
}
.topbar-btn:hover { background: rgba(255, 255, 255, 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(--amber); }
.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(--board); font: 800 12.5px/1 var(--mono);
}
.cart-badge[data-count="0"] { background: rgba(255, 255, 255, 0.16); color: var(--board-muted); }
@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; }
  .record-pill.cart-pill.bump { animation: cart-bump 0.35s ease; }
  .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; }
  .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); }
}

/* The home entry: amber, the first thing in the row of pills */
.record-pill.cart-pill { background: var(--amber); color: var(--board); border: 1px solid var(--amber); min-height: 42px; padding: 4px 18px 4px 14px; font-size: 14.5px; font-weight: 750; box-shadow: 0 4px 16px rgba(245, 181, 68, 0.22); }
.record-pill.cart-pill::before { content: none; }
.record-pill.cart-pill:hover { background: var(--amber); filter: brightness(1.07); }
@media (max-width: 560px) { .record-pill.cart-pill { flex: 1 1 100%; justify-content: center; } }

/* 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(--amber); }
.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) {
  .cart-add:not(.added) { background: var(--amber); border-color: var(--amber); color: var(--board); }
  .cart-add:not(.added) svg { color: var(--board); }
  .cart-add:not(.added):hover { background: var(--amber); filter: brightness(1.07); }
}
body.sharing [data-action="cart-add"] { display: none; }

/* The toast under the top bar */
.cart-toast {
  position: fixed; z-index: 40; top: 70px; right: 20px; max-width: min(480px, calc(100vw - 24px));
  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; }
.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(255, 255, 255, 0.1); border: 1px solid var(--board-line);
}
.cart-toast-btn:hover { background: rgba(255, 255, 255, 0.18); }
.cart-toast-btn.primary-action { background: var(--amber); color: var(--board); 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(255, 255, 255, 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; }
body.cart-open .board, body.cart-open .banner, body.cart-open .shared-bar, body.cart-open .layout, body.cart-open .footer { display: none; }
@media (max-width: 900px) { body.cart-open .chat-launcher { 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-solid); 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 { 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; }
.cart-item-credits { font-family: var(--mono); font-size: 13px; }
.cart-remove { margin-left: auto; 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-item.missing .cart-item-head { padding-right: 0; }
.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(--board); }
.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-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line); }
.auth-tabs button { min-height: 40px; border: none; border-radius: 9px; background: transparent; color: var(--muted); font-weight: 650; cursor: pointer; }
.auth-tabs button[aria-pressed="true"] { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }
.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 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-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) { dialog.account { border-color: rgba(255, 255, 255, 0.1); } }
@media (min-width: 901px) { body.cart-open .chat-launcher { bottom: 104px; } } /* above the cart's total bar, not over its button */
@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; } }
/* ---------- One-click timetable (schedule-ui.js) ---------- */
dialog.compare.schedule { width: min(1180px, calc(100vw - 24px)); }
.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; }
.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: 64px; 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; }
@media (prefers-color-scheme: dark) {
  .tt-block { background: hsl(var(--h) 35% 24%); border-left-color: hsl(var(--h) 55% 62%); }
  .tt-block.clash { border-left-color: var(--no-solid); background-color: color-mix(in srgb, var(--no-solid) 24%, hsl(var(--h) 35% 24%)); }
  .tt-key i { background: hsl(var(--h) 55% 60%); }
  .tt-agenda ol li { background: hsl(var(--h) 30% 20%); border-left-color: hsl(var(--h) 55% 62%); }
  .tt-grid, .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: 28px; 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; }
}
@media (max-width: 560px) {
  dialog.compare.schedule { width: 100vw; max-width: 100vw; max-height: 100dvh; height: 100dvh; border-radius: 0; border: none; }
  .tt-heads { top: 60px; }
}
/* ---------- 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) {
  .chat-add-menu, .chat-file-card, .chat-file-thumb { border-color: rgba(255, 255, 255, 0.1); }
  .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(--board); 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(--board); 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; }
body.cart-open .picks-view { display: none; } /* the cart opened from the picks page sits above it; Back returns here */
/* ---------- 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; }
body.cart-open .plan-view { display: none; }
@media (max-width: 900px) { body.plan-open .chat-launcher { bottom: calc(env(safe-area-inset-bottom, 0px) + 16px); } }
.plan-pill { background: var(--amber); color: #1b1404; border-color: transparent; font-weight: 700; }
.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); }
.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-solid); 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-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); }
.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-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.private { color: #6d28d9; background: color-mix(in srgb, #7c3aed 13%, transparent); }
.pick-tag.variation { color: var(--accent); 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: var(--accent); background: color-mix(in srgb, var(--accent) 13%, transparent);
}
.pick-chip:hover { background: color-mix(in srgb, var(--accent) 22%, transparent); }
@media (pointer: coarse) { .pick-chip { min-height: 36px; padding: 6px 12px; } }
.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; }
.picks-conditional { margin-top: 28px; padding: 14px 16px; border-radius: 14px; border: 1px dashed var(--check); background: var(--surface); }
.picks-conditional h3 { margin: 0 0 4px; font-family: var(--display); font-size: 16px; }
.picks-conditional > 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; }
}
