
/* ── CSS Variables ─────────────────────────────────────────── */
:root {
  /* LEAD brand tokens */
  --lead-navy:      #003B73;
  --lead-teal:      #00A6A6;
  --commerce-blue:  #1F77B4;
  --sea-green:      #2E8B57;
  --signal-gold:    #F2B84B;
  --burnt-orange:   #D55E00;
  --policy-slate:   #2F3A45;
  --analyst-gray:   #6B7280;
  --light-gray-bg:  #EEF2F6;
  --line-gray:      #D9DEE5;
  --near-black:     #05070A;

  /* Light theme — maps to LEAD palette */
  --bg:           #EEF2F6;
  --bg2:          #E2E8F0;
  --bg3:          #D9DEE5;
  --surface:      #FFFFFF;
  --text:         #2F3A45;
  --text2:        #2F3A45;
  --text3:        #6B7280;
  --border:       #D9DEE5;
  --accent:       #00A6A6;
  --accent2:      #D55E00;
  --shadow:       0 2px 8px rgba(0,0,0,.08);
  --radius:       6px;
  --shadow2:      0 12px 32px rgba(0,0,0,.22);   /* used by #privacy-popup */
  --tab-h:        48px;
  --sidebar-w:    280px;
  /* Sidebar tokens — light: soft Navy tint sidebar, all text LEAD Navy */
  --sb-bg:        #EEF2F6;
  --sb-text:      #003B73;
  --sb-text2:     #003B73;
  --sb-text3:     #1A5499;
  --sb-border:    #D9DEE5;
  --sb-chip-bg:   #FFFFFF;
  --sb-chip-hover:#D9E8F5;
  --sb-input-bg:  #FFFFFF;
  --sb-input-bdr: #B3C6D9;
  /* Filter summary bar — navy-tinted banner, distinct from white chart cards */
  --fs-bg:     #E8F0F8;
  --fs-border: #C3D6E8;
  --fs-text:   #003B73;
}
[data-theme="dark"] {
  /* Dark theme — Near Black canvas, Navy sidebar */
  --bg:        #05070A;
  --bg2:       #0D1520;
  --bg3:       #151F2E;
  --surface:   #111827;
  --text:      #E8EDF5;
  --text2:     #C5D0DE;
  --text3:     #6B7280;
  --border:    #1E2D40;
  --shadow:    0 2px 8px rgba(0,0,0,.5);
  /* Sidebar stays LEAD Navy in dark mode */
  --sb-bg:        #002A54;
  --sb-text:      #FFFFFF;
  --sb-text2:     rgba(255,255,255,.85);
  --sb-text3:     rgba(255,255,255,.5);
  --sb-border:    rgba(255,255,255,.1);
  --sb-chip-bg:   rgba(255,255,255,.07);
  --sb-chip-hover:rgba(255,255,255,.16);
  --sb-input-bg:  rgba(255,255,255,.08);
  --sb-input-bdr: rgba(255,255,255,.18);
  /* Filter summary bar — navy panel with light navy text (8.6:1 contrast) */
  --fs-bg:     #0B2745;
  --fs-border: #1C3E63;
  --fs-text:   #9EC9EC;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: 'Aptos', 'Segoe UI', Calibri, system-ui, sans-serif;
  background: var(--bg); color: var(--text); font-size: 14px; line-height: 1.5;
}
button { cursor: pointer; border: none; background: none; font: inherit; }
select { font: inherit; }

/* App fills full viewport using fixed positioning - no flex-chain height issues */
#app { position: fixed; inset: 0; display: flex; overflow: hidden; }

/* ── Sidebar ── */
#sidebar {
  width: var(--sidebar-w); flex-shrink: 0;
  background: var(--sb-bg);
  border-right: 1px solid var(--sb-border);
  display: flex; flex-direction: column;
  overflow-y: auto;
  transition: background .2s;
}
#sidebar-header { padding: 10px 16px; border-bottom: 1px solid var(--sb-border); text-align:center; }
.filter-section { padding: 8px 16px; border-bottom: 1px solid var(--sb-border); }
.filter-label {
  color: var(--sb-text3); font-size: 10px; font-weight: 600;
  letter-spacing: .1em; text-transform: uppercase; margin-bottom: 5px;
}
.chip-group { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  padding: 3px 10px; border-radius: 20px; font-size: 12px; font-weight: 500;
  border: 1.5px solid transparent; transition: all .15s;
  color: var(--sb-text2); background: var(--sb-chip-bg); white-space: nowrap;
}
.chip:hover { color: var(--sb-text); background: var(--sb-chip-hover); }
.chip.active { color: var(--sb-text); border-color: var(--accent); background: var(--sb-chip-hover); }
.chip[data-val="NCCCS"].active { color: #2DB5A3; border-color: #2DB5A3; background: var(--sb-chip-hover); }
.chip[data-val="NCDPI"].active { color: #E8763A; border-color: #E8763A; background: var(--sb-chip-hover); }
.chip[data-val="UNC"].active   { color: #7B8FE8; border-color: #7B8FE8; background: var(--sb-chip-hover); }
.styled-select {
  width: 100%; padding: 5px 28px 5px 10px; border-radius: var(--radius);
  background: var(--sb-input-bg); color: var(--sb-text);
  border: 1px solid var(--sb-input-bdr);
  appearance: none; -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%234A5568' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center; font-size: 12px;
}
[data-theme="dark"] .styled-select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23ffffff80' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
}
.styled-select:focus { outline: 2px solid var(--accent); }
.styled-select option { background: var(--sb-input-bg); color: var(--sb-text); }
.demo-chip {
  padding: 3px 10px; border-radius: 4px; font-size: 11px; font-weight: 600;   /* same shape as year chips */
  border: 1.5px solid var(--sb-input-bdr); color: var(--sb-text2);
  background: var(--sb-chip-bg); transition: all .15s;
}
.demo-chip.active { background: var(--sb-chip-hover); border-color: var(--accent); color: var(--accent); }
.demo-chip:disabled { opacity: .35; cursor: not-allowed; }
/* graduation years: a 5-column grid of compact chips */
#year-chips { display: grid; grid-template-columns: repeat(5,1fr); gap: 3px; width: 100%; }
.year-chip { padding: 3px 2px; font-variant-numeric: tabular-nums; text-align: center; }
.filter-note { font-size: 10px; color: var(--sb-text3); margin-top: 4px; line-height: 1.3; }
#reset-section {
  padding: 8px 16px; border-top: 1px solid var(--sb-border);
}
.reset-btn {
  width: 100%; padding: 6px 12px; border-radius: var(--radius);
  background: var(--sb-chip-hover); color: var(--sb-text2);
  border: 1px solid var(--sb-input-bdr); font-size: 12px; font-weight: 500;
  cursor: pointer; transition: all .15s; text-align: center;
}
.reset-btn:hover { background: var(--lead-navy); color: #fff; border-color: var(--lead-navy); }
#sidebar-footer {
  /* now the last sidebar block: pin it to the bottom edge */
  margin-top: auto;
  padding: 8px 16px; border-top: 1px solid var(--sb-border);
  display: flex; align-items: center; justify-content: space-between;
}
#sidebar-footer span { color: var(--sb-text3); font-size: 11px; }
.theme-toggle {
  width: 40px; height: 22px; background: var(--sb-chip-bg);
  border-radius: 11px; position: relative; transition: background .2s;
  border: 1px solid var(--sb-input-bdr);
}
.theme-toggle::after {
  content: ''; position: absolute; top: 3px; left: 3px;
  width: 14px; height: 14px; border-radius: 50%;
  background: rgba(226,232,240,.6); transition: transform .2s, background .2s;
}
[data-theme="dark"] .theme-toggle { background: rgba(45,181,163,.25); border-color: var(--accent); }
[data-theme="dark"] .theme-toggle::after { transform: translateX(18px); background: var(--accent); }

/* ── Main ── */
#main { flex: 1; display: flex; flex-direction: column; min-width: 0; overflow: hidden; }
/* Tab bar reads as a tinted rail that the active tab sits on top of,
   rather than a flat strip of text. */
#tab-bar {
  background: var(--fs-bg);
  border-bottom: 2px solid var(--fs-border);
  display: flex; align-items: flex-end; gap: 4px;
  padding: 8px 24px 0;
  flex-shrink: 0; overflow-x: auto; z-index: 10;
  box-shadow: inset 0 -1px 0 var(--fs-border), var(--shadow);
}
.tab-btn {
  position: relative; flex-shrink: 0;
  height: calc(var(--tab-h) - 8px);
  padding: 0 16px; font-size: 13px; font-weight: 600;
  color: var(--text2); white-space: nowrap;
  display: inline-flex; align-items: center; gap: 7px;
  border: 1px solid transparent; border-bottom: none;
  border-radius: 8px 8px 0 0;
  background: transparent;
  transition: background .15s, color .15s;
}
.tab-btn:hover { background: rgba(0,0,0,.05); color: var(--text); }
[data-theme="dark"] .tab-btn:hover { background: rgba(255,255,255,.07); }

/* Active tab: a raised card with a teal cap, overlapping the rail's border
   so it reads as connected to the panel below. */
.tab-btn.active {
  background: var(--surface);
  border-color: var(--fs-border);
  color: var(--lead-navy);
  margin-bottom: -2px;
  padding-bottom: 2px;
  box-shadow: inset 0 3px 0 var(--accent);
}
[data-theme="dark"] .tab-btn.active { color: #fff; }
.tab-btn.active .tab-icon { stroke: var(--accent); }

.tab-icon {
  width: 16px; height: 16px; flex-shrink: 0;
  stroke: currentColor; fill: none;
}
#content {
  flex: 1; overflow: hidden; position: relative;
  display: flex; flex-direction: column;
}
/* Wrapper so absolutely-positioned tab panels sit below the summary bar */
#panel-wrap { flex: 1; position: relative; overflow: hidden; }
/* Mounted as the first child of the ACTIVE tab panel (see mountFilterSummary)
   so it shares the panel's content box exactly — including the width lost to
   the vertical scrollbar. Sticky keeps it visible while the panel scrolls. */
/* Selected-filter display, page-title style. No box: it reads as the
   heading of the view. Opaque page-colour background so it still works as a
   sticky header on the Data Table tab, where content scrolls beneath it.
   It deliberately does NOT use --fs-bg - sharing that colour with the tab
   rail above is what made the previous design visually disappear. */
#filter-summary {
  position: sticky; top: 0; z-index: 5;
  margin: 0 0 10px; padding: 2px 2px 8px;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  display: block; flex-shrink: 0;
}
/* Hide the empty shell before the first populate, and on tabs where the
   sidebar filters do not apply. */
#filter-summary:empty { display: none; }

/* Intro bar for tabs that are not filter-driven (Data at Work). Shares the
   filter bar's frame - spacing, divider, background - so the two read as
   the same element on every tab. */
.page-intro {
  flex: none; margin: 0 0 10px; padding: 2px 2px 8px;
  background: var(--bg); border-bottom: 1px solid var(--border);
}
.page-intro .pi-text {
  margin: 0; font-size: 15px; font-weight: 600; line-height: 1.35;
  color: var(--lead-navy);
}
[data-theme="dark"] .page-intro .pi-text { color: #FFFFFF; }

#filter-summary .fs-crumb {
  display: flex; align-items: center; gap: 7px; flex-wrap: wrap;
  font-size: 11px; color: var(--text3); margin-bottom: 3px;
}
#filter-summary .fs-crumb b { font-weight: 600; color: var(--fs-text); }
/* drawn as an SVG chevron: the font's '›' glyph was too small to read and
   looked like a comma */
#filter-summary .fs-crumb-sep {
  width: 12px; height: 12px; flex: none;
  fill: none; stroke: var(--text3); stroke-width: 2.4;
  stroke-linecap: round; stroke-linejoin: round;
}

/* baseline alignment: the small credential/years text sits on the same
   baseline as the program title rather than floating at its midpoint */
#filter-summary .fs-row {
  display: flex; align-items: baseline; gap: 8px 10px; flex-wrap: wrap;
}
#filter-summary .fs-title {
  margin: 0; font-size: 19px; font-weight: 700; line-height: 1.15;
  letter-spacing: -.01em; color: var(--lead-navy);
}
[data-theme="dark"] #filter-summary .fs-title { color: #FFFFFF; }
#filter-summary .fs-spacer { flex: 1 1 auto; }
/* Credential and years as plain text, styled exactly like the breadcrumb
   (System > Campus): grey label, semibold value, same size. */
#filter-summary .fs-meta {
  font-size: 11px; color: var(--text3); white-space: nowrap;
}
#filter-summary .fs-meta b { font-weight: 600; color: var(--fs-text); }
#filter-summary .fs-meta-sep { font-size: 11px; color: var(--text3); }
.tab-panel {
  display: none; position: absolute; inset: 0;
  /* top halved so the gap under the summary bar is tighter; sides stay at
     24px so chart cards remain flush with the summary bar edges */
  padding: 12px 24px 16px;
  overflow-y: auto;
}
.tab-panel.active { display: block; }

/* ── Fit-to-screen chart tabs ────────────────────────────────────────────
   Chart canvases used to be a fixed 34vh regardless of what else sat in
   their card (titles, pill rows, legends), so heavier cards overflowed the
   viewport. Now each chart tab is a flex column: rows split the available
   height, cards fill their row, and the canvas takes whatever its card has
   left. Result: the tab fits any viewport with no scroll. A min-height floor
   keeps charts legible on very small screens, where the panel falls back to
   scrolling. Data Table and About are exempt - their content is variable
   length and should scroll. */
:is(#tab-overview,#tab-outcomes,#tab-employment,#tab-enrollment,#tab-spotlights).active {
  display: flex; flex-direction: column;
}
:is(#tab-overview,#tab-outcomes,#tab-employment,#tab-enrollment,#tab-spotlights)
  > :is(.chart-grid-1,.chart-grid-2) {
  flex: 1 1 0; min-height: 0; grid-template-rows: minmax(0,1fr);
}
:is(#tab-overview,#tab-outcomes,#tab-employment,#tab-enrollment,#tab-spotlights)
  > :is(.chart-grid-1,.chart-grid-2):last-child { margin-bottom: 0; }
#tab-overview > .overview-grid {
  flex: 1 1 0; min-height: 0;
  grid-template-rows: minmax(0,1fr) minmax(0,1fr);
}
:is(#tab-overview,#tab-outcomes,#tab-employment,#tab-enrollment,#tab-spotlights) .chart-card {
  display: flex; flex-direction: column; min-height: 0; height: auto;
}
/* everything in a card except the plot area keeps its natural height */
:is(#tab-overview,#tab-outcomes,#tab-employment,#tab-enrollment,#tab-spotlights)
  .chart-card > :not(.chart-wrap):not(.chart-inline-table):not(#empl-map-wrap) { flex: none; }
/* the plot area absorbs the remaining space */
:is(#tab-overview,#tab-outcomes,#tab-employment,#tab-enrollment,#tab-spotlights) .chart-wrap {
  flex: 1 1 auto; min-height: 96px; height: auto !important; position: relative;
}
:is(#tab-overview,#tab-outcomes,#tab-employment,#tab-enrollment,#tab-spotlights) .chart-wrap canvas {
  position: absolute; inset: 0; width: 100% !important; height: 100% !important;
}
#tab-overview #empl-map-wrap { flex: 1 1 auto; min-height: 96px; height: auto; }
/* table view fills the card and scrolls inside it */
:is(#tab-overview,#tab-outcomes,#tab-employment,#tab-enrollment,#tab-spotlights)
  .chart-inline-table.visible { flex: 1 1 auto; min-height: 0; }

/* ── Chart cards ── */
.chart-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 14px; }
.chart-grid-1 { display: grid; grid-template-columns: 1fr; gap: 14px; margin-bottom: 14px; }
/* Overview 2×2 grid (heights come from the fit-to-screen rules above) */
.overview-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.chart-card {
  background: var(--surface); border-radius: var(--radius);
  border: 1px solid var(--border); padding: 14px 16px; box-shadow: var(--shadow);
  position: relative;
}
.chart-card-header {
  display: flex; align-items: flex-start; justify-content: space-between;
  margin-bottom: 4px; gap: 8px;
}
.chart-card-title    { font-size: 13px; font-weight: 600; color: var(--lead-navy); flex: 1; }
.chart-card-subtitle { font-size: 11px; color: var(--text3); margin-bottom: 10px; }
.chart-wrap canvas   { max-width: 100%; }

/* Chart/table toggle button */
.chart-view-toggle {
  flex-shrink: 0; width: 26px; height: 26px; border-radius: 5px;
  border: 1px solid var(--border); background: var(--bg2);
  color: var(--text3); cursor: pointer; display: flex;
  align-items: center; justify-content: center;
  transition: all .15s; padding: 0; margin-top: -2px;
}
.chart-view-toggle:hover { background: var(--bg3); color: var(--text2); border-color: var(--accent); }
.chart-view-toggle.active { background: var(--accent); border-color: var(--accent); color: #fff; }
.chart-view-toggle svg { width: 13px; height: 13px; stroke: currentColor; fill: none; }

/* Inline data table inside chart card */
.chart-inline-table {
  display: none; overflow: auto; border-radius: 4px;
  border: 1px solid var(--border); margin-top: 4px;
}
.chart-inline-table.visible { display: block; }
/* In table view the table already lists every year and after-year, and has
   its own Race / Gender columns - so the chart's legend and its year /
   after-year selector are hidden until the card returns to chart view. */
.chart-card.table-mode .grouped-legend,
.chart-card.table-mode .after-year-group,
.chart-card.table-mode .trend-controls { display: none; }
.chart-table-toolbar {
  display: flex; justify-content: flex-end;
  padding: 6px 10px 4px; background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 2;
}
.chart-dl-btn {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 11px; font-weight: 500; padding: 4px 12px;
  border-radius: var(--radius); border: 1px solid var(--accent);
  color: var(--accent); background: transparent;
  text-decoration: none; cursor: pointer; transition: background .15s, color .15s;
}
.chart-dl-btn:hover { background: var(--accent); color: #fff; }
.chart-dl-btn svg { flex-shrink: 0; }
.chart-inline-table table {
  width: 100%; border-collapse: collapse; font-size: 11px;
}
.chart-inline-table th {
  padding: 6px 10px; text-align: left; font-weight: 600;
  color: var(--text2); background: var(--bg2);
  border-bottom: 2px solid var(--border); white-space: nowrap;
  font-size: 10px; letter-spacing: .04em; text-transform: uppercase;
  position: sticky; top: 0;
}
.chart-inline-table td {
  padding: 5px 10px; border-bottom: 1px solid var(--border);
  color: var(--text); white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.chart-inline-table tr:last-child td { border-bottom: none; }
.chart-inline-table tbody tr:hover { background: var(--bg2); }

/* After-year selector container */
.after-year-group { display: flex; gap: 6px; margin-bottom: 16px; flex-wrap: wrap; align-items: center; }
.after-year-group-label { font-size: 11px; color: var(--text3); margin-right: 4px; font-weight: 500; }

/* Graduation-year selector container (trend charts) */
.trend-controls { display: flex; gap: 8px; align-items: center; margin-bottom: 12px; flex-wrap: wrap; }
.trend-controls-label { font-size: 11px; color: var(--text3); font-weight: 500; }
/* Stepper: "< [Year 3 v] > of 22" - one line however many options there are.
   Used for every "Years after graduation" and "Graduation year" selector. */
.stepper { display: inline-flex; align-items: center; gap: 5px; }
.stepper-btn {
  width: 28px; height: 28px; display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--border); border-radius: 6px; background: var(--surface);
  color: var(--lead-navy); cursor: pointer; padding: 0;
  font-family: inherit; font-size: 15px; font-weight: 700; line-height: 1;
}
[data-theme="dark"] .stepper-btn { color: var(--text); }
.stepper-btn:hover:not(:disabled) { border-color: var(--accent); }
.stepper-btn:disabled { opacity: .35; cursor: not-allowed; }
.stepper-select {
  height: 28px; padding: 0 28px 0 10px; border-radius: 6px; cursor: pointer;
  border: 1px solid var(--border); background-color: var(--surface);
  color: var(--text); font-family: inherit; font-size: 12px; font-weight: 600;
  line-height: 1; font-variant-numeric: tabular-nums;
  appearance: none; -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%236B7280' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center;
}
.stepper-select:hover { border-color: var(--accent); }
.stepper-btn:focus-visible, .stepper-select:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.stepper-of { font-size: 11px; color: var(--text3); margin-left: 2px; font-variant-numeric: tabular-nums; }

/* Data table */
#tab-data .chart-card { padding: 0; }
#data-table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 12px; }
thead tr { background: var(--bg2); border-bottom: 2px solid var(--border); }
th { padding: 10px 14px; text-align: left; font-weight: 600; color: var(--text2);
     white-space: nowrap; font-size: 11px; letter-spacing: .04em; text-transform: uppercase; }
td { padding: 9px 14px; border-bottom: 1px solid var(--border); color: var(--text);
     font-variant-numeric: tabular-nums; white-space: nowrap; }
tr:last-child td { border-bottom: none; }
tbody tr:hover { background: var(--bg2); }
#data-table-toolbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 20px; border-bottom: 1px solid var(--border);
}
#data-table-info { font-size: 12px; color: var(--text2); }
.export-btn {
  padding: 7px 16px; border-radius: 6px; background: var(--accent);
  color: #fff; font-size: 12px; font-weight: 600;
}
.export-btn:hover { opacity: .85; }

/* Loading */
.loading-overlay {
  position: fixed; inset: 0; background: var(--bg);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  z-index: 1000; gap: 14px;
}
.loading-overlay.hidden { display: none; }
.spinner { width: 40px; height: 40px; border: 3px solid var(--border);
           border-top-color: var(--accent); border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.loading-overlay p { color: var(--text2); font-size: 14px; }

/* ── Campus picker modal ────────────────────────────────────────────── */
.filter-label-row {
  display: flex; align-items: baseline; justify-content: space-between; gap: 8px;
}
.filter-label-link {
  background: none; border: none; padding: 0; font-family: inherit;
  font-size: 10px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
  color: var(--accent); cursor: pointer; text-decoration: underline;
  text-underline-offset: 2px;
}
.filter-label-link:hover { filter: brightness(1.15); }

#campus-map-modal {
  position: fixed; inset: 0; z-index: 1100;
  background: rgba(0,0,0,.45);
  display: flex; align-items: center; justify-content: center; padding: 32px;
}
#campus-map-modal.hidden { display: none; }
/* touch: confirms the campus previewed by a tap */
#cmm-tapbar {
  position: absolute; left: 8px; right: 8px; bottom: 8px; z-index: 5;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 8px 8px 8px 14px; background: var(--surface); box-shadow: var(--shadow2);
  border: 1px solid var(--border); border-left: 4px solid var(--accent); border-radius: 4px;
}
#cmm-tapbar[hidden] { display: none; }
.cmm-tap-name { font-size: 15px; font-weight: 700; color: var(--lead-navy); }
[data-theme="dark"] .cmm-tap-name { color: #FFFFFF; }
#cmm-tap-select {
  flex: none; height: 44px; padding: 0 18px; cursor: pointer; font-family: inherit;
  font-size: 15px; font-weight: 600; color: #FFFFFF;
  background: var(--lead-navy); border: none; border-radius: 4px;
}
.cmm-panel {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: 0 18px 60px rgba(0,0,0,.35);
  width: min(880px, 100%); height: min(680px, 100%);
  display: flex; flex-direction: column; overflow: hidden;
}
.cmm-head {
  flex: none; display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px; border-bottom: 1px solid var(--border);
  background: var(--fs-bg);
}
.cmm-title { font-size: 13px; font-weight: 700; color: var(--fs-text); }
.cmm-close {
  background: none; border: none; font-family: inherit; font-size: 15px;
  line-height: 1; color: var(--text2); cursor: pointer; padding: 4px 6px;
  border-radius: var(--radius);
}
.cmm-close:hover { background: var(--bg3); color: var(--text); }
.cmm-body { flex: 1; min-height: 0; padding: 14px 16px 16px; display: flex; flex-direction: column; }
/* the map fills the modal body */
#campus-map-wrap { flex: 1; min-height: 0; width: 100%; position: relative; }
#campus-map-subtitle { margin-bottom: 8px; flex: none; }

.chart-footnote { font-size: 11px; line-height: 1.4; color: var(--text3); margin-top: 6px; }
.nodata-swatch { display:inline-block; width:14px; height:8px; margin-left:4px; flex-shrink:0;
  border:1px solid #8A94A0; background: repeating-linear-gradient(45deg, #8A94A0 0 1px, #FFFFFF 1px 4px); }
[data-theme="dark"] .nodata-swatch { border-color: rgba(255,255,255,.35);
  background: repeating-linear-gradient(45deg, rgba(255,255,255,.35) 0 1px, #111827 1px 4px); }
/* Share button: right end of the System > Campus line */
#filter-summary .fs-share {
  margin-left: auto; display: inline-flex; align-items: center; gap: 6px;
  height: 26px; padding: 0 11px; cursor: pointer;
  font-family: inherit; font-size: 12px; font-weight: 600; letter-spacing: normal; text-transform: none;
  color: var(--lead-navy); background: var(--surface);
  border: 1px solid var(--border); border-radius: 4px; transition: border-color .15s;
}
#filter-summary .fs-share:hover { border-color: var(--accent); }
#filter-summary .fs-share.copied { border-color: var(--accent); }
#filter-summary .fs-share svg { width: 14px; height: 14px; fill: none; stroke: currentColor;
  stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
[data-theme="dark"] #filter-summary .fs-share { color: #FFFFFF; }
/* notice shown when a shared link contained values that no longer exist */
#share-notice {
  position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%); z-index: 1200;
  max-width: 560px; display: flex; gap: 12px; align-items: flex-start;
  padding: 12px 14px; font-size: 13px; line-height: 1.45;
  background: var(--surface); color: var(--text); border: 1px solid var(--border);
  border-left: 4px solid var(--accent); border-radius: 4px; box-shadow: var(--shadow2);
}
#share-notice button { background: none; border: none; font-size: 18px; line-height: 1; cursor: pointer; color: var(--text3); }
.supp-swatch { display:inline-block; width:14px; height:8px; margin-left:4px; flex-shrink:0;
  border:1px solid #8A94A0; background-color:#FFFFFF;
  background-image: radial-gradient(#5B6774 1px, transparent 1.3px); background-size: 4px 4px; }
[data-theme="dark"] .supp-swatch { border-color: rgba(255,255,255,.35); background-color:#111827;
  background-image: radial-gradient(rgba(255,255,255,.55) 1px, transparent 1.3px); }
/* Employment Location in table view: the legend and notes belong to the map */
.chart-card.table-mode #empl-legend, .chart-card.table-mode #empl-no-data-note { display: none !important; }
/* Top Sectors of Employment: shown when the cohort has no data for the selection */
#sectors-ov-note { font-size: 12px; color: var(--text3); text-align: center; padding: 6px 0 0; }
#sectors-ov-note:empty { display: none; }
/* ── Tabs the filters don't apply to (Data at Work, About) ──────────────
   The search and filters are dimmed and made inert (not clickable, not
   focusable, skipped by screen readers); the note above them stays pinned
   to the top of the scrolling sidebar. Logo, theme switch and footer stay
   active. Selections are kept for when the user returns to a chart tab. */
body.filters-na #sidebar > :is(#sb-search-section, .sb-nav-heading-divider, .filter-section, #reset-section) {
  opacity: .38; filter: grayscale(.4); user-select: none; transition: opacity .2s;
}
#sb-na-note {
  position: sticky; top: 0; z-index: 3; margin: 12px 16px 6px; padding: 12px 14px;
  background: #FFFFFF; color: var(--sb-text); font-size: 13px;
  border: 1px solid #CBD5E1; border-left: 4px solid var(--accent); border-radius: 4px;
  box-shadow: 0 2px 6px rgba(5,7,10,.08);
}
#sb-na-note[hidden] { display: none; }
#sb-na-note p { margin: 0 0 8px; font-weight: 600; }
#sb-na-back {
  height: 34px; padding: 0 12px; cursor: pointer; font-family: inherit; font-size: 13px; font-weight: 600;
  color: #FFFFFF; background: var(--lead-navy); border: none; border-radius: 4px;
}
[data-theme="dark"] #sb-na-note { background: #0B3A6B; border-color: rgba(255,255,255,.25); }
[data-theme="dark"] #sb-na-back { color: #003B73; background: #FFFFFF; }
/* No data for the current selection (see setChartEmpty) */
.chart-wrap.is-empty { position: relative; }
.chart-wrap.is-empty canvas { visibility: hidden; }
.chart-card.no-data .grouped-legend { display: none; }
.chart-empty {
  position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center;
  justify-content: center; gap: 6px; padding: 16px; text-align: center;
}
.chart-empty-table { position: static; padding: 32px 16px; }
.chart-empty-title { font-size: 14px; font-weight: 600; color: var(--text); }
.chart-empty-hint { font-size: 12px; line-height: 1.45; color: var(--text3); max-width: 360px; }
#filter-summary .fs-sub { font-size: 12px; color: var(--text3); margin-top: 3px; }
#filter-summary .fs-row-cmp { align-items: center; }   /* Compare: heading and Share on one line */
/* ── Compare tab ─────────────────────────────────────────────────────── */
#tab-compare .chart-grid-2 { margin-top: 14px; }
.cmp-wrap { height: 300px; }
.cmp-builder { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 18px; }
.cmp-items { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.cmp-items:empty { display: none; }
.cmp-chip { display: inline-flex; align-items: center; gap: 8px; max-width: 100%; padding: 5px 6px 5px 10px;
  font-size: 13px; color: var(--text); background: var(--bg); border: 1px solid var(--border);
  border-left: 4px solid var(--c); border-radius: 4px; }
.cmp-sw { width: 10px; height: 10px; border-radius: 2px; background: var(--c); flex: none; }
.cmp-chip-txt { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cmp-x { flex: none; width: 26px; height: 26px; border: none; background: none; cursor: pointer;
  font-size: 18px; line-height: 1; color: var(--text3); border-radius: 4px; }
.cmp-x:hover { color: var(--text); background: var(--border); }
.cmp-add { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.cmp-add .styled-select { width: auto; min-width: 150px; max-width: 280px; flex: 1 1 160px; }
.cmp-or { font-size: 12px; color: var(--text3); }
.cmp-btn { height: 36px; padding: 0 14px; font-family: inherit; font-size: 13px; font-weight: 600; cursor: pointer;
  color: var(--lead-navy); background: var(--surface); border: 1px solid var(--border); border-radius: 4px; }
.cmp-btn-primary { color: #FFFFFF; background: var(--lead-navy); border-color: var(--lead-navy); max-width: 100%;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cmp-btn:disabled { opacity: .45; cursor: not-allowed; }
[data-theme="dark"] .cmp-btn { color: #FFFFFF; }
[data-theme="dark"] .cmp-btn-primary { color: #003B73; background: #FFFFFF; border-color: #FFFFFF; }
.cmp-note { font-size: 12px; color: var(--accent); margin-top: 8px; }
.cmp-note:empty { display: none; }
.cmp-empty { margin-top: 14px; padding: 40px 16px; text-align: center; font-size: 14px; color: var(--text3);
  border: 1px dashed var(--border); border-radius: var(--radius); }
.cmp-empty[hidden], #cmp-charts[hidden], .cmp-controls[hidden] { display: none; }
.cmp-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 20px; margin-top: 14px; }
.cmp-group-note { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 14px; font-size: 12px; color: var(--text3); }
.cmp-key-lead { font-weight: 600; }
.cmp-key { display: inline-flex; align-items: center; gap: 6px; color: var(--text); }
.cmp-key svg { color: var(--text2, var(--text)); flex: none; }
.cmp-key-bar { width: 10px; height: 10px; border-radius: 2px; background: var(--text2, var(--text)); flex: none; }
th.num, td.num { text-align: right; font-variant-numeric: tabular-nums; }
.chart-footnote a { color: var(--accent); text-decoration: underline; text-underline-offset: 2px; }

/* ── Grouped chart legend ───────────────────────────────────────────── */
.grouped-legend {
  display: flex; flex-direction: column; gap: 4px;
  margin-top: 8px; font-size: 11px; color: var(--text2);
}
.gl-row { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; }
.gl-item { display: inline-flex; align-items: center; gap: 5px; }
.gl-sw { width: 11px; height: 11px; border-radius: 2px; flex: none;
         border: 1px solid rgba(0,0,0,.12); }
[data-theme="dark"] .gl-sw { border-color: rgba(255,255,255,.18); }

/* ── Sidebar search ─────────────────────────────────────────────────── */
.sb-searchrow { display: flex; gap: 6px; }
#sb-search {
  flex: 1; min-width: 0; box-sizing: border-box;
  padding: 6px 10px; font-size: 12.5px; font-family: inherit;
  border-radius: var(--radius);
  background: var(--sb-input-bg); color: var(--sb-text);
  border: 1px solid var(--sb-input-bdr); outline: none;
}
#sb-search::placeholder { color: var(--sb-text3); }
#sb-search:focus { border-color: var(--accent); }
#sb-search:disabled { opacity: .6; }

#sb-results {
  list-style: none; margin: 8px 0 0; padding: 0;
  max-height: 240px; overflow-y: auto;
  background: var(--surface); color: var(--text);
  border: 1px solid var(--border); border-radius: var(--radius);
}
#sb-results:empty { display: none; }
#sb-results li {
  padding: 7px 10px; cursor: pointer; font-size: 11.5px; line-height: 1.35;
  border-bottom: 1px solid var(--border);
}
#sb-results li:last-child { border-bottom: none; }
#sb-results li:hover, #sb-results li.sel { background: var(--fs-bg); }
#sb-results .lr-sys {
  display: block; min-width: 0; font-weight: 700; font-size: 10px;
  letter-spacing: .04em; color: var(--accent); margin-bottom: 1px;
}
#sb-results .lr-campus { font-weight: 600; }
#sb-results .lr-prog { color: var(--text2); }
.sb-hint { font-size: 10.5px; color: var(--sb-text3); margin-top: 3px; }
.sb-hint:empty { display: none; }

/* The two primary navigation pointers ("search" vs "pick from the list")
   are full-width bands: LEAD Navy with white text, inverted in dark mode.
   Both use the same box so they line up exactly - the search heading sits
   inside a padded .filter-section, so it breaks out of that padding with
   negative margins to reach the sidebar edges like the list heading. */
:root               { --sb-head-bg: #446F98; --sb-head-text: #FFFFFF; }   /* = Graduates by Year bar fill (#003B73 at BB opacity on white) */
[data-theme="dark"] { --sb-head-bg: #E8F0F8; --sb-head-text: #003B73; }
.sb-nav-heading {
  font-size: 11.5px; font-weight: 800; letter-spacing: .07em;
  text-transform: uppercase; line-height: 1.25;
  background: var(--sb-head-bg); color: var(--sb-head-text);
  padding: 7px 16px;
  margin: -8px -16px 8px;          /* cancel .filter-section's 8px 16px padding */
}
.sb-nav-heading-divider {
  margin: 0;                        /* direct sidebar child: already edge to edge */
}

/* ── Landing / search page ─────────────────────────────────────────────── */
/* Fixed 1600x800 stage, centred, scaled down to fit smaller viewports. */
:root      { --ld-hero:#003B73; --ld-page:#EEF2F6; --ld-eyebrow:#94BCE3; }
[data-theme="dark"] { --ld-hero:#002A54; --ld-page:#05070A; --ld-eyebrow:#7FB2DC; }

#landing {
  position: fixed; inset: 0; z-index: 900;
  background: var(--ld-page);
  display: grid; place-items: center; overflow: hidden;
}
#landing.hidden { display: none; }

/* Artwork spans the whole stage so the dot field can fade in from the
   middle; all stage content is lifted above it. */
#ld-art-stage { position: absolute; inset: 0; width: 100%; height: 100%;
                display: block; pointer-events: none; z-index: 0; }
#ld-stage > .ld-nav,
#ld-stage > .ld-body,
#ld-stage > .ld-foot { position: relative; z-index: 1; }

#ld-stage {
  width: 1600px; height: 800px; flex: none;
  background: var(--ld-hero); color: #fff;
  border-radius: 10px; overflow: hidden; position: relative;
  box-shadow: 0 18px 60px rgba(0,0,0,.28);
  transform-origin: center center;
  display: flex; flex-direction: column;
}

/* nav */
.ld-nav {
  display: flex; align-items: center; gap: 26px;
  padding: 22px 56px; border-bottom: 1px solid rgba(255,255,255,.14);
  flex: none;
}
.ld-brand { margin-right: auto; }
.ld-brand img { height: 51px; display: block; }
.ld-nav a {
  color: rgba(255,255,255,.82); text-decoration: none; font-size: 14px;
  background: none; border: none; font-family: inherit; cursor: pointer; padding: 4px 0;
}
.ld-nav a:hover { color: #fff; text-decoration: underline; }
.ld-nav .ld-cta {
  border: 1px solid rgba(255,255,255,.45);
  border-radius: var(--radius); padding: 8px 18px; color: #fff;
}
.ld-nav .ld-cta:hover { background: rgba(255,255,255,.12); text-decoration: none; }

/* two-column body */
.ld-body {
  flex: 1; display: grid; grid-template-columns: 1fr 520px;
  gap: 0; min-height: 0;
}
.ld-left  { padding: 46px 40px 34px 56px; display: flex; flex-direction: column; }
.ld-right { position: relative; overflow: hidden; }

/* Three fixed lines. Each line is a block that never wraps, so the break
   points hold at any stage scale (a max-width would re-wrap line two). */
.ld-h1 { font-size: 42px; line-height: 1.08; margin: 0 0 20px; font-weight: 700; }
.ld-h1 > span { display: block; white-space: nowrap; }
.ld-lede {
  font-size: 17px; line-height: 1.6; color: rgba(255,255,255,.84);
  max-width: 60ch; margin: 0 0 28px;
}

.ld-searchrow { display: flex; gap: 10px; max-width: 720px; flex: none; }
#landing-search {
  flex: 1; height: 54px; box-sizing: border-box; padding: 0 16px;
  font-size: 16px; font-family: inherit; border-radius: var(--radius);
  background: rgba(255,255,255,.09); color: #fff;
  border: 1px solid rgba(255,255,255,.38); outline: none;
}
#landing-search::placeholder { color: rgba(255,255,255,.55); }
#landing-search:focus { border-color: var(--accent); background: rgba(255,255,255,.14); }
#landing-search:disabled { opacity: .6; }
/* Search: same height as the bar; dimmed until a result has been picked */
#landing-go {
  flex: none; height: 54px; padding: 0 30px;
  font-size: 16px; font-weight: 600; font-family: inherit;
  border-radius: var(--radius); cursor: pointer;
  background: var(--accent); border: 1px solid var(--accent); color: #04232B;
}
#landing-go:disabled { opacity: .45; cursor: not-allowed; }
#landing-go:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }

#landing-results {
  list-style: none; margin: 10px 0 0; padding: 0; max-width: 720px;
  max-height: 260px; overflow-y: auto;
  background: var(--surface); color: var(--text);
  border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow);
}
#landing-results:empty { display: none; }
#landing-results li {
  padding: 9px 14px; cursor: pointer; font-size: 13px; line-height: 1.4;
  border-bottom: 1px solid var(--border);
}
#landing-results li:last-child { border-bottom: none; }
#landing-results li:hover, #landing-results li.sel { background: var(--fs-bg); }
.lr-sys { display:inline-block; min-width:52px; font-weight:700; font-size:11px;
          letter-spacing:.03em; color: var(--accent); }
.lr-campus { font-weight: 600; }
.lr-prog { color: var(--text2); }

.landing-hint { font-size: 12px; color: rgba(255,255,255,.6); margin: 9px 2px 0; min-height: 15px; }

.ld-quick { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: 18px; }
.ld-quick-label { font-size: 12px; color: rgba(255,255,255,.55); }
.ld-tag {
  font-size: 12.5px; padding: 6px 13px; border-radius: 999px; cursor: pointer;
  background: none; font-family: inherit;
  border: 1px solid rgba(255,255,255,.35); color: #fff;
}
.ld-tag:hover { background: rgba(255,255,255,.14); }

.landing-skip {
  background: none; border: none; font-family: inherit; font-size: 15px;
  color: rgba(255,255,255,.65); cursor: pointer; text-decoration: underline;
  padding: 6px 0; margin-top: auto; align-self: flex-start;
}
.landing-skip:hover { color: #fff; }

/* ── Stats panel with abstract background ─────────────────────────────── */
.ld-stats-wrap {
  position: relative; height: 100%; box-sizing: border-box;
  padding: 46px 44px 34px 44px; display: flex; flex-direction: column;
}
.ld-stats-head {
  font-size: 11.5px; font-weight: 700; letter-spacing: .15em; text-transform: uppercase;
  color: var(--ld-eyebrow); margin-bottom: 4px;
}
.ld-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 20px 18px; }
/* icon + figure side by side */
.ld-stat {
  position: relative; padding: 16px 16px 16px 18px;
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 8px; overflow: hidden;
  display: flex; align-items: center; gap: 12px;
}
.ld-stat::before {
  content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 3px;
  background: var(--accent); opacity: .85;
}
.ld-stat-ic {
  flex: none; width: 44px; height: 44px; border-radius: 50%;
  background: rgba(0,166,166,.18);
  display: flex; align-items: center; justify-content: center;
}
.ld-stat-ic svg {
  width: 22px; height: 22px; fill: none;
  stroke: #5FD4D4; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round;
}
.ld-stat-txt { min-width: 0; }
/* lead tile spans both columns with a larger figure */
.ld-stat.wide { grid-column: 1 / -1; background: rgba(255,255,255,.10); }
.ld-stat.wide .ld-stat-n { font-size: 46px; }
.ld-stat.wide .ld-stat-ic { width: 52px; height: 52px; }
.ld-stat.wide .ld-stat-ic svg { width: 26px; height: 26px; }
.ld-stat-n { font-size: 34px; font-weight: 700; line-height: 1; color: #fff; }
/* labels stay on one line so every tile is the same height; the room for
   them comes from the tighter icon gap and panel padding below */
.ld-stat-l { font-size: 12px; color: rgba(255,255,255,.7); margin-top: 6px; white-space: nowrap; }

/* stage footer */
.ld-foot {
  flex: none; display: flex; align-items: center; justify-content: center;
  gap: 10px; flex-wrap: wrap; text-align: center;
  padding: 16px 56px; border-top: 1px solid rgba(255,255,255,.14);
  font-size: 12.5px; color: rgba(255,255,255,.65);
}
.ld-foot a {
  color: rgba(255,255,255,.85); text-decoration: underline; text-underline-offset: 2px;
}
.ld-foot a:hover { color: #fff; }
.ld-foot-sep { opacity: .45; }
.ld-foot-btn {
  background: none; border: none; font-family: inherit; font-size: 12.5px;
  color: rgba(255,255,255,.85); text-decoration: underline; text-underline-offset: 2px;
  cursor: pointer; padding: 0;
}
.ld-foot-btn:hover { color: #fff; }

/* Chart loading overlays */
.chart-loading-overlay {
  position:absolute; inset:0; z-index:10; display:flex; flex-direction:column;
  align-items:center; justify-content:center; gap:10px;
  background:var(--surface); border-radius:var(--radius);
  opacity:0; pointer-events:none; transition:opacity 0.15s;
}
.chart-loading-overlay.visible { opacity:1; pointer-events:all; }
.chart-loading-overlay .cspin {
  width:32px; height:32px; border:3px solid var(--border);
  border-top-color:var(--accent); border-radius:50%; animation:spin .7s linear infinite;
}
.chart-loading-overlay .cspin-label { font-size:11px; color:var(--text3); font-weight:500; }
/* Top progress bar */
#data-fetch-bar {
  position:fixed; top:0; left:0; right:0; height:3px; z-index:9999;
  background:linear-gradient(90deg,#003B73 0%,#00A6A6 50%,#003B73 100%);
  background-size:200% 100%; animation:shimmer 1.2s infinite linear; display:none;
}
#data-fetch-bar.visible { display:block; }
@keyframes shimmer { 0%{background-position:200% 0} 100%{background-position:-200% 0} }

/* Employment location map */
#empl-map-svg { width:100%; display:block; }
#empl-map-wrap { position:relative; }
/* touch: a tapped tooltip stays up until a tap elsewhere (a hover-out from a
   mouse pointer parked elsewhere, e.g. on a touch laptop, cannot hide it) */
.empl-map-tip.pinned { display: block !important; }
/* map tooltips are display-only: taps and clicks pass through to the map */
.empl-map-tip {
  position:absolute; pointer-events:none;
  background:var(--surface); border:1px solid var(--border);
  border-radius:var(--radius); padding:8px 12px; font-size:12px;
  color:var(--text); display:none; z-index:5;
  box-shadow:var(--shadow); max-width:200px; line-height:1.5;
}
.empl-map-tip strong { font-weight:600; display:block; margin-bottom:2px; font-size:12px; }
#empl-legend {
  display:flex; align-items:center; gap:8px; margin-top:10px;
  font-size:11px; color:var(--text3); flex-wrap:wrap;
}
#empl-legend-bar { height:8px; flex:0 0 160px; border-radius:3px; }
#empl-no-data-note { font-size:11px; color:var(--text3); margin-top:6px; }

/* ── About Tab ─────────────────────────────────────────────────────────── */
/* the site's full name, leading the About NC TOWER card */
.about-lead { display: inline-block; font-weight: 700; color: var(--text); margin-bottom: 2px; }
.about-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-bottom: 24px; }
.about-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 20px 22px; box-shadow: var(--shadow);
}
.about-card p + p { margin-top: 8px; }
.about-body-row { display: flex; gap: 20px; align-items: flex-start; }
.about-body-text { flex: 1 1 auto; min-width: 0; }
/* partner logos, one column to the right of the text */
.about-logos {
  flex: 0 0 132px; display: flex; flex-direction: column; gap: 14px; align-items: center;
}
.about-logos a { display: flex; justify-content: center; width: 100%; }
.about-logos img { max-width: 132px; max-height: 44px; width: auto; height: auto; object-fit: contain; }
/* download links, grouped by education system */
.about-dl-groups {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 14px 20px; margin-top: 14px;
}
.about-dl-head {
  font-size: 11px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase;
  color: var(--text3); margin-bottom: 6px;
}
.about-dl {
  display: flex; align-items: baseline; gap: 6px; padding: 3px 0;
  font-size: 12.5px; line-height: 1.35; color: var(--accent); text-decoration: none;
}
.about-dl:hover { text-decoration: underline; }
/* small download glyph, drawn in the link colour */
.about-dl::before {
  content: ''; flex: none; width: 11px; height: 11px; transform: translateY(1px);
  background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 3v12M6 11l6 6 6-6M4 21h16'/%3E%3C/svg%3E") center/contain no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 3v12M6 11l6 6 6-6M4 21h16'/%3E%3C/svg%3E") center/contain no-repeat;
}

.about-card-header {
  display: flex; align-items: center; gap: 10px; margin-bottom: 10px;
}
.about-card-title { font-size: 18px; font-weight: 700; color: var(--text); }
.about-card p { font-size: 12px; color: var(--text2); line-height: 1.65; margin-bottom: 8px; }
.about-card p:last-child { margin-bottom: 0; }
.about-card a { color: var(--accent); text-decoration: none; }
.about-card a:hover { text-decoration: underline; }

/* FAQ accordion */
.about-faq { margin-bottom: 8px; }
.about-faq-title {
  font-size: 14px; font-weight: 600; color: var(--text); margin-bottom: 14px;
}
.faq-item {
  border: 1px solid var(--border); border-radius: var(--radius);
  margin-bottom: 8px; overflow: hidden; background: var(--surface);
}
.faq-q {
  width: 100%; text-align: left; padding: 12px 16px;
  font-size: 13px; font-weight: 500; color: var(--text);
  background: var(--surface); display: flex; justify-content: space-between;
  align-items: center; gap: 8px; cursor: pointer; border: none;
  transition: background .15s;
}
.faq-q:hover { background: var(--bg2); }
.faq-q .faq-chevron {
  flex-shrink: 0; width: 16px; height: 16px; transition: transform .2s;
  stroke: var(--text3); fill: none; stroke-width: 2;
}
.faq-q.open .faq-chevron { transform: rotate(180deg); }
.faq-q.open { color: var(--accent); background: var(--bg2); }
.faq-a {
  display: none; padding: 0 16px 14px; font-size: 12px; color: var(--text2);
  line-height: 1.7; border-top: 1px solid var(--border);
}
.faq-a.open { display: block; padding-top: 12px; }
.faq-a ul { margin: 6px 0 0 16px; }
.faq-a ul li { margin-bottom: 3px; }
.faq-a a { color: var(--accent); }
/* Privacy popup: opened from the landing page footer, centred above it */
#privacy-popup {
  display: none;
  position: fixed;
  left: 50%; top: 50%;
  transform: translate(-50%,-50%);
  width: 420px;
  max-height: 70vh;
  overflow-y: auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow2);
  padding: 16px;
  z-index: 1000;
  font-size: 11px;
  color: var(--text2);
  line-height: 1.65;
}
#privacy-popup.visible { display: block; }
#privacy-popup h3 {
  font-size: 12px; font-weight: 600;
  color: var(--text); margin-bottom: 8px;
}
#privacy-popup h4 {
  font-size: 11px; font-weight: 600;
  color: var(--text); margin: 10px 0 4px;
}
#privacy-popup-close {
  position: sticky; top: 0; float: right;
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: 4px; padding: 2px 8px;
  font-size: 11px; cursor: pointer; color: var(--text2);
  margin-bottom: 4px;
}
#privacy-popup-close:hover { background: var(--bg3); }

/* ══ Phones and portrait tablets (up to 900px) ═══════════════════════════
   - the filter sidebar becomes a slide-out panel, opened from a top bar
   - charts stack one per row at a readable height and the page scrolls
     (the fit-to-screen layout would squeeze them into slivers)
   - touch targets 40-44px; form fields 16px so iPhones don't zoom in
   Above 900px nothing here applies: the desktop layout is unchanged. */
#mobile-bar, #sb-close, #ld-menu-btn { display: none; }
#sidebar-backdrop { display: none; }
@media (max-width: 900px) {
  #app { flex-direction: column; }
  #main { width: 100%; }

  /* slide-out filter panel */
  #sidebar {
    position: fixed; top: 0; left: 0; bottom: 0; z-index: 1000;
    width: min(88vw, 340px); height: auto; overflow-y: auto;
    transform: translateX(-100%); visibility: hidden;      /* hidden: out of the tab order */
    transition: transform .25s ease, visibility 0s linear .25s;
  }
  body.sb-open #sidebar {
    transform: none; visibility: visible; box-shadow: var(--shadow2);
    transition: transform .25s ease;
  }
  #sidebar-backdrop {
    display: block; position: fixed; inset: 0; z-index: 999;
    background: rgba(5,7,10,.45); opacity: 0; pointer-events: none; transition: opacity .25s;
  }
  body.sb-open #sidebar-backdrop { opacity: 1; pointer-events: auto; }
  #sidebar-header { position: relative; }
  #sb-close {
    display: inline-flex; align-items: center; justify-content: center;
    position: absolute; top: 6px; right: 6px; width: 40px; height: 40px;
    font-size: 26px; line-height: 1; color: var(--sb-text); cursor: pointer;
    background: none; border: none; border-radius: 4px;
  }

  /* top bar */
  #mobile-bar {
    display: flex; align-items: center; justify-content: space-between; gap: 10px;
    flex: none; padding: 6px 10px; background: var(--surface); border-bottom: 1px solid var(--border);
  }
  #mobile-filters-btn {
    display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 14px;
    font-family: inherit; font-size: 15px; font-weight: 600; cursor: pointer;
    color: #FFFFFF; background: var(--lead-navy); border: 1px solid var(--lead-navy); border-radius: 4px;
  }
  #mobile-filters-btn svg { width: 16px; height: 16px; fill: currentColor; }
  #mobile-logo { background: none; border: none; padding: 0; cursor: pointer; }
  #mobile-logo img { height: 34px; width: auto; display: block; }

  /* tab bar: scrolls sideways, never vertically */
  #tab-bar { overflow-y: hidden; scrollbar-width: thin; }
  .tab-btn { min-height: 44px; }

  /* charts: one per row, readable height, normal scrolling */
  .tab-panel { overflow-y: auto; -webkit-overflow-scrolling: touch; }
  :is(#tab-overview,#tab-outcomes,#tab-employment,#tab-enrollment,#tab-spotlights).active { display: block; }
  :is(#tab-overview,#tab-outcomes,#tab-employment,#tab-enrollment,#tab-spotlights)
    > :is(.chart-grid-1,.chart-grid-2),
  #tab-overview > .overview-grid {
    display: grid; grid-template-columns: 1fr; grid-template-rows: none; flex: none;
  }
  :is(#tab-overview,#tab-outcomes,#tab-employment,#tab-enrollment,#tab-spotlights) .chart-wrap {
    flex: none; height: clamp(240px, 38vh, 340px) !important; min-height: 0;
  }
  /* NC is ~3x wider than tall: size the map area by its shape, not a fixed
     height, so a phone doesn't show the state as a thin band in empty space.
     (Selector must outrank the desktop rule #tab-overview #empl-map-wrap.) */
  #tab-overview .overview-grid #empl-map-wrap { flex: none; height: auto; min-height: 0; aspect-ratio: 2.2 / 1; }
  .chart-inline-table.visible { max-height: 420px !important; }

  /* title row wraps; Share stays on the System / Campus line */
  /* not pinned on phones: it would float over the charts as they scroll, and
     take ~100px of a small screen */
  #filter-summary { position: static; }
  #filter-summary .fs-title { font-size: 18px; }
  /* Credential and Years on their own lines below the program name */
  #filter-summary .fs-row { flex-direction: column; align-items: flex-start; gap: 3px; }
  #filter-summary .fs-spacer, #filter-summary .fs-meta-sep { display: none; }
  /* Compare: heading and Share stay on one line (not stacked like the meta lines) */
  #filter-summary .fs-row-cmp { flex-direction: row; align-items: center; gap: 12px; }

  /* ── landing page: a normal scrolling page instead of the scaled stage ── */
  #landing { display: block; overflow-y: auto; -webkit-overflow-scrolling: touch; background: var(--ld-hero); }
  #ld-stage {
    width: auto; height: auto; min-height: 100%; transform: none !important;
    border-radius: 0; box-shadow: none; display: flex; flex-direction: column;
  }
  #ld-art-stage { display: none; }                 /* decorative, drawn for the 1600x800 stage */
  .ld-nav { flex-wrap: wrap; gap: 0 12px; padding: 10px 16px; }
  .ld-brand { margin-right: auto; }
  .ld-brand img { height: 38px; }
  #ld-menu-btn {
    display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px;
    background: none; border: 1px solid rgba(255,255,255,.38); border-radius: 4px; color: #fff; cursor: pointer;
  }
  #ld-menu-btn svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
  .ld-nav > a { display: none; }
  .ld-nav.open > a {
    display: block; flex: 0 0 100%; padding: 13px 2px; font-size: 16px;
    border-top: 1px solid rgba(255,255,255,.14);
  }
  .ld-nav.open > a:first-of-type { margin-top: 10px; }
  .ld-nav.open > .ld-cta { border: none; border-top: 1px solid rgba(255,255,255,.14); border-radius: 0; text-align: left; }
  .ld-body { display: block; }
  .ld-left { padding: 22px 16px 10px; }
  .ld-h1 { font-size: clamp(28px, 8vw, 40px); }
  .ld-h1 > span { white-space: normal; }           /* the three designed lines may wrap */
  .ld-lede { font-size: 16px; margin-bottom: 20px; }
  .ld-searchrow { max-width: none; }
  #landing-search { height: 48px; min-width: 0; }
  #landing-go { height: 48px; padding: 0 18px; }
  .ld-tag { min-height: 40px; }
  .landing-skip { min-height: 44px; }
  .ld-right { overflow: visible; }
  .ld-stats-wrap { height: auto; padding: 18px 16px 24px; }
  .ld-stats { grid-template-columns: 1fr 1fr; gap: 10px; }
  .ld-foot { flex-direction: column; gap: 6px; padding: 16px; font-size: 13px; }
  .ld-foot-sep { display: none; }

  /* privacy policy: a sheet across the bottom of the screen (the desktop
     420px centred box is wider than a phone) */
  #privacy-popup {
    left: 12px; right: 12px; top: auto; bottom: 12px; width: auto;
    transform: none; max-height: 75vh;
  }

  /* About tab: the two cards stacked (About NC TOWER, then About the Data),
     and the partner logos below the text instead of in a side column */
  .about-grid { grid-template-columns: 1fr; }
  .about-body-row { flex-direction: column; }
  .about-logos { flex: none; width: 100%; flex-direction: row; flex-wrap: wrap; justify-content: center; gap: 14px 22px; }
  .about-logos a { width: auto; }

  /* Compare tab: one chart per row; picker stacks */
  #tab-compare .chart-grid-2 { grid-template-columns: 1fr; }
  .cmp-add { flex-direction: column; align-items: stretch; }
  .cmp-add .styled-select { max-width: none; }
  .cmp-btn { height: 44px; }

  /* campus map: full screen */
  #campus-map-modal { padding: 0; }
  .cmm-panel { width: 100%; height: 100%; border: none; border-radius: 0; }
  .cmm-close { min-width: 44px; min-height: 44px; }

  /* touch targets */
  .chip, .demo-chip, #year-chips button { min-height: 40px; }
  .styled-select, #sb-search { min-height: 44px; font-size: 16px; }
  .reset-btn { min-height: 44px; }
  .stepper-btn { width: 40px; height: 40px; }
  .stepper-select { height: 40px; font-size: 16px; }
}
