/* RISEN 2025–2026 — Explorator interactiv (identitatea vizuală CNE).
   Stil editorial aerisit (tip Our World in Data / The Pudding): Poppins exclusiv, ierarhie clară, linii fine, fără carduri cu umbre identice. */

:root {
  --blue: #0089F7;
  --blue-text: #006EDF;
  --blue-deep: #004B9B;
  --light-blue: #00AAFF;
  --yellow: #F9BB42;
  --yellow-soft: #FEF3D6;
  --navy: #161922;
  --ink: #161922;
  --muted: #555E6F;
  --muted-2: #768094;
  --bg: #FFFFFF;
  --tint: #F6F8FB;
  --tint-2: #EDF1F7;
  --line: #DDE3ED;
  --line-strong: #BFC8D8;
  --danger-bg: #FEF3F2;
  --danger-ink: #912018;
  --font: "Poppins", "Segoe UI", Helvetica, Arial, sans-serif;
  --max-w: 80rem;
  color-scheme: light;
}

*, *::before, *::after {
  box-sizing: border-box;
}

html {
  margin: 0;
  overflow-x: clip;
  scroll-padding-top: 96px;
}

body {
  margin: 0;
  overflow-x: clip;
  background: var(--bg);
  color: var(--ink);
  font: 400 15px/1.55 var(--font);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, p, dl, dd, ul, ol, figure {
  margin: 0;
}

h1, h2, h3 {
  text-wrap: balance;
}

button, input, select {
  font: inherit;
  color: inherit;
}

a {
  color: var(--blue-text);
  text-underline-offset: 3px;
}

:focus-visible {
  outline: 3px solid var(--blue);
  outline-offset: 2px;
  border-radius: 4px;
}

[hidden] {
  display: none !important;
}

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

.skip-link {
  position: absolute;
  left: -9999px;
  top: 8px;
  z-index: 100;
  background: var(--navy);
  color: #fff;
  padding: 8px 14px;
  font-weight: 600;
  text-decoration: none;
}

.skip-link:focus {
  left: 12px;
}

.container {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 clamp(14px, 3vw, 32px);
  min-width: 0;
}

/* ── Banda superioară DATE FICTIVE ────────────────────────────────────────── */
.demo-banner {
  background: var(--yellow);
  color: var(--navy);
  border-bottom: 1px solid #df9f20;
}

.demo-banner-inner {
  padding-top: 9px;
  padding-bottom: 9px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 14px;
  font-size: 13.5px;
  font-weight: 500;
}

.demo-pill {
  background: var(--navy);
  color: var(--yellow);
  font-size: 11.5px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 3px;
  letter-spacing: 0.03em;
  flex-shrink: 0;
}

/* ── Antet ────────────────────────────────────────────────────────────────── */
.top-nav {
  background: var(--navy);
  color: #d6dce8;
  font-size: 13px;
}

.top-nav-inner {
  min-height: 40px;
  padding-top: 6px;
  padding-bottom: 6px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 6px 20px;
}

.brand-mark {
  color: #fff;
  font-weight: 600;
  text-decoration: none;
}

.brand-mark:hover {
  text-decoration: underline;
}

.site-links {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 18px;
}

.site-links a {
  color: #e6ebf5;
  text-decoration: none;
  font-weight: 500;
}

.site-links a:hover {
  color: var(--yellow);
  text-decoration: underline;
}

.site-header {
  border-bottom: 1px solid var(--line);
}

.hero-inner {
  padding-top: clamp(22px, 3.5vw, 38px);
  padding-bottom: clamp(20px, 3vw, 32px);
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
  gap: clamp(20px, 4vw, 48px);
  align-items: end;
}

.hero-kicker {
  color: var(--blue-text);
  font-size: 14px;
  font-weight: 600;
  border-left: 4px solid var(--yellow);
  padding-left: 10px;
  margin-bottom: 8px;
}

.hero-copy h1 {
  font-size: clamp(26px, 3.6vw, 40px);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.025em;
  color: var(--navy);
}

.hero-lead {
  margin-top: 10px;
  color: var(--muted);
  font-size: 15px;
  max-width: 44rem;
}

.hero-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px 18px;
  border-top: 2px solid var(--navy);
  padding-top: 12px;
}

.stat-item {
  min-width: 0;
}

.stat-item dt {
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
  line-height: 1.3;
}

.stat-item dd {
  margin-top: 3px;
  font-size: clamp(20px, 2.3vw, 28px);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.02em;
  color: var(--navy);
  font-variant-numeric: tabular-nums;
}

.stat-item dd small {
  display: block;
  font-size: 11.5px;
  font-weight: 500;
  color: var(--muted);
  letter-spacing: 0;
  margin-top: 2px;
}

/* ── Bara fixă de filtre ──────────────────────────────────────────────────── */
.filter-bar {
  position: sticky;
  top: 0;
  z-index: 30;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}

.filter-bar-inner {
  padding-top: 10px;
  padding-bottom: 10px;
  display: grid;
  gap: 8px;
}

.filter-main-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.filter-title {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--navy);
  margin-right: 4px;
}

.mobile-filter-btn {
  display: none;
  align-items: center;
  gap: 7px;
  background: var(--navy);
  color: #fff;
  border: 0;
  border-radius: 6px;
  padding: 8px 13px;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
}

.mobile-filter-btn.has-active {
  background: var(--blue-text);
}

.desktop-filters {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  flex: 1 1 auto;
  min-width: 0;
}

.filter-control {
  position: relative;
  min-width: 0;
}

.filter-control select,
.combo-trigger {
  height: 32px;
  padding: 0 23px 0 8px;
  border: 1px solid var(--line-strong);
  border-radius: 5px;
  background-color: #fff;
  color: var(--navy);
  font-size: 12.5px;
  font-weight: 500;
  cursor: pointer;
  field-sizing: content;
  max-width: 10.2rem;
  text-overflow: ellipsis;
  white-space: nowrap;
  overflow: hidden;
}

.filter-control select {
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%),
    linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 12px) 52%, calc(100% - 7px) 52%;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
}

.filter-control select.is-active,
.combo-trigger.is-active {
  border-color: var(--blue);
  background-color: #EEF7FF;
  color: var(--blue-deep);
  font-weight: 600;
}

.filter-control.is-muted-prof select {
  opacity: 0.58;
}

.combo-trigger {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding-right: 8px;
  max-width: 11.2rem;
}

.combo-prefix {
  color: var(--muted);
  font-weight: 400;
}

.combo-trigger.is-active .combo-prefix {
  color: var(--blue-deep);
}

.combo-val {
  overflow: hidden;
  text-overflow: ellipsis;
}

.combo-caret {
  font-size: 11px;
  color: var(--muted);
  margin-left: 2px;
}

.combo-popover {
  position: absolute;
  top: calc(100% + 5px);
  left: 0;
  width: 270px;
  background: #fff;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  box-shadow: 0 12px 28px rgba(22, 25, 34, 0.14);
  z-index: 50;
  overflow: hidden;
}

.combo-search-wrap {
  padding: 8px;
  border-bottom: 1px solid var(--line);
}

.combo-search {
  width: 100%;
  padding: 7px 10px;
  border: 1px solid var(--line-strong);
  border-radius: 5px;
  font-size: 13px;
  background: var(--tint);
}

.combo-search:focus {
  background: #fff;
  border-color: var(--blue);
  outline: none;
}

.combo-list {
  list-style: none;
  padding: 4px;
  max-height: 260px;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.combo-option {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 6px 9px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  text-align: left;
  font-size: 13px;
  cursor: pointer;
}

.combo-option:hover,
.combo-option.is-focused {
  background: var(--tint-2);
}

.combo-option.is-selected {
  background: #E8F4FF;
  color: var(--blue-deep);
  font-weight: 600;
}

.combo-option code {
  font: 600 11.5px var(--font);
  color: var(--muted);
}

.filter-meta-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.live-sample {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--navy);
  font-variant-numeric: tabular-nums;
  background: var(--tint);
  border: 1px solid var(--line);
  padding: 4px 9px;
  border-radius: 99px;
  white-space: nowrap;
}

.live-sample.is-low {
  background: var(--yellow-soft);
  border-color: #ebc26b;
  color: #6e4800;
}

/* Butoane comune */
.btn-primary {
  background: var(--blue);
  color: #fff;
  border: 1px solid var(--blue);
  border-radius: 5px;
  padding: 7px 14px;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
}

.btn-primary:hover {
  background: var(--blue-text);
  border-color: var(--blue-text);
}

.btn-outline {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #fff;
  color: var(--navy);
  border: 1px solid var(--line-strong);
  border-radius: 5px;
  padding: 6px 11px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}

.btn-outline:hover {
  border-color: var(--blue);
  color: var(--blue-text);
}

.copy-btn {
  padding: 5px 9px;
  font-size: 12.5px;
}

.btn-text {
  background: none;
  border: 0;
  padding: 2px 4px;
  color: var(--blue-text);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
  white-space: nowrap;
  flex-shrink: 0;
}

.btn-link-small {
  background: none;
  border: 0;
  padding: 2px 0;
  color: var(--blue-text);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* Copiază linkul — fallback */
.copy-fallback {
  background: var(--tint);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 8px 12px;
  font-size: 12.5px;
}

.copy-fallback-row {
  display: flex;
  gap: 8px;
  margin-top: 4px;
}

.copy-fallback-row input {
  flex: 1;
  min-width: 0;
  padding: 5px 8px;
  border: 1px solid var(--line-strong);
  border-radius: 4px;
  font-size: 12.5px;
  background: #fff;
}

/* Chip-uri filtre active */
.active-chips-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 10px;
  padding-top: 2px;
}

.active-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #EEF7FF;
  color: var(--blue-deep);
  border: 1px solid #B7DCFF;
  border-radius: 99px;
  padding: 3px 10px;
  font-size: 12.5px;
  font-weight: 500;
  cursor: pointer;
}

.filter-chip:hover {
  background: #DCEEFF;
  border-color: var(--blue);
}

.filter-chip strong {
  font-weight: 600;
}

.filter-chip .chip-x {
  font-weight: 700;
  font-size: 13px;
  line-height: 1;
}

.btn-reset {
  background: none;
  border: 0;
  padding: 3px 6px;
  color: var(--blue-text);
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* ── Conținut principal & Watermark DATE FICTIVE ──────────────────────────── */
.main-explorer {
  padding-top: clamp(20px, 3vw, 32px);
  padding-bottom: clamp(48px, 6vw, 80px);
  display: grid;
  gap: clamp(28px, 4vw, 44px);
}

.viz-surface {
  position: relative;
  min-width: 0;
}

.watermark {
  display: none;
}

body.is-demo .watermark {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  user-select: none;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

body.is-demo .watermark span {
  transform: rotate(-16deg);
  font: 800 clamp(18px, 2.6vw, 30px)/1 var(--font);
  letter-spacing: 0.08em;
  color: rgba(146, 68, 0, 0.22);
  background: transparent;
  border: 2px solid rgba(146, 68, 0, 0.16);
  padding: 5px 14px;
  border-radius: 4px;
  white-space: nowrap;
}

/* Eroare API */
.error-banner {
  background: var(--danger-bg);
  border-left: 4px solid #D92D20;
  padding: 16px 20px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 20px;
}

.error-banner-body strong {
  display: block;
  color: var(--danger-ink);
  font-size: 15px;
}

.error-banner-body p {
  color: var(--ink);
  font-size: 14px;
  margin-top: 2px;
}

.error-banner-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

/* ── 3. Scorul drepturilor ────────────────────────────────────────────────── */
.rights-section {
  display: grid;
  gap: 14px;
}

.section-head h2 {
  font-size: clamp(20px, 2.2vw, 24px);
  font-weight: 700;
  letter-spacing: -0.015em;
  color: var(--navy);
}

.section-sub {
  font-size: 13.5px;
  color: var(--muted);
  margin-top: 2px;
}

.rights-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border-top: 2px solid var(--navy);
  border-left: 1px solid var(--line);
}

.right-tile {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 8px;
  padding: 14px 16px;
  background: #fff;
  border: 0;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  text-align: left;
  cursor: pointer;
  min-height: 112px;
  min-width: 0;
}

.right-tile:hover {
  background: var(--tint);
}

.right-tile[aria-expanded="true"] {
  background: #EEF7FF;
  box-shadow: inset 0 3px 0 var(--blue);
}

.right-tile.is-skeleton {
  cursor: default;
}

.right-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 6px;
}

.right-name {
  font-size: 13.5px;
  font-weight: 600;
  line-height: 1.3;
  color: var(--navy);
}

.right-chevron {
  font-size: 12px;
  color: var(--muted-2);
  flex-shrink: 0;
  transition: transform 0.2s ease;
}

.right-tile[aria-expanded="true"] .right-chevron {
  transform: rotate(180deg);
  color: var(--blue-text);
}

.right-score-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin-top: auto;
}

.right-score {
  font-size: clamp(24px, 2.4vw, 32px);
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.03em;
  color: var(--navy);
  font-variant-numeric: tabular-nums;
}

.right-score.is-suppressed {
  font-size: 15px;
  font-weight: 600;
  color: var(--muted-2);
  letter-spacing: 0;
}

.right-unit {
  font-size: 12px;
  color: var(--muted-2);
  font-weight: 500;
}

.right-bar-track {
  height: 5px;
  background: var(--tint-2);
  border-radius: 99px;
  overflow: hidden;
}

.right-bar-fill {
  height: 100%;
  background: var(--blue);
  border-radius: 99px;
}

.right-bar-fill.is-warn {
  background: var(--yellow);
}

/* Panoul de detaliu al dreptului selectat */
.right-detail {
  background: var(--tint);
  border-top: 2px solid var(--blue);
  border-bottom: 1px solid var(--line);
  padding: 16px 20px;
  display: grid;
  gap: 12px;
}

.right-detail-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.right-detail-head h3 {
  font-size: 16px;
  font-weight: 700;
}

.right-items-list {
  display: grid;
  gap: 8px;
}

.right-item-btn {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px 14px;
  width: 100%;
  padding: 10px 14px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 6px;
  text-align: left;
  cursor: pointer;
}

.right-item-btn:hover {
  border-color: var(--blue);
  background: #F7FBFF;
}

.right-item-code {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--blue-text);
  background: #EAF4FF;
  padding: 2px 8px;
  border-radius: 4px;
}

.right-item-text {
  font-size: 13.5px;
  font-weight: 500;
  color: var(--navy);
  min-width: 0;
}

.right-item-text small {
  display: block;
  font-size: 12px;
  font-weight: 400;
  color: var(--muted);
  margin-top: 2px;
}

.right-item-val {
  font-size: 15px;
  font-weight: 700;
  color: var(--navy);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* ── Grila pe două coloane (Desktop) ──────────────────────────────────────── */
.explorer-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.18fr) minmax(0, 0.92fr);
  gap: clamp(24px, 3.2vw, 44px);
  align-items: start;
}

.col-left,
.col-right {
  display: grid;
  gap: clamp(24px, 3vw, 36px);
  min-width: 0;
}

.panel {
  border-top: 2px solid var(--navy);
  padding-top: 16px;
  display: grid;
  gap: 18px;
  min-width: 0;
}

/* ── 4. Panoul Întrebarea ─────────────────────────────────────────────────── */
.q-nav-bar {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) 38px;
  gap: 8px;
  align-items: center;
}

.q-step-btn {
  height: 38px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: #fff;
  color: var(--navy);
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  display: grid;
  place-items: center;
}

.q-step-btn:hover:not(:disabled) {
  border-color: var(--blue);
  color: var(--blue-text);
  background: #F4F9FF;
}

.q-step-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.q-picker-wrap {
  position: relative;
  min-width: 0;
}

.q-picker-btn {
  width: 100%;
  height: 38px;
  padding: 0 12px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: var(--tint);
  display: flex;
  align-items: center;
  gap: 8px;
  text-align: left;
  cursor: pointer;
  min-width: 0;
}

.q-picker-btn:hover {
  border-color: var(--blue);
  background: #EEF7FF;
}

.q-picker-code {
  font-size: 12.5px;
  font-weight: 700;
  color: #fff;
  background: var(--blue-text);
  padding: 2px 7px;
  border-radius: 4px;
  flex-shrink: 0;
}

.q-picker-code.is-prof {
  background: var(--navy);
}

.q-picker-label {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--navy);
}

.q-picker-popover {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  background: #fff;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  box-shadow: 0 16px 36px rgba(22, 25, 34, 0.18);
  z-index: 45;
  overflow: hidden;
}

.q-picker-top {
  padding: 10px;
  border-bottom: 1px solid var(--line);
  display: grid;
  gap: 8px;
}

.q-audience-tabs {
  display: flex;
  gap: 6px;
}

.q-tab {
  border: 1px solid var(--line);
  background: var(--tint);
  border-radius: 99px;
  padding: 3px 11px;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
}

.q-tab.is-active {
  background: var(--navy);
  border-color: var(--navy);
  color: #fff;
}

.q-picker-list {
  max-height: 360px;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 6px;
}

.q-group-heading {
  padding: 8px 8px 4px;
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  border-top: 1px solid var(--line);
  margin-top: 4px;
}

.q-group-heading:first-child {
  border-top: 0;
  margin-top: 0;
}

.q-option-btn {
  width: 100%;
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) auto;
  align-items: baseline;
  gap: 8px;
  padding: 7px 8px;
  border: 0;
  border-radius: 5px;
  background: transparent;
  text-align: left;
  font-size: 13px;
  cursor: pointer;
}

.q-option-btn:hover,
.q-option-btn.is-focused {
  background: var(--tint-2);
}

.q-option-btn.is-selected {
  background: #E8F4FF;
  font-weight: 600;
}

.q-opt-code {
  font-weight: 700;
  font-size: 12px;
  color: var(--blue-text);
}

.q-opt-code.is-prof {
  color: var(--navy);
}

.q-opt-pair {
  font-size: 11px;
  font-weight: 600;
  color: var(--muted-2);
}

/* Antetul întrebării */
.q-header {
  display: grid;
  gap: 8px;
}

.q-badges {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.badge-tag {
  display: inline-flex;
  align-items: center;
  font-size: 12px;
  font-weight: 600;
  padding: 2px 9px;
  border-radius: 99px;
  background: var(--tint-2);
  color: var(--navy);
}

.badge-tag.is-art {
  background: #EAF4FF;
  color: var(--blue-deep);
}

.badge-tag.is-multi {
  background: var(--yellow-soft);
  color: #704900;
}

.q-title {
  font-size: clamp(20px, 2.3vw, 26px);
  font-weight: 700;
  line-height: 1.22;
  letter-spacing: -0.018em;
  color: var(--navy);
}

.q-meta-line {
  font-size: 13.5px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.q-prof-note {
  font-size: 12.5px;
  color: #6e4800;
  background: var(--yellow-soft);
  border-left: 3px solid var(--yellow);
  padding: 6px 10px;
}

/* Graficul întrebării — bare orizontale */
.q-chart-surface {
  min-height: 170px;
  padding: 6px 0;
}

.bars-list {
  display: grid;
  gap: 11px;
}

.bar-row {
  display: grid;
  grid-template-columns: minmax(130px, 42%) minmax(0, 1fr) 56px;
  align-items: center;
  gap: 12px;
  padding: 3px 4px;
  margin: -3px -4px;
  border-radius: 5px;
  cursor: pointer;
}

.bar-row:hover {
  background: var(--tint);
}

.bar-label {
  font-size: 13.5px;
  line-height: 1.32;
  color: var(--ink);
  min-width: 0;
}

.bar-track {
  height: 22px;
  background: var(--tint-2);
  border-radius: 4px;
  overflow: hidden;
  position: relative;
}

.bar-fill {
  height: 100%;
  background: var(--blue);
  border-radius: 4px;
  min-width: 0;
}

.bar-row.is-map-selected .bar-label {
  font-weight: 600;
  color: var(--blue-deep);
}

.bar-val {
  text-align: right;
  font-size: 14px;
  font-weight: 700;
  color: var(--navy);
  font-variant-numeric: tabular-nums;
}

/* Scală 5 trepte (100% stacked bar + legendă) */
.scale-wrap {
  display: grid;
  gap: 14px;
  padding: 6px 0;
}

.scale-stacked {
  display: flex;
  height: 40px;
  width: 100%;
  border-radius: 6px;
  overflow: hidden;
  background: var(--tint-2);
}

.scale-seg {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12.5px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  overflow: hidden;
  white-space: nowrap;
  border-right: 1.5px solid #fff;
}

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

/* Culori CNE pentru cele 5 trepte (Deloc → În foarte mare măsură) */
.scale-c0 { background: #F9BB42; color: #161922; }
.scale-c1 { background: #FDE09C; color: #161922; }
.scale-c2 { background: #D7DFEA; color: #161922; }
.scale-c3 { background: #3DB6FF; color: #092038; }
.scale-c4 { background: #006EDF; color: #FFFFFF; }

.scale-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
}

.scale-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

.scale-swatch {
  width: 12px;
  height: 12px;
  border-radius: 3px;
  flex-shrink: 0;
}

.scale-legend-item strong {
  font-weight: 700;
}

/* Mesaj prietenos pentru grupuri ascunse (sub 30) */
.suppressed-box {
  background: var(--tint);
  border: 1.5px dashed var(--line-strong);
  border-radius: 6px;
  padding: 24px 20px;
  text-align: center;
  display: grid;
  justify-items: center;
  gap: 10px;
}

.suppressed-box p {
  font-size: 14.5px;
  font-weight: 500;
  color: var(--ink);
  max-width: 30rem;
}

/* ── 5. Împarte după (split) ──────────────────────────────────────────────── */
.split-block {
  border-top: 1px solid var(--line);
  padding-top: 16px;
  display: grid;
  gap: 14px;
}

.split-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
}

.split-label {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--navy);
}

.segmented-control {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  background: var(--tint);
  padding: 4px;
  border-radius: 7px;
  border: 1px solid var(--line);
}

.seg-btn {
  border: 0;
  background: transparent;
  color: var(--muted);
  padding: 5px 10px;
  border-radius: 5px;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
}

.seg-btn:hover:not(:disabled) {
  color: var(--navy);
  background: rgba(22, 25, 34, 0.05);
}

.seg-btn.is-active {
  background: #fff;
  color: var(--blue-text);
  box-shadow: 0 1px 3px rgba(22, 25, 34, 0.1);
}

.seg-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.split-results-wrap {
  display: grid;
  gap: 10px;
}

.split-opt-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--muted);
}

.split-opt-bar select {
  padding: 5px 28px 5px 10px;
  border: 1px solid var(--line-strong);
  border-radius: 5px;
  font-size: 13px;
  font-weight: 500;
  background: #fff;
  max-width: 100%;
}

.split-rows {
  display: grid;
  gap: 10px;
}

.split-row {
  border-top: 1px solid var(--line);
  padding-top: 10px;
  display: grid;
  gap: 6px;
}

.split-row:first-child {
  border-top: 0;
  padding-top: 2px;
}

.split-row-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}

.split-group-name {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--navy);
}

.split-group-n {
  font-size: 12px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.split-row.is-suppressed {
  opacity: 0.68;
}

.split-suppressed-bar {
  height: 22px;
  border-radius: 4px;
  background: repeating-linear-gradient(-45deg, #f1f4f9 0 5px, #dfe5ef 5px 8px);
  display: flex;
  align-items: center;
  padding: 0 10px;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
}

.split-mini-bars {
  display: grid;
  gap: 5px;
}

.split-mini-row {
  display: grid;
  grid-template-columns: minmax(105px, 38%) minmax(0, 1fr) 52px;
  align-items: center;
  gap: 10px;
}

.split-mini-lbl {
  font-size: 12.5px;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.split-mini-track {
  height: 14px;
  background: var(--tint-2);
  border-radius: 3px;
  overflow: hidden;
}

.split-mini-fill {
  height: 100%;
  background: var(--blue);
  border-radius: 3px;
}

.split-mini-val {
  text-align: right;
  font-size: 12.5px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--navy);
}

.split-single-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 54px;
  align-items: center;
  gap: 10px;
}

/* ── 6. Harta pe județe ───────────────────────────────────────────────────── */
.map-head {
  display: grid;
  gap: 8px;
}

.map-title-row {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}

.map-title-row h2,
.pair-title-row h2 {
  font-size: clamp(18px, 2vw, 22px);
  font-weight: 700;
  letter-spacing: -0.015em;
  color: var(--navy);
}

.map-national {
  font-size: 13px;
  font-weight: 600;
  color: var(--blue-deep);
  background: #EEF7FF;
  padding: 2px 9px;
  border-radius: 99px;
  font-variant-numeric: tabular-nums;
}

.map-opt-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--muted);
}

.map-opt-row select {
  flex: 1 1 180px;
  min-width: 0;
  padding: 6px 10px;
  border: 1px solid var(--line-strong);
  border-radius: 5px;
  font-size: 13px;
  font-weight: 500;
  background: #fff;
  color: var(--navy);
}

.map-hint-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 22px;
  font-size: 12.5px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.map-surface {
  position: relative;
}

.county-grid {
  display: block;
  width: 100%;
}
.county-grid svg { display: block; width: 100%; height: auto; }
.county-grid .jud text.jud-val { font: 500 14px Poppins, Arial, sans-serif; text-anchor: middle; pointer-events: none; }
.county-grid .jud.sel path { stroke: #F9BB42; stroke-width: 3; }

.county-tile {
  border: 1px solid rgba(22, 25, 34, 0.12);
  border-radius: 4px;
  padding: 2px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  cursor: pointer;
  background: var(--tint);
  color: var(--navy);
  min-width: 0;
  line-height: 1.1;
}

.county-tile:hover {
  transform: translateY(-1px);
  box-shadow: 0 3px 8px rgba(22, 25, 34, 0.18);
  z-index: 2;
}

.county-code {
  font-size: clamp(10px, 1.05vw, 13px);
  font-weight: 700;
}

.county-val {
  font-size: clamp(8.5px, 0.85vw, 11px);
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  margin-top: 1px;
}

.county-tile.is-dark {
  color: #fff;
  border-color: rgba(0, 52, 112, 0.35);
}

.county-tile.is-suppressed {
  background: repeating-linear-gradient(-45deg, #EFF2F7 0 4px, #D7E0EC 4px 6.5px);
  color: var(--muted);
  border-style: dashed;
}

.county-tile.is-selected {
  outline: 3px solid var(--yellow);
  box-shadow: 0 0 0 1.5px var(--navy);
  z-index: 3;
}

.map-tooltip {
  position: absolute;
  z-index: 10;
  pointer-events: none;
  background: var(--navy);
  color: #fff;
  padding: 6px 10px;
  border-radius: 5px;
  font-size: 12.5px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  box-shadow: 0 6px 18px rgba(22, 25, 34, 0.25);
  transform: translate(-50%, -100%);
}

.map-tooltip small {
  display: block;
  font-size: 11px;
  font-weight: 400;
  color: #cbd3e1;
}

.map-legend {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 16px;
  font-size: 12px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.legend-scale {
  display: flex;
  align-items: center;
  gap: 7px;
}

.legend-gradient {
  width: 110px;
  height: 10px;
  border-radius: 3px;
  background: linear-gradient(90deg, #EBF5FF 0%, #7CC7FF 45%, #0089F7 75%, #004B9B 100%);
  border: 1px solid rgba(22, 25, 34, 0.12);
}

.legend-suppressed {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.swatch-hatched {
  width: 14px;
  height: 10px;
  border-radius: 2px;
  border: 1px dashed var(--line-strong);
  background: repeating-linear-gradient(-45deg, #EFF2F7 0 3px, #D3DCE9 3px 5.5px);
}

/* ── 7. Elevi vs profesori (oglindă / diverging) ──────────────────────────── */
.pair-head {
  display: grid;
  gap: 8px;
}

.pair-title-row {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}

.pair-reading {
  background: var(--yellow-soft);
  border-left: 4px solid var(--yellow);
  padding: 9px 12px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--navy);
  font-variant-numeric: tabular-nums;
}

.pair-axis-head {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
  font-size: 12.5px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.pair-axis-elevi {
  text-align: right;
  color: var(--blue-text);
  padding-right: 4px;
}

.pair-axis-prof {
  text-align: left;
  color: var(--navy);
  padding-left: 4px;
}

.pair-rows {
  display: grid;
  gap: 11px;
  padding-top: 10px;
}

.pair-row {
  display: grid;
  gap: 4px;
}

.pair-row-label {
  font-size: 12.5px;
  font-weight: 500;
  color: var(--ink);
  text-align: center;
}

.pair-butterfly {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) 2px minmax(0, 1fr) 48px;
  align-items: center;
  gap: 6px;
}

.pair-val {
  font-size: 12.5px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.pair-val.is-elevi {
  text-align: right;
  color: var(--blue-text);
}

.pair-val.is-prof {
  text-align: left;
  color: var(--navy);
}

.pair-track {
  height: 16px;
  background: var(--tint-2);
  border-radius: 3px;
  overflow: hidden;
  display: flex;
}

.pair-track.is-left {
  justify-content: flex-end;
}

.pair-track.is-right {
  justify-content: flex-start;
}

.pair-fill-elevi {
  height: 100%;
  background: var(--blue);
  border-radius: 3px 0 0 3px;
}

.pair-fill-prof {
  height: 100%;
  background: var(--navy);
  border-radius: 0 3px 3px 0;
}

.pair-spine {
  width: 2px;
  height: 22px;
  background: var(--line-strong);
}

.pair-note {
  margin-top: 10px;
  font-size: 12px;
  color: var(--muted);
}

/* ── Bottom Sheet pe telefon (<dialog>) ───────────────────────────────────── */
.filter-sheet {
  border: 0;
  padding: 0;
  margin: auto 0 0 0;
  width: 100%;
  max-width: 100%;
  max-height: 88dvh;
  background: #fff;
  border-radius: 16px 16px 0 0;
  box-shadow: 0 -10px 34px rgba(22, 25, 34, 0.25);
}

.filter-sheet::backdrop {
  background: rgba(22, 25, 34, 0.5);
}

.sheet-panel {
  display: flex;
  flex-direction: column;
  max-height: 88dvh;
}

.sheet-header {
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.sheet-header h2 {
  font-size: 17px;
  font-weight: 700;
}

.sheet-close-btn {
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 50%;
  background: var(--tint);
  font-size: 16px;
  cursor: pointer;
}

.sheet-body {
  padding: 16px 18px;
  overflow-y: auto;
  overscroll-behavior: contain;
  display: grid;
  gap: 14px;
}

.sheet-field {
  display: grid;
  gap: 5px;
}

.sheet-field label {
  font-size: 13px;
  font-weight: 600;
  color: var(--navy);
}

.sheet-field select {
  width: 100%;
  padding: 9px 10px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: #fff;
  font-size: 14px;
}

.sheet-judet-select {
  height: auto;
  min-height: 128px;
}

.sheet-footer {
  padding: 12px 18px;
  border-top: 1px solid var(--line);
  background: var(--tint);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.sheet-sample {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--navy);
  font-variant-numeric: tabular-nums;
}

.sheet-actions {
  display: flex;
  gap: 8px;
}

/* ── Skeletons & tranziții ────────────────────────────────────────────────── */
.skel {
  display: block;
  background: linear-gradient(90deg, #EDF1F7 25%, #E1E7F0 50%, #EDF1F7 75%);
  background-size: 200% 100%;
  border-radius: 4px;
}

.skel-num { width: 92px; height: 28px; }
.skel-inline { display: inline-block; width: 105px; height: 15px; vertical-align: middle; }
.skel-line { width: 70%; height: 14px; }
.skel-big { width: 54px; height: 30px; }
.skel-bar { width: 100%; height: 5px; }
.skel-heading { width: 85%; height: 26px; }
.skel-bars { display: grid; gap: 12px; }
.skel-bar-row { width: 100%; height: 24px; }

@media (prefers-reduced-motion: no-preference) {
  .bar-fill,
  .scale-seg,
  .right-bar-fill,
  .split-mini-fill,
  .pair-fill-elevi,
  .pair-fill-prof {
    transition: width 260ms cubic-bezier(0.22, 1, 0.36, 1);
  }
  .skel {
    animation: skel-shimmer 1.4s ease-in-out infinite;
  }
  @keyframes skel-shimmer {
    0% { background-position: 100% 0; }
    100% { background-position: -100% 0; }
  }
}

/* ── Responsive: Tabletă & Telefon (până la 360px, fără scroll orizontal) ── */
@media (max-width: 1024px) {
  .hero-inner {
    grid-template-columns: 1fr;
    gap: 18px;
  }
  .explorer-grid {
    grid-template-columns: 1fr;
  }
  .rights-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 860px) {
  .filter-title,
  .desktop-filters {
    display: none;
  }
  .mobile-filter-btn {
    display: inline-flex;
  }
}

@media (max-width: 560px) {
  .hero-stats {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
  }
  .stat-item dd {
    font-size: 18px;
  }
  .bar-row {
    grid-template-columns: 1fr auto;
    gap: 4px 10px;
  }
  .bar-label {
    grid-column: 1 / 2;
  }
  .bar-val {
    grid-column: 2 / 3;
  }
  .bar-track {
    grid-column: 1 / -1;
    height: 16px;
  }
  .split-mini-row {
    grid-template-columns: 1fr auto;
    gap: 2px 8px;
  }
  .split-mini-track {
    grid-column: 1 / -1;
  }
  .county-grid {
    gap: 2.5px;
  }
  .county-val {
    display: none;
  }
  .county-code {
    font-size: 10.5px;
  }
  .right-tile {
    padding: 11px 12px;
    min-height: 98px;
  }
  .right-name {
    font-size: 12.5px;
  }
  .right-item-btn {
    grid-template-columns: auto 1fr;
  }
  .right-item-val {
    grid-column: 2 / 3;
    justify-self: start;
  }
  .copy-btn span {
    display: none;
  }
}
