:root {
  --bg-page: #f4f5f7;
  --bg-card: #ffffff;
  --bg-header: #111827;
  --bg-stats: #172033;
  --bg-subtle: #f8fafc;
  --bg-hover: #eef4ff;
  --text: #242833;
  --text-muted: #647084;
  --text-inverse: #ffffff;
  --border: #d9dee7;
  --accent: #2563eb;
  --accent-soft: #dbeafe;
  --academic: #1f8a70;
  --postdoc: #96732f;
  --industry: #b94646;
  --policy_government: #3867b7;
  --research_org: #7a4cb0;
  --unknown: #8b95a5;
  --shadow: 0 1px 3px rgba(15, 23, 42, 0.08);
  --sticky-nav-height: 54px;
}

[data-theme="dark"] {
  --bg-page: #0f131b;
  --bg-card: #181d29;
  --bg-header: #090d14;
  --bg-stats: #0d1424;
  --bg-subtle: #202637;
  --bg-hover: #222b40;
  --text: #e7eaf0;
  --text-muted: #9aa5b8;
  --text-inverse: #ffffff;
  --border: #30394c;
  --accent: #60a5fa;
  --accent-soft: #1f355d;
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.35);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg-page);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  line-height: 1.48;
}

header {
  background: var(--bg-header);
  color: var(--text-inverse);
  padding: 28px 24px 26px;
  text-align: center;
}

.header-content {
  position: relative;
  max-width: 1160px;
  margin: 0 auto;
}

h1 {
  margin: 0;
  font-size: 34px;
  letter-spacing: 0;
}

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

.subtitle {
  margin: 6px 0 0;
  color: #cbd5e1;
}

.loading-status {
  min-height: 18px;
  margin: 5px 0 0;
  color: #93c5fd;
  font-size: 12px;
}

.loading-status[hidden] {
  display: none;
}

.header-actions {
  position: absolute;
  right: 0;
  top: 50%;
  display: flex;
  gap: 8px;
  transform: translateY(-50%);
}

.icon-btn {
  width: 36px;
  height: 36px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 6px;
  background: transparent;
  color: #e5e7eb;
  cursor: pointer;
  font-size: 17px;
}

.icon-btn:hover {
  background: rgba(255, 255, 255, 0.1);
}

.stats-bar {
  display: flex;
  justify-content: flex-start;
  gap: 8px;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  background: var(--bg-stats);
  color: #cbd5e1;
  padding: 8px max(18px, calc((100vw - 1280px) / 2 + 20px));
  scrollbar-width: thin;
}

.stat-item {
  flex: 0 0 auto;
  min-width: 118px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.035);
  padding: 5px 10px;
  line-height: 1.15;
  text-align: left;
  font-size: 12px;
  text-transform: uppercase;
  color: #94a3b8;
}

.stat-value {
  display: block;
  color: #ffffff;
  font-size: 18px;
  line-height: 1.1;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.stat-label {
  display: block;
  margin-top: 2px;
}

.tabs {
  display: flex;
  justify-content: flex-start;
  align-items: stretch;
  flex-wrap: nowrap;
  gap: 2px;
  position: sticky;
  top: 0;
  z-index: 20;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  background: var(--bg-header);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding: 0 max(16px, calc((100vw - 1280px) / 2 + 20px));
  scrollbar-width: thin;
}

.tab {
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  border: 0;
  border-bottom: 3px solid transparent;
  background: transparent;
  color: #aab2c2;
  cursor: pointer;
  padding: 14px 16px 11px;
  font: inherit;
  white-space: nowrap;
}

.tab:hover, .tab.active {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.06);
  border-bottom-color: var(--accent);
}

.nav-menu {
  position: relative;
  flex: 0 0 auto;
}

.nav-menu-trigger {
  cursor: pointer;
  list-style: none;
}

.nav-menu-trigger::-webkit-details-marker {
  display: none;
}

.nav-menu-trigger::after {
  content: "";
  width: 0;
  height: 0;
  margin-left: 8px;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 5px solid currentColor;
  opacity: 0.75;
}

.nav-menu[open] .nav-menu-trigger,
.nav-menu.active .nav-menu-trigger {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.06);
  border-bottom-color: var(--accent);
}

.nav-popover {
  position: fixed;
  top: var(--nav-menu-top, 0px);
  left: var(--nav-menu-left, 8px);
  z-index: 30;
  display: grid;
  grid-template-columns: repeat(3, minmax(132px, 1fr));
  gap: 14px;
  width: min(590px, calc(100vw - 32px));
  max-height: calc(100vh - var(--nav-menu-top, 0px) - 8px);
  overflow: auto;
  margin-top: 0;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg-card);
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.22);
}

.nav-popover-compact {
  grid-template-columns: repeat(2, minmax(145px, 1fr));
  width: min(410px, calc(100vw - 32px));
}

.nav-group {
  display: grid;
  align-content: start;
  gap: 2px;
}

.nav-group-label {
  padding: 2px 8px 6px;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
}

.nav-menu-item {
  width: 100%;
  min-height: 32px;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  padding: 6px 8px;
  text-align: left;
}

.nav-menu-item:hover,
.nav-menu-item:focus-visible {
  background: var(--bg-hover);
  color: var(--accent);
  outline: 0;
}

main {
  max-width: 1280px;
  margin: 0 auto;
  padding: 22px 20px 38px;
}

.controls {
  background: var(--bg-card);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  border-radius: 8px;
  padding: 14px;
  margin-bottom: 18px;
}

.control-row {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) repeat(4, minmax(140px, 180px));
  gap: 10px;
}

.global-control-hidden {
  display: none !important;
}

input, select, button {
  font: inherit;
}

button:focus-visible,
summary:focus-visible,
input:focus-visible,
select:focus-visible,
a:focus-visible,
th[data-sort-key]:focus-visible,
th[data-dest-sort]:focus-visible,
th[data-person-sort]:focus-visible,
th[data-flow-sort]:focus-visible,
th[data-cohort-sort]:focus-visible,
th[data-pathway-sort]:focus-visible,
th[data-field-sort]:focus-visible,
th[data-gap-sort]:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}

input, select {
  width: 100%;
  min-height: 38px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--bg-card);
  color: var(--text);
  padding: 8px 10px;
}

.search-box {
  position: relative;
  z-index: 4;
}

.search-box input {
  padding-right: 38px;
}

.clear-btn {
  position: absolute;
  right: 5px;
  top: 5px;
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 20px;
}

.quick-jump {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  z-index: 30;
  display: none;
  max-height: 420px;
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg-card);
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.18);
}

.quick-jump.show {
  display: block;
}

.quick-item {
  display: grid;
  grid-template-columns: 86px minmax(0, 1fr);
  grid-template-areas:
    "type title"
    "type meta";
  width: 100%;
  min-height: 54px;
  border: 0;
  border-bottom: 1px solid var(--border);
  border-radius: 0;
  background: var(--bg-card);
  color: var(--text);
  cursor: pointer;
  padding: 9px 10px;
  text-align: left;
}

.quick-item:last-child {
  border-bottom: 0;
}

.quick-item:hover, .quick-item.active {
  background: var(--bg-hover);
}

.quick-type {
  grid-area: type;
  color: var(--accent);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
}

.quick-title {
  grid-area: title;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 650;
}

.quick-meta {
  grid-area: meta;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text-muted);
  font-size: 12px;
}

.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.chip-row:empty {
  display: none;
}

.chip {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--bg-subtle);
  color: var(--text-muted);
  padding: 4px 10px;
  font-size: 13px;
}

.chip-button {
  cursor: pointer;
}

.chip-button:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.tool-row, .compare-tools, .evidence-toolbar, .detail-actions, .atlas-tools, .discover-actions, .navigator-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 12px;
}

.segmented {
  display: inline-flex;
  border: 1px solid var(--border);
  border-radius: 7px;
  overflow: hidden;
  background: var(--bg-subtle);
}

.seg-btn, .export-btn, .page-btn, .mini-btn {
  min-height: 34px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text);
  cursor: pointer;
  border-radius: 6px;
  padding: 7px 10px;
}

.seg-btn {
  border: 0;
  border-right: 1px solid var(--border);
  border-radius: 0;
}

.seg-btn:last-child {
  border-right: 0;
}

.seg-btn.active, .page-btn.active {
  background: var(--accent);
  color: #ffffff;
}

.export-row {
  display: inline-flex;
  gap: 8px;
  flex-wrap: wrap;
}

.inline-select {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--text-muted);
  font-size: 13px;
}

.inline-select select {
  width: 86px;
}

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

.pagination {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 10px;
}

th[data-sort-key], th[data-dest-sort], th[data-person-sort], th[data-flow-sort], th[data-cohort-sort], th[data-pathway-sort], th[data-field-sort], th[data-gap-sort] {
  cursor: pointer;
}

th.sorted::after {
  content: " " attr(data-dir);
  color: var(--accent);
  font-size: 11px;
  text-transform: uppercase;
}

.view-hidden { display: none; }

#view-pivot {
  overflow-x: clip;
}

.split-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(360px, 0.75fr);
  gap: 18px;
  align-items: start;
}

.split-layout > * {
  min-width: 0;
}

.section-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 10px;
}

.section-head h2 {
  margin-bottom: 0;
  font-size: 20px;
}

.muted {
  color: var(--text-muted);
  font-size: 13px;
}

.table-wrap, .detail-panel, .chart-panel, .coverage-summary, .evidence-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.table-wrap {
  overflow: auto;
  max-width: 100%;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

th, td {
  padding: 9px 10px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: top;
}

.empty-table-cell {
  color: var(--text-muted);
  cursor: default;
  padding: 24px 12px;
  text-align: center;
}

th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--bg-subtle);
  color: var(--text-muted);
  font-weight: 650;
}

tbody tr {
  cursor: pointer;
}

tbody tr:hover, tbody tr.selected {
  background: var(--bg-hover);
}

.program-name {
  font-weight: 650;
}

.program-unit {
  color: var(--text-muted);
  font-size: 12px;
}

.person-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 6px;
}

.person-chip {
  max-width: 150px;
  min-height: 24px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--bg-subtle);
  color: var(--accent);
  cursor: pointer;
  overflow: hidden;
  padding: 3px 8px;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
}

.person-chip:hover {
  border-color: var(--accent);
  background: var(--bg-hover);
}

.sector-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.swatch {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 3px;
  background: var(--unknown);
}

.academic { background: var(--academic); }
.postdoc { background: var(--postdoc); }
.industry { background: var(--industry); }
.policy_government { background: var(--policy_government); }
.research_org { background: var(--research_org); }
.unknown { background: var(--unknown); }

.detail-panel {
  position: sticky;
  top: calc(var(--sticky-nav-height) + 12px);
  max-height: calc(100vh - var(--sticky-nav-height) - 24px);
  overflow: auto;
  padding: 16px;
}

.detail-title {
  margin-bottom: 4px;
  font-size: 20px;
}

.detail-meta {
  color: var(--text-muted);
  margin-bottom: 12px;
}

.link-btn {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
}

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

.metric {
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: 7px;
  padding: 10px;
}

.metric b {
  display: block;
  font-size: 20px;
  font-variant-numeric: tabular-nums;
}

.metric span {
  color: var(--text-muted);
  font-size: 12px;
}

.stack {
  display: flex;
  height: 24px;
  overflow: hidden;
  border-radius: 5px;
  background: var(--bg-subtle);
  margin: 10px 0 12px;
}

.seg {
  height: 100%;
}

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  color: var(--text-muted);
  font-size: 12px;
  margin-bottom: 14px;
}

.mini-table td, .mini-table th {
  padding: 6px 4px;
}

.sample-list {
  padding-left: 20px;
  color: var(--text-muted);
  font-size: 13px;
}

.pathway-panel {
  margin: 16px 0;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg-subtle);
  padding: 12px;
}

.pathway-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.pathway-head h3 {
  margin-bottom: 2px;
}

.pathway-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 12px;
}

.pathway-metric {
  border: 1px solid var(--border);
  border-radius: 7px;
  background: var(--bg-card);
  color: var(--text);
  cursor: pointer;
  padding: 10px;
  text-align: left;
}

.pathway-metric:hover {
  border-color: var(--accent);
  background: var(--bg-hover);
}

.pathway-metric b {
  display: block;
  font-size: 20px;
  font-variant-numeric: tabular-nums;
}

.pathway-metric span {
  color: var(--text-muted);
  font-size: 12px;
}

.pathway-actions {
  margin-top: 4px;
}

.cohort-browser {
  margin: 16px 0;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg-subtle);
  padding: 12px;
}

.cohort-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.cohort-head h3 {
  margin-bottom: 2px;
}

.cohort-controls {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 10px;
}

.cohort-controls label {
  color: var(--text-muted);
  font-size: 12px;
}

.cohort-controls select {
  margin-top: 4px;
  background: var(--bg-card);
}

.cohort-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 10px;
}

.cohort-summary h4, .roster-summary h4 {
  margin: 0;
  color: var(--text-muted);
  font-size: 12px;
}

.cohort-table-wrap {
  max-height: 420px;
}

.school-person-roster {
  margin: 16px 0;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg-card);
  padding: 12px;
}

.roster-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 10px;
}

.program-roster-wrap {
  max-height: 520px;
}

.outcome-matrix {
  margin: 12px 0;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg-card);
  padding: 10px;
}

.outcome-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.outcome-head h4 {
  margin: 0;
  font-size: 13px;
}

.outcome-totals {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(96px, 1fr));
  gap: 6px;
  margin-bottom: 8px;
}

.outcome-total {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 6px;
  min-height: 32px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--bg-subtle);
  color: var(--text);
  cursor: pointer;
  padding: 6px 8px;
  text-align: left;
}

.outcome-total:hover, .outcome-total.selected {
  border-color: var(--accent);
  background: var(--bg-hover);
}

.outcome-total span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
}

.outcome-total b {
  font-variant-numeric: tabular-nums;
}

.outcome-table-wrap {
  max-height: 360px;
}

.outcome-table th:first-child {
  min-width: 84px;
}

.outcome-table th small {
  display: block;
  margin-top: 2px;
  color: var(--text-muted);
  font-weight: 500;
}

.outcome-cell {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 28px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: color-mix(in srgb, var(--accent) calc(var(--cell-alpha) * 72%), var(--bg-subtle));
  color: var(--text);
  cursor: pointer;
  font-variant-numeric: tabular-nums;
  font-weight: 700;
}

.outcome-cell.academic { background: color-mix(in srgb, var(--academic) calc(var(--cell-alpha) * 76%), var(--bg-subtle)); }
.outcome-cell.postdoc { background: color-mix(in srgb, var(--postdoc) calc(var(--cell-alpha) * 76%), var(--bg-subtle)); }
.outcome-cell.industry { background: color-mix(in srgb, var(--industry) calc(var(--cell-alpha) * 76%), var(--bg-subtle)); }
.outcome-cell.policy_government { background: color-mix(in srgb, var(--policy_government) calc(var(--cell-alpha) * 76%), var(--bg-subtle)); }
.outcome-cell.research_org { background: color-mix(in srgb, var(--research_org) calc(var(--cell-alpha) * 76%), var(--bg-subtle)); }
.outcome-cell.unknown { background: color-mix(in srgb, var(--unknown) calc(var(--cell-alpha) * 76%), var(--bg-subtle)); }

.outcome-cell:hover, .outcome-cell.selected {
  border-color: var(--accent);
  box-shadow: inset 0 0 0 1px var(--accent);
}

.outcome-cell:disabled {
  cursor: default;
  opacity: 0.34;
  box-shadow: none;
}

.feeder-cell {
  background: color-mix(in srgb, var(--accent) calc(var(--cell-alpha) * 72%), var(--bg-subtle));
}

.feeder-table th:first-child {
  min-width: 150px;
}

.destination-feeder-head {
  margin-top: 12px;
}

.table-link {
  border: 0;
  background: transparent;
  color: var(--accent);
  cursor: pointer;
  padding: 0;
  text-align: left;
  font-weight: 650;
}

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

.page-btn:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.related-section {
  margin-top: 14px;
}

.related-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 10px;
  margin: 8px 0 12px;
}

.compact-related {
  grid-template-columns: 1fr;
}

.related-grid h4 {
  margin: 0 0 6px;
  font-size: 13px;
  color: var(--text-muted);
}

.related-item {
  display: block;
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: var(--bg-subtle);
  color: var(--text);
  cursor: pointer;
  margin-bottom: 6px;
  padding: 8px 9px;
  text-align: left;
}

.related-item:hover {
  border-color: var(--accent);
  background: var(--bg-hover);
}

.related-item span, .related-item small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.related-item span {
  font-weight: 650;
}

.related-item small {
  color: var(--text-muted);
  font-size: 12px;
  margin-top: 2px;
}

.source-list {
  display: grid;
  gap: 7px;
  margin-top: 10px;
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

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

.atlas-layout, .navigator-layout, .ask-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(360px, 0.42fr);
  gap: 18px;
  align-items: start;
}

.atlas-panel, .navigator-panel {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: var(--shadow);
  overflow: auto;
}

.atlas-svg, .navigator-svg {
  width: 100%;
  min-width: 820px;
  min-height: 520px;
  display: block;
}

.navigator-link {
  stroke: var(--border-strong);
  stroke-width: 1.5;
  stroke-opacity: 0.72;
}

.navigator-link.core-link {
  stroke: var(--accent);
  stroke-width: 2.4;
  stroke-opacity: 0.85;
}

.navigator-node {
  cursor: pointer;
}

.navigator-node circle {
  fill: var(--bg-subtle);
  stroke: var(--border-strong);
  stroke-width: 2px;
}

.navigator-node.center-node circle {
  fill: var(--accent);
  stroke: var(--accent-strong);
  stroke-width: 3px;
}

.navigator-node.program-node circle {
  fill: var(--academic);
}

.navigator-node.destination-node circle {
  fill: var(--industry);
}

.navigator-node.flow-node circle {
  fill: var(--policy_government);
}

.navigator-node.field-node circle {
  fill: var(--research_org);
}

.navigator-node.related-node circle {
  fill: var(--bg-card);
}

.navigator-node:hover circle, .navigator-node.selected circle {
  stroke: var(--accent-strong);
  stroke-width: 4px;
}

.navigator-node text {
  fill: var(--text);
  font-size: 11px;
  paint-order: stroke;
  stroke: var(--bg-card);
  stroke-width: 3px;
  stroke-linejoin: round;
}

.navigator-node.center-node text {
  font-size: 13px;
  font-weight: 750;
}

.navigator-node .node-caption {
  fill: var(--text-muted);
  font-size: 10px;
  font-weight: 500;
}

.atlas-axis {
  fill: var(--text-muted);
  font-size: 13px;
  font-weight: 700;
}

.atlas-edge {
  fill: none;
  stroke: var(--unknown);
  stroke-opacity: 0.32;
  cursor: pointer;
  transition: stroke-opacity 0.12s, stroke-width 0.12s;
}

.atlas-edge:hover, .atlas-edge.selected {
  stroke-opacity: 0.88;
}

.atlas-edge.academic { stroke: var(--academic); }
.atlas-edge.postdoc { stroke: var(--postdoc); }
.atlas-edge.industry { stroke: var(--industry); }
.atlas-edge.policy_government { stroke: var(--policy_government); }
.atlas-edge.research_org { stroke: var(--research_org); }
.atlas-edge.unknown { stroke: var(--unknown); }

.atlas-node {
  cursor: pointer;
}

.atlas-node circle {
  fill: var(--accent);
  stroke: var(--bg-card);
  stroke-width: 2px;
}

.atlas-node.destination-node circle {
  fill: var(--unknown);
}

.atlas-node circle.academic { fill: var(--academic); }
.atlas-node circle.postdoc { fill: var(--postdoc); }
.atlas-node circle.industry { fill: var(--industry); }
.atlas-node circle.policy_government { fill: var(--policy_government); }
.atlas-node circle.research_org { fill: var(--research_org); }
.atlas-node circle.unknown { fill: var(--unknown); }

.atlas-node.selected circle, .atlas-node:hover circle {
  stroke: var(--accent);
  stroke-width: 4px;
}

.atlas-node text {
  fill: var(--text);
  font-size: 11px;
  paint-order: stroke;
  stroke: var(--bg-card);
  stroke-width: 3px;
  stroke-linejoin: round;
}

.compare-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 14px;
  margin: 14px 0;
}

.discover-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 14px;
  margin-top: 14px;
}

.discover-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 15px;
  cursor: pointer;
}

.discover-card:hover {
  border-color: var(--accent);
}

.ask-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 12px;
}

.ask-card {
  min-height: 92px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg-card);
  color: var(--text);
  cursor: pointer;
  padding: 14px;
  text-align: left;
  box-shadow: var(--shadow);
}

.ask-card:hover, .ask-card.selected {
  border-color: var(--accent);
  background: var(--bg-hover);
}

.ask-card b {
  display: block;
  margin-top: 4px;
  font-size: 16px;
}

.ask-panel {
  position: sticky;
}

.ask-controls {
  display: grid;
  gap: 10px;
  margin: 12px 0 16px;
}

.ask-controls label {
  color: var(--text-muted);
  font-size: 12px;
}

.ask-controls select {
  margin-top: 4px;
}

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

.ask-path-list {
  margin: 10px 0 12px;
}

.gap-mode-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.gap-mode {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  min-height: 54px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg-card);
  color: var(--text);
  cursor: pointer;
  padding: 10px 12px;
  text-align: left;
  box-shadow: var(--shadow);
}

.gap-mode:hover, .gap-mode.selected {
  border-color: var(--accent);
  background: var(--bg-hover);
}

.gap-mode span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 650;
}

.gap-mode b {
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}

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

.discover-card h3 {
  margin-bottom: 6px;
}

.discover-kicker {
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
  margin-bottom: 6px;
  text-transform: uppercase;
}

.discover-list {
  display: grid;
  gap: 6px;
  margin: 12px 0;
}

.discover-list div {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 5px;
  font-size: 13px;
}

.discover-list span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ranking-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 12px;
}

.ranking-tools .inline-select {
  min-width: 180px;
}

.ranking-podium {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-bottom: 12px;
}

.ranking-podium-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: var(--shadow);
  color: var(--text);
  cursor: pointer;
  display: grid;
  gap: 4px;
  min-height: 92px;
  padding: 12px;
  text-align: left;
}

.ranking-podium-card span {
  color: var(--accent);
  font-weight: 800;
}

.ranking-podium-card b {
  line-height: 1.2;
}

.ranking-podium-card small {
  color: var(--text-muted);
}

.ranking-podium-card.selected {
  border-color: var(--accent);
  box-shadow: inset 0 0 0 1px var(--accent);
}

.ranking-score-bar {
  background: var(--bg-subtle);
  border-radius: 999px;
  height: 6px;
  margin-top: 5px;
  overflow: hidden;
  width: 90px;
}

.ranking-score-bar span {
  background: var(--accent);
  display: block;
  height: 100%;
}

.peer-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 12px;
}

.peer-tools .inline-select:first-child {
  min-width: min(420px, 100%);
}

.peer-strip {
  display: grid;
  gap: 9px;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  margin-bottom: 12px;
}

.peer-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: var(--shadow);
  color: var(--text);
  cursor: pointer;
  display: grid;
  gap: 5px;
  min-height: 94px;
  padding: 11px;
  text-align: left;
}

.peer-card.selected {
  border-color: var(--accent);
  box-shadow: inset 0 0 0 1px var(--accent);
}

.peer-card b {
  line-height: 1.25;
}

.peer-card span {
  color: var(--accent);
  font-weight: 800;
}

.peer-card small {
  color: var(--text-muted);
  line-height: 1.35;
}

.ranking-components {
  display: grid;
  gap: 8px;
  margin-bottom: 14px;
}

.ranking-component {
  align-items: center;
  display: grid;
  gap: 8px;
  grid-template-columns: 120px minmax(0, 1fr) 42px;
  font-size: 13px;
}

.ranking-component b {
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.cohort-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 12px;
}

.cohort-strip {
  display: grid;
  gap: 9px;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  margin-bottom: 12px;
}

.cohort-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: var(--shadow);
  color: var(--text);
  cursor: pointer;
  display: grid;
  gap: 5px;
  min-height: 92px;
  padding: 11px;
  text-align: left;
}

.cohort-card.selected {
  border-color: var(--accent);
  box-shadow: inset 0 0 0 1px var(--accent);
}

.cohort-card b {
  line-height: 1.25;
}

.cohort-card span {
  color: var(--accent);
  font-weight: 800;
}

.cohort-card small {
  color: var(--text-muted);
  line-height: 1.35;
}

.cohort-bars {
  display: grid;
  gap: 8px;
  margin-bottom: 14px;
}

.cohort-bar-row {
  align-items: center;
  display: grid;
  gap: 8px;
  grid-template-columns: 128px minmax(0, 1fr) 42px;
  font-size: 13px;
}

.cohort-bar-row span {
  align-items: center;
  display: inline-flex;
  gap: 6px;
  min-width: 0;
}

.cohort-bar-row b {
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.pivot-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 12px;
}

.pivot-tools .inline-select {
  min-width: 150px;
}

.pivot-wrap {
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: var(--shadow);
  contain: paint;
  max-width: 100%;
  overflow: auto;
}

.pivot-table {
  border-collapse: separate;
  border-spacing: 0;
  min-width: 760px;
  width: 100%;
}

.pivot-table th,
.pivot-table td {
  border-bottom: 1px solid var(--border);
  border-right: 1px solid var(--border);
  padding: 0;
  text-align: center;
  vertical-align: middle;
}

.pivot-table thead th {
  background: var(--bg-subtle);
  color: var(--text);
  font-size: 12px;
  line-height: 1.25;
  min-width: 86px;
  padding: 8px;
  position: sticky;
  top: 0;
  z-index: 2;
}

.pivot-table thead th:first-child,
.pivot-table tbody th {
  left: 0;
  min-width: 190px;
  position: sticky;
  text-align: left;
  z-index: 3;
}

.pivot-table tbody th {
  background: var(--bg-card);
  padding: 8px;
}

.pivot-table th small {
  color: var(--text-muted);
  display: block;
  font-weight: 500;
  margin-top: 3px;
}

.pivot-cell {
  background: color-mix(in srgb, var(--accent) calc(var(--intensity) * 70%), transparent);
  border: 0;
  color: var(--text);
  cursor: pointer;
  display: block;
  font-variant-numeric: tabular-nums;
  font-weight: 800;
  min-height: 36px;
  min-width: 64px;
  width: 100%;
}

.pivot-cell:hover,
.pivot-cell.selected {
  box-shadow: inset 0 0 0 2px var(--accent);
}

.pivot-cell:not(:empty) {
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.35);
}

.lane-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 12px;
}

.lane-tools .inline-select:first-child {
  min-width: min(420px, 100%);
}

.lane-grid {
  display: grid;
  gap: 9px;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  margin-bottom: 12px;
}

.lane-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: var(--shadow);
  color: var(--text);
  cursor: pointer;
  display: grid;
  gap: 6px;
  min-height: 104px;
  padding: 11px;
  text-align: left;
}

.lane-card.selected {
  border-color: var(--accent);
  box-shadow: inset 0 0 0 1px var(--accent);
}

.lane-card b {
  line-height: 1.28;
}

.lane-card span {
  color: var(--accent);
  font-weight: 800;
}

.lane-card small {
  color: var(--text-muted);
  line-height: 1.35;
}

.lane-steps {
  display: grid;
  gap: 8px;
  margin: 0 0 14px;
}

.lane-step {
  align-items: center;
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: 8px;
  display: grid;
  gap: 6px;
  grid-template-columns: 120px minmax(0, 1fr);
  padding: 8px 10px;
}

.lane-step b {
  color: var(--text-muted);
  font-size: 12px;
  text-transform: uppercase;
}

.geo-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 12px;
}

.geo-tools .inline-select {
  min-width: 170px;
}

.geo-map {
  display: grid;
  gap: 9px;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  margin-bottom: 12px;
}

.geo-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: var(--shadow);
  color: var(--text);
  cursor: pointer;
  display: grid;
  gap: 8px;
  padding: 11px;
  text-align: left;
}

.geo-card.selected {
  border-color: var(--accent);
  box-shadow: inset 0 0 0 1px var(--accent);
}

.geo-card-head {
  align-items: start;
  display: grid;
  gap: 8px;
  grid-template-columns: minmax(0, 1fr) auto;
}

.geo-card-head b {
  line-height: 1.25;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: normal;
}

.geo-card-head span {
  color: var(--accent);
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.geo-card small {
  color: var(--text-muted);
}

.trend-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 12px;
}

.trend-tools .inline-select {
  min-width: 150px;
}

.trend-panel {
  margin-bottom: 12px;
  padding: 12px;
}

.placement-trend-svg {
  display: block;
  width: 100%;
  min-height: 250px;
}

.trend-grid {
  stroke: var(--border);
  stroke-width: 1;
}

.trend-axis, .trend-axis-line {
  fill: var(--text-muted);
  stroke: var(--border);
  font-size: 12px;
}

.trend-line {
  fill: none;
  opacity: 0.78;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2.4;
}

.trend-line.selected {
  opacity: 1;
  stroke-width: 4;
}

.trend-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.trend-legend-item {
  align-items: center;
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  cursor: pointer;
  display: inline-flex;
  gap: 6px;
  min-height: 30px;
  padding: 5px 8px;
}

.trend-legend-item.selected {
  border-color: var(--accent);
  box-shadow: inset 0 0 0 1px var(--accent);
}

.trend-legend-item i {
  border-radius: 50%;
  display: inline-block;
  height: 9px;
  width: 9px;
}

.trend-table-wrap {
  margin-top: 8px;
}

.sparkline {
  display: block;
  margin-top: 5px;
  width: 118px;
}

.sparkline polyline {
  fill: none;
  stroke: var(--accent);
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.compare-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 14px;
}

.compare-card-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

.empty-state {
  color: var(--text-muted);
  margin-top: 12px;
}

.chart-panel {
  padding: 15px;
}

.chart-panel.wide {
  grid-column: 1 / -1;
}

.bar-row {
  display: grid;
  grid-template-columns: minmax(130px, 210px) 1fr 54px;
  gap: 10px;
  align-items: center;
  margin: 8px 0;
}

.bar-track {
  height: 20px;
  border-radius: 5px;
  background: var(--bg-subtle);
  overflow: hidden;
}

.bar-fill {
  height: 100%;
  background: var(--accent);
}

.spark-chart, .trend-svg {
  width: 100%;
  height: auto;
  display: block;
  margin-bottom: 12px;
}

.spark-chart rect, .trend-svg rect {
  fill: var(--accent);
}

.trend-svg line {
  stroke: var(--border);
}

.spark-chart text, .trend-svg text {
  fill: var(--text-muted);
  font-size: 11px;
}

.coverage-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding: 12px;
  margin-bottom: 12px;
}

.compact {
  max-height: 640px;
}

.evidence-list {
  display: grid;
  gap: 12px;
}

.evidence-card {
  padding: 14px;
}

.evidence-card h3 {
  margin-bottom: 4px;
  font-size: 17px;
}

.evidence-text {
  color: var(--text-muted);
  margin: 8px 0;
}

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 20;
  max-width: 280px;
  border-radius: 7px;
  background: var(--bg-header);
  color: #ffffff;
  padding: 10px 12px;
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translateY(8px);
  pointer-events: none;
  transition: opacity 0.18s, transform 0.18s;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

footer {
  border-top: 1px solid var(--border);
  padding: 20px;
  color: var(--text-muted);
  text-align: center;
  font-size: 13px;
}

footer p {
  margin: 4px 0;
}

@media (max-width: 980px) {
  .split-layout, .market-grid, .quality-grid, .atlas-layout, .navigator-layout, .ask-layout {
    grid-template-columns: 1fr;
  }

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

  .search-box {
    grid-column: 1 / -1;
  }

  .cohort-controls, .cohort-summary, .roster-summary {
    grid-template-columns: 1fr;
  }

  .cohort-head, .pathway-head {
    align-items: stretch;
    flex-direction: column;
  }

  .pathway-metrics {
    grid-template-columns: 1fr;
  }

  .ask-panel {
    position: static;
  }

  .outcome-head {
    align-items: start;
    flex-direction: column;
  }

  .tool-row {
    align-items: flex-start;
  }

  .segmented {
    width: 100%;
    overflow-x: auto;
    flex-wrap: nowrap;
  }

  .export-row {
    width: 100%;
  }

  .seg-btn {
    flex: 0 0 auto;
  }

  .export-row .export-btn {
    flex: 1;
  }

  .section-head {
    align-items: start;
    flex-direction: column;
  }

  .detail-panel {
    position: static;
    max-height: none;
    overflow: visible;
  }

  .tabs {
    padding-inline: 10px;
  }

  .tab {
    padding: 12px 13px 9px;
  }

  .stats-bar {
    padding-inline: 10px;
  }

  .controls {
    padding: 12px;
  }
}

@media (max-width: 640px) {
  header {
    padding-top: 20px;
    padding-bottom: 18px;
    padding-left: 14px;
    padding-right: 14px;
  }

  h1 {
    font-size: 28px;
  }

  main {
    padding-top: 16px;
    padding-left: 12px;
    padding-right: 12px;
  }

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

  .ranking-podium {
    grid-template-columns: 1fr;
  }

  .ranking-component {
    grid-template-columns: 1fr;
  }

  .ask-metrics {
    grid-template-columns: 1fr;
  }

  .bar-row {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .quick-item {
    grid-template-columns: 70px minmax(0, 1fr);
  }

  .nav-popover,
  .nav-popover-compact {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    padding: 10px;
  }

}

@media (max-width: 340px) {
  .control-row {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 460px) {
  .segmented {
    flex-wrap: wrap;
    overflow-x: visible;
  }

  .seg-btn {
    flex: 1 1 33.333%;
    text-align: center;
  }

  .header-actions {
    position: static;
    justify-content: center;
    margin-top: 10px;
    transform: none;
  }
}

/* Visual system refresh: denser research workspace, clearer data hierarchy. */
:root {
  --bg-page: #f3f5f8;
  --bg-card: #ffffff;
  --bg-header: #111a28;
  --bg-stats: #162133;
  --bg-subtle: #f8fafc;
  --bg-hover: #edf4ff;
  --text: #172033;
  --text-muted: #617086;
  --border: #d9e1eb;
  --accent: #2563d4;
  --accent-soft: #e7efff;
  --academic: #117a69;
  --postdoc: #a36b18;
  --industry: #c4513d;
  --policy_government: #4c63ba;
  --research_org: #8754a5;
  --unknown: #7d8a9b;
  --shadow: 0 8px 24px rgba(24, 39, 63, 0.06);
}

[data-theme="dark"] {
  --bg-page: #101722;
  --bg-card: #182230;
  --bg-header: #0b111a;
  --bg-stats: #111b28;
  --bg-subtle: #202c3b;
  --bg-hover: #1f344f;
  --text: #edf2fa;
  --text-muted: #a9b6c8;
  --border: #334256;
  --accent: #78a7ff;
  --accent-soft: #20395e;
  --shadow: 0 10px 28px rgba(0, 0, 0, 0.22);
}

body {
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.45;
}

header {
  padding: 18px 32px 16px;
  text-align: left;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.header-content {
  max-width: 1440px;
}

h1 {
  font-size: 27px;
  font-weight: 760;
}

.subtitle {
  margin-top: 3px;
  color: #aebbd0;
  font-size: 14px;
}

.header-actions {
  gap: 7px;
}

.icon-btn {
  width: 34px;
  height: 34px;
  border-radius: 7px;
  color: #dce5f2;
}

.stats-bar {
  gap: 0;
  justify-content: center;
  overflow: visible;
  padding: 0 max(24px, calc((100vw - 1440px) / 2 + 24px));
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.stat-item {
  min-width: 0;
  flex: 1 1 0;
  border: 0;
  border-left: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 0;
  background: transparent;
  padding: 10px 14px 9px;
}

.stat-item:first-child { border-left: 0; }

.stat-value {
  font-size: 19px;
  font-weight: 740;
}

.stat-label {
  margin-top: 3px;
  font-size: 10px;
}

.tabs {
  gap: 0;
  background: var(--bg-header);
  padding: 0 max(24px, calc((100vw - 1440px) / 2 + 24px));
}

.tab {
  padding: 13px 15px 10px;
  font-size: 14px;
  font-weight: 580;
}

main {
  max-width: 1488px;
  padding: 26px 24px 46px;
}

.controls {
  margin-bottom: 26px;
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 13px;
}

.control-row {
  grid-template-columns: minmax(300px, 1.55fr) repeat(4, minmax(145px, 0.78fr));
  gap: 9px;
}

input, select {
  min-height: 40px;
  border-color: var(--border);
  border-radius: 7px;
  background: var(--bg-subtle);
  padding: 8px 11px;
}

.chip-row { margin-top: 8px; }

.chip {
  min-height: 24px;
  border-radius: 5px;
  padding: 3px 8px;
  font-size: 12px;
}

.segmented {
  border-radius: 7px;
}

.seg-btn, .export-btn, .page-btn, .mini-btn {
  min-height: 36px;
  border-radius: 7px;
  font-size: 13px;
  font-weight: 620;
}

.seg-btn.active, .page-btn.active {
  background: var(--accent);
}

.section-head {
  margin-bottom: 12px;
}

.section-head h2 {
  font-size: 23px;
  font-weight: 740;
}

.muted { font-size: 13px; }

.split-layout {
  grid-template-columns: minmax(0, 1.55fr) minmax(400px, 0.78fr);
  gap: 22px;
}

.table-wrap, .detail-panel, .chart-panel, .coverage-summary, .evidence-card {
  border-radius: 8px;
  box-shadow: var(--shadow);
}

table {
  font-size: 13px;
}

th, td {
  padding: 12px 12px;
  border-bottom-color: var(--border);
}

th {
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 720;
  text-transform: uppercase;
}

tbody tr {
  transition: background 0.12s ease;
}

tbody tr:nth-child(even) { background: color-mix(in srgb, var(--bg-subtle) 55%, transparent); }
tbody tr:hover, tbody tr.selected { background: var(--bg-hover); }

.table-link {
  color: var(--accent);
  font-weight: 660;
}

.program-name {
  font-size: 14px;
  font-weight: 730;
  line-height: 1.32;
}

.program-unit {
  margin-top: 3px;
  font-size: 11.5px;
  line-height: 1.35;
}

.detail-panel {
  padding: 19px;
  border-top: 3px solid var(--accent);
}

.detail-title {
  font-size: 22px;
  font-weight: 740;
}

.detail-meta { font-size: 13px; }

.metric-grid { gap: 8px; }

.metric {
  border-radius: 7px;
  padding: 10px;
}

.metric-value { font-size: 20px; }

.person-chip {
  max-width: 128px;
  min-height: 23px;
  border-radius: 5px;
  background: transparent;
  padding: 2px 7px;
  font-size: 11px;
}

#program-table {
  min-width: 790px;
  table-layout: fixed;
}

#program-table th:nth-child(1), #program-table td:nth-child(1) { width: 44px; text-align: center; }
#program-table th:nth-child(2), #program-table td:nth-child(2) { width: 33%; }
#program-table th:nth-child(3), #program-table td:nth-child(3) { width: 9%; }
#program-table th:nth-child(4), #program-table td:nth-child(4) { width: 11%; }
#program-table th:nth-child(5), #program-table td:nth-child(5) { width: 11%; }
#program-table th:nth-child(6), #program-table td:nth-child(6) { width: 22%; }
#program-table th:nth-child(7), #program-table td:nth-child(7) { width: 10%; }

#program-table th, #program-table td { padding: 13px 10px; }
#program-table .col-compare { padding-inline: 5px; }

.compare-check {
  width: 16px;
  height: 16px;
  accent-color: var(--accent);
  cursor: pointer;
}

.program-title-line {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
}

.discipline-tag {
  display: inline-flex;
  flex: 0 0 auto;
  border: 1px solid color-mix(in srgb, var(--accent) 28%, var(--border));
  border-radius: 4px;
  color: var(--accent);
  padding: 1px 5px;
  font-size: 10px;
  font-weight: 700;
}

.person-strip {
  align-items: center;
  gap: 4px;
  margin-top: 8px;
}

.person-more {
  color: var(--text-muted);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}

.numeric-cell strong, .people-cell > .table-link, .cohort-cell strong, .quality-cell strong {
  font-size: 15px;
  font-variant-numeric: tabular-nums;
}

.people-cell > .table-link {
  text-decoration: none;
}

.outcome-stack {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 5px;
}

.outcome-stack span {
  display: grid;
  grid-template-columns: 8px minmax(0, 1fr);
  grid-template-areas: "dot value" "label label";
  align-items: center;
  column-gap: 4px;
  min-width: 0;
}

.outcome-stack b {
  grid-area: value;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.outcome-stack small {
  grid-area: label;
  margin-top: 2px;
  color: var(--text-muted);
  font-size: 9px;
  line-height: 1.1;
}

.outcome-dot {
  grid-area: dot;
  width: 7px;
  height: 7px;
  border-radius: 50%;
}

.outcome-dot.global { background: var(--policy_government); }

.quality-cell strong {
  color: var(--academic);
}

.business-area-summary {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  margin: 14px 0;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 650;
}

.quality-pill {
  display: inline-flex;
  align-items: center;
  border-radius: 4px;
  background: var(--bg-subtle);
  color: var(--text-muted);
  padding: 3px 6px;
  font-size: 10px;
  font-weight: 720;
}

.quality-pill.top-10, .quality-pill.top-25 { background: color-mix(in srgb, var(--academic) 14%, var(--bg-card)); color: var(--academic); }
.quality-pill.top-50, .quality-pill.top-100 { background: color-mix(in srgb, var(--accent) 12%, var(--bg-card)); color: var(--accent); }

.pagination { margin-top: 13px; }

@media (max-width: 1180px) {
  .split-layout { grid-template-columns: minmax(0, 1.35fr) minmax(360px, 0.8fr); }
  .control-row { grid-template-columns: minmax(260px, 1fr) repeat(4, minmax(120px, 0.72fr)); }
}

@media (max-width: 980px) {
  header { padding-inline: 20px; }
  .stats-bar { justify-content: flex-start; overflow-x: auto; padding-inline: 14px; }
  .stat-item { flex: 0 0 126px; }
  .tabs { padding-inline: 12px; }
  main { padding-inline: 16px; }
  .split-layout { grid-template-columns: 1fr; }
  .detail-panel { border-top-width: 3px; }
}

@media (max-width: 640px) {
  header { padding: 16px 14px 14px; }
  h1 { font-size: 24px; }
  .subtitle { max-width: calc(100% - 82px); font-size: 12px; }
  .stat-item { flex-basis: 112px; padding: 8px 10px; }
  .stat-value { font-size: 17px; }
  main { padding: 18px 12px 34px; }
  .controls { padding: 10px; margin-bottom: 20px; }
  .control-row { grid-template-columns: 1fr; }
  .search-box { grid-column: auto; }
  .section-head h2 { font-size: 21px; }
  #program-table { min-width: 760px; }
  #program-table th, #program-table td { padding: 11px 8px; }
  .detail-panel { padding: 15px; }
}
