/* ------------------------------------------------------------------ tokens */
:root {
  --gold: #cfb991;
  --gold-strong: #b08d2e;
  --gold-soft: #f4ecdc;
  --bg: #f6f5f2;
  --panel: #ffffff;
  --panel-2: #faf9f6;
  --ink: #1b1b1b;
  --ink-2: #555249;
  --ink-3: #8a857a;
  --line: #e5e1d8;
  --line-2: #d6d0c3;
  --ok: #2f7d4f;
  --ok-soft: #e3f2e8;
  --plan: #2d6cb5;
  --plan-soft: #e3edf9;
  --warn: #a8660b;
  --warn-soft: #fbefd9;
  --err: #b3322b;
  --err-soft: #fbe3e1;
  --ph: #7a5bb0;
  --ph-soft: #efe8fa;
  --grad: #0f6f78;
  --grad-soft: #dff1f2;
  --shadow: 0 1px 2px rgba(0,0,0,.06), 0 2px 8px rgba(0,0,0,.05);
  --radius: 10px;
  --font: "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "Cascadia Mono", Consolas, monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --gold: #cfb991; --gold-strong: #e0c878; --gold-soft: #2f2a1f;
    --bg: #141412; --panel: #1d1c1a; --panel-2: #23221f;
    --ink: #eeebe4; --ink-2: #bdb7ab; --ink-3: #8c8679;
    --line: #34322d; --line-2: #45423b;
    --ok: #6cc28f; --ok-soft: #1c3226; --plan: #7fb0ea; --plan-soft: #1b2a3d;
    --warn: #e5a54a; --warn-soft: #362a17; --err: #f07c74; --err-soft: #3b1f1d;
    --ph: #b69ae6; --ph-soft: #2b2338; --grad: #5fc4cc; --grad-soft: #16302f;
    --shadow: 0 1px 2px rgba(0,0,0,.4);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --gold: #cfb991; --gold-strong: #e0c878; --gold-soft: #2f2a1f;
  --bg: #141412; --panel: #1d1c1a; --panel-2: #23221f;
  --ink: #eeebe4; --ink-2: #bdb7ab; --ink-3: #8c8679;
  --line: #34322d; --line-2: #45423b;
  --ok: #6cc28f; --ok-soft: #1c3226; --plan: #7fb0ea; --plan-soft: #1b2a3d;
  --warn: #e5a54a; --warn-soft: #362a17; --err: #f07c74; --err-soft: #3b1f1d;
  --ph: #b69ae6; --ph-soft: #2b2338; --grad: #5fc4cc; --grad-soft: #16302f;
  --shadow: 0 1px 2px rgba(0,0,0,.4);
  color-scheme: dark;
}

/* ------------------------------------------------------------------ base */
* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 14px/1.45 var(--font); -webkit-font-smoothing: antialiased;
  display: flex; flex-direction: column; overflow: hidden;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
code { font-family: var(--mono); font-size: .92em; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
[hidden] { display: none !important; }

.btn {
  border: 1px solid var(--line-2); background: var(--panel); border-radius: 8px;
  padding: 6px 11px; line-height: 1.2; white-space: nowrap;
}
.btn:hover { border-color: var(--gold-strong); }
.btn.primary { background: var(--ink); color: var(--panel); border-color: var(--ink); }
.btn.primary:hover { background: var(--gold-strong); border-color: var(--gold-strong); color: #000; }
.btn.ghost { background: transparent; }
.btn.icon { padding: 6px 9px; }
.btn.danger { color: var(--err); border-color: var(--err); }
.btn.small { padding: 3px 8px; font-size: 12px; }
input[type="text"], input[type="search"], input[type="number"], select, textarea {
  border: 1px solid var(--line-2); background: var(--panel); border-radius: 8px; padding: 6px 9px; min-width: 0;
}
input:focus, select:focus, textarea:focus, button:focus-visible { outline: 2px solid var(--gold-strong); outline-offset: 1px; }
.check { display: inline-flex; gap: 6px; align-items: center; cursor: pointer; }

/* ------------------------------------------------------------------ top bar */
.topbar {
  display: flex; align-items: center; gap: 14px; padding: 8px 14px; flex-wrap: wrap;
  background: var(--panel); border-bottom: 3px solid var(--gold); box-shadow: var(--shadow); z-index: 5;
}
.brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.logo {
  width: 32px; height: 32px; border-radius: 8px; background: var(--gold); color: #000;
  display: grid; place-items: center; font-weight: 800; font-size: 18px; flex: none;
}
.brand-name { font-weight: 700; letter-spacing: .2px; }
.brand-sub { color: var(--ink-3); font-size: 11.5px; }
.plan-picker { display: flex; gap: 6px; align-items: center; }
.plan-picker select { max-width: 220px; font-weight: 600; }
.actions { display: flex; gap: 6px; align-items: center; margin-left: auto; flex-wrap: wrap; }
.menu-wrap { position: relative; }
.menu {
  position: absolute; right: 0; top: calc(100% + 4px); background: var(--panel); border: 1px solid var(--line-2);
  border-radius: 10px; box-shadow: 0 8px 24px rgba(0,0,0,.18); padding: 6px; min-width: 220px; z-index: 20;
  display: flex; flex-direction: column;
}
.menu button { text-align: left; background: none; border: 0; padding: 8px 10px; border-radius: 6px; }
.menu button:hover { background: var(--panel-2); }
.menu hr { border: 0; border-top: 1px solid var(--line); margin: 4px 0; width: 100%; }
.menu .danger { color: var(--err); }

/* ------------------------------------------------------------------ layout */
.layout {
  flex: 1; min-height: 0; display: grid; gap: 12px; padding: 12px;
  grid-template-columns: minmax(250px, 300px) minmax(0, 1fr) minmax(300px, 380px);
}
.panel {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); min-height: 0; display: flex; flex-direction: column; overflow: hidden;
}
.mobile-tabs { display: none; }

/* ------------------------------------------------------------------ library */
.lib-head { padding: 10px; display: grid; gap: 8px; border-bottom: 1px solid var(--line); }
.lib-list { overflow: auto; flex: 1; padding: 6px; }
.lib-group { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .6px; color: var(--ink-3); padding: 10px 6px 4px; }
.lib-item {
  display: grid; grid-template-columns: 1fr auto; gap: 2px 8px; padding: 7px 8px; border-radius: 8px;
  border: 1px solid transparent; cursor: grab; user-select: none;
}
.lib-item:hover { background: var(--panel-2); border-color: var(--line); }
.lib-item .code { font-weight: 650; font-family: var(--mono); font-size: 12.5px; }
.lib-item .title { grid-column: 1 / -1; color: var(--ink-2); font-size: 12.5px; line-height: 1.3; }
.lib-item .meta { display: flex; gap: 4px; align-items: center; justify-content: flex-end; font-size: 11.5px; color: var(--ink-3); }
.lib-item.planned { opacity: .6; }
.lib-item.planned .code::after { content: " ✓"; color: var(--ok); }
.lib-foot { font-size: 11.5px; color: var(--ink-3); padding: 8px 12px; margin: 0; border-top: 1px solid var(--line); }
.pill {
  display: inline-block; font-size: 10.5px; font-weight: 650; padding: 1px 6px; border-radius: 99px;
  background: var(--panel-2); border: 1px solid var(--line); color: var(--ink-2); white-space: nowrap;
}
.pill.on { background: var(--gold-soft); border-color: var(--gold); color: var(--ink); }
.pill.grad { background: var(--grad-soft); border-color: transparent; color: var(--grad); }
.pill.ucc { background: var(--plan-soft); border-color: transparent; color: var(--plan); }
.pill.warn { background: var(--warn-soft); border-color: transparent; color: var(--warn); }
.pill.err { background: var(--err-soft); border-color: transparent; color: var(--err); }
.pill.ok { background: var(--ok-soft); border-color: transparent; color: var(--ok); }
.pill.ph { background: var(--ph-soft); border-color: transparent; color: var(--ph); }

/* ------------------------------------------------------------------ summary strip */
.plan { background: transparent; border: 0; box-shadow: none; }
.summary { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 8px; margin-bottom: 10px; }
.stat {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 8px 11px;
  box-shadow: var(--shadow); min-width: 0;
}
.stat .k { font-size: 11px; color: var(--ink-3); text-transform: uppercase; letter-spacing: .5px; font-weight: 650; }
.stat .v { font-size: 19px; font-weight: 700; font-variant-numeric: tabular-nums; }
.stat .v small { font-size: 12px; color: var(--ink-3); font-weight: 600; }
.stat.click { cursor: pointer; }
.stat.click:hover { border-color: var(--gold-strong); }
.bar { height: 5px; background: var(--line); border-radius: 99px; overflow: hidden; margin-top: 5px; }
.bar > i { display: block; height: 100%; background: var(--gold-strong); border-radius: 99px; }
.bar.done > i { background: var(--ok); }

/* ------------------------------------------------------------------ timeline */
.timeline { overflow: auto; flex: 1; display: flex; flex-direction: column; gap: 12px; padding-bottom: 20px; }
.year { display: grid; gap: 8px; }
.year-head { display: flex; align-items: baseline; gap: 10px; font-weight: 700; padding: 0 2px; }
.year-head .sub { color: var(--ink-3); font-weight: 500; font-size: 12.5px; }
.year-terms { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 10px; }
.term {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow);
  display: flex; flex-direction: column; min-width: 0; transition: border-color .12s, background .12s;
}
.term.summer { background: var(--panel-2); }
.term.grad { border-top: 3px solid var(--grad); }
.term.drop { border-color: var(--gold-strong); background: var(--gold-soft); }
.term.prior { border-style: dashed; }
.term header { display: flex; align-items: center; gap: 8px; padding: 8px 10px 6px; border-bottom: 1px solid var(--line); }
.term .t-name { font-weight: 700; }
.term .t-meta { margin-left: auto; font-size: 12px; color: var(--ink-3); display: flex; gap: 6px; align-items: center; font-variant-numeric: tabular-nums; }
.term .t-cr { font-weight: 700; color: var(--ink); }
.term .t-cr.hi { color: var(--warn); }
.chips { list-style: none; margin: 0; padding: 6px; display: flex; flex-direction: column; gap: 4px; min-height: 38px; }
.chip {
  display: grid; grid-template-columns: auto 1fr auto auto; align-items: center; gap: 6px;
  padding: 5px 6px 5px 8px; border-radius: 7px; background: var(--panel-2); border: 1px solid var(--line);
  border-left: 3px solid var(--plan); cursor: pointer; font-size: 12.5px; min-width: 0;
}
.chip:hover { border-color: var(--line-2); }
.chip.completed { border-left-color: var(--ok); }
.chip.inprogress { border-left-color: var(--gold-strong); }
.chip.placeholder { border-left-color: var(--ph); border-style: dashed; border-left-style: solid; }
.chip.nocredit { opacity: .55; text-decoration: line-through; }
.chip .c-code { font-family: var(--mono); font-weight: 650; white-space: nowrap; }
.chip .c-title { color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.chip .c-cr { font-variant-numeric: tabular-nums; color: var(--ink-3); font-weight: 600; }
.chip .c-flags { display: flex; gap: 3px; align-items: center; }
.chip .x { border: 0; background: none; color: var(--ink-3); padding: 0 3px; font-size: 14px; line-height: 1; visibility: hidden; }
.chip:hover .x, .chip:focus-within .x { visibility: visible; }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.dot.error { background: var(--err); } .dot.warn { background: var(--warn); } .dot.info { background: var(--ink-3); }
.term .add { margin: 0 6px 6px; border: 1px dashed var(--line-2); background: none; border-radius: 7px; padding: 5px; color: var(--ink-3); font-size: 12.5px; }
.term .add:hover { border-color: var(--gold-strong); color: var(--ink); }
.term-issues { padding: 0 10px 6px; font-size: 11.5px; color: var(--warn); }
.term-issues .info { color: var(--ink-3); }
.chip.dragging { opacity: .4; }

/* ------------------------------------------------------------------ audit */
.audit-tabs { display: flex; gap: 2px; padding: 6px 6px 0; border-bottom: 1px solid var(--line); overflow-x: auto; flex: none; }
.audit-tabs button {
  border: 0; background: none; padding: 8px 10px; border-radius: 8px 8px 0 0; color: var(--ink-2); white-space: nowrap;
  border-bottom: 2px solid transparent; font-weight: 600; font-size: 13px;
}
.audit-tabs button[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--gold-strong); }
.audit-tabs .count { font-size: 11px; margin-left: 4px; }
.audit-body { overflow: auto; flex: 1; padding: 6px 10px 16px; }
.audit-pane { display: none; }
.audit-pane.active { display: block; }
.audit-pane h3 { font-size: 15px; margin: 8px 2px 4px; }
.audit-pane .asub { color: var(--ink-3); font-size: 12px; margin: 0 2px 8px; }
details.sec { border: 1px solid var(--line); border-radius: 9px; margin: 8px 0; background: var(--panel); }
details.sec > summary {
  cursor: pointer; list-style: none; padding: 8px 10px; font-weight: 650; display: flex; gap: 8px; align-items: center;
}
details.sec > summary::-webkit-details-marker { display: none; }
details.sec > summary::before { content: "▸"; color: var(--ink-3); transition: transform .12s; }
details.sec[open] > summary::before { transform: rotate(90deg); }
details.sec > summary .sec-count { margin-left: auto; font-size: 12px; color: var(--ink-3); font-weight: 600; }
.req { display: grid; grid-template-columns: 20px 1fr; gap: 2px 8px; padding: 7px 10px; border-top: 1px solid var(--line); }
.req .ico { font-size: 13px; line-height: 1.5; text-align: center; font-weight: 800; }
.req .lbl { font-weight: 600; font-size: 13px; }
.req .lbl .t { color: var(--ink-3); font-weight: 500; }
.req .body { grid-column: 2; display: flex; flex-direction: column; gap: 4px; }
.req .note { color: var(--ink-3); font-size: 12px; }
.req .opts { font-size: 12px; color: var(--ink-3); display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.req .cs { display: flex; flex-wrap: wrap; gap: 4px; }
.mini {
  font-family: var(--mono); font-size: 11.5px; padding: 1px 6px; border-radius: 5px; border: 1px solid var(--line);
  background: var(--panel-2); cursor: pointer; white-space: nowrap; color: var(--ink);
}
.mini.done { border-color: var(--ok); color: var(--ok); }
.mini.planned { border-color: var(--plan); color: var(--plan); }
.mini.placeholder { border-color: var(--ph); color: var(--ph); border-style: dashed; }
.mini.opt { border-style: dashed; color: var(--ink-2); }
.mini.opt:hover { border-color: var(--gold-strong); color: var(--ink); }
.s-done .ico { color: var(--ok); } .s-planned .ico { color: var(--plan); } .s-placeholder .ico { color: var(--ph); }
.s-partial .ico { color: var(--warn); } .s-missing .ico { color: var(--err); } .s-warn .ico { color: var(--warn); }
.s-info .ico { color: var(--ink-3); }
.legend { display: flex; flex-wrap: wrap; gap: 10px; font-size: 11.5px; color: var(--ink-3); margin: 4px 2px 8px; }
.legend span b { font-weight: 800; }
.issue { display: grid; grid-template-columns: 12px 1fr; gap: 8px; padding: 7px 4px; border-bottom: 1px solid var(--line); cursor: pointer; font-size: 12.5px; }
.issue:hover { background: var(--panel-2); }
.issue .dot { margin-top: 5px; }
.issue .where { color: var(--ink-3); font-size: 11.5px; }
.empty { color: var(--ink-3); text-align: center; padding: 20px; }

/* ------------------------------------------------------------------ modal */
.modal-back {
  position: fixed; inset: 0; background: rgba(15,14,12,.45); display: grid; place-items: center; z-index: 50; padding: 16px;
  animation: dim-in .12s ease-out; /* only the backdrop fades; the dialog itself is always fully opaque and readable */
}
@keyframes dim-in { from { background: rgba(15,14,12,0); } }
.modal {
  background: var(--panel); border-radius: 14px; box-shadow: 0 20px 60px rgba(0,0,0,.3); width: min(640px, 100%);
  max-height: calc(100vh - 32px); display: flex; flex-direction: column; overflow: hidden; border: 1px solid var(--line);
}
.modal.wide { width: min(860px, 100%); }
.modal-head { display: flex; align-items: flex-start; gap: 10px; padding: 14px 16px 10px; border-bottom: 1px solid var(--line); }
.modal-head h2 { margin: 0; font-size: 17px; line-height: 1.3; }
.modal-head .sub { color: var(--ink-3); font-size: 12.5px; margin-top: 2px; }
.modal-head .close { margin-left: auto; border: 0; background: none; font-size: 20px; color: var(--ink-3); padding: 0 4px; }
.modal-body { padding: 12px 16px; overflow: auto; display: flex; flex-direction: column; gap: 12px; }
.modal-body > * { flex-shrink: 0; } /* the body scrolls; its sections never get squashed */
.modal-foot { padding: 10px 16px; border-top: 1px solid var(--line); display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; }
.modal-foot .left { margin-right: auto; }
.field { display: grid; gap: 4px; }
.field > span { font-size: 12px; font-weight: 650; color: var(--ink-2); }
.field .hint { font-size: 11.5px; color: var(--ink-3); }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.box { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; background: var(--panel-2); }
.box h4 { margin: 0 0 6px; font-size: 12px; text-transform: uppercase; letter-spacing: .5px; color: var(--ink-3); }
.desc { color: var(--ink-2); font-size: 13px; }
.offered { display: flex; gap: 4px; flex-wrap: wrap; }
.offered .pill { font-size: 11px; }
.tree { font-size: 12.5px; }
.tree ul { list-style: none; margin: 2px 0 2px 6px; padding-left: 12px; border-left: 1px dashed var(--line-2); }
.tree li { margin: 2px 0; }
.tree .op { font-size: 11px; font-weight: 700; color: var(--ink-3); text-transform: uppercase; letter-spacing: .4px; }
.tree .ok { color: var(--ok); } .tree .no { color: var(--err); } .tree .cc { color: var(--gold-strong); }
.issues-list { display: flex; flex-direction: column; gap: 4px; }
.issues-list div { display: flex; gap: 8px; align-items: baseline; font-size: 12.5px; }
.qa-list { display: flex; flex-direction: column; max-height: 50vh; overflow: auto; border: 1px solid var(--line); border-radius: 8px; }
.qa-list button { text-align: left; border: 0; border-bottom: 1px solid var(--line); background: none; padding: 7px 10px; display: grid; grid-template-columns: auto 1fr auto; gap: 8px; align-items: baseline; }
.qa-list button:hover { background: var(--panel-2); }
.qa-list .code { font-family: var(--mono); font-weight: 650; font-size: 12.5px; }
.qa-list .t { color: var(--ink-2); font-size: 12.5px; }
.tpl { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; display: grid; gap: 4px; cursor: pointer; background: var(--panel); text-align: left; }
.tpl:hover, .tpl.sel { border-color: var(--gold-strong); background: var(--gold-soft); }
.tpl b { font-size: 14px; }
.tpl span { color: var(--ink-2); font-size: 12.5px; }

#toast {
  position: fixed; left: 50%; bottom: 18px; transform: translateX(-50%) translateY(20px); background: var(--ink); color: var(--panel);
  padding: 8px 14px; border-radius: 9px; font-size: 13px; opacity: 0; pointer-events: none; transition: all .18s; z-index: 60;
  display: flex; gap: 10px; align-items: center;
}
#toast.show { opacity: 1; transform: translateX(-50%); pointer-events: auto; }
#toast button { background: none; border: 0; color: var(--gold); font-weight: 700; }
@keyframes fade { from { opacity: 0; } }

/* ------------------------------------------------------------------ responsive */
@media (max-width: 1180px) {
  .layout { grid-template-columns: minmax(230px, 270px) minmax(0, 1fr); }
  .audit { grid-column: 1 / -1; max-height: 55vh; }
  body { overflow: auto; }
  .layout { min-height: auto; }
}
@media (max-width: 820px) {
  body { overflow: hidden; }
  .topbar { gap: 8px; padding: 8px 12px; }
  .brand-sub { display: none; }
  .plan-picker { order: 3; width: 100%; }
  .plan-picker select { flex: 1; max-width: none; }
  .actions { margin-left: auto; }
  .actions .btn:not(.primary):not(.icon):not([data-act="file-menu"]) { display: none; }
  .mobile-tabs { display: flex; background: var(--panel); border-bottom: 1px solid var(--line); }
  .mobile-tabs button { flex: 1; border: 0; background: none; padding: 10px; font-weight: 650; color: var(--ink-3); border-bottom: 2px solid transparent; }
  body[data-mobile-tab="library"] .mobile-tabs [data-tab="library"],
  body[data-mobile-tab="plan"] .mobile-tabs [data-tab="plan"],
  body[data-mobile-tab="audit"] .mobile-tabs [data-tab="audit"] { color: var(--ink); border-bottom-color: var(--gold-strong); }
  .layout { display: block; padding: 8px 16px; overflow: auto; }
  .layout > .panel { display: none; max-height: none; }
  body[data-mobile-tab="library"] .library,
  body[data-mobile-tab="plan"] .plan,
  body[data-mobile-tab="audit"] .audit { display: flex; }
  .library, .audit { height: 100%; }
  .year-terms { grid-template-columns: 1fr; }
  .grid2, .grid3 { grid-template-columns: 1fr; }
  .chip .x { visibility: visible; }
}

/* ------------------------------------------------------------------ print */
@media print {
  body { overflow: visible; display: block; background: #fff; color: #000; font-size: 11px; }
  .topbar .actions, .plan-picker, .mobile-tabs, .library, .term .add, .chip .x, .audit-tabs { display: none !important; }
  .topbar { box-shadow: none; border-bottom: 2px solid #000; }
  .layout { display: block; padding: 0; }
  .panel { border: 0; box-shadow: none; overflow: visible; display: block !important; }
  .timeline, .audit-body { overflow: visible; }
  .year { break-inside: avoid; }
  .term { box-shadow: none; break-inside: avoid; }
  .audit { page-break-before: always; max-height: none; }
  .audit-pane { display: block !important; break-inside: auto; }
  details.sec { break-inside: avoid; }
  details.sec > summary::before { content: ""; }
}

/* ================================================================== views (v2) */
.view-tabs {
  display: flex; gap: 4px; align-items: center; padding: 6px 14px 0; background: var(--panel);
  border-bottom: 1px solid var(--line); overflow-x: auto; flex: none;
}
.view-tabs button {
  border: 0; background: none; padding: 8px 14px; font-weight: 650; color: var(--ink-3); white-space: nowrap;
  border-bottom: 3px solid transparent; border-radius: 8px 8px 0 0; display: inline-flex; gap: 7px; align-items: center;
}
.view-tabs button:hover { color: var(--ink); background: var(--panel-2); }
body[data-view="planner"] .view-tabs [data-view="planner"],
body[data-view="semesters"] .view-tabs [data-view="semesters"],
body[data-view="map"] .view-tabs [data-view="map"],
body[data-view="audit"] .view-tabs [data-view="audit"] { color: var(--ink); border-bottom-color: var(--gold-strong); }
.view-hint { margin-left: auto; font-size: 11.5px; color: var(--ink-3); white-space: nowrap; padding-right: 4px; }

.mapview { display: none; }
body[data-view="semesters"] .layout, body[data-view="map"] .layout, body[data-view="audit"] .layout { grid-template-columns: minmax(0, 1fr); }
body[data-view="semesters"] .library, body[data-view="semesters"] .audit,
body[data-view="map"] .library, body[data-view="map"] .audit, body[data-view="map"] .plan,
body[data-view="audit"] .library, body[data-view="audit"] .plan { display: none; }
body[data-view="map"] .mapview { display: flex; }
body[data-view="semesters"] .audit, body[data-view="audit"] .audit { max-height: none; }
body:not([data-view="planner"]) .mobile-tabs { display: none; }

/* semesters board */
body[data-view="semesters"] .year-terms { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 14px; }
body[data-view="semesters"] .year-head { font-size: 16px; }
body[data-view="semesters"] .chip { grid-template-columns: auto 1fr auto auto; padding: 8px 8px 8px 10px; font-size: 13px; }
body[data-view="semesters"] .chip .c-title { white-space: normal; }
.chip .c-more { display: none; grid-column: 1 / -1; font-size: 11.5px; color: var(--ink-3); gap: 4px; flex-wrap: wrap; align-items: center; }
body[data-view="semesters"] .chip .c-more { display: flex; }
.rtag { font-size: 10.5px; font-weight: 700; padding: 1px 6px; border-radius: 99px; background: var(--gold-soft); color: var(--ink-2); border: 1px solid var(--gold); white-space: nowrap; }
.rtag.ms { background: var(--grad-soft); border-color: transparent; color: var(--grad); }
.after { color: var(--ink-3); }
.after b { color: var(--ink-2); font-family: var(--mono); font-weight: 600; }

/* audit full page */
body[data-view="audit"] .audit-body { padding: 10px 18px 24px; }
body[data-view="audit"] .audit-pane.active { columns: 380px 3; column-gap: 16px; }
body[data-view="audit"] .audit-pane.active > h3, body[data-view="audit"] .audit-pane.active > .asub,
body[data-view="audit"] .audit-pane.active > .legend, body[data-view="audit"] .audit-pane.active > p { column-span: all; }
body[data-view="audit"] details.sec { break-inside: avoid; margin-top: 0; }

/* progress ring */
.stat.ring { display: flex; gap: 10px; align-items: center; }
.stat.ring svg { flex: none; }
.ring-bg { stroke: var(--line); }
.ring-plan { stroke: var(--plan); opacity: .45; }
.ring-done { stroke: var(--ok); }
.ring-txt { font: 700 13px var(--font); fill: var(--ink); }

/* prerequisite map */
.mapview { background: var(--panel); }
.map-bar { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; padding: 10px 14px; border-bottom: 1px solid var(--line); font-size: 13px; }
.map-stats { font-weight: 600; margin-right: auto; }
.map-legend { display: flex; gap: 10px; flex-wrap: wrap; font-size: 11.5px; color: var(--ink-3); width: 100%; }
.lg::before { content: ""; display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; border-left: 3px solid var(--plan); background: var(--panel-2); }
.lg.completed::before { border-left-color: var(--ok); } .lg.inprogress::before { border-left-color: var(--gold-strong); }
.lg.placeholder::before { border-left-color: var(--ph); }
.lg.edge::before { display: none; }
.map-scroll { flex: 1; overflow: auto; min-height: 0; background:
  radial-gradient(circle, var(--line) 1px, transparent 1.2px) 0 0 / 22px 22px; }
.map-canvas { position: relative; }
.map-svg { position: absolute; left: 0; top: 0; overflow: visible; }
.mcol-bg { fill: var(--panel-2); opacity: .85; }
.mcol-bg.grad { fill: var(--grad-soft); }
.mcol-head { position: absolute; top: 14px; font-weight: 700; font-size: 12.5px; display: flex; justify-content: space-between; color: var(--ink); }
.mcol-head span { color: var(--ink-3); font-weight: 600; }
.mcol-head.grad { color: var(--grad); }
.medge { fill: none; stroke: var(--line-2); stroke-width: 1.6; transition: stroke .12s, opacity .12s; }
.medge.cc { stroke-dasharray: 4 3; }
.medge.crit { stroke: var(--err); stroke-width: 2.6; }
.marrow { fill: var(--line-2); }
.mnode {
  position: absolute; background: var(--panel); border: 1px solid var(--line); border-left: 4px solid var(--plan); border-radius: 9px;
  padding: 6px 8px; box-shadow: var(--shadow); cursor: pointer; font-size: 12px; overflow: hidden; transition: opacity .12s, transform .12s, box-shadow .12s;
  display: flex; flex-direction: column; gap: 1px;
}
.mnode:hover, .mnode:focus { box-shadow: 0 4px 16px rgba(0,0,0,.18); z-index: 2; outline: none; }
.mnode.completed { border-left-color: var(--ok); }
.mnode.inprogress { border-left-color: var(--gold-strong); }
.mnode.placeholder { border-left-color: var(--ph); border-style: dashed; border-left-style: solid; }
.mnode.has-error { box-shadow: 0 0 0 2px var(--err-soft), var(--shadow); }
.mnode.crit { box-shadow: 0 0 0 2px var(--err); }
.mnode .n1 { display: flex; gap: 6px; align-items: center; }
.mnode .n1 b { font-family: var(--mono); font-size: 12.5px; }
.mnode .ncr { margin-left: auto; color: var(--ink-3); font-weight: 650; }
.mnode .n2 { color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mnode .n3 { display: flex; gap: 4px; align-items: center; min-height: 14px; }
.ntag { font-size: 9.5px; font-weight: 700; padding: 0 5px; border-radius: 99px; background: var(--gold-soft); color: var(--ink-2); white-space: nowrap; }
.nun { margin-left: auto; font-size: 10.5px; color: var(--plan); font-weight: 700; }
.mapview.focus .mnode { opacity: .25; }
.mapview.focus .mnode.hl-self, .mapview.focus .mnode.hl-up, .mapview.focus .mnode.hl-down { opacity: 1; }
.mapview.focus .mnode.hl-self { transform: scale(1.04); box-shadow: 0 0 0 2px var(--ink), 0 6px 18px rgba(0,0,0,.2); }
.mapview.focus .mnode.hl-up { box-shadow: 0 0 0 2px var(--gold-strong); }
.mapview.focus .mnode.hl-down { box-shadow: 0 0 0 2px var(--plan); }
.mapview.focus .medge { opacity: .12; }
.mapview.focus .medge.hl-up { opacity: 1; stroke: var(--gold-strong); stroke-width: 2.4; }
.mapview.focus .medge.hl-down { opacity: 1; stroke: var(--plan); stroke-width: 2.4; }
.map-foot { margin: 0; padding: 8px 14px; font-size: 11.5px; color: var(--ink-3); border-top: 1px solid var(--line); }

/* course modal: unlocks */
.unlocks { display: flex; flex-wrap: wrap; gap: 4px; }

@media (max-width: 820px) {
  .view-tabs { padding: 4px 8px 0; }
  .view-hint { display: none; }
  body:not([data-view="planner"]) .layout > .panel { display: none; }
  body[data-view="semesters"] .layout > .plan, body[data-view="map"] .layout > .mapview, body[data-view="audit"] .layout > .audit,
  body[data-view="schedule"] .layout > .schedview { display: flex; }
  body[data-view="map"] .layout { height: 100%; }
}
@media print {
  .view-tabs, .map-bar { display: none !important; }
}

/* ================================================================== data (v3) */
.lib-filters { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.lib-filters select { font-size: 12.5px; padding: 5px 6px; }
.lib-checks { display: flex; gap: 12px; flex-wrap: wrap; font-size: 12.5px; }
.lib-count { font-size: 11.5px; color: var(--ink-3); padding: 4px 6px 2px; }
.pill.gpa { font-variant-numeric: tabular-nums; border-color: transparent; }
.pill.g-hi { background: var(--ok-soft); color: var(--ok); }
.pill.g-mid { background: var(--plan-soft); color: var(--plan); }
.pill.g-low { background: var(--warn-soft); color: var(--warn); }
.pill.g-vlow { background: var(--err-soft); color: var(--err); }
.gbar { display: inline-flex; width: 130px; height: 10px; border-radius: 3px; overflow: hidden; background: var(--line); vertical-align: middle; }
.gbar i { display: block; height: 100%; }
.gbar .gA { background: #3f9c5a; } .gbar .gB { background: #c9b037; } .gbar .gC { background: #dd8a2c; }
.gbar .gD { background: #c0503a; } .gbar .gF { background: #7a2618; }
.prof-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.prof-table th { text-align: left; font-size: 11px; color: var(--ink-3); font-weight: 650; padding: 4px 6px; border-bottom: 1px solid var(--line); }
.prof-table td { padding: 6px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.prof-table a { color: inherit; text-decoration: none; }
.prof-table a:hover { text-decoration: underline; }
.rmp-hi { color: var(--ok); } .rmp-mid { color: var(--warn); } .rmp-low { color: var(--err); }
.links { display: flex; flex-wrap: wrap; gap: 6px; }
.links a { font-size: 12.5px; padding: 5px 10px; border: 1px solid var(--line-2); border-radius: 8px; color: var(--ink); text-decoration: none; background: var(--panel); }
.links a:hover { border-color: var(--gold-strong); }
@media (max-width: 820px) { .prof-table th:nth-child(3), .prof-table td:nth-child(3) { display: none; } }

.sugg { display: flex; flex-direction: column; max-height: 46vh; overflow: auto; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); }
.sugg-row { display: grid; grid-template-columns: 92px 1fr; gap: 2px 10px; text-align: left; border: 0; border-bottom: 1px solid var(--line); background: none; padding: 7px 10px; }
.sugg-row:hover { background: var(--gold-soft); }
.sugg-row b { font-family: var(--mono); font-size: 12.5px; }
.sugg-row .t { font-size: 12.5px; color: var(--ink-2); }
.sugg-row .sg-meta { grid-column: 2; display: flex; gap: 4px; flex-wrap: wrap; align-items: center; }

/* ================================================================== resizer + prereq hover (v4) */
.summary { flex: none; }
.summary.sized { overflow: auto; margin-bottom: 0; align-content: start; }
.summary.collapsed { overflow: hidden; }
.summary-resizer { flex: none; height: 14px; margin: 2px 0 8px; cursor: row-resize; display: grid; place-items: center; border-radius: 6px; touch-action: none; }
.summary-resizer span { width: 54px; height: 5px; border-radius: 99px; background: var(--line-2); transition: background .12s, width .12s; }
.summary-resizer:hover span, .summary-resizer:focus span, body.resizing .summary-resizer span { background: var(--gold-strong); width: 80px; }
.summary.collapsed + .summary-resizer::after { content: "Progress hidden: drag down or double-click"; font-size: 11px; color: var(--ink-3); margin-top: 2px; }
.summary.collapsed + .summary-resizer { height: 26px; }
body.resizing { cursor: row-resize; user-select: none; }

.chip.pr-bad { border-color: var(--err); border-left-color: var(--err); background: var(--err-soft); box-shadow: 0 0 0 1px var(--err); }
.chip.pr-self { border-color: var(--ink-3); box-shadow: 0 0 0 1px var(--ink-3); }
.chip.pr-src { background: var(--gold-soft); border-color: var(--gold-strong); box-shadow: 0 0 0 1px var(--gold-strong); }
.prereq-pop {
  position: fixed; z-index: 40; background: var(--panel); border: 1px solid var(--line-2); border-radius: 10px;
  box-shadow: 0 10px 30px rgba(0,0,0,.22); padding: 9px 11px; font-size: 12.5px; pointer-events: none; line-height: 1.45;
}
.prereq-pop .ph { display: flex; gap: 8px; align-items: center; margin-bottom: 4px; }
.prereq-pop .pt ul { list-style: none; margin: 2px 0 2px 4px; padding-left: 12px; border-left: 1px dashed var(--line-2); }
.prereq-pop .op { font-size: 10.5px; font-weight: 700; color: var(--ink-3); text-transform: uppercase; letter-spacing: .4px; }
.prereq-pop .pm { font-weight: 800; display: inline-block; width: 14px; }
.prereq-pop .pm.y { color: var(--ok); } .prereq-pop .pm.n { color: var(--err); } .prereq-pop .pm.c { color: var(--gold-strong); } .prereq-pop .pm.o { color: var(--ink-3); }
.prereq-pop b { font-family: var(--mono); font-size: 12px; }
.prereq-pop .dim { color: var(--ink-3); }
.prereq-pop .bad { color: var(--err); font-weight: 600; }
.prereq-pop .more { color: var(--ink-3); font-style: italic; }
.prereq-pop .pu { margin-top: 6px; padding-top: 6px; border-top: 1px solid var(--line); color: var(--ink-2); }
@media (hover: none) { .prereq-pop { display: none; } }

/* programs panel */
.prog-group { border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px; }
.prog-group h4 { margin: 2px 0 6px; font-size: 12px; text-transform: uppercase; letter-spacing: .5px; color: var(--ink-3); }
.prog { display: flex; gap: 10px; align-items: flex-start; padding: 6px 2px; cursor: pointer; border-radius: 6px; }
.prog:hover { background: var(--panel-2); }
.prog input { margin-top: 3px; }
.prog b { font-weight: 650; margin-right: 6px; }
.prog .desc { margin-right: 6px; }

/* programs: off / exploring / pursuing */
.prog-chips { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.prog-chips .k { font-size: 11px; color: var(--ink-3); text-transform: uppercase; letter-spacing: .5px; font-weight: 650; margin-right: 2px; }
.pchip { border: 1px solid var(--gold-strong); background: var(--gold-soft); border-radius: 99px; padding: 3px 10px; font-size: 12px; font-weight: 650; display: inline-flex; gap: 5px; align-items: center; }
.pchip small { font-weight: 600; color: var(--ink-3); }
.pchip.exploring { background: transparent; border-style: dashed; border-color: var(--line-2); color: var(--ink-2); }
.pchip.add { background: transparent; border-color: var(--line-2); color: var(--ink-3); }
.pchip:hover { border-color: var(--ink); }
.stat.exploring { border-style: dashed; opacity: .8; }
details.sec.exploring { border-style: dashed; }
details.sec.exploring > summary .pill { font-weight: 600; }
.prog-row { display: grid; grid-template-columns: 1fr auto; gap: 10px; align-items: center; padding: 7px 2px; border-top: 1px solid var(--line); }
.prog-row:first-of-type { border-top: 0; }
.prog-row select { margin-top: 4px; font-size: 12.5px; }
.segs { display: inline-flex; border: 1px solid var(--line-2); border-radius: 8px; overflow: hidden; }
.seg { padding: 4px 10px; font-size: 12px; cursor: pointer; color: var(--ink-2); border-left: 1px solid var(--line-2); }
.seg:first-child { border-left: 0; }
.seg input { display: none; }
.seg.on { background: var(--ink); color: var(--panel); }
.seg:not(.on):hover { background: var(--panel-2); }
@media (max-width: 820px) { .prog-row { grid-template-columns: 1fr; } }

/* ================================================================== prerequisite map v2 */
.map-bar { gap: 8px 14px; }
.map-mode { display: inline-flex; border: 1px solid var(--line-2); border-radius: 8px; overflow: hidden; }
.map-mode button { border: 0; background: none; padding: 5px 12px; font-size: 12.5px; font-weight: 650; color: var(--ink-2); }
.map-mode button + button { border-left: 1px solid var(--line-2); }
.map-mode button.on { background: var(--ink); color: var(--panel); }
.map-stats { margin-left: auto; margin-right: 0; font-weight: 600; color: var(--ink-3); font-size: 12px; }
.map-info { padding: 8px 14px; border-bottom: 1px solid var(--line); font-size: 12.5px; min-height: 40px; display: flex; flex-direction: column; gap: 4px; background: var(--panel-2); }
.map-info .hint { color: var(--ink-2); }
.map-info .ihead { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.map-info .ihead b { font-family: var(--mono); }
.map-info .ihead .btn { margin-left: 4px; }
.map-info .ibad { color: var(--err); font-weight: 600; }
.map-info .irow { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.map-info .il { font-size: 11px; text-transform: uppercase; letter-spacing: .4px; color: var(--ink-3); font-weight: 700; width: 84px; }
.map-info .dim { color: var(--ink-3); }
.ib { font-family: var(--mono); font-size: 12px; font-weight: 650; padding: 2px 8px; border-radius: 6px; display: inline-flex; gap: 6px; align-items: baseline; }
.ib small { font-family: var(--font); font-weight: 500; color: var(--ink-3); font-size: 11px; }
.ib.up { background: var(--gold-soft); border: 1px solid var(--gold-strong); }
.ib.down { background: var(--plan-soft); border: 1px solid var(--plan); }
.map-scroll { background: var(--panel); }
.mlane { fill: var(--panel); }
.mlane.alt { fill: var(--panel-2); }
.mgrad { fill: var(--grad-soft); opacity: .45; }
.mlane-label { position: absolute; left: 0; display: flex; align-items: center; padding-left: 12px; font-size: 11.5px; font-weight: 750; color: var(--ink-3); text-transform: uppercase; letter-spacing: .5px; border-right: 2px solid var(--line); }
.mlane-label span { writing-mode: horizontal-tb; }
.mcol-head { top: 8px; display: flex; flex-direction: column; align-items: center; gap: 0; font-size: 12px; text-align: center; }
.mcol-head span { font-size: 11px; }
.medge { stroke: var(--line-2); stroke-width: 1.3; opacity: .55; }
.medge.cc { stroke-dasharray: 3 3; }
.medge.crit { stroke: var(--err); stroke-width: 2.4; opacity: 1; }
.mnode { padding: 5px 8px; gap: 1px; border-radius: 8px; }
.mnode .n1 { gap: 5px; }
.mnode .n1 .ntag { margin-left: auto; }
.mnode .n2 { font-size: 11.5px; }
.mnode.bad { border-color: var(--err); background: var(--err-soft); }
.nbad { background: var(--err); color: #fff; border-radius: 99px; width: 15px; height: 15px; display: inline-grid; place-items: center; font-size: 10px; font-weight: 800; }
.mapview.focus .mnode { opacity: .18; }
.mapview.focus .medge { opacity: .06; }
.mapview.focus .medge.hl-up { opacity: 1; stroke: var(--gold-strong); stroke-width: 2.4; }
.mapview.focus .medge.hl-down { opacity: 1; stroke: var(--plan); stroke-width: 2.4; }
.map-foot { display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center; }
.map-foot .lg-sep { color: var(--line-2); }
.sw { display: inline-block; width: 18px; height: 3px; border-radius: 2px; margin-right: 6px; vertical-align: middle; }
.sw.up { background: var(--gold-strong); } .sw.down { background: var(--plan); }
.sw.cc { background: repeating-linear-gradient(90deg, var(--ink-3) 0 3px, transparent 3px 6px); }

.save-status { font-size: 12px; font-weight: 650; padding: 3px 9px; border-radius: 99px; border: 1px solid var(--line-2); color: var(--ink-3); white-space: nowrap; }
.save-status.saved { color: var(--ok); border-color: var(--ok); background: var(--ok-soft); }
.save-status.saving { color: var(--plan); border-color: var(--plan); }
.save-status.error { color: var(--err); border-color: var(--err); background: var(--err-soft); }
.save-status.local { color: var(--warn); border-color: var(--warn); }

/* ================================================================== prerequisite map v3 (semester columns, subject colors) */
:root { --sc-ECE: #b8860b; --sc-MA: #2d6cb5; --sc-SCI: #2f8a57; --sc-MSE: #7a5bb0; --sc-ENG: #c0612b; --sc-OTHER: #8a857a; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --sc-ECE: #e0b84a; --sc-MA: #6fa6e8; --sc-SCI: #5fc28b; --sc-MSE: #b195e6; --sc-ENG: #e8915a; --sc-OTHER: #a39d90; } }
:root[data-theme="dark"] { --sc-ECE: #e0b84a; --sc-MA: #6fa6e8; --sc-SCI: #5fc28b; --sc-MSE: #b195e6; --sc-ENG: #e8915a; --sc-OTHER: #a39d90; }
.s-ECE { --sc: var(--sc-ECE); } .s-MA { --sc: var(--sc-MA); } .s-SCI { --sc: var(--sc-SCI); }
.s-MSE { --sc: var(--sc-MSE); } .s-ENG { --sc: var(--sc-ENG); } .s-OTHER { --sc: var(--sc-OTHER); }

.map-wrap { position: relative; flex: 1; min-height: 0; display: flex; }
.map-wrap .map-scroll { flex: 1; }
.map-scroll { background: radial-gradient(circle, var(--line) 1px, transparent 1.2px) 0 0 / 22px 22px, var(--panel); }
.mcol-bg { fill: var(--panel-2); opacity: .9; }
.mcol-bg.grad { fill: var(--grad-soft); }
.mcol-head { top: 14px; display: flex; flex-direction: column; align-items: center; text-align: center; font-size: 12.5px; }
.mcol-head b { font-weight: 750; }
.mcol-head span { font-size: 11px; color: var(--ink-3); }

.mnode {
  --stat: var(--plan);
  position: absolute; display: flex; flex-direction: column; gap: 1px; padding: 5px 9px 5px 11px; cursor: pointer; overflow: hidden;
  background: color-mix(in srgb, var(--sc) 11%, var(--panel)); border: 1px solid color-mix(in srgb, var(--sc) 50%, var(--line));
  border-left: 5px solid var(--stat); border-radius: 9px; box-shadow: var(--shadow); font-size: 12px;
  transition: opacity .12s, box-shadow .12s, transform .12s;
}
.mnode.completed { --stat: var(--ok); }
.mnode.inprogress { --stat: var(--gold-strong); }
.mnode.placeholder { --stat: var(--ph); border-style: dashed; border-left-style: solid; }
.mnode.solo { opacity: .78; box-shadow: none; }
.mnode .n1 { display: flex; gap: 6px; align-items: center; }
.mnode .n1 b { font-family: var(--mono); font-size: 12.5px; color: color-mix(in srgb, var(--sc) 70%, var(--ink)); }
.mnode .ncr { margin-left: auto; color: var(--ink-3); font-size: 11px; font-weight: 650; }
.mnode .n2 { color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 11.5px; }
.mnode .n3 { display: flex; gap: 4px; }
.mnode .ntag { font-size: 9.5px; font-weight: 700; padding: 0 6px; border-radius: 99px; background: color-mix(in srgb, var(--sc) 22%, var(--panel)); color: var(--ink-2); }
.mnode.bad { border-color: var(--err); box-shadow: 0 0 0 2px var(--err-soft); }
.mnode.crit { box-shadow: 0 0 0 2px var(--err); }
.mnode:hover, .mnode:focus { outline: none; box-shadow: 0 6px 18px rgba(0,0,0,.18); z-index: 3; }

.medge { fill: none; stroke: var(--sc); stroke-width: 1.7; opacity: .5; transition: opacity .12s, stroke-width .12s; }
.medge.e-ECE { stroke: var(--sc-ECE); } .medge.e-MA { stroke: var(--sc-MA); } .medge.e-SCI { stroke: var(--sc-SCI); }
.medge.e-MSE { stroke: var(--sc-MSE); } .medge.e-ENG { stroke: var(--sc-ENG); } .medge.e-OTHER { stroke: var(--sc-OTHER); }
.medge.cc { stroke-dasharray: 4 3; }
.medge.crit { stroke: var(--err) !important; stroke-width: 2.8; opacity: 1; }
.mk-ECE { fill: var(--sc-ECE); } .mk-MA { fill: var(--sc-MA); } .mk-SCI { fill: var(--sc-SCI); } .mk-MSE { fill: var(--sc-MSE); }
.mk-ENG { fill: var(--sc-ENG); } .mk-OTHER { fill: var(--sc-OTHER); } .mk-up { fill: var(--gold-strong); } .mk-down { fill: var(--plan); } .mk-crit { fill: var(--err); }

.mapview.focus .mnode { opacity: .2; }
.mapview.focus .mnode.hl-self, .mapview.focus .mnode.hl-up, .mapview.focus .mnode.hl-down { opacity: 1; }
.mapview.focus .mnode.hl-self { box-shadow: 0 0 0 2.5px var(--ink), 0 8px 20px rgba(0,0,0,.22); transform: scale(1.03); z-index: 4; }
.mapview.focus .mnode.hl-up { box-shadow: 0 0 0 2.5px var(--gold-strong); }
.mapview.focus .mnode.hl-down { box-shadow: 0 0 0 2.5px var(--plan); }
.mapview.focus .medge { opacity: .06; }
.mapview.focus .medge.hl-up { opacity: 1; stroke: var(--gold-strong); stroke-width: 3; }
.mapview.focus .medge.hl-down { opacity: 1; stroke: var(--plan); stroke-width: 3; }

.map-card {
  position: absolute; bottom: 16px; right: 22px; width: min(340px, calc(100% - 44px)); z-index: 10; pointer-events: none;
  background: var(--panel); border: 1px solid var(--line-2); border-radius: 12px; box-shadow: 0 12px 32px rgba(0,0,0,.22);
  padding: 10px 12px; font-size: 12.5px; display: flex; flex-direction: column; gap: 5px;
}
.map-card.locked { pointer-events: auto; border-color: var(--ink-3); }
.map-card .ihead { display: flex; gap: 8px; align-items: baseline; }
.map-card .ihead b { font-family: var(--mono); font-size: 13px; }
.map-card .ihead span { color: var(--ink-2); font-weight: 600; }
.map-card .irow { display: flex; gap: 5px; flex-wrap: wrap; align-items: center; }
.map-card .il { font-size: 10.5px; text-transform: uppercase; letter-spacing: .4px; color: var(--ink-3); font-weight: 700; width: 76px; }
.map-card .ibad { color: var(--err); font-weight: 600; }
.map-card .iact { display: flex; gap: 6px; margin-top: 2px; }
.map-card .dim { color: var(--ink-3); }

.map-foot { display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: center; font-size: 11.5px; color: var(--ink-2); }
.map-foot .subj { padding: 1px 8px; border-radius: 6px; border: 1px solid color-mix(in srgb, var(--sc) 50%, var(--line)); background: color-mix(in srgb, var(--sc) 12%, var(--panel)); font-weight: 650; }
.map-foot .st::before { content: ""; display: inline-block; width: 4px; height: 12px; border-radius: 2px; margin-right: 5px; vertical-align: -2px; background: var(--plan); }
.map-foot .st.completed::before { background: var(--ok); } .map-foot .st.inprogress::before { background: var(--gold-strong); }
.map-foot .dim { color: var(--ink-3); }

.mnode .n2 { white-space: normal; overflow: visible; text-overflow: clip; line-height: 15px; }

/* ------------------------------------------------------------------ swap a course */
.chip .c-acts { display: flex; align-items: center; }
.chip .x.sw { font-size: 13px; }
.chip .x.sw:hover { color: var(--plan); }
.modal.swap-modal { width: min(1080px, 100%); }
.swap { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); gap: 14px; align-items: start; }
.swap-left { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.swap-tools { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.swap-tools input[type="search"] { flex: 1 1 200px; min-width: 0; }
.swap-list { max-height: 58vh; }
.swap-list .sugg-row.on { background: var(--gold-soft); box-shadow: inset 3px 0 0 var(--gold-strong); }
.swap-right { position: sticky; top: 0; border: 1px solid var(--line); border-radius: 10px; padding: 12px; background: var(--panel-2); min-height: 200px; font-size: 12.5px; display: flex; flex-direction: column; gap: 6px; max-height: 66vh; overflow: auto; }
.swap-right h5 { margin: 6px 0 0; font-size: 10.5px; text-transform: uppercase; letter-spacing: .4px; color: var(--ink-3); }
.sw-head { display: flex; gap: 6px; align-items: baseline; flex-wrap: wrap; font-size: 14px; }
.sw-head b { font-family: var(--mono); }
.sw-head .sw-from { font-family: var(--mono); color: var(--ink-3); text-decoration: line-through; }
.sw-head .t { color: var(--ink-2); font-weight: 600; font-size: 13px; }
.sw-verdict { padding: 6px 9px; border-radius: 8px; font-weight: 600; }
.sw-verdict.ok { background: var(--ok-soft); color: var(--ok); }
.sw-verdict.warn { background: var(--warn-soft); color: var(--warn); }
.sw-term { max-width: 240px; }
.sw-tags { display: flex; gap: 4px; flex-wrap: wrap; }
.rtag.ok { background: var(--ok-soft); border-color: transparent; color: var(--ok); }
.rtag.bad { background: var(--err-soft); border-color: transparent; color: var(--err); }
.sw-ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 3px; }
.sw-ul li { padding-left: 16px; position: relative; }
.sw-ul li::before { content: "•"; position: absolute; left: 4px; color: var(--ink-3); }
.sw-ul li.good::before { content: "✓"; color: var(--ok); left: 2px; }
.sw-ul li.bad { color: var(--err); } .sw-ul li.bad::before { content: "✗"; color: var(--err); left: 2px; }
.sw-ul li.meh::before { content: "!"; color: var(--warn); left: 5px; font-weight: 800; }
.sw-ul .dim, .swap-right .dim { color: var(--ink-3); font-size: 11.5px; }
.swap-right > * { flex-shrink: 0; } /* the preview pane scrolls as a whole; nothing inside it gets squashed */
.sw-desc { line-height: 1.55; font-size: 12.5px; }
@media (max-width: 760px) {
  .swap { grid-template-columns: 1fr; }
  .swap-right { position: static; max-height: none; }
  .swap-list { max-height: 40vh; }
}
.rtag.bad.soft { background: var(--warn-soft); color: var(--warn); }
.sw-note { background: var(--warn-soft); color: var(--ink-2); padding: 6px 9px; border-radius: 8px; }
.btn:disabled { opacity: .45; cursor: not-allowed; }

/* ------------------------------------------------------------------ map: drag a course to another semester */
.mapview .mnode.planned, .mapview .mnode.inprogress, .mapview .mnode.placeholder { cursor: grab; user-select: none; -webkit-user-select: none; }
.mapview.dragging, .mapview.dragging * { cursor: grabbing !important; }
.mapview.dragging .mnode.drag-src { opacity: .3; outline: 2px dashed var(--ink-3); outline-offset: 2px; }
.mghost { position: fixed; z-index: 1000; pointer-events: none; opacity: .95; transform-origin: 0 0; transition: none;
  box-shadow: 0 14px 34px rgba(0,0,0,.32); rotate: -1.5deg; }
.mempty { position: absolute; text-align: center; font-size: 12px; color: var(--ink-3); border: 1.5px dashed var(--line-2);
  border-radius: 10px; padding: 14px 6px; line-height: 1.4; }
.mempty span { font-size: 11px; }
.mdrops { position: absolute; inset: 0; pointer-events: none; z-index: 5; }
.mdrop { position: absolute; top: 8px; border-radius: 12px; border: 2px dashed transparent; transition: background .12s, border-color .12s; }
.mdrop.no { background: color-mix(in srgb, var(--bg) 60%, transparent); }
.mdrop.ok { border-color: var(--ok); background: color-mix(in srgb, var(--ok) 6%, transparent); }
.mdrop.warn { border-color: var(--warn); background: color-mix(in srgb, var(--warn) 6%, transparent); }
.mdrop.bad { border-color: var(--err); background: color-mix(in srgb, var(--err) 8%, transparent); }
.mdrop.same { border-color: var(--line-2); }
.mdrop.over { border-style: solid; border-width: 3px; }
.mdrop.over.ok { background: color-mix(in srgb, var(--ok) 18%, transparent); }
.mdrop.over.warn { background: color-mix(in srgb, var(--warn) 18%, transparent); }
.mdrop.over.bad { background: color-mix(in srgb, var(--err) 18%, transparent); }
.mdrop.over.same { background: color-mix(in srgb, var(--ink-3) 12%, transparent); }
.mdrop-ic { position: absolute; top: 4px; right: 6px; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center;
  font-size: 13px; font-weight: 800; color: var(--panel); background: var(--ink-3); }
.mdrop.ok .mdrop-ic { background: var(--ok); } .mdrop.warn .mdrop-ic { background: var(--warn); } .mdrop.bad .mdrop-ic { background: var(--err); }
.mdrop-tag { display: none; position: absolute; left: 6px; right: 6px; top: 40px; font-size: 11.5px; line-height: 1.35; padding: 7px 9px; border-radius: 8px;
  background: var(--panel); border: 1px solid var(--line-2); box-shadow: 0 6px 18px rgba(0,0,0,.22); color: var(--ink-2); }
.mdrop.over .mdrop-tag { display: block; }
.mdrop-tag b { display: block; color: var(--ink); }
.mdrop.ok .mdrop-tag b { color: var(--ok); } .mdrop.warn .mdrop-tag b { color: var(--warn); } .mdrop.bad .mdrop-tag b { color: var(--err); }
.mdrop-tag ul { margin: 3px 0 0; padding-left: 15px; }
.mdrop .mcr { display: block; color: var(--ink-3); font-variant-numeric: tabular-nums; margin-top: 3px; }
@media (prefers-reduced-motion: reduce) { .mghost { rotate: 0deg; } .mdrop { transition: none; } }

/* ------------------------------------------------------------------ Schedule tab */
.schedview { display: none; flex-direction: column; min-height: 0; overflow: auto; padding: 12px 14px 18px; gap: 12px; }
body[data-view="schedule"] .view-tabs [data-view="schedule"] { color: var(--ink); border-bottom-color: var(--gold-strong); }
body[data-view="schedule"] .layout { grid-template-columns: minmax(0, 1fr); }
body[data-view="schedule"] .library, body[data-view="schedule"] .audit, body[data-view="schedule"] .plan { display: none; }
body[data-view="schedule"] .schedview { display: flex; }
.sc-bar { display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: center; }
.sc-bar .field.inline { display: flex; align-items: center; gap: 8px; }
.sc-bar .field.inline > span { margin: 0; }
.sc-nav { display: flex; align-items: center; gap: 8px; margin-left: auto; font-variant-numeric: tabular-nums; }
.sc-stats { display: flex; flex-wrap: wrap; gap: 6px; width: 100%; }
.sc-stats span { font-size: 12px; padding: 2px 9px; border-radius: 99px; background: var(--panel-2); border: 1px solid var(--line); color: var(--ink-2); }
.sc-body { display: grid; grid-template-columns: minmax(260px, 320px) minmax(0, 1fr); gap: 14px; align-items: start; }
.sc-side { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.sc-side h4 { margin: 4px 0 0; font-size: 11px; text-transform: uppercase; letter-spacing: .4px; color: var(--ink-3); }
.sc-courses { display: flex; flex-direction: column; gap: 6px; }
.sc-course { display: grid; grid-template-columns: auto 1fr; gap: 2px 8px; padding: 7px 9px; border: 1px solid var(--line); border-radius: 9px; background: var(--panel-2); font-size: 12.5px; }
.sc-course.off { opacity: .55; }
.sc-course .check b { font-family: var(--mono); font-size: 12.5px; color: color-mix(in srgb, var(--sc) 70%, var(--ink)); }
.sc-course .t { color: var(--ink-2); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; align-self: center; }
.sc-course .meta, .sc-course .note, .sc-course .crns { grid-column: 1 / -1; font-size: 11.5px; color: var(--ink-3); }
.sc-course .note { color: var(--warn); }
.sc-course .crns { display: flex; flex-wrap: wrap; gap: 4px; }
.sc-course .crns span { font-family: var(--mono); padding: 0 6px; border-radius: 6px; background: var(--panel); border: 1px solid var(--line); color: var(--ink-2); }
.linkish { border: 0; background: none; padding: 0; color: var(--ink-2); text-decoration: underline; cursor: pointer; font-size: inherit; }
.sc-prefs { display: flex; flex-direction: column; gap: 8px; font-size: 12.5px; }
.sc-days { display: flex; gap: 8px; flex-wrap: wrap; }
.sc-days label { display: flex; gap: 3px; align-items: center; }
.sc-main { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.sc-msg { padding: 10px 12px; border-radius: 9px; background: var(--warn-soft); color: var(--ink); }
.sc-msg.bad { background: var(--err-soft); }
.sc-grid { display: grid; grid-template-columns: 52px repeat(auto-fit, minmax(90px, 1fr)); border: 1px solid var(--line); border-radius: 10px; overflow-x: auto; background: var(--panel); }
.sc-col, .sc-times { min-width: 0; border-left: 1px solid var(--line); }
.sc-times { border-left: 0; }
.sc-dayhead { height: 52px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; font-size: 12.5px; border-bottom: 1px solid var(--line); background: var(--panel-2); }
.sc-dayhead b { font-weight: 700; }
.sc-dayhead .hrs { font-size: 11.5px; font-weight: 650; color: var(--ink); font-variant-numeric: tabular-nums; }
.sc-dayhead .hrs.bad { color: var(--warn); }
.sc-dayhead .hrs.off { color: var(--ink-3); font-weight: 500; }
.sc-dayhead .span { font-size: 10.5px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.sc-daybody { position: relative; background: repeating-linear-gradient(to bottom, transparent 0, transparent 53px, var(--line) 53px, var(--line) 54px); }
.sc-hour { position: absolute; right: 6px; transform: translateY(-50%); font-size: 10.5px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.sc-hour:first-child { transform: none; }
.sc-block { position: absolute; padding: 3px 5px; border-radius: 7px; overflow: hidden; text-align: left; font-size: 11px; line-height: 1.25; cursor: pointer;
  background: color-mix(in srgb, var(--sc) 22%, var(--panel)); border: 1px solid color-mix(in srgb, var(--sc) 60%, var(--line)); border-left: 4px solid var(--sc); color: var(--ink);
  display: flex; flex-direction: column; gap: 0; box-sizing: border-box; }
.sc-block:hover, .sc-block:focus-visible { z-index: 2; box-shadow: 0 4px 14px rgba(0,0,0,.25); outline: none; }
.sc-block b { font-family: var(--mono); font-size: 11px; }
.sc-block .tm, .sc-block .rm { color: var(--ink-2); font-size: 10.5px; }
.sc-block .half { font-size: 9.5px; color: var(--warn); font-weight: 700; }
.sc-table { border: 1px solid var(--line); border-radius: 10px; background: var(--panel); }
.sc-table-head { display: flex; align-items: center; justify-content: space-between; padding: 8px 10px; border-bottom: 1px solid var(--line); }
.sc-table-head h4 { margin: 0; font-size: 13px; }
.sc-scroll { overflow-x: auto; }
.sc-table table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.sc-table th, .sc-table td { padding: 6px 10px; border-bottom: 1px solid var(--line); text-align: left; white-space: nowrap; }
.sc-table th { font-size: 11px; color: var(--ink-3); text-transform: uppercase; letter-spacing: .3px; }
.sc-table .mono { font-family: var(--mono); }
@media (max-width: 860px) {
  .sc-body { grid-template-columns: 1fr; }
  .sc-nav { margin-left: 0; }
}
.sc-prefs fieldset { border: 1px solid var(--line); border-radius: 9px; padding: 8px 10px 10px; margin: 0; display: flex; flex-direction: column; gap: 8px; }
.sc-prefs legend { font-size: 11px; font-weight: 700; color: var(--ink-3); text-transform: uppercase; letter-spacing: .4px; padding: 0 4px; }
.sc-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.sc-row.dim { opacity: .5; }
.sc-stats span.bad { background: var(--warn-soft); border-color: transparent; color: var(--warn); font-weight: 600; }
.sc-lunch { position: absolute; left: 3px; right: 3px; border: 1.5px dashed color-mix(in srgb, var(--ok) 60%, var(--line)); border-radius: 7px;
  background: color-mix(in srgb, var(--ok) 8%, transparent); color: var(--ok); font-size: 10.5px; font-weight: 700; display: grid; place-items: center; pointer-events: none; }
.sc-streak { position: absolute; right: 0; width: 4px; border-radius: 3px; background: var(--warn); pointer-events: none; z-index: 3; }

/* ------------------------------------------------------------------ phones */
.phone-only, .view-tabs .vs { display: none; }
.hosted [data-act="print"] { display: none; }
.sheet { display: flex; flex-direction: column; gap: 10px; }
.sheet-group { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.sheet-item { display: flex; flex-direction: column; align-items: flex-start; gap: 1px; text-align: left; border: 0; border-bottom: 1px solid var(--line);
  background: var(--panel); padding: 12px 14px; font-size: 15px; color: var(--ink); min-height: 48px; }
.sheet-item:last-child { border-bottom: 0; }
.sheet-item span { font-size: 12.5px; color: var(--ink-3); }
.sheet-item[data-act="plan-delete"] b { color: var(--err); }

@media (max-width: 820px) {
  .phone-only { display: inline-grid; }
  /* top bar: logo · plan picker · sync status · menu */
  .topbar { flex-wrap: nowrap; gap: 8px; padding: calc(6px + env(safe-area-inset-top, 0px)) 12px 6px; border-bottom-width: 2px; }
  .brand-name { display: none; }
  .plan-picker { order: 0; width: auto; flex: 1; min-width: 0; }
  .plan-picker select { width: 100%; min-width: 0; font-size: 15px; }
  .plan-picker .btn { display: none; }
  .actions { flex-wrap: nowrap; gap: 6px; margin-left: 0; }
  .actions > *:not(.save-status):not([data-act="mobile-menu"]) { display: none !important; }
  .actions [data-act="mobile-menu"] { font-size: 20px; width: 40px; height: 36px; }
  .save-status { font-size: 11px; padding: 3px 8px; white-space: nowrap; }

  /* views move to a bottom bar, like an app */
  .view-tabs { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; display: flex; justify-content: space-around; gap: 0;
    padding: 4px 4px calc(4px + env(safe-area-inset-bottom, 0px)); background: var(--panel); border-top: 1px solid var(--line-2);
    box-shadow: 0 -4px 16px rgba(0,0,0,.12); overflow: visible; }
  .view-tabs button { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 1px; padding: 6px 2px; min-height: 50px;
    border-bottom: 0 !important; border-top: 2px solid transparent; font-size: 11px; }
  .view-tabs .vi { font-size: 18px; line-height: 1; }
  .view-tabs .vl, .view-hint { display: none; }
  .view-tabs .vs { display: inline; }
  body[data-view="planner"] .view-tabs [data-view="planner"], body[data-view="semesters"] .view-tabs [data-view="semesters"],
  body[data-view="map"] .view-tabs [data-view="map"], body[data-view="audit"] .view-tabs [data-view="audit"],
  body[data-view="schedule"] .view-tabs [data-view="schedule"] { border-top-color: var(--gold-strong); color: var(--ink); }
  body { overflow: auto; }
  .layout { padding: 8px 12px calc(76px + env(safe-area-inset-bottom, 0px)); overflow: visible; }
  .mapview, .schedview { margin-bottom: calc(68px + env(safe-area-inset-bottom, 0px)); }

  /* dialogs become full-screen sheets */
  .modal-back { padding: 0; place-items: end stretch; }
  .modal, .modal.wide, .modal.swap-modal { width: 100%; max-height: 100dvh; height: 100dvh; border-radius: 0; border: 0; }
  .modal-head { padding: calc(10px + env(safe-area-inset-top, 0px)) 14px 10px; }
  .modal-foot { padding: 10px 14px calc(10px + env(safe-area-inset-bottom, 0px)); }
  .modal-foot .btn { min-height: 40px; }
  .modal-head .close { font-size: 26px; padding: 0 8px; }

  /* bigger touch targets */
  .btn { min-height: 36px; }
  select, input[type="text"], input[type="search"], input[type="number"] { font-size: 16px; } /* no iOS zoom-on-focus */
  .chip { padding: 9px 8px 9px 10px; }
  .chip .x { padding: 4px 6px; font-size: 16px; }

  /* summary cards scroll sideways instead of squeezing */
  #summary { overflow-x: auto; }

  /* schedule tab: narrow day columns that still fit five days */
  .sc-body { grid-template-columns: 1fr; }
  .sc-main { order: -1; }
  .sc-bar { gap: 8px; }
  .sc-nav { width: 100%; justify-content: space-between; }
  .sc-nav .btn { min-width: 48px; }
  .sc-grid { grid-template-columns: 34px repeat(5, minmax(0, 1fr)); }
  .sc-dayhead { height: 46px; font-size: 11px; }
  .sc-dayhead .hrs { font-size: 10px; }
  .sc-dayhead .span { display: none; }
  .sc-hour { font-size: 9.5px; right: 3px; }
  .sc-block { padding: 2px 3px; font-size: 9.5px; border-left-width: 3px; }
  .sc-block b { font-size: 9.5px; }
  .sc-block .rm, .sc-block .half { display: none; }
  .sc-block .tm { font-size: 9px; }
  .sc-stats span { font-size: 11px; }

  /* swap dialog: list on top, preview below */
  .swap { grid-template-columns: 1fr; }
  .swap-right { position: static; max-height: none; }

  /* map: keep the floating card clear of the bottom bar */
  .map-card { bottom: 10px; right: 10px; left: 10px; width: auto; }
}
.sc-block.occ { border-style: dashed; background: color-mix(in srgb, var(--sc) 10%, var(--panel)); opacity: .9; }
@media (max-width: 820px) {
  /* progress cards: one swipeable row so the semesters start on the first screen */
  #summary.summary { display: grid; grid-auto-flow: column; grid-auto-columns: 46%; grid-template-columns: none; grid-template-rows: auto auto;
    overflow-x: auto; overscroll-behavior-x: contain; scroll-snap-type: x proximity; gap: 8px; padding-bottom: 6px; height: auto !important; }
  #summary.summary > .prog-chips { grid-row: 1; grid-column: 1 / span 30; position: sticky; left: 0; }
  #summary.summary > .stat { grid-row: 2; scroll-snap-align: start; min-width: 0; }
  #summary-resizer { display: none; }
}

/* ------------------------------------------------------------------ accounts (public site) */
.hide { display: none !important; }
.linkish { background: none; border: 0; padding: 0; color: var(--plan); font: inherit; cursor: pointer; text-decoration: underline; text-underline-offset: 2px; }
kbd { font-family: var(--mono); font-size: 11px; border: 1px solid var(--line-2); border-bottom-width: 2px; border-radius: 4px; padding: 0 4px; background: var(--panel-2); }
.account-btn { max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
html.auth-open body > *:not(.auth-screen):not(#toast) { visibility: hidden; }
.auth-screen { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; overflow-y: auto; padding: 24px 16px;
  background: radial-gradient(1200px 500px at 50% -10%, var(--gold-soft), transparent), var(--bg); }
.auth-card { width: min(420px, 100%); background: var(--panel); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); padding: 22px; display: grid; gap: 12px; }
.auth-card h2 { margin: 4px 0 0; font-size: 19px; }
.auth-brand { display: flex; gap: 10px; align-items: center; }
.auth-brand .logo { width: 36px; height: 36px; border-radius: 9px; background: var(--gold); color: #000; display: grid; place-items: center; font-weight: 800; }
.auth-brand b { display: block; font-size: 17px; }
.auth-brand span { font-size: 12.5px; color: var(--ink-2); }
.auth-tabs { display: grid; grid-template-columns: 1fr 1fr; border: 1px solid var(--line-2); border-radius: 9px; overflow: hidden; }
.auth-tabs[hidden] { display: none; }
.auth-tabs button { border: 0; background: var(--panel); color: var(--ink-2); padding: 8px; font: inherit; font-weight: 600; cursor: pointer; }
.auth-tabs button[aria-selected="true"] { background: var(--ink); color: var(--panel); }
.auth-form { display: grid; gap: 10px; }
.auth-form input, .modal input[type="password"] { width: 100%; font-size: 16px; padding: 9px 10px; }
.btn.wide { width: 100%; justify-content: center; padding: 10px; font-size: 15px; }
.auth-err { color: var(--err); background: var(--err-soft); border-radius: 8px; padding: 8px 10px; font-size: 13.5px; font-weight: 600; }
.auth-err:empty { display: none; }
.auth-msg { background: var(--warn-soft); color: var(--warn); border-radius: 8px; padding: 8px 10px; font-size: 13px; }
.auth-links { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; font-size: 13px; }
.auth-foot { margin: 0; font-size: 11.5px; color: var(--ink-3); line-height: 1.45; }
.rc-code { font-family: var(--mono); font-size: 17px; letter-spacing: .5px; text-align: center; padding: 12px; border: 2px dashed var(--gold-strong);
  border-radius: 10px; background: var(--gold-soft); word-break: break-all; user-select: all; }
.rc-code.small { font-size: 13px; padding: 2px 6px; border-width: 1px; display: inline-block; }
.rc-actions { display: flex; gap: 8px; justify-content: center; }
.acct-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 8px; }
.tpl.danger b { color: var(--err); }
.totp-qr { display: grid; place-items: center; }
.totp-qr svg { width: 200px; height: 200px; background: #fff; border-radius: 8px; }

/* ------------------------------------------------------------------ custom programs */
.prog-add { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.pe-import { border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px; background: var(--panel-2); }
.pe-import summary { cursor: pointer; }
.pe-import ol { margin: 8px 0; padding-left: 20px; display: grid; gap: 3px; }
.pe-import textarea, .pe-main textarea { width: 100%; font-family: var(--mono); font-size: 12.5px; border: 1px solid var(--line-2); border-radius: 8px;
  padding: 8px; background: var(--panel); color: var(--ink); resize: vertical; }
.pe-row { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 6px; }
.pe-main { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 12px; align-items: start; }
.pe-preview { border: 1px solid var(--line); border-radius: 10px; padding: 8px; max-height: 420px; overflow-y: auto; display: grid; gap: 4px; }
.pe-preview .pill { white-space: normal; }
.pe-help code { font-family: var(--mono); background: var(--panel-2); padding: 0 3px; border-radius: 3px; }
@media (max-width: 820px) {
  .pe-main { grid-template-columns: 1fr; }
  .account-btn { max-width: 110px; }
}

/* ------------------------------------------------------------------ program picker */
.pk-top { display: grid; gap: 8px; }
.pk-top input[type="search"] { width: 100%; font-size: 16px; padding: 10px 12px; border: 1px solid var(--line-2); border-radius: 10px; background: var(--panel); color: var(--ink); }
.pk-kinds { display: flex; flex-wrap: wrap; gap: 6px; }
.pk-kinds .pchip.on { background: var(--ink); color: var(--panel); border-color: var(--ink); }
.pk-main { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); gap: 12px; margin-top: 10px; min-height: 340px; }
.pk-list { display: grid; gap: 4px; align-content: start; max-height: 52vh; overflow-y: auto; padding-right: 4px; }
.pk-item { display: grid; gap: 2px; text-align: left; border: 1px solid var(--line); border-radius: 9px; padding: 8px 10px; background: var(--panel); color: var(--ink); cursor: pointer; font: inherit; }
.pk-item:hover, .pk-item.sel { border-color: var(--gold-strong); background: var(--gold-soft); }
.pk-item b { font-size: 13.5px; }
.pk-item span { font-size: 12px; color: var(--ink-2); }
.pk-detail { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; max-height: 52vh; overflow-y: auto; display: grid; gap: 6px; align-content: start; }
.pk-detail h3 { margin: 0; font-size: 16px; }
.pk-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.pk-note { margin-top: 8px; }
@media (max-width: 820px) {
  .pk-main { grid-template-columns: 1fr; }
  .pk-list, .pk-detail { max-height: none; }
}
