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

:root {
  /* Color Tokens */
  --primary: #1B3A6B;
  --primary-dark: #122848;
  --accent: #9B1D20;
  --gold: #B8960C;
  --gold-light: #D4AF37;
  --bg: #F7F4EF;
  --bg-card: #FFFFFF;
  --bg-muted: #EDE9E1;
  --text-primary: #1A1A2E;
  --text-secondary: #4A4A6A;
  --text-muted: #8A8AA0;
  --border: #D6CFC4;
  --border-gold: #B8960C;
  --success: #2D6A4F;
  --warning: #A05C00;
  --danger: #9B1D20;

  /* Typography */
  --font-display: 'Cormorant Garamond', serif;
  --font-body: 'Inter', sans-serif;

  /* Scale */
  --text-hero: clamp(2rem, 4vw, 3.5rem);
  --text-h1: clamp(1.5rem, 3vw, 2.25rem);
  --text-h2: 1.5rem;
  --text-h3: 1.125rem;
  --text-body: 0.9375rem;
  --text-sm: 0.8125rem;
  --text-xs: 0.6875rem;
}

body.dark-theme {
  --primary: #2C5282; /* Brighter Sapphire */
  --primary-dark: #1A365D; /* Darker Navy for backgrounds */
  --accent: #E53E3E; /* Brighter Crimson */
  --gold: #D69E2E; /* Richer Gold */
  --gold-light: #F6E05E;
  --bg: #0B1120; /* Deep Obsidian */
  --bg-card: #151F32; /* Dark Sapphire */
  --bg-muted: #1E293B; /* Slate */
  --text-primary: #F8FAFC;
  --text-secondary: #94A3B8;
  --text-muted: #64748B;
  --border: #334155;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  background: var(--bg);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: var(--text-body);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  transition: background-color 0.3s ease, color 0.3s ease;
}

/* ── Typography Utilities ── */
.t-display { font-family: var(--font-display); }
.t-body { font-family: var(--font-body); }
.text-muted { color: var(--text-muted); }
.text-secondary { color: var(--text-secondary); }
.text-primary { color: var(--primary); }

/* ── Layout Architecture ── */
.app { display: flex; flex-direction: column; min-height: 100vh; }

/* ── Entry Page ── */
.entry {
  position: fixed; inset: 0; z-index: 1000;
  background: var(--primary-dark);
  color: #fff;
  display: flex; flex-direction: column;
  justify-content: center;
  padding: 4rem;
  overflow: hidden;
  transition: opacity 0.6s ease, transform 0.6s ease, background-color 0.3s ease;
  background-image: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 100%);
}
.entry::before {
  content: ''; position: absolute; inset: 0;
  background-image: repeating-linear-gradient(45deg, rgba(255,255,255,0.02) 0, rgba(255,255,255,0.02) 1px, transparent 1px, transparent 10px);
  pointer-events: none;
}
.entry.is-exiting { opacity: 0; transform: scale(1.02); }
.entry__content { position: relative; z-index: 1; max-width: 800px; animation: entryReveal 1s ease; }
@keyframes entryReveal { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }

.entry__top-bar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 2rem; max-width: 500px; }
.entry__badge {
  display: inline-flex; align-items: center; gap: 0.6rem;
  font-family: var(--font-body); font-size: 0.65rem; font-weight: 600; letter-spacing: 0.15em;
  color: #fff; padding: 0.4rem 1rem;
  background: rgba(255,255,255,0.1); border-radius: 999px;
}
.entry__badge--outline { background: transparent; border: 1px solid rgba(255,255,255,0.3); }
.entry__dot { width: 6px; height: 6px; border-radius: 50%; background: var(--gold); }

.entry__kicker {
  font-family: var(--font-body); font-size: 0.75rem; letter-spacing: 0.2em;
  color: var(--gold); margin-bottom: 0.5rem; text-transform: uppercase;
}
.entry__title {
  font-family: var(--font-display); font-size: 8rem; font-weight: 700;
  letter-spacing: 0.05em; line-height: 0.9; margin-bottom: 0.5rem;
  text-shadow: 0 10px 30px rgba(0,0,0,0.3);
}
.entry__subtitle {
  font-family: var(--font-body); font-size: 1rem; color: rgba(255,255,255,0.7);
  letter-spacing: 0.05em; margin-bottom: 3rem;
}

.rec-card__warning {
  background: rgba(153, 27, 27, 0.1);
  color: var(--accent);
  border: 1px solid rgba(153, 27, 27, 0.2);
  padding: 0.5rem;
  font-size: var(--text-xs);
  margin-top: 1rem;
  border-radius: 4px;
}

/* Restored Detailed Blocks */
.comp-profile { margin-top: 1rem; padding-top: 1rem; border-top: 1px solid var(--border); }
.comp-profile__row { display: flex; justify-content: space-between; font-size: 0.8rem; margin-bottom: 0.3rem; }
.intensity-badge { display: inline-block; font-size: 0.65rem; font-weight: 600; padding: 0.1rem 0.4rem; border-radius: 2px; margin-bottom: 0.5rem; }
.intensity-badge--low { background: rgba(16, 185, 129, 0.1); color: #10B981; border: 1px solid #10B981; }
.intensity-badge--moderate { background: rgba(245, 158, 11, 0.1); color: #F59E0B; border: 1px solid #F59E0B; }
.intensity-badge--high { background: rgba(239, 68, 68, 0.1); color: #EF4444; border: 1px solid #EF4444; }
.demand-badge--high { color: #10B981; }
.demand-badge--moderate { color: #F59E0B; }
.demand-badge--low { color: #EF4444; }
.role-tag { background: var(--bg-muted); color: var(--text-primary); transition: background-color 0.3s ease; }
.role-tag:hover { background: var(--border); }
.insight-block { border-radius: 4px; transition: background-color 0.3s ease; }
.pathway-row { border-bottom: 1px dashed var(--border); padding-bottom: 0.5rem; }
.pathway-row:last-child { border-bottom: none; }

.entry__stats {
  display: flex; align-items: center; gap: 0;
  border: 1px solid rgba(255,255,255,0.15);
  background: rgba(0,0,0,0.2);
  margin-bottom: 2rem;
  border-radius: 8px;
  max-width: 550px;
}
.entry__stat { padding: 1.5rem 2rem; text-align: left; flex: 1; }
.entry__stat-val {
  font-family: var(--font-display); font-size: 2.5rem; font-weight: 700;
  color: #fff; line-height: 1; margin-bottom: 0.5rem;
}
.entry__stat-label {
  font-family: var(--font-body); font-size: 0.6rem; letter-spacing: 0.15em;
  color: rgba(255,255,255,0.5); font-weight: 600;
}
.entry__stat-divider { width: 1px; height: 80px; background: rgba(255,255,255,0.15); }

.entry__cta { padding: 1.25rem 2.5rem; font-size: 0.85rem; letter-spacing: 0.15em; border-radius: 999px; background: var(--gold); color: #fff; display: inline-flex; width: auto; font-weight: 600; }
.entry__cta:hover { background: var(--gold-light); }

/* ── Mobile Directives ── */
.mobile-only { display: none !important; }

@media (max-width: 768px) {
  :root {
    --text-hero: clamp(1.75rem, 8vw, 2.25rem);
    --text-h1: clamp(1.375rem, 6vw, 1.75rem);
    --text-h2: 1.25rem;
    --text-h3: 1rem;
  }
  .mobile-only { display: block !important; }
  .desktop-only { display: none !important; }
  
  /* Global */
  html, body { overflow-x: hidden; width: 100%; }
  body { scroll-behavior: smooth; }
  .main-content { padding: 0 1rem; padding-bottom: 72px; overflow-x: hidden; max-width: 100%; box-sizing: border-box; }
  #dashboard { max-width: 100%; overflow-x: hidden; }
  .section-header { margin-top: 2rem; }
  
  /* Header */
  .header { position: sticky; top: 0; z-index: 100; height: 56px; padding: 0 1rem; overflow: hidden; }
  .header__brand { display: flex; align-items: center; }
  .header__title { font-size: 1.375rem; }
  
  /* Entry Page Mobile */
  .entry { padding: 2rem 1.5rem; }
  .entry__content { max-width: 100%; }
  .entry__top-bar { max-width: 100%; flex-wrap: wrap; gap: 0.5rem; margin-bottom: 1.5rem; }
  .entry__title { font-size: clamp(3.5rem, 18vw, 6rem); }
  .entry__subtitle { font-size: 0.875rem; margin-bottom: 2rem; }
  .entry__stats { max-width: 100%; flex-wrap: wrap; border-radius: 6px; }
  .entry__stat { padding: 1rem 1rem; min-width: 0; }
  .entry__stat-val { font-size: 1.75rem; }
  .entry__stat-label { font-size: 0.55rem; }
  .entry__stat-divider { height: 50px; }
  .entry__cta { padding: 1rem 2rem; font-size: 0.8rem; }

  /* Hero */
  .hero { padding: 3rem 1rem 2rem; }
  .hero__title { font-size: var(--text-hero); }
  .hero__sub { font-size: var(--text-sm); display: -webkit-box; -webkit-line-clamp: 2; line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
  
  /* Bottom Bar */
  #mobile-bottom-bar.mobile-only { display: flex !important; }
  #mobile-bottom-bar { position: fixed; bottom: 0; width: 100%; z-index: 99; background: var(--primary); border-top: 2px solid var(--gold); height: 52px; padding: 0 1rem; padding-bottom: env(safe-area-inset-bottom); justify-content: space-between; align-items: center; }
  .mobile-bottom-bar__pill { font-family: var(--font-body); font-weight: 600; font-size: var(--text-sm); color: #fff; }
  
  /* Recommendation Cards */
  .rec-grid { grid-template-columns: 1fr; }
  .rec-card { margin-bottom: 1.25rem; padding: 1.5rem; overflow-wrap: break-word; word-break: break-word; max-width: 100%; }
  .rec-card__program { font-size: var(--text-h2); }
  .rec-metrics { grid-template-columns: 1fr 1fr; }
  .rec-metric { padding: 0.625rem 0.5rem; }
  .rec-sources { white-space: normal; flex-wrap: wrap; padding-bottom: 0.5rem; }
  
  /* Comparative Summary */
  #comp-summary { max-width: 100%; overflow-x: hidden; }
  #comp-summary > div { margin-top: 1rem; padding: 1rem; max-width: 100%; box-sizing: border-box; overflow-wrap: break-word; }
  #comp-summary > div > div { grid-template-columns: 1fr !important; gap: 1rem !important; }
  
  /* Charts */
  .charts-grid { display: flex; flex-direction: column; gap: 2rem; max-width: 100%; overflow: hidden; }
  .chart-box { max-width: 100%; overflow: hidden; box-sizing: border-box; }
  .chart-wrap { height: 220px; width: 100%; max-width: 100%; overflow: hidden; }
  .chart-wrap canvas { max-width: 100% !important; }
  .chart-box__title { font-size: var(--text-h3); }
  #chartAcceptance-box { order: 1; }
  #chartTrend-box { order: 2; }
  #chartScores-box { order: 3; }
  #chartScatter-box { order: 4; }
  
  /* Data Table Mobile Cards */
  .table-wrap { background: transparent; border: none; box-shadow: none; overflow-x: hidden; max-width: 100%; }
  .table-wrap table, .table-wrap thead, .table-wrap tbody, .table-wrap th, .table-wrap td, .table-wrap tr { display: block; }
  .table-wrap thead { display: none; }
  .table-wrap tr { background: var(--bg-card); border: 1px solid var(--border); margin-bottom: 0.75rem; padding: 0.875rem; border-radius: 4px; box-shadow: 0 2px 4px rgba(0,0,0,0.02); transition: background-color 0.3s ease; }
  .table-wrap td { border: none; padding: 0.2rem 0; font-size: var(--text-sm); }
  .table-wrap td:first-child { display: none; } /* Hide rank num */
  .table-wrap td[data-col="name"] { font-family: var(--font-display); font-weight: 600; font-size: 1rem; color: var(--primary); display: flex; justify-content: space-between; align-items: center; }
  .table-wrap td[data-col="ease_score"] { font-family: var(--font-display); font-weight: 600; color: var(--gold); }
  .table-wrap td[data-col="faculty"] { font-family: var(--font-body); font-size: var(--text-xs); font-style: italic; color: var(--text-secondary); margin-bottom: 0.5rem; }
  .table-wrap .mobile-metric-row { display: flex; gap: 0.5rem; font-size: var(--text-xs); color: var(--text-muted); border-bottom: 1px dashed var(--border); padding-bottom: 0.5rem; margin-bottom: 0.5rem; }
  .table-wrap .mobile-bottom-row { display: flex; justify-content: space-between; align-items: center; }
}

/* Mobile Drawers & Overlays */
#mobile-drawer-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 1000; opacity: 0; pointer-events: none; transition: opacity 0.3s; }
#mobile-drawer-backdrop.active { opacity: 1; pointer-events: auto; }
#mobile-drawer { position: fixed; bottom: 0; left: 0; width: 100%; height: 50vh; background: var(--primary-dark); z-index: 1001; border-radius: 12px 12px 0 0; transform: translateY(100%); transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1); display: flex; flex-direction: column; }
#mobile-drawer.active { transform: translateY(0); }
.mobile-drawer__handle { width: 40px; height: 4px; background: rgba(255,255,255,0.3); border-radius: 2px; margin: 12px auto; }
.mobile-drawer__content { padding: 1rem; overflow-y: auto; flex: 1; }

.mobile-uni-card { padding: 1rem; border: 2px solid rgba(255,255,255,0.15); border-radius: 4px; color: #fff; text-align: left; background: transparent; cursor: pointer; transition: all 0.2s ease; }
.mobile-uni-card.active { border-color: var(--gold); background: rgba(184,150,12,0.1); }
.mobile-uni-card__title { font-family: var(--font-display); font-size: 1.125rem; font-weight: 600; margin-bottom: 0.2rem; }
.mobile-uni-card__sub { font-family: var(--font-body); font-size: var(--text-xs); color: rgba(255,255,255,0.6); text-transform: uppercase; letter-spacing: 0.05em; }

#chart-tooltip-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,0.3); z-index: 1000; opacity: 0; pointer-events: none; transition: opacity 0.2s; }
#chart-tooltip-backdrop.active { opacity: 1; pointer-events: auto; }
#chart-tooltip-sheet { position: fixed; bottom: 0; left: 0; width: 100%; max-height: 40vh; background: var(--bg-card); border-top: 2px solid var(--gold); z-index: 1001; transform: translateY(100%); transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1); box-shadow: 0 -4px 20px rgba(0,0,0,0.1); border-radius: 12px 12px 0 0; }
#chart-tooltip-sheet.active { transform: translateY(0); }
.chart-tooltip-sheet__content { padding: 1.5rem; overflow-y: auto; max-height: calc(40vh - 20px); color: var(--text-primary); }

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}

/* ── Data Archives ── */
#archives-body { max-height: 0; overflow: hidden; transition: max-height 0.4s ease; }
#archives-body.is-open { max-height: 5000px; }
#archives-arrow.is-open { transform: rotate(180deg); }

.src-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-top: 2px solid var(--gold);
  padding: 1rem;
  flex: 1 1 280px;
  max-width: 400px;
  transition: background-color 0.3s ease, border-color 0.3s ease;
}
.src-card__title {
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.25rem;
  display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap;
}
.src-card__meta {
  font-family: var(--font-body);
  font-size: var(--text-xs);
  color: var(--text-muted);
}
.src-card__link {
  display: inline-block;
  margin-top: 0.5rem;
  font-size: var(--text-xs);
  color: var(--primary);
  text-decoration: none;
  font-weight: 600;
}
.src-card__link:hover { text-decoration: underline; }

.src-badge {
  font-size: 0.6rem;
  padding: 0.1rem 0.4rem;
  border: 1px solid var(--border);
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.src-badge--official { border-color: var(--success); color: var(--success); }
.src-badge--affiliated { border-color: var(--warning); color: var(--warning); }

.reliability-dot {
  display: inline-block; width: 6px; height: 6px; border-radius: 50%;
}
.reliability-dot--high { background: var(--success); }
.reliability-dot--medium { background: var(--warning); }
.reliability-dot--low { background: var(--danger); }

.cite-links { display: flex; gap: 0.25rem; }
.cite-link {
  display: inline-flex; align-items: center; justify-content: center;
  width: 20px; height: 20px;
  font-size: 0.65rem; font-weight: 600;
  border: 1px solid var(--border);
  color: var(--primary);
  text-decoration: none;
  transition: all 0.2s;
}
.cite-link:hover { background: var(--primary); color: #fff; }

.main-content {
  max-width: 1280px;
  width: 100%;
  margin: 0 auto;
  padding: 0 2rem 4rem;
  flex: 1;
}

/* ── Header ── */
.header {
  background: var(--primary);
  width: 100%;
  border-bottom: 2px solid var(--gold);
  padding: 1rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: background-color 0.3s ease;
}
.header__brand { display: flex; flex-direction: column; }
.header__title {
  font-family: var(--font-display);
  font-size: 1.75rem;
  color: #fff;
  letter-spacing: 0.15em;
  line-height: 1.1;
}
.header__sub {
  font-family: var(--font-body);
  font-size: 0.75rem;
  color: rgba(255,255,255,0.6);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

/* ── Hero Section ── */
.hero {
  background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 100%);
  width: 100%;
  padding: 4rem 2rem;
  text-align: center;
  position: relative;
  transition: background 0.3s ease;
}
/* Optional watermark pattern */
.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: repeating-linear-gradient(45deg, rgba(255,255,255,0.05) 0, rgba(255,255,255,0.05) 1px, transparent 1px, transparent 10px);
  pointer-events: none;
}
.hero__content { position: relative; z-index: 1; }
.hero__title {
  font-family: var(--font-display);
  font-size: var(--text-hero);
  color: #fff;
  font-weight: 700;
  margin-bottom: 0.5rem;
}
.hero__sub {
  font-family: var(--font-body);
  font-size: var(--text-body);
  color: rgba(255,255,255,0.7);
  margin-bottom: 1.5rem;
}
.hero__rule {
  width: 60px;
  height: 2px;
  background: var(--gold);
  margin: 0 auto 1.5rem;
  border: none;
}
.hero__timestamp {
  font-family: var(--font-body);
  font-size: var(--text-xs);
  color: rgba(184, 150, 12, 0.8);
}

/* ── Section Headers ── */
.section-header {
  margin-top: 3rem;
  margin-bottom: 1.5rem;
}
.section-header__label {
  font-family: var(--font-body);
  font-size: var(--text-xs);
  color: var(--gold);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 0.25rem;
}
.section-header__title {
  font-family: var(--font-display);
  font-size: var(--text-h1);
  font-weight: 700;
  color: var(--primary);
  border-bottom: 2px solid var(--border-gold);
  padding-bottom: 0.5rem;
  letter-spacing: 0.02em;
}

/* ── University Selector ── */
.selector {
  margin-top: -2rem; /* Pull up into hero slightly or sit right below */
  position: relative;
  z-index: 10;
  margin-bottom: 2rem;
}
.selector__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
}
.selector__card {
  background: var(--bg-card);
  border: 2px solid var(--border);
  padding: 1.5rem 1rem;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s ease;
  border-radius: 0;
}
.selector__card:hover {
  border-color: var(--gold);
  background: var(--bg-muted);
}
.selector__card.is-active {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(184,150,12,0.2);
}
.selector__id {
  font-family: var(--font-display);
  font-size: var(--text-h3);
  font-weight: 600;
  color: var(--primary);
  display: block;
  margin-bottom: 0.25rem;
}
.selector__name {
  font-family: var(--font-body);
  font-size: var(--text-xs);
  color: var(--text-secondary);
  text-transform: uppercase;
  display: block;
}
.type-badge {
  font-family: var(--font-body);
  font-size: 0.6rem;
  padding: 0.1rem 0.4rem;
  border: 1px solid var(--border);
  color: var(--text-muted);
  margin-top: 0.5rem;
  display: inline-block;
}
.type-badge--d4 { border-color: var(--primary); color: var(--primary); }

/* ── Recommendation Cards ── */
.rec-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  margin-bottom: 2rem;
}
.rec-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 2px;
  box-shadow: 0 4px 24px rgba(27,58,107,0.08);
  position: relative;
  padding: 2rem;
  transition: background-color 0.3s ease, border-color 0.3s ease;
}
.rec-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 4px;
  background: var(--primary);
}
.rec-card.rank-1::before { background: var(--gold); }

.rec-card__rank {
  position: absolute;
  top: 1rem; right: 1rem;
  background: var(--primary);
  color: #fff;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: var(--text-xs);
  text-transform: uppercase;
  padding: 0.25rem 0.75rem;
  border-radius: 999px; /* The ONLY pill allowed is the rank badge per spec */
}
.rec-card__program {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: var(--text-h2);
  color: var(--primary);
  margin-bottom: 0.25rem;
  padding-right: 3rem;
}
.rec-card__faculty {
  font-family: var(--font-body);
  font-size: var(--text-sm);
  color: var(--text-secondary);
  font-style: italic;
  margin-bottom: 1.5rem;
}

.rec-metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-bottom: 1.5rem;
  border-top: 1px solid var(--border);
  padding-top: 1.5rem;
}
.rec-metric { display: flex; flex-direction: column; }
.rec-metric__label {
  font-family: var(--font-body);
  font-size: var(--text-xs);
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 0.25rem;
}
.rec-metric__val {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.5rem;
  color: var(--text-primary);
  line-height: 1;
}

.rec-insight {
  background: var(--bg-muted);
  border-left: 3px solid var(--gold);
  padding: 1rem;
  font-family: var(--font-body);
  font-size: var(--text-sm);
  color: var(--text-primary);
  margin-bottom: 1.5rem;
}

.rec-sources {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.source-chip {
  font-family: var(--font-body);
  font-size: var(--text-xs);
  color: var(--text-muted);
  border: 1px solid var(--border);
  padding: 0.2rem 0.5rem;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}
.source-chip::after {
  content: '\2197'; /* Arrow up right */
}

/* ── Data Table ── */
.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  background: var(--bg-card);
  border-radius: 0;
  box-shadow: 0 4px 24px rgba(27,58,107,0.04);
  transition: background-color 0.3s ease, border-color 0.3s ease;
}
table {
  width: 100%;
  border-collapse: collapse;
}
th {
  background: var(--primary);
  color: #fff;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: var(--text-sm);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 1rem;
  text-align: left;
  cursor: pointer;
  white-space: nowrap;
}
th.is-active { border-bottom: 3px solid var(--gold); }
th .sort-arrow { margin-left: 4px; font-size: 10px; }

td {
  padding: 0.875rem 1rem;
  font-family: var(--font-body);
  font-size: var(--text-sm);
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
tbody tr:nth-child(even) { background: var(--bg-muted); }
tbody tr:hover { background: rgba(27,58,107,0.04); }

.col-ease {
  font-family: var(--font-display);
  font-weight: 600;
  color: var(--primary);
  font-size: 1.1rem;
}
.col-program { color: var(--text-primary); font-weight: 500; }

.crowding-badge {
  padding: 0.25rem 0.5rem;
  font-size: var(--text-xs);
  font-weight: 500;
  text-transform: uppercase;
}
.crowding-badge--low { background: #D1FAE5; color: #065F46; }
.crowding-badge--moderate { background: #FEF3C7; color: #92400E; }
.crowding-badge--high { background: #FEE2E2; color: #991B1B; }

.trend-up { color: var(--danger); }
.trend-down { color: var(--success); }
.trend-flat { color: var(--text-muted); }

/* ── Charts ── */
.charts-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  margin-bottom: 3rem;
}
.chart-box {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-top: 2px solid var(--gold);
  padding: 1.5rem;
  box-shadow: 0 4px 24px rgba(27,58,107,0.06);
  transition: background-color 0.3s ease, border-color 0.3s ease;
}
.chart-box__title {
  font-family: var(--font-display);
  font-size: var(--text-h3);
  color: var(--primary);
  margin-bottom: 1rem;
  font-weight: 600;
}
.chart-wrap { position: relative; height: 300px; }

/* ── Buttons ── */
.btn {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: var(--text-sm);
  padding: 0.625rem 1.5rem;
  border-radius: 2px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
}
.btn--primary {
  background: var(--primary);
  color: #fff;
}
.btn--primary:hover { background: var(--primary-dark); }

.btn--gold {
  background: var(--gold);
  color: #fff;
}
.btn--gold:hover { background: var(--gold-light); }

.btn--ghost {
  background: transparent;
  border: 1.5px solid var(--primary);
  color: var(--primary);
}
.btn--ghost:hover {
  background: rgba(27,58,107,0.05);
}

/* ── Utilities ── */
.hr-gold {
  border: none;
  border-top: 1px solid var(--border-gold);
  opacity: 0.4;
  margin: 3rem 0;
}
.hidden { display: none !important; }

/* ── Footer ── */
.footer {
  background: var(--primary-dark);
  border-top: 3px solid var(--gold);
  padding: 3rem 2rem;
  color: rgba(255,255,255,0.7);
  font-family: var(--font-body);
}
.footer__grid {
  max-width: 1280px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 2fr 1fr;
  gap: 2rem;
}
.footer__brand {
  font-family: var(--font-display);
  font-size: 1.5rem;
  color: #fff;
  margin-bottom: 0.5rem;
}
.footer__text { font-size: var(--text-xs); line-height: 1.6; }
.footer__disclaimer {
  font-size: var(--text-xs);
  color: rgba(255,255,255,0.5);
}

/* ── Mobile Responsive ── */
@media(max-width: 900px) {
  .rec-grid, .charts-grid { grid-template-columns: 1fr; }
  .footer__grid { grid-template-columns: 1fr; }
}
@media(max-width: 600px) {
  .header { padding: 0.5rem 1rem; }
  .hero { padding: 3rem 1rem; }
  .rec-metrics { grid-template-columns: 1fr 1fr; }
  .main-content { padding: 0 1rem 3rem; }
}

/* ── Comparative Summary ── */
.comp-summary__title {
  font-family: var(--font-display); font-size: var(--text-h2);
  font-weight: 700; color: var(--primary); margin-bottom: 1rem;
  border-bottom: 2px solid var(--border-gold); padding-bottom: 0.5rem;
}
.comp-summary__row {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 1.5rem; margin-bottom: 1rem;
}
.comp-summary__label {
  font-family: var(--font-body); font-size: var(--text-xs);
  text-transform: uppercase; color: var(--gold);
  letter-spacing: 0.08em; margin-bottom: 0.25rem;
}
.comp-summary__val {
  font-family: var(--font-body); font-size: var(--text-sm);
  color: var(--text-primary); line-height: 1.6;
}
.safer-pick {
  display: inline-block; background: var(--gold); color: #fff;
  padding: 0.15rem 0.5rem; font-weight: 600; font-size: var(--text-xs);
  border-radius: 2px;
}
#comp-summary > div {
  background: var(--bg-card); border: 1px solid var(--border);
  border-top: 3px solid var(--gold); padding: 2rem;
  box-shadow: 0 4px 24px rgba(27,58,107,0.06);
  transition: background-color 0.3s ease, border-color 0.3s ease;
}

/* ── Loading Skeleton (Light Theme) ── */
.skel {
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: 2px;
}
.skel--line { height: 16px; margin-bottom: 8px; width: 80%; }
.skel--big { height: 48px; margin-bottom: 12px; }
@keyframes shimmer{0%{background-position:200% 0}100%{background-position:-200% 0}}
