/* ============================================================
   MathLink v2 — NYU Shanghai Knowledge Network
   Modern redesign: cleaner typography, polished cards,
   graduation tracker, improved spacing
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800;900&display=swap');

:root {
  /* NYU Purple palette */
  --nyu-purple:    #57068c;
  --nyu-dark:      #2e0051;
  --nyu-mid:       #7b2fbe;
  --nyu-soft:      #f3eafa;
  --nyu-lighter:   #ecdff7;
  --nyu-glow:      rgba(87, 6, 140, 0.18);

  /* Neutrals */
  --ink:           #111827;
  --ink-2:         #374151;
  --muted:         #6b7280;
  --muted-light:   #9ca3af;
  --line:          #e5e7eb;
  --surface:       #ffffff;
  --page:          #f5f3f8;

  /* Accent colours */
  --green:         #059669;
  --green-soft:    #ecfdf5;
  --orange:        #d97706;
  --orange-soft:   #fffbeb;
  --red:           #dc2626;
  --red-soft:      #fef2f2;
  --teal:          #0891b2;
  --teal-soft:     #ecfeff;
  --gold:          #b45309;
  --gold-soft:     #fef3c7;

  /* Elevation */
  --shadow-xs: 0 1px 3px rgba(0,0,0,.07), 0 1px 2px rgba(0,0,0,.05);
  --shadow-sm: 0 4px 12px rgba(87,6,140,.08), 0 1px 4px rgba(0,0,0,.06);
  --shadow-md: 0 8px 24px rgba(87,6,140,.12), 0 2px 8px rgba(0,0,0,.06);
  --shadow-lg: 0 20px 48px rgba(87,6,140,.16), 0 4px 16px rgba(0,0,0,.08);

  /* Radii */
  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 16px;
  --r-xl: 20px;
  --r-pill: 999px;

  /* Sidebar */
  --sidebar-w: 220px;
}

/* ── Auth Overlay ───────────────────────────────────────────── */
.auth-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #1a0030 0%, #2e0051 40%, #57068c 80%, #7b2fbe 100%);
  transition: opacity 500ms ease, visibility 500ms ease;
}
.auth-overlay.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}
.auth-screen {
  display: none;
  flex-direction: column;
  align-items: center;
  width: 100%;
  max-width: 560px;
  padding: 32px 24px;
  animation: authFadeUp 400ms ease both;
}
.auth-screen.active { display: flex; }
.standalone-auth {
  min-height: 100vh;
}
.auth-page .auth-screen {
  max-width: 460px;
}
.auth-mode-toggle {
  width: min(100%, 360px);
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  padding: 6px;
  margin-bottom: 18px;
  border-radius: var(--r-md);
  background: rgba(255,255,255,.1);
  border: 1px solid rgba(255,255,255,.16);
}
.auth-mode-btn {
  border: 0;
  border-radius: var(--r-sm);
  padding: 10px 14px;
  background: transparent;
  color: rgba(255,255,255,.66);
  font-weight: 900;
  cursor: pointer;
}
.auth-mode-btn.active {
  background: #fff;
  color: var(--nyu-purple);
}
.auth-mode-panel {
  display: none;
}
.auth-mode-panel.active {
  display: flex;
}
.auth-hint a {
  color: #fff;
  font-weight: 900;
}
@keyframes authFadeUp {
  from { opacity: 0; transform: translateY(24px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Logo */
.auth-logo {
  width: 64px; height: 64px;
  display: grid; place-items: center;
  border-radius: 16px;
  background: rgba(255,255,255,0.15);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255,255,255,0.25);
  font-size: 2rem;
  margin-bottom: 20px;
  box-shadow: 0 8px 32px rgba(0,0,0,.25);
}
.auth-logo span { font-weight: 900; color: #fff; font-size: 1.6rem; }
.auth-overlay h1 {
  font-size: 2rem; font-weight: 900; color: #fff;
  text-align: center; margin-bottom: 6px; letter-spacing: -0.03em;
}
.auth-overlay .auth-sub {
  font-size: 0.92rem; color: rgba(255,255,255,.6);
  text-align: center; margin-bottom: 36px; font-weight: 500;
}

/* Role cards */
.role-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  width: 100%;
}
.role-card {
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  padding: 28px 20px;
  background: rgba(255,255,255,0.08);
  border: 1.5px solid rgba(255,255,255,0.18);
  border-radius: 16px;
  cursor: pointer;
  transition: all 220ms ease;
  text-align: center;
  color: #fff;
  backdrop-filter: blur(8px);
}
.role-card:hover {
  background: rgba(255,255,255,0.18);
  border-color: rgba(255,255,255,0.45);
  transform: translateY(-4px);
  box-shadow: 0 16px 40px rgba(0,0,0,.3);
}
.role-card .rc-icon { font-size: 2.6rem; }
.role-card strong { font-size: 1.1rem; font-weight: 800; display: block; }
.role-card span { font-size: 0.8rem; color: rgba(255,255,255,.65); line-height: 1.4; }

/* Login form screen */
.auth-back {
  align-self: flex-start;
  background: transparent; border: none; color: rgba(255,255,255,.65);
  font-size: 0.875rem; font-weight: 600; cursor: pointer;
  margin-bottom: 20px; padding: 4px 0;
  transition: color 160ms;
}
.auth-back:hover { color: #fff; }
.login-role-badge {
  width: 56px; height: 56px;
  display: grid; place-items: center;
  border-radius: 14px;
  background: rgba(255,255,255,.13);
  border: 1px solid rgba(255,255,255,.22);
  font-size: 1.8rem;
  margin-bottom: 14px;
}
.auth-overlay h2 {
  font-size: 1.6rem; font-weight: 800; color: #fff;
  text-align: center; margin-bottom: 4px; letter-spacing: -0.02em;
}
.auth-role-label {
  font-size: 0.78rem; font-weight: 700; color: rgba(255,255,255,.5);
  text-align: center; text-transform: uppercase; letter-spacing: 0.08em;
  margin-bottom: 28px;
}
.auth-form {
  width: 100%; display: grid; gap: 12px;
}
.auth-form input {
  width: 100%; height: 50px;
  background: rgba(255,255,255,.1);
  border: 1.5px solid rgba(255,255,255,.22);
  border-radius: 12px;
  color: #fff;
  padding: 0 18px;
  font-size: 0.95rem; font-weight: 500;
  outline: none;
  transition: border-color 160ms, background 160ms;
}
.auth-form input::placeholder { color: rgba(255,255,255,.4); }
.auth-form input:focus {
  border-color: rgba(255,255,255,.6);
  background: rgba(255,255,255,.15);
}
.auth-submit {
  width: 100%; height: 50px;
  background: #fff;
  border: none; border-radius: 12px;
  color: var(--nyu-dark);
  font-size: 1rem; font-weight: 800;
  cursor: pointer;
  transition: all 180ms ease;
  margin-top: 4px;
  box-shadow: 0 4px 20px rgba(0,0,0,.25);
}
.auth-submit:hover { transform: translateY(-2px); box-shadow: 0 8px 28px rgba(0,0,0,.35); }
.auth-secondary-submit {
  width: 100%;
  height: 48px;
  margin-top: 12px;
  background: rgba(255,255,255,.12);
  border: 1.5px solid rgba(255,255,255,.28);
  border-radius: 12px;
  color: #fff;
  font-size: 0.98rem;
  font-weight: 800;
  cursor: pointer;
  transition: all 180ms ease;
}
.auth-secondary-submit:hover {
  background: rgba(255,255,255,.18);
  transform: translateY(-1px);
}
.auth-error {
  min-height: 18px;
  color: #fca5a5;
  font-size: 0.83rem;
  font-weight: 600;
  text-align: center;
}
.auth-hint {
  margin-top: 16px;
  padding: 12px 16px;
  background: rgba(255,255,255,.08);
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,.14);
  font-size: 0.8rem;
  color: rgba(255,255,255,.55);
  text-align: center;
  line-height: 1.5;
  width: 100%;
}
.auth-hint code {
  color: rgba(255,255,255,.85);
  font-family: monospace;
  background: rgba(255,255,255,.12);
  padding: 1px 6px;
  border-radius: 4px;
}
.auth-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: none;
  place-items: center;
  padding: 24px;
  background: rgba(17, 0, 35, .58);
  backdrop-filter: blur(8px);
}
.auth-modal-backdrop.open { display: grid; }
.auth-register-modal {
  position: relative;
  width: min(440px, 100%);
  padding: 34px;
  background: #fff;
  border: 1px solid rgba(107, 33, 168, .16);
  border-radius: 18px;
  box-shadow: 0 28px 80px rgba(17, 0, 35, .34);
  color: var(--ink);
}
.auth-register-modal h2 {
  color: var(--nyu-dark);
  font-size: 1.55rem;
  font-weight: 900;
  letter-spacing: 0;
}
.auth-register-modal > p {
  margin: 8px 0 22px;
  color: var(--muted);
  font-weight: 600;
  line-height: 1.5;
}
.auth-modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 38px;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  color: var(--ink);
  font-size: 1.35rem;
  line-height: 1;
}
.auth-modal-close:hover { background: #f8f5ff; }
.auth-modal-form input {
  background: #fff;
  border: 1.5px solid var(--line);
  color: var(--ink);
}
.auth-modal-form input::placeholder { color: #9ca3af; }
.auth-modal-form input:focus {
  border-color: var(--nyu-purple);
  background: #fff;
}
.auth-modal-form .auth-submit {
  background: var(--nyu-purple);
  color: #fff;
  box-shadow: 0 10px 24px rgba(87, 6, 140, .26);
}
.auth-modal-form .auth-error { color: #dc2626; }

.ml-confirm-backdrop {
  position: fixed;
  inset: 0;
  z-index: 9200;
  display: none;
  place-items: center;
  padding: 24px;
  background: rgba(17, 0, 35, .58);
  backdrop-filter: blur(8px);
}
.ml-confirm-backdrop.open {
  display: grid;
}
.ml-confirm-modal {
  position: relative;
  width: min(440px, 100%);
  padding: 28px;
  border: 1px solid rgba(107, 33, 168, .16);
  border-radius: 16px;
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 28px 80px rgba(17, 0, 35, .34);
}
.ml-confirm-modal h3 {
  margin: 0 0 8px;
  color: var(--nyu-purple);
  font-size: 1.35rem;
  font-weight: 900;
}
.ml-confirm-modal p {
  margin: 0;
  color: var(--muted);
  font-weight: 650;
  line-height: 1.5;
}
.ml-dialog-input {
  width: 100%;
  height: 46px;
  margin-top: 16px;
  padding: 0 14px;
  border: 1.5px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  color: var(--ink);
  font-size: .95rem;
  font-weight: 700;
}
.ml-dialog-input:focus {
  outline: none;
  border-color: var(--nyu-purple);
  box-shadow: 0 0 0 3px rgba(87, 6, 140, .12);
}
.ml-confirm-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 20px;
  flex-wrap: wrap;
}
.ml-confirm-actions .danger-confirm {
  background: #dc2626;
  border-color: #dc2626;
}
.ml-confirm-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 36px;
  height: 36px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  color: var(--ink);
  font-size: 1.3rem;
  line-height: 1;
  cursor: pointer;
}

/* ── Reset ─────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--page);
  color: var(--ink);
  font-family: 'Inter', ui-sans-serif, system-ui, sans-serif;
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
a { color: var(--nyu-purple); text-decoration: none; }
a:hover { text-decoration: underline; }
p { margin: 0; }
h1,h2,h3,h4 { margin: 0; font-weight: 700; letter-spacing: -0.02em; }

/* ── App shell ──────────────────────────────────────────────── */
.app-shell {
  display: grid;
  grid-template-columns: var(--sidebar-w) minmax(0, 1fr);
  min-height: 100vh;
}

/* ── Sidebar ────────────────────────────────────────────────── */
.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 20px 14px 24px;
  background: linear-gradient(170deg, var(--nyu-dark) 0%, #3b0068 60%, var(--nyu-purple) 100%);
  color: #fff;
  overflow: hidden;
  z-index: 10;
  box-shadow: 4px 0 24px rgba(46, 0, 81, 0.3);
}

/* brand */
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 0 20px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
  margin-bottom: 8px;
}
.brand-mark {
  width: 38px; height: 38px;
  display: grid; place-items: center;
  border-radius: var(--r-sm);
  background: #fff;
  color: var(--nyu-purple);
  font-size: 1.05rem;
  font-weight: 900;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(0,0,0,.2);
}
.brand-text strong {
  display: block;
  font-size: 1rem;
  font-weight: 800;
  color: #fff;
  line-height: 1.2;
}
.brand-text span {
  display: block;
  font-size: 0.68rem;
  font-weight: 500;
  color: rgba(255,255,255,0.55);
  letter-spacing: 0.03em;
  text-transform: uppercase;
  margin-top: 2px;
}

/* nav */
.nav-section-label {
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.38);
  padding: 12px 8px 6px;
  margin-top: 4px;
}
.nav-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.18) transparent;
}
.nav-list::-webkit-scrollbar { width: 4px; }
.nav-list::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.18); border-radius: 2px; }
.nav-list::-webkit-scrollbar-track { background: transparent; }
.nav-item {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  padding: 9px 10px;
  border: 1px solid transparent;
  border-radius: var(--r-sm);
  background: transparent;
  color: rgba(255,255,255,0.68);
  font-size: 0.875rem;
  font-weight: 600;
  text-align: left;
  transition: all 160ms ease;
  white-space: nowrap;
}
.nav-item .nav-icon {
  font-size: 1rem;
  width: 20px;
  text-align: center;
  flex-shrink: 0;
}
.nav-item:hover {
  background: rgba(255,255,255,0.1);
  color: #fff;
}
.nav-item.active {
  background: rgba(255,255,255,0.15);
  border-color: rgba(255,255,255,0.22);
  color: #fff;
  font-weight: 700;
}
/* profile-nav is now pinned outside nav-list */
.profile-nav-pinned {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  padding: 9px 10px;
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: var(--r-sm);
  background: rgba(255,255,255,0.06);
  color: rgba(255,255,255,0.68);
  font-size: 0.875rem;
  font-weight: 600;
  text-align: left;
  transition: all 160ms ease;
  white-space: nowrap;
  flex-shrink: 0;
  margin-top: 6px;
}
.profile-nav-pinned .nav-icon {
  font-size: 1rem;
  width: 20px;
  text-align: center;
  flex-shrink: 0;
}
.profile-nav-pinned:hover {
  background: rgba(255,255,255,0.12);
  color: #fff;
}
.profile-nav-pinned.active {
  background: rgba(255,255,255,0.15);
  border-color: rgba(255,255,255,0.22);
  color: #fff;
  font-weight: 700;
}

.mobile-menu-toggle,
.mobile-menu-panel {
  display: none;
}

.sidebar-footer {
  margin-top: 12px;
  padding: 12px;
  border-radius: var(--r-sm);
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.1);
}
.sidebar-footer p {
  color: rgba(255,255,255,0.45);
  font-size: 0.72rem;
  line-height: 1.55;
}
.sidebar-footer .footer-label {
  display: block;
  font-size: 0.65rem;
  font-weight: 700;
  color: rgba(255,255,255,0.55);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 5px;
}

/* ── Workspace ──────────────────────────────────────────────── */
.workspace {
  display: flex;
  flex-direction: column;
  gap: 24px;
  padding: 32px 36px;
  min-width: 0;
}

/* ── Topbar ─────────────────────────────────────────────────── */
.topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--line);
}
.topbar-left .eyebrow {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--nyu-purple);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 8px;
}
.topbar h1 {
  font-size: clamp(1.2rem, 1.7vw, 1.6rem);
  font-weight: 700;
  color: var(--ink);
  max-width: 600px;
  line-height: 1.25;
}
.topbar-actions {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  flex-wrap: nowrap;
  flex-shrink: 0;
}

/* ── Metric cards ───────────────────────────────────────────── */
.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}
.metric {
  position: relative;
  padding: 18px 20px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  transition: box-shadow 200ms ease, transform 200ms ease;
}
.metric:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.metric::before {
  content: '';
  position: absolute;
  inset: 0 0 auto 0;
  height: 3px;
  background: linear-gradient(90deg, var(--nyu-purple), var(--nyu-mid));
  border-radius: var(--r-lg) var(--r-lg) 0 0;
}
.metric-icon {
  font-size: 1.4rem;
  margin-bottom: 10px;
  display: block;
}
.metric-label {
  font-size: 0.76rem;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.metric-value {
  display: block;
  font-size: 2rem;
  font-weight: 800;
  color: var(--ink);
  line-height: 1;
  margin: 8px 0 4px;
  font-variant-numeric: tabular-nums;
}
.metric-sub {
  font-size: 0.76rem;
  color: var(--muted-light);
}

/* ── Graduation Progress Banner ─────────────────────────────── */
.grad-banner {
  background: linear-gradient(135deg, var(--nyu-dark) 0%, var(--nyu-purple) 100%);
  border-radius: var(--r-lg);
  padding: 20px 24px;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 24px;
  flex-wrap: wrap;
  box-shadow: var(--shadow-md);
}
.grad-banner-text h3 {
  font-size: 1rem;
  font-weight: 700;
  color: #fff;
}
.grad-banner-text p {
  font-size: 0.82rem;
  color: rgba(255,255,255,.65);
  margin-top: 2px;
}
.grad-progress-wrap {
  flex: 1;
  min-width: 200px;
}
.grad-progress-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.76rem;
  color: rgba(255,255,255,.7);
  margin-bottom: 6px;
  font-weight: 600;
}
.grad-progress-bar {
  height: 10px;
  background: rgba(255,255,255,.2);
  border-radius: var(--r-pill);
  overflow: hidden;
}
.grad-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #c084fc, #f0abfc);
  border-radius: var(--r-pill);
  transition: width 600ms cubic-bezier(.4,0,.2,1);
}
.grad-stats {
  display: flex;
  gap: 24px;
  flex-shrink: 0;
}
.grad-stat {
  text-align: center;
}
.grad-stat strong {
  display: block;
  font-size: 1.6rem;
  font-weight: 800;
  color: #fff;
  line-height: 1;
}
.grad-stat span {
  display: block;
  font-size: 0.7rem;
  color: rgba(255,255,255,.6);
  margin-top: 3px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 600;
}

/* ── View panels ────────────────────────────────────────────── */
.view-panel {
  display: none;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  padding: 28px 30px;
  box-shadow: var(--shadow-sm);
}
.view-panel.active { display: block; }

body:not([data-active-view="planner"]):not([data-active-view="profile"]) #plannerHeroHeader {
  display: none;
}

.section-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}
.section-heading .eyebrow {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--nyu-purple);
  text-transform: uppercase;
  letter-spacing: 0.11em;
  margin-bottom: 7px;
}
.section-heading h2 {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--ink);
}
.section-heading-brand {
  display: flex;
  align-items: center;
  gap: 14px;
}
.view-logo {
  width: 56px;
  height: 56px;
  border-radius: 10px;
  flex-shrink: 0;
  object-fit: contain;
}

/* ── Form elements ──────────────────────────────────────────── */
.field-group {
  display: grid;
  gap: 5px;
}
.field-label {
  font-size: 0.76rem;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.field-input,
.field-select {
  height: 42px;
  border: 1.5px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--surface);
  color: var(--ink);
  padding: 0 14px;
  font-size: 0.9rem;
  font-weight: 500;
  transition: border-color 160ms ease, box-shadow 160ms ease;
  outline: none;
}
.field-input:focus, .field-select:focus {
  border-color: var(--nyu-purple);
  box-shadow: 0 0 0 3px rgba(87,6,140,.12);
}
.field-textarea {
  border: 1.5px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--surface);
  color: var(--ink);
  padding: 10px 14px;
  font-size: 0.9rem;
  line-height: 1.5;
  resize: vertical;
  outline: none;
  transition: border-color 160ms ease, box-shadow 160ms ease;
}
.field-textarea:focus {
  border-color: var(--nyu-purple);
  box-shadow: 0 0 0 3px rgba(87,6,140,.12);
}

/* old compat shims */
.search-box, .select-field { display: grid; gap: 5px; }
.select-field[hidden] { display: none; }
.search-box span, .select-field span {
  font-size: 0.76rem; font-weight: 700; color: var(--muted);
  text-transform: uppercase; letter-spacing: 0.05em;
}
.search-box input,
.select-field select {
  height: 42px;
  border: 1.5px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--surface);
  color: var(--ink);
  padding: 0 14px;
  font-size: 0.9rem;
  min-width: 180px;
  outline: none;
  transition: border-color 160ms, box-shadow 160ms;
}
.search-box input:focus, .select-field select:focus {
  border-color: var(--nyu-purple);
  box-shadow: 0 0 0 3px rgba(87,6,140,.12);
}

/* ── Buttons ────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 42px;
  padding: 0 18px;
  border-radius: var(--r-sm);
  font-size: 0.875rem;
  font-weight: 700;
  border: 1.5px solid transparent;
  cursor: pointer;
  white-space: nowrap;
  transition: all 160ms ease;
  outline: none;
  text-decoration: none;
}
.btn:focus-visible { box-shadow: 0 0 0 3px rgba(87,6,140,.3); }

.btn-primary {
  background: var(--nyu-purple);
  color: #fff;
  border-color: var(--nyu-purple);
  box-shadow: 0 2px 8px rgba(87,6,140,.3);
}
.btn-primary:hover {
  background: var(--nyu-dark);
  border-color: var(--nyu-dark);
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(87,6,140,.4);
}
.btn-secondary {
  background: var(--surface);
  color: var(--ink);
  border-color: var(--line);
  box-shadow: var(--shadow-xs);
}
.btn-secondary:hover {
  border-color: var(--nyu-purple);
  color: var(--nyu-purple);
  transform: translateY(-1px);
}
.btn-ghost {
  background: var(--nyu-soft);
  color: var(--nyu-purple);
  border-color: transparent;
}
.btn-ghost:hover { background: var(--nyu-lighter); }
.btn-danger {
  background: var(--red-soft);
  color: var(--red);
  border-color: transparent;
}
.btn-danger:hover { background: #fecaca; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none !important; }

/* legacy compat */
.primary-action {
  display: inline-flex; align-items: center; justify-content: center;
  height: 42px; padding: 0 18px;
  border-radius: var(--r-sm); font-size: 0.875rem; font-weight: 700;
  border: 1.5px solid var(--nyu-purple);
  background: var(--nyu-purple); color: #fff; cursor: pointer;
  transition: all 160ms ease;
  box-shadow: 0 2px 8px rgba(87,6,140,.3);
  white-space: nowrap;
}
.primary-action:hover { background: var(--nyu-dark); border-color: var(--nyu-dark); transform: translateY(-1px); }
.secondary-action {
  display: inline-flex; align-items: center; justify-content: center;
  height: 42px; padding: 0 18px;
  border-radius: var(--r-sm); font-size: 0.875rem; font-weight: 700;
  border: 1.5px solid var(--line); background: var(--surface);
  color: var(--ink); cursor: pointer; transition: all 160ms ease;
}
.secondary-action:hover { border-color: var(--nyu-purple); color: var(--nyu-purple); transform: translateY(-1px); }

/* ── Segmented control ──────────────────────────────────────── */
.segmented-control {
  display: flex;
  gap: 4px;
  padding: 4px;
  background: var(--nyu-soft);
  border: 1.5px solid var(--nyu-lighter);
  border-radius: var(--r-sm);
}
.segment {
  height: 34px;
  padding: 0 14px;
  border-radius: 6px;
  border: none;
  background: transparent;
  color: var(--muted);
  font-size: 0.83rem;
  font-weight: 600;
  transition: all 160ms ease;
}
.segment:hover { color: var(--nyu-purple); }
.segment.active {
  background: var(--surface);
  color: var(--nyu-purple);
  font-weight: 700;
  box-shadow: var(--shadow-xs);
}

/* ── Wallet ─────────────────────────────────────────────────── */
.wallet {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  background: var(--nyu-soft);
  border: 1.5px solid var(--nyu-lighter);
  border-radius: var(--r-sm);
}
.wallet-icon { font-size: 1.2rem; }
.wallet-label {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.wallet-amount {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--nyu-purple);
  font-variant-numeric: tabular-nums;
}

/* ── Knowledge Graph ────────────────────────────────────────── */
.network-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: 20px;
}
.graph-stage {
  min-height: 520px;
  border: 1.5px solid var(--line);
  border-radius: var(--r-lg);
  background:
    radial-gradient(circle at 20% 80%, rgba(87,6,140,.05) 0%, transparent 50%),
    radial-gradient(circle at 80% 20%, rgba(87,6,140,.04) 0%, transparent 50%),
    linear-gradient(90deg, rgba(87,6,140,.04) 1px, transparent 1px),
    linear-gradient(rgba(87,6,140,.04) 1px, transparent 1px),
    #fafbff;
  background-size: auto, auto, 30px 30px, 30px 30px;
  overflow: hidden;
  position: relative;
}
#graphSvg {
  display: block;
  width: 100%;
  height: 520px;
}
.edge {
  fill: none;
  stroke: #c7b7dc;
  stroke-width: 2;
  stroke-linecap: round;
  transition: opacity 200ms, stroke 200ms, stroke-width 200ms;
}
.edge.selected-edge { stroke: var(--nyu-purple); stroke-width: 3; }
.edge.incoming { stroke: var(--orange); }
.edge.outgoing { stroke: var(--green); }
.edge.dimmed, .node.dimmed, .node-label.dimmed { opacity: 0.12; }
.graph-level-band {
  fill: rgba(87, 6, 140, .028);
  stroke: none;
}
.graph-level-band-alt {
  fill: rgba(87, 6, 140, .058);
}
.graph-core-shelf {
  fill: rgba(23, 143, 100, .055);
  stroke: rgba(23, 143, 100, .14);
  stroke-width: 1;
  rx: 14;
}
.graph-core-label {
  fill: var(--green);
  font-size: 11px;
  font-weight: 850;
  text-transform: uppercase;
  letter-spacing: .04em;
  pointer-events: none;
}
.graph-level-label {
  fill: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .04em;
  pointer-events: none;
}
.node {
  stroke: #fff;
  stroke-width: 3;
  transition: opacity 180ms ease, filter 180ms ease;
  cursor: pointer;
}
.node:hover { filter: drop-shadow(0 6px 16px rgba(87,6,140,.35)); }
.node.selected { stroke: var(--nyu-dark); stroke-width: 4; }
.node.prereq { stroke: var(--orange); stroke-width: 4; }
.node.unlocks { stroke: var(--green); stroke-width: 4; }
.node-label {
  fill: var(--ink-2);
  font-size: 11.5px;
  font-weight: 700;
  paint-order: stroke;
  stroke: rgba(255,255,255,.95);
  stroke-width: 5px;
  pointer-events: none;
}
.detail-panel {
  background: var(--surface);
  border: 1.5px solid var(--line);
  border-radius: var(--r-lg);
  padding: 20px;
  box-shadow: var(--shadow-xs);
}
.detail-panel .panel-label {
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--nyu-purple);
  text-transform: uppercase;
  letter-spacing: 0.09em;
}
.detail-panel h3 {
  font-size: 1.2rem;
  font-weight: 700;
  margin: 8px 0 6px;
  color: var(--ink);
}
.detail-panel p {
  color: var(--muted);
  font-size: 0.875rem;
  line-height: 1.6;
  margin-bottom: 16px;
}
.detail-panel dl { display: grid; gap: 2px; margin: 0; }
.detail-panel dl div {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  border-top: 1px solid var(--line);
  gap: 12px;
}
.detail-panel dt { font-size: 0.83rem; font-weight: 600; color: var(--muted); }
.detail-panel dd {
  margin: 0;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--ink);
}
.graph-path-summary {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin: 12px 0;
}
.graph-path-summary div {
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 10px;
  background: #fafbff;
}
.graph-path-summary strong {
  display: block;
  color: var(--nyu-purple);
  font-size: 1.25rem;
  line-height: 1;
}
.graph-path-summary span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: .75rem;
  font-weight: 700;
}
.graph-detail-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 14px 0;
}
.graph-detail-list > strong {
  flex-basis: 100%;
  color: var(--ink);
  font-size: .82rem;
}
.graph-mini-node {
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  background: var(--surface);
  color: var(--nyu-purple);
  font-weight: 800;
  padding: 6px 10px;
  cursor: pointer;
}
.graph-mini-node:hover {
  border-color: var(--nyu-mid);
  background: var(--nyu-soft);
}
.muted { color: var(--muted); font-size: .82rem; }
.node-type-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: var(--r-pill);
  font-size: 0.73rem;
  font-weight: 700;
}
.type-course  { background: #ede9fe; color: #5b21b6; }
.type-concept { background: var(--green-soft); color: var(--green); }
.type-material{ background: var(--orange-soft); color: var(--orange); }

/* ── Learning paths ─────────────────────────────────────────── */
.path-view-actions {
  display: flex;
  align-items: end;
  justify-content: flex-end;
  gap: 14px;
  flex-wrap: wrap;
}
#targetSelect {
  display: none !important;
}
.learning-path-tabs {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px;
  border: 1.5px solid var(--line);
  border-radius: var(--r-md);
  background: var(--surface);
}
.learning-path-tab {
  border: 0;
  border-radius: var(--r-sm);
  background: transparent;
  color: var(--muted);
  padding: 10px 14px;
  font-weight: 800;
  cursor: pointer;
}
.learning-path-tab.active {
  background: var(--nyu-soft);
  color: var(--nyu-purple);
  box-shadow: inset 0 -2px 0 var(--nyu-purple);
}
.path-board {
  display: grid;
  grid-template-columns: repeat(5, minmax(120px, 1fr));
  gap: 12px;
  align-items: stretch;
  margin-top: 4px;
}
.path-step {
  position: relative;
  background: #fafbff;
  border: 1.5px solid var(--line);
  border-radius: var(--r-md);
  padding: 16px;
  transition: border-color 200ms, box-shadow 200ms;
}
.path-step:hover { border-color: var(--nyu-mid); box-shadow: var(--shadow-sm); }
.path-step:not(:last-child)::after {
  content: '›';
  position: absolute;
  top: 50%; right: -16px;
  transform: translateY(-50%);
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--nyu-lighter);
  z-index: 1;
}
.step-index {
  width: 28px; height: 28px;
  display: grid; place-items: center;
  border-radius: var(--r-sm);
  background: var(--nyu-soft);
  color: var(--nyu-purple);
  font-size: 0.8rem;
  font-weight: 800;
  margin-bottom: 10px;
}
.path-step h3 { font-size: 0.92rem; font-weight: 700; margin-bottom: 6px; }
.path-step p { font-size: 0.8rem; color: var(--muted); line-height: 1.5; }
.path-step-optional { border-style: dashed; background: var(--nyu-soft); }
.course-chain {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 12px;
}
.course-chain--has-or {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 12px;
}
.course-chain--has-or > .path-step {
  flex: 0 1 170px;
}
.course-chain--has-or > .path-step::after { display: none !important; }
.path-or-group {
  flex: 0 0 100%;
  border: 1.5px dashed var(--nyu-mid);
  border-radius: var(--r-md);
  padding: 12px 14px;
  background: var(--nyu-soft);
}
.path-or-label {
  font-size: 0.72rem;
  font-weight: 800;
  color: var(--nyu-purple);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 10px;
}
.path-or-cards {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.path-or-cards .path-step {
  flex: 1 1 150px;
  margin: 0;
}
.path-or-cards .path-step::after { display: none !important; }
.path-step-or {
  border-style: dashed;
  background: #fff;
}
.path-step-or .step-index {
  font-size: 0.68rem;
  width: auto;
  min-width: 28px;
  padding: 2px 7px;
  letter-spacing: 0.04em;
}
.path-step-target {
  flex: 0 0 100%;
  border-color: var(--nyu-purple);
  border-width: 2px;
}
.pn-flow {
  grid-column: 1 / -1;
  display: flex;
  align-items: stretch;
  gap: 0;
  padding: 4px 0;
}
.pn-flow--solo {
  align-items: flex-start;
}
.pn-prereqs {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
}
.pn-row {
  display: flex;
  align-items: center;
  flex: 1;
  gap: 0;
}
.pn-row > .pn-card,
.pn-row > .pn-or-box { flex: 1; min-width: 0; }
.pn-arrow {
  flex: 0 0 52px;
  text-align: center;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--nyu-purple);
  line-height: 1;
}
.pn-card {
  background: var(--surface);
  border: 1.5px solid var(--line);
  border-radius: var(--r-md);
  padding: 14px 16px;
  transition: border-color 200ms, box-shadow 200ms;
}
.pn-card:hover { border-color: var(--nyu-mid); box-shadow: var(--shadow-sm); }
.pn-card--or {
  border-style: dashed;
  background: #fff;
  padding: 10px 12px;
}
.pn-card--target {
  flex: 0 0 220px;
  border: 2px solid var(--nyu-purple);
  background: var(--nyu-soft);
  border-radius: var(--r-md);
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.pn-flow--solo .pn-card--target {
  flex: 0 0 auto;
}
.pn-card-code { font-size: 0.92rem; font-weight: 800; margin-bottom: 4px; }
.pn-card-title { font-size: 0.84rem; font-weight: 600; margin-bottom: 4px; }
.pn-card-meta { font-size: 0.76rem; color: var(--muted); }
.pn-target-label {
  font-size: 0.64rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--nyu-purple);
  opacity: 0.75;
  margin-bottom: 10px;
}
.pn-or-box {
  border: 1.5px dashed var(--nyu-mid);
  border-radius: var(--r-md);
  padding: 12px 14px;
  background: var(--nyu-soft);
}
.pn-or-label {
  font-size: 0.7rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--nyu-purple);
  margin-bottom: 10px;
}
.pn-or-cards {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.pn-or-cards .pn-card {
  flex: 1 1 130px;
}
.lp-major-browser {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 12px;
}
.lp-major-card {
  text-align: left;
  min-height: 118px;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: space-between;
  border: 1.5px solid var(--line);
  border-radius: var(--r-md);
  background: linear-gradient(135deg, #fff 0%, #fbf7ff 100%);
  padding: 16px 18px;
  cursor: pointer;
  transition: border-color 160ms, box-shadow 160ms, transform 160ms, background 160ms;
}
.lp-major-card:hover {
  border-color: var(--nyu-purple);
  box-shadow: 0 10px 26px rgba(87, 6, 140, 0.12);
  transform: translateY(-1px);
  background: #fff;
}
.lp-major-card strong,
.lp-major-card em,
.lp-major-card span {
  display: block;
}
.lp-major-card strong {
  color: var(--ink);
  font-size: 1rem;
  font-weight: 800;
  line-height: 1.3;
}
.lp-major-card em {
  margin-top: 6px;
  color: var(--muted);
  font-size: .78rem;
  font-style: normal;
}
.lp-major-card span {
  margin-top: 14px;
  color: var(--nyu-purple);
  font-size: .72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.lp-major-card small {
  color: var(--muted);
  font-size: .74rem;
  font-weight: 700;
}
.lp-major-card--empty {
  opacity: 0.62;
  border-style: dashed;
}
.lp-major-card--empty:hover {
  opacity: 1;
  border-style: dashed;
}
.path-drill-header {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border: 1.5px solid var(--line);
  border-radius: var(--r-md);
  background: var(--surface);
  padding: 14px;
}
.path-drill-header h3 {
  margin: 3px 0 0;
  color: var(--ink);
  font-size: 1.05rem;
}
.path-back-button {
  border-color: var(--nyu-purple);
  color: var(--nyu-purple);
  background: var(--nyu-soft);
  font-weight: 800;
}
.all-course-paths {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
}
.course-path-group h4 {
  margin: 0 0 10px;
  color: var(--nyu-purple);
  font-size: .78rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .06em;
}
.course-path-group-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 12px;
}
.course-path-card {
  text-align: left;
  border: 1.5px solid var(--line);
  border-radius: var(--r-md);
  background: var(--surface);
  padding: 14px;
  cursor: pointer;
  transition: border-color 160ms, box-shadow 160ms, transform 160ms;
}
.course-path-card:hover {
  border-color: var(--nyu-mid);
  box-shadow: var(--shadow-sm);
  transform: translateY(-1px);
}
.course-path-card strong,
.course-path-card span,
.course-path-card em {
  display: block;
}
.course-path-card strong { color: var(--nyu-purple); font-weight: 800; }
.course-path-card span { color: var(--ink); margin-top: 4px; font-weight: 700; }
.course-path-card em { color: var(--muted); margin-top: 8px; font-size: .78rem; font-style: normal; }
.course-reflection-shell {
  grid-column: 1 / -1;
  position: relative;
  display: block;
}
.course-reflection-form,
.course-reflection-browser {
  border: 1.5px solid var(--line);
  border-radius: var(--r-md);
  background: var(--surface);
  padding: 18px;
}
.course-reflection-form {
  display: grid;
  gap: 13px;
}
.reflection-form-head,
.reflection-library-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.reflection-form-head h3,
.reflection-library-head h3 {
  margin: 3px 0 0;
  color: var(--ink);
  font-size: 1rem;
}
.reflection-modal-close {
  width: 36px;
  height: 36px;
  border: 1.5px solid var(--line);
  border-radius: var(--r-sm);
  background: #fff;
  color: var(--muted);
  font-size: 1.25rem;
  font-weight: 800;
  cursor: pointer;
}
.course-reflection-form label,
.course-reflection-form label span {
  display: grid;
  gap: 7px;
}
.course-reflection-form label span {
  color: var(--muted);
  font-size: .76rem;
  font-weight: 800;
  letter-spacing: .05em;
  text-transform: uppercase;
}
.course-reflection-form input,
.course-reflection-form select,
.course-reflection-form textarea {
  width: 100%;
  border: 1.5px solid var(--line);
  border-radius: var(--r-sm);
  background: #fff;
  color: var(--ink);
  padding: 10px 12px;
  font: inherit;
}
.course-reflection-form textarea {
  min-height: 92px;
  resize: vertical;
}
.reflection-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.reflection-toolbar {
  display: grid;
  grid-template-columns: minmax(220px, 1.35fr) repeat(3, minmax(160px, 1fr)) auto;
  gap: 12px;
  align-items: center;
  margin: 16px 0 18px;
  padding: 14px;
  background: var(--nyu-soft);
  border: 1.5px solid var(--nyu-lighter);
  border-radius: var(--r-md);
}
.reflection-course-filter {
  min-width: 0;
}
.reflection-toolbar select,
.reflection-toolbar input {
  width: 100%;
  min-width: 0;
  height: 56px;
  border: 1.5px solid var(--line);
  border-radius: var(--r-md);
  background: var(--surface);
  color: var(--ink);
  padding: 0 42px 0 18px;
  font: inherit;
  font-size: 1rem;
  font-weight: 700;
  outline: none;
  transition: border-color 160ms, box-shadow 160ms;
}
.reflection-toolbar select:focus,
.reflection-toolbar input:focus {
  border-color: var(--nyu-purple);
  box-shadow: 0 0 0 3px rgba(87, 6, 140, .12);
}
#courseReflectionCount {
  color: var(--muted);
  font-weight: 800;
  white-space: nowrap;
}
.course-reflection-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}
.course-reflection-group {
  border: 1.5px solid var(--line);
  border-radius: var(--r-md);
  background: #fafbff;
  overflow: hidden;
}
.course-reflection-group summary {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) minmax(360px, auto);
  gap: 14px;
  align-items: center;
  padding: 16px 18px;
  cursor: pointer;
  list-style: none;
}
.course-reflection-group summary::-webkit-details-marker {
  display: none;
}
.course-reflection-group summary::after {
  content: "⌄";
  justify-self: end;
  color: var(--nyu-purple);
  font-weight: 900;
}
.course-reflection-group[open] summary::after {
  content: "⌃";
}
.reflection-course-summary-main strong,
.reflection-course-summary-main span {
  display: block;
}
.reflection-course-summary-main strong {
  color: var(--ink);
  font-weight: 900;
}
.reflection-course-summary-main span {
  margin-top: 4px;
  color: var(--muted);
  font-size: .82rem;
}
.reflection-course-summary-stats {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}
.reflection-course-summary-stats span {
  border-radius: 999px;
  background: var(--nyu-soft);
  color: var(--muted);
  padding: 7px 10px;
  font-size: .76rem;
  font-weight: 800;
}
.reflection-course-summary-stats b {
  color: var(--nyu-purple);
}
.course-reflection-group-body {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 12px;
  padding: 0 16px 16px;
}
.course-reflection-card {
  border: 1.5px solid var(--line);
  border-radius: var(--r-md);
  background: var(--surface);
  padding: 15px;
}
.course-reflection-card-head,
.reflection-meta-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.course-reflection-card-head {
  justify-content: space-between;
  margin-bottom: 10px;
}
.reflection-card-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.course-reflection-card h3 {
  margin: 0 0 8px;
  color: var(--ink);
  font-size: 1rem;
}
.reflection-meta-row {
  color: var(--muted);
  font-size: .78rem;
  margin-bottom: 10px;
}
.course-reflection-card p,
.course-reflection-card blockquote {
  color: var(--ink);
  font-size: .86rem;
  line-height: 1.55;
}
.course-reflection-card blockquote {
  margin: 10px 0 0;
  border-left: 3px solid var(--nyu-mid);
  padding-left: 10px;
  color: var(--muted);
}
.course-reflection-card footer {
  margin-top: 12px;
  color: var(--muted);
  font-size: .76rem;
}
.reflection-delete {
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: #fff;
  color: var(--muted);
  padding: 6px 9px;
  font-size: .76rem;
  font-weight: 800;
  cursor: pointer;
}
.reflection-empty {
  grid-column: 1 / -1;
  border: 1.5px dashed var(--line);
  border-radius: var(--r-md);
  padding: 24px;
  text-align: center;
  color: var(--muted);
}
.reflection-empty strong,
.reflection-empty span {
  display: block;
}
.reflection-empty strong {
  color: var(--ink);
  margin-bottom: 4px;
}
.reflection-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(20, 0, 34, .42);
}
.reflection-modal-backdrop.open {
  display: flex;
}
.reflection-modal-panel {
  width: min(720px, 100%);
  max-height: min(86vh, 860px);
  overflow: auto;
  border-radius: var(--r-md);
  box-shadow: var(--shadow-lg);
}

/* ── Resource marketplace ───────────────────────────────────── */
.resource-layout {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  gap: 24px;
  align-items: start;
  width: 100%;
}
.resource-layout.browse-mode {
  display: block;
}
.resource-layout.mine-mode {
  display: block;
}
.resource-layout.browse-mode .resource-list {
  width: 100%;
  min-width: 0;
}
.resource-layout.mine-mode .resource-list {
  width: 100%;
  min-width: 0;
}
.resource-layout.browse-mode .resource-toolbar {
  display: none;
}
.resource-layout.browse-mode .upload-panel,
.resource-layout.mine-mode .upload-panel {
  display: none;
}
.resource-layout.sell-mode {
  grid-template-columns: minmax(280px, 720px);
}
.resource-layout.sell-mode .resource-list {
  display: none;
}
.market-tabs {
  display: flex;
  gap: 18px;
  align-items: flex-end;
  border-bottom: 1.5px solid var(--line);
  margin-bottom: 18px;
  overflow-x: auto;
}
.market-tab {
  min-height: 48px;
  border: 0;
  border-bottom: 3px solid transparent;
  border-radius: var(--r-sm) var(--r-sm) 0 0;
  background: transparent;
  color: var(--muted);
  padding: 0 18px;
  font-weight: 800;
  white-space: nowrap;
}
.market-tab.active {
  background: var(--nyu-soft);
  color: var(--nyu-purple);
  border-bottom-color: var(--nyu-purple);
}
.market-mine-library {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(520px, 100%), 1fr));
  gap: 18px;
  align-items: start;
  width: 100%;
}
.market-mine-section {
  display: grid;
  gap: 14px;
  min-width: 0;
  align-content: start;
}
/* display:grid on <details> stops some browsers from hiding closed content —
   hide it explicitly so collapse always works. */
.market-mine-section:not([open]) > *:not(summary) {
  display: none;
}
.market-mine-heading {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  text-align: left;
  gap: 16px;
  padding: 14px 16px;
  border: 1.5px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--surface);
  cursor: pointer;
  list-style: none;
}
.market-mine-heading::-webkit-details-marker {
  display: none;
}
.market-mine-heading::before {
  content: "▸";
  flex: 0 0 auto;
  color: var(--nyu-purple);
  font-weight: 900;
  transition: transform .18s ease;
}
.market-mine-section[open] .market-mine-heading::before {
  transform: rotate(90deg);
}
.market-mine-heading h3 {
  margin: 0;
  color: var(--ink);
  font-size: 1rem;
}
.market-mine-heading p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: .82rem;
  line-height: 1.35;
}
.market-mine-heading span {
  flex: 0 0 auto;
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 38px;
  height: 32px;
  padding: 0 10px;
  border-radius: var(--r-pill);
  background: var(--nyu-soft);
  color: var(--nyu-purple);
  font-weight: 900;
}
.market-mine-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr));
  gap: 18px;
  max-height: 72vh;
  overflow: auto;
  padding-right: 2px;
}
.market-mine-empty {
  margin: 0;
  padding: 18px;
  border: 1.5px dashed var(--line);
  border-radius: var(--r-sm);
  color: var(--muted);
  background: var(--surface);
}
.marketplace-tile--featured {
  position: relative;
  border-color: var(--nyu-purple);
  box-shadow: 0 6px 20px rgba(87, 6, 140, 0.14);
}
.featured-ribbon {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 2;
  padding: 3px 10px;
  border-radius: var(--r-pill);
  background: var(--nyu-purple);
  color: #fff;
  font-size: .7rem;
  font-weight: 900;
  letter-spacing: .03em;
  box-shadow: 0 4px 12px rgba(87, 6, 140, 0.3);
}
.zip-contents {
  margin-top: 14px;
  border: 1.5px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--surface);
  padding: 12px 14px;
}
.zip-contents h4 {
  margin: 0 0 8px;
  font-size: .9rem;
  color: var(--ink);
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: baseline;
}
.zip-contents h4 span {
  font-size: .76rem;
  font-weight: 700;
  color: var(--muted);
}
.zip-contents ul {
  margin: 0;
  padding: 0;
  list-style: none;
  max-height: 240px;
  overflow: auto;
  display: grid;
  gap: 2px;
}
.zip-contents li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 4px 2px;
  font-size: .8rem;
  border-bottom: 1px dashed var(--line);
}
.zip-contents li span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--ink);
}
.zip-contents li em {
  flex: 0 0 auto;
  font-style: normal;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.zip-contents-more {
  margin: 8px 0 0;
  font-size: .78rem;
  color: var(--muted);
}
.feedback-fab {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 1500;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: none;
  background: var(--nyu-purple);
  color: #fff;
  font-size: 1.35rem;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(87, 6, 140, 0.35);
  transition: transform 140ms ease, box-shadow 140ms ease;
}
.feedback-fab:hover {
  transform: translateY(-2px) scale(1.05);
  box-shadow: 0 12px 30px rgba(87, 6, 140, 0.45);
}
.feedback-dialog {
  display: grid;
  gap: 12px;
  max-width: 440px;
}
.feedback-dialog h3 { margin: 0; }
.feedback-dialog-sub {
  margin: 0;
  color: var(--muted);
  font-size: .85rem;
}
.feedback-dialog label {
  display: grid;
  gap: 6px;
  font-size: .82rem;
  font-weight: 700;
  color: var(--muted);
}
.feedback-dialog select,
.feedback-dialog textarea {
  border: 1.5px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--surface);
  color: var(--ink);
  padding: 9px 12px;
  font: inherit;
  font-weight: 500;
}
.feedback-dialog textarea { resize: vertical; }
.feedback-dialog select:focus,
.feedback-dialog textarea:focus {
  border-color: var(--nyu-purple);
  outline: none;
}
.feedback-dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}
.maintenance-banner {
  position: sticky;
  top: 0;
  z-index: 2000;
  padding: 10px 18px;
  background: #fff3cd;
  border-bottom: 1.5px solid #d9b94e;
  color: #6b5310;
  font-weight: 700;
  font-size: .9rem;
  text-align: center;
}
.marketplace-disabled-notice {
  grid-column: 1 / -1;
  padding: 40px 24px;
  border: 1.5px dashed var(--line);
  border-radius: var(--r-md);
  background: var(--surface);
  color: var(--muted);
  font-weight: 700;
  text-align: center;
}
.market-filters.sell-mode {
  display: none;
}
.subject-directory {
  display: grid;
  gap: 18px;
}
.subject-directory-hero {
  background: linear-gradient(135deg, #f3e8ff, #f6eefb 52%, #f8f4ff);
  border: 1.5px solid #eadcf6;
  border-radius: var(--r-lg);
  padding: 24px 28px;
  display: flex;
  justify-content: space-between;
  gap: 20px;
  box-shadow: var(--shadow-sm);
}
.subject-directory-hero h3 {
  margin: 0 0 8px;
  font-size: 1.2rem;
  color: var(--ink);
}
.subject-directory-hero p {
  margin: 0;
  color: var(--muted);
}
.subject-stats {
  display: flex;
  gap: 22px;
  align-items: end;
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 900;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
}
.subject-stats span {
  display: grid;
  gap: 4px;
}
.subject-stats strong {
  color: var(--ink);
  font-size: 1.4rem;
  letter-spacing: 0;
}
.subject-directory-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(260px, 1fr));
  gap: 14px;
}
.subject-row {
  position: relative;
  min-height: 136px;
  border: 1.5px solid color-mix(in srgb, var(--tone, #d8c6ea) 65%, var(--line));
  border-radius: var(--r-md);
  background: linear-gradient(135deg, color-mix(in srgb, var(--tone, #f3e8ff) 22%, white), #fff);
  color: var(--ink);
  padding: 24px 28px;
  display: grid;
  align-content: start;
  gap: 12px;
  text-align: left;
  box-shadow: 0 10px 24px rgba(30, 16, 48, 0.05);
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}
@media (min-width: 1680px) {
  .subject-directory-grid {
    grid-template-columns: repeat(4, minmax(240px, 1fr));
  }
}
@media (max-width: 1280px) {
  .subject-directory-grid {
    grid-template-columns: repeat(2, minmax(260px, 1fr));
  }
}
.subject-row:hover {
  border-color: var(--nyu-purple);
  box-shadow: 0 16px 34px rgba(87, 6, 140, 0.14);
  transform: translateY(-2px);
}
.subject-tone-0 { --tone: #bdeee3; }
.subject-tone-1 { --tone: #f3dda1; }
.subject-tone-2 { --tone: #efd0b5; }
.subject-tone-3 { --tone: #d8cdf8; }
.subject-tone-4 { --tone: #bfe6f3; }
.subject-tone-5 { --tone: #ccd9f8; }
.subject-tone-6 { --tone: #d8d2f1; }
.subject-tone-7 { --tone: #e9e5a8; }
.subject-icon {
  font-size: 1.7rem;
  line-height: 1;
}
.subject-count {
  position: absolute;
  top: 20px;
  right: 22px;
  min-width: 34px;
  height: 34px;
  border: 1px solid color-mix(in srgb, var(--tone, #d8c6ea) 70%, var(--line));
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.62);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-weight: 900;
}
.subject-row strong {
  color: var(--ink);
  font-size: 1.05rem;
  line-height: 1.25;
}
.subject-row em {
  color: var(--muted);
  font-size: 0.82rem;
  font-style: normal;
  line-height: 1.45;
}
.subject-browse {
  color: var(--nyu-purple);
  font-size: 0.82rem;
  font-weight: 900;
}
.upload-panel {
  background: #fafbff;
  border: 1.5px solid var(--line);
  border-radius: var(--r-lg);
  padding: 20px;
  display: grid;
  gap: 14px;
}
.upload-panel .panel-label {
  font-size: 0.7rem; font-weight: 700; color: var(--nyu-purple);
  text-transform: uppercase; letter-spacing: 0.09em;
}
.upload-panel label {
  display: grid; gap: 5px;
  font-size: 0.75rem; font-weight: 700; color: var(--muted);
  text-transform: uppercase; letter-spacing: 0.04em;
}
.upload-panel input,
.upload-panel select,
.upload-panel textarea {
  width: 100%;
  border: 1.5px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--surface);
  color: var(--ink);
  padding: 0 12px;
  min-height: 40px;
  font-size: 0.875rem;
  outline: none;
  transition: border-color 160ms, box-shadow 160ms;
}
.upload-panel input:focus,
.upload-panel select:focus,
.upload-panel textarea:focus {
  border-color: var(--nyu-purple);
  box-shadow: 0 0 0 3px rgba(87,6,140,.1);
}
.upload-panel textarea { min-height: 88px; padding: 10px 12px; resize: vertical; }
.form-status { font-size: 0.82rem; color: var(--green); font-weight: 600; min-height: 18px; }
.muted-hint {
  color: var(--muted);
  font-weight: 600;
  text-transform: none;
  letter-spacing: 0;
  line-height: 1.35;
}

.resource-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
  font-size: 0.83rem;
  color: var(--muted);
  font-weight: 600;
}
.material-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
}
.resource-layout.mine-mode .material-grid {
  display: block;
}
.material-card {
  background: var(--surface);
  border: 1.5px solid var(--line);
  border-radius: var(--r-md);
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: box-shadow 200ms, transform 200ms;
}
.material-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.resource-preview {
  position: relative;
  min-height: 168px;
  margin: -8px -8px 4px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  overflow: hidden;
  background: linear-gradient(135deg, #f8fafc, var(--nyu-soft));
}
.resource-preview button,
button.resource-preview {
  color: inherit;
  font: inherit;
}
button.resource-preview {
  appearance: none;
  width: calc(100% + 16px);
  padding: 0;
  text-align: left;
  cursor: zoom-in;
}
.resource-preview-pages {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  padding: 10px;
}
.resource-preview-page {
  min-width: 0;
  margin: 0;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  overflow: hidden;
  background: #fff;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.4);
}
.resource-preview-page img {
  width: 100%;
  aspect-ratio: 8.5 / 11;
  object-fit: contain;
  display: block;
  background: #fff;
}
.resource-preview-page figcaption {
  padding: 4px 6px;
  font-size: 0.68rem;
  color: var(--muted);
  font-weight: 700;
}
.resource-preview-badge {
  position: absolute;
  left: 10px;
  bottom: 10px;
  padding: 5px 9px;
  border-radius: var(--r-pill);
  background: rgba(17, 24, 39, 0.78);
  color: #fff;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.02em;
}
.resource-preview-empty {
  display: grid;
  place-items: center;
  text-align: center;
  color: var(--muted);
}
.resource-preview-empty strong {
  display: block;
  color: var(--ink);
  font-size: 0.9rem;
}
.resource-preview-empty span {
  display: block;
  max-width: 180px;
  margin-top: 4px;
  font-size: 0.76rem;
  line-height: 1.35;
}
.resource-preview-backdrop {
  position: fixed;
  inset: 0;
  z-index: 9000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 28px;
  background: rgba(17, 24, 39, 0.68);
  backdrop-filter: blur(4px);
}
.resource-preview-backdrop.open {
  display: flex;
}
.resource-preview-modal {
  position: relative;
  width: min(1180px, 96vw);
  max-height: 92vh;
  overflow: auto;
  background: var(--surface);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-lg);
  padding: 22px;
}
.resource-preview-close {
  position: sticky;
  top: 0;
  float: right;
  width: 40px;
  height: 40px;
  border-radius: var(--r-pill);
  border: 1.5px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  font-size: 1.4rem;
  cursor: pointer;
  z-index: 2;
}
.resource-preview-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
  padding-right: 48px;
}
.resource-preview-modal-head span {
  display: block;
  color: var(--nyu-purple);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}
.resource-preview-modal-head h3 {
  color: var(--ink);
  font-size: 1.3rem;
}
.resource-preview-modal-head strong {
  color: var(--muted);
}
.resource-preview-large-pages {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(420px, 100%), 1fr));
  gap: 18px;
}
.resource-preview-large-pages figure {
  margin: 0;
  border: 1.5px solid var(--line);
  border-radius: var(--r-sm);
  overflow: hidden;
  background: #fff;
}
.resource-preview-large-pages img {
  display: block;
  width: 100%;
  height: auto;
  background: #fff;
}
.resource-preview-large-pages figcaption {
  padding: 8px 10px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  background: var(--surface-muted);
}
.material-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.tag {
  padding: 3px 9px;
  border-radius: var(--r-pill);
  font-size: 0.72rem;
  font-weight: 700;
}
.tag-topic { background: var(--nyu-soft); color: var(--nyu-purple); }
.tag-type  { background: var(--line); color: var(--muted); }
.material-card h3 { font-size: 0.95rem; font-weight: 700; color: var(--ink); line-height: 1.3; }
.material-card > p { font-size: 0.82rem; color: var(--muted); line-height: 1.55; flex: 1; }
.marketplace-tile {
  cursor: pointer;
}
.marketplace-tile h3 {
  min-height: 2.5em;
}
.marketplace-tile-author,
.marketplace-tile-foot {
  color: var(--muted);
  font-size: 0.82rem;
}
.marketplace-tile-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.marketplace-tile-foot strong {
  color: var(--nyu-purple);
}
.marketplace-detail-button {
  width: 100%;
  min-height: 38px;
}
.marketplace-owner-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 8px;
}
.marketplace-owner-actions .secondary-action {
  min-height: 36px;
  justify-content: center;
}
.detail-owner-actions {
  margin-top: 0;
}
.tile-hidden-control {
  display: none;
}
.marketplace-tile-rating {
  display: grid;
  gap: 7px;
  padding: 10px;
  border: 1px solid var(--line);
  background: var(--nyu-soft);
  border-radius: var(--r-sm);
}
.marketplace-tile-rating > strong,
.marketplace-rating-label {
  color: var(--ink);
  font-size: 0.78rem;
}
.marketplace-tile-rating .rating-button {
  padding: 0 3px;
  font-size: 0.72rem;
}
.marketplace-detail {
  grid-column: 1 / -1;
}
.market-detail-back {
  margin-bottom: 14px;
}
.marketplace-detail-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 360px);
  gap: 18px;
  align-items: start;
}
.marketplace-detail-main,
.marketplace-detail-side {
  background: var(--surface);
  border: 1.5px solid var(--line);
  border-radius: var(--r-md);
  padding: 18px;
  box-shadow: var(--shadow-sm);
}
.marketplace-detail-main .resource-preview {
  margin: 0 0 16px;
  min-height: 340px;
}
.marketplace-detail-main h2 {
  margin-bottom: 8px;
  color: var(--ink);
}
.marketplace-detail-side {
  position: sticky;
  top: 18px;
  display: grid;
  gap: 12px;
}
.resource-edit-modal {
  width: min(680px, 100%);
}
.resource-edit-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 18px;
}
.resource-edit-form label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: .78rem;
  font-weight: 850;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.resource-edit-form .ml-dialog-input {
  margin-top: 0;
}
.resource-edit-form textarea.ml-dialog-input {
  height: auto;
  min-height: 112px;
  padding-top: 12px;
  resize: vertical;
}
.resource-edit-wide,
.resource-edit-actions {
  grid-column: 1 / -1;
}
.auto-review-summary {
  display: grid;
  gap: 6px;
  margin: 12px 0;
  padding: 10px 12px;
  border-radius: var(--r-sm);
  background: var(--nyu-soft);
  color: var(--muted);
  font-size: 0.8rem;
}
.auto-review-summary span b {
  color: var(--ink);
}
.auto-review-summary p {
  margin: 0;
  line-height: 1.4;
}
.auto-review-summary.compact {
  margin: 0;
}
.ml-confirm-modal p {
  white-space: pre-line;
}
.resource-source {
  font-size: 0.78rem;
  color: var(--muted-light);
  border-top: 1px solid var(--line);
  padding-top: 10px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}
.resource-source strong { color: var(--muted); display: block; }
.seller-profile {
  display: grid;
  gap: 3px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--r-xs);
  background: color-mix(in srgb, var(--nyu-soft) 42%, var(--surface));
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.35;
}
.seller-profile span:first-child {
  color: var(--ink);
  font-weight: 800;
}
.seller-profile strong {
  color: var(--nyu-purple);
  font-size: 0.86rem;
  line-height: 1.25;
}
.seller-profile em {
  color: var(--muted);
  font-style: normal;
  font-size: 0.73rem;
}
.seller-rating-summary {
  display: grid;
  gap: 6px;
  padding: 12px 14px;
  border: 1.5px solid var(--nyu-lighter);
  border-radius: var(--r-sm);
  background: color-mix(in srgb, var(--nyu-soft) 70%, #fff);
}
.seller-rating-summary div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.seller-rating-summary span {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.seller-rating-summary strong {
  color: var(--nyu-purple);
  font-size: 1rem;
  white-space: nowrap;
}
.seller-rating-summary p {
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.35;
}
.token-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--nyu-soft);
  border-radius: var(--r-sm);
  padding: 8px 12px;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--nyu-purple);
}
.token-row span { font-weight: 600; color: var(--muted); font-size: 0.78rem; }

/* star rating display */
.star-rating {
  display: flex;
  align-items: center;
  gap: 6px;
}
.stars { color: #f59e0b; font-size: 0.9rem; letter-spacing: 1px; }
.rating-num { font-weight: 700; font-size: 0.88rem; color: var(--ink); }
.rating-count { font-size: 0.76rem; color: var(--muted-light); }

.buy-button {
  width: 100%;
  height: 40px;
  border-radius: var(--r-sm);
  border: 1.5px solid var(--nyu-purple);
  background: var(--nyu-purple);
  color: #fff;
  font-size: 0.875rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 160ms ease;
}
.buy-button:hover { background: var(--nyu-dark); border-color: var(--nyu-dark); }
.buy-button:disabled { opacity: 0.55; cursor: not-allowed; }
.resource-open-button {
  width: 100%;
  height: 38px;
  border-radius: var(--r-sm);
  border: 1.5px solid #16a34a;
  background: #ecfdf5;
  color: #047857;
  font-size: 0.84rem;
  font-weight: 800;
  cursor: pointer;
  transition: all 160ms ease;
}
.resource-open-button:hover {
  background: #d1fae5;
  transform: translateY(-1px);
}
.resource-open-button.unavailable {
  border-color: var(--line);
  background: #f3f4f6;
  color: var(--muted);
  cursor: not-allowed;
  transform: none;
}

.rating-control {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 5px;
}
.rating-button {
  height: 32px;
  border: 1.5px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--nyu-soft);
  color: var(--nyu-purple);
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 140ms;
}
.rating-button:hover:not(:disabled) { background: var(--nyu-purple); color: #fff; border-color: var(--nyu-purple); }
.rating-button:disabled { opacity: 0.45; cursor: not-allowed; }

.review-box {
  border-top: 1px solid var(--line);
  padding-top: 12px;
  display: grid;
  gap: 8px;
}
.review-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.review-head strong {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.review-head span {
  flex: 0 0 auto;
  padding: 3px 8px;
  border-radius: var(--r-pill);
  background: var(--nyu-soft);
  color: var(--nyu-purple);
  font-size: 0.68rem;
  font-weight: 800;
}
.review-list {
  display: grid;
  gap: 7px;
  max-height: 118px;
  min-height: 42px;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 8px 9px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: #fbfafc;
  scrollbar-width: thin;
  scrollbar-color: rgba(87, 6, 140, 0.38) transparent;
}
.review-list::-webkit-scrollbar { width: 7px; }
.review-list::-webkit-scrollbar-track { background: transparent; }
.review-list::-webkit-scrollbar-thumb {
  background: rgba(87, 6, 140, 0.28);
  border-radius: 999px;
}
.review-list:focus {
  outline: 2px solid rgba(87, 6, 140, 0.16);
  outline-offset: 2px;
}
.review-list p {
  margin: 0;
  padding: 7px 8px;
  border-radius: var(--r-sm);
  background: var(--surface);
  box-shadow: inset 0 0 0 1px rgba(226, 232, 240, 0.72);
  font-size: 0.82rem;
  color: var(--muted);
  line-height: 1.45;
}
.review-list span { font-weight: 700; color: var(--ink); }
[data-theme="dark"] .review-list {
  background: rgba(255,255,255,0.03);
}
[data-theme="dark"] .review-list p {
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.06);
}
.review-locked { font-size: 0.8rem; color: var(--muted-light); font-style: italic; }
.review-input { display: grid; gap: 4px; font-size: 0.75rem; font-weight: 700; color: var(--muted); }
.review-input input {
  height: 36px; border: 1.5px solid var(--line); border-radius: var(--r-sm);
  padding: 0 10px; font-size: 0.85rem; outline: none;
  transition: border-color 160ms;
}
.review-input input:focus { border-color: var(--nyu-purple); }
.review-button { height: 34px; font-size: 0.82rem; }
.review-action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.secondary-action.danger,
.report-resource-button {
  border-color: #fecaca;
  background: #fff1f2;
  color: #b91c1c;
}
.secondary-action.danger:hover,
.report-resource-button:hover {
  border-color: #fca5a5;
  background: #ffe4e6;
}
.admin-auto-review {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: .82rem;
  line-height: 1.4;
}

/* ── Major Planner ──────────────────────────────────────────── */
.planner-layout {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 24px;
  align-items: start;
}
.course-bank {
  background: #fafbff;
  border: 1.5px solid var(--line);
  border-radius: var(--r-lg);
  padding: 20px;
  display: grid;
  gap: 14px;
  position: sticky;
  top: 24px;
}
.course-bank .panel-label {
  font-size: 0.7rem; font-weight: 700; color: var(--nyu-purple);
  text-transform: uppercase; letter-spacing: 0.09em;
}
.course-bank label {
  display: grid; gap: 5px;
  font-size: 0.75rem; font-weight: 700; color: var(--muted);
  text-transform: uppercase; letter-spacing: 0.04em;
}
.course-bank select,
.course-bank input[type="search"] {
  width: 100%; height: 40px;
  border: 1.5px solid var(--line); border-radius: var(--r-sm);
  background: var(--surface); color: var(--ink);
  padding: 0 12px; font-size: 0.875rem; outline: none;
  transition: border-color 160ms;
}
.course-bank select:focus,
.course-bank input[type="search"]:focus { border-color: var(--nyu-purple); box-shadow: 0 0 0 3px rgba(87,6,140,.1); }
.course-bank input[type="search"]::-webkit-search-cancel-button { cursor: pointer; }
.course-search-box {
  position: relative;
}
.course-search-results {
  position: absolute;
  z-index: 50;
  top: calc(100% + 8px);
  left: 0;
  right: auto;
  display: none;
  min-width: 100%;
  width: max-content;
  max-width: min(620px, calc(100vw - 48px));
  max-height: min(640px, 78vh);
  overflow: auto;
  padding: 6px;
  border: 1.5px solid var(--line);
  border-radius: var(--r-md);
  background: var(--surface);
  box-shadow: 0 18px 45px rgba(24, 18, 35, .18);
  text-transform: none;
  letter-spacing: 0;
}
.course-search-results.open {
  display: block;
}
.course-search-empty {
  padding: 10px 12px;
  color: var(--muted);
  font-size: .8rem;
  font-weight: 700;
  line-height: 1.35;
}
.course-search-major {
  border-top: 1px solid var(--line);
}
.course-search-major:first-child {
  border-top: 0;
}
.course-search-major-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  cursor: pointer;
  list-style: none;
  user-select: none;
  border-radius: var(--r-sm);
}
.course-search-major-head::-webkit-details-marker {
  display: none;
}
.course-search-major-head:hover {
  background: rgba(87, 6, 140, .06);
}
.course-search-major-head:focus-visible {
  outline: 2px solid var(--nyu-purple);
  outline-offset: -2px;
}
.course-search-major-name {
  flex: 1 1 auto;
  color: var(--ink);
  font-size: .78rem;
  font-weight: 900;
  letter-spacing: .01em;
}
.course-search-major-count {
  flex: 0 0 auto;
  min-width: 20px;
  padding: 1px 8px;
  border-radius: 999px;
  background: rgba(87, 6, 140, .1);
  color: var(--nyu-purple);
  font-size: .62rem;
  font-weight: 900;
  text-align: center;
}
.course-search-major-chevron {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: .8rem;
  line-height: 1;
  transition: transform .18s ease;
}
.course-search-major[open] > .course-search-major-head .course-search-major-chevron {
  transform: rotate(180deg);
}
.course-search-major-body {
  padding: 2px 4px 8px;
}
.course-search-group + .course-search-group {
  margin-top: 6px;
  padding-top: 4px;
  border-top: 1px solid var(--line);
}
.course-search-group-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 2px 6px 3px;
  color: var(--muted-light);
  font-size: .64rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.course-search-group-title small {
  color: var(--muted-light);
  font-size: .58rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: none;
}
.course-search-choice-group {
  margin: 4px 3px 6px;
  padding: 5px;
  border: 1px solid rgba(87, 6, 140, .16);
  border-left: 3px solid var(--nyu-purple);
  border-radius: var(--r-sm);
  background: rgba(87, 6, 140, .035);
}
.course-search-choice-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  padding: 2px 5px 4px;
}
.course-search-choice-head strong {
  color: var(--nyu-purple);
  font-size: .67rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .02em;
}
.course-search-choice-head span {
  color: var(--muted);
  font-size: .65rem;
  font-weight: 700;
}
.course-search-choice {
  flex: 0 0 auto;
  color: var(--nyu-purple);
  font-size: .68rem;
  font-weight: 900;
  text-transform: none;
  letter-spacing: 0;
}
.course-search-option {
  display: block;
  width: 100%;
  padding: 4px 8px;
  border: 0;
  border-radius: var(--r-sm);
  background: transparent;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
}
.course-search-option:hover,
.course-search-option:focus {
  background: rgba(87, 6, 140, .08);
  outline: none;
}
.course-search-option strong {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: .74rem;
  font-weight: 700;
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.course-search-option strong em {
  flex: 0 0 auto;
  padding: 1px 6px;
  border-radius: 999px;
  background: rgba(87, 6, 140, .1);
  color: var(--nyu-purple);
  font-size: .6rem;
  font-style: normal;
  font-weight: 900;
  white-space: nowrap;
}
.course-search-option span {
  color: var(--muted);
  font-size: .72rem;
  font-weight: 700;
  line-height: 1.25;
}
.course-search-hint {
  color: var(--muted-light);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: none;
  line-height: 1.35;
}
#resourceDescriptionHint {
  color: #a15c00;
  font-size: .72rem;
  font-weight: 700;
  line-height: 1.4;
}
#resourceDescriptionHint.valid {
  color: #047857;
}
.saved-plan-tools {
  display: grid;
  gap: 8px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}
.saved-plan-actions {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 6px;
}
.saved-plan-actions .secondary-action {
  min-height: 34px;
  padding: 0 8px;
  font-size: .75rem;
}
.cm-why-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}
.cm-why-grid div {
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  padding: 10px;
  background: var(--surface);
}
.cm-why-grid span {
  display: block;
  color: var(--muted);
  font-size: .72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.cm-why-grid strong {
  display: block;
  color: var(--ink);
  font-size: .86rem;
  margin-top: 4px;
}
.cm-year-insight-list {
  display: grid;
  gap: 8px;
}
.cm-year-insight-row {
  display: grid;
  grid-template-columns: minmax(92px, 0.8fr) minmax(160px, 1.8fr) minmax(150px, 1fr);
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: #fbf9ff;
}
.cm-year-label,
.cm-year-difficulty {
  display: grid;
  gap: 2px;
  min-width: 0;
}
.cm-year-label strong {
  color: var(--ink);
  font-size: 0.9rem;
}
.cm-year-label span,
.cm-year-difficulty span {
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.cm-year-timing {
  display: grid;
  grid-template-columns: minmax(80px, 1fr) 42px;
  align-items: center;
  gap: 10px;
}
.cm-year-track {
  height: 10px;
  border-radius: var(--r-pill);
  background: #ede7f5;
  overflow: hidden;
}
.cm-year-track i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--nyu-purple), #8b5cf6);
}
.cm-year-timing b {
  color: var(--nyu-purple);
  font-size: 0.88rem;
  text-align: right;
}
.cm-year-difficulty strong {
  font-size: 0.9rem;
  line-height: 1.2;
}
.cm-year-difficulty em {
  color: var(--muted);
  font-style: normal;
  font-size: 0.72rem;
  line-height: 1.25;
}
.cm-difficulty-easy { color: var(--green) !important; }
.cm-difficulty-medium { color: var(--nyu-purple) !important; }
.cm-difficulty-hard { color: var(--orange) !important; }
.cm-difficulty-very-hard { color: var(--red) !important; }
.cm-difficulty-no-data { color: var(--muted) !important; }
@media (max-width: 760px) {
  .cm-year-insight-row {
    grid-template-columns: 1fr;
    gap: 8px;
  }
  .cm-year-timing {
    grid-template-columns: 1fr 42px;
  }
  .placement-exam-panel.compact {
    display: grid;
    width: 100%;
    margin-left: 0;
  }
}
.planner-note {
  padding: 12px;
  border-radius: var(--r-sm);
  background: var(--orange-soft);
  border: 1px solid #fde68a;
}
.planner-note strong { display: block; color: var(--orange); font-size: 0.83rem; margin-bottom: 4px; }
.planner-note p { font-size: 0.78rem; color: #92400e; line-height: 1.45; }
.planner-note.short-term-note {
  background: #f5f3ff;
  border-color: var(--nyu-lighter);
}
.planner-note.short-term-note strong,
.planner-note.short-term-note p {
  color: var(--nyu-purple);
}
.short-term-tools {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}
.short-term-tools select {
  width: 100%;
  height: 40px;
  border: 1.5px solid var(--nyu-lighter);
  border-radius: var(--r-sm);
  background: var(--surface);
  color: var(--ink);
  padding: 0 10px;
  font-weight: 750;
}
.short-term-tools .secondary-action {
  width: 100%;
  justify-content: center;
  background: var(--surface);
}
.placement-exam-panel {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1.5px solid #bfdbfe;
  border-radius: var(--r-sm);
  background: #eff6ff;
}
.placement-exam-panel.compact {
  display: inline-grid;
  grid-template-columns: auto auto auto;
  align-items: center;
  width: fit-content;
  margin: 0 0 16px 10px;
}
.placement-exam-panel strong {
  color: #1d4ed8;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.placement-exam-panel label {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--ink);
  font-size: 0.8rem;
  font-weight: 800;
}
.placement-exam-panel input {
  width: 16px;
  height: 16px;
  accent-color: var(--nyu-purple);
}
.placement-exam-panel p {
  color: #1e40af;
  font-size: 0.74rem;
  line-height: 1.35;
}
.placement-exam-panel.compact p {
  grid-column: 1 / -1;
}
.placement-course-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  margin-top: 8px;
  border: 1.5px dashed #93c5fd;
  border-radius: var(--r-sm);
  background: #eff6ff;
}
.placement-course-card strong {
  color: #1d4ed8;
}
.placement-course-card span {
  color: var(--ink);
}
.placement-course-card em {
  color: #1e40af;
}

.planner-actions { display: flex; align-items: flex-end; gap: 10px; flex-wrap: wrap; }
.planner-identity-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin: -10px 0 18px;
}
.planner-identity-row p {
  margin: 0;
  color: var(--muted);
  font-size: .82rem;
  font-weight: 650;
}

.planner-summary {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 14px;
  align-items: center;
}
.planner-stat {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: var(--r-sm);
  background: var(--surface);
  border: 1.5px solid var(--line);
  font-size: 0.83rem;
  font-weight: 700;
  color: var(--muted);
}
.planner-stat strong { color: var(--ink); font-size: 1rem; }
.planner-stat.highlight { border-color: var(--nyu-lighter); background: var(--nyu-soft); color: var(--nyu-purple); }
.planner-stat.highlight strong { color: var(--nyu-dark); }

.route-intro {
  margin-bottom: 16px;
  padding: 16px 20px;
  background: var(--nyu-soft);
  border: 1.5px solid var(--nyu-lighter);
  border-radius: var(--r-md);
}
.route-intro h3 { color: var(--nyu-dark); font-size: 1rem; margin-bottom: 4px; }
.route-intro p { color: var(--muted); font-size: 0.83rem; line-height: 1.55; }

.semester-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}
.semester-card {
  background: var(--surface);
  border: 1.5px solid var(--line);
  border-radius: var(--r-md);
  padding: 16px;
  min-height: 180px;
  transition: border-color 200ms;
}
.semester-card:hover { border-color: var(--nyu-lighter); }
.semester-card.short-term-card {
  background: linear-gradient(180deg, #fff, #fbf8ff);
  border-style: dashed;
}
.semester-card.drag-over {
  border-color: var(--nyu-purple);
  background: linear-gradient(180deg, #fff, var(--nyu-soft));
  box-shadow: 0 0 0 3px rgba(87, 6, 140, .12);
}
.semester-card.current-year-semester,
.semester-card.current-semester-card {
  border-color: var(--nyu-purple);
  box-shadow: 0 0 0 3px rgba(87, 6, 140, .08);
}
.semester-card.semester-over-limit {
  border-color: #dc2626;
  box-shadow: 0 0 0 3px rgba(220, 38, 38, .08);
}
.semester-card.semester-overload-enabled {
  border-color: #d97706;
  box-shadow: 0 0 0 3px rgba(217, 119, 6, .1);
}
.semester-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}
.semester-header h3 {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--nyu-dark);
}
.semester-badges {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  min-width: 0;
}
.semester-credits {
  font-size: 0.73rem;
  font-weight: 700;
  color: var(--muted);
  background: var(--nyu-soft);
  padding: 2px 8px;
  border-radius: var(--r-pill);
  color: var(--nyu-purple);
}
.semester-limit-badge,
.semester-overload-badge,
.overload-toggle,
.short-term-badge,
.short-term-limit-badge {
  font-size: 0.68rem;
  font-weight: 800;
  border-radius: var(--r-pill);
  white-space: nowrap;
}
.semester-limit-badge {
  color: #991b1b;
  background: #fee2e2;
  padding: 2px 8px;
}
.semester-overload-badge {
  color: #92400e;
  background: #fef3c7;
  padding: 2px 8px;
}
.short-term-badge {
  color: #5b21b6;
  background: #ede9fe;
  padding: 2px 8px;
}
.short-term-limit-badge {
  color: #6b21a8;
  background: #f3e8ff;
  padding: 2px 8px;
}
.short-term-hide {
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  background: var(--surface);
  color: var(--muted);
  padding: 2px 8px;
  font-size: .68rem;
  font-weight: 800;
  cursor: pointer;
}
.short-term-hide:hover {
  color: var(--nyu-purple);
  border-color: var(--nyu-lighter);
}
.overload-toggle {
  color: var(--nyu-purple);
  background: #fff;
  border: 1px solid var(--nyu-lighter);
  padding: 3px 8px;
  cursor: pointer;
  transition: border-color 160ms ease, background 160ms ease, color 160ms ease;
}
.overload-toggle:hover {
  color: #fff;
  background: var(--nyu-purple);
  border-color: var(--nyu-purple);
}
.current-year-badge,
.current-semester-badge {
  font-size: 0.68rem;
  font-weight: 800;
  text-transform: uppercase;
  color: #fff;
  background: var(--nyu-purple);
  padding: 3px 8px;
  border-radius: var(--r-pill);
  margin-left: auto;
}
.planned-course {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  align-items: start;
  padding: 9px 0;
  border-top: 1px solid var(--line);
  cursor: grab;
  transition: opacity 140ms ease, transform 140ms ease;
}
.planned-course:first-of-type { border-top: none; }
.planned-course:active { cursor: grabbing; }
.planned-course.dragging {
  opacity: 0.45;
  transform: scale(0.985);
}
.course-info strong {
  display: block;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--nyu-purple);
  font-variant-numeric: tabular-nums;
}
.course-info span {
  display: block;
  font-size: 0.83rem;
  color: var(--ink);
  font-weight: 500;
  margin-top: 1px;
  line-height: 1.35;
}
.course-info em {
  display: block;
  font-size: 0.73rem;
  color: var(--muted-light);
  font-style: normal;
  margin-top: 3px;
}
.remove-course {
  width: 26px; height: 26px;
  display: grid; place-items: center;
  border: 1.5px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--surface);
  color: var(--red);
  font-size: 1rem;
  cursor: pointer;
  transition: all 140ms;
  flex-shrink: 0;
}
.remove-course:hover { background: var(--red-soft); border-color: var(--red); }
.empty-semester {
  font-size: 0.83rem;
  color: var(--muted-light);
  font-style: italic;
  padding: 8px 0;
}

.equivalence-panel {
  margin-top: 16px;
  padding: 18px 20px;
  background: var(--surface);
  border: 1.5px solid var(--line);
  border-radius: var(--r-md);
}
.equivalence-panel h3 { font-size: 1rem; font-weight: 700; margin-bottom: 14px; }
.planner-alerts { display: grid; gap: 10px; }
.planner-alert {
  padding: 12px 14px;
  background: #fafbff;
  border: 1.5px solid var(--line);
  border-radius: var(--r-sm);
  border-left: 3px solid var(--nyu-purple);
}
.planner-alert span {
  display: block;
  font-size: 0.68rem; font-weight: 700;
  color: var(--nyu-purple); text-transform: uppercase; letter-spacing: 0.07em;
  margin-bottom: 3px;
}
.planner-alert p { font-size: 0.82rem; color: var(--muted); line-height: 1.45; }
.planner-alert.alert-warn { border-left-color: var(--orange); }
.planner-alert.alert-warn span { color: var(--orange); }
.planner-alert.alert-miss { border-left-color: var(--red); }
.planner-alert.alert-miss span { color: var(--red); }
.planner-alert.alert-ok { border-left-color: var(--green); }
.planner-alert.alert-ok span { color: var(--green); }

/* ── Profile ────────────────────────────────────────────────── */
.profile-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 4px;
}
.profile-block {
  background: #fafbff;
  border: 1.5px solid var(--line);
  border-radius: var(--r-md);
  padding: 18px 20px;
}
.wide-profile { grid-column: 1 / -1; }
.profile-block h3 { font-size: 0.95rem; font-weight: 700; margin-bottom: 14px; color: var(--ink); }
.profile-list { display: grid; gap: 10px; }
.profile-item {
  background: var(--surface);
  border: 1.5px solid var(--line);
  border-radius: var(--r-sm);
  padding: 12px 14px;
  display: grid;
  gap: 5px;
}
.profile-item strong { font-size: 0.9rem; }
.profile-item span { font-size: 0.8rem; color: var(--muted); }
.profile-links {
  display: flex; flex-wrap: wrap; gap: 7px; margin-top: 4px;
}
.profile-links a {
  padding: 3px 10px;
  border: 1.5px solid var(--line);
  border-radius: var(--r-pill);
  font-size: 0.73rem; font-weight: 700;
  color: var(--nyu-purple); background: var(--surface);
  transition: all 140ms;
}
.profile-links a:hover {
  background: var(--nyu-soft); border-color: var(--nyu-lighter);
  text-decoration: none;
}
.purchase-card {
  background: var(--surface);
  border: 1.5px solid var(--line);
  border-radius: var(--r-sm);
  padding: 14px;
  display: grid;
  gap: 10px;
}
.purchase-card-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}
.purchase-card-head strong {
  display: block;
  font-size: 0.9rem;
  color: var(--ink);
}
.purchase-card-head span,
.purchase-meta span,
.purchase-review span {
  font-size: 0.78rem;
  color: var(--muted);
}
.purchase-price {
  flex-shrink: 0;
  border: 1.5px solid var(--line);
  border-radius: var(--r-pill);
  padding: 3px 9px;
  background: var(--nyu-soft);
  color: var(--nyu-purple) !important;
  font-weight: 800;
}
.purchase-card p {
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.45;
}
.purchase-description {
  display: grid;
  gap: 5px;
  padding: 10px 12px;
  border-left: 3px solid var(--nyu-purple);
  background: var(--nyu-soft);
  border-radius: 0 var(--r-sm) var(--r-sm) 0;
}
.purchase-description > strong {
  color: var(--ink);
  font-size: 0.78rem;
}
.purchase-description p {
  margin: 0;
}
.purchase-meta {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.purchase-actions {
  display: grid;
  grid-template-columns: minmax(150px, 190px) minmax(180px, 1fr);
  gap: 10px;
  align-items: center;
}
.purchase-resource-action {
  min-width: 0;
}
.purchase-review {
  display: grid;
  gap: 4px;
  min-width: 0;
}
.purchase-review input {
  height: 32px;
  border: 1.5px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--surface);
  color: var(--ink);
  padding: 0 10px;
  min-width: 0;
}
.purchase-review-row {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(88px, 120px);
  gap: 10px;
  align-items: end;
}
.purchase-review-locked {
  margin: 0;
  min-width: 0;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.4;
}
.purchase-card .rating-control {
  min-width: 0;
}
.purchase-rating-panel {
  display: grid;
  gap: 6px;
  min-width: 190px;
}
.purchase-rating-panel > strong {
  font-size: 0.78rem;
  color: var(--ink);
}
.purchase-card .review-button {
  width: 100%;
  min-width: 88px;
}
.purchase-library {
  display: grid;
  gap: 14px;
}
.purchase-section-label {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.purchase-recent {
  display: grid;
  gap: 8px;
}
.purchase-recent-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}
.recent-purchase-item {
  border: 1.5px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--surface);
  overflow: hidden;
}
.recent-purchase-item summary {
  min-height: 64px;
  cursor: pointer;
  list-style: none;
  display: grid;
  gap: 4px;
  padding: 12px 14px;
}
.recent-purchase-item summary::-webkit-details-marker { display: none; }
.recent-purchase-item summary strong {
  color: var(--ink);
  font-size: 0.9rem;
  line-height: 1.25;
}
.recent-purchase-item summary span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
}
.recent-purchase-detail {
  border-top: 1.5px solid var(--line);
  display: grid;
  gap: 8px;
  padding: 12px 14px;
}
.recent-purchase-detail p {
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.45;
}
.recent-purchase-detail a {
  font-size: 0.78rem;
  font-weight: 800;
}
.purchase-group {
  border: 1.5px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--surface);
  overflow: hidden;
}
.purchase-group summary {
  cursor: pointer;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 13px 14px;
}
.purchase-group summary::-webkit-details-marker { display: none; }
.purchase-group summary::before {
  content: "›";
  color: var(--nyu-purple);
  font-size: 1rem;
  font-weight: 900;
  transition: transform 160ms;
}
.purchase-group[open] summary::before { transform: rotate(90deg); }
.purchase-group summary span:first-child {
  flex: 1;
  display: grid;
  gap: 2px;
}
.purchase-group summary strong {
  color: var(--ink);
  font-size: 0.9rem;
}
.purchase-group summary em,
.purchase-group summary span:last-child {
  color: var(--muted);
  font-size: 0.78rem;
  font-style: normal;
  font-weight: 700;
}
.purchase-group-list {
  border-top: 1.5px solid var(--line);
  padding: 12px;
  display: grid;
  gap: 10px;
}
.profile-path-title { font-size: 0.83rem; color: var(--muted); font-weight: 600; margin-bottom: 12px; }
.profile-path-steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}
.profile-path-steps span {
  background: var(--surface);
  border: 1.5px solid var(--line);
  border-radius: var(--r-sm);
  padding: 10px 12px;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--ink);
}

/* ── Analysis ───────────────────────────────────────────────── */
.analysis-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-top: 4px;
}
.analysis-block {
  background: #fafbff;
  border: 1.5px solid var(--line);
  border-radius: var(--r-md);
  padding: 20px;
}
.analysis-block h3 { font-size: 0.95rem; font-weight: 700; margin-bottom: 14px; }
.risk-list { display: grid; gap: 10px; }
.risk-item {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 14px;
  background: var(--surface);
  border: 1.5px solid var(--line);
  border-radius: var(--r-sm);
  transition: border-color 180ms;
}
.risk-item:hover { border-color: var(--nyu-lighter); }
.risk-item strong { display: block; font-size: 0.9rem; margin-bottom: 2px; }
.risk-item span { font-size: 0.8rem; color: var(--muted); line-height: 1.4; }
.risk-badge {
  flex-shrink: 0;
  padding: 4px 10px;
  border-radius: var(--r-pill);
  background: var(--orange-soft);
  color: var(--orange);
  font-size: 0.73rem;
  font-weight: 800;
  white-space: nowrap;
}
.simulation label { font-size: 0.83rem; font-weight: 700; color: var(--muted); display: block; margin-bottom: 14px; }
.simulation input[type=range] { width: 100%; accent-color: var(--nyu-purple); margin-bottom: 16px; }
.simulation-meter {
  height: 12px;
  background: var(--line);
  border-radius: var(--r-pill);
  overflow: hidden;
}
.simulation-meter span {
  display: block; height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--green), var(--orange), var(--red));
  transition: width 300ms ease;
}
.simulation p { font-size: 0.83rem; color: var(--muted); line-height: 1.6; margin-top: 14px; }

/* ── Responsive ─────────────────────────────────────────────── */
@media (max-width: 1100px) {
  :root { --sidebar-w: 64px; }
  .brand-text, .nav-item .nav-label, .sidebar-footer, .nav-section-label { display: none; }
  .sidebar { padding: 16px 10px; align-items: center; }
  .brand { justify-content: center; padding-bottom: 16px; }
  .brand-mark { width: 36px; height: 36px; }
  .nav-item { justify-content: center; padding: 10px; }
  .nav-icon { width: auto; }
  .profile-nav-pinned { justify-content: center; padding: 10px; }
  .profile-nav-pinned .nav-label { display: none; }
  .workspace { padding: 24px 20px; }
  .metric-grid { grid-template-columns: repeat(2, 1fr); }
  .network-layout, .resource-layout, .planner-layout { grid-template-columns: 1fr; }
  .material-grid { grid-template-columns: repeat(2, 1fr); }
  .marketplace-detail-grid { grid-template-columns: 1fr; }
  .marketplace-detail-side { position: static; }
}
@media (max-width: 760px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar {
    position: sticky;
    top: 0;
    height: auto;
    flex-direction: row;
    align-items: center;
    padding: 10px 12px;
    overflow-x: auto;
    gap: 10px;
    box-shadow: 0 2px 12px rgba(46,0,81,.25);
  }
  .sidebar::-webkit-scrollbar { display: none; }
  .brand { padding: 0; border: none; margin: 0; }
  .brand-mark { width: 34px; height: 34px; }
  .brand-text { display: block; }
  .brand-text span { display: none; }
  .nav-list { flex-direction: row; flex: 0 0 auto; gap: 4px; }
  .nav-item,
  .profile-nav-pinned {
    width: auto;
    min-height: 36px;
    justify-content: center;
    padding: 7px 12px;
    margin-top: 0;
  }
  .nav-label { display: inline; }
  .nav-icon { display: none; }
  .profile-nav-pinned .nav-label { display: inline; }
  .profile-nav-pinned .nav-icon { display: none; }
  .nav-section-label { display: none; }
  .sidebar-footer,
  .sidebar-user { display: none; }
  .workspace { padding: 14px; gap: 14px; }
  .topbar {
    display: grid;
    gap: 14px;
    padding-bottom: 16px;
  }
  .topbar-left,
  .topbar-actions,
  .section-heading,
  .planner-actions,
  .market-filters,
  .resource-toolbar {
    width: 100%;
  }
  .topbar-actions,
  .planner-actions,
  .market-filters {
    display: grid;
    grid-template-columns: 1fr;
    align-items: stretch;
  }
  .topbar-actions > *,
  .planner-actions > *,
  .planner-actions label,
  .market-filters > *,
  .primary-action,
  .secondary-action,
  .dark-toggle,
  .search-box input,
  .select-field select {
    width: 100%;
    min-width: 0;
  }
  .dark-toggle { height: 42px; }
  .section-heading {
    display: grid;
    gap: 14px;
    margin-bottom: 18px;
  }
  .view-panel {
    border-radius: var(--r-md);
    padding: 18px 14px;
  }
  .metric-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .metric { padding: 14px; }
  .metric-value { font-size: 1.5rem; }
  .metric-grid, .analysis-grid, .profile-grid,
  .semester-grid, .profile-path-steps, .path-board { grid-template-columns: 1fr; }
  .planner-layout,
  .resource-layout,
  .network-layout,
  .checklist-grid { grid-template-columns: 1fr; }
  .course-bank {
    position: static;
    padding: 16px;
  }
  .grad-banner {
    padding: 16px;
    display: grid;
    gap: 14px;
  }
  .grad-progress-wrap { min-width: 0; }
  .planner-summary,
  .planner-stat {
    width: 100%;
  }
  .planner-stat { justify-content: space-between; }
  .planned-course {
    grid-template-columns: minmax(0, 1fr) 32px;
  }
  .remove-course { width: 32px; height: 32px; }
  .material-grid { grid-template-columns: 1fr; }
  .subject-directory-hero {
    padding: 18px;
    flex-direction: column;
  }
  .subject-stats {
    justify-content: space-between;
    white-space: normal;
  }
  .subject-directory-grid { grid-template-columns: 1fr; }
  .subject-row {
    min-height: 132px;
    padding: 20px;
  }
  .material-card,
  .profile-block,
  .analysis-block,
  .equivalence-panel {
    padding: 16px;
  }
  .token-row,
  .resource-toolbar {
    display: grid;
    gap: 6px;
    justify-content: stretch;
  }
  .rating-button { min-height: 36px; }
  .purchase-actions,
  .purchase-review-row { grid-template-columns: 1fr; }
  .purchase-review-row { grid-column: auto; }
  .purchase-recent-grid { grid-template-columns: 1fr; }
  .purchase-card-head,
  .purchase-group summary,
  .semester-header,
  .risk-item,
  .next-course-item {
    align-items: flex-start;
  }
  .purchase-card-head,
  .risk-item {
    display: grid;
    grid-template-columns: 1fr;
  }
  .purchase-price { width: max-content; }
  .profile-hero {
    display: grid;
    gap: 14px;
    padding: 18px;
  }
  .profile-hero > div[style*="flex:1"] { min-width: 0; }
  .hero-stat { text-align: left; }
  .profile-dashboard-grid,
  .profile-progress-list,
  .saved-pathway-list {
    grid-template-columns: 1fr;
  }
  .profile-dashboard-grid.compact {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .profile-semester-summary {
    display: grid;
  }
  .profile-semester-summary span {
    text-align: left;
  }
  #graphSvg,
  .graph-stage {
    height: 360px;
    min-height: 360px;
  }
  .graph-controls {
    top: 8px;
    right: 8px;
  }
  .detail-panel { padding: 16px; }
  .compare-backdrop,
  .onboard-backdrop {
    align-items: stretch;
    padding: 10px;
  }
  .compare-modal {
    width: 100%;
    max-height: calc(100vh - 20px);
  }
  .compare-header,
  .compare-selectors {
    display: grid;
    width: 100%;
  }
  .compare-selectors select { width: 100%; min-width: 0; }
  .compare-body {
    display: block;
  }
  .compare-col {
    border-right: none;
    border-bottom: 1px solid var(--line);
    padding: 16px;
  }
  .overlap-legend {
    display: grid;
    gap: 8px;
  }
  .onboard-card {
    width: 100%;
    padding: 24px 18px;
    align-self: center;
  }
  .onboard-actions,
  .onboard-btns {
    display: grid;
    width: 100%;
  }
  .onboard-skip { order: 2; }
  .path-step:not(:last-child)::after { display: none; }
  .grad-stats { display: none; }
  .topbar h1 { font-size: 1.4rem; }
}

@media (max-width: 480px) {
  body { font-size: 14px; }
  .auth-screen { padding: 24px 16px; }
  .role-cards { grid-template-columns: 1fr; }
  .auth-overlay h1 { font-size: 1.7rem; }
  .workspace { padding: 10px; }
  .view-panel { padding: 14px 10px; }
  .topbar h1 { font-size: 1.22rem; }
  .section-heading h2 { font-size: 1.1rem; }
  .metric-grid { grid-template-columns: 1fr; }
  .brand-text { display: none; }
  .nav-item,
  .profile-nav-pinned {
    padding: 7px 10px;
    font-size: 0.82rem;
  }
  .semester-card { padding: 14px; }
  .purchase-group summary {
    grid-template-columns: auto 1fr;
  }
  .purchase-group summary span:last-child {
    grid-column: 2;
  }
  #graphSvg,
  .graph-stage {
    height: 300px;
    min-height: 300px;
  }
  .compare-header {
    padding: 16px;
  }
  .compare-course {
    display: grid;
    gap: 2px;
  }
}

/* ════════════════════════════════════════════════════════════
   DARK MODE
   ════════════════════════════════════════════════════════════ */
[data-theme="dark"] {
  --ink:        #f9fafb;
  --ink-2:      #e5e7eb;
  --muted:      #9ca3af;
  --muted-light:#6b7280;
  --line:       #2d2d3a;
  --surface:    #1e1b2e;
  --page:       #13111e;
  --nyu-soft:   rgba(87,6,140,.25);
  --nyu-lighter:rgba(123,47,190,.3);
  --green-soft: rgba(5,150,105,.18);
  --orange-soft:rgba(217,119,6,.18);
  --red-soft:   rgba(220,38,38,.18);
}
[data-theme="dark"] .metric,
[data-theme="dark"] .view-panel,
[data-theme="dark"] .detail-panel,
[data-theme="dark"] .upload-panel,
[data-theme="dark"] .course-bank,
[data-theme="dark"] .profile-block,
[data-theme="dark"] .analysis-block,
[data-theme="dark"] .semester-card,
[data-theme="dark"] .equivalence-panel,
[data-theme="dark"] .path-step,
[data-theme="dark"] .material-card,
[data-theme="dark"] .purchase-card,
[data-theme="dark"] .profile-item { background: var(--surface); }
[data-theme="dark"] .topbar { background: var(--surface); border-color: var(--line); }
[data-theme="dark"] .graph-stage { background: #16132a; }

/* Dark toggle button */
.dark-toggle {
  width: 36px; height: 36px;
  display: grid; place-items: center;
  border-radius: var(--r-sm);
  border: 1.5px solid var(--line);
  background: var(--surface);
  font-size: 1.1rem;
  cursor: pointer;
  transition: all 160ms;
  flex-shrink: 0;
}
.dark-toggle:hover { border-color: var(--nyu-purple); background: var(--nyu-soft); }

/* ── Sidebar user footer ────────────────────────────────────── */
.sidebar-user {
  margin-top: auto;
  padding: 12px 10px;
  border-top: 1px solid rgba(255,255,255,.1);
  display: flex;
  align-items: center;
  gap: 8px;
}
.sidebar-avatar {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: rgba(255,255,255,.15);
  display: grid; place-items: center;
  font-size: .9rem;
  flex-shrink: 0;
  border: 1.5px solid rgba(255,255,255,.25);
  overflow: hidden;
}
.sidebar-user-info { flex: 1; min-width: 0; }
.sidebar-user-info strong {
  display: block; font-size: .83rem; font-weight: 700;
  color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.sidebar-user-info span { display: block; font-size: .68rem; color: rgba(255,255,255,.5); }
.logout-btn-sm {
  width: 28px; height: 28px;
  display: grid; place-items: center;
  border: 1px solid rgba(255,255,255,.18);
  border-radius: var(--r-sm);
  background: transparent;
  color: rgba(255,255,255,.55);
  font-size: .85rem;
  cursor: pointer;
  transition: all 150ms;
  flex-shrink: 0;
}
.logout-btn-sm:hover { background: rgba(220,38,38,.25); border-color: rgba(220,38,38,.5); color: #fca5a5; }

/* ── Announcement banner ────────────────────────────────────── */
.announcement-banner {
  display: none;
  align-items: center;
  gap: 12px;
  padding: 11px 20px;
  background: linear-gradient(90deg, #0c4a6e, #0369a1);
  color: #fff;
  font-size: .875rem;
  font-weight: 500;
  position: relative;
}
.announcement-banner.show { display: flex; }
.announcement-banner.warn { background: linear-gradient(90deg, #78350f, #d97706); }
.announcement-banner.crit { background: linear-gradient(90deg, #7f1d1d, #dc2626); }
.ann-icon { font-size: 1rem; flex-shrink: 0; }
.ann-text { flex: 1; }
.ann-text strong { font-weight: 700; margin-right: 6px; }
.ann-dismiss {
  background: rgba(255,255,255,.15); border: none; color: #fff;
  width: 24px; height: 24px; border-radius: var(--r-sm);
  font-size: .9rem; cursor: pointer; display: grid; place-items: center;
  flex-shrink: 0; transition: background 150ms;
}
.ann-dismiss:hover { background: rgba(255,255,255,.3); }

/* ── Marketplace filters ────────────────────────────────────── */
.market-filters {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 16px;
  padding: 14px 16px;
  background: var(--nyu-soft);
  border: 1.5px solid var(--nyu-lighter);
  border-radius: var(--r-md);
}
.market-filters input {
  flex: 1; min-width: 180px; height: 38px;
  border: 1.5px solid var(--line); border-radius: var(--r-sm);
  background: var(--surface); color: var(--ink);
  padding: 0 14px; font-size: .875rem; outline: none;
  transition: border-color 160ms;
}
.market-filters input:focus { border-color: var(--nyu-purple); }
.market-filters select {
  height: 38px; border: 1.5px solid var(--line); border-radius: var(--r-sm);
  background: var(--surface); color: var(--ink);
  padding: 0 10px; font-size: .83rem; outline: none;
  transition: border-color 160ms;
}
.market-filters select:focus { border-color: var(--nyu-purple); }
.market-results-count { font-size: .8rem; color: var(--muted); font-weight: 600; white-space: nowrap; }

/* ── Degree Audit view ───────────────────────────────────────── */
.audit-identity-switch {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  width: fit-content;
  margin: 0 0 16px;
  padding: 4px;
  background: var(--nyu-soft);
  border: 1.5px solid var(--nyu-lighter);
  border-radius: var(--r-sm);
}
.planner-identity-switch {
  margin: 0;
}
.audit-identity-switch span {
  padding: 0 10px;
  color: var(--muted);
  font-size: .78rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.audit-identity-readonly {
  padding: 8px 10px 8px 4px;
}
.audit-identity-readonly strong {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 12px;
  border-radius: 6px;
  background: var(--surface);
  color: var(--nyu-purple);
  font-size: .85rem;
  font-weight: 800;
  box-shadow: var(--shadow-xs);
}
.identity-option {
  height: 34px;
  padding: 0 14px;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-size: .83rem;
  font-weight: 700;
  cursor: pointer;
}
.identity-option.active {
  background: var(--surface);
  color: var(--nyu-purple);
  box-shadow: var(--shadow-xs);
}
.checklist-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}
.audit-hero,
.audit-summary,
.audit-wide {
  grid-column: 1 / -1;
}
.audit-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 22px 24px;
  border: 1.5px solid var(--nyu-lighter);
  border-radius: var(--r-lg);
  background: linear-gradient(135deg, #f8f3ff 0%, #ffffff 58%, #eefcf8 100%);
  box-shadow: var(--shadow-sm);
}
.audit-hero h3 {
  margin: 4px 0 8px;
  font-size: 1.35rem;
  color: var(--ink);
}
.audit-hero p {
  margin: 0;
  color: var(--muted);
}
.audit-score-card {
  flex: 0 0 190px;
  padding: 16px;
  border: 1.5px solid #e9d8fd;
  border-radius: var(--r-md);
  background: rgba(255,255,255,.78);
  box-shadow: var(--shadow-xs);
}
.audit-score-card span {
  display: block;
  color: var(--muted);
  font-size: .7rem;
  font-weight: 900;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.audit-score-card strong {
  display: block;
  margin-top: 6px;
  color: var(--nyu-purple);
  font-size: 2rem;
  line-height: 1;
}
.audit-score-card em {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: .76rem;
  font-style: normal;
}
.audit-score-card i {
  display: block;
  height: 7px;
  margin-top: 13px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--nyu-purple) var(--score), #eee7f7 0);
}
.audit-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}
.audit-stat {
  padding: 16px;
  border: 1.5px solid var(--line);
  border-radius: var(--r-md);
  background: var(--surface);
  box-shadow: var(--shadow-xs);
}
.audit-stat span,
.audit-stat em {
  display: block;
  color: var(--muted);
  font-size: .75rem;
  font-style: normal;
}
.audit-stat span {
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .06em;
}
.audit-stat strong {
  display: block;
  margin: 7px 0 4px;
  color: var(--ink);
  font-size: 1.35rem;
}
.audit-stat-bar {
  height: 6px;
  margin-top: 12px;
  border-radius: 999px;
  background: var(--line);
  overflow: hidden;
}
.audit-stat-bar i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--nyu-purple), #10b981);
}
.audit-panel .req-item strong {
  display: block;
  color: var(--ink);
  font-size: .86rem;
}
.audit-panel .req-item > em {
  margin-left: auto;
  align-self: flex-start;
  padding: 2px 8px;
  border-radius: var(--r-pill);
  background: var(--line);
  color: var(--muted);
  font-size: .68rem;
  font-style: normal;
  font-weight: 900;
  text-transform: uppercase;
}
.audit-finding-critical > em {
  background: var(--red-soft);
  color: var(--red);
}
.audit-finding-warning > em {
  background: var(--orange-soft);
  color: var(--orange);
}
.audit-finding-good > em {
  background: var(--green-soft);
  color: var(--green);
}
.audit-course-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
  padding: 14px;
}
.audit-course-rec,
.audit-empty,
.audit-whatif-grid > div {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: #fafbff;
}
.audit-course-rec strong,
.audit-empty strong,
.audit-whatif-grid strong {
  display: block;
  color: var(--nyu-purple);
  font-size: .82rem;
}
.audit-course-rec span,
.audit-empty span,
.audit-whatif-grid span {
  display: block;
  margin-top: 4px;
  color: var(--ink);
  font-size: .82rem;
  line-height: 1.35;
}
.audit-course-rec em {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: .72rem;
  font-style: normal;
}
.audit-whatif-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  padding: 14px;
}
.audit-summary-note {
  margin: 0;
  padding: 14px;
  color: var(--ink);
  background: #fafbff;
  border-top: 1px solid var(--line);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: .8rem;
  line-height: 1.55;
  white-space: pre-wrap;
}
.checklist-block {
  background: var(--surface);
  border: 1.5px solid var(--line);
  border-radius: var(--r-md);
  overflow: hidden;
}
.checklist-block-head {
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  background: #fafbff;
}
[data-theme="dark"] .checklist-block-head { background: var(--surface); }
.checklist-block-head h3 { font-size: .95rem; font-weight: 700; }
.checklist-prog { display: flex; align-items: center; gap: 8px; }
.checklist-prog .prog-bar { width: 80px; }
.checklist-prog span { font-size: .78rem; font-weight: 700; color: var(--nyu-purple); }
.req-list { padding: 8px 0; }
.req-item {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 10px 18px;
  border-bottom: 1px solid var(--line);
  font-size: .85rem;
  transition: background 150ms;
}
.req-item small {
  display: block;
  color: var(--muted);
  font-size: .75rem;
  margin-top: 2px;
}
.req-item:last-child { border-bottom: none; }
.req-item:hover { background: var(--nyu-soft); }
.req-icon {
  width: 22px; height: 22px; border-radius: 50%;
  display: grid; place-items: center; font-size: .7rem;
  flex-shrink: 0; margin-top: 1px;
}
.req-icon.done  { background: var(--green-soft); color: var(--green); }
.req-icon.miss  { background: var(--red-soft);   color: var(--red); }
.req-icon.warn  { background: var(--orange-soft);color: var(--orange); }
.req-item-body { flex: 1; min-width: 0; }
.req-item-body strong { display: block; font-weight: 700; color: var(--ink); line-height: 1.3; }
.req-item-body span { display: block; font-size: .77rem; color: var(--muted); margin-top: 2px; }
.req-badge {
  flex-shrink: 0; padding: 2px 8px; border-radius: var(--r-pill);
  font-size: .68rem; font-weight: 800; text-transform: uppercase;
}
.req-badge.done  { background: var(--green-soft); color: var(--green); }
.req-badge.miss  { background: var(--red-soft);   color: var(--red); }
.req-badge.warn  { background: var(--orange-soft);color: var(--orange); }

/* ── Major comparison modal ─────────────────────────────────── */
.compare-backdrop {
  position: fixed; inset: 0;
  background: rgba(20,0,40,.6); z-index: 500;
  display: none; align-items: center; justify-content: center;
  backdrop-filter: blur(4px);
}
.compare-backdrop.open,
.compare-backdrop.show { display: flex; }
.compare-modal {
  background: var(--surface); border-radius: var(--r-xl);
  width: min(900px, 96vw); max-height: 88vh;
  display: flex; flex-direction: column;
  box-shadow: 0 24px 64px rgba(0,0,0,.35);
  animation: modalIn 220ms ease;
  overflow: hidden;
}
@keyframes modalIn { from{opacity:0;transform:scale(.94)} to{opacity:1;transform:scale(1)} }
.compare-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--line);
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  flex-wrap: wrap;
  flex-shrink: 0;
}
.compare-header h2 { font-size: 1.1rem; font-weight: 800; }
.compare-selectors { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.compare-side-label {
  color: var(--muted);
  font-size: .72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.compare-selectors select {
  height: 38px; border: 1.5px solid var(--line); border-radius: var(--r-sm);
  background: var(--surface); color: var(--ink);
  padding: 0 10px; font-size: .875rem; outline: none; min-width: 150px;
}
.compare-saved-bar {
  width: 100%;
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto auto auto;
  gap: 8px;
  align-items: center;
}
.compare-saved-bar select {
  min-width: 0;
  height: 38px;
  border: 1.5px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--surface);
  color: var(--ink);
  padding: 0 10px;
}
.compare-saved-bar button { min-height: 38px; white-space: nowrap; }
.compare-close {
  width: 32px; height: 32px; border-radius: var(--r-sm);
  border: 1.5px solid var(--line); background: var(--surface);
  font-size: 1.1rem; cursor: pointer; display: grid; place-items: center;
}
.compare-body {
  display: block; overflow-y: auto; flex: 1;
}
.compare-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--line);
  background: #fafbff;
}
.compare-summary div {
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  padding: 10px 12px;
  background: var(--surface);
}
.compare-summary span,
.compare-summary em {
  display: block;
  color: var(--muted);
  font-size: .72rem;
  font-style: normal;
}
.compare-summary strong {
  display: block;
  margin: 2px 0;
  color: var(--nyu-purple);
  font-size: 1.3rem;
  line-height: 1;
}
.compare-explain {
  display: grid;
  gap: 6px;
  padding: 12px 20px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
  color: var(--muted);
  font-size: .82rem;
}
.compare-explain strong { color: var(--ink); }
.compare-columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: flex-start;
}
.compare-col { padding: 20px; border-right: 1px solid var(--line); }
.compare-col:last-child { border-right: none; }
.compare-col h3 {
  font-size: 1rem; font-weight: 800; color: var(--nyu-dark); margin-bottom: 6px;
}
.compare-role { font-size: 11px; opacity: .65; font-weight: 700; }
.compare-meta { font-size: .78rem; color: var(--muted); margin-bottom: 14px; }
.compare-section { margin-bottom: 14px; }
.compare-section-title {
  font-size: .68rem; font-weight: 700; color: var(--nyu-purple);
  text-transform: uppercase; letter-spacing: .08em; margin-bottom: 8px;
}
.compare-course {
  display: flex; align-items: center; gap: 8px;
  padding: 7px 0; border-bottom: 1px solid var(--line);
  font-size: .83rem;
}
.compare-course:last-child { border-bottom: none; }
.compare-course .cc-code { color: var(--nyu-purple); font-weight: 700; font-size: .78rem; min-width: 80px; }
.compare-course .cc-title { flex: 1; color: var(--ink); }
.compare-course .cc-cr { color: var(--muted); font-size: .75rem; font-weight: 700; }
.compare-overlap { background: rgba(5,150,105,.08); border-left: 3px solid var(--green); padding-left: 8px; }
.compare-details {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  padding: 16px 20px;
  border-top: 1px solid var(--line);
  background: #fafbff;
}
.compare-detail-list {
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--surface);
  padding: 12px;
  min-width: 0;
}
.compare-detail-list h4 {
  margin: 0 0 8px;
  font-size: .76rem;
  color: var(--nyu-purple);
  text-transform: uppercase;
  letter-spacing: .04em;
}
.compare-detail-list span,
.compare-detail-list em {
  display: block;
  color: var(--muted);
  font-size: .76rem;
  padding: 5px 0;
  border-top: 1px solid var(--line);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.compare-detail-list span:first-of-type,
.compare-detail-list em:first-of-type { border-top: none; }
.overlap-legend {
  display: flex; gap: 16px; font-size: .78rem; color: var(--muted);
  padding: 12px 20px; border-top: 1px solid var(--line);
  background: #fafbff; flex-shrink: 0;
  flex-wrap: wrap;
}
[data-theme="dark"] .overlap-legend { background: var(--surface); }
[data-theme="dark"] .compare-details { background: var(--surface); }
.overlap-legend span { display: flex; align-items: center; gap: 5px; }
.leg-dot { width: 10px; height: 10px; border-radius: 2px; }

/* ── Graph controls ─────────────────────────────────────────── */
.graph-controls {
  position: absolute; top: 12px; right: 12px;
  display: flex; flex-direction: column; gap: 5px;
  z-index: 2;
}
.graph-ctrl-btn {
  width: 32px; height: 32px;
  display: grid; place-items: center;
  border: 1.5px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--surface);
  font-size: .95rem;
  cursor: pointer;
  box-shadow: var(--shadow-xs);
  transition: all 150ms;
}
.graph-ctrl-btn:hover { border-color: var(--nyu-purple); background: var(--nyu-soft); }

/* ── My Page improvements ───────────────────────────────────── */
.profile-hero {
  background: linear-gradient(135deg, var(--nyu-dark) 0%, var(--nyu-purple) 100%);
  border-radius: var(--r-lg);
  padding: 24px 28px;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 24px;
  flex-wrap: wrap;
  margin-bottom: 4px;
}
.profile-avatar-control {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.hero-avatar-custom {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: rgba(255,255,255,.2);
  border: 2px solid rgba(255,255,255,.42);
  color: #fff;
  display: grid;
  place-items: center;
  overflow: hidden;
  font-size: 26px;
  font-weight: 800;
  flex-shrink: 0;
}
.hero-avatar-custom img,
.sidebar-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.profile-avatar-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.profile-avatar-actions button {
  height: 32px;
  border: 1px solid rgba(255,255,255,.35);
  border-radius: var(--r-sm);
  background: rgba(255,255,255,.14);
  color: #fff;
  padding: 0 10px;
  font-size: .76rem;
  font-weight: 800;
}
.profile-avatar-actions button:hover:not(:disabled) {
  background: rgba(255,255,255,.24);
}
.profile-avatar-actions button:disabled {
  opacity: .45;
  cursor: not-allowed;
}
.profile-avatar-lg {
  width: 60px; height: 60px;
  border-radius: 50%;
  background: rgba(255,255,255,.2);
  border: 2px solid rgba(255,255,255,.35);
  display: grid; place-items: center;
  font-size: 1.6rem;
  flex-shrink: 0;
}
.profile-hero-info { flex: 1; }
.profile-hero-info h3 { font-size: 1.2rem; font-weight: 800; color: #fff; margin-bottom: 3px; }
.profile-hero-info p { font-size: .83rem; color: rgba(255,255,255,.65); }
.profile-hero-stats { display: flex; gap: 20px; flex-shrink: 0; }
.hero-stat { text-align: center; }
.hero-stat strong { display: block; font-size: 1.5rem; font-weight: 800; color: #fff; line-height: 1; }
.hero-stat span { display: block; font-size: .68rem; color: rgba(255,255,255,.6); text-transform: uppercase; letter-spacing: .05em; margin-top: 3px; font-weight: 600; }
.next-courses { display: grid; gap: 8px; }
.next-course-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px;
  border: 1.5px solid var(--line); border-radius: var(--r-sm);
  background: var(--surface);
  transition: border-color 160ms;
}
.next-course-item:hover { border-color: var(--nyu-lighter); }
.next-num {
  width: 24px; height: 24px; border-radius: var(--r-sm);
  background: var(--nyu-soft); color: var(--nyu-purple);
  display: grid; place-items: center; font-size: .75rem; font-weight: 800;
  flex-shrink: 0;
}
.next-course-item strong { font-size: .85rem; display: block; }
.next-course-item span { font-size: .76rem; color: var(--muted); }

.profile-dashboard-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}
.profile-dashboard-grid.compact {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.profile-metric-card {
  min-width: 0;
  padding: 12px;
  border: 1.5px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--surface);
}
.profile-metric-card span {
  display: block;
  color: var(--muted);
  font-size: .72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .04em;
  line-height: 1.3;
}
.profile-metric-card strong {
  display: block;
  margin-top: 6px;
  color: var(--ink);
  font-size: 1.05rem;
  line-height: 1.25;
  overflow-wrap: anywhere;
}
.profile-progress-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px 16px;
}
.profile-progress-row {
  min-width: 0;
  display: grid;
  gap: 7px;
}
.profile-progress-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.profile-progress-top strong {
  font-size: .86rem;
  color: var(--ink);
}
.profile-progress-top span {
  color: var(--muted);
  font-size: .78rem;
  font-weight: 900;
}
.profile-progress-bar {
  height: 9px;
  overflow: hidden;
  border-radius: var(--r-pill);
  background: var(--line);
}
.profile-progress-bar span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--nyu-purple), var(--nyu-mid));
}
.profile-alert-list,
.profile-current-semester,
.profile-course-mini-list {
  display: grid;
  gap: 10px;
}
.profile-alert-item {
  padding: 11px 12px;
  border: 1.5px solid #fed7aa;
  border-radius: var(--r-sm);
  background: #fff7ed;
}
.profile-alert-item span {
  display: inline-flex;
  margin-bottom: 4px;
  padding: 2px 8px;
  border-radius: var(--r-pill);
  background: #ffedd5;
  color: #c2410c;
  font-size: .7rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.profile-alert-item p {
  margin: 0;
  color: var(--ink);
  font-size: .84rem;
  line-height: 1.45;
}
.profile-empty-state {
  padding: 14px;
  border: 1.5px dashed var(--line);
  border-radius: var(--r-sm);
  background: var(--surface);
}
.profile-empty-state strong,
.profile-empty-state span {
  display: block;
}
.profile-empty-state strong {
  color: var(--ink);
  font-size: .9rem;
}
.profile-empty-state span {
  margin-top: 4px;
  color: var(--muted);
  font-size: .8rem;
  line-height: 1.45;
}
.profile-semester-summary {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
  border: 1.5px solid var(--nyu-lighter);
  border-radius: var(--r-sm);
  background: var(--nyu-soft);
}
.profile-semester-summary strong {
  color: var(--nyu-dark);
  font-size: .95rem;
}
.profile-semester-summary span {
  color: var(--nyu-purple);
  font-size: .8rem;
  font-weight: 900;
  text-align: right;
}
.profile-course-mini {
  display: grid;
  gap: 2px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}
.profile-course-mini:last-child {
  border-bottom: 0;
}
.profile-course-mini strong {
  color: var(--nyu-purple);
  font-size: .86rem;
}
.profile-course-mini span {
  color: var(--ink);
  font-size: .86rem;
  font-weight: 800;
  line-height: 1.35;
}
.profile-course-mini em {
  color: var(--muted);
  font-size: .76rem;
  font-style: normal;
  line-height: 1.35;
}
.saved-pathway-list {
  display: block;
}
.saved-pathways-fold {
  border: 1.5px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--surface);
  overflow: hidden;
}
.saved-pathways-fold summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  cursor: pointer;
  color: var(--ink);
  font-weight: 900;
  list-style: none;
}
.saved-pathways-fold summary::-webkit-details-marker {
  display: none;
}
.saved-pathways-fold summary::before {
  content: "▸";
  color: var(--nyu-purple);
  transition: transform .18s ease;
}
.saved-pathways-fold[open] summary::before {
  transform: rotate(90deg);
}
.saved-pathways-fold summary span {
  margin-right: auto;
}
.saved-pathways-fold summary strong {
  padding: 4px 10px;
  border-radius: var(--r-pill);
  background: var(--nyu-soft);
  color: var(--nyu-purple);
  font-size: .78rem;
}
.saved-pathway-scroll {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  max-height: 520px;
  overflow: auto;
  padding: 0 14px 14px;
}
.saved-pathway-card {
  min-width: 0;
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1.5px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--surface);
}
.saved-pathway-card strong {
  display: block;
  color: var(--ink);
  font-size: .92rem;
}
.saved-pathway-card p {
  margin-top: 2px;
  color: var(--muted);
  font-size: .78rem;
}
.saved-pathway-destination {
  color: var(--nyu-purple);
  font-size: .88rem;
  font-weight: 900;
  line-height: 1.35;
}
.saved-pathway-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.saved-pathway-tags span {
  padding: 3px 8px;
  border-radius: var(--r-pill);
  background: var(--nyu-soft);
  color: var(--nyu-purple);
  font-size: .72rem;
  font-weight: 800;
}
.saved-pathway-open {
  width: max-content;
  min-width: 110px;
}

/* ── Onboarding overlay ─────────────────────────────────────── */
.onboard-backdrop {
  position: fixed; inset: 0;
  background: rgba(20,0,40,.75); z-index: 600;
  display: none; align-items: center; justify-content: center;
  backdrop-filter: blur(6px);
}
.onboard-backdrop.open { display: flex; }
.onboard-card {
  background: var(--surface); border-radius: var(--r-xl);
  width: min(520px, 94vw); padding: 36px;
  box-shadow: 0 24px 64px rgba(0,0,0,.4);
  animation: modalIn 300ms ease;
  text-align: center;
}
.onboard-step-dots { display: flex; justify-content: center; gap: 6px; margin-bottom: 28px; }
.onboard-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--line); transition: background 250ms, width 250ms;
}
.onboard-dot.active { background: var(--nyu-purple); width: 20px; border-radius: var(--r-pill); }
.onboard-icon { font-size: 3rem; margin-bottom: 16px; }
.onboard-card h2 { font-size: 1.4rem; font-weight: 800; margin-bottom: 10px; }
.onboard-card p { color: var(--muted); line-height: 1.65; margin-bottom: 28px; font-size: .95rem; }
.onboard-actions { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.onboard-skip { font-size: .83rem; color: var(--muted); background: none; border: none; cursor: pointer; }
.onboard-skip:hover { color: var(--ink); }
.onboard-btns { display: flex; gap: 10px; }

@media (max-width: 760px) {
  .compare-saved-bar {
    grid-template-columns: 1fr 1fr;
  }
  .compare-saved-bar select { grid-column: 1 / -1; }
  .compare-body {
    display: block;
  }
  .compare-summary {
    grid-template-columns: 1fr 1fr;
    padding: 12px;
  }
  .compare-columns {
    grid-template-columns: 1fr;
    gap: 0;
  }
  .compare-details {
    grid-template-columns: 1fr 1fr;
    padding: 12px;
  }
  .compare-col {
    border-right: none;
    border-bottom: 1px solid var(--line);
    padding: 16px;
  }
}

@media (max-width: 520px) {
  .compare-details {
    grid-template-columns: 1fr;
  }
}

/* Final mobile navigation overrides. Kept late so later sidebar rules cannot hide the menu. */
@media (max-width: 760px) {
  .sidebar {
    position: sticky;
    top: 0;
    height: auto;
    max-width: 100vw;
    flex-direction: row;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    overflow: hidden;
    overflow-y: hidden;
  }
  .mobile-menu-toggle {
    flex: 0 0 auto;
    width: 38px;
    min-height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 1px solid rgba(255,255,255,0.22);
    border-radius: var(--r-sm);
    background: rgba(255,255,255,0.08);
    color: #fff;
    font-weight: 800;
  }
  .mobile-menu-toggle span {
    font-size: 1.15rem;
    line-height: 1;
  }
  .mobile-menu-panel {
    position: fixed;
    left: 12px;
    right: 12px;
    top: 64px;
    z-index: 999;
    display: none;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    padding: 12px;
    border: 1px solid rgba(255,255,255,0.18);
    border-radius: var(--r-md);
    background: var(--nyu-dark);
    box-shadow: 0 18px 36px rgba(20,0,40,.32);
  }
  .mobile-menu-panel.open {
    display: grid;
  }
  .mobile-menu-item {
    min-height: 44px;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 9px 10px;
    border: 1px solid rgba(255,255,255,0.14);
    border-radius: var(--r-sm);
    background: rgba(255,255,255,0.06);
    color: rgba(255,255,255,0.78);
    text-align: left;
  }
  .mobile-menu-item.active {
    background: rgba(255,255,255,0.16);
    color: #fff;
    border-color: rgba(255,255,255,0.3);
  }
  .mobile-menu-item span {
    width: 20px;
    text-align: center;
    flex-shrink: 0;
  }
  .mobile-menu-item strong {
    font-size: 0.84rem;
    line-height: 1.2;
  }
  .sidebar::-webkit-scrollbar { display: none; }
  .brand {
    flex: 0 0 auto;
    padding: 0;
    margin: 0;
    border: 0;
  }
  .brand-mark {
    width: 34px;
    height: 34px;
  }
  .brand-text {
    display: block;
  }
  .brand-text span,
  .nav-section-label,
  .sidebar-footer,
  .sidebar-user {
    display: none !important;
  }
  .nav-list {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    flex-direction: row;
    gap: 6px;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }
  .nav-list::-webkit-scrollbar {
    display: none;
  }
  .nav-item {
    flex: 0 0 auto;
    width: auto;
    min-height: 38px;
    margin: 0;
    padding: 8px 12px;
    justify-content: center;
  }
  .profile-nav-pinned {
    display: none !important;
  }
  .nav-item .nav-icon,
  .profile-nav-pinned .nav-icon {
    display: none;
  }
  .nav-item .nav-label,
  .profile-nav-pinned .nav-label {
    display: inline !important;
  }
}

@media (max-width: 480px) {
  .brand-text {
    display: block;
  }
  .brand-text span {
    display: none;
  }
}

.market-filters.sell-mode {
  display: none !important;
}

/* Final marketplace responsive overrides */
#materials .section-heading {
  align-items: center;
}
#materials .section-heading > div:first-child {
  min-width: 0;
}
#materials .market-tabs {
  max-width: 100%;
  scrollbar-width: none;
}
#materials .market-tabs::-webkit-scrollbar {
  display: none;
}
#materials .market-tab {
  flex: 0 0 auto;
}
#materials .resource-layout.browse-mode {
  display: block;
  width: 100%;
}
#materials .resource-layout.mine-mode {
  display: block;
  width: 100%;
}
#materials .resource-layout.browse-mode .resource-list,
#materials .resource-layout.mine-mode .resource-list,
#materials .resource-layout.browse-mode .material-grid,
#materials .resource-layout.mine-mode .material-grid,
#materials .resource-layout.browse-mode .subject-directory,
#materials .resource-layout.mine-mode .market-mine-library {
  width: 100%;
  max-width: none;
  grid-column: 1 / -1;
}
#materials .resource-layout.browse-mode .material-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}
#materials .resource-layout.mine-mode #materialGrid {
  display: block;
}
#materials .resource-layout.mine-mode .market-mine-library {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}
#materials .resource-layout.mine-mode .market-mine-grid {
  max-height: none;
  overflow: visible;
  padding-right: 0;
  grid-template-columns: repeat(auto-fit, minmax(min(340px, 100%), 1fr));
}
#materials .material-card {
  min-width: 0;
  padding: 16px;
}
#materials .material-card h3 {
  font-size: 0.95rem;
}
#materials .material-card > p {
  min-height: 2.8em;
}
#materials .token-row,
#materials .buy-button,
#materials .resource-open-button {
  min-height: 42px;
}
#materials .subject-directory-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
#materials .subject-row {
  min-width: 0;
}
#materials .subject-row strong,
#materials .subject-row em {
  overflow-wrap: anywhere;
}
#materials .subject-directory-hero {
  align-items: center;
}
#materials .subject-directory-hero > div:first-child {
  min-width: 260px;
  max-width: 420px;
}
#materials .subject-directory-hero h3,
#materials .subject-directory-hero p {
  max-width: none;
}
#materials .subject-stats {
  flex: 1;
  justify-content: flex-end;
}
@media (min-width: 1680px) {
  #materials .subject-directory-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}
@media (max-width: 1180px) {
  #materials .subject-directory-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  #materials .resource-layout.browse-mode .material-grid,
  #materials .resource-layout.mine-mode #materialGrid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 760px) {
  .reflection-toolbar,
  .course-reflection-group summary {
    grid-template-columns: 1fr;
  }
  .reflection-toolbar select,
  .reflection-toolbar input {
    height: 50px;
  }
  #courseReflectionCount {
    white-space: normal;
  }
  #materials .section-heading {
    display: grid;
    gap: 12px;
  }
  #materials .wallet {
    width: 100%;
    justify-content: space-between;
  }
  #materials .market-tabs {
    gap: 8px;
    padding-bottom: 2px;
  }
  #materials .market-tab {
    min-height: 42px;
    padding: 0 12px;
    font-size: 0.88rem;
  }
  #materials .market-mine-heading {
    align-items: flex-start;
  }
  #materials .market-mine-grid {
    grid-template-columns: 1fr;
  }
  #materials .market-filters {
    grid-template-columns: 1fr;
    padding: 12px;
  }
  #materials .subject-directory {
    gap: 12px;
  }
  #materials .subject-directory-hero {
    display: grid;
    padding: 16px;
    gap: 14px;
  }
  #materials .subject-directory-hero h3 {
    font-size: 1rem;
  }
  #materials .subject-directory-hero p {
    font-size: 0.86rem;
  }
  #materials .subject-stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
  }
  #materials .subject-stats strong {
    font-size: 1.1rem;
  }
  #materials .subject-directory-grid,
  #materials .material-grid,
  #materials .resource-layout.browse-mode .material-grid,
  #materials .resource-layout.mine-mode #materialGrid {
    grid-template-columns: 1fr;
  }
  #materials .subject-row {
    min-height: 116px;
    padding: 18px;
  }
  #materials .subject-count {
    top: 16px;
    right: 16px;
  }
  #materials .resource-layout,
  #materials .resource-layout.sell-mode {
    display: block;
  }
  #materials .upload-panel {
    padding: 16px;
  }
  .audit-hero {
    display: grid;
  }
  .audit-summary,
  .audit-whatif-grid {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 480px) {
  #materials .subject-stats {
    grid-template-columns: 1fr;
  }
  #materials .subject-stats span {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
  }
  #materials .wallet-amount {
    font-size: 1rem;
  }
}
@media (max-width: 760px) {
  .saved-pathway-scroll {
    grid-template-columns: 1fr;
    max-height: 460px;
  }
  .saved-pathways-fold summary {
    align-items: flex-start;
  }
}

/* ── Print styles ───────────────────────────────────────────── */
@media print {
  .sidebar, .topbar, .metric-grid, .course-bank,
  .equivalence-panel, .planner-actions, .planner-summary,
  .btn, button, .auth-overlay { display: none !important; }
  .app-shell { display: block; }
  .workspace { padding: 0; }
  .view-panel { display: block !important; box-shadow: none; border: none; }
  #planner { display: block !important; }
  .planner-layout { grid-template-columns: 1fr; }
  .plan-area { width: 100%; }
  .semester-grid { grid-template-columns: repeat(2,1fr); }
  body { font-size: 12px; color: #000; }
  h1, h2, h3 { color: #2e0051; }
  .semester-card { break-inside: avoid; border: 1px solid #ccc; }
  .grad-banner { background: #ecdff7 !important; color: #2e0051 !important; -webkit-print-color-adjust: exact; }
}
