:root {
  --green: #0b5d3b;
  --green-700: #0a4d31;
  --green-300: #34a06a;
  --green-50: #eaf5ef;
  --gold: #c9a227;
  --gold-700: #8a6a10;   /* AA-contrast gold for small text on light backgrounds */
  --ink: #1c2421;
  --muted: #6b7872;
  --line: #e2e8e4;
  --bg: #f4f7f5;
  --card: #ffffff;
  --shadow: 0 1px 2px rgba(16,40,30,.06), 0 4px 16px rgba(16,40,30,.06);
  --radius: 12px;

  /* course kind colors */
  --c-math: #2563eb;     --c-math-bg: #e8effe;
  --c-science: #0891b2;  --c-science-bg: #e2f5f9;
  --c-cve: #0b5d3b;      --c-cve-bg: #e7f2ec;
  --c-egr: #7c3aed;      --c-egr-bg: #f0e9fe;
  --c-coop: #b45309;     --c-coop-bg: #fbefdf;
  --c-gened: #be185d;    --c-gened-bg: #fce8f0;
  --c-elective: #475569; --c-elective-bg: #eef1f5;
  --c-minor: #15803d;    --c-minor-bg: #e7f6ec;
  --c-transfer: #0d9488; --c-transfer-bg: #d7f2ee;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; height: 100%; }
body {
  font-family: "Inter", system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--ink);
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
}

/* ---------- Top bar ---------- */
.topbar {
  display: flex; align-items: center; gap: 24px;
  padding: 12px 20px;
  background: linear-gradient(100deg, var(--green-700), var(--green));
  color: #fff;
  box-shadow: var(--shadow);
  z-index: 20;
}
.brand { display: flex; align-items: center; gap: 12px; }
.brand-mark {
  width: 44px; height: 44px; border-radius: 10px;
  background: #fff; color: var(--green);
  display: grid; place-items: center;
  font-weight: 800; font-size: 16px; letter-spacing: .5px;
}
.brand-text h1 { margin: 0; font-size: 17px; font-weight: 700; }
.brand-text p { margin: 1px 0 0; font-size: 12px; opacity: .85; }

.tabs { display: flex; gap: 4px; margin-left: 8px; }
.tab {
  background: transparent; border: none; color: rgba(255,255,255,.8);
  padding: 9px 16px; border-radius: 8px; font-size: 14px; font-weight: 600;
  cursor: pointer; transition: .15s;
}
.tab:hover { background: rgba(255,255,255,.12); color: #fff; }
.tab.active { background: #fff; color: var(--green); }
.tab-link { text-decoration: none; display: inline-flex; align-items: center; }

.topbar-actions { margin-left: auto; display: flex; gap: 8px; }
.btn {
  border: none; border-radius: 8px; padding: 8px 14px;
  font-size: 13px; font-weight: 600; cursor: pointer;
  background: var(--green); color: #fff; transition: .15s;
}
.btn:hover { filter: brightness(1.08); }
.btn.ghost { background: rgba(255,255,255,.15); color: #fff; }
.btn.ghost:hover { background: rgba(255,255,255,.28); }
.btn.danger { background: rgba(255,255,255,.12); color: #ffd9d9; }
.btn.danger:hover { background: #b91c1c; color: #fff; }
.btn.accent { background: var(--gold); color: #2a2202; }
.view .btn { box-shadow: var(--shadow); }

/* ---------- Progress strip ---------- */
.progress-strip {
  display: flex; align-items: center; gap: 18px;
  padding: 10px 22px; background: var(--card);
  border-bottom: 1px solid var(--line);
}
.prog-item { display: flex; align-items: baseline; gap: 6px; }
.prog-num { font-size: 20px; font-weight: 800; color: var(--green); }
.prog-label { font-size: 12.5px; color: var(--muted); }
.prog-bar-wrap {
  flex: 1; height: 9px; background: var(--green-50);
  border-radius: 99px; overflow: hidden; max-width: 480px;
}
.prog-bar { height: 100%; width: 0%; background: linear-gradient(90deg, var(--green-300), var(--green)); transition: width .4s; }

/* ---------- Layout ---------- */
main { flex: 1; overflow: hidden; position: relative; }
.view { display: none; height: 100%; }
.view.active { display: flex; }

/* ---------- Degree plan ---------- */
#view-plan { gap: 0; }
.bank {
  width: 290px; flex-shrink: 0; background: var(--card);
  border-right: 1px solid var(--line);
  display: flex; flex-direction: column; height: 100%;
}
.bank-head { padding: 14px 14px 8px; }
.bank-head h2 { margin: 0 0 8px; font-size: 14px; text-transform: uppercase; letter-spacing: .6px; color: var(--muted); }
.bank-head input {
  width: 100%; padding: 8px 10px; border: 1px solid var(--line);
  border-radius: 8px; font-size: 13px; font-family: inherit;
}
.bank-hint { padding: 0 14px 8px; font-size: 11.5px; color: var(--muted); }
.bank-list { flex: 1; overflow-y: auto; padding: 4px 12px 20px; }
.bank-group-label {
  font-size: 11.5px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .5px; color: var(--muted); margin: 12px 4px 4px;
}

.board {
  flex: 1; overflow-x: auto; overflow-y: hidden;
  display: flex; gap: 14px; padding: 16px; align-items: stretch;
}
.term {
  width: 230px; flex-shrink: 0; background: var(--card);
  border: 1px solid var(--line); border-radius: var(--radius);
  display: flex; flex-direction: column; box-shadow: var(--shadow);
}
.term.summer { background: #fbfdfb; border-style: dashed; }
.term.transfer { background: var(--c-transfer-bg); border-color: var(--c-transfer); }
.term.transfer .t-label { color: var(--c-transfer); }
.term-head {
  padding: 10px 12px; border-bottom: 1px solid var(--line);
  display: flex; justify-content: space-between; align-items: center;
}
.term-head .t-label { font-weight: 700; font-size: 13px; }
.term-head .t-credits {
  font-size: 11px; font-weight: 700; color: var(--green);
  background: var(--green-50); padding: 2px 8px; border-radius: 99px;
}
.term-head .t-credits.warn { color: #b45309; background: #fbefdf; }
.term-head .t-credits.heavy { color: #b91c1c; background: #fde8e8; }
.term-body {
  flex: 1; overflow-y: auto; padding: 8px; min-height: 60px;
  display: flex; flex-direction: column; gap: 6px;
}
.term-body.dragover { background: var(--green-50); outline: 2px dashed var(--green-300); outline-offset: -4px; }

/* ---------- Course cards ---------- */
.course {
  border: 1px solid var(--line); border-left: 4px solid var(--c-elective);
  border-radius: 8px; padding: 7px 9px; background: #fff;
  cursor: grab; user-select: none; transition: .12s;
  position: relative;
}
.course:hover { box-shadow: var(--shadow); transform: translateY(-1px); }
.course.dragging { opacity: .4; }
.course .c-code { font-weight: 700; font-size: 12.5px; }
.course .c-title { font-size: 12.5px; color: var(--muted); line-height: 1.3; margin-top: 2px; }
.course .c-cred { position: absolute; top: 7px; right: 9px; font-size: 11.5px; font-weight: 700; color: var(--muted); }
.course .c-note { font-size: 11px; color: var(--gold-700); margin-top: 3px; font-weight: 600; }
.course.placed-elsewhere { opacity: .35; pointer-events: none; }

/* placeholder choice slots on the board */
.slot-card {
  border: 1.5px dashed #c2cfc8; border-radius: 8px; padding: 7px 9px;
  background: #fbfdfc; cursor: pointer; position: relative; transition: .12s;
}
.slot-card:hover { border-color: var(--gold); background: #fffdf5; }
.slot-card .slot-label { font-weight: 700; font-size: 12.5px; color: var(--gold-700); }
.slot-card .slot-sub { font-size: 11px; color: var(--muted); margin-top: 2px; }
.slot-opts { display: flex; flex-direction: column; gap: 6px; max-height: 50vh; overflow-y: auto; margin-bottom: 12px; }
.slot-opt { text-align: left; border: 1px solid var(--line); background: #fff; border-radius: 8px; padding: 8px 10px; font-size: 12.5px; cursor: pointer; font-family: inherit; }
.slot-opt:hover { border-color: var(--green-300); }
.slot-opt.sel { background: var(--green); color: #fff; border-color: var(--green); }
.slot-opt:disabled { opacity: .5; cursor: not-allowed; }
.slot-opt .so-meta { color: var(--muted); font-size: 11px; display: block; margin-top: 2px; }
.slot-opt.sel .so-meta { color: rgba(255,255,255,.85); }
.slot-opt .so-code { font-weight: 700; }
.slot-progwrap { display: flex; flex-direction: column; gap: 4px; margin-bottom: 12px; }
.slot-prog { display: flex; justify-content: space-between; align-items: center; font-size: 12px; padding: 6px 10px; border-radius: 7px; background: #fbefdf; }
.slot-prog.done { background: var(--green-50); }
.slot-prog .sp-name { font-weight: 600; }
.slot-prog .sp-val { font-weight: 700; color: #b45309; white-space: nowrap; }
.slot-prog.done .sp-val { color: var(--green); }
.const-themes { display: flex; flex-direction: column; gap: 5px; margin: 10px 0; }
.const-theme { font-size: 12px; padding: 7px 10px; border-radius: 7px; background: #f1f4f2; border: 1px solid var(--line); }
.const-theme.rec { background: var(--green-50); border-color: var(--green-300); font-weight: 600; color: var(--green); }
.const-theme em { color: var(--muted); font-style: normal; font-size: 11px; }
/* category tag on placed elective/gen-ed cards */
.course .c-cat { font-size: 10.5px; font-weight: 700; color: var(--gold-700); margin-top: 3px; text-transform: uppercase; letter-spacing: .3px; }

.course[data-kind="math"]    { border-left-color: var(--c-math); }
.course[data-kind="science"] { border-left-color: var(--c-science); }
.course[data-kind="cve"]     { border-left-color: var(--c-cve); }
.course[data-kind="egr"]     { border-left-color: var(--c-egr); }
.course[data-kind="coop"]    { border-left-color: var(--c-coop); }
.course[data-kind="gened"]   { border-left-color: var(--c-gened); }
.course[data-kind="elective"]{ border-left-color: var(--c-elective); }
.course[data-kind="minor"]   { border-left-color: var(--c-minor); }
.course[data-kind="transfer"]{ border-left-color: var(--c-transfer); }

.bank-list .course[data-kind="math"]    { background: var(--c-math-bg); }
.bank-list .course[data-kind="science"] { background: var(--c-science-bg); }
.bank-list .course[data-kind="cve"]     { background: var(--c-cve-bg); }
.bank-list .course[data-kind="egr"]     { background: var(--c-egr-bg); }
.bank-list .course[data-kind="coop"]    { background: var(--c-coop-bg); }
.bank-list .course[data-kind="gened"]   { background: var(--c-gened-bg); }
.bank-list .course[data-kind="elective"]{ background: var(--c-elective-bg); }
.bank-list .course[data-kind="minor"]   { background: var(--c-minor-bg); }
.bank-list .course[data-kind="transfer"]{ background: var(--c-transfer-bg); }
.event[data-kind="minor"]    { background: var(--c-minor); }
.req-card.minor-card { border-color: var(--c-minor); background: #f4fbf6; }

/* ---------- Requirements view ---------- */
#view-requirements { overflow-y: auto; padding: 22px; }
#view-requirements.active { display: block; }
.req-wrap { max-width: 980px; margin: 0 auto; display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.prereq-warn, .prereq-ok { grid-column: 1 / -1; border-radius: var(--radius); padding: 12px 16px; box-shadow: var(--shadow); }
.prereq-warn { background: #fdf3f3; border: 1px solid #e3a6a6; }
.prereq-warn h3 { margin: 0 0 6px; font-size: 14px; color: #b91c1c; }
.prereq-warn div { font-size: 12.5px; margin: 3px 0; color: var(--ink); }
.prereq-ok { background: var(--green-50); border: 1px solid var(--green-300); color: var(--green); font-weight: 600; font-size: 13px; }
.req-card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 14px 16px; box-shadow: var(--shadow);
}
.req-card.done { border-color: var(--green-300); }
.req-card .req-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.req-card h3 { margin: 0; font-size: 14px; }
.req-badge {
  flex-shrink: 0; font-size: 11px; font-weight: 700; padding: 3px 10px;
  border-radius: 99px; background: #fbefdf; color: #b45309; white-space: nowrap;
}
.req-badge.done { background: var(--green-50); color: var(--green); }
.req-note { font-size: 11.5px; color: var(--muted); margin: 6px 0 8px; }
.req-courses { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 8px; }
.req-pill {
  font-size: 11px; padding: 3px 8px; border-radius: 6px;
  background: #f1f4f2; color: var(--muted); border: 1px solid var(--line);
}
.req-pill.met { background: var(--green-50); color: var(--green); border-color: var(--green-300); font-weight: 600; }
.req-pill.met::before { content: "✓ "; }

/* ---------- Weekly schedule ---------- */
#view-schedule { flex-direction: column; }
.sched-toolbar {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 18px; background: var(--card); border-bottom: 1px solid var(--line);
}
.sched-toolbar label { font-size: 13px; font-weight: 600; }
.sched-toolbar select { font-family: inherit; font-size: 13px; padding: 6px 8px; border-radius: 7px; border: 1px solid var(--line); margin-left: 6px; }
.conflict-note { margin-left: auto; font-size: 13px; font-weight: 600; }
.conflict-note.bad { color: #b91c1c; }
.conflict-note.ok { color: var(--green); }

/* section-options picker */
.section-picker { background: #f8faf9; border-bottom: 1px solid var(--line); padding: 8px 14px; max-height: 38vh; overflow-y: auto; }
.section-picker:empty { display: none; }
.sp-row { display: flex; align-items: flex-start; gap: 10px; padding: 6px 0; border-bottom: 1px dashed #e6ece8; }
.sp-row:last-child { border-bottom: none; }
.sp-course { width: 92px; flex-shrink: 0; font-weight: 700; font-size: 12.5px; padding-top: 5px; }
.sp-course small { display: block; font-weight: 500; color: var(--muted); font-size: 10.5px; }
.sp-chips { display: flex; flex-wrap: wrap; gap: 6px; flex: 1; }
.sp-chip {
  border: 1px solid var(--line); border-radius: 8px; padding: 5px 9px; background: #fff;
  cursor: pointer; font-size: 11.5px; line-height: 1.3; transition: .12s; position: relative;
}
.sp-chip:hover { border-color: var(--green-300); box-shadow: var(--shadow); }
.sp-chip .sp-days { font-weight: 700; }
.sp-chip .sp-meta { color: var(--muted); display: block; font-size: 10px; }
.sp-chip.active { background: var(--green); border-color: var(--green); color: #fff; }
.sp-chip.active .sp-meta { color: rgba(255,255,255,.85); }
.sp-chip.conflict { border-color: #e3a6a6; background: #fdf3f3; }
.sp-chip.conflict::after { content: "✕ conflicts"; display: block; font-size: 9px; color: #b91c1c; font-weight: 700; }
.sp-chip.full { opacity: .55; }
.sp-chip.rec:not(.active) { border-color: var(--gold); box-shadow: 0 0 0 1px var(--gold) inset; }
.sp-chip .sp-rec { color: var(--gold); font-weight: 700; font-size: 9px; display: block; }
.sp-chip.active .sp-rec { color: #ffe9a8; }

.calendar { flex: 1; overflow: auto; padding: 0; position: relative; }
.cal-grid { display: grid; grid-template-columns: 56px repeat(7, 1fr); min-width: 820px; position: relative; }
.cal-corner, .cal-day-head {
  position: sticky; top: 0; background: var(--card); z-index: 5;
  border-bottom: 1px solid var(--line); border-right: 1px solid var(--line);
  padding: 8px 6px; text-align: center; font-size: 12px; font-weight: 700;
}
.cal-time {
  border-right: 1px solid var(--line); border-bottom: 1px solid #eef2ef;
  font-size: 10.5px; color: var(--muted); text-align: right; padding: 2px 6px 0 0;
  height: 48px; position: relative;
}
.cal-cell { border-right: 1px solid #eef2ef; border-bottom: 1px solid #eef2ef; height: 48px; position: relative; }
.cal-col { position: relative; }
.event {
  position: absolute; left: 3px; right: 3px; border-radius: 7px;
  padding: 4px 7px; font-size: 11px; color: #fff; overflow: hidden;
  box-shadow: 0 1px 4px rgba(0,0,0,.18); cursor: pointer; z-index: 3;
}
.event .e-code { font-weight: 700; display: block; }
.event .e-time { font-size: 11px; opacity: .95; }
.event .e-loc { font-size: 11px; opacity: .9; }
.event.practice { background: linear-gradient(135deg, var(--gold), #a8861f); color: #2a2202; }
.event.practice .e-code { color: #2a2202; }
.event.conflict { outline: 2px solid #b91c1c; outline-offset: -1px; }
.event[data-kind="math"]    { background: var(--c-math); }
.event[data-kind="science"] { background: var(--c-science); }
.event[data-kind="cve"]     { background: var(--c-cve); }
.event[data-kind="egr"]     { background: var(--c-egr); }
.event[data-kind="coop"]    { background: var(--c-coop); }
.event[data-kind="gened"]   { background: var(--c-gened); }
.event[data-kind="elective"]{ background: var(--c-elective); }
.empty-note { padding: 30px; text-align: center; color: var(--muted); font-size: 14px; }

/* ---------- Build Schedule ---------- */
#view-build { flex-direction: column; }
.build-toolbar {
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
  padding: 12px 18px; background: var(--card); border-bottom: 1px solid var(--line);
}
.build-toolbar label { font-size: 13px; font-weight: 600; }
.build-toolbar select { font-family: inherit; font-size: 13px; padding: 6px 8px; border-radius: 7px; border: 1px solid var(--line); margin-left: 6px; }
.build-toolbar .chk { display: inline-flex; align-items: center; gap: 5px; font-weight: 500; }
.build-count { margin-left: auto; font-size: 13px; font-weight: 700; color: var(--green); }
.build-count.none { color: #b91c1c; }
.build-body { flex: 1; display: flex; overflow: hidden; }
.build-side {
  width: 230px; flex-shrink: 0; background: #f8faf9; border-right: 1px solid var(--line);
  padding: 14px; overflow-y: auto;
}
.build-side h4 { margin: 0 0 8px; font-size: 11px; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); }
.build-side h4:not(:first-child) { margin-top: 18px; }
.build-include label { display: flex; align-items: center; gap: 7px; font-size: 12.5px; padding: 4px 0; cursor: pointer; }
.build-jumps { display: flex; flex-direction: column; gap: 6px; }
.build-jumps .btn { width: 100%; text-align: left; }
.build-hint { font-size: 11px; color: var(--muted); margin-top: 16px; line-height: 1.4; }
.build-main { flex: 1; display: flex; flex-direction: column; overflow: hidden; }
.build-pager {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 16px; background: var(--card); border-bottom: 1px solid var(--line);
}
.build-pager .btn { box-shadow: var(--shadow); }
#build-status { font-size: 13px; font-weight: 600; min-width: 280px; text-align: center; }
#build-status .safe { color: var(--green); }
#build-status .warn { color: #b45309; }
#build-cal { flex: 1; overflow: auto; }
.build-side .btn.ghost { background: #fff; color: var(--ink); border: 1px solid var(--line); box-shadow: none; }
.build-side .btn.ghost:hover { border-color: var(--green-300); }
/* Pager Prev/Next are ghost buttons on a light bar — need dark text (top-bar version is white). */
.build-pager .btn.ghost { background: #eef1f5; color: var(--ink); border: 1px solid var(--line); }
.build-pager .btn.ghost:hover { background: #e2e8e4; }

/* ---------- Modal ---------- */
.modal-overlay { position: fixed; inset: 0; background: rgba(16,30,24,.45); display: grid; place-items: center; z-index: 50; }
.modal { background: #fff; border-radius: 14px; padding: 22px; width: 420px; max-width: 92vw; box-shadow: 0 20px 60px rgba(0,0,0,.3); }
.modal h3 { margin: 0 0 14px; }
.modal label { display: block; font-size: 12.5px; font-weight: 600; margin-bottom: 12px; }
.modal label .opt { font-weight: 400; color: var(--muted); }
.modal input[type="text"], .modal input[type="time"], .modal select {
  width: 100%; margin-top: 4px; padding: 8px 10px; font-family: inherit;
  font-size: 13px; border: 1px solid var(--line); border-radius: 8px;
}
.modal .days { border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; margin-bottom: 12px; display: flex; flex-wrap: wrap; gap: 8px; }
.modal .days legend { font-size: 12px; font-weight: 600; padding: 0 4px; }
.modal .days label { display: inline-flex; align-items: center; gap: 3px; margin: 0; font-weight: 500; }
.modal .days input { width: auto; margin: 0; }
.time-row { display: flex; gap: 12px; }
.time-row label { flex: 1; }
.modal-actions { display: flex; align-items: center; gap: 8px; margin-top: 6px; }
/* In the white modal, ghost buttons need dark text (the top-bar version is white). */
.modal .btn.ghost { background: #eef1f5; color: var(--ink); }
.modal .btn.ghost:hover { background: #e2e8e4; }
#m-delete { background: #fde8e8; color: #b91c1c; }
#m-delete:hover { background: #b91c1c; color: #fff; }

/* ---------- Plan Wizard ---------- */
.wiz-overlay { position: fixed; inset: 0; background: rgba(16,30,24,.5); display: grid; place-items: center; z-index: 55; }
.wiz { background: #fff; border-radius: 16px; width: 760px; max-width: 94vw; max-height: 88vh; display: flex; flex-direction: column; box-shadow: 0 24px 70px rgba(0,0,0,.34); overflow: hidden; }
.wiz-head { display: flex; align-items: center; gap: 16px; padding: 16px 20px; background: linear-gradient(100deg, var(--green-700), var(--green)); color: #fff; }
.wiz-head h3 { margin: 0; font-size: 17px; }
.wiz-mode { display: flex; gap: 4px; margin-left: 8px; }
.wiz-mode-btn { background: rgba(255,255,255,.15); color: rgba(255,255,255,.9); border: none; padding: 6px 12px; border-radius: 7px; font-size: 12.5px; font-weight: 600; cursor: pointer; }
.wiz-mode-btn.active { background: #fff; color: var(--green); }
.wiz-close { margin-left: auto; background: transparent; border: none; color: #fff; font-size: 18px; cursor: pointer; opacity: .85; }
.wiz-close:hover { opacity: 1; }
.wiz-termbar { display: flex; align-items: center; gap: 14px; padding: 12px 20px; border-bottom: 1px solid var(--line); }
.wiz-termbar label { font-size: 13px; font-weight: 600; }
.wiz-termbar select { font-family: inherit; font-size: 13px; padding: 6px 8px; border-radius: 7px; border: 1px solid var(--line); margin-left: 6px; }
.wiz-progress { margin-left: auto; font-size: 12.5px; font-weight: 700; color: var(--green); }
.wiz-body { flex: 1; overflow-y: auto; padding: 16px 20px; }
.wiz-sec { margin-bottom: 18px; }
.wiz-sec h4 { margin: 0 0 10px; font-size: 12px; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); }
.wiz-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.wiz-chip { font-size: 12px; padding: 5px 10px; border-radius: 7px; background: var(--green-50); color: var(--green); font-weight: 600; }
.wiz-chip.locked::before { content: "🔒 "; }
.wiz-empty { font-size: 12.5px; color: var(--muted); }
.wiz-req { border: 1px solid var(--line); border-radius: 10px; padding: 11px 13px; margin-bottom: 10px; }
.wiz-req.done { background: #f6faf7; border-color: var(--green-300); }
.wiz-req-head { font-size: 13px; font-weight: 700; margin-bottom: 8px; }
.wiz-done { font-size: 11px; color: var(--green); font-weight: 600; margin-left: 6px; }
.wiz-opts { display: flex; flex-wrap: wrap; gap: 6px; }
.wiz-opt { font-size: 12px; padding: 5px 10px; border-radius: 7px; border: 1px solid var(--line); background: #fff; cursor: pointer; transition: .12s; }
.wiz-opt:hover { border-color: var(--green-300); }
.wiz-opt.sel { background: var(--green); color: #fff; border-color: var(--green); }
.wiz-opt.sel::before { content: "✓ "; }
.wiz-hint { font-size: 11px; color: var(--muted); margin-top: 6px; }
.wiz-foot { display: flex; align-items: center; gap: 8px; padding: 14px 20px; border-top: 1px solid var(--line); }
.wiz-foot .btn.ghost { background: #eef1f5; color: var(--ink); }
.wiz-foot .btn.ghost:hover { background: #e2e8e4; }

/* ---------- Toast ---------- */
.toast {
  position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%);
  background: var(--ink); color: #fff; padding: 10px 18px; border-radius: 99px;
  font-size: 13px; font-weight: 600; box-shadow: var(--shadow); z-index: 60;
}

/* ---------- Course-color legend (Degree Plan bank) ---------- */
.bank-legend { margin: 2px 14px 8px; font-size: 11.5px; color: var(--muted); }
.bank-legend summary { cursor: pointer; font-weight: 600; letter-spacing: .3px; }
.bank-legend .legend-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 3px 10px; margin-top: 7px; }
.bank-legend span { display: flex; align-items: center; }
.bank-legend i { display: inline-block; width: 11px; height: 11px; border-radius: 3px; margin-right: 5px; flex-shrink: 0; }

/* ---------- Degree Audit ---------- */
#view-audit.active { display: block; overflow-y: auto; }
.audit-wrap { max-width: 1000px; margin: 0 auto; padding: 22px 26px 60px; }
.audit-headline { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.audit-headline h2 { margin: 0; font-size: 22px; color: var(--green-700); }
.audit-headline p { margin: 3px 0 0; color: var(--muted); font-size: 13px; }
.audit-stats { display: flex; flex-wrap: wrap; gap: 12px; margin: 18px 0 6px; }
.audit-stat { flex: 1 1 120px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; box-shadow: var(--shadow); }
.audit-stat .as-num { display: block; font-size: 26px; font-weight: 800; color: var(--ink); line-height: 1; }
.audit-stat .as-label { display: block; font-size: 11.5px; color: var(--muted); margin-top: 5px; }
.audit-stat.ok .as-num { color: var(--green); }
.audit-stat.gpa { background: var(--green-50); border-color: var(--green-300); }
.audit-note { font-size: 12.5px; color: var(--ink); background: var(--green-50); border-radius: 8px; padding: 9px 12px; margin: 12px 0 22px; }
.audit-group { margin-bottom: 26px; }
.audit-group > h3 { font-size: 13px; text-transform: uppercase; letter-spacing: .6px; color: var(--green-700); border-bottom: 2px solid var(--line); padding-bottom: 5px; margin: 0 0 12px; }
.audit-req { border: 1px solid var(--line); border-radius: 10px; margin-bottom: 10px; overflow: hidden; background: var(--card); }
.audit-req.done { border-color: var(--green-300); }
.audit-req-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 9px 12px; background: #f7faf8; border-bottom: 1px solid var(--line); }
.audit-req-head h4 { margin: 0; font-size: 13.5px; color: var(--ink); }
.audit-req-badge { font-size: 11.5px; font-weight: 700; color: var(--muted); white-space: nowrap; }
.audit-req-badge.done { color: var(--green); }
.audit-table { width: 100%; border-collapse: collapse; }
.audit-table td { padding: 7px 12px; border-top: 1px solid var(--line); font-size: 12.5px; vertical-align: middle; }
.audit-table tr:first-child td { border-top: none; }
.ac-title { color: var(--muted); }
.ac-term { color: var(--muted); white-space: nowrap; }
.ac-cr { text-align: right; font-variant-numeric: tabular-nums; color: var(--muted); width: 42px; }
.ac-sub { display: block; font-size: 10.5px; color: var(--gold-700); font-weight: 600; }
.audit-badge { display: inline-block; font-size: 11px; font-weight: 700; padding: 1px 9px; border-radius: 99px; }
.audit-badge.b-done { background: #e2f3e8; color: #15803d; }
.audit-badge.b-await { background: #fbf0da; color: #92600b; }
.audit-badge.b-prog { background: #e5edfd; color: #1d4ed8; }
.audit-badge.b-plan { background: #eef1f5; color: #475569; }
.audit-badge.b-with { background: #fbe3e3; color: #b91c1c; }
.audit-grade { padding: 3px 6px; border: 1px solid var(--line); border-radius: 6px; font-size: 12.5px; font-weight: 700; background: #fff; color: var(--ink); }
.audit-tr { font-size: 11px; font-weight: 700; color: var(--c-transfer); }
.audit-empty-row td { color: var(--muted); font-style: italic; }

/* Print: the Degree Audit only, laid out for paper / PDF */
@media print {
  .topbar, .progress-strip, #btn-print-audit { display: none !important; }
  body { height: auto; overflow: visible; }
  main { overflow: visible !important; height: auto !important; }
  .view { display: none !important; }
  #view-audit, #view-audit.active { display: block !important; height: auto !important; overflow: visible !important; }
  .audit-wrap { max-width: none; padding: 0; }
  .audit-stat, .audit-req { box-shadow: none; }
  .audit-group, .audit-req { break-inside: avoid; }
}

/* ---------- Schedule mode switcher (Weekly view / Auto-build) ---------- */
.sched-modes { display: flex; gap: 5px; padding: 12px 16px 2px; }
.sched-mode-btn { font-family: inherit; font-size: 13px; font-weight: 600; padding: 7px 15px; border: 1px solid var(--line); background: var(--card); color: var(--muted); border-radius: 8px; cursor: pointer; }
.sched-mode-btn:hover { background: var(--green-50); }
.sched-mode-btn.active { background: var(--green); color: #fff; border-color: var(--green); }

/* ---------- Topbar "More" menu ---------- */
.tb-more { position: relative; }
.tb-more-menu { position: absolute; right: 0; top: calc(100% + 6px); background: var(--card); border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow); padding: 6px; min-width: 190px; z-index: 40; display: flex; flex-direction: column; gap: 2px; }
.tb-more-menu .menu-item { text-align: left; font-family: inherit; font-size: 13px; padding: 8px 10px; border: none; background: none; border-radius: 7px; cursor: pointer; color: var(--ink); }
.tb-more-menu .menu-item:hover { background: var(--green-50); }
.tb-more-menu .menu-item.danger { color: #b91c1c; }
.tb-more-menu .menu-item.danger:hover { background: #fdeaea; }

/* ---------- First-run welcome ---------- */
.welcome-overlay { position: fixed; inset: 0; background: rgba(16,32,26,.55); display: flex; align-items: center; justify-content: center; z-index: 60; padding: 20px; }
.welcome-card { background: var(--card); border-radius: 16px; width: min(520px, calc(100vw - 32px)); max-height: 90vh; overflow-y: auto; padding: 28px 30px; box-shadow: 0 12px 48px rgba(0,0,0,.28); }
.welcome-card * { max-width: 100%; }
.welcome-card h2 { margin: 0 0 10px; font-size: 22px; color: var(--green-700); }
.welcome-card p { margin: 0 0 14px; color: var(--ink); font-size: 14px; line-height: 1.5; }
.welcome-steps { margin: 0 0 20px; padding-left: 20px; color: var(--ink); font-size: 13.5px; line-height: 1.55; }
.welcome-steps li { margin-bottom: 7px; }
.welcome-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.welcome-actions .btn { box-shadow: var(--shadow); }
.welcome-actions .btn.ghost { background: var(--green-50); color: var(--green-700); }

/* ---------- Tap-to-place, remove button, selection ---------- */
.course.selected { outline: 3px solid var(--gold); outline-offset: 1px; box-shadow: var(--shadow); }
.term-body.place-target { outline: 2px dashed var(--green-300); outline-offset: -3px; }
.c-remove { position: absolute; top: 4px; right: 5px; width: 20px; height: 20px; padding: 0; border: none; background: none; color: var(--muted); font-size: 18px; line-height: 1; cursor: pointer; border-radius: 5px; }
.c-remove:hover, .c-remove:focus-visible { background: #fbe3e3; color: #b91c1c; }
.course:has(.c-remove) .c-cred { right: 32px; }
.event .e-warn { font-weight: 800; }

/* ---------- Keyboard focus visibility ---------- */
:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }
.tab:focus-visible, .btn:focus-visible { outline-offset: -2px; }
.course:focus-visible { outline: 3px solid var(--gold); outline-offset: 1px; }
.term-body:focus-visible { outline: 2px solid var(--green); outline-offset: -3px; }

/* ---------- Responsive: tablet ---------- */
@media (max-width: 900px) {
  .topbar { flex-wrap: wrap; gap: 10px 14px; padding: 10px 14px; }
  .tabs { order: 3; width: 100%; overflow-x: auto; }
  .topbar-actions { flex-wrap: wrap; }
  #view-plan { flex-direction: column; }
  .bank { width: 100%; max-height: 40vh; border-right: none; border-bottom: 1px solid var(--line); }
  .req-wrap { grid-template-columns: 1fr; }
}
/* ---------- Responsive: phone ---------- */
@media (max-width: 600px) {
  .brand-text p { display: none; }
  .brand-text h1 { font-size: 16px; }
  .term { width: 80vw; }
  .progress-strip { flex-wrap: wrap; gap: 6px 14px; }
  .prog-bar-wrap { order: 3; width: 100%; }
  .sched-toolbar, .build-toolbar { flex-wrap: wrap; }
  .audit-stat { flex-basis: 44%; }
  .audit-wrap { padding: 16px 14px 50px; }
  .welcome-card { padding: 22px 20px; }
  .welcome-actions { flex-direction: column; }
  .welcome-actions .btn { width: 100%; }
}

/* ---------- Auth gate ---------- */
.auth-overlay { position: fixed; inset: 0; z-index: 100; display: flex; align-items: center; justify-content: center; padding: 20px; background: linear-gradient(135deg, var(--green-700), var(--green)); }
.auth-overlay[hidden] { display: none; }
.auth-card { width: min(400px, 100vw - 32px); background: var(--card); border-radius: 16px; padding: 28px 30px 22px; box-shadow: 0 14px 50px rgba(0,0,0,.35); display: flex; flex-direction: column; gap: 12px; }
.auth-brand { display: flex; align-items: center; gap: 10px; font-weight: 800; color: var(--green-700); font-size: 17px; }
.auth-brand .brand-mark { width: 34px; height: 34px; font-size: 13px; }
.auth-card h2 { margin: 6px 0 0; font-size: 20px; color: var(--ink); }
.auth-sub { margin: 0 0 6px; color: var(--muted); font-size: 13px; }
.auth-card label { display: flex; flex-direction: column; gap: 4px; font-size: 12.5px; font-weight: 600; color: var(--ink); }
.auth-card input { padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; font-size: 14px; font-family: inherit; }
.auth-card input:focus-visible { outline: 2px solid var(--green); outline-offset: 1px; border-color: var(--green); }
.auth-card .btn { justify-content: center; text-align: center; padding: 11px; font-size: 14px; box-shadow: var(--shadow); margin-top: 4px; }
.auth-card .btn:disabled { opacity: .6; cursor: default; }
.auth-toggle { background: none; border: none; color: var(--green); font-size: 13px; font-weight: 600; cursor: pointer; padding: 6px; }
.auth-error { color: #b91c1c; font-size: 12.5px; min-height: 16px; font-weight: 600; }
.user-email { display: flex; align-items: center; color: rgba(255,255,255,.9); font-size: 12.5px; font-weight: 600; margin-left: 4px; max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* the brand mark reused inside the auth card */
.auth-brand .brand-mark { background: var(--green-50); color: var(--green-700); display: flex; align-items: center; justify-content: center; border-radius: 8px; font-weight: 800; }

/* ---------- Collapsible sidebar layout ---------- */
.app-shell { display: flex; height: 100vh; }
.app-main { flex: 1; display: flex; flex-direction: column; min-width: 0; overflow: hidden; }

.sidebar-toggle { position: fixed; top: 10px; left: 10px; z-index: 60; width: 40px; height: 40px; border: none; border-radius: 8px; background: var(--green); color: #fff; font-size: 18px; cursor: pointer; box-shadow: var(--shadow); }
.sidebar-scrim { position: fixed; inset: 0; background: rgba(0,0,0,.4); z-index: 45; opacity: 0; pointer-events: none; transition: opacity .2s; }

.sidebar { width: 250px; flex-shrink: 0; background: linear-gradient(160deg, var(--green-700), var(--green)); color: #fff; display: flex; flex-direction: column; overflow-y: auto; transition: margin-left .22s ease; z-index: 50; }
body:not(.sidebar-open) .sidebar { margin-left: -250px; }

.sidebar-brand { display: flex; align-items: center; gap: 10px; padding: 56px 16px 14px; }
.sidebar-brand .brand-text h1 { margin: 0; font-size: 16px; color: #fff; }
.sidebar-brand .brand-text p { margin: 2px 0 0; font-size: 11px; color: rgba(255,255,255,.7); }

.sidebar-nav { display: flex; flex-direction: column; gap: 2px; padding: 6px 10px; }
.sidebar-nav .tab { display: flex; align-items: center; gap: 10px; text-align: left; background: none; border: none; color: rgba(255,255,255,.85); font-family: inherit; font-size: 14px; font-weight: 600; padding: 10px 12px; border-radius: 8px; cursor: pointer; text-decoration: none; }
.sidebar-nav .tab:hover { background: rgba(255,255,255,.12); color: #fff; }
.sidebar-nav .tab.active { background: #fff; color: var(--green-700); }
.sidebar-nav .tab .ti { font-size: 15px; width: 18px; text-align: center; }

.sidebar-tools { display: flex; flex-direction: column; gap: 5px; padding: 12px; margin-top: 6px; border-top: 1px solid rgba(255,255,255,.15); }
.sidebar-label { font-size: 10.5px; text-transform: uppercase; letter-spacing: .6px; color: rgba(255,255,255,.55); font-weight: 700; margin: 2px 4px 4px; }
.side-btn { text-align: left; background: rgba(255,255,255,.1); color: #fff; border: none; border-radius: 7px; padding: 8px 11px; font-family: inherit; font-size: 12.5px; font-weight: 600; cursor: pointer; }
.side-btn:hover { background: rgba(255,255,255,.2); }
.side-btn.accent { background: var(--gold); color: #2a2202; }
.side-btn.danger:hover { background: #b91c1c; }
.side-btn.ghost { background: rgba(255,255,255,.08); }

.sidebar-foot { margin-top: auto; padding: 12px; border-top: 1px solid rgba(255,255,255,.15); display: flex; flex-direction: column; gap: 8px; }
.sidebar-foot .user-email { color: rgba(255,255,255,.9); font-size: 12px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* admin-only items hidden unless the signed-in user is an admin */
body:not(.is-admin) .admin-only { display: none !important; }
/* clear the fixed hamburger when the sidebar is collapsed */
body:not(.sidebar-open) .progress-strip { padding-left: 62px; }

@media (max-width: 900px) {
  .sidebar { position: fixed; top: 0; left: 0; height: 100vh; box-shadow: 4px 0 24px rgba(0,0,0,.3); }
  body.sidebar-open .sidebar-scrim { opacity: 1; pointer-events: auto; }
  .progress-strip { padding-left: 62px; }
}

/* ---------- Users (admin) page ---------- */
#view-users.active { display: block; overflow-y: auto; }
.users-wrap { max-width: 780px; margin: 0 auto; padding: 22px 24px 60px; }
.users-head h2 { margin: 0; font-size: 22px; color: var(--green-700); }
.users-head p { margin: 4px 0 18px; color: var(--muted); font-size: 13px; }
.invite-box { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 16px 18px; box-shadow: var(--shadow); margin-bottom: 20px; }
.invite-box h3, .users-section h3 { font-size: 13px; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); margin: 0 0 10px; }
.invite-form { display: flex; gap: 8px; flex-wrap: wrap; }
.invite-form input { flex: 1; min-width: 180px; padding: 9px 12px; border: 1px solid var(--line); border-radius: 8px; font-size: 14px; font-family: inherit; }
.invite-result { margin-top: 12px; font-size: 13px; color: var(--ink); }
.invite-result[hidden] { display: none; }
.ir-ok { margin-bottom: 6px; }
.invite-link { display: flex; gap: 6px; margin: 4px 0; }
.invite-link input { flex: 1; padding: 8px 10px; border: 1px solid var(--line); border-radius: 7px; font-size: 12px; background: var(--green-50); font-family: ui-monospace, "SF Mono", monospace; }
.btn.sm { padding: 6px 12px; font-size: 12.5px; }
.users-section { margin-bottom: 22px; }
.urow { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 11px 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--card); margin-bottom: 7px; }
.uinfo { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.uinfo b { font-size: 13.5px; }
.umeta { font-size: 11.5px; color: var(--muted); }
.ubadge { display: inline-block; margin-left: 6px; font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .4px; color: var(--green-700); background: var(--green-50); padding: 1px 7px; border-radius: 99px; vertical-align: middle; }
.uactions { display: flex; gap: 6px; flex-shrink: 0; }
.btn.ghost.sm { background: var(--green-50); color: var(--green-700); box-shadow: none; }
.btn.ghost.sm.danger { background: #fbe3e3; color: #b91c1c; }
.users-loading, .users-error { padding: 24px; color: var(--muted); }
.users-error { color: #b91c1c; }

/* scrollbars */
::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-thumb { background: #cdd8d2; border-radius: 99px; }
::-webkit-scrollbar-thumb:hover { background: #b3c2ba; }

@media (max-width: 760px) {
  .req-wrap { grid-template-columns: 1fr; }
  .brand-text p { display: none; }
}
