/* ── Design tokens ────────────────────────────────────────────────────────── */
:root {
  --bg:           #f4f7fb;
  --card:         #ffffff;
  --text:         #14213d;
  --muted:        #5d6b82;
  --border:       #dce4f0;
  --primary:      #0f62fe;
  --primary-dark: #0043ce;
  --primary-light:#e8f0ff;
  --danger:       #b42318;
  --success:      #047857;
  --warning:      #b45309;
  --shadow:       0 18px 45px rgba(20,33,61,0.08);
  --radius:       20px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: radial-gradient(circle at top left, #e7f0ff 0, var(--bg) 36rem);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
}

button, input, select { font: inherit; }

/* ── Shell ────────────────────────────────────────────────────────────────── */
.shell {
  width: min(1200px, calc(100% - 32px));
  margin: 0 auto;
  padding: 48px 0 80px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.page-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 0.95rem;
}

.page-nav a {
  color: var(--primary);
  text-decoration: none;
  font-weight: 700;
}

.page-nav a:hover {
  text-decoration: underline;
}

.beta-badge {
  display: inline-block;
  margin-left: auto;
  padding: 3px 10px;
  background: #fffbeb;
  color: #92400e;
  border: 1px solid #f59e0b;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

/* ── Hero ─────────────────────────────────────────────────────────────────── */
.hero { max-width: 780px; margin-bottom: 8px; }

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

.home-hero h1 {
  margin-bottom: 14px;
}

.hero h1 {
  margin: 0 0 14px;
  font-size: clamp(2rem, 4vw, 4.2rem);
  line-height: 0.98;
  letter-spacing: -0.05em;
}

.hero p {
  color: var(--muted);
  font-size: 1.06rem;
  line-height: 1.65;
  margin: 0;
}

.eyebrow {
  color: var(--primary);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin: 0 0 10px;
}

/* ── Status bar ───────────────────────────────────────────────────────────── */
.status-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  background: rgba(255,255,255,0.92);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: var(--shadow);
  padding: 16px 20px;
}

.status-card p { margin: 0; }

.label {
  color: var(--primary);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin: 0 0 3px;
}

.status       { color: var(--muted);   font-size: 0.9rem; }
.status.ok    { color: var(--success); }
.status.error { color: var(--danger);  }

/* ── Cards ────────────────────────────────────────────────────────────────── */
.card {
  background: rgba(255,255,255,0.94);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 28px 28px 24px;
}

/* ── Step cards ───────────────────────────────────────────────────────────── */
.step-card { display: flex; flex-direction: column; gap: 20px; }

.step-header {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.step-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  font-weight: 800;
  font-size: 0.88rem;
  flex-shrink: 0;
}

.step-header h2 { margin: 0; font-size: 1.25rem; letter-spacing: -0.02em; }

.step-subtitle {
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 600;
  margin-left: 4px;
}

/* ── Form controls ────────────────────────────────────────────────────────── */
.form-row {
  display: grid;
  grid-template-columns: 180px 200px 1fr;
  gap: 18px;
  align-items: start;
}

label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 700;
}

input, select {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 12px;
  color: var(--text);
  background: #fff;
  padding: 11px 13px;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}

input:focus, select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(15,98,254,0.13);
}

.university-list-block {
  display: grid;
  gap: 10px;
}

.list-label {
  margin: 0;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.university-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 8px;
  max-height: 320px;
  overflow-y: auto;
  padding-right: 4px;
}

.university-item {
  display: grid;
  gap: 3px;
  border: 1.5px solid var(--border);
  border-radius: 12px;
  background: #fff;
  padding: 10px 12px;
  text-align: left;
  cursor: pointer;
}

.university-item:hover {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(15,98,254,0.10);
}

.university-item.selected {
  border-color: var(--primary);
  background: var(--primary-light);
}

.university-item-name {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.3;
}

.university-item-meta {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--muted);
}

/* ── Program chips ────────────────────────────────────────────────────────── */
.program-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 7px;
}

.program-chip {
  display: grid;
  align-content: start;
  gap: 6px;
  background: #fff;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  padding: 8px 11px;
  cursor: pointer;
  text-align: left;
  transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
}

.program-chip:hover {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(15,98,254,0.10);
}

.program-chip.selected {
  border-color: var(--primary);
  background: var(--primary-light);
}

.chip-title {
  font-weight: 700;
  font-size: 0.82rem;
  color: var(--text);
  line-height: 1.3;
}

.chip-meta {
  font-size: 0.70rem;
  color: var(--muted);
  font-weight: 600;
}

.chip-badge,
.ac-degree-tag {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  border-radius: 999px;
  padding: 4px 9px;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  background: #fff7ed;
  color: var(--warning);
  border: 1px solid #fed7aa;
}

/* ── Loading spinner ──────────────────────────────────────────────────────── */
.loading-row {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 0.9rem;
}

.spinner {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2.5px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ── Outcomes stats ───────────────────────────────────────────────────────── */
.outcomes-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}

.stat-card {
  background: #f9fbff;
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 16px 18px;
}

.stat-card.highlight {
  background: var(--primary-light);
  border-color: var(--primary);
}

.stat-label {
  display: block;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 6px;
}

.stat-card strong { font-size: 1.3rem; display: block; }


/* ── Salary distribution chart ────────────────────────────────────────────── */
.chart-title {
  margin: 0 0 14px;
  font-size: 0.84rem;
  font-weight: 700;
  color: var(--muted);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

#salary-chart-wrap {
  margin-bottom: 18px;
}

.salary-chart {
  display: flex;
  align-items: flex-end;
  gap: 6px;
  height: 140px;
  padding: 0 4px 10px;
  border-bottom: 1px solid var(--border);
}

.chart-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  flex: 1;
  gap: 5px;
  height: 100%;
}

.chart-bar {
  width: 100%;
  background: var(--primary);
  border-radius: 6px 6px 0 0;
  opacity: 0.85;
  min-height: 4px;
  transition: height 0.3s ease;
}

.chart-bar.entry { background: #7c3aed; }
.chart-bar.median { background: var(--primary); }

.chart-count {
  font-size: 0.72rem;
  font-weight: 800;
  color: var(--muted);
  min-height: 1em;
}

.chart-label {
  font-size: 0.82rem;
  font-weight: 800;
  color: var(--text);
  text-align: center;
  line-height: 1.2;
  padding-top: 6px;
  white-space: nowrap;
}

/* ── Table shared ─────────────────────────────────────────────────────────── */
.table-wrap {
  overflow-x: visible;
  margin-top: 10px;
}

table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

th, td {
  border-bottom: 1px solid var(--border);
  padding: 11px 12px;
  text-align: right;
  white-space: normal;
  vertical-align: top;
}

th:first-child, td:first-child { text-align: left; }
th:nth-child(1), td:nth-child(1) { width: 23%; }
th:nth-child(2), td:nth-child(2) { width: 15%; }
th:nth-child(3), td:nth-child(3) { width: 12%; }
th:nth-child(4), td:nth-child(4) { width: 12%; }
th:nth-child(5), td:nth-child(5) { width: 24%; }
th:nth-child(6), td:nth-child(6) { width: 14%; min-width: 100px; }

#imprecise-occ-table th:nth-child(1),
#imprecise-occ-table td:nth-child(1) { width: 24%; }
#imprecise-occ-table th:nth-child(2),
#imprecise-occ-table td:nth-child(2) { width: 34%; }
#imprecise-occ-table th:nth-child(3),
#imprecise-occ-table td:nth-child(3) { width: 42%; }

td.notes-cell {
  white-space: normal;
  text-align: left;
  color: var(--muted);
  line-height: 1.45;
}

th {
  color: var(--muted);
  font-size: 0.74rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  background: #fafbfd;
}

.active-row td { background: var(--primary-light); }
.row-neg td    { color: var(--danger); font-weight: 800; }
.row-neg       { color: var(--danger); font-weight: 800; }
.row-pos td    { color: var(--success); }

.drill-btn {
  width: 100%;
  background: transparent;
  color: var(--primary);
  border: 1.5px solid var(--primary);
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 0.76rem;
  font-weight: 800;
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: block;
}

.drill-btn:hover { background: var(--primary-light); }

.mono { font-family: ui-monospace, monospace; font-size: 0.84rem; }

.projection-table {
  table-layout: fixed;
}

#projection-table th,
#projection-table td {
  white-space: normal;
  word-break: normal;
  overflow-wrap: anywhere;
}

#projection-table th.year-col,
#projection-table td.year-col {
  width: 72px;
  min-width: 72px;
  max-width: 72px;
  text-align: left;
  white-space: nowrap;
}

#projection-table th.phase-col,
#projection-table td.phase-col {
  width: 96px;
  min-width: 96px;
  white-space: nowrap;
  text-align: left;
}

#projection-table th.scenario-head {
  width: auto;
  min-width: 0;
  text-align: center;
  line-height: 1.35;
}

#projection-table td.scenario-value {
  min-width: 0;
}

/* ── Step 4 sub-grid ──────────────────────────────────────────────────────── */
.form-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.sub-card {
  background: #f9fbff;
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 18px 18px 20px;
  display: grid;
  align-content: start;
  gap: 14px;
}

.sub-card h3 {
  margin: 0;
  font-size: 0.96rem;
  letter-spacing: -0.01em;
}

.expense-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

/* ── Actions ──────────────────────────────────────────────────────────────── */
.actions {
  display: flex;
  align-items: center;
  gap: 18px;
  padding-top: 4px;
}

#submit-button {
  background: var(--primary);
  color: #fff;
  border: 0;
  border-radius: 999px;
  padding: 13px 28px;
  font-weight: 800;
  cursor: pointer;
  transition: background 0.15s;
}

#submit-button:hover    { background: var(--primary-dark); }
#submit-button:disabled { opacity: 0.55; cursor: not-allowed; }

#form-message {
  color: var(--danger);
  font-weight: 700;
  margin: 0;
  font-size: 0.9rem;
}

/* ── Projection results ───────────────────────────────────────────────────── */
#results { display: flex; flex-direction: column; gap: 20px; }

.results-assumptions-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}

.results-assumptions-header h2 {
  margin: 0;
}

.results-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-top: 18px;
}

#assumptions-summary {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.metric {
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 15px;
  background: #f9fbff;
}

.metric span {
  color: var(--muted);
  display: block;
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.metric strong { display: block; font-size: 1.2rem; margin-top: 5px; }

.metric-wide {
  min-width: 0;
}

.metric small {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.35;
}

.metric-lines {
  margin-top: 10px;
  color: var(--text);
  font-size: 0.9rem;
  line-height: 1.5;
  white-space: normal;
}

.metric-lines div {
  white-space: normal;
}

.secondary-button {
  background: #fff;
  color: var(--primary);
  border: 1.5px solid var(--primary);
  border-radius: 999px;
  padding: 10px 16px;
  font-weight: 800;
  cursor: pointer;
}

.secondary-button:hover {
  background: var(--primary-light);
}

.scenario-metric {
  background: linear-gradient(180deg, #f9fbff 0%, #eef4ff 100%);
}

/* ── Incremental ROI summary color coding (subtle) ────────────────────────── */
.scenario-metric.roi-excellent {
  border-left: 4px solid #34d399;
  background: linear-gradient(180deg, #f0fdf6 0%, #e8fef2 100%);
}
.scenario-metric.roi-good {
  border-left: 4px solid #6ee7b7;
  background: linear-gradient(180deg, #f4fdf8 0%, #ecfbf2 100%);
}
.scenario-metric.roi-moderate {
  border-left: 4px solid #fbbf24;
  background: linear-gradient(180deg, #fffdf0 0%, #fffae5 100%);
}
.scenario-metric.roi-late {
  border-left: 4px solid #f97316;
  background: linear-gradient(180deg, #fffaf5 0%, #fff4e8 100%);
}
.scenario-metric.roi-negative {
  border-left: 4px solid #f87171;
  background: linear-gradient(180deg, #fff5f5 0%, #fee8e8 100%);
}

.scenario-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}

.scenario-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 7px 12px;
  background: #f9fbff;
  color: var(--text);
  font-size: 0.84rem;
  font-weight: 700;
}

.scenario-swatch {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

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

.line-chart-wrap {
  border: 1px solid var(--border);
  border-radius: 16px;
  background: #fbfcff;
  padding: 10px;
}

.line-chart {
  width: 100%;
  height: auto;
  display: block;
}

.line-grid {
  stroke: #dce4f0;
  stroke-width: 1;
}

.line-axis {
  stroke: #aab8ce;
  stroke-width: 1.2;
}

.line-zero {
  stroke: #b42318;
  stroke-width: 1;
  stroke-dasharray: 5 5;
  opacity: 0.45;
}

.line-axis-label {
  fill: var(--muted);
  font-size: 11px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
}

.line-axis-label.negative {
  fill: var(--danger);
  font-weight: 800;
}

.line-axis-label.positive {
  fill: var(--success);
  font-weight: 700;
}

.line-axis-label.zero {
  fill: var(--muted);
  font-weight: 700;
}

/* ── University autocomplete ─────────────────────────────────────────────── */
.autocomplete-wrap { position: relative; }

.autocomplete-dropdown {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background: #fff;
  border: 1.5px solid var(--primary);
  border-radius: 14px;
  box-shadow: 0 8px 30px rgba(20,33,61,0.13);
  z-index: 100;
  max-height: 280px;
  overflow-y: auto;
  padding: 6px 0;
}

.ac-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 16px;
  font-size: 0.9rem;
  color: var(--text);
  cursor: pointer;
  line-height: 1.35;
}

.ac-item:hover { background: var(--primary-light); color: var(--primary); }

.ac-empty {
  padding: 10px 16px;
  font-size: 0.88rem;
  color: var(--muted);
}

/* ── Degree cross-search row ──────────────────────────────────────────────── */
.degree-search-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 16px;
  align-items: start;
}

.search-toggle {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding-top: 26px;   /* align with the input (label offset) */
}

.toggle-label {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--muted);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.toggle-opt {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
}

.toggle-opt input[type="radio"] { width: auto; cursor: pointer; }

/* Two-line autocomplete items (university + degree) */
.ac-item-degree { flex-direction: column; gap: 2px; align-items: flex-start; justify-content: flex-start; }
.ac-degree-name { font-weight: 700; font-size: 0.9rem; color: var(--text); }
.ac-univ-name   { font-size: 0.78rem; color: var(--muted); }

/* City autocomplete items with rent badge */
.ac-rent-tag {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--success);
  white-space: nowrap;
  flex-shrink: 0;
}

@media (max-width: 700px) {
  .degree-search-row { grid-template-columns: 1fr; }
  .search-toggle      { padding-top: 0; flex-direction: row; flex-wrap: wrap; gap: 10px; }
  #assumptions-summary { grid-template-columns: 1fr; }
}

/* ── HUD hint ─────────────────────────────────────────────────────────────── */
.hud-hint {
  display: flex;
  gap: 8px;
  align-items: baseline;
  background: #f0fdf4;
  border: 1px solid #86efac;
  border-radius: 10px;
  padding: 9px 13px;
  font-size: 0.85rem;
}

.school-earnings-block {
  display: grid;
  gap: 10px;
}

.methodology-link-row {
  display: flex;
  justify-content: flex-end;
}

.summary-definitions {
  margin-top: 18px;
}

.definitions-card {
  display: grid;
  gap: 10px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
}

.definitions-card h3 {
  margin: 0;
  font-size: 0.98rem;
}

.definition-item {
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.6;
}

.definition-item strong {
  color: var(--text);
}

.methodology-link {
  color: var(--primary);
  font-weight: 800;
  text-decoration: none;
}

.methodology-link:hover {
  text-decoration: underline;
}

.page-links-card,
.filter-card {
  padding: 22px 24px;
}

.page-links-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

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

.brand-story-card {
  display: grid;
  gap: 14px;
}

.brand-story-card h2,
.site-footer h2 {
  margin: 0;
}

.page-link-card,
.selection-card,
.selection-link-card {
  display: grid;
  gap: 8px;
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: #f9fbff;
  color: var(--text);
  text-align: left;
  text-decoration: none;
  box-shadow: 0 8px 18px rgba(20, 33, 61, 0.05);
}

.page-link-card strong,
.selection-card strong,
.selection-link-card strong {
  font-size: 1rem;
}

.page-link-card span,
.selection-card span,
.selection-card em,
.selection-link-card span,
.selection-link-card em,
.table-subline {
  color: var(--muted);
  font-style: normal;
  font-size: 0.9rem;
  line-height: 1.45;
}

.page-link-card:hover,
.selection-card:hover,
.selection-link-card:hover {
  border-color: var(--primary);
  box-shadow: 0 14px 28px rgba(15, 98, 254, 0.10);
}

.site-footer {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.5;
}

.site-footer p {
  margin: 0;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-bottom: 4px;
}

.footer-links a {
  color: var(--primary);
  text-decoration: none;
  font-weight: 700;
}

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

.footer-disclaimer {
  font-size: 0.78rem;
  opacity: 0.75;
  line-height: 1.55;
  padding-top: 4px;
}

.footer-disclaimer:first-of-type {
  border-top: 1px solid var(--border, #e0e0e0);
  margin-top: 6px;
  padding-top: 10px;
}

.calculator-disclaimer-panel {
  background: var(--warning-bg, #fffbeb);
  border-left: 3px solid var(--warning, #d97706);
  font-size: 0.88rem;
  color: var(--text, #333);
  line-height: 1.6;
}

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

.selection-list {
  display: grid;
  gap: 14px;
}

.selection-check {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: #f9fbff;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}

.selection-check:hover {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(15,98,254,0.08);
}

/* Highlight checked rows — `:has` is widely supported in modern browsers */
.selection-check:has(input:checked) {
  border-color: var(--primary);
  background: var(--primary-light);
}

.selection-check-text {
  flex: 1;
  min-width: 0;
  display: grid;
  gap: 3px;
}

.selection-check input[type="checkbox"] {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  margin: 0;
  cursor: pointer;
  accent-color: var(--primary);
}

.selected-chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.selected-chip {
  background: #fff;
  color: var(--primary);
  border: 1.5px solid var(--primary);
  border-radius: 999px;
  padding: 8px 14px;
}

.compare-sticky-bar {
  position: fixed;
  left: 50%;
  bottom: 20px;
  transform: translateX(-50%);
  width: min(960px, calc(100% - 24px));
  z-index: 40;
}

.compare-sticky-bar__content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 16px;
  background: rgba(255,255,255,0.96);
  border: 1px solid var(--border);
  border-radius: 18px;
  box-shadow: 0 18px 45px rgba(20,33,61,0.16);
  backdrop-filter: blur(10px);
}

.compare-sticky-bar__text {
  margin: 0;
  color: var(--text);
  font-weight: 700;
}

.compare-sticky-bar__button {
  flex-shrink: 0;
}

.scorecard-table td strong {
  display: block;
}

.scorecard-table {
  table-layout: fixed;
}

.scorecard-table th,
.scorecard-table td {
  white-space: normal;
  overflow-wrap: anywhere;
  vertical-align: top;
}

.scorecard-table th:nth-child(1),
.scorecard-table td:nth-child(1) {
  width: 28%;
  text-align: left;
}

.scorecard-table th:nth-child(2),
.scorecard-table td:nth-child(2) {
  width: 10%;
}

.scorecard-table th:nth-child(3),
.scorecard-table td:nth-child(3) {
  width: 14%;
}

.scorecard-table th:nth-child(4),
.scorecard-table td:nth-child(4) {
  width: 14%;
}

.scorecard-table th:nth-child(5),
.scorecard-table td:nth-child(5) {
  width: 12%;
}

.scorecard-table th:nth-child(6),
.scorecard-table td:nth-child(6) {
  width: 12%;
}

.scorecard-table th:nth-child(7),
.scorecard-table td:nth-child(7) {
  width: 10%;
}

/* ── Score column & sort indicator ───────────────────────────────────────── */
.sortable-th {
  cursor: help;          /* signals there's a tooltip */
  white-space: nowrap;
  text-decoration: underline dotted var(--muted);
  text-underline-offset: 3px;
}

/* Score cells: bold, primary-coloured, monospaced for alignment */
.score-cell {
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  color: var(--primary);
}

/* Directory result count note */
.dir-count {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 600;
}

.methodology-prose {
  display: grid;
  gap: 16px;
  line-height: 1.65;
  color: var(--text);
}

.methodology-prose p,
.methodology-prose ul {
  margin: 0;
}

.methodology-prose code {
  background: #eef4ff;
  border-radius: 6px;
  padding: 1px 5px;
}

.hint-label {
  color: var(--success);
  font-weight: 800;
  font-size: 0.72rem;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  white-space: nowrap;
}

/* ── Location block (Step 4 living expenses) ─────────────────────────────── */
.location-block {
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: #f0f6ff;
  border: 1px solid #c7deff;
  border-radius: 12px;
  padding: 12px 14px;
}

.location-row-label {
  margin: 0;
  display: flex;
  align-items: baseline;
  gap: 8px;
  font-size: 0.82rem;
}

.muted-inline {
  color: var(--muted);
  font-size: 0.82rem;
}

.postgrad-rent-hint {
  margin: 0;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--primary);
}

/* ── Misc helpers ─────────────────────────────────────────────────────────── */
.hidden { display: none !important; }

.error-msg { color: var(--danger); font-weight: 700; margin: 0; }

.muted-msg { color: var(--muted); font-size: 0.9rem; margin: 0; }

.notice-msg {
  color: var(--warning);
  background: #fff7ed;
  border: 1px solid #fed7aa;
  border-radius: 14px;
  padding: 14px 16px;
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1.5;
}

button {
  border: 0;
  border-radius: 999px;
  background: var(--primary);
  color: #fff;
  cursor: pointer;
  font-weight: 800;
  padding: 10px 18px;
}

button:hover    { background: var(--primary-dark); }
button:disabled { opacity: 0.55; cursor: not-allowed; }

/* ── Responsive ───────────────────────────────────────────────────────────── */
@media (max-width: 900px) {
  .form-row        { grid-template-columns: 1fr; }
  .outcomes-stats  { grid-template-columns: repeat(2, 1fr); }
  .form-grid       { grid-template-columns: 1fr; }
  .summary-grid    { grid-template-columns: repeat(2, 1fr); }
  .line-chart-grid { grid-template-columns: 1fr; }
  .table-wrap      { overflow-x: auto; }
  table            { min-width: 760px; table-layout: auto; }
  #projection-table { min-width: 700px; table-layout: fixed; }
  .page-links-grid,
  .filter-grid-two { grid-template-columns: 1fr; }
  .compare-sticky-bar__content { align-items: stretch; flex-direction: column; }
  .compare-sticky-bar__button { width: 100%; }
}

@media (max-width: 560px) {
  .outcomes-stats { grid-template-columns: 1fr; }
  .summary-grid   { grid-template-columns: 1fr; }
  .program-grid   { grid-template-columns: repeat(2, 1fr); }
  .status-card    { flex-direction: column; align-items: stretch; }
  .page-links-grid { grid-template-columns: 1fr; }
}

/* ── Compare Results page ─────────────────────────────────────────────────── */

/* Winner badges grid */
.cr-winners-card { display: grid; gap: 18px; }

.cr-winners-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
}

.cr-winner-badge {
  display: flex;
  align-items: center;
  gap: 12px;
  background: #f9fbff;
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 14px 16px;
}

.cr-winner-icon {
  font-size: 1.5rem;
  line-height: 1;
  flex-shrink: 0;
}

.cr-winner-body {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.cr-winner-label {
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.cr-winner-name {
  font-size: 0.94rem;
  font-weight: 700;
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Two-column chart row */
.cr-chart-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}

.cr-chart-card {
  display: grid;
  gap: 4px;
}

/* Chart canvas containers */
.cr-chart-wrap {
  position: relative;
  height: 280px;
  margin-top: 8px;
}

.cr-chart-wrap-wide {
  height: 340px;
}

.cr-chart-note {
  color: var(--muted);
  font-size: 0.84rem;
  margin: 0;
  line-height: 1.45;
}

.cr-section-note {
  color: var(--muted);
  font-size: 0.9rem;
  margin: 0;
}

/* Methodology strip */
.cr-methodology-card {
  background: #f0f6ff;
  border-color: #c7deff;
}

.cr-methodology-text {
  color: var(--muted);
  font-size: 0.85rem;
  line-height: 1.6;
  margin: 0;
}

/* Disclaimer strip */
.cr-disclaimer-card {
  background: #fafbfd;
  border-color: var(--border);
}

/* ── Prominent disclaimer banner (appears on all data pages) ── */
.disclaimer-banner {
  border-left: 5px solid #b45309;
  background: #fffbeb;
  border-radius: 10px;
  padding: 16px 20px;
  margin: 0 0 16px;
}

.disclaimer-banner-title {
  font-weight: 800;
  font-size: 0.95rem;
  color: #92400e;
  margin: 0 0 6px;
  letter-spacing: 0.01em;
}

.disclaimer-banner p {
  margin: 0;
  font-size: 0.875rem;
  color: #78350f;
  line-height: 1.55;
}

.disclaimer-banner a {
  color: #92400e;
  font-weight: 600;
  text-decoration: underline;
}

.cr-disclaimer-text {
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.6;
  margin: 0;
}

/* Color dot used in table rows */
.cr-color-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  margin-right: 5px;
  vertical-align: middle;
  flex-shrink: 0;
}

/* Override fixed table layout for compare results — auto width is better */
.cr-compare-table {
  table-layout: auto !important;
}

.cr-compare-table th,
.cr-compare-table td {
  width: auto !important;
  white-space: nowrap;
}

.cr-compare-table th:first-child,
.cr-compare-table td:first-child {
  white-space: normal;
  min-width: 160px;
}

/* ── Top ROI Universities table ───────────────────────────────────────────── */

/* Rank badge — small numbered pill in the first column */
.cr-rank-badge {
  display: inline-block;
  background: var(--primary);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 800;
  line-height: 1;
  padding: 3px 6px;
  border-radius: 99px;
  margin-right: 4px;
  vertical-align: middle;
  letter-spacing: 0.02em;
}

/* Highlighted row — university is in the user's current comparison selection */
.cr-top-uni-highlighted {
  background: rgba(15, 98, 254, 0.06);
}

.cr-top-uni-highlighted td:first-child + td {
  border-left: 3px solid var(--primary);
  padding-left: 10px;
}

/* Small "Currently comparing" tag inside highlighted rows */
.cr-highlighted-tag {
  display: inline-block;
  margin-top: 3px;
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--primary);
  background: rgba(15, 98, 254, 0.1);
  padding: 1px 6px;
  border-radius: 4px;
  letter-spacing: 0.02em;
}

/* The top-uni table doesn't wrap the university name */
.cr-top-uni-table td:nth-child(2) {
  min-width: 180px;
  white-space: normal;
}

/* Responsive: stack charts on mobile */
@media (max-width: 760px) {
  .cr-chart-row     { grid-template-columns: 1fr; }
  .cr-chart-wrap    { height: 240px; }
  .cr-chart-wrap-wide { height: 280px; }
  .cr-winners-grid  { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 480px) {
  .cr-winners-grid  { grid-template-columns: 1fr; }
}
