/* ======================================  TOKENS  ====================================== */
:root {
  --crimson: #a51417; --crimson-dark: #7a0f11; --crimson-light: #f0d0d0;
  --gold: #c9a227;
  --bg: #f2f4f7; --surface: #fff; --surface-alt: #f8f9fa;
  --border: #dde1e8; --text: #1a1c22; --muted: #6b7280;
  --radius: 10px; --shadow: 0 2px 10px rgba(0,0,0,.08); --shadow-md: 0 4px 16px rgba(0,0,0,.11);
  --font-xs: 11px; --font-sm: 13px; --font-md: 15px; --font-lg: 18px; --font-xl: 22px;
  color-scheme: light;
}

/* == DARK MODE == */
[data-theme="dark"] {
  --bg: #111827; --surface: #1f2937; --surface-alt: #283548;
  --border: #374151; --text: #e5e7eb; --muted: #9ca3af;
  --crimson: #d04040; --crimson-dark: #a51417; --crimson-light: #3b1f1f;
  --shadow: 0 2px 10px rgba(0,0,0,.25); --shadow-md: 0 4px 16px rgba(0,0,0,.35);
  color-scheme: dark;
}
[data-theme="dark"] .login-box,
[data-theme="dark"] .admin-box,
[data-theme="dark"] .modal-box { background: var(--surface); color: var(--text); }
[data-theme="dark"] .lf-input,
[data-theme="dark"] .fp-select,
[data-theme="dark"] .tag-input,
[data-theme="dark"] .notes-textarea { background: var(--surface-alt); color: var(--text); border-color: var(--border); }
[data-theme="dark"] thead { background: var(--surface-alt); }
[data-theme="dark"] td { border-bottom-color: var(--border); }
[data-theme="dark"] .upload-zone { border-color: var(--border); }
[data-theme="dark"] .upload-zone:hover { background: #2d1a1a; }
[data-theme="dark"] .desc-inner { background: var(--surface-alt) !important; }
[data-theme="dark"] .notes-area { background: #1a2636; border-left-color: #0c4a6e; }
[data-theme="dark"] .tags-area { background: #1f1433; border-left-color: #7c3aed; }
[data-theme="dark"] .prereq-block { background: #2d2305; border-left-color: #d97706; color: #fbbf24; }
[data-theme="dark"] tr.cr:hover { background: var(--surface-alt); }
[data-theme="dark"] tr.cr.in-s { background: #0f2918; }
[data-theme="dark"] .sug-box { background: var(--surface); }
[data-theme="dark"] .sug-item:hover, [data-theme="dark"] .sug-item.active { background: var(--surface-alt); }
[data-theme="dark"] .admin-format { background: var(--surface-alt); }
[data-theme="dark"] .no-sched-chip { background: #0f2918; border-color: #166534; color: #86efac; }
[data-theme="dark"] .mobile-card { background: var(--surface); border-color: var(--border); }
[data-theme="dark"] .compare-card { background: rgba(255,255,255,.08); }
[data-theme="dark"] .login-security { background: var(--surface-alt); color: var(--muted); }
[data-theme="dark"] .hidden-section { background: var(--surface); border-color: var(--border); }
[data-theme="dark"] .hidden-chip { background: #2d1f1f; border-color: #4a2020; color: #f87171; }
[data-theme="dark"] .saved-note { background: #1a2636; border-color: #1e3a5f; }
[data-theme="dark"] mark.hl { background: #78350f; color: #fde68a; }
[data-theme="dark"] .inline-confirm-box { background: var(--surface); color: var(--text); }

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg); color: var(--text);
  font-size: var(--font-sm); line-height: 1.5;
}

/* == SKIP LINK == */
.skip-link {
  position: absolute; top: -40px; left: 0; padding: 8px 16px;
  background: var(--crimson); color: #fff; z-index: 10000;
  font-size: var(--font-sm); font-weight: 700; text-decoration: none;
  transition: top .2s;
}
.skip-link:focus { top: 0; }

/* == LOGIN OVERLAY == */
#loginOverlay, #userAuthOverlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.55); backdrop-filter: blur(4px);
  z-index: 9000; display: none; align-items: center; justify-content: center;
}
#loginOverlay.open, #userAuthOverlay.open { display: flex; }
.login-box {
  background: var(--surface); border-radius: 14px; padding: 32px 36px; width: 360px;
  box-shadow: 0 20px 60px rgba(0,0,0,.25);
}
.login-logo { text-align: center; font-size: 32px; margin-bottom: 6px; }
.login-title { text-align: center; font-size: var(--font-lg); font-weight: 700; margin-bottom: 4px; }
.login-sub { text-align: center; font-size: var(--font-xs); color: var(--muted); margin-bottom: 22px; }
.lf-group { margin-bottom: 14px; }
.lf-group label { display: block; font-size: var(--font-xs); font-weight: 600; color: var(--muted); margin-bottom: 5px; }
.lf-input {
  width: 100%; padding: 9px 12px; border: 1.5px solid var(--border); border-radius: 8px;
  font-size: var(--font-sm); outline: none; transition: border-color .15s;
  background: var(--surface); color: var(--text);
}
.lf-input:focus { border-color: var(--crimson); }
.lf-error { font-size: var(--font-xs); color: #dc2626; margin-top: 5px; display: none; }
.lf-error.on { display: block; }
.btn-login {
  width: 100%; padding: 10px; border-radius: 8px; border: none;
  background: var(--crimson); color: #fff; font-size: var(--font-sm); font-weight: 700;
  cursor: pointer; transition: background .15s; margin-top: 4px;
}
.btn-login:hover { background: var(--crimson-dark); }
.login-hint { text-align: center; font-size: var(--font-xs); color: var(--muted); margin-top: 12px; }
.login-security {
  margin-top: 16px; padding: 10px 12px; background: var(--surface-alt); border-radius: 8px;
  font-size: 10px; color: var(--muted); line-height: 1.6;
}
.set-pw-note {
  background: #fef9c3; border: 1px solid #f59e0b; border-radius: 7px;
  padding: 8px 11px; font-size: var(--font-xs); color: #78350f; margin-bottom: 14px;
}

/* == MODAL OVERLAY == */
.modal-overlay {
  display: none; position: fixed; inset: 0; z-index: 9999;
  background: rgba(0,0,0,.45); align-items: center; justify-content: center;
}
.modal-overlay.open { display: flex; }
.modal-box {
  background: var(--surface); border-radius: 14px; padding: 28px 32px;
  box-shadow: 0 20px 60px rgba(0,0,0,.35); max-width: calc(100vw - 32px);
}

/* == INLINE CONFIRM DIALOG == */
.inline-confirm-overlay {
  position: fixed; inset: 0; z-index: 10000;
  background: rgba(0,0,0,.45); display: flex; align-items: center; justify-content: center;
  animation: fadeIn .15s ease;
}
.inline-confirm-box {
  background: var(--surface); border-radius: 14px; padding: 24px 28px;
  box-shadow: 0 20px 60px rgba(0,0,0,.35); max-width: 360px; width: 90vw;
}
.inline-confirm-box p { font-size: var(--font-sm); margin-bottom: 16px; color: var(--text); }
.inline-confirm-btns { display: flex; gap: 10px; justify-content: flex-end; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

/* == ADMIN PANEL MODAL == */
#adminPanel {
  position: fixed; inset: 0; background: rgba(0,0,0,.45); backdrop-filter: blur(3px);
  z-index: 8000; display: flex; align-items: center; justify-content: center;
}
#adminPanel.hidden { display: none; }
.admin-box {
  background: var(--surface); border-radius: 14px; padding: 28px 32px; width: 520px; max-width: 95vw;
  box-shadow: 0 16px 50px rgba(0,0,0,.22);
}
.admin-title { font-size: 17px; font-weight: 700; margin-bottom: 4px; display: flex; align-items: center; gap: 8px; }
.admin-sub { font-size: var(--font-xs); color: var(--muted); margin-bottom: 20px; }
.admin-section { margin-bottom: 22px; }
.admin-section-title {
  font-size: var(--font-xs); font-weight: 700; text-transform: uppercase;
  letter-spacing: .07em; color: var(--muted); margin-bottom: 10px;
  padding-bottom: 6px; border-bottom: 1px solid var(--border);
}
.upload-zone {
  border: 2px dashed var(--border); border-radius: 10px; padding: 22px;
  text-align: center; cursor: pointer; transition: all .15s;
}
.upload-zone:hover, .upload-zone.drag { border-color: var(--crimson); background: #fdf0f0; }
.upload-zone p { font-size: var(--font-sm); color: var(--muted); margin-top: 6px; }
.upload-zone .uz-icon { font-size: 28px; }
.upload-status { margin-top: 10px; padding: 9px 13px; border-radius: 8px; font-size: var(--font-xs); display: none; }
.upload-status.ok { background: #dcfce7; color: #166534; display: block; }
.upload-status.err { background: #fee2e2; color: #991b1b; display: block; }
.admin-format {
  background: var(--surface-alt); border-radius: 8px; padding: 10px 13px;
  font-size: var(--font-xs); color: var(--muted); line-height: 1.7;
}
.admin-format code { background: #e5e7eb; padding: 1px 5px; border-radius: 4px; font-size: 10px; }
.btn-admin-close {
  padding: 8px 18px; border-radius: 8px; border: 1.5px solid var(--border);
  background: var(--surface); color: var(--muted); font-size: var(--font-sm); font-weight: 600;
  cursor: pointer; transition: all .15s;
}
.btn-admin-close:hover { border-color: var(--crimson); color: var(--crimson); }
.btn-upload-confirm {
  padding: 8px 18px; border-radius: 8px; border: none;
  background: var(--crimson); color: #fff; font-size: var(--font-sm); font-weight: 700;
  cursor: pointer; transition: background .15s; display: none;
}
.btn-upload-confirm:hover { background: var(--crimson-dark); }
.btn-upload-confirm.ready { display: inline-block; }
.admin-footer { display: flex; justify-content: flex-end; gap: 8px; margin-top: 8px; }
.semester-badge {
  display: inline-block; padding: 2px 10px; border-radius: 10px;
  background: var(--crimson-light); color: var(--crimson); font-size: var(--font-xs); font-weight: 700;
}

/* == CALENDAR MODAL == */
#calModal {
  position: fixed; z-index: 7000; background: var(--surface); border-radius: 11px;
  box-shadow: 0 8px 32px rgba(0,0,0,.22); padding: 14px 16px;
  width: 280px; max-width: 90vw; display: none;
  border-top: 3px solid var(--crimson); animation: fadeInUp .18s ease;
}
#calModal.open { display: block; }
@keyframes fadeInUp { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.cal-modal-close {
  position: absolute; top: 8px; right: 10px;
  background: none; border: none; cursor: pointer; font-size: 14px; color: var(--muted);
}
.cal-modal-close:hover { color: var(--crimson); }
.cal-modal-code { font-weight: 700; font-size: var(--font-sm); color: var(--crimson); margin-bottom: 2px; }
.cal-modal-title { font-size: var(--font-xs); font-weight: 600; margin-bottom: 6px; line-height: 1.4; }
.cal-modal-meta { font-size: var(--font-xs); color: var(--muted); margin-bottom: 8px; line-height: 1.7; }
.cal-modal-desc {
  font-size: var(--font-xs); color: var(--text); line-height: 1.6;
  max-height: 130px; overflow-y: auto; padding-right: 2px;
  border-top: 1px solid var(--border); padding-top: 7px;
}
.cal-modal-prereq {
  margin-top: 7px; padding: 7px 9px; background: #fff3cd;
  border-left: 3px solid #f59e0b; border-radius: 0 5px 5px 0;
  font-size: 10px; color: #78350f; line-height: 1.6;
}

/* == UNDO TOAST == */
.undo-toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%) translateY(80px);
  background: #1e3a5f; color: #fff; padding: 10px 20px; border-radius: 20px;
  font-size: var(--font-sm); font-weight: 600; z-index: 9999;
  display: flex; align-items: center; gap: 12px;
  transition: transform .3s ease, opacity .3s ease; opacity: 0; pointer-events: none;
}
.undo-toast.show { transform: translateX(-50%) translateY(0); opacity: 1; pointer-events: auto; }
.btn-undo {
  background: rgba(255,255,255,.2); border: 1px solid rgba(255,255,255,.4);
  color: #fff; padding: 4px 12px; border-radius: 12px; font-size: var(--font-xs);
  font-weight: 700; cursor: pointer; transition: background .15s;
}
.btn-undo:hover { background: rgba(255,255,255,.35); }

/* == TOP STICKY BAND == */
.top-band { position: sticky; top: 0; z-index: 500; display: flex; flex-direction: column; }
.header {
  background: var(--crimson); color: #fff;
  padding: 9px 20px; display: flex; align-items: center; gap: 12px;
  box-shadow: 0 2px 8px rgba(0,0,0,.25);
}
.header-logo { font-size: var(--font-xl); display: flex; align-items: center; }
.washu-logo { height: 32px; width: auto; display: block; }
.header-titles h1 { font-size: 16px; font-weight: 700; }
.header-titles p { font-size: var(--font-xs); opacity: .85; }
.header-right { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.header-stat {
  background: rgba(255,255,255,.18); border-radius: 20px;
  padding: 3px 12px; font-size: var(--font-xs); font-weight: 600;
}
.btn-theme-toggle {
  background: none; border: none; cursor: pointer; font-size: var(--font-lg);
  line-height: 1; padding: 2px 6px; transition: transform .15s;
  filter: brightness(1.2);
}
.btn-theme-toggle:hover { transform: scale(1.2); }
.btn-user-auth {
  background: rgba(255,255,255,.15); border: 1px solid rgba(255,255,255,.3);
  border-radius: 20px; padding: 3px 12px; color: #fff;
  font-size: var(--font-xs); font-weight: 600; cursor: pointer;
  display: flex; align-items: center; gap: 5px; transition: all .15s;
}
.btn-user-auth:hover { background: rgba(255,255,255,.25); }
.btn-user-auth.logged-in { background: rgba(16,185,129,.3); border-color: rgba(16,185,129,.5); }
.user-auth-label { white-space: nowrap; }
.btn-admin-login {
  background: rgba(255,255,255,.15); border: 1px solid rgba(255,255,255,.3);
  border-radius: 20px; padding: 3px 12px; color: #fff;
  cursor: pointer; transition: all .15s;
  font-size: var(--font-xs); font-weight: 600;
  display: flex; align-items: center; gap: 4px;
}
.btn-admin-login:hover { background: rgba(255,255,255,.25); transform: scale(1.02); }
.btn-admin-login.logged-in { background: rgba(255,255,255,.25); border-color: rgba(255,255,255,.5); }

/* == SEMESTER SWITCHER == */
.semester-switcher { position: relative; }
.semester-switch-btn {
  background: rgba(255,255,255,.15); border: 1px solid rgba(255,255,255,.3);
  border-radius: 20px; padding: 3px 14px 3px 12px; color: #fff;
  cursor: pointer; transition: all .15s;
  font-size: var(--font-xs); font-weight: 600;
  display: flex; align-items: center; gap: 5px; white-space: nowrap;
}
.semester-switch-btn:hover { background: rgba(255,255,255,.25); }
.semester-switch-arrow { font-size: 10px; transition: transform .15s; }
.semester-dropdown {
  position: absolute; top: calc(100% + 6px); right: 0; min-width: 200px;
  background: var(--surface); border-radius: 10px; box-shadow: var(--shadow-md);
  border: 1px solid var(--border); z-index: 700;
  display: none; overflow: hidden;
  animation: fadeInDown .15s ease;
}
.semester-dropdown.open { display: block; }
@keyframes fadeInDown { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
.semester-option {
  padding: 10px 14px; cursor: pointer; font-size: var(--font-sm);
  color: var(--text); display: flex; align-items: center; justify-content: space-between;
  transition: background .1s; border-bottom: 1px solid var(--border);
}
.semester-option:last-child { border-bottom: none; }
.semester-option:hover { background: var(--surface-alt); }
.semester-option.active { background: var(--crimson-light); color: var(--crimson); font-weight: 600; }
.semester-active-dot { color: #16a34a; font-size: 10px; }
[data-theme="dark"] .semester-dropdown { background: var(--surface); border-color: var(--border); }
[data-theme="dark"] .semester-option:hover { background: var(--surface-alt); }
[data-theme="dark"] .semester-option.active { background: #3b1f1f; }

/* == KEYBOARD FOCUS STYLES == */
tr.cr:focus {
  outline: 2px solid var(--crimson);
  outline-offset: -2px;
  background: var(--crimson-light) !important;
}
[data-theme="dark"] tr.cr:focus {
  background: rgba(165, 20, 23, 0.15) !important;
}
tr.cr:focus-visible {
  outline: 2px solid var(--crimson);
  outline-offset: -2px;
}
.keyboard-hint {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 10px; color: var(--muted); margin-left: 8px;
}
.kbd {
  display: inline-block; padding: 1px 5px; border-radius: 3px;
  background: var(--surface-alt); border: 1px solid var(--border);
  font-family: monospace; font-size: 9px; font-weight: 600;
  line-height: 1.4;
}

/* == HERO SEARCH == */
.hero-wrap { background: var(--crimson-dark); padding: 10px 22px 12px; }
.hero-inner { position: relative; width: 100%; }
.hero-input {
  width: 100%; padding: 11px 44px 11px 46px;
  border: none; border-bottom: 2px solid rgba(255,255,255,.35);
  border-radius: 0; background: transparent;
  font-size: var(--font-lg); font-weight: 500; outline: none;
  color: #fff; caret-color: #fff; transition: border-color .2s;
}
.hero-input::placeholder { color: rgba(255,255,255,.45); }
.hero-input:focus { border-bottom-color: rgba(255,255,255,.85); }
.hero-icon { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: rgba(255,255,255,.55); font-size: var(--font-lg); pointer-events: none; }
.hero-clear {
  position: absolute; right: 14px; top: 50%; transform: translateY(-50%);
  background: none; border: none; font-size: var(--font-lg); cursor: pointer; color: rgba(255,255,255,.55); display: none;
}
.hero-clear:hover { color: #fff; }
.hero-clear.on { display: block; }
.hero-count { text-align: left; margin-top: 4px; font-size: var(--font-xs); color: rgba(255,255,255,.6); padding-left: 46px; }
.sug-box {
  position: absolute; top: calc(100% + 4px); left: 0; right: 0;
  background: var(--surface); border-radius: 9px; box-shadow: var(--shadow-md);
  overflow: hidden; z-index: 600; display: none;
}
.sug-box.open { display: block; }
.sug-item {
  display: flex; align-items: center; gap: 9px; padding: 8px 13px; cursor: pointer;
  border-bottom: 1px solid var(--border); transition: background .1s;
}
.sug-item:hover, .sug-item.active { background: #f0f4ff; }
.sug-icon { font-size: 17px; }
.sug-text { flex: 1; min-width: 0; }
.sug-title { font-weight: 600; font-size: var(--font-xs); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sug-sub { font-size: var(--font-xs); color: var(--muted); }
.sug-snippet { font-size: 10px; color: var(--muted); margin-top: 2px; font-style: italic; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sug-badge {
  font-size: 10px; padding: 2px 7px; border-radius: 9px;
  background: var(--crimson-light); color: var(--crimson); font-weight: 600; white-space: nowrap;
}
mark.hl { background: #fff176; color: inherit; border-radius: 2px; }
.sug-footer {
  padding: 8px 14px; text-align: center; font-size: var(--font-xs); color: var(--crimson);
  font-weight: 600; cursor: pointer;
}
.sug-footer:hover { background: #fdf0f0; }

/* == CALENDAR SECTION == */
.cal-section-wrap {
  position: fixed; left: 0; right: 0; top: var(--top-band-h, 92px);
  z-index: 399; max-width: none; padding: 0; margin: 0; background: transparent;
}
.cal-section {
  max-width: 1600px; margin: 0 auto; padding: 0 14px;
  background: var(--surface); border-radius: var(--radius);
  box-shadow: var(--shadow-md); border: 1px solid var(--border);
}
.cal-toolbar {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  padding: 7px 14px 5px; border-bottom: 1px solid var(--border);
}
.cal-toolbar h2 { font-size: var(--font-sm); font-weight: 700; white-space: nowrap; }
.cal-tabs { display: flex; gap: 3px; flex-wrap: wrap; }
.cal-tab {
  padding: 3px 10px; border-radius: 14px; font-size: var(--font-xs); font-weight: 600;
  cursor: pointer; border: 1.5px solid var(--border); background: var(--surface-alt);
  color: var(--muted); transition: all .15s; white-space: nowrap;
}
.cal-tab.active { background: var(--crimson); color: #fff; border-color: var(--crimson); }
.credit-pills { display: flex; gap: 5px; flex-wrap: wrap; margin-left: auto; }
.credit-pill {
  display: flex; align-items: center; gap: 3px;
  padding: 2px 9px; border-radius: 12px; font-size: var(--font-xs); font-weight: 700; white-space: nowrap;
}
.cp-total { background: #1e3a5f; color: #fff; }
.cp-full { background: #065f46; color: #fff; }
.cp-halfa { background: #5b21b6; color: #fff; }
.cp-halfb { background: #9a3412; color: #fff; }
.cp-inter { background: #b45309; color: #fff; }
.credit-pill span { opacity: .8; font-weight: 400; }

.btn-cal-toggle {
  padding: 3px 10px; border-radius: 12px; font-size: var(--font-xs); font-weight: 600;
  cursor: pointer; border: 1.5px solid var(--border); background: var(--surface-alt);
  color: var(--muted); transition: all .15s; white-space: nowrap;
}
.btn-cal-toggle:hover { border-color: var(--crimson); color: var(--crimson); }
.btn-cal-toggle.collapsed { background: var(--crimson); color: #fff; border-color: var(--crimson); }
.btn-cal-expand {
  padding: 3px 9px; border-radius: 12px; font-size: var(--font-xs); font-weight: 600;
  cursor: pointer; border: 1.5px solid var(--border); background: var(--surface-alt);
  color: var(--muted); transition: all .15s; white-space: nowrap;
}
.btn-cal-expand:hover, .btn-cal-expand.active { background: var(--crimson); color: #fff; border-color: var(--crimson); }
.btn-save-sched {
  padding: 4px 11px; border-radius: 14px; font-size: var(--font-xs); font-weight: 700;
  cursor: pointer; border: none; background: #16a34a; color: #fff;
  display: flex; align-items: center; gap: 4px; transition: background .15s; white-space: nowrap;
}
.btn-save-sched:hover { background: #15803d; }
.btn-save-sched.saved { background: #0369a1; }

.cal-grid-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; transition: max-height .3s ease, opacity .3s ease; }
.cal-grid-wrap.collapsed { max-height: 0; overflow: hidden; opacity: 0; }
.cal-grid { display: grid; grid-template-columns: 40px repeat(7, 1fr); min-width: 420px; }
.cal-col-hdr {
  text-align: center; padding: 4px 2px; font-size: var(--font-xs); font-weight: 700;
  background: var(--surface-alt); border-bottom: 1px solid var(--border);
  border-right: 1px solid var(--border); color: var(--muted);
}
.cal-col-hdr:last-child { border-right: none; }
.cal-time-lbl {
  font-size: var(--font-xs); color: var(--muted); text-align: right; padding-right: 4px;
  border-right: 1px solid var(--border); position: absolute; width: 100%; top: 0;
}
.cal-day-col { position: relative; border-right: 1px solid var(--border); }
.cal-day-col:last-child { border-right: none; }
.cal-hr-line { position: absolute; left: 0; right: 0; height: 1px; background: var(--border); pointer-events: none; }
.cal-event {
  position: absolute; border-radius: 5px;
  padding: 3px 5px; font-size: var(--font-xs); overflow: hidden; cursor: pointer;
  transition: filter .15s, box-shadow .15s, outline .1s;
  border-left: 3px solid rgba(0,0,0,.18); z-index: 2;
}
.cal-event:hover { filter: brightness(.9); box-shadow: 0 2px 6px rgba(0,0,0,.18); }
.cal-event.conflict-event { outline: 2px solid #ef4444; outline-offset: 1px; animation: shake .35s ease; }
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-3px); } 40% { transform: translateX(3px); }
  60% { transform: translateX(-2px); } 80% { transform: translateX(2px); }
}
.cal-event-code { font-weight: 700; font-size: var(--font-xs); line-height: 1.3; }
.cal-event-title { font-size: var(--font-xs); line-height: 1.2; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.cal-event-time { font-size: var(--font-xs); opacity: .8; }
.cal-event-fav { position: absolute; top: 2px; right: 3px; font-size: var(--font-xs); }
.cal-empty-msg { grid-column: 1 / -1; padding: 10px; text-align: center; font-size: var(--font-xs); color: var(--muted); font-style: italic; }
.cal-legend { display: flex; gap: 8px; flex-wrap: wrap; padding: 4px 14px 5px; border-top: 1px solid var(--border); }
.legend-item { display: flex; align-items: center; gap: 4px; font-size: 10px; color: var(--muted); }
.legend-dot { width: 8px; height: 8px; border-radius: 50%; }
.credit-bar-mobile { display: none; flex-wrap: wrap; gap: 5px; padding: 6px 14px 7px; border-top: 1px solid var(--border); background: var(--surface); }
.cal-credit-warn { font-size: var(--font-xs); font-weight: 700; padding: 3px 8px; border-radius: 10px; margin-left: 4px; }
.cal-credit-warn.warn { background: #fef9c3; color: #78350f; }
.cal-credit-warn.over { background: #fee2e2; color: #7f1d1d; animation: pulse .7s infinite alternate; }
@keyframes pulse { from { opacity: 1; } to { opacity: .6; } }

/* == HIDDEN COURSES SECTION == */
.hidden-section {
  background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 12px 16px; margin-bottom: 10px; border-left: 3px solid #ef4444;
}
.hidden-section-title {
  font-size: var(--font-xs); font-weight: 700; color: var(--muted);
  text-transform: uppercase; letter-spacing: .07em; margin-bottom: 8px;
}
.hidden-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.hidden-chip {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 4px 10px; border-radius: 8px; font-size: var(--font-xs); font-weight: 600;
  background: #fef2f2; border: 1px solid #fca5a5; color: #7f1d1d; transition: all .15s;
}
.hidden-chip-restore {
  background: none; border: none; color: #2563eb; font-size: var(--font-xs); font-weight: 700;
  cursor: pointer; margin-left: 4px; padding: 0;
}
.hidden-chip-restore:hover { color: #1d4ed8; text-decoration: underline; }

/* == NO-SCHEDULE SECTION == */
.no-sched-section {
  background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 12px 16px; margin-bottom: 10px;
}
.no-sched-title {
  font-size: var(--font-xs); font-weight: 700; color: var(--muted);
  text-transform: uppercase; letter-spacing: .07em; margin-bottom: 8px;
}
.no-sched-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.no-sched-chip {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 4px 10px; border-radius: 8px; font-size: var(--font-xs); font-weight: 600;
  background: #f0fdf4; border: 1px solid #86efac; color: #166534; cursor: pointer; transition: all .15s;
}
.no-sched-chip:hover { background: #dcfce7; border-color: #4ade80; }

/* == PAGE LAYOUT == */
.app { max-width: 1600px; margin: 0 auto; padding: 0 14px 40px; display: flex; flex-direction: column; gap: 10px; }
.conflict-bar {
  background: #fee2e2; border: 1.5px solid #ef4444; border-radius: 8px;
  padding: 8px 14px; display: none; align-items: center; gap: 9px; font-size: var(--font-xs); color: #7f1d1d;
}
.conflict-bar.on { display: flex; }
.conflict-txt { flex: 1; }
.main-grid { display: grid; grid-template-columns: 240px 1fr; gap: 12px; align-items: start; }

/* == FILTER PANEL == */
.filter-panel {
  background: var(--surface); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 12px;
  position: sticky; top: 200px;
  max-height: calc(100vh - 210px); overflow-y: auto;
}
.fp-title {
  font-size: var(--font-xs); text-transform: uppercase; letter-spacing: .08em;
  color: var(--muted); margin-bottom: 9px; font-weight: 700;
}
.fg { margin-bottom: 11px; }
.fg label {
  display: block; font-size: var(--font-xs); font-weight: 600;
  color: var(--muted); margin-bottom: 3px;
}
.fp-select {
  width: 100%; padding: 6px 9px; border: 1.5px solid var(--border);
  border-radius: 7px; font-size: var(--font-xs); background: var(--surface); color: var(--text);
  outline: none; appearance: none; cursor: pointer; transition: border-color .15s;
}
.fp-select:focus { border-color: var(--crimson); }
.fp-divider { border: none; border-top: 1px solid var(--border); margin: 10px 0; }
.btn-clear {
  width: 100%; padding: 6px; border: 1.5px solid var(--border);
  border-radius: 7px; background: var(--surface); color: var(--muted);
  font-size: var(--font-xs); font-weight: 600; cursor: pointer; transition: all .15s;
}
.btn-clear:hover { border-color: var(--crimson); color: var(--crimson); }
.btn-clear-schedule { background: #fee2e2; color: #991b1b; border-color: #fca5a5; }
.btn-clear-schedule:hover { background: #fecaca; border-color: #ef4444; color: #7f1d1d; }
.sched-info { margin-top: 11px; padding-top: 11px; border-top: 1px solid var(--border); }
.sched-info-title {
  font-size: var(--font-xs); text-transform: uppercase; letter-spacing: .08em;
  color: var(--muted); margin-bottom: 7px; font-weight: 700;
}
.sched-pills { display: flex; flex-direction: column; gap: 3px; }
.sched-pill {
  display: flex; align-items: center; gap: 6px;
  padding: 4px 7px; border-radius: 7px; font-size: var(--font-xs);
  background: var(--surface-alt); border: 1px solid var(--border); cursor: pointer; transition: all .15s;
}
.sched-pill:hover { background: #fdf0f0; border-color: var(--crimson-light); }
.pill-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.pill-txt { flex: 1; min-width: 0; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: var(--font-xs); }
.pill-rm { color: #ccc; font-size: var(--font-xs); line-height: 1; flex-shrink: 0; cursor: pointer; }
.pill-rm:hover { color: var(--crimson); }
.sched-empty { font-size: var(--font-xs); color: var(--muted); text-align: center; padding: 7px 0; }

/* == RIGHT COLUMN == */
.right-col { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.export-bar { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 6px; }
.eb-left { font-size: var(--font-sm); color: var(--muted); }
.eb-left strong { color: var(--text); font-weight: 700; }
.eb-btns { display: flex; gap: 5px; flex-wrap: wrap; }
.btn-exp {
  padding: 5px 10px; border-radius: 7px; font-size: var(--font-xs); font-weight: 600;
  cursor: pointer; transition: all .15s; border: none; display: flex; align-items: center; gap: 4px;
}
.btn-exp.btn-disabled { opacity: .4; cursor: not-allowed; pointer-events: none; }
.bx { background: #217346; color: #fff; } .bx:hover { background: #195e39; }
.bp { background: #c0392b; color: #fff; } .bp:hover { background: #96281b; }
.bi { background: #2563eb; color: #fff; } .bi:hover { background: #1d4ed8; }
.bs { background: #6366f1; color: #fff; } .bs:hover { background: #4f46e5; }
.bpr { background: #374151; color: #fff; } .bpr:hover { background: #1f2937; }

/* == TABLE == */
.tbl-wrap { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.tbl-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table { width: 100%; border-collapse: collapse; min-width: 680px; }
thead { background: var(--surface-alt); }
th {
  padding: 8px 10px; text-align: left; font-size: var(--font-xs); font-weight: 700;
  text-transform: uppercase; letter-spacing: .06em; color: var(--muted);
  border-bottom: 2px solid var(--border); white-space: nowrap; user-select: none;
}
th.sortable { cursor: pointer; }
th.sortable:hover { color: var(--crimson); }
.si { margin-left: 3px; opacity: .45; }
th.sa .si { opacity: 1; color: var(--crimson); }
td {
  padding: 7px 10px; border-bottom: 1px solid var(--border);
  vertical-align: top; font-size: var(--font-sm);
}
.col-title { max-width: 320px; min-width: 160px; }
.col-instructor { min-width: 80px; max-width: 130px; font-size: var(--font-xs) !important; white-space: normal !important; }
tr:last-child td { border-bottom: none; }
tr.cr { cursor: pointer; transition: background .1s; border-left: 3px solid transparent; }
tr.cr:hover { background: var(--surface-alt); }
tr.cr.in-s { background: #f0fdf4; }
tr.cr.de { background: #fffbf0 !important; }
tr.cr.conflict-row { background: #fef2f2 !important; box-shadow: inset 3px 0 0 #ef4444; }
tr.cr.conflict-row.in-s { background: #fef2f2 !important; }
tr.desc-row td { padding: 0; border-bottom: 1px solid var(--border); background: var(--surface-alt); }
.desc-inner {
  padding: 11px 15px 13px; font-size: var(--font-sm); line-height: 1.65;
  color: var(--muted); max-width: 960px; display: none; animation: slideD .18s ease;
}
.desc-inner.open { display: block; }
@keyframes slideD { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
.prereq-block {
  margin-top: 10px; padding: 9px 13px;
  background: #fff3cd; border-left: 3px solid #f59e0b;
  border-radius: 0 6px 6px 0; font-size: var(--font-xs); color: #78350f; line-height: 1.6;
}
.prereq-block strong { display: block; font-size: var(--font-xs); text-transform: uppercase; letter-spacing: .05em; margin-bottom: 3px; color: #92400e; }

/* Cell bits */
.cc { font-weight: 700; font-size: var(--font-sm); }
.ct { font-weight: 600; line-height: 1.3; }
.ct .tn { font-size: 14px; cursor: pointer; }
.ct .tn:hover { color: var(--crimson); text-decoration: underline; }
.bdg { display: inline-block; padding: 2px 7px; border-radius: 9px; font-size: var(--font-xs); font-weight: 700; white-space: nowrap; }
.bg { background: #dcfce7; color: #166534; }
.by { background: #fef9c3; color: #854d0e; }
.br { background: #fee2e2; color: #991b1b; }
.bk { background: #f3f4f6; color: #374151; }
.bb { background: #dbeafe; color: #1e40af; }
.day-chips { display: flex; flex-wrap: wrap; gap: 3px; }
.dc { padding: 1px 6px; border-radius: 9px; font-size: var(--font-xs); font-weight: 600; background: var(--crimson-light); color: var(--crimson); }
.star-btn {
  background: none; border: none; cursor: pointer; font-size: var(--font-md);
  line-height: 1; padding: 0 2px; transition: transform .15s; color: #d1d5db;
}
.star-btn.on { color: #f59e0b; }
.star-btn:hover { transform: scale(1.2); }
.add-btn {
  background: none; border: none; cursor: pointer; font-size: var(--font-sm);
  line-height: 1; padding: 2px 4px; border-radius: 5px; transition: all .15s; color: #9ca3af;
  position: relative;
}
.add-btn:hover { color: var(--crimson); background: var(--crimson-light); }
.add-btn.on { color: #16a34a; }
.add-btn.pulse-add { animation: pulseAdd .6s ease; }
@keyframes pulseAdd {
  0% { transform: scale(1); }
  30% { transform: scale(1.4); background: #dcfce7; }
  100% { transform: scale(1); }
}
.add-btn .conflict-tip {
  display: none; position: absolute; bottom: calc(100% + 6px); left: 50%;
  transform: translateX(-50%); background: #fef2f2; border: 1px solid #fca5a5;
  color: #991b1b; padding: 4px 8px; border-radius: 6px; font-size: 10px;
  white-space: nowrap; z-index: 100; pointer-events: none;
  box-shadow: 0 2px 8px rgba(0,0,0,.12);
}
.add-btn:hover .conflict-tip { display: block; }
.hide-btn {
  background: none; border: 1.5px solid var(--border); cursor: pointer;
  font-size: var(--font-xs); line-height: 1; padding: 2px 4px; border-radius: 5px;
  transition: all .15s; color: var(--muted);
}
.hide-btn:hover { border-color: #ef4444; color: #ef4444; background: #fef2f2; }
.cmp-btn {
  background: none; border: 1.5px solid var(--border); cursor: pointer;
  font-size: var(--font-xs); line-height: 1; padding: 2px 5px; border-radius: 5px;
  transition: all .15s; color: var(--muted);
}
.cmp-btn:hover { border-color: #6366f1; color: #6366f1; background: #f5f3ff; }
.cmp-btn.active { background: #6366f1; color: #fff; border-color: #6366f1; }
.no-res { text-align: center; padding: 50px 20px; color: var(--muted); }
.no-res .ni { font-size: 40px; margin-bottom: 9px; }
.no-res h3 { font-size: 16px; margin-bottom: 5px; color: var(--text); }
.load-more-wrap { text-align: center; padding: 8px; }

/* Dept styling */
.dept-label {
  display: inline-block; padding: 1px 6px; border-radius: 8px;
  font-size: var(--font-xs); font-weight: 700;
}

/* Notes area */
.notes-area {
  margin-top: 10px; padding: 9px 13px;
  background: #f0f9ff; border-left: 3px solid #0ea5e9; border-radius: 0 6px 6px 0;
}
.notes-area label {
  display: block; font-size: var(--font-xs); font-weight: 700; color: #0369a1;
  text-transform: uppercase; letter-spacing: .05em; margin-bottom: 5px;
}
.notes-input-row { display: flex; gap: 6px; align-items: flex-start; }
.notes-textarea {
  flex: 1; min-height: 60px; padding: 6px 8px;
  border: 1.5px solid #bae6fd; border-radius: 6px;
  font-size: var(--font-xs); font-family: inherit; resize: vertical;
  outline: none; background: var(--surface); color: var(--text); transition: border-color .15s;
}
.notes-textarea:focus { border-color: #0ea5e9; }
.notes-indicator { font-size: var(--font-xs); color: #0369a1; margin-left: 4px; }
.btn-save-note {
  padding: 6px 12px; border-radius: 6px; border: none;
  background: #0ea5e9; color: #fff; font-size: var(--font-xs); font-weight: 700;
  cursor: pointer; white-space: nowrap; transition: background .15s; flex-shrink: 0;
}
.btn-save-note:hover { background: #0284c7; }

/* Saved notes */
.saved-notes-list { display: flex; flex-direction: column; gap: 4px; margin-bottom: 8px; }
.saved-note {
  display: flex; align-items: flex-start; gap: 6px; padding: 6px 10px;
  background: #e0f2fe; border: 1px solid #bae6fd; border-radius: 6px;
  font-size: var(--font-xs); color: #0c4a6e; line-height: 1.5;
}
.saved-note-text { flex: 1; word-break: break-word; }
.saved-note-rm {
  background: none; border: none; color: #6b7280; cursor: pointer; font-size: 12px; padding: 0;
  flex-shrink: 0; line-height: 1;
}
.saved-note-rm:hover { color: #dc2626; }

/* Tags area */
.tags-area {
  margin-top: 8px; padding: 8px 13px;
  background: #fdf4ff; border-left: 3px solid #a855f7; border-radius: 0 6px 6px 0;
}
.tags-area label { font-size: var(--font-xs); font-weight: 700; color: #7e22ce; text-transform: uppercase; letter-spacing: .05em; }
.tags-list { display: flex; flex-wrap: wrap; gap: 4px; margin: 5px 0; }
.course-tag {
  display: inline-flex; align-items: center; gap: 3px;
  padding: 2px 8px; border-radius: 10px; font-size: var(--font-xs); font-weight: 700;
  background: #ede9fe; color: #5b21b6; cursor: pointer;
}
.course-tag .tag-rm { font-size: 10px; opacity: .6; cursor: pointer; }
.course-tag .tag-rm:hover { opacity: 1; color: #7c3aed; }
.tag-input-wrap { display: flex; gap: 5px; margin-top: 5px; }
.tag-input {
  flex: 1; padding: 4px 8px; border: 1.5px solid #d8b4fe;
  border-radius: 6px; font-size: var(--font-xs); outline: none;
  background: var(--surface); color: var(--text); transition: border-color .15s;
}
.tag-input:focus { border-color: #a855f7; }
.btn-add-tag {
  padding: 4px 10px; border-radius: 6px; border: none;
  background: #a855f7; color: #fff; font-size: var(--font-xs); font-weight: 700;
  cursor: pointer; white-space: nowrap;
}
.btn-add-tag:hover { background: #7e22ce; }

/* Row indicators */
.note-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: #0ea5e9; margin-left: 5px; vertical-align: middle; }
.note-dot-label { font-size: 10px; color: #0369a1; font-weight: 700; margin-left: 3px; vertical-align: middle; }
.row-tags { display: flex; flex-wrap: wrap; gap: 2px; margin-top: 3px; }
.row-tag { display: inline-block; padding: 1px 6px; border-radius: 8px; font-size: 10px; font-weight: 700; background: #ede9fe; color: #5b21b6; }

/* Section group header */
.section-group-header td { padding: 0 !important; border-bottom: none !important; }
.section-group-bar {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  padding: 8px 14px; background: linear-gradient(135deg, #f0f4ff 0%, #e8eeff 100%);
  border-left: 4px solid #3b82f6; font-size: var(--font-xs);
}
[data-theme="dark"] .section-group-bar { background: linear-gradient(135deg, #1e2a44 0%, #1a2340 100%); border-left-color: #60a5fa; }
.section-group-icon { font-size: 14px; }
.section-group-bar strong { font-size: var(--font-sm); color: var(--text); }
.section-group-meta { color: var(--muted); font-size: var(--font-xs); }
.section-group-times { color: var(--muted); font-size: 10px; font-style: italic; margin-left: auto; }

/* Group toggle button */
.btn-group-toggle {
  background: var(--surface-alt) !important; color: var(--text) !important;
  border: 1.5px solid var(--border) !important;
}
.btn-group-toggle:hover { border-color: #3b82f6 !important; color: #3b82f6 !important; }
.btn-group-toggle.active { background: #3b82f6 !important; color: #fff !important; border-color: #3b82f6 !important; }

/* Multi-section badge */
.multi-sec-badge {
  display: inline-block; padding: 1px 6px; border-radius: 8px;
  font-size: 10px; font-weight: 700; background: #dbeafe; color: #1e40af;
  white-space: nowrap; cursor: help;
}
[data-theme="dark"] .multi-sec-badge { background: #1e3a5f; color: #93c5fd; }

/* Seat progress bar */
.seat-bar-wrap { margin-top: 3px; height: 4px; border-radius: 2px; background: #e5e7eb; overflow: hidden; width: 60px; }
.seat-bar { height: 100%; border-radius: 2px; transition: width .3s; }
.seat-bar.g { background: #16a34a; } .seat-bar.y { background: #f59e0b; } .seat-bar.r { background: #ef4444; }
.seat-cell { display: flex; flex-direction: column; align-items: flex-start; gap: 1px; }

/* Prereq code links */
.prereq-code-link {
  display: inline-block; padding: 1px 5px; border-radius: 4px;
  background: #fef3c7; color: #92400e; font-weight: 700; cursor: pointer;
  border-bottom: 1px dashed #f59e0b; transition: background .15s; font-size: inherit;
}
.prereq-code-link:hover { background: #fde68a; }

/* Skeleton loader */
.skeleton-row td { padding: 12px 10px !important; }
.skeleton-line {
  height: 16px; border-radius: 4px;
  background: linear-gradient(90deg, var(--surface-alt) 25%, #e5e7eb 50%, var(--surface-alt) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
}
@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* == COMPARE DRAWER == */
#compareDrawer {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 8500;
  background: #1e3a5f; color: #fff;
  transform: translateY(100%); transition: transform .3s ease;
  box-shadow: 0 -4px 24px rgba(0,0,0,.25);
}
#compareDrawer.open { transform: translateY(0); }
.compare-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 18px; border-bottom: 1px solid rgba(255,255,255,.15);
}
.compare-header h3 { font-size: var(--font-sm); font-weight: 700; }
.btn-compare-close { background: none; border: none; color: rgba(255,255,255,.7); cursor: pointer; font-size: var(--font-lg); }
.btn-compare-close:hover { color: #fff; }
.compare-grid { display: grid; gap: 12px; padding: 14px 18px; overflow-x: auto; }
.compare-card {
  background: rgba(255,255,255,.1); border-radius: 10px; padding: 12px 14px;
  min-width: 220px; position: relative; color: #fff;
}
.compare-card-remove { position: absolute; top: 6px; right: 8px; background: none; border: none; color: rgba(255,255,255,.5); cursor: pointer; font-size: 14px; }
.compare-card-remove:hover { color: #fff; }
.cc-title { font-size: var(--font-sm); font-weight: 700; margin-bottom: 6px; line-height: 1.3; }
.cc-row { display: flex; gap: 5px; font-size: var(--font-xs); margin-bottom: 3px; align-items: flex-start; color: #fff; }
.cc-lbl { opacity: .65; white-space: nowrap; flex-shrink: 0; }
.cc-val { font-weight: 600; }
.cc-desc {
  margin-top: 8px; padding-top: 8px; border-top: 1px solid rgba(255,255,255,.15);
  font-size: var(--font-xs); color: rgba(255,255,255,.75); line-height: 1.5;
  max-height: 60px; overflow-y: auto;
}
.btn-cmp {
  padding: 2px 7px; border-radius: 8px; border: none; cursor: pointer;
  font-size: var(--font-xs); font-weight: 700; transition: all .15s;
  background: rgba(255,255,255,.15); color: rgba(255,255,255,.8);
}
.btn-cmp:hover { background: rgba(255,255,255,.3); color: #fff; }
.btn-cmp.active { background: #ef4444; color: #fff; }
.compare-hint { font-size: var(--font-xs); color: rgba(255,255,255,.55); padding: 6px 18px 10px; }

/* == SHARE TOAST == */
#shareToast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%) translateY(60px);
  background: #1e3a5f; color: #fff; padding: 10px 22px; border-radius: 20px;
  font-size: var(--font-sm); font-weight: 600; z-index: 9999;
  transition: transform .3s ease, opacity .3s ease; opacity: 0; pointer-events: none;
}
#shareToast.show { transform: translateX(-50%) translateY(0); opacity: 1; }

/* == BACK TO TOP == */
.btn-back-to-top {
  position: fixed; bottom: 24px; right: 24px; z-index: 800;
  width: 40px; height: 40px; border-radius: 50%;
  background: var(--crimson); color: #fff; border: none;
  font-size: 18px; font-weight: 700; cursor: pointer;
  box-shadow: 0 4px 12px rgba(0,0,0,.25);
  opacity: 0; transform: translateY(20px);
  transition: opacity .3s ease, transform .3s ease;
  pointer-events: none;
}
.btn-back-to-top.visible { opacity: 1; transform: translateY(0); pointer-events: auto; }
.btn-back-to-top:hover { background: var(--crimson-dark); transform: translateY(-2px); }

/* == MOBILE CARDS == */
.mobile-cards { display: none; flex-direction: column; gap: 8px; }
.mobile-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 12px; cursor: pointer;
  transition: all .15s; position: relative;
}
.mobile-card:hover { box-shadow: var(--shadow-md); }
.mobile-card.in-s { border-left: 3px solid #16a34a; background: #f0fdf4; }
.mobile-card-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.mobile-card-code { font-weight: 700; font-size: var(--font-md); color: var(--crimson); }
.mobile-card-title { font-size: var(--font-sm); font-weight: 600; margin: 4px 0; }
.mobile-card-meta { font-size: var(--font-xs); color: var(--muted); line-height: 1.7; }
.mobile-card-actions { display: flex; gap: 8px; margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--border); flex-wrap: wrap; }
.mobile-card-btn {
  padding: 4px 12px; border-radius: 6px; font-size: var(--font-xs); font-weight: 600;
  cursor: pointer; border: 1px solid var(--border); background: var(--surface);
  color: var(--text); transition: all .15s;
}
.mobile-card-btn:hover { border-color: var(--crimson); color: var(--crimson); }
.mobile-card-btn.primary { background: var(--crimson); color: #fff; border-color: var(--crimson); }
.mobile-card-btn.primary:hover { background: var(--crimson-dark); }
.mobile-card-desc {
  margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--border);
  font-size: var(--font-xs); color: var(--muted); line-height: 1.6; display: none;
}
.mobile-card-desc.open { display: block; }

/* == MOBILE == */
@media (max-width: 768px) {
  .header { padding: 8px 12px; }
  .header-titles h1 { font-size: 14px; }
  .header-titles p { display: none; }
  .hero-wrap { padding: 8px 12px 10px; }
  .hero-input { font-size: var(--font-md); padding: 9px 38px 9px 40px; }
  .cal-section-wrap { padding: 0 8px; }
  .cal-section { position: static; margin-bottom: 0; border-radius: 0; }
  .cal-toolbar { padding: 5px 9px 4px; gap: 5px; }
  .credit-pills { display: none; }
  .credit-bar-mobile { display: flex !important; }
  .app { padding: 8px 8px 28px; }
  .main-grid { grid-template-columns: 1fr; }
  .filter-panel { position: static; max-height: none; overflow: visible; padding: 9px; }
  .fp-inner-scroll { display: flex; gap: 8px; overflow-x: auto; -webkit-overflow-scrolling: touch; padding-bottom: 5px; }
  .fg { flex-shrink: 0; min-width: 120px; margin-bottom: 0; }
  .sched-info { display: none; }
  .fp-divider { display: none; }
  .btn-clear { margin-top: 7px; }
  .col-dept, .col-term, .col-mode { display: none; }
  td.col-dept, th.col-dept, td.col-term, th.col-term, td.col-mode, th.col-mode { display: none; }
  .export-bar { flex-direction: column; align-items: flex-start; }
  .cal-grid { min-width: 380px; }
  .user-auth-label { display: none; }
  #compareDrawer .compare-grid { grid-template-columns: 1fr !important; }
  .compare-card { min-width: auto; }
  /* Show mobile cards, hide desktop table */
  #desktopTable { display: none; }
  .mobile-cards { display: flex; }
}

@media print {
  .top-band, .cal-section, .cal-section-wrap, .filter-panel, .export-bar, .conflict-bar, #compareDrawer, .btn-back-to-top { display: none !important; }
  .main-grid { grid-template-columns: 1fr !important; }
  table { font-size: 10px; } td, th { padding: 4px 6px; }
}

/* == DEPT ROW COLOR CODING == */
tr.cr[data-dept="Accounting"] { border-left-color: #1e40af; }
tr.cr[data-dept="Data Analytics"] { border-left-color: #065f46; }
tr.cr[data-dept="Finance"] { border-left-color: #9d174d; }
tr.cr[data-dept="Managerial Economics"] { border-left-color: #9a3412; }
tr.cr[data-dept="Management"] { border-left-color: #5b21b6; }
tr.cr[data-dept="Marketing"] { border-left-color: #991b1b; }
tr.cr[data-dept="Organizational Behavior"] { border-left-color: #065f46; }
tr.cr[data-dept="Supply Chain, Operations & Technology"] { border-left-color: #075985; }
