:root {
  --category-desired: #2e7d32;
  --category-desired-soft: #e3f0e4;
  --category-minimum: #e88900;
  --category-minimum-soft: #fff0d6;
  --category-deficient: #c62828;
  --category-deficient-soft: #fde6e6;
  --paper: #faf7f0;
  --white: #fffdf9;
  --ink: #241322;
  --muted: #6b5b67;
  --line: #e2d9c8;
  --green: #346b6c;
  --green-soft: #dce9e5;
  --gold: #f3aa1f;
  --gold-soft: #fff0c9;
  --red: #841e61;
  --red-soft: #f3e0eb;
  --plum: #58094f;
  --magenta: #841e61;
  --navy: #294864;
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 15px/1.5 "Segoe UI", Arial, sans-serif; }
html, body { height: 100%; overflow: hidden; }
button, input, select { font: inherit; }
button { cursor: pointer; }
.topbar { height: 76px; display: flex; align-items: center; justify-content: space-between; padding: 0 5.2vw; border-bottom: 1px solid var(--line); background: rgba(255,255,255,.58); }
.brand { display: flex; align-items: center; gap: 12px; color: var(--ink); text-decoration: none; font-weight: 800; letter-spacing: -.03em; }
.brand-mark { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 12px; background: var(--green); color: white; font: 22px Georgia, serif; }
.brand small { display: block; margin-top: 1px; color: var(--muted); font-size: 11px; font-weight: 500; letter-spacing: .02em; }
.top-actions { display: flex; align-items: center; gap: 22px; }
.home-link { text-decoration: none; }
.sidebar-home-link { color: var(--plum); font-size: 12px; font-weight: 700; text-decoration: none; }
.sidebar-home-link:hover, .sidebar-home-link:focus-visible { text-decoration: underline; }
.source-link { color: var(--plum); text-decoration: underline; text-underline-offset: 2px; }
.source-link:hover, .source-link:focus-visible { color: var(--magenta); }
.origin-url { overflow-wrap: anywhere; }
.measure-steps { margin: 8px 0 0; padding-left: 19px; }
.measure-steps li { margin: 5px 0; }
.criteria-note { margin: -4px 19px 13px; color: var(--muted); font-size: 11px; line-height: 1.5; }
.percentile-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.percentile-status { margin: 7px 0 0; color: var(--muted); font-size: 11px; }
.percentile-explainer { margin: 2px 19px 14px; padding: 12px 14px; border-left: 3px solid var(--green); background: #f4f8f5; color: var(--muted); font-size: 11px; line-height: 1.5; }
.percentile-explainer p { margin: 6px 0 0; }
.percentile-explainer strong { color: var(--ink); }
@media (max-width:580px) { .percentile-fields { grid-template-columns: 1fr; } }
.save-status { color: var(--muted); font-size: 12px; }
.layout { display: grid; grid-template-columns: 285px minmax(0,1fr); height: calc(100dvh - 76px); min-height: 0; }
.sidebar { display: flex; flex-direction: column; gap: 25px; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 30px 22px 22px 5.2vw; border-right: 1px solid var(--line); }
.project-box label, .side-heading { display: block; color: var(--muted); font-size: 11px; font-weight: 700; letter-spacing: .11em; text-transform: uppercase; }
.project-box input { width: 100%; margin-top: 10px; padding: 11px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--white); color: var(--ink); outline: 0; }
.project-box input:focus, .value-input:focus, .category-select:focus { border-color: var(--green); box-shadow: 0 0 0 3px rgba(45,89,72,.1); }
.side-heading { display: flex; justify-content: space-between; }
.section-nav { display: grid; gap: 5px; margin-top: -16px; }
.nav-block, .nav-subsections { display: grid; gap: 6px; min-width: 0; }
.nav-subsections { margin: 2px 0 8px 12px; padding-left: 9px; border-left: 2px solid var(--axis-tint, var(--line)); }
.nav-subsection, .nav-indicators { display: grid; gap: 5px; min-width: 0; }
.nav-indicators { margin: 0 0 9px 8px; padding-left: 8px; border-left: 1px solid var(--axis-color, var(--plum)); }
.nav-indicator { display: grid; grid-template-columns: 42px minmax(0,1fr); gap: 5px; width: 100%; padding: 7px 5px; border: 0; border-radius: 4px; background: color-mix(in srgb, var(--axis-tint, #e8d2e3) 48%, white); color: var(--axis-ink, var(--plum)); font-size: 10px; line-height: 1.35; text-align: left; }
.nav-indicator:hover, .nav-indicator:focus-visible { background: var(--axis-tint, #e8d2e3); outline: 2px solid var(--axis-color, var(--plum)); outline-offset: 1px; }
.nav-indicator.is-centered { background: var(--axis-color, var(--plum)); color: var(--axis-active-ink, white); box-shadow: 0 2px 9px rgba(36,19,34,.14); }
.nav-indicator.is-centered:hover, .nav-indicator.is-centered:focus-visible { background: var(--axis-color, var(--plum)); color: var(--axis-active-ink, white); }
.nav-indicator-num { font-family: "DejaVu Sans Mono", Consolas, monospace; font-weight: 700; }
.nav-block-toggle { align-items: center; min-height: 48px; }
.nav-block-toggle .nav-label { font-weight: 800; }
.nav-chevron { margin-left: 3px; font-size: 14px; }
.nav-subitem { min-height: 38px; }
.nav-item { display: flex; align-items: flex-start; gap: 11px; width: 100%; padding: 10px 9px; border: 0; border-radius: 9px; background: transparent; color: var(--muted); line-height: 1.35; text-align: left; }
.nav-item:hover { background: rgba(255,255,255,.75); }
.nav-item.active { background: var(--white); color: var(--ink); box-shadow: 0 2px 10px rgba(26,46,37,.04); }
.nav-num { display: grid; flex: 0 0 23px; height: 23px; place-items: center; border: 1px solid var(--line); border-radius: 50%; font-size: 11px; font-weight: 700; }
.nav-item.active .nav-num { border-color: var(--green); background: var(--green); color: white; }
.nav-label { font-size: 12px; font-weight: 600; }
.nav-count { margin-left: auto; color: #8b9790; font-size: 11px; }
.sidebar-foot { display: flex; align-items: flex-start; gap: 9px; margin-top: auto; padding-top: 20px; border-top: 1px solid var(--line); color: var(--muted); font-size: 11px; line-height: 1.5; }
.status-dot { flex: 0 0 7px; height: 7px; margin-top: 4px; border-radius: 50%; background: #61a47e; }
.content { width: min(100%,1110px); min-height: 0; overflow-y: auto; overscroll-behavior: contain; margin: 0 auto; padding: 62px clamp(28px,7vw,112px) 30px; }
.overview-panel { max-width: 720px; padding-top: 42px; }
.eyebrow { color: var(--green); font-size: 10px; font-weight: 700; letter-spacing: .17em; }
h1 { margin: 17px 0 15px; font-size: clamp(37px,5vw,58px); font-weight: 600; line-height: 1.1; letter-spacing: -.065em; }
h1 em { color: var(--green); font: italic 400 1em Georgia,serif; letter-spacing: -.05em; }
.intro, .section-lede { max-width: 620px; margin: 0; color: var(--muted); font-size: 16px; line-height: 1.7; }
.landing-fields { display: grid; gap: 9px; max-width: 470px; margin: 28px 0 18px; }
.landing-fields label { margin-top: 5px; color: var(--ink); font-size: 12px; font-weight: 700; }
.landing-fields input, .landing-fields select { width: 100%; min-height: 43px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; background: white; color: var(--ink); outline: 0; }
.landing-fields input:focus, .landing-fields select:focus { border-color: var(--green); box-shadow: 0 0 0 3px rgba(45,89,72,.1); }
.municipality-picker { position: relative; }
.municipality-picker input { display: block; }
.municipality-options { position: absolute; z-index: 20; top: calc(100% + 5px); right: 0; left: 0; max-height: 270px; overflow-y: auto; padding: 5px; border: 1px solid var(--line); border-radius: 9px; background: #fff; box-shadow: 0 10px 28px rgba(31,49,43,.14); }
.municipality-options[hidden] { display: none; }
.municipality-option { display: block; width: 100%; padding: 9px 11px; border: 0; border-radius: 6px; background: transparent; color: var(--ink); text-align: left; font-size: 13px; }
.municipality-option:hover, .municipality-option:focus { outline: 0; background: #f1f5f2; color: var(--green); }
.municipality-empty { padding: 10px 11px; color: var(--muted); font-size: 12px; }
.population-pyramid { width: min(100%, 560px); margin: 14px 0 18px; padding: 12px; border: 1px solid var(--line); border-radius: 9px; background: #fbfcfa; }
.pyramid-heading, .pyramid-row { display: grid; grid-template-columns: 1fr 72px 1fr; align-items: center; gap: 8px; }
.pyramid-heading { margin-bottom: 7px; color: var(--muted); font-size: 10px; font-weight: 700; text-align: center; }
.pyramid-side { display: flex; align-items: center; height: 10px; background: #f0f1ee; }
.male-side { justify-content: flex-end; }
.female-side { justify-content: flex-start; }
.pyramid-bar { display: block; height: 8px; min-width: 1px; }
.male-bar { background: #688eaa; }
.female-bar { background: #ba8290; }
.pyramid-age { color: var(--muted); font-size: 9px; text-align: center; white-space: nowrap; }
.age-variable-card .population-pyramid { margin: 0 19px 15px; }
.age-report .population-pyramid { width: min(100%, 400px); margin: 10px 0; }
.api-status { min-height: 20px; margin: 0; color: var(--muted); font-size: 11px; line-height: 1.5; }
.overview-stats { display: flex; gap: 40px; margin: 40px 0; }
.stat strong { display: block; font-size: 29px; font-weight: 600; letter-spacing: -.05em; }
.stat span { display: block; margin-top: 4px; color: var(--muted); font-size: 12px; }
.callout { display: flex; align-items: flex-start; gap: 12px; margin: 0 0 26px; padding: 16px; border: 1px solid #e6dfce; border-radius: 10px; background: #f8f4ea; color: #725f40; }
.callout p { margin: 0; font-size: 12px; line-height: 1.6; }
.callout-icon { display: grid; flex: 0 0 19px; height: 19px; place-items: center; border: 1px solid #c9b995; border-radius: 50%; font: 12px Georgia,serif; }
.button { display: inline-flex; min-height: 42px; align-items: center; justify-content: center; gap: 12px; padding: 0 16px; border: 1px solid transparent; border-radius: 8px; font-size: 12px; font-weight: 700; transition: .16s; }
.button-primary { background: var(--green); color: white; }
.button-primary:hover { transform: translateY(-1px); background: #23483a; }
.button:disabled { cursor: not-allowed; opacity: .5; transform: none; }
.button-quiet { border-color: var(--line); background: rgba(255,255,255,.65); color: var(--ink); }
.button-quiet:hover { border-color: #c7d2ca; background: white; }
.top-actions .button { min-height: 36px; }
.section-view, .results-view { padding-top: 6px; }
.section-topline { display: flex; align-items: center; justify-content: space-between; color: var(--muted); font-size: 12px; }
.section-view h1, .results-view h1 { margin-top: 15px; font-size: clamp(32px,4vw,46px); }
.section-lede { font-size: 14px; }
.variable-list { display: grid; gap: 14px; margin: 27px 0; }
.variable-card { overflow: hidden; border: 1px solid var(--line); border-radius: 12px; background: var(--white); box-shadow: 0 3px 14px rgba(26,46,37,.025); }
.variable-card { scroll-margin-top: 14px; }
.variable-card.is-centered { border-color: var(--axis-color, var(--plum)); box-shadow: 0 0 0 2px color-mix(in srgb, var(--axis-color, var(--plum)) 35%, transparent), 0 8px 24px rgba(36,19,34,.08); }
.variable-head { display: flex; justify-content: space-between; gap: 18px; padding: 17px 19px 12px; }
.variable-head h2 { margin: 0; font-size: 16px; line-height: 1.4; font-weight: 700; letter-spacing: -.025em; }
.variable-id { flex: 0 0 auto; color: #9aa49e; font-size: 10px; letter-spacing: .08em; }
.measure-note { margin: 0; padding: 0 19px 14px; color: var(--muted); font-size: 12px; line-height: 1.55; }
.measure-note strong { color: var(--ink); }
.unit-note { margin: 0; padding: 0 19px 12px; color: var(--muted); font-size: 11px; line-height: 1.45; }
.unit-note strong { color: var(--ink); }
.interval-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 8px; padding: 0 19px 15px; }
.interval { min-height: 69px; padding: 10px; border-radius: 8px; background: #f7f8f5; }
.interval strong { display: block; margin-bottom: 5px; color: var(--muted); font-size: 9px; letter-spacing: .1em; text-transform: uppercase; }
.interval span { font-size: 11px; line-height: 1.45; white-space: pre-wrap; }
.interval.desired { background: var(--green-soft); }
.interval.desired strong { color: var(--green); }
.interval.minimum { background: var(--gold-soft); }
.interval.minimum strong { color: #8d632c; }
.interval.deficient { background: var(--red-soft); }
.interval.deficient strong { color: var(--red); }
.entry-row { display: grid; grid-template-columns: 1fr; align-items: center; gap: 13px; padding: 14px 19px; border-top: 1px solid #eef0eb; }
.component-fields { display: grid; gap: 12px; margin: 8px 0 0; padding-left: 20px; }
.component-fields li { padding-left: 2px; }
.component-fields .entry-label { display: block; margin-bottom: 5px; }
.calculation-note { margin: 0 19px 12px; padding: 10px 12px; border-left: 3px solid var(--green); background: #f4f8f5; color: var(--ink); font-size: 11px; line-height: 1.5; }
.calculation-note p { margin: 5px 0 0; }
.calculation-variables { font-size: 11px; line-height: 1.55; }
.calculation-note .calculation-variables { margin-top: 10px; }
.calculation-variables ul { margin: 5px 0 0; padding-left: 19px; }
.calculation-variables li { margin: 5px 0; }
.available-categories { padding: 14px 0 2px; border-top: 1px solid var(--line); }
.available-categories h3 { margin: 0 19px 10px; color: var(--plum); font-size: 12px; }
.calculated-value[readonly] { background: #f4f2ed; color: var(--ink); cursor: default; font-weight: 600; }
.auto-entry small, .entry-row small { display: block; margin-top: 5px; color: var(--muted); font-size: 10px; }
.auto-breakdown { max-height: 280px; overflow: auto; margin: 8px 0; padding-left: 20px; font-size: 11px; }
.auto-breakdown li { margin: 5px 0; }
@media (max-width:580px) { .calculation-note { margin-right: 14px; margin-left: 14px; } .available-categories h3 { margin-left: 14px; } }
.entry-label { color: var(--muted); font-size: 11px; font-weight: 600; }
.value-input, .category-select { width: 100%; min-height: 39px; padding: 9px 11px; border: 1px solid var(--line); border-radius: 7px; background: white; color: var(--ink); outline: 0; font-size: 12px; }
.input-hint { display: block; margin-top: 5px; color: var(--muted); font-size: 10px; }
.classification { display: flex; align-items: center; gap: 9px; padding: 0 19px 15px; color: var(--muted); font-size: 11px; }
.badge { display: inline-flex; align-items: center; padding: 5px 9px; border-radius: 999px; font-size: 10px; font-weight: 700; letter-spacing: .02em; }
.badge.desired { background: var(--green-soft); color: var(--green); }
.badge.minimum { background: var(--gold-soft); color: #8d632c; }
.badge.deficient { background: var(--red-soft); color: var(--red); }
.badge.pending { background: #eff0ed; color: #78837c; }
.step-actions { display: flex; justify-content: space-between; gap: 10px; padding-top: 10px; border-top: 1px solid var(--line); }
.result-summary { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 10px; margin: 25px 0; }
.summary-tile { padding: 17px; border: 1px solid var(--line); border-radius: 10px; background: white; }
.summary-tile strong { display: block; font-size: 25px; letter-spacing: -.05em; }
.summary-tile span { display: block; margin-top: 4px; color: var(--muted); font-size: 10px; }
.results-by-section { display: grid; gap: 13px; margin-bottom: 24px; }
.result-block-heading { margin: 19px 0 0; padding: 10px 0 4px; border-top: 3px solid var(--block-color, var(--plum)); color: var(--block-color, var(--plum)); font-size: 18px; }
.result-section { padding: 17px 19px; border: 1px solid var(--line); border-radius: 10px; background: white; }
.result-section h2 { margin: 0 0 13px; font-size: 15px; }
.result-list { display: grid; gap: 8px; }
.result-line { display: grid; grid-template-columns: minmax(0,1fr) 130px minmax(0,1fr); align-items: center; gap: 12px; padding-top: 8px; border-top: 1px solid #eff0ec; font-size: 11px; }
.auto-result-line { grid-template-columns: minmax(150px,.7fr) 130px minmax(0,2fr); align-items: start; }
.auto-result-line .result-value { min-width: 0; }
.result-line:first-child { border-top: 0; }
.result-value { overflow: hidden; color: var(--muted); text-overflow: ellipsis; white-space: nowrap; }
.result-value { overflow: visible; white-space: normal; line-height: 1.55; }
.result-interval { display: block; margin-top: 3px; font-size: 10px; }
.age-table-wrap { max-width: 100%; overflow-x: auto; }
.age-input-table { width: 100%; border-collapse: collapse; font-size: 11px; }
.history-table { min-width: 900px; }
.auto-result-line h3 { margin: 12px 0 4px; font-size: 12px; }
.age-input-table th, .age-input-table td { padding: 6px 9px; border-bottom: 1px solid #eff0ec; text-align: right; white-space: nowrap; }
.age-input-table thead th { background: #f7f8f5; color: var(--muted); font-size: 10px; }
.age-input-table th:first-child { text-align: left; }
.age-input-table .age-value-input { min-width: 100px; min-height: 33px; padding: 6px 8px; text-align: right; }
.age-variable-card > .age-table-wrap { padding: 0 19px 15px; }
.age-total-row { font-weight: 700; }
.age-report { white-space: normal; }
.age-report > p { margin: 0 0 8px; font-size: 10px; }
.age-report small { display: block; margin-top: 8px; font-size: 10px; }
.page-footer { margin-top: 42px; padding-top: 15px; border-top: 1px solid var(--line); color: #849089; font-size: 10px; line-height: 1.5; }
[hidden] { display: none !important; }

@media (max-width:850px) {
  .layout { grid-template-columns: 1fr; grid-template-rows: auto minmax(0,1fr); }
  .sidebar { gap: 14px; max-height: 36dvh; padding: 18px 22px; border-right: 0; border-bottom: 1px solid var(--line); }
  .project-box { display: flex; align-items: center; gap: 12px; }
  .project-box label { flex: 0 0 160px; }
  .project-box input { margin: 0; }
  .side-heading, .sidebar-foot { display: none; }
  .section-nav { display: grid; overflow: visible; margin: 0; padding-bottom: 3px; }
  .nav-item { background: rgba(255,255,255,.55); }
  .content { padding: 38px 24px 24px; }
  .overview-panel { padding-top: 20px; }
}
@media (max-width:580px) {
  .top-actions { gap: 6px; }
  .top-actions .button { padding: 0 8px; font-size: 10px; }
  .topbar { height: 66px; padding: 0 17px; }
  .brand { font-size: 13px; }
  .brand-mark { width: 34px; height: 34px; }
  .save-status { display: none; }
  .layout { height: calc(100dvh - 66px); min-height: 0; }
  .sidebar { padding: 14px 16px; }
  .project-box { display: block; }
  .project-box label { display: block; margin-bottom: 8px; }
  .nav-item { flex-basis: 150px; }
  .content { padding: 32px 17px 20px; }
  .overview-stats { gap: 22px; }
  .stat strong { font-size: 24px; }
  .interval-grid { grid-template-columns: 1fr; padding: 0 14px 12px; }
  .interval { min-height: 0; }
  .variable-head { padding: 14px; }
  .measure-note { padding: 0 14px 12px; }
  .unit-note { padding: 0 14px 11px; }
  .entry-row { grid-template-columns: 1fr; padding: 12px 14px; }
  .classification { padding: 0 14px 13px; }
  .result-summary { grid-template-columns: repeat(2,1fr); }
  .result-line { grid-template-columns: 1fr auto; }
  .result-value { grid-column: 1/-1; grid-row: 2; }
  .result-line .badge { grid-column: 2; grid-row: 1; }
}
@media print {
  html, body { height: auto; overflow: visible; }
  body { background: white; }
  .topbar, .sidebar, .step-actions, .page-footer, .top-actions { display: none !important; }
  .layout { display: block; height: auto; min-height: 0; }
  .content { width: 100%; height: auto; overflow: visible; padding: 0; }
  .results-view { display: block !important; }
  .result-section, .summary-tile { break-inside: avoid; }
  .result-line { font-size: 9pt; }
}

/* Visual language adapted from Modelo Guia Prueba.pdf */
body { background: var(--paper); color: var(--ink); font-family: "Poppins", "Century Gothic", "Trebuchet MS", Arial, sans-serif; }
.topbar { background: var(--paper); border-bottom-color: var(--line); }
.brand { color: var(--plum); font-weight: 800; }
.save-status, .api-status { color: var(--muted); }
.layout { background: var(--paper); }
.sidebar { background: #f6f1e8; border-right-color: var(--line); }
.project-box label, .side-heading { color: var(--plum); font-family: "DejaVu Sans Mono", Consolas, monospace; font-size: 9px; letter-spacing: .12em; }
.project-box input, .landing-fields input, .landing-fields select, .value-input, .category-select { border-color: var(--line); border-radius: 5px; background: var(--white); color: var(--ink); }
.project-box input:focus, .value-input:focus, .category-select:focus, .landing-fields input:focus, .landing-fields select:focus { border-color: var(--green); box-shadow: 0 0 0 3px rgba(52,107,108,.12); }
.section-nav { gap: 7px; }
.nav-item { border-radius: 4px; color: var(--muted); }
.nav-item:hover { background: rgba(88,9,79,.06); }
.nav-item.active { background: var(--white); color: var(--plum); box-shadow: inset 3px 0 var(--plum), 0 1px 4px rgba(36,19,34,.06); }
.nav-num { border-color: transparent; background: #e8dedf; color: var(--plum); font-family: "DejaVu Sans Mono", Consolas, monospace; }
.nav-item:nth-child(5n+2) .nav-num, .nav-item:nth-child(5n+3) .nav-num, .nav-item:nth-child(5n+4) .nav-num, .nav-item:nth-child(5n+5) .nav-num { background: transparent; }
.nav-item.active .nav-num { border-color: var(--plum); background: var(--plum); color: white; }
.nav-label { font-weight: 600; }
.nav-count { color: var(--muted); font-family: "DejaVu Sans Mono", Consolas, monospace; font-size: 10px; }
.nav-item { background: var(--axis-tint, #e8d2e3); transition: background-color .16s, color .16s, transform .16s; }
.nav-item:hover { background: color-mix(in srgb, var(--axis-color, var(--plum)) 28%, white); }
.nav-subitem:hover, .nav-subitem:focus-visible { background: var(--axis-color, var(--plum)); color: var(--axis-active-ink, white); outline: 2px solid var(--axis-color, var(--plum)); outline-offset: 1px; }
.nav-subitem:hover .nav-label, .nav-subitem:hover .nav-num, .nav-subitem:hover .nav-count,
.nav-subitem:focus-visible .nav-label, .nav-subitem:focus-visible .nav-num, .nav-subitem:focus-visible .nav-count { color: var(--axis-active-ink, white); }
.nav-item .nav-num { border-color: transparent; background: color-mix(in srgb, var(--axis-color, var(--plum)) 13%, white); color: var(--axis-ink, var(--plum)); }
.nav-item .nav-num { flex: 0 0 18px; width: 18px; height: auto; min-height: 0; place-items: start; border: 0; border-radius: 0; background: transparent; font-size: 12px; line-height: 1.4; }
.nav-subitem .nav-num { flex-basis: 30px; width: 30px; font-size: 10px; }
.nav-item.active { background: var(--axis-color, var(--plum)); color: white; box-shadow: none; }
.nav-item.active .nav-label, .nav-item.active .nav-count { color: var(--axis-active-ink, white); }
.nav-item.active .nav-num { border: 0; background: transparent; color: var(--axis-active-ink, white); }
.nav-item.results-item.active, .nav-item.results-item.active .nav-label, .nav-item.results-item.active .nav-num { color: #fff !important; }
.status-dot { background: var(--green); }
.sidebar-foot { border-top-color: var(--line); }
.content { padding-top: 42px; }
.overview-panel { position: relative; isolation: isolate; overflow: hidden; max-width: none; padding: clamp(32px,5vw,62px); background: var(--plum); color: white; }
.overview-panel::before { position: absolute; z-index: 0; top: -95px; right: -110px; width: 350px; height: 350px; border: 1px solid rgba(255,255,255,.12); border-radius: 50%; box-shadow: 0 0 0 45px rgba(255,255,255,.035), 0 0 0 95px rgba(255,255,255,.025); content: ""; pointer-events: none; }
.overview-panel::after { position: absolute; z-index: 0; top: 76px; right: 90px; width: 64px; height: 64px; border-radius: 50%; background: var(--gold); box-shadow: -35px 22px 0 var(--magenta), 18px 47px 0 var(--green); content: ""; opacity: .95; pointer-events: none; }
.overview-panel::after { content: none; }
.hero-brand-lockup { position: absolute !important; z-index: 2 !important; top: 30px; right: 42px; display: flex; align-items: center; gap: 10px; }
.hero-logo { display: block; width: 48px; height: 70px; color: #f0cce0; overflow: visible; }
.hero-brand-lockup p { margin: 0; color: white; font-size: clamp(16px,2vw,25px); font-weight: 800; line-height: 1.05; letter-spacing: -.045em; }
.hero-brand-lockup p span { color: var(--gold); }
.overview-panel > * { position: relative; z-index: 1; }
.overview-panel .eyebrow { color: var(--gold); font-family: "DejaVu Sans Mono", Consolas, monospace; font-size: 10px; }
.overview-panel h1 { max-width: 680px; margin-top: 20px; color: white; font-size: clamp(38px,5vw,62px); font-weight: 700; letter-spacing: -.055em; }
.overview-panel h1 em { color: var(--gold); font-family: inherit; font-style: normal; font-weight: 700; }
.overview-panel .intro { max-width: 570px; color: #eadde8; font-size: 15px; }
.landing-fields { max-width: 600px; margin: 29px 0 22px; padding: 22px; border: 1px solid rgba(255,255,255,.35); border-radius: 8px; background: var(--paper); color: var(--ink); box-shadow: 0 12px 35px rgba(24,4,21,.12); }
.landing-fields label { color: var(--plum); font-size: 10px; font-weight: 700; letter-spacing: .05em; }
.landing-fields input, .landing-fields select { min-height: 44px; }
.municipality-options { border-color: var(--line); border-radius: 5px; box-shadow: 0 12px 28px rgba(36,19,34,.16); }
.municipality-option:hover, .municipality-option:focus { background: #eee6ee; color: var(--plum); }
.population-pyramid { border-color: var(--line); border-radius: 5px; background: #fffdf9; }
.pyramid-side { background: #ece8e0; }
.male-bar { background: var(--green); }
.female-bar { background: var(--magenta); }
.overview-stats { gap: 34px; margin: 28px 0; }
.overview-panel .stat strong { color: white; font-size: 31px; }
.overview-panel .stat span { color: #d7c8d4; }
.callout { border-color: rgba(243,170,31,.48); border-radius: 5px; background: rgba(243,170,31,.13); color: #fff0c9; }
.callout-icon { border-color: var(--gold); color: var(--gold); }
.button { border-radius: 4px; font-family: "DejaVu Sans Mono", Consolas, monospace; letter-spacing: .015em; }
.button-primary { background: var(--gold); color: var(--plum); }
.button-primary:hover { background: #ffc044; }
.button-quiet { border-color: var(--line); background: var(--paper); color: var(--plum); }
.eyebrow { color: var(--plum); font-family: "DejaVu Sans Mono", Consolas, monospace; font-size: 10px; letter-spacing: .12em; }
.section-topline .eyebrow::before { display: inline-block; width: 18px; height: 1px; margin: 0 9px 3px 0; background: currentColor; content: ""; }
.section-view { padding: 22px; border-top: 7px solid var(--axis-color, var(--plum)); border-radius: 6px; background: linear-gradient(var(--axis-tint, #efe4ed), var(--paper) 500px); }
.section-view .section-topline .eyebrow, .section-view h1 { color: var(--axis-color, var(--plum)); }
.section-view h1, .results-view h1 { color: var(--plum); font-size: clamp(32px,4vw,48px); font-weight: 700; letter-spacing: -.045em; }
.section-view h1 em, .results-view h1 em { color: var(--magenta); font-style: normal; }
.axis-phrase { margin: -5px 0 15px; color: var(--axis-color, var(--plum)); font-size: 12px; font-weight: 800; letter-spacing: .01em; }
.section-lede { color: var(--muted); }
.variable-list { gap: 12px; }
.variable-card { border-color: var(--line); border-radius: 7px; background: var(--white); box-shadow: none; }
.variable-head { padding-top: 20px; }
.variable-head h2 { color: var(--plum); font-size: 16px; font-weight: 700; letter-spacing: -.025em; }
.variable-id { color: var(--muted); font-family: "DejaVu Sans Mono", Consolas, monospace; font-size: 9px; letter-spacing: .08em; }
.measure-note strong, .unit-note strong { color: var(--plum); }
.interval { border: 1px solid var(--line); border-radius: 5px; background: #f7f2e9; }
.interval.desired { border-color: #cbded8; background: var(--green-soft); }
.interval.desired strong, .badge.desired { color: #285b5d; }
.interval.minimum { border-color: #f0d697; background: var(--gold-soft); }
.interval.minimum strong, .badge.minimum { color: #805300; }
.interval.deficient { border-color: #e3c3d5; background: var(--red-soft); }
.interval.deficient strong, .badge.deficient { color: var(--magenta); }
.entry-row { border-top-color: var(--line); }
.badge { padding: 5px 10px; border-radius: 999px; font-family: "DejaVu Sans Mono", Consolas, monospace; font-size: 9px; font-weight: 500; letter-spacing: .015em; }
.badge.desired { background: var(--green-soft); }
.badge.minimum { background: var(--gold-soft); }
.badge.deficient { background: var(--red-soft); }
.badge.pending { background: #eee8e8; color: var(--muted); }
.result-summary { gap: 12px; }
.summary-tile { border-color: var(--line); border-radius: 5px; background: var(--white); }
.summary-tile:nth-child(1) { border-top: 3px solid var(--plum); }
.summary-tile:nth-child(2) { border-top: 3px solid var(--green); }
.summary-tile:nth-child(3) { border-top: 3px solid var(--gold); }
.summary-tile:nth-child(4) { border-top: 3px solid var(--magenta); }
.summary-tile strong { color: var(--plum); }
.result-section { border-color: var(--line); border-radius: 6px; background: var(--white); }
.result-section { border-left: 6px solid var(--axis-color, var(--plum)); background: color-mix(in srgb, var(--axis-tint, var(--white)) 88%, var(--axis-color, var(--plum))); }
.result-section h2 { color: var(--axis-color, var(--plum)); }
.result-line { border-top-color: var(--line); }
.classification-only { grid-template-columns: minmax(0,1fr) auto; }
.classification-badges { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; }
.result-indicator { display: grid; gap: 5px; }
.result-formula { color: var(--muted); font-size: 11px; line-height: 1.5; }
.result-formula strong { color: var(--ink); }
.age-results { margin-top: 6px; }
.age-results summary { color: var(--plum); cursor: pointer; font-weight: 700; }
.age-results .population-pyramid { margin: 12px 0; max-width: 640px; }
.result-criteria { margin-top: 6px; }
.result-criteria summary { color: var(--plum); cursor: pointer; font-weight: 700; }
.result-criteria .interval-grid { margin-top: 9px; padding: 0 0 4px; }
.result-category-choice { display: grid; gap: 5px; max-width: 320px; margin: 8px 0; }
.interval.desired { border-color: #b8d8bb; background: var(--category-desired-soft); }
.interval.desired strong, .badge.desired { color: var(--category-desired); }
.badge.desired { background: var(--category-desired-soft); }
.interval.minimum { border-color: #f0c47a; background: var(--category-minimum-soft); }
.interval.minimum strong, .badge.minimum { color: #a85b00; }
.badge.minimum { background: var(--category-minimum-soft); }
.interval.deficient { border-color: #e9b3b3; background: var(--category-deficient-soft); }
.interval.deficient strong, .badge.deficient { color: var(--category-deficient); }
.badge.deficient { background: var(--category-deficient-soft); }
.summary-tile:nth-child(2) { border-top-color: var(--category-desired); }
.summary-tile:nth-child(2) strong { color: var(--category-desired); }
.summary-tile:nth-child(3) { border-top-color: var(--category-minimum); }
.summary-tile:nth-child(3) strong { color: #a85b00; }
.summary-tile:nth-child(4) { border-top-color: var(--category-deficient); }
.summary-tile:nth-child(4) strong { color: var(--category-deficient); }
.age-input-table thead th { background: var(--green); color: white; }
.age-input-table th, .age-input-table td { border-bottom-color: var(--line); }
.age-total-row { color: var(--plum); }
.page-footer { border-top-color: var(--line); color: var(--muted); font-family: "DejaVu Sans Mono", Consolas, monospace; font-size: 9px; letter-spacing: .04em; text-transform: uppercase; }

@media (max-width:850px) {
  .overview-panel { padding: 34px 26px; }
  .hero-brand-lockup { top: 25px; right: 24px; }
  .hero-logo { width: 42px; height: 62px; }
}
@media (max-width:580px) {
  .overview-panel { margin: 0 -5px; padding: 32px 19px; }
  .overview-panel::before { right: -230px; }
  .hero-brand-lockup { position: relative !important; top: auto; right: auto; justify-content: flex-start; margin-bottom: 28px; }
  .hero-logo { width: 42px; height: 62px; }
  .hero-brand-lockup p { font-size: 18px; }
  .overview-panel h1, .overview-panel .intro { max-width: 100%; }
  .section-view { padding: 15px 10px; }
  .landing-fields { padding: 16px; }
  .content { padding-top: 26px; }
}
