:root {
  --bg: #f7f8fb;
  --surface: #ffffff;
  --surface-soft: #f0f4f8;
  --line: #d9e0e8;
  --line-strong: #b8c3d0;
  --text: #1d2433;
  --muted: #677384;
  --teal: #0f766e;
  --teal-soft: #d9f0ec;
  --blue: #2563eb;
  --blue-soft: #dce8ff;
  --amber: #b45309;
  --amber-soft: #fff0d2;
  --red: #b42318;
  --red-soft: #ffe1de;
  --shadow: 0 18px 50px rgba(31, 45, 61, 0.08);
  --radius: 8px;
  --ease-out-soft: cubic-bezier(0.2, 0.7, 0.2, 1);
  --ease-spring: cubic-bezier(0.34, 1.12, 0.64, 1);
  --focus-ring: 0 0 0 3px rgba(15, 118, 110, 0.2);
  --press-scale: 0.98;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  scroll-behavior: smooth;
}

body {
  min-width: 320px;
  margin: 0;
  background: var(--bg);
  color: var(--text);
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 64px;
  padding: 10px 84px 10px 24px;
  border-bottom: 1px solid var(--line);
  background: rgba(247, 248, 251, 0.94);
  backdrop-filter: blur(14px);
}

.floating-nav {
  position: fixed;
  top: 11px;
  right: 24px;
  z-index: 60;
}

.floating-nav-toggle {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 1px solid rgba(15, 118, 110, 0.28);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.94);
  color: var(--teal);
  box-shadow: 0 14px 34px rgba(31, 45, 61, 0.14);
  backdrop-filter: blur(14px);
  transition: transform 140ms ease, box-shadow 140ms ease, background-color 140ms ease;
}

.floating-nav-toggle:hover,
.floating-nav-toggle[aria-expanded="true"] {
  background: var(--teal-soft);
  box-shadow: 0 18px 40px rgba(15, 118, 110, 0.18);
  transform: translateY(-1px);
}

.floating-nav-toggle svg {
  width: 21px;
  height: 21px;
}

.floating-nav-panel {
  position: absolute;
  top: 50px;
  right: 0;
  display: grid;
  min-width: 190px;
  gap: 6px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
}

.floating-nav-panel[hidden] {
  display: none;
}

.floating-nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid transparent;
  border-radius: 12px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  text-decoration: none;
  transition: border-color 140ms ease, background-color 140ms ease, color 140ms ease;
}

.floating-nav-link svg {
  width: 18px;
  height: 18px;
}

.beta-badge {
  display: inline-flex;
  align-items: center;
  min-height: 20px;
  padding: 3px 7px;
  border: 1px solid rgba(180, 83, 9, 0.28);
  border-radius: 999px;
  background: var(--amber-soft);
  color: var(--amber);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.06em;
  line-height: 1;
  text-transform: uppercase;
}

.brand-name .beta-badge {
  margin-left: 8px;
  vertical-align: middle;
}

.floating-nav-link:hover,
.floating-nav-link.active {
  border-color: #9ccbc5;
  background: var(--teal-soft);
  color: var(--teal);
}

.calendar-body {
  min-height: 100vh;
  overflow: hidden;
}

.calendar-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 64px;
  padding: 10px 84px 10px 24px;
  border-bottom: 1px solid var(--line);
  background: rgba(247, 248, 251, 0.95);
  backdrop-filter: blur(14px);
}

.calendar-header-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

.calendar-shell {
  display: grid;
  grid-template-columns: 380px minmax(720px, 1fr);
  height: calc(100dvh - 64px);
  min-height: 0;
  overflow: hidden;
}

.calendar-sidebar {
  display: flex;
  min-height: 0;
  flex-direction: column;
  gap: 9px;
  padding: 14px;
  border-right: 1px solid var(--line);
  background: linear-gradient(180deg, #0c2a39 0%, #0a2331 100%);
  color: #f3f7fa;
}

.calendar-sidebar .field span,
.calendar-filter-group > span,
.calendar-sidebar .catalog-count,
.calendar-sidebar-head p {
  color: rgba(255, 255, 255, 0.72);
}

.calendar-sidebar .field input,
.calendar-sidebar .field select {
  border-color: rgba(255, 255, 255, 0.22);
}

.calendar-sidebar-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.calendar-sidebar-head p {
  margin: 0 0 4px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.calendar-sidebar-head h2 {
  margin: 0;
  font-size: 20px;
  letter-spacing: 0;
}

.calendar-filter-group {
  display: grid;
  gap: 4px;
}

.segmented.compact {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-bottom: 0;
  gap: 5px;
}

.calendar-sidebar .segmented button {
  min-height: 30px;
  padding: 5px 7px;
  border-color: rgba(255, 255, 255, 0.18);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.78);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.01em;
}

.calendar-sidebar .segmented button.active {
  border-color: #9ccbc5;
  background: #d9f0ec;
  color: #075c55;
}

.calendar-course-list {
  display: grid;
  min-height: 0;
  gap: 8px;
  overflow: auto;
  padding-right: 4px;
}

.planned-conflict-panel {
  display: grid;
  gap: 8px;
}

.plan-check-card {
  display: grid;
  gap: 5px;
  padding: 10px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.86);
}

.plan-check-card strong {
  font-size: 13px;
}

.plan-check-card span,
.plan-check-card small {
  color: rgba(255, 255, 255, 0.72);
  font-size: 12px;
  font-weight: 750;
}

.plan-check-card.success {
  border-color: #9ccbc5;
  background: rgba(217, 240, 236, 0.18);
}

.plan-check-card.danger {
  border-color: rgba(255, 225, 222, 0.58);
  background: rgba(255, 225, 222, 0.12);
}

.plan-check-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.plan-check-pill {
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(217, 240, 236, 0.25);
  color: #d9f0ec;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.plan-auto-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border: 1px solid #9ccbc5;
  border-radius: 999px;
  background: #d9f0ec;
  color: #075c55;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: transform 120ms ease, box-shadow 120ms ease, background-color 120ms ease;
}

.plan-auto-btn:hover:not([disabled]) {
  background: #c5e7e0;
  box-shadow: 0 4px 12px rgba(217, 240, 236, 0.25);
}

.plan-auto-btn:disabled {
  border-color: rgba(255, 225, 222, 0.45);
  background: rgba(255, 225, 222, 0.18);
  color: rgba(255, 225, 222, 0.75);
  cursor: not-allowed;
}

.plan-auto-btn svg {
  width: 14px;
  height: 14px;
}

.plan-conflict-list {
  display: grid;
  gap: 4px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.plan-conflict-list li {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
  border-radius: 8px;
  background: rgba(255, 225, 222, 0.16);
  color: #ffe1de;
  font-size: 12px;
  font-weight: 700;
}

.plan-conflict-list li span {
  color: rgba(255, 225, 222, 0.7);
  font-weight: 600;
}

.calendar-course-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 18px;
  gap: 10px;
  align-items: center;
  width: 100%;
  padding: 10px 12px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.97);
  color: var(--text);
  text-align: left;
  transition: border-color 140ms ease, background-color 140ms ease;
}

.calendar-course-card:hover {
  border-color: rgba(15, 118, 110, 0.5);
}

.calendar-course-card.active {
  border-color: #9ccbc5;
  background: var(--teal-soft);
}

.calendar-course-card.has-selection {
  border-left: 3px solid var(--teal);
}

.calendar-course-card.planned:not(.has-selection) {
  border-left: 3px solid rgba(15, 118, 110, 0.35);
}

.calendar-course-card-main {
  display: grid;
  min-width: 0;
  gap: 4px;
}

.calendar-course-card-title {
  display: flex;
  align-items: center;
  min-width: 0;
  gap: 8px;
}

.calendar-course-card-title strong {
  display: -webkit-box;
  overflow: hidden;
  font-size: 14px;
  line-height: 1.28;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.calendar-course-card-meta {
  display: block;
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.course-card-dot {
  margin: 0 4px;
  color: var(--line-strong);
  font-style: normal;
}

.course-card-flag {
  display: inline-block;
  margin-right: 6px;
  padding: 1px 7px;
  border-radius: 999px;
  background: var(--teal-soft);
  color: #075c55;
  font-size: 10.5px;
  font-style: normal;
  font-weight: 800;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  vertical-align: 1px;
}

.course-color-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.course-color-dot.tone-0 { background: #0f766e; }
.course-color-dot.tone-1 { background: #2563eb; }
.course-color-dot.tone-2 { background: #b45309; }
.course-color-dot.tone-3 { background: #7c3aed; }
.course-color-dot.tone-4 { background: #be123c; }
.course-color-dot.tone-5 { background: #475569; }

.calendar-course-card svg {
  width: 18px;
  height: 18px;
  color: var(--muted);
}

.calendar-stage {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
  min-height: 0;
  height: 100%;
  overflow: hidden;
  padding: 16px 18px;
  background: #f4f7fa;
}

.plan-auto-btn-top {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 38px;
  padding: 8px 14px;
  border: 1px solid var(--teal);
  border-radius: 999px;
  background: var(--teal);
  color: #ffffff;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: transform 120ms ease, box-shadow 120ms ease, background-color 120ms ease, opacity 120ms ease;
}

.plan-auto-btn-top:hover:not(:disabled) {
  background: #0c8b80;
  box-shadow: 0 6px 16px rgba(15, 118, 110, 0.25);
}

.plan-auto-btn-top:disabled {
  cursor: not-allowed;
  opacity: 0.65;
}

.plan-auto-btn-top.muted {
  background: rgba(15, 118, 110, 0.15);
  border-color: rgba(15, 118, 110, 0.25);
  color: rgba(15, 118, 110, 0.85);
}

.plan-auto-btn-top.danger {
  background: rgba(190, 18, 60, 0.12);
  border-color: rgba(190, 18, 60, 0.35);
  color: #be123c;
}

.plan-auto-btn-top svg {
  width: 16px;
  height: 16px;
}

.calendar-term-field select {
  min-height: 38px;
}

.section-picker {
  display: flex;
  flex-direction: column;
  max-height: 220px;
  min-height: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.97);
  overflow: hidden;
}

.section-picker[hidden] {
  display: none;
}

.section-picker-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 12px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-soft);
}

.section-picker-title {
  display: flex;
  align-items: center;
  min-width: 0;
  gap: 10px;
}

.section-picker-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
  gap: 1px;
}

.section-picker-text strong {
  overflow: hidden;
  font-size: 14px;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.section-picker-text span {
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.section-picker-body {
  min-height: 0;
  overflow: auto;
}

.section-picker-course-badge {
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.04em;
  color: #ffffff;
}

.tone-bg-0 { background: #0f766e; }
.tone-bg-1 { background: #2563eb; }
.tone-bg-2 { background: #b45309; }
.tone-bg-3 { background: #7c3aed; }
.tone-bg-4 { background: #be123c; }
.tone-bg-5 { background: #475569; }

.section-remove-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #ffffff;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s;
}

.section-remove-btn:hover {
  border-color: #be123c;
  color: #be123c;
}

.section-remove-btn svg {
  width: 13px;
  height: 13px;
}

.section-component {
  padding: 12px;
  border-bottom: 1px solid var(--line);
}

.section-component:last-child {
  border-bottom: 0;
}

.section-component-title {
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.section-button-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(132px, 1fr));
  gap: 8px;
}

.section-toggle {
  display: grid;
  gap: 3px;
  min-height: 56px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #ffffff;
  color: var(--text);
  text-align: left;
}

.section-toggle strong {
  font-size: 14px;
}

.section-toggle span {
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.section-toggle.selected {
  border-color: var(--teal);
  background: var(--teal-soft);
  color: #075c55;
}

.week-grid {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  flex: 1 1 auto;
  min-height: 0;
  height: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.week-grid-header {
  display: grid;
  grid-template-columns: 64px repeat(5, minmax(120px, 1fr));
  background: #1e5a6e;
  color: #ffffff;
  font-weight: 850;
  font-size: 13px;
  letter-spacing: 0.02em;
}

.week-grid-header > div {
  display: grid;
  min-height: 38px;
  place-items: center;
  border-right: 1px solid rgba(255, 255, 255, 0.16);
}

.week-grid-body {
  display: grid;
  grid-template-columns: 64px repeat(5, minmax(120px, 1fr));
  grid-template-rows: minmax(0, 1fr);
  min-height: 0;
  height: 100%;
  overflow: hidden;
}

.week-grid-body > * {
  min-height: 0;
  height: 100%;
}

.time-column {
  position: relative;
  background: #f8fafc;
  border-right: 1px solid var(--line);
}

.time-column > div {
  position: absolute;
  right: 7px;
  color: #111827;
  font-size: 14px;
  font-weight: 850;
  transform: translateY(-50%);
}

.day-column {
  position: relative;
  min-width: 0;
  border-right: 1px solid var(--line);
  background: #ffffff;
}

.time-line {
  position: absolute;
  right: 0;
  left: 0;
  height: 1px;
  background: rgba(15, 23, 42, 0.07);
  pointer-events: none;
}

.meeting-block {
  position: absolute;
  right: 5px;
  left: 5px;
  display: grid;
  align-content: center;
  min-height: 28px;
  overflow: hidden;
  padding: 5px 7px;
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: var(--radius);
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(31, 45, 61, 0.22);
  opacity: 0.94;
}

.meeting-block strong {
  overflow: hidden;
  font-size: 13px;
  line-height: 1.15;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.meeting-block.tone-0 {
  background: #0f766e;
}

.meeting-block.tone-1 {
  background: #2563eb;
}

.meeting-block.tone-2 {
  background: #b45309;
}

.meeting-block.tone-3 {
  background: #7c3aed;
}

.meeting-block.tone-4 {
  background: #be123c;
}

.meeting-block.tone-5 {
  background: #475569;
}

.compact-empty {
  min-height: 96px;
  border: 0;
  background: transparent;
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.brand-logo {
  height: 44px;
  width: auto;
  flex: 0 0 auto;
  display: block;
}

.brand-name {
  padding-left: 14px;
  border-left: 1px solid var(--line);
}

.panel-heading p,
.section-heading p {
  margin: 0 0 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.brand h1,
.panel-heading h2,
.section-heading h2 {
  margin: 0;
  letter-spacing: 0;
}

.brand h1 {
  font-size: 20px;
  line-height: 1.1;
  color: var(--text);
}

.header-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

/* ── Guest notice bar ───────────────────────────────────── */
.guest-notice {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 24px;
  background: #fffbeb;
  border-bottom: 1px solid #fde68a;
  color: #92400e;
  font-size: 13px;
  font-weight: 500;
}

.guest-notice > i[data-lucide] {
  flex: 0 0 auto;
  width: 16px;
  height: 16px;
  color: #d97706;
}

.guest-notice > span {
  flex: 1 1 auto;
}

.guest-notice-login {
  flex: 0 0 auto;
  min-height: 30px;
  padding: 0 14px;
  font-size: 12px;
}

.guest-notice-close {
  flex: 0 0 auto;
  width: 28px;
  height: 28px;
  color: #a16207;
}

/* ── Profile guest gate ──────────────────────────────────── */
.profile-panel--locked {
  opacity: 0.35;
  pointer-events: none;
  user-select: none;
}

.profile-guest-gate {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  max-width: 420px;
  margin: 48px auto 0;
  padding: 40px 32px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
  text-align: center;
}

.profile-guest-gate > i[data-lucide] {
  width: 40px;
  height: 40px;
  color: var(--muted);
}

.profile-guest-gate h3 {
  margin: 0;
  font-size: 17px;
}

.profile-guest-gate p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

/* ── App shell ───────────────────────────────────────────── */
.app-shell {
  width: min(1560px, calc(100% - 40px));
  margin: 24px auto 40px;
}

.site-disclaimer-footer {
  width: min(1560px, calc(100% - 40px));
  margin: -16px auto 28px;
  padding: 12px 16px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
  line-height: 1.55;
}

.legal-disclaimer-footer {
  width: min(920px, calc(100% - 32px));
  margin-top: -56px;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(130px, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.summary-card,
.requirement-card,
.term-card,
.course-row,
.result-card,
.missing-panel,
.term-dialog,
.course-detail-dialog,
.fast-plan-result {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.summary-card {
  min-height: 104px;
  padding: 16px;
}

.summary-card span,
.requirement-card span,
.term-card span,
.course-meta,
.missing-panel span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.catalog-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 26px;
  height: 26px;
  padding: 0 8px;
  border-radius: 999px;
  background: var(--teal);
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: none;
}

.summary-card strong {
  display: block;
  margin-top: 10px;
  font-size: 28px;
  letter-spacing: 0;
}

.summary-card small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
}

.workspace {
  display: grid;
  grid-template-columns: 280px minmax(360px, 1.4fr) minmax(360px, 1fr);
  gap: 16px;
  align-items: start;
}

.term-rail,
.term-detail,
.course-search,
.requirement-section {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.84);
  box-shadow: var(--shadow);
}

.term-rail,
.term-detail,
.course-search {
  min-height: 600px;
  padding: 18px;
}

.course-search {
  display: flex;
  height: clamp(540px, calc(100vh - 160px), 720px);
  min-height: 0;
  flex-direction: column;
  overflow: hidden;
}

.course-search-launch {
  width: calc(100% + 36px);
  margin: -18px -18px 0;
  padding: 18px;
  border: 0;
  border-radius: calc(var(--radius) - 1px) calc(var(--radius) - 1px) 0 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
  text-align: left;
  transition: background-color 140ms ease, color 140ms ease;
}

.course-search-launch:hover {
  background: var(--teal-soft);
  color: var(--teal);
}

.course-search .panel-heading,
.course-search .search-field,
.course-search .segmented {
  flex: 0 0 auto;
}

.catalog-filter-group {
  display: grid;
  gap: 7px;
  margin-bottom: 12px;
}

.catalog-filter-group > span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.catalog-toggles {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.catalog-pool-toggles {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.catalog-sort {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.catalog-search-overlay {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: grid;
  place-items: stretch;
  padding: 0;
  border: 0;
  background: rgba(15, 23, 42, 0.42);
  backdrop-filter: blur(4px);
}

.catalog-search-overlay[hidden] {
  display: none !important;
}

.requirement-course-overlay[hidden] {
  display: none !important;
}

body.catalog-search-open {
  overflow: hidden;
}

.catalog-search-shell {
  display: flex;
  width: 100%;
  height: 100%;
  flex-direction: column;
  padding: 14px clamp(14px, 2.4vw, 24px) 16px;
  overflow: hidden;
  background: #f7f9fc;
}

.catalog-search-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.requirement-course-header {
  align-items: flex-start;
}

.requirement-course-header > div {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.requirement-course-header span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.requirement-course-header h2 {
  margin: 0;
  font-size: 24px;
  letter-spacing: 0;
}

.requirement-course-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}

.requirement-course-chip {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  background: #eef3f8;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.requirement-course-chip.done {
  background: rgba(14, 125, 113, 0.12);
  color: var(--teal);
}

.requirement-course-toolbar {
  margin-bottom: 10px;
}

/* ====== Active term switcher inside catalog overlay (compact, collapsible) ====== */
.catalog-term-switcher {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0;
  margin: 0 0 8px;
}

.catalog-term-switcher[hidden] {
  display: none;
}

.catalog-term-switcher-trigger {
  display: inline-flex;
  align-self: flex-start;
  align-items: center;
  gap: 6px;
  padding: 4px 8px 4px 8px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.6);
  color: rgba(15, 23, 42, 0.7);
  font-size: 12px;
  font-weight: 500;
  line-height: 1.2;
  cursor: pointer;
  max-width: 100%;
  min-width: 0;
  transition:
    background-color 140ms var(--ease-out-soft),
    border-color 140ms var(--ease-out-soft),
    color 140ms var(--ease-out-soft);
}

.catalog-term-switcher-trigger:hover {
  border-color: rgba(15, 118, 110, 0.28);
  background: rgba(15, 118, 110, 0.04);
  color: var(--ink);
}

.catalog-term-switcher-trigger:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
}

.catalog-term-switcher-trigger[aria-expanded="true"] {
  border-color: var(--teal);
  background: var(--teal-soft);
  color: var(--teal);
}

.catalog-term-switcher-trigger > i[data-lucide] {
  width: 13px;
  height: 13px;
  flex: 0 0 auto;
  opacity: 0.75;
}

.catalog-term-switcher-trigger-text {
  display: inline-flex;
  align-items: baseline;
  gap: 4px;
  min-width: 0;
  overflow: hidden;
}

.catalog-term-switcher-label {
  font-size: 11px;
  font-weight: 500;
  opacity: 0.65;
  flex: 0 0 auto;
}

.catalog-term-switcher-trigger-text strong {
  font-size: 12px;
  font-weight: 600;
  color: inherit;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 180px;
}

.catalog-term-switcher-chevron {
  transition: transform 180ms var(--ease-out-soft);
}

.catalog-term-switcher-trigger[aria-expanded="true"] .catalog-term-switcher-chevron {
  transform: rotate(180deg);
}

.catalog-term-switcher-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 6px;
  padding: 6px;
  border: 1px solid rgba(15, 23, 42, 0.06);
  border-radius: 10px;
  background: rgba(248, 250, 252, 0.7);
}

.catalog-term-switcher-pills[hidden] {
  display: none;
}

.catalog-term-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  flex: 0 0 auto;
  padding: 4px 9px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 999px;
  background: #ffffff;
  color: var(--ink);
  font-size: 12px;
  font-weight: 500;
  line-height: 1.2;
  cursor: pointer;
  transition:
    background-color 140ms var(--ease-out-soft),
    border-color 140ms var(--ease-out-soft),
    color 140ms var(--ease-out-soft);
}

.catalog-term-pill:hover {
  border-color: rgba(15, 118, 110, 0.28);
  background: rgba(15, 118, 110, 0.04);
}

.catalog-term-pill.active {
  border-color: var(--teal);
  background: var(--teal-soft);
  color: var(--teal);
  font-weight: 600;
}

.catalog-term-pill-gpa {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  padding: 1px 5px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.05);
  color: rgba(15, 23, 42, 0.6);
  font-size: 10px;
  font-weight: 700;
}

.catalog-term-pill.active .catalog-term-pill-gpa {
  background: rgba(15, 118, 110, 0.14);
  color: var(--teal);
}

@media (max-width: 720px) {
  .catalog-term-switcher-trigger {
    align-self: stretch;
    justify-content: space-between;
  }

  .catalog-term-switcher-trigger-text strong {
    max-width: none;
  }
}

.catalog-search-shell .search-field {
  grid-template-columns: 132px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  margin-bottom: 7px;
}

.catalog-search-shell .search-field input {
  min-height: 34px;
  font-size: 14px;
}

.catalog-filter-toolbar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 8px;
}

.filter-toggle-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 36px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #ffffff;
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: -0.01em;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease, color 0.15s ease;
}

.filter-toggle-btn:hover {
  border-color: rgba(15, 118, 110, 0.4);
  background: rgba(15, 118, 110, 0.04);
}

.filter-toggle-btn[aria-expanded="true"] {
  border-color: var(--teal);
  background: var(--teal-soft);
  color: var(--teal);
}

.filter-toggle-btn svg {
  width: 15px;
  height: 15px;
}

.filter-toggle-chevron {
  transition: transform 0.2s ease;
}

.filter-toggle-btn[aria-expanded="true"] .filter-toggle-chevron {
  transform: rotate(180deg);
}

.filter-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--teal);
  color: #ffffff;
  font-size: 11px;
  font-weight: 800;
  line-height: 1;
}

.filter-badge[hidden] {
  display: none;
}

.catalog-active-chips {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  flex: 1 1 240px;
  min-width: 0;
}

.catalog-active-chips:empty {
  display: none;
}

.catalog-active-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 100%;
  height: 30px;
  padding: 0 4px 0 10px;
  border: 1px solid rgba(15, 118, 110, 0.22);
  border-radius: 999px;
  background: var(--teal-soft);
  color: var(--teal);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: -0.01em;
  white-space: nowrap;
  overflow: hidden;
}

.catalog-active-chip > span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.catalog-active-chip > strong {
  font-weight: 800;
  text-transform: uppercase;
  font-size: 10px;
  letter-spacing: 0.05em;
  opacity: 0.85;
}

.catalog-active-chip button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: inherit;
  cursor: pointer;
  flex: 0 0 auto;
  transition: background 0.15s ease;
}

.catalog-active-chip button:hover {
  background: rgba(15, 118, 110, 0.16);
}

.catalog-active-chip button svg {
  width: 12px;
  height: 12px;
}

.catalog-sort-select {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 36px;
  padding: 0 32px 0 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #ffffff;
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: -0.01em;
  cursor: pointer;
  flex: 0 0 auto;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.catalog-sort-select:hover {
  border-color: rgba(15, 118, 110, 0.4);
  background: rgba(15, 118, 110, 0.04);
}

.catalog-sort-select:focus-within {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.14);
}

.catalog-sort-select > svg:first-of-type {
  width: 15px;
  height: 15px;
  flex: 0 0 auto;
  color: var(--muted);
}

.catalog-sort-select select {
  appearance: none;
  -webkit-appearance: none;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  letter-spacing: inherit;
  padding: 0;
  margin: 0;
  cursor: pointer;
  outline: none;
  min-width: 140px;
}

.catalog-sort-chevron {
  position: absolute;
  right: 10px;
  top: 50%;
  width: 14px;
  height: 14px;
  transform: translateY(-50%);
  color: var(--muted);
  pointer-events: none;
}

.catalog-filter-panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #ffffff;
  padding: 14px;
  margin-bottom: 10px;
  box-shadow: 0 4px 16px rgba(15, 23, 42, 0.04);
  animation: catalogFilterPanelIn 0.18s ease-out;
}

.catalog-filter-panel[hidden] {
  display: none;
}

@keyframes catalogFilterPanelIn {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}

.catalog-filter-panel-footer {
  display: flex;
  justify-content: flex-end;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px dashed var(--line);
}

.catalog-filter-panel-footer .button {
  height: 32px;
  padding: 0 12px;
  font-size: 12px;
}

.catalog-filter-panel-footer .button svg {
  width: 14px;
  height: 14px;
}

.catalog-filter-row {
  display: grid;
  gap: 10px;
  align-items: start;
  margin-bottom: 0;
}

.catalog-filter-row--meta {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-bottom: 12px;
}

.catalog-filter-pools-stack {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 10px;
  width: 100%;
  min-width: 0;
  padding-top: 12px;
  border-top: 1px dashed var(--line);
}

.catalog-minor-pools-stack {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 10px;
}

.catalog-pool-section {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
  width: 100%;
  margin: 0;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: color-mix(in srgb, var(--surface) 92%, var(--bg) 8%);
}

.catalog-pool-section--minor {
  background: color-mix(in srgb, var(--surface) 88%, var(--accent-soft, #e8f0ff) 12%);
}

.catalog-pool-heading {
  display: block;
  margin: 0;
  font-size: 12px;
  font-weight: 650;
  letter-spacing: -0.02em;
  color: var(--text);
  line-height: 1.3;
  text-transform: none;
}

.catalog-pool-section--minor .catalog-pool-heading {
  color: color-mix(in srgb, var(--text) 88%, var(--accent, #2563eb) 12%);
}

.catalog-search-shell .catalog-filter-group {
  gap: 4px;
  margin-bottom: 0;
}

.catalog-search-shell .catalog-filter-group > span {
  font-size: 11px;
}

.catalog-search-shell .segmented {
  gap: 3px;
}

.catalog-search-shell .segmented button {
  min-height: 32px;
  padding: 0 8px;
  border-radius: 8px;
  font-size: 12px;
  letter-spacing: -0.01em;
  white-space: nowrap;
}

.catalog-search-shell #catalogPoolsStack {
  display: flex;
  flex-direction: column;
  align-items: stretch;
}

.catalog-search-shell #catalogPoolsStack > .catalog-pool-section,
.catalog-search-shell #catalogPoolsStack > .catalog-minor-pools-stack {
  width: 100%;
  max-width: 100%;
}

.catalog-search-shell .catalog-pool-toggles {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.catalog-search-shell .catalog-minor-pool-toggles {
  grid-template-columns: repeat(auto-fit, minmax(72px, 1fr));
}

.catalog-search-shell .catalog-availability-toggles {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.catalog-search-shell .catalog-prereq-toggle {
  grid-template-columns: 1fr;
}

.catalog-search-shell .catalog-sort {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.catalog-prereq-toggle button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.catalog-prereq-toggle svg {
  width: 14px;
  height: 14px;
}

.catalog-search-results {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding-right: 6px;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  align-content: start;
}

.catalog-search-results.result-list {
  gap: 8px;
}

.catalog-search-results .result-card {
  align-self: start;
  align-items: start;
  min-height: 124px;
  padding: 10px;
}

.catalog-search-results .result-card > div {
  min-width: 0;
}

.catalog-search-results .result-card strong {
  margin-bottom: 4px;
  font-size: 14px;
  overflow-wrap: break-word;
}

.catalog-search-results .result-card p {
  font-size: 12px;
  overflow-wrap: break-word;
}

.catalog-search-results .chip-row {
  gap: 5px;
  margin-top: 7px;
}

.catalog-search-results .chip {
  min-height: 22px;
  padding: 0 7px;
  font-size: 11px;
}

.catalog-search-results .button {
  min-height: 34px;
  padding: 0 12px;
}

.catalog-zero-credit-notice {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid rgba(180, 83, 9, 0.24);
  border-radius: var(--radius);
  background: var(--amber-soft);
  color: var(--amber);
  font-size: 12px;
  font-weight: 800;
}

.catalog-zero-credit-notice .button {
  flex: 0 0 auto;
  border-color: rgba(180, 83, 9, 0.28);
  background: #ffffff;
  color: var(--amber);
}

.panel-heading,
.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 16px;
}

.plan-manager-trigger {
  min-width: 0;
  display: grid;
  gap: 2px;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
}

.plan-manager-trigger h2 {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.plan-manager-trigger h2::after {
  content: "";
  width: 16px;
  height: 16px;
  background: currentColor;
  opacity: 0.56;
  mask: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='m6 9 6 6 6-6' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat;
}

.plan-manager-trigger small {
  max-width: 210px;
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.plan-manager-trigger:hover h2 {
  color: var(--teal);
}

.panel-heading h2,
.section-heading h2 {
  font-size: 19px;
  line-height: 1.2;
}

.button,
.icon-button,
.segmented button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  transition:
    border-color 160ms ease,
    background-color 160ms ease,
    color 160ms ease,
    transform 160ms ease;
}

.button {
  gap: 8px;
  padding: 0 14px;
  font-weight: 750;
}

.button svg,
.icon-button svg {
  width: 17px;
  height: 17px;
}

.button-secondary {
  border-color: #9ccbc5;
  background: var(--teal-soft);
  color: #075c55;
}

.button-ghost {
  border-color: var(--line);
  background: #ffffff;
  color: var(--muted);
}

.button-danger {
  border-color: rgba(185, 28, 28, 0.24);
  background: #fff1f2;
  color: var(--red);
}

.icon-button {
  width: 38px;
  height: 38px;
  border-color: var(--line);
  background: #ffffff;
  color: var(--text);
}

.icon-button.danger {
  color: var(--red);
}

.button:hover,
.icon-button:hover,
.segmented button:hover {
  background-color: rgba(15, 118, 110, 0.04);
}

.field {
  display: grid;
  gap: 7px;
}

.field span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.field input,
.field select,
.course-row select,
.term-dialog select {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #ffffff;
  color: var(--text);
  outline: none;
}

.field input,
.field select {
  padding: 0 12px;
}

.field-compact select {
  min-width: 210px;
}

.field input:focus,
.field select:focus,
.course-row select:focus,
.term-dialog select:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px var(--blue-soft);
}

.term-list,
.course-table,
.result-list {
  display: grid;
  gap: 10px;
}

.course-search .result-list {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding-right: 6px;
  scrollbar-color: #aeb9c7 transparent;
  scrollbar-width: thin;
}

.course-search .result-list::-webkit-scrollbar {
  width: 6px;
}

.course-search .result-list::-webkit-scrollbar-track {
  background: transparent;
}

.course-search .result-list::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: #aeb9c7;
}

.term-card {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  width: 100%;
  padding: 12px;
  text-align: left;
}

.term-card strong {
  display: block;
  margin-bottom: 5px;
  overflow-wrap: anywhere;
  font-size: 15px;
}

.term-card.active {
  border-color: var(--teal);
  background: var(--teal-soft);
}

.term-card .term-gpa {
  display: grid;
  min-width: 54px;
  height: 54px;
  place-items: center;
  border-radius: var(--radius);
  background: #ffffff;
  color: var(--teal);
  font-weight: 850;
}

.term-actions {
  display: flex;
  gap: 8px;
}

.course-row {
  display: grid;
  grid-template-columns: minmax(170px, 1fr) 112px 38px;
  gap: 10px;
  align-items: center;
  min-height: 74px;
  padding: 12px;
}

.course-main strong,
.result-card strong {
  display: block;
  margin-bottom: 5px;
  font-size: 15px;
  line-height: 1.25;
}

.course-main p,
.result-card p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}

.course-row select {
  padding: 0 8px;
}

.empty-state {
  display: grid;
  min-height: 180px;
  place-items: center;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  color: var(--muted);
  text-align: center;
}

.search-field {
  margin-bottom: 12px;
}

.segmented {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  margin-bottom: 14px;
}

.segmented button {
  min-width: 0;
  padding: 0 8px;
  border-color: var(--line);
  background: #ffffff;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.segmented button.active {
  border-color: var(--blue);
  background: var(--blue-soft);
  color: #1e40af;
}

.result-card {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 12px;
}

.course-title-link {
  display: grid;
  width: fit-content;
  max-width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--ink);
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.course-title-link:hover strong,
.course-title-link:focus-visible strong,
.course-title-link:hover span,
.course-title-link:focus-visible span {
  color: var(--teal);
}

.course-title-link:focus-visible {
  outline: 3px solid rgba(14, 165, 164, 0.28);
  outline-offset: 3px;
  border-radius: 6px;
}

.course-title-link span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 14px;
}

.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 9px;
}

.chip {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 8px;
  border-radius: 999px;
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.course-warning {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  min-height: 24px;
  border-radius: 999px;
  background: #fef3c7;
  color: #a16207;
  font-size: 13px;
  font-weight: 900;
}

.availability-warning {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 999px;
  border: 1px solid transparent;
}

.availability-warning svg {
  width: 15px;
  height: 15px;
}

.availability-warning.closed {
  border-color: rgba(180, 35, 24, 0.18);
  background: var(--red-soft);
  color: var(--red);
}

.availability-warning.unknown {
  border-color: rgba(180, 83, 9, 0.18);
  background: var(--amber-soft);
  color: var(--amber);
}

.chip.teal {
  background: var(--teal-soft);
  color: #075c55;
}

.chip.blue {
  background: var(--blue-soft);
  color: #1e40af;
}

.chip.amber {
  background: var(--amber-soft);
  color: var(--amber);
}

.chip.red {
  background: var(--red-soft);
  color: var(--red);
}

.schedule-term-field {
  margin: -4px 0 14px;
}

.placeholder-page {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 28px;
}

.placeholder-panel {
  display: grid;
  width: min(520px, 100%);
  min-height: 280px;
  place-items: center;
  padding: 34px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
  text-align: center;
}

.placeholder-panel > svg {
  width: 48px;
  height: 48px;
  color: var(--teal);
}

.placeholder-panel p {
  margin: 12px 0 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.placeholder-panel h1 {
  margin: 0;
  font-size: 24px;
  letter-spacing: 0;
}

.term-dialog {
  width: min(440px, calc(100% - 28px));
  padding: 18px;
}

.term-dialog::backdrop,
.course-detail-dialog::backdrop {
  background: rgba(29, 36, 51, 0.34);
  backdrop-filter: blur(3px);
}

.term-dialog .panel-heading,
.course-detail-dialog .panel-heading {
  margin-bottom: 18px;
}

.course-detail-dialog {
  width: min(900px, calc(100% - 32px));
  max-height: min(760px, calc(100vh - 32px));
  padding: 0;
  overflow: hidden;
}

.course-detail-shell {
  display: flex;
  max-height: inherit;
  flex-direction: column;
  padding: 18px;
}

.course-detail-body {
  display: grid;
  gap: 14px;
  min-height: 0;
  overflow-y: auto;
  padding-right: 4px;
}

.course-detail-section,
.course-detail-card,
.season-availability-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.course-detail-section {
  padding: 14px;
}

.course-detail-section h3 {
  margin: 0 0 10px;
  font-size: 15px;
  letter-spacing: 0;
}

.course-detail-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.detail-source {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

a.detail-source:hover {
  color: var(--teal);
}

.course-detail-grid {
  display: grid;
  grid-template-columns: 1.05fr 1fr 1fr;
  gap: 10px;
}

.course-detail-card {
  min-height: 152px;
  padding: 13px;
}

.course-detail-card > span,
.season-availability-card > span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.course-detail-card p {
  margin: 9px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.program-roles-list {
  display: grid;
  gap: 8px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.program-role-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fafafa;
}

.program-role-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.program-role-tag {
  display: inline-flex;
  align-items: center;
  padding: 2px 7px;
  border-radius: 4px;
  background: var(--line);
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  white-space: nowrap;
}

.program-role-tag-cap {
  background: rgba(15, 118, 110, 0.12);
  color: var(--teal);
}

.program-role-tag-minor {
  background: rgba(245, 158, 11, 0.14);
  color: #b45309;
}

.program-role-name {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.program-role-chips {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 4px;
}

.program-role-empty {
  font-size: 12px;
  color: var(--muted);
  font-style: italic;
}

@media (max-width: 640px) {
  .program-role-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  .program-role-chips {
    justify-content: flex-start;
  }

  .program-role-name {
    white-space: normal;
  }
}

.requisite-credit-note {
  display: grid;
  gap: 6px;
  margin-top: 10px;
}

.requisite-credit-note span {
  border-left: 3px solid var(--amber);
  color: var(--text);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.35;
  padding-left: 8px;
}

.credit-list {
  display: grid;
  gap: 8px;
  margin: 10px 0 0;
}

.credit-list div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.credit-list dt {
  color: var(--muted);
  font-weight: 750;
}

.credit-list dd {
  margin: 0;
  font-weight: 850;
}

.requisite-course-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.requisite-chip {
  border: 0;
  cursor: pointer;
}

.season-availability-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.season-availability-card {
  padding: 13px;
}

.season-availability-card strong,
.season-availability-card small {
  display: block;
}

.season-availability-card strong {
  margin-top: 8px;
  font-size: 18px;
}

.season-availability-card small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.season-availability-card.open {
  background: var(--teal-soft);
  border-color: rgba(14, 165, 164, 0.32);
}

.season-availability-card.closed {
  background: var(--red-soft);
  border-color: rgba(220, 38, 38, 0.24);
}

.season-availability-card.unknown {
  background: var(--surface-soft);
}

.term-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.term-dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 18px;
}

.requirement-section {
  margin-top: 18px;
  padding: 20px;
}

.completion-badge {
  min-height: 30px;
  padding: 6px 10px;
  border-radius: 999px;
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.fast-plan-result {
  display: grid;
  gap: 16px;
  margin-top: 18px;
  padding: 20px;
}

.fast-plan-result[hidden] {
  display: none;
}

.fast-plan-summary {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
}

.fast-plan-summary article,
.fast-plan-empty,
.fast-plan-blockers,
.fast-plan-requirements,
.fast-plan-term {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.fast-plan-summary article {
  display: grid;
  gap: 6px;
  padding: 13px;
}

.fast-plan-summary span,
.fast-plan-term header span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.fast-plan-summary strong {
  color: var(--text);
  font-size: 20px;
  line-height: 1.15;
}

.fast-plan-note {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.fast-plan-note.warn {
  color: var(--red);
  font-weight: 750;
}

.fast-plan-note.done {
  color: #075c55;
  font-weight: 750;
}

.fast-plan-actions {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.fast-plan-requirements {
  display: grid;
  gap: 12px;
  padding: 14px;
}

.fast-plan-requirements header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.fast-plan-requirements header span,
.fast-plan-gaps span,
.fast-plan-requirement-card span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.fast-plan-requirements header strong {
  display: block;
  margin-top: 3px;
  font-size: 20px;
  letter-spacing: 0;
}

.fast-plan-requirement-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.fast-plan-requirement-card {
  min-width: 0;
  display: grid;
  gap: 8px;
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}

.fast-plan-requirement-card.done {
  border-color: rgba(20, 184, 166, 0.32);
  background: var(--teal-soft);
}

.fast-plan-requirement-card.more {
  place-content: center;
  min-height: 98px;
}

.fast-plan-requirement-card strong {
  min-width: 0;
  color: var(--text);
  font-size: 14px;
  line-height: 1.25;
}

.fast-plan-requirement-card small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.fast-plan-gaps {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.fast-plan-gaps article {
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}

.fast-plan-gaps p {
  margin: 6px 0 0;
  color: var(--text);
  font-size: 13px;
  line-height: 1.45;
}

.fast-plan-timeline {
  display: grid;
  gap: 12px;
}

.fast-plan-empty {
  min-height: 76px;
  display: grid;
  place-items: center;
  padding: 16px;
  color: var(--muted);
  text-align: center;
}

.fast-plan-term {
  display: grid;
  gap: 12px;
  padding: 14px;
}

.fast-plan-term header {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
}

.fast-plan-term h3 {
  margin: 4px 0 0;
  letter-spacing: 0;
}

.fast-plan-term header strong {
  color: var(--teal);
  white-space: nowrap;
}

.fast-plan-course-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.fast-plan-course {
  min-width: 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}

.fast-plan-blockers {
  padding: 14px;
  background: var(--red-soft);
  border-color: rgba(220, 38, 38, 0.22);
}

.fast-plan-blockers strong {
  color: var(--red);
}

.fast-plan-blockers ul {
  margin: 10px 0 0;
  padding-left: 18px;
  color: var(--text);
}

.fast-plan-option-grid {
  display: grid;
  gap: 12px;
}

.fast-plan-limit-meta {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 750;
}

.plan-manager-dialog {
  width: min(720px, calc(100vw - 24px));
}

.plan-save-form {
  display: grid;
  gap: 10px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

.plan-manager-list {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.plan-manager-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.plan-manager-item.active {
  border-color: rgba(20, 184, 166, 0.34);
  background: var(--teal-soft);
}

.plan-manager-item.transcript-active {
  position: relative;
  border-color: rgba(37, 99, 235, 0.34);
  background:
    linear-gradient(135deg, rgba(220, 232, 255, 0.92), rgba(217, 240, 236, 0.86)),
    #ffffff;
  box-shadow: 0 20px 46px rgba(37, 99, 235, 0.14);
}

.plan-manager-item.transcript-active::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  border-radius: 8px 0 0 8px;
  background: var(--blue);
}

.plan-manager-item.transcript-plan {
  border-color: rgba(15, 118, 110, 0.22);
  background: #f8fffd;
}

.plan-transcript-kicker {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 8px;
  color: var(--blue);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.plan-transcript-kicker.muted {
  color: var(--teal);
}

.plan-transcript-kicker svg {
  width: 16px;
  height: 16px;
}

.plan-manager-item-title {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.plan-manager-item strong {
  color: var(--text);
  font-size: 15px;
}

.plan-manager-item p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.plan-manager-item small {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 12px;
}

.plan-manager-item .plan-transcript-meta {
  color: #1d4ed8;
  font-weight: 800;
}

.plan-manager-actions {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.completion-badge.done {
  background: var(--teal-soft);
  color: #075c55;
}

.completion-badge.warn {
  background: var(--red-soft);
  color: var(--red);
}

.completion-badge.transcript {
  background: var(--blue-soft);
  color: #1d4ed8;
}

.requirement-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(170px, 1fr));
  gap: 12px;
}

.requirement-group-title,
.requirement-card-wide {
  grid-column: 1 / -1;
}

.requirement-card {
  min-height: 145px;
  padding: 15px;
}

.requirement-card-button {
  display: block;
  width: 100%;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: border-color 160ms ease, box-shadow 160ms ease, background-color 160ms ease;
}

.requirement-card-button:hover {
  border-color: rgba(37, 99, 235, 0.36);
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 14px 34px rgba(15, 23, 42, 0.09);
}

.requirement-card-button:focus-visible {
  outline: 3px solid rgba(37, 99, 235, 0.22);
  outline-offset: 2px;
}

.requirement-card h3 {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin: 8px 0 12px;
  font-size: 16px;
  letter-spacing: 0;
}

.requirement-card h3 svg {
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
  color: var(--muted);
}

.requirement-card .req-login-btn {
  margin-top: 4px;
}

.progress-track {
  width: 100%;
  height: 9px;
  overflow: hidden;
  border-radius: 999px;
  background: #e8edf3;
}

.progress-bar {
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: var(--blue);
  transition: width 180ms ease;
}

.progress-bar.done {
  background: var(--teal);
}

.progress-bar.warn {
  background: var(--amber);
}

.requirement-foot {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-top: 11px;
  color: var(--muted);
  font-size: 13px;
}

.missing-panel {
  display: grid;
  gap: 10px;
  margin-top: 12px;
  padding: 15px;
}

.missing-panel ul {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.missing-panel li {
  min-height: 28px;
  padding: 5px 9px;
  border-radius: var(--radius);
  background: var(--amber-soft);
  color: var(--amber);
  font-size: 13px;
  font-weight: 750;
}

.auth-widget {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.auth-user-pill {
  display: flex;
  align-items: center;
  min-height: 42px;
  max-width: 100%;
  gap: 8px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  font-size: 13px;
  font-weight: 800;
}

.auth-user-pill span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.auth-user-pill svg,
.auth-widget .button svg {
  width: 17px;
  height: 17px;
}

.auth-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.auth-links a {
  color: #075c55;
  text-decoration: none;
}

.auth-links a:hover {
  text-decoration: underline;
}

.auth-dialog {
  width: min(440px, calc(100% - 28px));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.auth-dialog::backdrop {
  background: rgba(15, 23, 42, 0.34);
}

.auth-panel {
  display: grid;
  gap: 14px;
  padding: 18px;
}

/* ─── Onboarding dialog (two-column layout) ─── */

.onboarding-dialog {
  width: min(1040px, calc(100% - 24px));
  max-height: min(860px, calc(100dvh - 24px));
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: var(--surface);
  box-shadow:
    0 30px 80px -20px rgba(15, 23, 42, 0.35),
    0 12px 30px -10px rgba(15, 118, 110, 0.18);
}

.onboarding-dialog::backdrop {
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(10px);
}

.onboarding-dialog[open] {
  display: grid;
  grid-template-columns: 360px 1fr;
}

@media (max-width: 880px) {
  .onboarding-dialog[open] {
    grid-template-columns: 1fr;
  }
}

/* ─── Aside (left brand panel) ─── */

.onboarding-aside {
  position: relative;
  overflow: hidden;
  padding: 32px 28px;
  background:
    radial-gradient(circle at 80% 0%, rgba(56, 189, 175, 0.35), transparent 55%),
    radial-gradient(circle at 0% 90%, rgba(37, 99, 235, 0.32), transparent 55%),
    linear-gradient(165deg, #0b3b35 0%, #0f766e 45%, #1d4ed8 100%);
  color: #f8fafc;
  isolation: isolate;
}

@media (max-width: 880px) {
  .onboarding-aside {
    display: none;
  }
}

.onboarding-aside-decor {
  position: absolute;
  z-index: 0;
  width: 240px;
  height: 240px;
  border-radius: 50%;
  filter: blur(40px);
  opacity: 0.55;
  pointer-events: none;
}

.onboarding-aside-decor--a {
  top: -60px;
  right: -70px;
  background: radial-gradient(circle, rgba(94, 234, 212, 0.7), transparent 70%);
}

.onboarding-aside-decor--b {
  bottom: -80px;
  left: -60px;
  background: radial-gradient(circle, rgba(96, 165, 250, 0.7), transparent 70%);
}

.onboarding-aside-content {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  height: 100%;
  gap: 18px;
}

.onboarding-aside-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 16px;
  font-weight: 900;
  letter-spacing: 0.02em;
}

.onboarding-brand-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
  backdrop-filter: blur(4px);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.25);
}

.onboarding-brand-icon svg {
  width: 22px;
  height: 22px;
}

.onboarding-aside-title {
  margin: 14px 0 0;
  font-size: 26px;
  font-weight: 850;
  line-height: 1.18;
  letter-spacing: -0.01em;
  color: #ffffff;
}

.onboarding-aside-lede {
  margin: 0;
  color: rgba(241, 245, 249, 0.85);
  font-size: 14px;
  line-height: 1.55;
}

.onboarding-aside-features {
  display: grid;
  gap: 14px;
  margin: auto 0 0;
  padding: 0;
  list-style: none;
}

.onboarding-aside-features li {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.onboarding-aside-features li > div {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.onboarding-aside-features li strong {
  font-size: 13.5px;
  font-weight: 800;
  color: #ffffff;
  line-height: 1.25;
}

.onboarding-aside-features li span {
  font-size: 12.5px;
  font-weight: 600;
  color: rgba(226, 232, 240, 0.78);
  line-height: 1.4;
}

.onboarding-aside-bullet {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 30px;
  height: 30px;
  margin-top: 1px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.15);
  color: #f0fdfa;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.2);
}

.onboarding-aside-bullet svg {
  width: 15px;
  height: 15px;
}

/* ─── Shell (right form area) ─── */

.onboarding-shell {
  display: flex;
  flex-direction: column;
  max-height: min(860px, calc(100dvh - 24px));
  overflow-y: auto;
  padding: 26px 30px 28px;
  background: var(--surface);
}

/* ─── Stepper ─── */

.onboarding-stepper {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 22px;
}

.onboarding-step-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
  transition: background 140ms, border-color 140ms, color 140ms;
}

.onboarding-step-pill span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  transition: background 140ms, color 140ms;
}

.onboarding-step-pill span svg {
  width: 13px;
  height: 13px;
}

.onboarding-step-pill.is-active {
  border-color: var(--teal);
  background: var(--teal-soft);
  color: var(--teal);
}

.onboarding-step-pill.is-active span {
  background: var(--teal);
  color: #fff;
}

.onboarding-step-pill.is-done {
  border-color: rgba(15, 118, 110, 0.4);
  color: var(--teal);
}

.onboarding-step-pill.is-done span {
  background: var(--teal);
  color: #fff;
}

.onboarding-step-divider {
  flex: 1;
  height: 2px;
  border-radius: 2px;
  background: var(--line);
  min-width: 16px;
  max-width: 36px;
}

.onboarding-step-divider.is-done {
  background: var(--teal);
}

@media (max-width: 480px) {
  .onboarding-step-pill strong {
    display: none;
  }
}

/* ─── Step body ─── */

.onboarding-step-body {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.onboarding-step-header {
  display: flex;
  align-items: center;
  margin-bottom: -4px;
}

.onboarding-back-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px 7px 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text);
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
  transition: background 120ms, border-color 120ms, color 120ms, transform 140ms;
}

.onboarding-back-btn svg {
  width: 14px;
  height: 14px;
}

.onboarding-back-btn:hover {
  background: var(--teal-soft);
  border-color: var(--teal);
  color: var(--teal);
  transform: translateX(-2px);
}

.onboarding-kicker {
  display: inline-block;
  margin: 0;
  color: var(--teal);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.onboarding-step-title {
  margin: 4px 0 0;
  font-size: 24px;
  font-weight: 850;
  letter-spacing: -0.01em;
  color: var(--text);
  line-height: 1.2;
}

.onboarding-step-lede {
  margin: -4px 0 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.55;
}

/* ─── Path selection cards ─── */

.onboarding-paths {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 4px;
}

@media (max-width: 720px) {
  .onboarding-paths {
    grid-template-columns: 1fr;
  }
}

.onboarding-path-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 14px;
  padding: 20px 18px 18px;
  border: 1.5px solid var(--line);
  border-radius: 18px;
  background: var(--surface);
  cursor: pointer;
  text-align: left;
  overflow: hidden;
  transition: border-color 160ms, background 160ms, box-shadow 160ms, transform 160ms;
}

.onboarding-path-card::after {
  content: "";
  position: absolute;
  inset: auto -40px -60px auto;
  width: 160px;
  height: 160px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(15, 118, 110, 0.12), transparent 70%);
  opacity: 0;
  transition: opacity 200ms;
  pointer-events: none;
}

.onboarding-path-card:hover {
  border-color: var(--teal);
  background: var(--teal-soft);
  box-shadow: 0 6px 18px -10px rgba(15, 118, 110, 0.25);
}

.onboarding-path-card:hover::after {
  opacity: 1;
}

.onboarding-path-card:hover .onboarding-path-icon {
  color: var(--teal);
}

.onboarding-path-card--feature {
  border-color: rgba(15, 118, 110, 0.45);
  background:
    linear-gradient(135deg, rgba(217, 240, 236, 0.55), rgba(220, 232, 255, 0.4)),
    var(--surface);
}

.onboarding-path-card--feature::before {
  content: "";
  position: absolute;
  inset: 0;
  padding: 1.5px;
  border-radius: 18px;
  background: linear-gradient(135deg, var(--teal), #2563eb);
  -webkit-mask:
    linear-gradient(#000 0 0) content-box,
    linear-gradient(#000 0 0);
  mask:
    linear-gradient(#000 0 0) content-box,
    linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  opacity: 0.4;
  pointer-events: none;
}

.onboarding-path-badge {
  position: absolute;
  top: 14px;
  right: 14px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 10px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--teal), #2563eb);
  color: #fff;
  font-size: 10.5px;
  font-weight: 900;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  box-shadow: 0 4px 12px rgba(15, 118, 110, 0.3);
}

.onboarding-path-badge svg {
  width: 12px;
  height: 12px;
}

.onboarding-path-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 48px;
  height: 48px;
  border-radius: 14px;
  transition: transform 200ms;
}

.onboarding-path-icon--teal {
  background: var(--teal-soft);
  color: var(--teal);
}

.onboarding-path-icon--blue {
  background: var(--blue-soft);
  color: var(--blue);
}

.onboarding-path-icon svg {
  width: 22px;
  height: 22px;
}

.onboarding-path-content {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
  width: 100%;
}

.onboarding-path-content strong {
  font-size: 15.5px;
  font-weight: 850;
  color: var(--text);
  letter-spacing: -0.005em;
}

.onboarding-path-content span {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.5;
}

.onboarding-path-cta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding-top: 10px;
  margin-top: auto;
  border-top: 1px dashed var(--line);
  width: 100%;
  color: var(--teal);
  font-size: 12px;
  font-weight: 800;
}

.onboarding-path-cta svg {
  width: 14px;
  height: 14px;
}

.onboarding-path-cta em {
  font-style: normal;
  letter-spacing: 0.02em;
}

/* ─── Foot hints / skip link ─── */

.onboarding-foot-hint {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 650;
  text-align: center;
}

.onboarding-foot-hint svg {
  width: 14px;
  height: 14px;
  color: var(--teal);
  flex-shrink: 0;
}

.onboarding-skip-link {
  padding: 0;
  border: none;
  background: none;
  color: var(--teal);
  font-size: inherit;
  font-weight: 800;
  cursor: pointer;
  transition: color 120ms;
}

.onboarding-skip-link:hover {
  color: var(--text);
  text-decoration: underline;
}

/* ─── Transcript upload zone ─── */

.onboarding-upload-zone {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  padding: 40px 30px;
  border: 1.75px dashed var(--line-strong);
  border-radius: 20px;
  background:
    radial-gradient(circle at 50% 0%, rgba(15, 118, 110, 0.05), transparent 60%),
    var(--surface-soft);
  text-align: center;
  cursor: pointer;
  transition: border-color 160ms, background 160ms, transform 200ms;
}

.onboarding-upload-zone:hover {
  border-color: var(--teal);
  background:
    radial-gradient(circle at 50% 0%, rgba(15, 118, 110, 0.08), transparent 60%),
    var(--teal-soft);
}

.onboarding-upload-zone:hover .onboarding-upload-icon {
  color: var(--teal);
}

.onboarding-upload-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 64px;
  height: 64px;
  border-radius: 20px;
  background: linear-gradient(135deg, var(--teal), #2563eb);
  color: #fff;
  box-shadow: 0 8px 24px -6px rgba(15, 118, 110, 0.4);
  transition: transform 200ms;
}

.onboarding-upload-icon svg {
  width: 28px;
  height: 28px;
}

.onboarding-upload-text {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.onboarding-upload-text strong {
  color: var(--text);
  font-size: 15px;
  font-weight: 800;
}

.onboarding-upload-text span {
  color: var(--muted);
  font-size: 12.5px;
}

.onboarding-upload-btn {
  pointer-events: none;
  min-height: 38px;
  padding: 0 16px;
  font-size: 13px;
}

.onboarding-upload-btn svg {
  width: 14px;
  height: 14px;
}

.onboarding-trust-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

@media (max-width: 540px) {
  .onboarding-trust-grid {
    grid-template-columns: 1fr;
  }
}

.onboarding-trust-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  color: var(--text);
  font-size: 12.5px;
  font-weight: 750;
}

.onboarding-trust-item svg {
  width: 15px;
  height: 15px;
  color: var(--teal);
  flex-shrink: 0;
}

/* ─── Manual setup cards ─── */

.onboarding-card {
  display: grid;
  gap: 14px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
  transition: border-color 160ms, box-shadow 160ms;
}

.onboarding-card:hover {
  border-color: rgba(15, 118, 110, 0.35);
  box-shadow: 0 6px 18px -10px rgba(15, 118, 110, 0.25);
}

.onboarding-card-head {
  display: flex;
  align-items: center;
  gap: 12px;
}

.onboarding-card-head > div {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
  min-width: 0;
}

.onboarding-card-head > div strong {
  color: var(--text);
  font-size: 14.5px;
  font-weight: 850;
}

.onboarding-card-head > div span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.4;
}

.onboarding-card-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  border-radius: 12px;
}

.onboarding-card-icon svg {
  width: 18px;
  height: 18px;
}

.onboarding-card-icon--teal {
  background: var(--teal-soft);
  color: var(--teal);
}

.onboarding-card-icon--blue {
  background: var(--blue-soft);
  color: var(--blue);
}

.onboarding-card-icon--amber {
  background: rgba(245, 158, 11, 0.13);
  color: #b45309;
}

.onboarding-card-req {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(225, 29, 72, 0.1);
  color: #be123c;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.onboarding-card-count {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 800;
}

/* Custom toggle switch */
.onboarding-card-toggle {
  display: inline-flex;
  align-items: center;
  cursor: pointer;
  user-select: none;
}

.onboarding-card-toggle input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.onboarding-card-toggle-track {
  position: relative;
  display: inline-block;
  width: 42px;
  height: 24px;
  border-radius: 999px;
  background: var(--line);
  transition: background 180ms;
}

.onboarding-card-toggle-thumb {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 4px rgba(15, 23, 42, 0.25);
  transition: transform 180ms;
}

.onboarding-card-toggle input:checked + .onboarding-card-toggle-track {
  background: var(--teal);
}

.onboarding-card-toggle input:checked + .onboarding-card-toggle-track .onboarding-card-toggle-thumb {
  transform: translateX(18px);
}

.onboarding-card-toggle input:focus-visible + .onboarding-card-toggle-track {
  outline: 2px solid var(--teal);
  outline-offset: 2px;
}

.onboarding-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

@media (max-width: 560px) {
  .onboarding-form-grid {
    grid-template-columns: 1fr;
  }
}

/* ─── Minor grid (multi-select chips) ─── */

.onboarding-minor-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 8px;
  max-height: 220px;
  overflow-y: auto;
  padding: 2px;
}

.onboarding-minor-grid::-webkit-scrollbar {
  width: 6px;
}

.onboarding-minor-grid::-webkit-scrollbar-thumb {
  background: var(--line);
  border-radius: 3px;
}

.onboarding-minor-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 40px;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  color: var(--text);
  font-size: 12.5px;
  font-weight: 750;
  cursor: pointer;
  transition: border-color 120ms, background 120ms, color 120ms, transform 140ms;
}

.onboarding-minor-item:hover {
  border-color: var(--teal);
  background: var(--teal-soft);
}

.onboarding-minor-item input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.onboarding-minor-check {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  border: 1.5px solid var(--line-strong);
  border-radius: 6px;
  background: var(--surface);
  color: transparent;
  transition: border-color 120ms, background 120ms, color 120ms;
}

.onboarding-minor-check svg {
  width: 12px;
  height: 12px;
}

.onboarding-minor-label {
  flex: 1;
  min-width: 0;
  line-height: 1.3;
}

.onboarding-minor-item:has(input:checked) {
  border-color: var(--teal);
  background: var(--teal-soft);
  color: var(--teal);
}

.onboarding-minor-item:has(input:checked) .onboarding-minor-check {
  border-color: var(--teal);
  background: var(--teal);
  color: #fff;
}

.onboarding-empty {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

/* ─── Footer actions (submit / back) ─── */

.onboarding-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 6px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.onboarding-submit {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 22px;
  min-height: 44px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--teal), #1d4ed8);
  color: #fff;
  font-size: 14px;
  font-weight: 850;
  box-shadow: 0 10px 24px -8px rgba(15, 118, 110, 0.45);
  transition: transform 140ms, box-shadow 160ms;
}

.onboarding-submit:hover {
  box-shadow: 0 14px 30px -8px rgba(15, 118, 110, 0.55);
}

.onboarding-submit svg {
  width: 16px;
  height: 16px;
}

.auth-google-section {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-soft);
}

.auth-google-button {
  min-height: 42px;
}

.auth-google-section p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
  line-height: 1.35;
}

.auth-legal {
  display: grid;
  gap: 6px;
  margin-top: 2px;
}

.auth-legal details {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.72);
}

.auth-legal summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 34px;
  padding: 8px 10px;
  color: var(--text);
  cursor: pointer;
  font-size: 12px;
  font-weight: 850;
  list-style: none;
}

.auth-legal summary::-webkit-details-marker {
  display: none;
}

.auth-legal summary svg {
  width: 14px;
  height: 14px;
  color: var(--muted);
  transition: transform 140ms ease;
}

.auth-legal details[open] summary svg {
  transform: rotate(180deg);
}

.auth-legal-body {
  display: grid;
  gap: 8px;
  max-height: 220px;
  overflow: auto;
  padding: 0 10px 10px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 650;
  line-height: 1.45;
}

.auth-legal-body p {
  margin: 0;
}

.auth-divider {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
  text-transform: uppercase;
}

.auth-divider::before,
.auth-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line);
}

.auth-tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-soft);
}

.auth-tabs button {
  min-height: 36px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  background: transparent;
  color: var(--muted);
  font-weight: 850;
}

.auth-tabs button.active {
  border-color: #9ccbc5;
  background: var(--surface);
  color: var(--teal);
}

.auth-alert {
  padding: 10px 12px;
  border: 1px solid #9ccbc5;
  border-radius: var(--radius);
  background: var(--teal-soft);
  color: #075c55;
  font-size: 13px;
  font-weight: 750;
}

.auth-alert.error {
  border-color: #f1aaa4;
  background: var(--red-soft);
  color: var(--red);
}

.auth-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.friends-body {
  min-height: 100vh;
}

.friends-shell {
  display: grid;
  grid-template-columns: minmax(280px, 360px) minmax(320px, 1fr);
  gap: 18px;
  width: min(1380px, calc(100% - 40px));
  margin: 24px auto 40px;
}

.friends-panel {
  display: grid;
  align-content: start;
  gap: 14px;
  min-height: 180px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.88);
  box-shadow: var(--shadow);
}

.friend-search-panel,
.friends-list-panel {
  grid-column: 1;
}

.friend-detail-panel {
  grid-column: 2;
  grid-row: 1 / span 4;
}

.friend-search-form {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: end;
  gap: 10px;
}

.friend-columns {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.friend-columns h3,
.friend-detail h3 {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.friend-list,
.friend-result-list {
  display: grid;
  gap: 9px;
}

.friend-row,
.friend-card,
.friend-course-item,
.friend-compat-item,
.friend-schedule-item,
.calendar-request-row,
.common-participant,
.common-plan-summary {
  display: grid;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.friend-row {
  grid-template-columns: 1fr auto;
  align-items: center;
  min-height: 62px;
  padding: 10px;
}

.common-section-form {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: 10px;
}

.common-section-picker,
.common-friend-picker,
.common-plan-result {
  display: grid;
  gap: 9px;
}

.common-component {
  display: grid;
  gap: 7px;
}

.common-component > span,
.common-friend-picker > span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.common-section-grid,
.common-friend-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
}

.common-friend-option {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  font-size: 13px;
  font-weight: 800;
}

.common-section-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.common-plan-summary,
.common-participant,
.calendar-request-row {
  padding: 10px;
}

.common-plan-summary.possible,
.common-participant.possible {
  border-color: #9ccbc5;
  background: var(--teal-soft);
}

.common-plan-summary.blocked,
.common-participant.blocked {
  border-color: #f1aaa4;
  background: var(--red-soft);
}

.common-plan-summary span,
.common-participant span,
.calendar-request-row span {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.common-participant-list {
  display: grid;
  gap: 7px;
}

.calendar-request-group {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.calendar-request-group h4 {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.calendar-request-row {
  grid-template-columns: 1fr auto;
  align-items: center;
}

.friend-card {
  grid-template-columns: 1fr auto;
  align-items: center;
  width: 100%;
  min-height: 66px;
  padding: 12px;
  color: var(--text);
  text-align: left;
}

.friend-card.active {
  border-color: #9ccbc5;
  background: var(--teal-soft);
}

.friend-row strong,
.friend-card strong,
.friend-course-item strong,
.friend-compat-item strong,
.friend-schedule-item strong {
  display: block;
  font-size: 14px;
}

.friend-row span,
.friend-card span,
.friend-course-item span,
.friend-compat-item span,
.friend-status {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.friend-row-actions {
  display: flex;
  gap: 6px;
}

.friend-detail-grid {
  display: grid;
  gap: 16px;
}

.friend-course-item,
.friend-compat-item,
.friend-schedule-item {
  margin-bottom: 8px;
  padding: 12px;
}

.friend-compat-item.possible {
  border-color: #9ccbc5;
  background: var(--teal-soft);
}

.friend-compat-item.blocked {
  border-color: #f1aaa4;
  background: var(--red-soft);
}

.friend-meeting-group {
  display: grid;
  gap: 3px;
  margin-top: 8px;
  padding: 8px;
  border-radius: var(--radius);
  background: var(--surface-soft);
}

.friend-meeting-group span,
.friend-meeting-group small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.remove-friend-button {
  justify-self: start;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ─── Profile page ──────────────────────────────────────────────────── */

.profile-shell {
  display: grid;
  gap: 16px;
  width: min(720px, calc(100% - 40px));
  margin: 24px auto 48px;
}

.profile-panel {
  display: grid;
  align-content: start;
  gap: 18px;
  padding: 22px 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.88);
  box-shadow: var(--shadow);
}

.profile-auth-panel {
  background:
    linear-gradient(135deg, rgba(217, 240, 236, 0.55), rgba(255, 255, 255, 0.92)),
    var(--surface);
}

.profile-auth-mount {
  display: flex;
  align-items: center;
  min-height: 42px;
}

.profile-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.profile-note {
  padding: 10px 14px;
  border-radius: calc(var(--radius) - 2px);
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.legal-body {
  min-height: 100vh;
  background:
    linear-gradient(180deg, rgba(248, 250, 252, 0.92), rgba(238, 244, 246, 0.82)),
    var(--bg);
}

.legal-shell {
  width: min(920px, calc(100% - 32px));
  margin: 0 auto;
  padding: 56px 0 84px;
}

.legal-panel {
  display: grid;
  gap: 14px;
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.92);
  box-shadow: var(--shadow);
}

.legal-kicker {
  margin: 0;
  color: #075c55;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

.legal-panel h1,
.legal-panel h2,
.legal-panel p {
  margin: 0;
}

.legal-panel h1 {
  font-size: 32px;
  line-height: 1.15;
}

.legal-panel h2 {
  margin-top: 10px;
  font-size: 18px;
}

.legal-panel p {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.65;
}

/* Toggle switch */
.switch-field {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 13px;
  color: var(--muted);
  user-select: none;
  white-space: nowrap;
}

.switch-field input[type="checkbox"] {
  position: relative;
  flex-shrink: 0;
  width: 36px;
  height: 20px;
  margin: 0;
  appearance: none;
  -webkit-appearance: none;
  border: 1.5px solid var(--line-strong);
  border-radius: 999px;
  background: var(--surface-soft);
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
}

.switch-field input[type="checkbox"]::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--muted);
  transition: transform 0.2s, background 0.2s;
}

.switch-field input[type="checkbox"]:checked {
  background: var(--teal-soft);
  border-color: var(--teal);
}

.switch-field input[type="checkbox"]:checked::after {
  transform: translateX(16px);
  background: var(--teal);
}

/* Minors list */
.profile-minor-list {
  display: grid;
  gap: 10px;
}

.profile-minor-row {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: end;
  gap: 10px;
}

/* Profile preview cards */
.profile-preview {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
}

.profile-preview-item {
  display: grid;
  gap: 4px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-soft);
}

.profile-preview-item span {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}

.profile-preview-item strong {
  font-size: 18px;
  font-weight: 750;
  color: var(--text);
}

.profile-preview-item small {
  font-size: 12px;
  color: var(--muted);
}

@media (max-width: 1180px) {
  .app-header,
  .calendar-header {
    display: grid;
    grid-template-columns: 1fr auto;
  }

  .summary-grid {
    grid-template-columns: repeat(3, minmax(150px, 1fr));
  }

  .workspace {
    grid-template-columns: 260px minmax(340px, 1fr);
  }

  .course-search {
    grid-column: 1 / -1;
    min-height: 0;
  }

  .catalog-search-shell {
    width: 100%;
    border-radius: 0;
  }

  .catalog-filter-row--meta {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .catalog-search-results {
    grid-template-columns: 1fr;
  }

  .result-list {
    grid-template-columns: repeat(2, minmax(260px, 1fr));
  }

  .requirement-grid {
    grid-template-columns: repeat(3, minmax(170px, 1fr));
  }

  .fast-plan-summary,
  .fast-plan-requirement-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .course-detail-grid {
    grid-template-columns: 1fr;
  }

  .calendar-body {
    overflow: auto;
  }

  .calendar-shell {
    grid-template-columns: 340px minmax(620px, 1fr);
    height: calc(100dvh - 64px);
    min-height: 0;
  }

  .friends-shell {
    grid-template-columns: 1fr;
  }

  .friend-search-panel,
  .friends-list-panel,
  .friend-detail-panel {
    grid-column: 1;
    grid-row: auto;
  }
}

@media (max-width: 860px) {
  .app-header,
  .calendar-header {
    position: static;
    align-items: flex-start;
    padding: 16px;
  }

  .app-header,
  .calendar-header,
  .header-actions,
  .workspace {
    flex-direction: column;
  }

  .app-header,
  .calendar-header {
    grid-template-columns: 1fr;
  }

  .header-actions,
  .calendar-header-actions,
  .calendar-shell,
  .friends-shell,
  .workspace,
  .term-rail,
  .term-detail,
  .course-search {
    width: 100%;
  }

  .app-shell {
    width: calc(100% - 24px);
    margin-top: 12px;
  }

  .summary-grid,
  .workspace,
  .result-list,
  .requirement-grid,
  .fast-plan-summary,
  .fast-plan-requirement-grid,
  .fast-plan-gaps,
  .fast-plan-course-list,
  .calendar-shell,
  .calendar-header-actions {
    grid-template-columns: 1fr;
  }

  .fast-plan-result .section-heading,
  .fast-plan-requirements header {
    align-items: stretch;
    flex-direction: column;
  }

  .fast-plan-actions,
  .fast-plan-actions .button {
    width: 100%;
  }

  .plan-manager-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .plan-manager-actions,
  .plan-manager-actions .button,
  .plan-manager-actions .icon-button {
    width: 100%;
  }

  .plan-manager-item {
    grid-template-columns: 1fr;
  }

  .plan-manager-item .button {
    width: 100%;
  }

  .calendar-header-actions {
    display: grid;
  }

  .auth-widget,
  .friend-search-form,
  .friend-columns,
  .common-section-form,
  .common-section-grid,
  .common-friend-grid,
  .common-section-actions {
    grid-template-columns: 1fr;
  }

  .auth-widget {
    width: 100%;
    align-items: stretch;
    flex-direction: column;
  }

  .auth-widget .button,
  .auth-user-pill {
    width: 100%;
    justify-content: center;
  }

  .friends-shell {
    width: calc(100% - 24px);
    margin-top: 12px;
  }

  .calendar-shell {
    height: auto;
    min-height: 0;
  }

  .calendar-sidebar {
    border-right: 0;
  }

  .calendar-stage {
    min-height: 700px;
  }

  .term-rail,
  .term-detail,
  .course-search {
    min-height: 0;
  }

  .course-search {
    height: auto;
    max-height: none;
  }

  .course-search .result-list {
    max-height: 420px;
  }

  .course-row {
    grid-template-columns: 1fr;
  }

  .course-row .icon-button {
    width: 100%;
  }

  .course-detail-actions,
  .season-availability-grid {
    grid-template-columns: 1fr;
  }

  .course-detail-actions {
    display: grid;
  }

  .term-form-grid,
  .term-dialog-actions {
    grid-template-columns: 1fr;
  }

  .term-dialog-actions {
    flex-direction: column-reverse;
  }

  .field-compact select {
    min-width: 0;
  }

  .profile-shell {
    width: calc(100% - 24px);
    margin-top: 12px;
  }

  .profile-form-grid {
    grid-template-columns: 1fr;
  }

  .profile-preview {
    grid-template-columns: 1fr 1fr;
  }
}

/* ─────────────────────────────────────────────
   MOBILE UX OVERRIDES
   Concept-preserving refinements for phones and small tablets.
   Breakpoints layered: 1080 → 880 → 640 → 480 → 380.
   ───────────────────────────────────────────── */

/* Tablet refinement — smoother step-down between desktop and phone */
@media (max-width: 1080px) {
  .summary-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .requirement-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .fast-plan-summary,
  .fast-plan-requirement-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .catalog-filter-row--meta {
    grid-template-columns: 1fr;
  }
}

/* Mobile: move floating nav to bottom-right FAB and reclaim header space */
@media (max-width: 860px) {
  .app-header,
  .calendar-header {
    padding: 14px 16px;
    gap: 12px;
  }

  .app-header .brand,
  .calendar-header .brand {
    min-width: 0;
    width: 100%;
  }

  .app-header .brand h1,
  .calendar-header .brand h1 {
    font-size: 18px;
    line-height: 1.18;
  }

  .app-header .brand p,
  .calendar-header .brand p {
    font-size: 12px;
  }

  /* Floating nav becomes a thumb-zone FAB with bottom-sheet panel */
  .floating-nav {
    top: auto;
    right: 16px;
    bottom: calc(16px + env(safe-area-inset-bottom, 0px));
    z-index: 80;
  }

  .floating-nav-toggle {
    width: 52px;
    height: 52px;
    border-radius: 999px;
    background: var(--teal);
    border-color: var(--teal);
    color: #ffffff;
    box-shadow: 0 18px 36px -16px rgba(15, 118, 110, 0.55),
                0 8px 16px -8px rgba(15, 23, 42, 0.32);
  }

  .floating-nav-toggle:hover,
  .floating-nav-toggle[aria-expanded="true"] {
    background: #0b5e58;
    color: #ffffff;
  }

  .floating-nav-toggle svg {
    width: 22px;
    height: 22px;
  }

  .floating-nav-panel {
    position: fixed;
    inset: auto 0 0 0;
    display: grid;
    width: 100%;
    min-width: 0;
    max-width: 100%;
    padding: 12px 12px calc(12px + env(safe-area-inset-bottom, 0px));
    border: 0;
    border-top: 1px solid var(--line);
    border-radius: 18px 18px 0 0;
    background: #ffffff;
    box-shadow: 0 -18px 40px -18px rgba(15, 23, 42, 0.28);
    gap: 4px;
  }

  .floating-nav-link {
    display: grid;
    grid-template-columns: 24px 1fr auto;
    align-items: center;
    gap: 12px;
    min-height: 48px;
    padding: 10px 14px;
    border-radius: 12px;
    font-size: 15px;
  }

  .floating-nav-link i {
    width: 22px;
    height: 22px;
  }

  /* Touch-friendly tap targets */
  .button,
  .icon-button,
  .segmented button {
    min-height: 44px;
  }

  .icon-button {
    width: 44px;
    height: 44px;
  }

  .button {
    padding: 0 16px;
    font-size: 14px;
  }

  .field input,
  .field select,
  .course-row select,
  .term-dialog select {
    min-height: 46px;
    font-size: 16px; /* prevents iOS zoom-on-focus */
  }

  .field-compact select {
    min-width: 0;
  }

  /* Header action cluster wraps neatly without horizontal scroll */
  .header-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
  }

  .header-actions .button {
    flex: 1 1 calc(50% - 4px);
    min-width: 0;
  }

  /* Summary grid: 2-col on phones is more scannable than 1-col stack */
  .summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: 14px;
  }

  .summary-card {
    padding: 12px;
  }

  /* Leave space for the bottom FAB so it never covers content */
  .app-shell,
  .friends-shell,
  .profile-shell,
  .calendar-shell {
    padding-bottom: calc(80px + env(safe-area-inset-bottom, 0px));
  }

  /* Calendar: sidebar collapses gracefully */
  .calendar-sidebar {
    border-top: 0;
    padding: 12px;
  }

  .calendar-stage {
    min-height: 560px;
  }

  /* Week grid: keep horizontal scroll usable on phones */
  .week-grid {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .week-grid-header,
  .week-grid-body {
    grid-template-columns: 56px repeat(5, minmax(112px, 1fr));
    min-width: 624px;
  }

  /* Dialogs stay readable: bottom-sheet style on small screens */
  .term-dialog,
  .course-detail-dialog,
  .plan-manager-dialog,
  .fast-plan-dialog,
  .auth-dialog {
    max-height: min(86vh, calc(100dvh - 56px));
  }
}

/* Phone-tier refinements */
@media (max-width: 640px) {
  :root {
    --radius: 12px;
  }

  .app-shell,
  .friends-shell,
  .profile-shell {
    width: calc(100% - 16px);
    margin-top: 10px;
  }

  .app-header,
  .calendar-header {
    padding: 12px 14px;
  }

  .app-header .brand h1,
  .calendar-header .brand h1 {
    font-size: 17px;
  }

  /* Auth widget keeps its hierarchy but stacks below the brand */
  .auth-widget {
    width: 100%;
  }

  .auth-user-pill {
    padding: 8px 12px;
    font-size: 13px;
  }

  /* Header actions: full width buttons in a single column for clarity */
  .header-actions .button {
    flex: 1 1 100%;
  }

  /* Summary: keep 2-col but tighten cards */
  .summary-card {
    padding: 10px 12px;
  }

  .summary-card strong {
    font-size: 18px;
  }

  /* Workspace stacks already at 860 — reduce gaps further */
  .workspace {
    gap: 14px;
  }

  .term-rail,
  .term-detail,
  .course-search {
    padding: 12px;
  }

  /* Bottom-sheet dialogs for phones */
  .term-dialog,
  .course-detail-dialog,
  .plan-manager-dialog,
  .fast-plan-dialog,
  .auth-dialog {
    width: 100%;
    max-width: 100%;
    margin: 0 0 0 0;
    border-radius: 18px 18px 0 0;
    inset: auto 0 0 0;
    transform: none;
    padding: 16px 14px calc(16px + env(safe-area-inset-bottom, 0px));
  }

  .course-detail-dialog,
  .plan-manager-dialog {
    max-height: min(90vh, calc(100dvh - 24px));
  }

  .course-detail-shell {
    padding: 0;
  }

  .term-dialog::backdrop,
  .course-detail-dialog::backdrop,
  .plan-manager-dialog::backdrop,
  .fast-plan-dialog::backdrop,
  .auth-dialog::backdrop {
    background: rgba(15, 23, 42, 0.48);
    backdrop-filter: blur(4px);
  }

  /* Term/dialog action buttons full-width and easy to thumb */
  .term-dialog-actions .button,
  .plan-manager-actions .button,
  .fast-plan-actions .button {
    width: 100%;
    min-height: 46px;
  }

  /* Profile: previews stack to single column */
  .profile-preview {
    grid-template-columns: 1fr;
  }

  /* Catalog meta filters stack on narrow screens */
  .catalog-filter-row--meta {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  /* Result list one card per row */
  .result-list {
    grid-template-columns: 1fr;
  }

  /* Chips wrap with breathing room */
  .chip-row {
    gap: 6px;
  }

  .chip {
    font-size: 12px;
  }

  /* Section headings: ensure title and action stack when tight */
  .section-heading {
    flex-wrap: wrap;
    gap: 8px;
  }

  /* Calendar: tighter time column */
  .week-grid-header,
  .week-grid-body {
    grid-template-columns: 48px repeat(5, minmax(104px, 1fr));
    min-width: 568px;
  }

  /* Floating nav panel rounds in from edges, slightly smaller */
  .floating-nav-panel {
    padding: 10px 10px calc(10px + env(safe-area-inset-bottom, 0px));
  }

  .floating-nav-link {
    min-height: 46px;
    padding: 8px 12px;
    font-size: 14px;
  }

  /* Forum (if present) — generic list legibility */
  .forum-shell,
  .forum-thread {
    padding: 12px;
  }
}

/* Compact phones (iPhone SE, small Androids) */
@media (max-width: 480px) {
  .app-shell,
  .friends-shell,
  .profile-shell {
    width: calc(100% - 12px);
  }

  .app-header,
  .calendar-header {
    padding: 10px 12px;
    gap: 10px;
  }

  .app-header .brand h1,
  .calendar-header .brand h1 {
    font-size: 16px;
  }

  /* Summary collapses to 1-col on very narrow screens */
  .summary-grid {
    grid-template-columns: 1fr;
  }

  .button {
    font-size: 13.5px;
    padding: 0 14px;
  }

  /* Floating FAB nudges to maintain visibility above iOS home indicator */
  .floating-nav-toggle {
    width: 48px;
    height: 48px;
  }

  .floating-nav-toggle svg {
    width: 20px;
    height: 20px;
  }

  /* Requirement grid one per row */
  .requirement-grid,
  .fast-plan-summary,
  .fast-plan-requirement-grid {
    grid-template-columns: 1fr;
  }

  /* Week grid further tightening */
  .week-grid-header,
  .week-grid-body {
    grid-template-columns: 44px repeat(5, minmax(96px, 1fr));
    min-width: 524px;
  }

  /* Friends list cards more compact */
  .friend-card,
  .common-friend-card {
    padding: 10px 12px;
  }
}

/* Extra small (older phones, ~360px) */
@media (max-width: 380px) {
  .app-shell,
  .friends-shell,
  .profile-shell {
    width: calc(100% - 8px);
  }

  .app-header .brand h1,
  .calendar-header .brand h1 {
    font-size: 15px;
  }

  .summary-card strong {
    font-size: 17px;
  }

  .button {
    font-size: 13px;
    padding: 0 12px;
  }

  .icon-button {
    width: 42px;
    height: 42px;
  }

  /* Auth pill text shortens visually via tighter padding */
  .auth-user-pill {
    padding: 6px 10px;
    font-size: 12px;
  }
}

/* Landscape phones — keep nav reachable, shrink vertical chrome */
@media (max-width: 900px) and (orientation: landscape) and (max-height: 480px) {
  .app-header,
  .calendar-header {
    position: static;
    padding: 8px 14px;
  }

  .floating-nav {
    bottom: calc(10px + env(safe-area-inset-bottom, 0px));
  }

  .floating-nav-toggle {
    width: 44px;
    height: 44px;
  }

  .floating-nav-panel {
    max-height: 70vh;
    overflow-y: auto;
  }
}

/* Pointer fine-tuning: hover effects only for real pointers */
@media (hover: none) {
  .button:hover,
  .icon-button:hover,
  .segmented button:hover,
  .floating-nav-link:hover,
  .summary-card:hover,
  .chip:hover {
    transform: none;
  }
}

/* ============================================
   Interaction polish layer
   Adds tactile press feedback, consistent focus rings,
   smoother color transitions, hover lift and entrance
   animations across the whole UI.
   ============================================ */

/* Remove default tap highlight; we render our own */
button,
a,
[role="button"],
input,
select,
textarea,
.summary-card,
.result-card,
.chip {
  -webkit-tap-highlight-color: transparent;
}

/* Smoother default transitions for the core interactive primitives */
.button,
.icon-button,
.segmented button,
.filter-toggle-btn,
.catalog-sort-select,
.catalog-active-chip,
.catalog-active-chip button,
.chip,
.summary-card,
.result-card,
.calendar-course-card {
  transition:
    background-color 140ms var(--ease-out-soft),
    border-color 140ms var(--ease-out-soft),
    color 140ms var(--ease-out-soft),
    box-shadow 160ms var(--ease-out-soft),
    opacity 140ms var(--ease-out-soft);
}

/* Tactile press feedback — subtle opacity dim only (no scale) */
.button:active,
.icon-button:active,
.segmented button:active,
.filter-toggle-btn:active,
.catalog-active-chip button:active,
.floating-nav-link:active,
.floating-nav-toggle:active,
.section-remove-btn:active,
.chip:not([disabled]):active {
  opacity: 0.85;
  transition-duration: 60ms;
}

/* Large panel-style buttons: press feedback via background only (scale would shrink the whole panel) */
.course-search-launch:active {
  background: var(--teal-soft);
  color: var(--teal);
}

/* Consistent focus rings (keyboard navigation) */
.button:focus-visible,
.icon-button:focus-visible,
.segmented button:focus-visible,
.filter-toggle-btn:focus-visible,
.catalog-active-chip button:focus-visible,
.chip:focus-visible,
.floating-nav-link:focus-visible,
.floating-nav-toggle:focus-visible,
.plan-auto-btn:focus-visible,
.plan-auto-btn-top:focus-visible,
.course-search-launch:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
  border-color: var(--teal);
}

/* Form inputs: soft teal focus glow */
.field input:focus-visible,
.field select:focus-visible,
.field textarea:focus-visible,
.search-field input:focus-visible,
.catalog-search-shell input:focus-visible,
.catalog-sort-select:focus-within {
  outline: none;
  border-color: var(--teal);
  box-shadow: var(--focus-ring);
}

/* Result + summary card lift on hover (pointer devices only) */
@media (hover: hover) {
  .result-card:hover {
    border-color: rgba(15, 118, 110, 0.28);
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.05);
  }

  .summary-card:hover {
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.05);
  }
}

/* Sort chevron flips when the select is focused */
.catalog-sort-select:focus-within .catalog-sort-chevron {
  transform: translateY(-50%) rotate(180deg);
  transition: transform 200ms var(--ease-out-soft);
}

/* Catalog search overlay: simple fade */
@keyframes overlayFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes shellSlideIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

.catalog-search-overlay:not([hidden]) {
  animation: overlayFadeIn 160ms var(--ease-out-soft);
}

.catalog-search-overlay:not([hidden]) .catalog-search-shell {
  animation: shellSlideIn 200ms var(--ease-out-soft);
}

/* Empty state fade-in */
@keyframes fadeUpIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

.empty-state {
  animation: fadeUpIn 200ms var(--ease-out-soft);
}

/* Skeleton/loading shimmer (for any element with .is-loading) */
@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

.is-loading {
  background: linear-gradient(
    90deg,
    rgba(217, 224, 232, 0.4) 25%,
    rgba(217, 224, 232, 0.7) 50%,
    rgba(217, 224, 232, 0.4) 75%
  );
  background-size: 200% 100%;
  animation: shimmer 1400ms linear infinite;
  color: transparent;
  border-color: transparent;
}

/* Ensure ripple sits below text content of buttons */
.button > *,
.icon-button > *,
.segmented button > *,
.filter-toggle-btn > *,
.floating-nav-toggle > * {
  position: relative;
  z-index: 1;
}

/* Touch devices: disable transform-on-hover, keep press feedback */
@media (hover: none) {
  .summary-card:hover {
    transform: none;
  }
}

/* Respect users who prefer reduced motion */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}
