@font-face { font-family: "Instrument Sans"; src: url(fonts/InstrumentSans.woff2) format("woff2"); font-weight: 400 700; font-display: swap; }
@font-face { font-family: "JetBrains Mono"; src: url(fonts/JetBrainsMono.woff2) format("woff2"); font-weight: 400 700; font-display: swap; }

:root {
  --sans: "Instrument Sans", "Helvetica Neue", Arial, sans-serif;
  --mono: "JetBrains Mono", "Cascadia Code", Consolas, monospace;
  --bg: #f6f6f3;
  --surface: #ffffff;
  --surface-2: #f0efeb;
  --text: #1d1d1b;
  --muted: #6c6b66;
  --line: #e2e0da;
  --accent: #2f5bd3;
  --ok: #1f8a4c;
  --bad: #c2372d;
  --warn: #b7791f;
  --k-core: #5b6474;
  --k-compulsory: #2f5bd3;
  --k-elective: #1f8a4c;
  --k-masters: #7a4cc2;
  --k-breadth: #c26a1b;
  --k-flex: #8a8678;
  --k-fy: #3b8f9a;
  --k-prep: #8a8678;
  --k-none: #a5a399;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(0,0,0,.05), 0 2px 8px rgba(0,0,0,.04);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #141414; --surface: #1d1d1c; --surface-2: #262624; --text: #ecebe6; --muted: #9b9a93; --line: #33322f;
    --accent: #7c9cff; --ok: #4cc27f; --bad: #ff6b5e; --warn: #e3a948;
    --k-core: #9aa3b3; --k-compulsory: #7c9cff; --k-elective: #4cc27f; --k-masters: #b48cff; --k-breadth: #f0a050;
    --k-flex: #a8a597; --k-fy: #5fc0cc; --k-none: #6f6d66;
    --shadow: none; color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #141414; --surface: #1d1d1c; --surface-2: #262624; --text: #ecebe6; --muted: #9b9a93; --line: #33322f;
  --accent: #7c9cff; --ok: #4cc27f; --bad: #ff6b5e; --warn: #e3a948;
  --k-core: #9aa3b3; --k-compulsory: #7c9cff; --k-elective: #4cc27f; --k-masters: #b48cff; --k-breadth: #f0a050;
  --k-flex: #a8a597; --k-fy: #5fc0cc; --k-none: #6f6d66;
  --shadow: none; color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg); color: var(--text);
  font: 14px/1.45 var(--sans);
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--accent); }
h1, h2, h3 { margin: 0; line-height: 1.2; }
h2 { font-size: 16px; }
h3 { font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 600; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.pad { padding: 8px 4px; }
.nowrap { white-space: nowrap; }
.code { font-family: var(--mono); font-weight: 600; letter-spacing: -.01em; font-size: .96em; }

/* header */
.top {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
  padding: 10px 20px; background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(8px); border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: baseline; gap: 8px; }
.brand h1 { font-size: 17px; }
.sub { color: var(--muted); font-size: 12px; }
.field-switch, .tabs { display: flex; background: var(--surface-2); border-radius: 8px; padding: 3px; gap: 2px; }
.field-switch button, .tabs button {
  border: 0; background: none; padding: 5px 11px; border-radius: 6px; color: var(--muted); font-weight: 500;
}
.field-switch button.active, .tabs button.active { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }
.tools { margin-left: auto; display: flex; align-items: center; gap: 8px; position: relative; }
.save-status { font-size: 12px; color: var(--muted); }
.ghost { border: 0; background: none; padding: 4px 8px; border-radius: 6px; }
.ghost:hover { background: var(--surface-2); }
.menu {
  position: absolute; right: 0; top: 34px; background: var(--surface); border: 1px solid var(--line);
  border-radius: 8px; box-shadow: 0 8px 24px rgba(0,0,0,.12); padding: 4px; min-width: 210px; z-index: 30;
}
.menu button { display: block; width: 100%; text-align: left; border: 0; background: none; padding: 7px 10px; border-radius: 6px; }
.menu button:hover { background: var(--surface-2); }

main { padding: 16px 20px 60px; }
.tab { display: none; }
.tab.active { display: block; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; box-shadow: var(--shadow); }

/* plan layout */
.plan-layout { display: grid; grid-template-columns: minmax(0, 1fr) clamp(340px, 27vw, 480px); gap: 16px; align-items: start; }
.side { position: sticky; top: 66px; display: flex; flex-direction: column; gap: 12px; max-height: calc(100vh - 80px); }
.grid { display: flex; flex-direction: column; gap: 14px; }
.year { display: grid; grid-template-columns: 56px minmax(0, 1fr); gap: 10px; }
.year-label { display: flex; flex-direction: column; padding-top: 8px; font-weight: 600; font-size: 13px; }
.year-label .muted { font-weight: 400; font-size: 12px; }
.year-sems { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, .62fr); gap: 10px; }

.sem {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 8px; display: flex; flex-direction: column; gap: 6px; min-height: 120px; transition: border-color .12s, background .12s;
}
.sem.summer { background: var(--surface-2); border-style: dashed; }
.sem.done { opacity: .72; }
.sem.drop { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 7%, var(--surface)); }
.sem-head { display: flex; justify-content: space-between; align-items: center; gap: 6px; padding: 0 2px; font-size: 13px; }
.sem-tools { display: flex; align-items: center; gap: 8px; }
.units { font-variant-numeric: tabular-nums; font-size: 12px; color: var(--muted); }
.units.full { color: var(--ok); }
.units.over { color: var(--warn); font-weight: 600; }
.done-toggle { font-size: 11px; color: var(--muted); display: flex; align-items: center; gap: 3px; cursor: pointer; }
.done-toggle input { margin: 0; }
.sem-body { display: flex; flex-direction: column; gap: 6px; flex: 1; }
.slot {
  border: 1px dashed var(--line); border-radius: 8px; color: var(--muted); font-size: 12px;
  padding: 10px; text-align: center;
}
.add input {
  width: 100%; border: 1px solid transparent; background: transparent; padding: 4px 6px; border-radius: 6px; font-size: 12px; color: var(--muted);
}
.add input:focus { outline: none; border-color: var(--line); background: var(--surface); color: var(--text); }

.card {
  position: relative; background: var(--surface); border: 1px solid var(--line); border-left: 3px solid var(--kc, var(--k-none));
  border-radius: 8px; padding: 6px 8px; cursor: grab; display: flex; flex-direction: column; gap: 2px;
}
.card:hover { border-color: color-mix(in srgb, var(--kc) 60%, var(--line)); border-left-color: var(--kc); }
.card:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.card.dragging { opacity: .4; }
.card.lifted { display: none; }
.gap {
  flex: none; box-sizing: border-box; border: 2px dashed var(--accent); border-radius: 8px;
  background: color-mix(in srgb, var(--accent) 10%, transparent); pointer-events: none;
}
.card.bad { box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--bad) 45%, transparent); }
.card-top { display: flex; align-items: center; gap: 6px; }
.card-top .offered { margin-left: auto; display: flex; gap: 2px; }
.card .name { font-size: 12.5px; line-height: 1.3; }
.card-foot { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-top: 2px; }
.u { font-size: 11px; color: var(--muted); }
.issues { margin-top: 3px; }
.iss { font-size: 11.5px; line-height: 1.3; padding: 2px 0; }
.iss.bad { color: var(--bad); }
.iss.warn { color: var(--warn); }

.k-core { --kc: var(--k-core); }
.k-compulsory { --kc: var(--k-compulsory); }
.k-elective { --kc: var(--k-elective); }
.k-masters { --kc: var(--k-masters); }
.k-breadth { --kc: var(--k-breadth); }
.k-flex { --kc: var(--k-flex); }
.k-fy { --kc: var(--k-fy); }
.k-prep { --kc: var(--k-prep); }
.k-none { --kc: var(--k-none); }
.pill {
  display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: 11.5px; font-weight: 500;
  color: var(--kc); background: color-mix(in srgb, var(--kc) 13%, transparent); white-space: nowrap;
}
.pill.sm { font-size: 10.5px; padding: 0 6px; }
.sem-dot {
  font-size: 10.5px; font-weight: 600; padding: 1px 4px; border-radius: 4px; line-height: 1.3; color: var(--muted); opacity: .35;
  border: 1px solid var(--line);
}
.sem-dot.on { opacity: 1; color: var(--text); background: var(--surface-2); }
.ext { font-size: 11px; text-decoration: none; color: var(--muted); }
.ext:hover { color: var(--accent); text-decoration: underline; }

/* requirements */
#reqPanel { display: flex; flex-direction: column; gap: 10px; }
.total { display: flex; justify-content: space-between; align-items: baseline; }
.big { font-size: 26px; font-weight: 700; font-variant-numeric: tabular-nums; }
.bar { position: relative; height: 6px; background: var(--surface-2); border-radius: 99px; overflow: hidden; }
.fill { height: 100%; background: var(--warn); border-radius: 99px; transition: width .2s; }
.fill.ok { background: var(--ok); }
.tick { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--muted); opacity: .5; }
.req-list { display: flex; flex-direction: column; gap: 8px; }
.req-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 3px; }
.req-n { font-variant-numeric: tabular-nums; font-size: 12.5px; font-weight: 600; color: var(--warn); }
.req-n.ok { color: var(--ok); }
.missing { display: flex; flex-wrap: wrap; gap: 5px; align-items: center; }
.missing h3 { width: 100%; }
.chip {
  border: 1px solid var(--line); background: var(--surface); border-radius: 6px; padding: 1px 7px;
  font: 600 11.5px var(--mono); color: var(--kc, var(--text));
}
.chip.ok { color: var(--ok); border-color: color-mix(in srgb, var(--ok) 40%, var(--line)); }
.chip.no { color: var(--bad); border-color: color-mix(in srgb, var(--bad) 40%, var(--line)); }
.rules summary { cursor: pointer; color: var(--muted); font-size: 12px; }
.rules p { font-size: 12px; color: var(--muted); }

/* catalogue */
.catalogue { display: flex; flex-direction: column; min-height: 0; flex: 1; padding: 10px; }
.cat-head { display: flex; flex-direction: column; gap: 6px; margin-bottom: 6px; }
.cat-head input, .cat-head select, .summer-filters input[type=search] {
  width: 100%; padding: 6px 9px; border: 1px solid var(--line); border-radius: 7px; background: var(--surface);
}
.cat-list { overflow-y: auto; min-height: 160px; }
.cat-group { margin-bottom: 10px; }
.cat-group h3 { position: sticky; top: 0; background: var(--surface); padding: 4px 2px; z-index: 1; }
.cat-item { padding: 5px 6px; border-radius: 6px; cursor: grab; display: flex; flex-direction: column; gap: 2px; }
.cat-item:hover { background: var(--surface-2); }
.cat-item.placed .ci-main { opacity: .55; }
.ci-main { font-size: 12.5px; line-height: 1.3; }
.ci-meta { display: flex; gap: 2px; align-items: center; }
.where { margin-left: auto; font-size: 11px; color: var(--ok); font-weight: 500; }

/* summer */
.summer-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; margin-bottom: 8px; }
.summer-head p { margin: 4px 0 0; max-width: 70ch; }
.summer-filters { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; font-size: 13px; }
.summer-filters input[type=search] { width: 200px; }
.sum-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; }
.sum-card {
  border: 1px solid var(--line); border-left: 3px solid var(--kc, var(--line)); border-radius: 8px; padding: 8px 10px;
  display: flex; flex-direction: column; gap: 3px; cursor: pointer; background: var(--surface);
}
.sum-card:hover { background: var(--surface-2); }
.ok-t { color: var(--muted); }
.bad-t { color: var(--bad); }
.mini {
  border: 1px solid var(--line); background: var(--surface); border-radius: 6px; padding: 2px 8px; font-size: 12px;
}
.mini:hover { border-color: var(--accent); color: var(--accent); }
.mini.danger:hover { border-color: var(--bad); color: var(--bad); }
.sum-card .mini { margin-left: auto; }

/* compare */
.cmp-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 12px; margin-bottom: 12px; }
.cmp-card.current { border-color: var(--accent); }
.cmp-card h3 { color: var(--text); text-transform: none; letter-spacing: 0; font-size: 15px; display: flex; gap: 6px; align-items: center; }
.facts { padding-left: 18px; margin: 8px 0; }
.facts li { margin: 3px 0; }
.notes-panel { margin-bottom: 12px; }
.notes-panel ul { margin: 8px 0 0; padding-left: 18px; }
.notes-panel li { margin: 5px 0; max-width: 100ch; }
.table-wrap { overflow-x: auto; }
table.cmp { width: 100%; border-collapse: collapse; font-size: 13px; }
.cmp th { text-align: left; font-size: 12px; color: var(--muted); font-weight: 600; padding: 6px 8px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: var(--surface); }
.cmp td { padding: 5px 8px; border-bottom: 1px solid var(--line); }
.cmp tbody tr { cursor: pointer; }
.cmp tbody tr:hover { background: var(--surface-2); }

/* drawer */
.drawer { position: fixed; inset: 0; z-index: 50; visibility: hidden; transition: visibility 0s .3s; }
.drawer.open { visibility: visible; transition-delay: 0s; }
.drawer-scrim { position: absolute; inset: 0; background: rgba(0,0,0,.34); opacity: 0; transition: opacity .25s ease; }
.drawer.open .drawer-scrim { opacity: 1; }
.drawer-body {
  position: absolute; right: 0; top: 0; bottom: 0; width: min(540px, 100%); background: var(--surface);
  border-left: 1px solid var(--line); padding: 26px 28px 48px; overflow-y: auto;
  transform: translateX(100%); transition: transform .3s cubic-bezier(.22, 1, .36, 1);
  box-shadow: -12px 0 40px rgba(0,0,0,.14);
}
.drawer.open .drawer-body { transform: none; }
.drawer .close { position: absolute; right: 16px; top: 16px; }
#drawerContent.swap > * { animation: rise .32s cubic-bezier(.22, 1, .36, 1) both; }
#drawerContent.swap > :nth-child(n+4) { animation-delay: .04s; }
#drawerContent.swap > :nth-child(n+6) { animation-delay: .08s; }
#drawerContent.swap > :nth-child(n+8) { animation-delay: .12s; }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } }
@media (prefers-reduced-motion: reduce) {
  .drawer-body, .drawer-scrim { transition: none; }
  #drawerContent.swap > * { animation: none; }
}
.d-eyebrow { display: flex; align-items: center; gap: 10px; padding-right: 40px; }
.code.big { font-size: 22px; }
.d-title { font-size: 19px; font-weight: 600; margin: 6px 0 8px; line-height: 1.25; }
.d-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 10px; color: var(--muted); font-size: 13px; }
.d-meta > span + span::before { content: "·"; margin-right: 10px; opacity: .6; }
.d-dots { display: inline-flex; gap: 3px; align-items: center; }
.d-dots::before { display: none; }
.summary { margin: 16px 0 0; line-height: 1.6; max-width: 60ch; }
.d-links { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 18px; }
.btn {
  display: inline-flex; align-items: center; padding: 8px 14px; border-radius: 8px; border: 1px solid var(--line);
  background: var(--surface); color: var(--text); text-decoration: none; font-weight: 500; font-size: 13px;
  transition: border-color .12s, background .12s;
}
.btn:hover { border-color: var(--accent); color: var(--accent); }
.btn:first-child { background: var(--accent); border-color: var(--accent); color: #fff; }
:root[data-theme="dark"] .btn:first-child { color: #10131c; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .btn:first-child { color: #10131c; } }
.btn:first-child:hover { filter: brightness(1.08); }
.d-sec { margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 10px; }
.d-sec h3 { margin-bottom: 2px; }
.h-note { text-transform: none; letter-spacing: 0; font-weight: 400; margin-left: 6px; opacity: .8; }
.d-row { display: grid; grid-template-columns: 112px minmax(0, 1fr); gap: 12px; align-items: baseline; }
.d-label { color: var(--muted); font-size: 12.5px; }
.d-val { font-size: 13px; line-height: 1.9; }
.d-sec .d-val .chip { margin: 0 1px; }
.d-place { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.d-place select { flex: 1; min-width: 200px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); }
.btn-quiet { padding: 8px 14px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface); font-size: 13px; font-weight: 500; }
.btn-quiet.danger:hover { border-color: var(--bad); color: var(--bad); }
.d-sec .iss { font-size: 12.5px; }
.d-roles { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 8px; }
.d-role { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; }
.d-role.cur { border-color: color-mix(in srgb, var(--accent) 55%, var(--line)); background: color-mix(in srgb, var(--accent) 6%, transparent); }
.yrs { display: inline-flex; gap: 6px; flex-wrap: wrap; margin-right: 10px; vertical-align: middle; }
.yr { font: 500 12px var(--mono); padding: 2px 8px; border-radius: 6px; border: 1px solid var(--line); color: var(--muted); text-decoration: none; line-height: 1.5; }
a.yr { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 35%, var(--line)); }
a.yr:hover { background: color-mix(in srgb, var(--accent) 10%, transparent); }
textarea { width: 100%; border: 1px solid var(--line); border-radius: 8px; padding: 10px; background: var(--surface); resize: vertical; line-height: 1.5; }
textarea:focus, select:focus-visible, input[type=search]:focus { outline: 2px solid color-mix(in srgb, var(--accent) 55%, transparent); outline-offset: 0; }

/* header pieces */
.field-pick { display: flex; align-items: center; gap: 8px; }
.locked {
  display: inline-flex; align-items: center; gap: 6px; padding: 5px 11px; border-radius: 8px; border: 1px solid var(--line);
  color: var(--muted); font-weight: 500; cursor: default; white-space: nowrap;
}
.pick-label { font-size: 12px; color: var(--muted); margin-left: 4px; }
.ghost.icon { width: 30px; height: 30px; padding: 0; display: inline-grid; place-items: center; color: var(--muted); }
.ghost.icon:hover { color: var(--text); }
.tab-intro { margin: 0 0 12px; color: var(--muted); max-width: 80ch; }
.legend { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 16px; margin: 0 0 12px 66px; font-size: 12.5px; color: var(--muted); }
.lg { display: inline-flex; align-items: center; gap: 6px; }
.lg::before { content: ""; width: 10px; height: 10px; border-radius: 3px; background: var(--kc); }
.lg-hint { display: inline-flex; align-items: center; gap: 3px; margin-left: auto; }
.lg-hint .sem-dot:last-of-type { margin-right: 5px; }
.rule-links { margin: 0; font-size: 12.5px; }

/* remove affordances */
.rm {
  margin-left: auto; border: 0; background: none; color: var(--muted); border-radius: 5px; width: 20px; height: 20px;
  display: grid; place-items: center; font-size: 11px; opacity: 0; transition: opacity .12s, background .12s, color .12s;
}
.card:hover .rm, .card:focus-within .rm { opacity: 1; }
.rm:hover { background: color-mix(in srgb, var(--bad) 14%, transparent); color: var(--bad); }
@media (hover: none) { .rm { opacity: .7; } }
.trash {
  position: absolute; inset: 0; z-index: 5; border-radius: var(--radius); border: 2px dashed var(--muted);
  background: var(--surface-2);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px;
  color: var(--bad); font-weight: 600; opacity: 0; visibility: hidden; pointer-events: none;
  transition: opacity .15s, border-color .15s, background .15s;
}
.trash svg { transition: transform .15s; }
.trash span { color: var(--muted); font-weight: 500; }
body.drag-placed .trash { opacity: 1; visibility: visible; pointer-events: auto; }
.side.drop .trash { border-color: var(--bad); background: color-mix(in srgb, var(--bad) 12%, var(--surface-2)); }
.side.drop .trash svg { transform: scale(1.15); }
.side.drop .trash span { color: var(--bad); }

/* responsive */
@media (max-width: 1100px) {
  .plan-layout { grid-template-columns: 1fr; }
  .side { position: relative; top: auto; max-height: none; }
  .trash { position: fixed; inset: auto 16px 16px 16px; height: 120px; flex-direction: row; box-shadow: 0 8px 30px rgba(0,0,0,.25); }
  .cat-list { max-height: 60vh; }
}
@media (max-width: 760px) {
  .top { padding: 8px 16px; gap: 8px; }
  main { padding: 12px 16px 40px; }
  .year { grid-template-columns: 1fr; }
  .year-label { flex-direction: row; gap: 8px; padding: 0; }
  .year-sems { grid-template-columns: 1fr; }
  .cmp-cards { grid-template-columns: 1fr; }
  .field-pick, .tabs { width: 100%; }
  .field-pick .field-switch { flex: 1; }
  .legend { margin-left: 0; }
  .lg-hint { margin-left: 0; }
  .drawer-body { padding: 22px 16px 40px; }
  .d-row { grid-template-columns: 1fr; gap: 2px; }
  .d-roles { grid-template-columns: 1fr; }
  .field-switch button, .tabs button { flex: 1; padding: 5px 4px; font-size: 13px; }
  .tools { position: absolute; right: 12px; top: 8px; }
}

/* disciplines / general version */
:root { --k-research: #b8457f; }
:root[data-theme="dark"] { --k-research: #f07fb5; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --k-research: #f07fb5; } }
.k-research { --kc: var(--k-research); }
#legendKinds { display: contents; }
#discPick { display: inline-flex; }
.pick-select {
  padding: 6px 10px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface); font-weight: 500; max-width: 100%;
}
.field-switch.as-select { background: none; padding: 0; }
[hidden] { display: none !important; }
.card.cont { cursor: pointer; border-style: dashed; border-left-style: solid; opacity: .8; }
.welcome {
  position: fixed; inset: 0; z-index: 80; display: grid; place-items: center; padding: 16px;
  grid-template-columns: minmax(0, 1fr); overflow-y: auto;
  background: color-mix(in srgb, var(--bg) 78%, transparent); backdrop-filter: blur(6px); animation: fade .25s ease both;
}
.welcome-card {
  width: min(420px, 100%); background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 26px;
  display: flex; flex-direction: column; gap: 14px; box-shadow: 0 20px 60px rgba(0,0,0,.2);
  animation: rise .35s cubic-bezier(.22, 1, .36, 1) both;
}
.welcome-card h2 { font-size: 20px; }
.welcome-card p { margin: 0; line-height: 1.55; }
.welcome-card label { display: flex; flex-direction: column; gap: 6px; font-size: 12.5px; color: var(--muted); }
.welcome-card select, .welcome-card input {
  padding: 9px 10px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface); color: var(--text); font-size: 14px;
}
.welcome-card select, .welcome-card input { width: 100%; min-width: 0; text-overflow: ellipsis; }
@media (max-width: 760px) { .welcome-card { padding: 20px; gap: 12px; } }
.welcome-card button {
  margin-top: 4px; padding: 10px 14px; border-radius: 8px; border: 0; background: var(--accent); color: #fff; font-weight: 600;
}
:root[data-theme="dark"] .welcome-card button { color: #10131c; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .welcome-card button { color: #10131c; } }
.welcome-card button:hover { filter: brightness(1.08); }
@keyframes fade { from { opacity: 0; } }

/* add-course autocomplete */
.ac {
  position: fixed; z-index: 40; background: var(--surface); border: 1px solid var(--line); border-radius: 10px;
  box-shadow: 0 10px 30px rgba(0,0,0,.18); padding: 4px; max-width: calc(100vw - 16px);
}
.ac-item { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 6px; cursor: pointer; font-size: 12.5px; }
.ac-item.on, .ac-item:hover { background: var(--surface-2); }
.ac-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ac-item .where { margin-left: 0; }

/* touch + phones (nothing below applies to a desktop with a mouse) */
.hint-touch { display: none; }
.touch-ghost {
  position: fixed; left: 0; top: 0; z-index: 100; pointer-events: none; margin: 0;
  box-shadow: 0 14px 34px rgba(0,0,0,.35); opacity: .95; will-change: transform;
}
body.touch-dragging { user-select: none; -webkit-user-select: none; }
@media (hover: none) {
  .hint-mouse { display: none; }
  .hint-touch { display: inline; }
  .card, .cat-item { -webkit-touch-callout: none; -webkit-user-select: none; user-select: none; }
  .rm { width: 30px; height: 30px; font-size: 13px; opacity: .7; }
  .card-foot .ext { padding: 6px 4px; }
}
@media (max-width: 760px) {
  .top { position: static; align-items: center; gap: 10px; }
  .brand { order: 0; flex: 1; min-width: 0; }
  .brand .sub { display: none; }
  .tools { order: 1; position: static; margin-left: 0; }
  .field-pick { order: 2; gap: 6px; }
  .tabs { order: 3; }
  .pick-label { display: none; }
  .locked { padding: 5px 9px; }
  .field-switch button, .tabs button { white-space: nowrap; font-size: 12.5px; padding: 6px 4px; }
  .legend { gap: 4px 12px; font-size: 12px; }
  .lg-hint { width: 100%; }
  /* 16px inputs stop iOS zooming the page when a field is focused */
  .add input, .cat-head input, .cat-head select, .summer-filters input[type=search], .d-place select,
  textarea, .pick-select, .welcome-card select, .welcome-card input { font-size: 16px; }
  .add input { border-color: var(--line); padding: 8px; }
  .sem-head { font-size: 14px; }
  .done-toggle { font-size: 12px; padding: 4px 0; }
  .summer-head { flex-direction: column; }
  .summer-filters input[type=search] { width: 100%; }
  .sum-grid { grid-template-columns: 1fr; }
  .cmp td, .cmp th { padding: 5px 6px; }
  .cmp .name { display: block; }
  .drawer-body { width: 100%; border-left: 0; }
  .trash { height: 64px; inset: auto 12px 12px 12px; gap: 12px; }
  .trash svg { width: 26px; height: 26px; }
  .menu { right: 0; }
}
@media (max-width: 760px) { .lg-hint { display: block; line-height: 1.8; } .lg-hint .sem-dot { margin-right: 3px; } }

/* BE(Hons) majors / minors */
:root { --k-major: #7a4cc2; --k-minor: #b0458a; }
:root[data-theme="dark"] { --k-major: #b48cff; --k-minor: #e87fc0; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --k-major: #b48cff; --k-minor: #e87fc0; } }
.k-major { --kc: var(--k-major); }
.k-minor { --kc: var(--k-minor); }
/* phones: keep the discipline + major pickers inside the screen; no blur behind the first-run dialog */
@media (max-width: 760px) {
  #discPick, #discPick .pick-select { min-width: 0; max-width: 42vw; }
  .field-pick .field-switch { min-width: 0; }
  .field-switch button { flex: 1 1 0; min-width: 0; overflow: hidden; text-overflow: ellipsis; padding: 6px 3px; }
  .welcome { backdrop-filter: none; background: color-mix(in srgb, var(--bg) 94%, transparent); align-items: start; }
}
.welcome-card .deg-long { font-size: 12px; color: var(--muted); margin-top: -2px; }
