:root{
  --ink: #0f1b2d;
  --ink-2: #142238;
  --ink-3: #1b2c47;
  --gold: #c8a24d;
  --gold-soft: #e3c988;
  --rose: #b5563f;
  --amber: #cf9a3e;
  --teal: #3f8a72;
  --line: rgba(200,162,77,0.18);
  --text-hi: #f4efe2;
  --text-lo: #a9b4c6;
  --font-display: "Fraunces", Georgia, serif;
  --font-body: "IBM Plex Sans", -apple-system, sans-serif;
  --font-mono: "IBM Plex Mono", monospace;
}

*{ box-sizing: border-box; }
html,body{ margin:0; }
body{
  font-family: var(--font-body);
  background: var(--ink);
  color: var(--text-hi);
}

.app{ max-width: 1000px; margin: 0 auto; padding-bottom: 60px; }

/* ---------- Topbar ---------- */
.topbar{ padding: 22px 22px 14px; border-bottom: 1px solid var(--line); }
.brand{ display:flex; align-items:flex-start; gap:14px; }
.brand-mark{
  font-family: var(--font-display); font-weight: 600; font-size: 19px; color: var(--ink);
  background: linear-gradient(135deg, var(--gold-soft), var(--gold));
  width: 44px; height:44px; border-radius: 50%;
  display:flex; align-items:center; justify-content:center; flex-shrink: 0;
  box-shadow: 0 0 0 3px rgba(200,162,77,0.15); margin-top: 2px;
}
.brand-text h1{ font-family: var(--font-display); font-size: 22px; font-weight: 600; margin: 0; line-height:1.25; }
.subtitle{ margin: 6px 0 0; font-size: 13px; color: var(--text-lo); line-height:1.5; }

.intro{ padding: 16px 22px; border-bottom: 1px solid var(--line); background: rgba(200,162,77,0.04); }
.intro-content{
  max-height: 130px; overflow: hidden; position: relative;
  transition: max-height 0.35s ease;
}
.intro-content.expanded{ max-height: 2400px; }
.intro-content:not(.expanded)::after{
  content: ''; position: absolute; left:0; right:0; bottom:0; height: 50px;
  background: linear-gradient(180deg, transparent, var(--ink) 92%);
}
.intro p{ margin:0 0 10px; font-size: 13px; color: var(--text-lo); line-height: 1.7; max-width: 760px; }
.intro p:last-child{ margin-bottom: 0; }
.intro p strong{ color: var(--text-hi); font-family: var(--font-display); font-size: 14px; }
.intro-toggle{
  margin-top: 10px; background: none; border: 1px solid var(--line); color: var(--gold-soft);
  border-radius: 7px; padding: 6px 14px; font-family: var(--font-body); font-size: 12px;
  font-weight: 600; cursor: pointer;
}
.intro-toggle:hover{ background: rgba(200,162,77,0.08); }

/* ---------- Tabs ---------- */
.tabs{
  display:flex; gap: 6px; padding: 18px 22px 0;
  border-bottom: 1px solid var(--line);
}
.tab-btn{
  background: none; border: none; color: var(--text-hi);
  font-family: var(--font-display); font-size: 16.5px; font-weight: 700;
  letter-spacing: 0.01em;
  padding: 12px 18px; cursor: pointer; border-radius: 10px 10px 0 0;
  position: relative; top: 1px;
  opacity: 0.55;
}
.tab-btn.active{
  color: var(--gold-soft);
  opacity: 1;
  border-bottom: 3px solid var(--gold);
  background: var(--ink-2);
}
.tab-btn:hover:not(.active){ opacity: 0.85; color: var(--gold-soft); }

.tab-panel{ display:none; }
.tab-panel.active{ display:block; }

/* ---------- Stats strip ---------- */
.stats-strip{
  display:flex; gap: 14px; padding: 20px 22px; border-bottom: 1px solid var(--line);
  flex-wrap: wrap;
}
.stat{ flex:1; min-width: 110px; text-align:center; background: var(--ink-2); border: 1px solid var(--line); border-radius: 10px; padding: 14px 10px; }
.stat-value{ display:block; font-family: var(--font-display); font-size: 26px; font-weight: 600; color: var(--gold-soft); }
.stat-label{ display:block; font-size: 11px; color: var(--text-lo); text-transform: uppercase; letter-spacing: 0.05em; margin-top: 3px; }
.stat-insight{ flex: 1.6; min-width: 200px; display:flex; align-items:center; justify-content:center; text-align:left; }
.stat-insight-text{ font-size: 12px; color: var(--text-hi); line-height: 1.5; }
.stat-insight-text strong{ color: var(--gold-soft); }

/* ---------- Insight cards (Bac) ---------- */
.insights{
  display:flex; gap: 12px; padding: 0 22px 20px; flex-wrap: wrap;
}
.insight-card{
  flex: 1; min-width: 240px;
  background: var(--ink-2); border: 1px solid var(--line); border-radius: 10px;
  padding: 14px 16px;
}
.insight-card h3{
  font-family: var(--font-body); font-size: 11px; text-transform: uppercase; letter-spacing: 0.05em;
  color: var(--text-lo); margin: 0 0 8px; font-weight: 600;
}
.insight-card p{ margin:0; font-size: 13px; line-height: 1.6; color: var(--text-hi); }
.insight-card strong{ color: var(--gold-soft); }

/* ---------- Distribution chart ---------- */
.distribution{ padding: 22px; border-bottom: 1px solid var(--line); }
.distribution h2{ font-family: var(--font-display); font-size: 15.5px; font-weight: 600; margin: 0 0 14px; }
.dist-chart{ display:flex; flex-direction:column; gap: 7px; }
.dist-note{ margin: 14px 0 0; font-size: 11.5px; color: var(--text-lo); line-height: 1.6; }
.dist-row{ display:flex; align-items:center; gap: 10px; cursor:pointer; }
.dist-row:hover .dist-bar-fill{ filter: brightness(1.15); }
.dist-label{ width: 108px; flex-shrink:0; font-size: 11.5px; color: var(--text-lo); font-family: var(--font-mono); text-align:right; }
.dist-bar{ flex:1; height: 20px; background: var(--ink-2); border-radius: 5px; overflow:hidden; border: 1px solid var(--line); }
.dist-bar-fill{ height:100%; border-radius: 5px 0 0 5px; transition: width 0.4s ease; }
.dist-count{ width: 56px; flex-shrink:0; font-size: 12px; color: var(--text-hi); font-family: var(--font-mono); font-weight:500; }

/* ---------- Controls ---------- */
.controls{
  display:flex; gap: 10px; padding: 18px 22px; border-bottom: 1px solid var(--line);
  flex-wrap: wrap; position: sticky; top: 0; background: var(--ink); z-index: 10;
}
.search-box{
  flex: 2; min-width: 200px; display:flex; align-items:center; gap:8px;
  background: var(--ink-2); border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; color: var(--text-lo);
}
.search-box input{ background:none; border:none; outline:none; width:100%; color: var(--text-hi); font-family: var(--font-body); font-size: 13.5px; }
select{
  flex: 1; min-width: 150px; background: var(--ink-2); color: var(--text-hi);
  border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; font-family: var(--font-body); font-size: 13.5px;
}

/* ---------- Bands ---------- */
.bands{ padding: 6px 22px 0; }
.band{ border: 1px solid var(--line); border-radius: 12px; margin-bottom: 12px; overflow: hidden; background: var(--ink-2); }
.band-header{ display:flex; align-items:center; gap: 12px; padding: 14px 16px; cursor: pointer; user-select: none; }
.band-swatch{ width: 12px; height: 12px; border-radius: 50%; flex-shrink:0; }
.band-title{ font-family: var(--font-display); font-weight: 600; font-size: 15.5px; flex:1; }
.band-meta{ font-size: 12px; color: var(--text-lo); font-family: var(--font-mono); }
.band-chevron{ transition: transform 0.2s ease; color: var(--text-lo); flex-shrink:0; }
.band.open .band-chevron{ transform: rotate(180deg); }
.band-body{ display:none; border-top: 1px solid var(--line); }
.band.open .band-body{ display:block; }

.school-row{ display:flex; align-items:flex-start; gap: 12px; padding: 12px 16px; border-bottom: 1px dashed rgba(255,255,255,0.06); cursor: default; }
.school-row.clickable{ cursor: pointer; }
.school-row.clickable:hover{ background: rgba(200,162,77,0.05); }
.school-row:last-child{ border-bottom:none; }
.school-rank{ width: 22px; flex-shrink:0; font-family: var(--font-mono); font-size: 11px; color: var(--text-lo); text-align:right; margin-top: 2px; }
.school-main{ flex:1; min-width:0; display:flex; flex-direction:column; gap: 8px; }
.school-info{ min-width:0; }
.school-name{ font-size: 13.5px; font-weight: 500; color: var(--text-hi); }
.badge-gimnaziu{
  display:inline-block; font-size: 9px; font-family: var(--font-mono); font-weight: 600;
  color: var(--ink); background: var(--gold-soft); border-radius: 4px;
  padding: 1px 5px; margin-left: 6px; vertical-align: middle; cursor: help;
  text-transform: uppercase; letter-spacing: 0.02em;
}
.school-address{ font-size: 12px; color: var(--text-lo); margin-top: 2px; }
.school-metrics{ display:flex; align-items:center; gap: 16px; width: 100%; flex-wrap: wrap; }
.metric{ text-align:center; min-width: 44px; flex-shrink:0; }
.metric-value{ display:block; font-family: var(--font-mono); font-size: 13px; font-weight: 600; color: var(--gold-soft); }
.metric-label{ display:block; font-size: 9.5px; color: var(--text-lo); text-transform: uppercase; letter-spacing: 0.04em; margin-top:1px; }
.metric-prom .metric-value.high{ color: var(--teal); }
.metric-prom .metric-value.low{ color: var(--rose); }

.chart-cell{ flex: 1; min-width: 190px; cursor: help; }
.mini-bars{ display:flex; align-items:flex-end; gap: 4px; height: 42px; width: 100%; }
.mbar-col{ flex:1; min-width: 14px; display:flex; flex-direction:column; align-items:center; justify-content:flex-end; height: 100%; }
.mbar-label{ font-family: var(--font-mono); font-size: 8.5px; line-height:1; color: var(--text-lo); margin-bottom: 2px; }
.mbar{ width: 100%; border-radius: 2px 2px 0 0; min-width: 3px; opacity: 0.9; }
.mbar:hover{ opacity: 1; }

.empty-note{ padding: 14px 16px; font-size: 12.5px; color: var(--text-lo); font-style: italic; }

.app-footer{ padding: 22px; }
.app-footer p{ font-size: 11px; color: var(--text-lo); line-height: 1.6; margin:0; }

/* ---------- Subject distribution charts (Top licee) ---------- */
.subject-charts{ padding: 4px 22px 20px; }
.subject-charts h2{ font-family: var(--font-display); font-size: 15.5px; font-weight: 600; margin: 0 0 4px; }
.scope-tag{ font-family: var(--font-body); font-size: 12px; font-weight: 400; color: var(--gold-soft); }
.subject-chart-grid{
  display:grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 14px; margin-top: 16px;
}
.subject-chart-card{
  background: var(--ink-2); border: 1px solid var(--line); border-radius: 10px; padding: 12px;
}
.subject-chart-title{ font-size: 11.5px; color: var(--text-lo); text-align:center; margin-bottom: 10px; min-height: 28px; display:flex; align-items:center; justify-content:center; }
.subject-vstack-wrap{ position: relative; width: 64px; height: 150px; margin: 0 auto; }
.subject-vstack{
  display:flex; flex-direction: column-reverse; height: 100%; width: 100%;
  border-radius: 6px; overflow:hidden; border: 1px solid var(--line);
}
.subject-vstack-seg{
  display:flex; align-items:center; justify-content:center; width:100%;
  font-family: var(--font-mono); font-size: 10px; font-weight:600; color: rgba(15,27,45,0.85);
  min-height: 0;
}
.subject-pass-line{
  position:absolute; left: -8px; right: -8px; height: 0;
  border-top: 1.5px dashed rgba(244,239,226,0.55);
  pointer-events:none;
}
.subject-pass-line[data-grade="5"]{
  border-top: 2px dashed var(--text-hi);
}
.subject-pass-label{
  position:absolute; right: -16px; top: -8px;
  font-family: var(--font-mono); font-size: 9.5px; color: rgba(244,239,226,0.65);
}
.subject-pass-line[data-grade="5"] .subject-pass-label{
  color: var(--text-hi); font-weight: 700; font-size: 10px;
}
.subject-chart-total{ text-align:center; font-family: var(--font-mono); font-size: 11px; color: var(--gold-soft); margin-top: 8px; }
.subject-legend{ display:flex; flex-wrap:wrap; gap: 10px; margin-top: 6px; justify-content:flex-start; }
.subject-legend-item{ display:flex; align-items:center; gap: 5px; font-size: 10.5px; color: var(--text-lo); }
.subject-legend-swatch{ width: 10px; height: 10px; border-radius: 2px; }

/* ---------- Segmented subject table (liceu modal) ---------- */
.subject-table{ margin-top: 4px; }
.subject-table-header{
  display:flex; gap: 2px; margin: 0 0 8px 190px;
}
.subject-table-header span{
  flex:1; text-align:center; font-size: 9px; color: var(--text-lo); font-family: var(--font-mono);
}
.subject-group-title{
  font-size: 11px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--gold-soft);
  margin: 16px 0 6px; font-weight: 600;
}
.subject-group-title:first-child{ margin-top: 0; }
.subject-seg-row{ display:flex; align-items:center; gap: 10px; margin-bottom: 8px; }
.subject-seg-label{ width: 180px; flex-shrink:0; font-size: 12px; color: var(--text-hi); line-height:1.3; }
.subject-seg-track{
  flex:1; display:flex; gap: 1px; height: 24px; border-radius: 4px; overflow:hidden;
  background: var(--ink); border: 1px solid var(--line);
}
.subject-seg{
  display:flex; align-items:center; justify-content:center;
  font-family: var(--font-mono); font-size: 9.5px; color: rgba(15,27,45,0.85); font-weight:600;
  min-width: 0;
}
.subject-seg-avg{ width: 68px; flex-shrink:0; font-family: var(--font-mono); font-size: 11.5px; color: var(--gold-soft); text-align:right; }

/* ---------- Choropleth map ---------- */
.choropleth-section{ padding: 20px 22px 8px; border-bottom: 1px solid var(--line); }
.choropleth-section h2{ font-family: var(--font-display); font-size: 15.5px; font-weight: 600; margin: 0 0 14px; }
.choropleth-wrap{ display:flex; gap: 24px; align-items:flex-start; flex-wrap: wrap; }
.choropleth-map{ flex: 1; min-width: 280px; max-width: 520px; }
.choropleth-map svg{ width: 100%; height: auto; display:block; }
.map-county{
  stroke: var(--ink); stroke-width: 1; cursor: pointer;
  transition: opacity 0.15s ease;
}
.map-county:hover{ opacity: 0.8; stroke: var(--gold-soft); stroke-width: 1.5; }
.map-county.dimmed{ fill: #4a5568 !important; opacity: 0.35; cursor: pointer; }
.map-county.dimmed:hover{ opacity: 0.55; }
.map-county.selected{ stroke: var(--gold); stroke-width: 2.5; }
.choropleth-legend{
  display:flex; flex-direction:column; gap: 6px; min-width: 170px; padding-top: 4px;
}
.choropleth-legend-title{ font-size: 11px; color: var(--text-lo); text-transform:uppercase; letter-spacing:0.04em; margin-bottom: 4px; }
.legend-class-row{ display:flex; align-items:center; gap: 8px; font-size: 11.5px; color: var(--text-lo); font-family: var(--font-mono); }
.legend-class-swatch{ width: 16px; height: 16px; border-radius: 4px; flex-shrink:0; border: 1px solid rgba(255,255,255,0.15); }
.choropleth-selected-note{ font-size: 12px; color: var(--gold-soft); margin-top: 6px; font-family: var(--font-body); }
.map-tooltip{
  position: fixed; pointer-events:none; z-index: 3000;
  background: var(--ink-2); border: 1px solid var(--gold); border-radius: 8px;
  padding: 8px 12px; font-size: 12px; color: var(--text-hi);
  box-shadow: 0 8px 20px rgba(0,0,0,0.4);
}
.map-tooltip strong{ color: var(--gold-soft); }

@media (max-width: 640px){
  .choropleth-wrap{ flex-direction: column; }
  .choropleth-legend{ flex-direction: row; align-items:center; flex-wrap:wrap; gap: 10px; }
  .legend-class-row{ flex-direction: column; align-items:flex-start; gap: 2px; }
}

/* ---------- Terms & Conditions ---------- */
.terms{ padding: 18px 22px 30px; border-top: 1px solid var(--line); }
.terms-toggle{
  background: none; border: 1px solid var(--line); color: var(--text-lo);
  border-radius: 7px; padding: 8px 16px; font-family: var(--font-body); font-size: 12px;
  font-weight: 600; cursor: pointer;
}
.terms-toggle:hover{ background: rgba(200,162,77,0.06); color: var(--gold-soft); }
.terms-content{ margin-top: 16px; max-width: 760px; }
.terms-content h2{ font-family: var(--font-display); font-size: 16px; margin: 0 0 14px; color: var(--text-hi); }
.terms-content p{ font-size: 12px; color: var(--text-lo); line-height: 1.7; margin: 0 0 10px; }
.terms-content p strong{ color: var(--text-hi); font-family: var(--font-display); font-size: 13px; display:inline-block; margin-top: 6px; }
.terms-content ul{ margin: 0 0 12px; padding-left: 20px; }
.terms-content li{ font-size: 12px; color: var(--text-lo); line-height: 1.7; margin-bottom: 4px; }

/* ---------- Admitere: profile chart + migration panel ---------- */
.profil-chart-grid{
  display:grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 14px; margin-top: 16px;
}
.profil-card{
  background: var(--ink-2); border: 1px solid var(--line); border-radius: 10px; padding: 14px;
  text-align:center;
}
.profil-card-name{ font-size: 12px; color: var(--text-lo); margin-bottom: 8px; min-height: 30px; }
.profil-card-medie{ font-family: var(--font-display); font-size: 26px; font-weight:700; color: var(--gold-soft); }
.profil-card-detail{ font-size: 10.5px; color: var(--text-lo); margin-top: 6px; line-height:1.5; }
.profil-card-detail strong{ color: var(--text-hi); }

.migration-panel{ padding: 4px 22px 20px; }
.migration-card{
  background: var(--ink-2); border: 1px solid var(--line); border-radius: 12px; padding: 18px 20px;
}
.migration-card h3{ font-family: var(--font-display); font-size: 15px; margin: 0 0 14px; }
.migration-stats{ display:flex; gap: 14px; flex-wrap:wrap; margin-bottom: 16px; }
.migration-stat{ flex:1; min-width: 130px; text-align:center; }
.migration-stat-value{ display:block; font-family: var(--font-mono); font-size: 19px; font-weight:700; color: var(--gold-soft); }
.migration-stat-label{ display:block; font-size: 10.5px; color: var(--text-lo); margin-top:2px; }
.migration-cols{ display:grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.migration-col h4{ font-size: 11px; text-transform:uppercase; letter-spacing:0.04em; color: var(--gold-soft); margin: 0 0 10px; }
.origin-row{ display:flex; align-items:center; gap: 8px; margin-bottom: 6px; font-size: 12px; }
.origin-bar-track{ flex:1; height: 8px; background: var(--ink); border-radius: 4px; overflow:hidden; border: 1px solid var(--line); }
.origin-bar-fill{ height:100%; background: linear-gradient(90deg, var(--gold), var(--gold-soft)); }
.origin-label{ width: 130px; flex-shrink:0; color: var(--text-hi); }
.origin-value{ width: 70px; flex-shrink:0; text-align:right; font-family: var(--font-mono); color: var(--text-lo); }
.liceu-alt-row{ display:flex; justify-content:space-between; gap: 8px; font-size: 12px; margin-bottom: 8px; padding-bottom:8px; border-bottom: 1px dashed rgba(255,255,255,0.06); }
.liceu-alt-row:last-child{ border-bottom:none; }
.liceu-alt-name{ color: var(--text-hi); }
.liceu-alt-loc{ display:block; color: var(--text-lo); font-size: 10.5px; margin-top:1px; }
.liceu-alt-count{ font-family: var(--font-mono); color: var(--gold-soft); font-weight:600; flex-shrink:0; }

@media (max-width: 640px){
  .migration-cols{ grid-template-columns: 1fr; }
  .origin-label{ width: 90px; font-size: 11px; }
}

.paywall-slot{ padding: 0 22px; }
.paywall-banner{
  display:flex; align-items:center; justify-content:space-between; gap: 16px;
  background: linear-gradient(135deg, rgba(200,162,77,0.14), rgba(200,162,77,0.05));
  border: 1px solid var(--gold); border-radius: 12px;
  padding: 16px 20px; margin-bottom: 14px; flex-wrap: wrap;
}
.paywall-banner.unlocked{
  background: rgba(63,138,114,0.10); border-color: var(--teal);
}
.paywall-text{ display:flex; flex-direction:column; gap: 3px; flex: 1; min-width: 220px; }
.paywall-text strong{ font-family: var(--font-display); font-size: 15px; color: var(--gold-soft); }
.paywall-banner.unlocked .paywall-text strong{ color: var(--teal); }
.paywall-text span{ font-size: 12.5px; color: var(--text-hi); line-height: 1.5; }
.paywall-cta{
  background: linear-gradient(135deg, var(--gold-soft), var(--gold));
  color: var(--ink); border: none; border-radius: 8px;
  padding: 12px 20px; font-family: var(--font-body); font-weight: 700; font-size: 13.5px;
  cursor: pointer; white-space: nowrap; flex-shrink: 0;
}
.paywall-cta:hover{ filter: brightness(1.08); }
.paywall-cta:disabled{ opacity: 0.6; cursor: wait; }

.details-btn{
  align-self: flex-start;
  background: none; border: 1px solid var(--gold); color: var(--gold-soft);
  border-radius: 7px; padding: 6px 14px; margin-top: 2px;
  font-family: var(--font-body); font-size: 11.5px; font-weight: 600;
  cursor: pointer;
}
.details-btn:hover{ background: rgba(200,162,77,0.1); }
.details-btn-locked{
  border-color: var(--line); color: var(--text-lo); cursor: pointer;
}
.details-btn-locked:hover{ border-color: var(--gold); color: var(--gold-soft); }

.locked-field{
  filter: blur(6px);
  user-select: none;
  pointer-events: none;
}
.locked-row .school-name::after{
  content: '🔒';
  margin-left: 6px;
  filter: none;
  font-size: 11px;
}
.paywall-toast{
  position: fixed; top: 16px; left:50%; transform: translateX(-50%);
  background: var(--ink-2); border: 1px solid var(--gold); color: var(--text-hi);
  padding: 10px 18px; border-radius: 8px; font-size: 13px; z-index: 2000;
  box-shadow: 0 8px 24px rgba(0,0,0,0.4);
}

.modal-overlay{
  position: fixed; inset:0; background: rgba(5,10,18,0.72);
  align-items:flex-start; justify-content:center;
  padding: 40px 16px; overflow-y:auto; z-index: 1000;
}
.modal-overlay[hidden]{ display: none; }
.modal-overlay:not([hidden]){ display: flex; }
.modal{
  background: var(--ink-2); border: 1px solid var(--line); border-radius: 14px;
  max-width: 640px; width:100%; padding: 26px 24px 30px; position:relative;
}
.modal-close{
  position:absolute; top: 14px; right: 16px; background:none; border:none;
  color: var(--text-lo); font-size: 26px; cursor:pointer; line-height:1;
}
.modal-close:hover{ color: var(--text-hi); }
.modal h2{ font-family: var(--font-display); font-size: 19px; margin: 0 6px 4px 0; padding-right: 30px; }
.modal .modal-address{ font-size: 12.5px; color: var(--text-lo); margin: 0 0 18px; }
.modal-stats{ display:flex; gap: 10px; margin-bottom: 20px; flex-wrap: wrap; }
.modal-stat{ flex:1; min-width: 90px; background: var(--ink); border: 1px solid var(--line); border-radius: 8px; padding: 10px; text-align:center; }
.modal-stat-value{ display:block; font-family: var(--font-mono); font-size: 16px; font-weight:600; color: var(--gold-soft); }
.modal-stat-label{ display:block; font-size: 9.5px; color: var(--text-lo); text-transform:uppercase; margin-top:2px; }

.modal-section{ margin-top: 20px; }
.modal-section h3{ font-family: var(--font-display); font-size: 14px; margin: 0 0 10px; color: var(--text-hi); }
.subject-bar-row{ display:flex; align-items:center; gap: 10px; margin-bottom: 8px; }
.subject-bar-label{ width: 190px; flex-shrink:0; font-size: 12px; color: var(--text-lo); }
.subject-bar-track{ flex:1; height: 14px; background: var(--ink); border-radius: 4px; overflow:hidden; border: 1px solid var(--line); }
.subject-bar-fill{ height:100%; background: linear-gradient(90deg, var(--gold), var(--gold-soft)); border-radius: 4px; }
.subject-bar-value{ width: 74px; flex-shrink:0; font-family: var(--font-mono); font-size: 11.5px; color: var(--text-hi); text-align:right; }

.chip-row{ display:flex; flex-wrap:wrap; gap: 8px; }
.chip{
  background: var(--ink); border: 1px solid var(--line); border-radius: 20px;
  padding: 5px 12px; font-size: 11.5px; color: var(--text-hi);
}
.chip .chip-count{ color: var(--gold-soft); font-family: var(--font-mono); font-weight:600; margin-left: 4px; }

/* ---------- Responsive ---------- */
@media (max-width: 640px){
  .brand-text h1{ font-size: 18px; }
  .subtitle{ font-size: 11.5px; }
  .stats-strip{ flex-wrap: wrap; }
  .dist-label{ width: 84px; font-size: 10.5px; }
  .school-row{ gap: 8px; }
  .school-metrics{ flex-wrap: wrap; row-gap: 8px; }
  .chart-cell{ min-width: 100%; order: 5; }
  .controls{ position: static; }
  .tab-btn{ flex:1; text-align:center; font-size: 12.5px; padding: 10px 6px; letter-spacing: 0; }
  .subject-seg-label{ width: 110px; font-size: 11px; }
  .subject-table-header{ margin-left: 120px; }
  .subject-chart-grid{ grid-template-columns: repeat(2, 1fr); }
}
