:root {
  --saints-blue: #003366;
  --campus-blue: #1578c1;
  --gold: #f4bb33;
  --charcoal: #444444;
  --silver: #cccccc;
  --mist: #f4f8fb;
  --line: #d9e4ec;
  --ink: #1f2f3d;
  --muted: #627386;
  --success: #217a4b;
  --surface: #ffffff;
  --shadow: 0 18px 45px rgba(0, 51, 102, 0.1);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  background:
    linear-gradient(180deg, rgba(0, 51, 102, 0.06), transparent 300px),
    var(--mist);
  color: var(--ink);
  font-family: Gantari, Arial, sans-serif;
}

.skip-link {
  position: fixed;
  top: 14px;
  left: 18px;
  z-index: 300;
  transform: translateY(-140%);
  min-height: 44px;
  border: 1px solid #b9c9d7;
  border-radius: 8px;
  background: #ffffff;
  color: var(--saints-blue);
  padding: 10px 14px;
  font-weight: 800;
  text-decoration: none;
  box-shadow: 0 16px 32px rgba(0, 35, 70, 0.14);
  transition: transform 0.16s ease;
}

.skip-link:focus {
  transform: translateY(0);
  outline: 3px solid rgba(21, 120, 193, 0.24);
  outline-offset: 3px;
}

button,
input,
select {
  font: inherit;
}

.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 18px clamp(18px, 4vw, 44px);
  background: var(--saints-blue);
  color: white;
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand-mark {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border: 2px solid rgba(255, 255, 255, 0.78);
  font-weight: 800;
}

.brand p,
.brand h1 {
  margin: 0;
}

.brand p {
  color: rgba(255, 255, 255, 0.74);
  font-size: 0.84rem;
  font-weight: 600;
}

.brand h1 {
  font-size: clamp(1.45rem, 3vw, 2.1rem);
  letter-spacing: 0;
}

.source-chip {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 0 12px;
  border: 1px solid rgba(21, 120, 193, 0.18);
  border-radius: 999px;
  background: rgba(21, 120, 193, 0.08);
  color: #003366;
  font-size: 0.8rem;
  font-weight: 750;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

main {
  width: min(1280px, calc(100% - 32px));
  margin: 0 auto;
  padding: 18px 0 56px;
  scroll-margin-top: 120px;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(300px, 0.75fr);
  gap: 20px;
  align-items: stretch;
  margin-bottom: 18px;
  border-bottom: 6px solid var(--gold);
  padding: 28px 42px;
  background: linear-gradient(135deg, rgba(0, 51, 102, 0.98), rgba(21, 120, 193, 0.9));
  box-shadow: var(--shadow);
}

.hero-panel,
.toolbar,
.summary-grid article,
.table-shell,
.detail-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.hero-copy {
  display: grid;
  align-content: center;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--campus-blue);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1,
h2,
h3 {
  color: var(--saints-blue);
  font-weight: 850;
  letter-spacing: 0;
}

.hero .eyebrow {
  color: var(--gold);
}

.hero-panel .eyebrow {
  color: var(--saints-blue);
}

.hero h1 {
  max-width: 780px;
  margin-bottom: 10px;
  color: #ffffff;
  font-size: clamp(2.35rem, 4vw, 4rem);
  line-height: 1;
}

.lead {
  max-width: 760px;
  margin: 0;
  color: rgba(255, 255, 255, 0.86);
  font-size: 1rem;
  line-height: 1.45;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 12px;
}

.hero-actions span {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 8px;
  padding: 6px 10px;
  color: #ffffff;
  font-size: 0.93rem;
  font-weight: 750;
}

.hero-panel {
  display: grid;
  align-content: start;
  gap: 9px;
  min-height: 240px;
  padding: 22px 24px;
}

.hero-panel strong {
  color: var(--saints-blue);
  font-size: 1.45rem;
  line-height: 1.08;
}

.hero-panel > span {
  color: var(--muted);
  line-height: 1.5;
}

.mini-metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 6px;
}

.mini-metrics div {
  display: grid;
  gap: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 11px 12px;
  background: #eef4f8;
}

.mini-metrics b {
  color: var(--saints-blue);
  font-size: 1.65rem;
  line-height: 1;
}

.mini-metrics span {
  color: #526678;
  line-height: 1.2;
}

.hero-form {
  display: grid;
  gap: 14px;
  margin-top: 4px;
  border-top: 1px solid var(--line);
  padding-top: 14px;
}

label {
  display: grid;
  gap: 7px;
}

label span {
  color: var(--saints-blue);
  font-size: 0.82rem;
  font-weight: 800;
}

input,
select {
  width: 100%;
  min-height: 44px;
  border: 1px solid #b9c9d7;
  border-radius: 8px;
  background: white;
  color: var(--ink);
  padding: 10px 12px;
}

input:focus,
select:focus {
  border-color: var(--campus-blue);
  outline: 3px solid rgba(21, 120, 193, 0.18);
}

button {
  min-height: 44px;
  border: 0;
  border-radius: 8px;
  background: var(--campus-blue);
  color: white;
  cursor: pointer;
  font-weight: 800;
}

button:hover {
  background: #0f6ba8;
}

.hero-form .sf-term-control__submit {
  background: var(--gold);
  color: var(--saints-blue);
}

.hero-form .sf-term-control__submit:hover {
  background: #efb41c;
}

.toolbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  align-items: end;
  margin-bottom: 18px;
  padding: 16px;
}

.command-surface {
  background: linear-gradient(180deg, #ffffff, #f8fbfd);
}

.command-main {
  min-width: 0;
}

.search-command {
  display: grid;
  grid-template-columns: minmax(280px, 1fr) minmax(220px, 300px);
  align-items: center;
  border: 1px solid #b9c9d7;
  border-radius: 8px;
  background: #ffffff;
  padding: 6px;
}

.search-command:focus-within {
  border-color: var(--campus-blue);
  outline: 3px solid rgba(21, 120, 193, 0.18);
}

.search-command input {
  min-height: 50px;
  border: 0;
  border-radius: 6px;
  padding: 10px 14px;
  font-size: 1.06rem;
}

.search-command input:focus {
  outline: 0;
}

.search-command__filter {
  min-width: 0;
  border-left: 1px solid #d8e4ed;
  padding-left: 6px;
}

.search-command__filter .sf-select-menu {
  min-width: 0;
}

.search-command__filter .sf-select-menu__button {
  min-height: 50px;
  border-color: transparent;
  background: #f6fbff;
}

.search-command__filter .sf-select-menu__button:hover {
  background: #eaf5fc;
}

.status-toggle {
  display: inline-flex;
  gap: 4px;
  align-items: center;
  min-height: 64px;
  margin: 0;
  border: 1px solid #c7d8e5;
  border-radius: 8px;
  background: #eef5fa;
  padding: 4px;
}

.status-toggle legend {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.status-toggle button {
  min-height: 52px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: var(--saints-blue);
  padding: 6px 12px;
  font-size: 0.9rem;
  font-weight: 800;
}

.status-toggle button:hover {
  background: rgba(21, 120, 193, 0.09);
}

.status-toggle button.selected {
  border-color: #bdd3e4;
  background: #ffffff;
  box-shadow: 0 4px 10px rgba(0, 51, 102, 0.08);
}

.view-tabs {
  display: inline-flex;
  gap: 8px;
  margin-bottom: 18px;
  border: 1px solid #c7d8e5;
  border-radius: 999px;
  background: #eef5fa;
  padding: 4px;
}

.view-tabs button {
  min-height: 42px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: transparent;
  color: var(--saints-blue);
  padding: 8px 16px;
  font-size: 0.92rem;
  font-weight: 800;
}

.view-tabs button:hover {
  background: rgba(21, 120, 193, 0.08);
}

.view-tabs button.selected {
  border-color: #bdd3e4;
  background: #ffffff;
  box-shadow: 0 4px 10px rgba(0, 51, 102, 0.08);
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 18px;
}

.summary-grid article {
  padding: 18px;
}

.summary-grid span {
  display: block;
  color: var(--saints-blue);
  font-size: 1.8rem;
  font-weight: 800;
}

.summary-grid p {
  margin: 4px 0 0;
  color: var(--muted);
  font-weight: 700;
}

.insights-shell {
  display: grid;
  gap: 18px;
}

.insights-header {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
}

.insights-header h2,
.insights-header p {
  margin: 0;
}

.insights-header h2 {
  color: var(--saints-blue);
  font-size: 1.35rem;
}

#insightsScope {
  max-width: 580px;
  color: var(--muted);
  font-weight: 700;
  text-align: right;
}

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

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

.insight-panel {
  min-width: 0;
  border: 1px solid #d7e3ed;
  border-radius: 8px;
  background: linear-gradient(180deg, #ffffff, #f8fbfd);
  padding: 20px;
  box-shadow: 0 8px 18px rgba(0, 51, 102, 0.055);
}

.insight-panel--full {
  grid-column: 1 / -1;
}

.insight-panel__header {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.insight-panel__header h3,
.insight-panel__header p {
  margin: 0;
}

.insight-panel__header h3 {
  color: var(--saints-blue);
  font-size: 1.08rem;
}

.insight-panel__header > p {
  max-width: 280px;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 700;
  text-align: right;
}

.distribution-list,
.bar-list,
.insight-list {
  display: grid;
  gap: 12px;
}

.bar-row {
  display: grid;
  gap: 8px;
}

.bar-row__meta {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.bar-row__meta strong,
.insight-list__item strong {
  color: var(--ink);
  font-weight: 800;
}

.bar-row__meta span,
.insight-list__item span {
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 800;
  text-align: right;
}

.bar-track {
  overflow: hidden;
  height: 10px;
  border-radius: 999px;
  background: #eaf1f6;
}

.bar-fill {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--campus-blue), #74b5e4);
}

.insight-list__item {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 14px;
  border-top: 1px solid #e4edf4;
  padding-top: 12px;
}

.insight-list__item:first-child {
  border-top: 0;
  padding-top: 0;
}

.insight-list__item p {
  margin: 4px 0 0;
  color: var(--muted);
  font-weight: 700;
  line-height: 1.35;
}

.insight-empty {
  margin: 0;
  color: var(--muted);
  font-weight: 700;
}

.table-shell {
  overflow: hidden;
}

.table-header {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 22px;
  border-bottom: 1px solid var(--line);
}

.table-header h3,
.table-header p {
  margin: 0;
}

.table-header h3 {
  color: var(--saints-blue);
  font-size: 1.35rem;
}

#statusText {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-weight: 700;
  text-align: right;
}

.list-actions {
  display: grid;
  gap: 6px;
  justify-items: end;
}

#resetFilters {
  min-height: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--campus-blue);
  padding: 0;
  cursor: pointer;
  font-size: 0.86rem;
  font-weight: 800;
  text-decoration: underline;
  text-decoration-color: rgba(21, 120, 193, 0.28);
  text-underline-offset: 3px;
}

#resetFilters:hover,
#resetFilters:focus-visible {
  background: transparent;
  color: var(--saints-blue);
  text-decoration-color: var(--gold);
}

#resetFilters:focus-visible {
  outline: 3px solid rgba(21, 120, 193, 0.18);
  outline-offset: 3px;
}

.spinner {
  width: 16px;
  height: 16px;
  border: 2px solid #cfe0ec;
  border-top-color: var(--campus-blue);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.course-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  padding: 18px;
  background: #f8fbfd;
}

.course-card {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(460px, 48%);
  gap: 18px;
  align-items: start;
  min-height: 108px;
  border: 1px solid #d7e3ed;
  border-left: 4px solid var(--campus-blue);
  border-radius: 8px;
  background: var(--surface);
  padding: 14px 16px;
  box-shadow: 0 8px 18px rgba(0, 51, 102, 0.055);
}

.course-section-panel {
  display: grid;
  gap: 8px;
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid #e4edf4;
}

.course-section-panel__header {
  display: flex;
  align-items: baseline;
  gap: 6px;
}

.course-section-panel__header span {
  color: var(--saints-blue);
  font-size: 0.95rem;
  font-weight: 900;
}

.course-section-panel__header p,
.section-empty {
  margin: 0;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
}

.section-list {
  display: grid;
  grid-auto-rows: minmax(38px, auto);
  align-content: start;
  max-height: 220px;
  gap: 6px;
  overflow: auto;
  padding-right: 4px;
}

.section-list--modal {
  max-height: none;
  overflow: visible;
  padding-right: 0;
}

.section-modal-trigger {
  display: grid;
  width: 100%;
  gap: 3px;
  border: 1px solid #dbe7ef;
  border-radius: 8px;
  background: #f8fbfd;
  color: inherit;
  padding: 10px 12px;
  text-align: left;
  cursor: pointer;
}

.section-modal-trigger:hover,
.section-modal-trigger:focus-visible {
  border-color: #bdd3e4;
  background: #ffffff;
}

.section-modal-trigger:focus-visible {
  outline: 3px solid rgba(21, 120, 193, 0.18);
  outline-offset: 2px;
}

.section-modal-trigger__label {
  color: var(--saints-blue);
  font-size: 0.88rem;
  font-weight: 900;
}

.section-modal-trigger__hint {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
}

.section-row {
  min-height: 38px;
  border: 1px solid #dbe7ef;
  border-radius: 6px;
  background: #f8fbfd;
  overflow: hidden;
}

.section-toggle {
  width: 100%;
  border: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
  padding: 0;
  text-align: left;
}

.section-toggle:hover {
  background: transparent;
  color: inherit;
}

.section-toggle:focus-visible {
  background: transparent;
  color: inherit;
  outline: 3px solid rgba(21, 120, 193, 0.18);
  outline-offset: -3px;
}

.section-toggle__content {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  min-height: 38px;
  padding: 7px 10px;
}

.section-badge {
  color: var(--saints-blue);
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.section-term {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
}

.section-chevron {
  width: 8px;
  height: 8px;
  flex: 0 0 auto;
  margin-left: auto;
  border-right: 2px solid var(--campus-blue);
  border-bottom: 2px solid var(--campus-blue);
  transform: rotate(45deg);
  transition: transform 0.16s ease;
}

.section-row.expanded .section-chevron {
  transform: rotate(225deg);
}

.section-row__details {
  display: grid;
  gap: 5px;
  border-top: 1px solid #dbe7ef;
  background: #ffffff;
  padding: 8px 10px 10px;
}

.section-row__meta,
.section-row__schedule {
  margin: 0;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
  line-height: 1.35;
}

.section-row__meta,
.section-row__schedule {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 12px;
}

.section-row__schedule {
  justify-content: flex-start;
  text-align: left;
}

.section-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(23, 33, 43, 0.36);
  backdrop-filter: blur(8px);
}

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

.section-modal {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 16px;
  width: min(760px, 100%);
  max-height: min(82vh, 900px);
  border: 1px solid #d7e3ed;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.98);
  padding: 20px;
  box-shadow: 0 24px 50px rgba(0, 51, 102, 0.16);
}

.section-modal__header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: start;
}

.section-modal__header h2,
.section-modal__header p {
  margin: 0;
}

.section-modal__header h2 {
  color: var(--saints-blue);
  font-size: 1.2rem;
}

.section-modal__subtitle {
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 700;
  line-height: 1.35;
}

.section-modal__close {
  display: inline-grid;
  place-items: center;
  width: 44px;
  min-width: 44px;
  height: 44px;
  min-height: 44px;
  border: 1px solid #d7e3ed;
  border-radius: 999px;
  background: #f8fbfd;
  color: var(--muted);
  padding: 0;
  cursor: pointer;
  font: inherit;
  font-weight: 800;
  font-size: 1.35rem;
  line-height: 1;
}

.section-modal__close:hover,
.section-modal__close:focus-visible {
  border-color: #bdd3e4;
  color: var(--saints-blue);
  background: #ffffff;
}

.section-modal__close:focus-visible {
  outline: 3px solid rgba(21, 120, 193, 0.18);
  outline-offset: 2px;
}

.section-modal__body {
  display: grid;
  overflow: auto;
  padding-right: 4px;
}

body.modal-open {
  overflow: hidden;
}

.course-card-main {
  min-width: 0;
}

.course-line {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-bottom: 4px;
}

.course-title {
  color: var(--ink);
  font-size: 1.02rem;
  font-weight: 800;
  line-height: 1.25;
}

.course-code {
  color: var(--saints-blue);
  font-weight: 800;
  white-space: nowrap;
}

.course-link,
.detail-course-code {
  position: relative;
  display: inline-block;
  width: fit-content;
  color: var(--saints-blue);
  font-weight: 900;
  text-decoration: none;
}

.course-link {
  font-size: 1.1rem;
  line-height: 1;
  white-space: nowrap;
}

.detail-course-code {
  margin: 0;
  color: #ffffff;
  font-size: clamp(1.8rem, 3.1vw, 2.5rem);
  line-height: 1.02;
}

.course-link::after,
.detail-course-code::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -6px;
  width: min(100%, 7rem);
  height: 3px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--gold), rgba(244, 187, 51, 0.18));
}

.course-link:hover,
.course-link:focus-visible {
  color: inherit;
}

.course-link:focus-visible,
.detail-back-link:focus-visible {
  outline: 3px solid rgba(21, 120, 193, 0.18);
  outline-offset: 3px;
}

.course-type {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  border: 1px solid #c8d8e5;
  border-radius: 999px;
  padding: 1px 8px;
  background: #f8fbfd;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 800;
}

.course-description-wrap {
  margin-top: 4px;
}

.course-description {
  color: var(--muted);
  line-height: 1.35;
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.course-description-wrap.expanded .course-description {
  display: block;
  overflow: visible;
  -webkit-line-clamp: unset;
}

.description-toggle {
  display: inline-flex;
  margin-left: auto;
  min-height: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--campus-blue);
  padding: 4px 0 0;
  cursor: pointer;
  font: inherit;
  font-size: 0.86rem;
  font-weight: 800;
}

.description-toggle:hover,
.description-toggle:focus-visible {
  background: transparent;
  color: var(--saints-blue);
}

.description-toggle:focus-visible {
  outline: 3px solid rgba(21, 120, 193, 0.18);
  outline-offset: 3px;
}

.course-details {
  display: grid;
  min-height: 78px;
  grid-template-rows: 1fr auto;
  gap: 10px;
  align-items: stretch;
  justify-items: end;
  padding-left: 18px;
  border-left: 1px solid #e4edf4;
  min-width: 0;
}

.course-meta {
  display: grid;
  width: 100%;
  grid-template-columns: 1fr;
  align-items: start;
  margin: 0;
  min-width: 0;
}

.course-meta div {
  min-width: 0;
}

.course-meta dt {
  margin-bottom: 4px;
  color: var(--saints-blue);
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
}

.course-meta dd {
  margin: 0;
  color: var(--charcoal);
  font-weight: 700;
  line-height: 1.25;
}

.department-link {
  display: inline;
  min-height: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--campus-blue);
  padding: 0;
  cursor: pointer;
  font: inherit;
  font-weight: 800;
  text-align: left;
  text-decoration: underline;
  text-decoration-color: rgba(21, 120, 193, 0.28);
  text-underline-offset: 3px;
}

.department-link:hover,
.department-link:focus-visible {
  background: transparent;
  color: var(--saints-blue);
  text-decoration-color: var(--gold);
}

.department-link:focus-visible {
  outline: 3px solid rgba(21, 120, 193, 0.18);
  outline-offset: 3px;
}

.term-corner {
  max-width: 100%;
  color: var(--saints-blue);
  font-weight: 800;
  line-height: 1.2;
  text-align: right;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.no-wrap {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.flag-area {
  display: grid;
  justify-items: end;
}

.flag-list {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.tag {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  border-radius: 999px;
  padding: 3px 10px;
  background: #eef4f8;
  color: #526678;
  font-size: 0.82rem;
  font-weight: 800;
}

.tag.active {
  background: rgba(33, 122, 75, 0.09);
  color: #3f7058;
}

.tag.signal {
  background: rgba(244, 187, 51, 0.16);
  color: #7a6223;
}

.empty-state {
  padding: 28px;
  color: var(--muted);
  font-weight: 800;
  text-align: center;
}

.detail-shell {
  display: grid;
  gap: 18px;
}

.detail-course-line {
  margin-bottom: 0;
}

.detail-back-link {
  width: fit-content;
  color: rgba(255, 255, 255, 0.92);
  font-size: 0.86rem;
  font-weight: 800;
  text-decoration: underline;
  text-decoration-color: rgba(244, 187, 51, 0.5);
  text-underline-offset: 3px;
}

.detail-hero {
  margin-bottom: 0;
}

.detail-hero-copy {
  gap: 0;
}

.detail-title {
  margin: 0 0 12px;
  color: #ffffff;
  font-size: clamp(1.8rem, 3.2vw, 2.8rem);
  line-height: 1.1;
}

.detail-description {
  margin: 0;
  color: rgba(255, 255, 255, 0.84);
  font-size: 1rem;
  line-height: 1.55;
  max-width: 860px;
}

.detail-hero-actions {
  margin-top: 18px;
}

.detail-hero-panel {
  box-shadow: var(--shadow);
}

.detail-facts {
  display: grid;
  gap: 10px;
  margin-top: 4px;
}

.detail-facts div {
  display: grid;
  gap: 4px;
  border-top: 1px solid #e4edf4;
  padding-top: 10px;
}

.detail-facts span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.detail-facts strong {
  color: var(--saints-blue);
  font-size: 0.98rem;
  line-height: 1.3;
}

.detail-panel {
  padding: 20px;
}

.detail-panel__header {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: end;
  padding-bottom: 14px;
  border-bottom: 1px solid #e4edf4;
}

.detail-panel__header h3,
.detail-panel__header p {
  margin: 0;
}

.detail-panel__header h3 {
  color: var(--saints-blue);
  font-size: 1.15rem;
}

.detail-status-text {
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 700;
}

.detail-section-list {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.detail-section-card {
  display: grid;
  gap: 10px;
  border: 1px solid #dbe7ef;
  border-radius: 8px;
  background: #f8fbfd;
  padding: 14px;
}

.detail-section-card__header {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.detail-section-card__badge {
  color: var(--saints-blue);
  font-size: 0.84rem;
  font-weight: 900;
  text-transform: uppercase;
}

.detail-section-card__term {
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 800;
}

.detail-section-card__meta,
.detail-section-card__schedule {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 12px;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 700;
  line-height: 1.45;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
  }

  .skip-link,
  .spinner,
  .section-chevron {
    animation: none !important;
    transition: none !important;
  }
}

@media (max-width: 860px) {
  .app-header,
  .table-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .hero,
  .summary-grid,
  .insight-grid {
    grid-template-columns: 1fr;
  }

  .hero {
    padding: 22px 20px;
  }

  .toolbar,
  .command-main {
    grid-template-columns: 1fr;
  }

  .search-command {
    grid-template-columns: 1fr;
  }

  .search-command__filter {
    border-top: 1px solid #d8e4ed;
    border-left: 0;
    padding-top: 6px;
    padding-left: 0;
  }

  .status-toggle {
    justify-content: stretch;
    width: 100%;
  }

  .status-toggle button {
    flex: 1;
  }

  .insights-header,
  .insight-panel__header {
    align-items: start;
    flex-direction: column;
  }

  #insightsScope,
  .insight-panel__header > p {
    max-width: none;
    text-align: left;
  }

  .course-card {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .course-details {
    grid-template-columns: 1fr;
    grid-template-rows: auto;
    justify-items: start;
    padding: 12px 0 0;
    border-top: 1px solid #e4edf4;
    border-left: 0;
  }

  .course-meta {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .flag-area {
    justify-items: start;
  }

  .term-corner {
    text-align: left;
  }

  .flag-list {
    justify-content: flex-start;
  }

  .section-row__schedule {
    justify-content: flex-start;
    text-align: left;
  }

  #statusText {
    text-align: left;
  }

  .detail-panel__header {
    align-items: start;
    flex-direction: column;
  }

  .detail-course-line {
    align-items: flex-start;
    gap: 10px;
  }

  .section-modal {
    width: min(680px, 100%);
  }
}

@media (max-width: 560px) {
  main {
    width: min(100% - 24px, 1280px);
  }

  .view-tabs {
    width: 100%;
  }

  .view-tabs button {
    flex: 1;
  }

  .section-modal-backdrop {
    padding: 12px;
  }

  .section-modal {
    max-height: calc(100vh - 24px);
    padding: 16px;
  }

  .section-modal__header {
    align-items: stretch;
    flex-direction: column;
  }

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

  .no-wrap {
    white-space: normal;
  }

  .insights-summary {
    grid-template-columns: 1fr;
  }
}
