: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; }
.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; }
.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; }
.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; }
}

/* ---------- Protect my GPA ---------- */
.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[aria-pressed="true"] { background: var(--board); border-color: var(--board); color: var(--board-ink); }
.gpa-toggle[aria-pressed="true"]::before { content: "✓ "; color: var(--amber); }
.gpa-toggle:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.gpa-toggle[hidden] { display: none; }
.filter-note.gpa { flex: 1 1 100%; }
.gpa-note { margin: 2px 0 0; font-size: 13.5px; line-height: 1.45; }
.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; }
.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; }
.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; }
}
