/* ============================================================
   J&H Consulting Group · Ceuta 2026 — Design system
   Navy + gold, extracted from the document brand.
   ============================================================ */

:root {
  --navy-950: #0E1828;
  --navy-900: #14213A;
  --navy-850: #17253F;
  --navy-800: #1B2B47;
  --navy-700: #24365A;
  --ink: #1B2A44;
  --text: #3B475E;
  --muted: #6B7690;
  --faint: #5E6D89;
  --gold: #B9945A;
  --gold-2: #C9A76B;
  --gold-dim: rgba(185, 148, 90, 0.55);
  --paper: #F5F6F9;
  --card: #FFFFFF;
  --line: #E1E5EE;
  --line-2: #D3D9E5;
  --cream: #FAF4E6;
  --green: #2E7D5B;
  --amber: #B27A14;
  --red: #B23A30;
  --blue: #3D5C8F;
  --shadow: 0 1px 2px rgba(16, 24, 40, 0.05), 0 4px 14px rgba(16, 24, 40, 0.06);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--text);
  font: 15px/1.62 -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
img, svg { display: block; }
.gold { color: var(--gold); }

/* ---------- topbar ---------- */

.topbar {
  position: sticky; top: 0; z-index: 60;
  background: var(--navy-900);
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.topbar-inner {
  max-width: 1360px; margin: 0 auto; height: 58px;
  display: flex; align-items: center; gap: 16px;
  padding: 0 28px;
}
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; }
.brand-pin { width: 26px; height: 29px; color: var(--gold); }
.brand-pin svg { width: 100%; height: 100%; }
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-name { color: #fff; font-size: 19px; font-weight: 800; letter-spacing: 0.02em; }
.brand-name .amp { color: var(--gold); font-weight: 700; }
.brand-sub { color: rgba(255,255,255,0.55); font-size: 9.5px; letter-spacing: 0.28em; text-transform: uppercase; }
.classif {
  margin-left: auto;
  color: var(--gold-2);
  font-size: 10.5px; letter-spacing: 0.22em; text-transform: uppercase; font-weight: 700;
  border: 1px solid rgba(201,167,107,0.4); border-radius: 3px;
  padding: 6px 12px; white-space: nowrap;
}

/* ---------- hero ---------- */

.hero {
  position: relative; overflow: hidden;
  background: var(--navy-850);
  color: #fff;
  padding: 88px 28px 72px;
}
.hero-bg, .footer .hero-bg {
  position: absolute; inset: 0;
  background: url("../assets/contours.svg") center / cover no-repeat;
  opacity: 0.9; pointer-events: none;
}
.hero::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(20,33,58,0.25), rgba(14,24,40,0.55));
  pointer-events: none;
}
.hero-inner {
  position: relative; z-index: 2;
  max-width: 1000px; margin: 0 auto; text-align: center;
}
.hero-pin { width: 64px; height: 71px; margin: 0 auto 26px; color: var(--gold); }
.hero-pin svg { width: 100%; height: 100%; }
.kicker {
  color: var(--gold);
  font-size: 11.5px; font-weight: 700; letter-spacing: 0.3em; text-transform: uppercase;
  margin: 0 0 14px;
}
.hero-title {
  margin: 0; font-size: clamp(44px, 7.5vw, 84px); font-weight: 800;
  letter-spacing: -0.015em; line-height: 1.02; color: #fff;
}
.hero-rule { width: 84px; height: 2px; background: var(--gold); margin: 26px auto 22px; }
.hero-sub { font-size: 19px; font-weight: 400; color: rgba(255,255,255,0.88); max-width: 640px; margin: 0 auto; }
.hero-regions { margin-top: 20px; font-size: 12.5px; letter-spacing: 0.3em; text-transform: uppercase; }
.hero-meta {
  margin: 34px auto 0; max-width: 860px;
  display: flex; flex-wrap: wrap; justify-content: center; gap: 10px 34px;
  font-size: 12.5px; color: rgba(255,255,255,0.62);
}
.hero-meta strong { color: rgba(255,255,255,0.95); font-weight: 600; margin-right: 6px; }

.hero-docs {
  margin-top: 44px; display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 16px;
  max-width: 940px; margin-left: auto; margin-right: auto;
}
.doc-card {
  display: flex; align-items: center; gap: 16px; text-decoration: none;
  background: rgba(255,255,255,0.045);
  border: 1px solid rgba(255,255,255,0.14);
  border-radius: 10px; padding: 18px 20px;
  transition: background 0.2s, border-color 0.2s, transform 0.2s;
}
.doc-card:nth-child(3):last-child { grid-column: 1 / -1; max-width: 462px; margin: 0 auto; width: 100%; }
.doc-card:hover { background: rgba(255,255,255,0.09); border-color: rgba(201,167,107,0.55); transform: translateY(-2px); }
.doc-card-pin { width: 34px; height: 38px; flex: none; }
.doc-card-pin svg { width: 100%; height: 100%; }
.doc-card-body { display: flex; flex-direction: column; gap: 3px; min-width: 0; text-align: left; }
.doc-card-kicker { color: var(--gold-2); font-size: 10px; letter-spacing: 0.24em; text-transform: uppercase; font-weight: 700; }
.doc-card-title { color: #fff; font-size: 15.5px; font-weight: 700; line-height: 1.35; }
.doc-card-meta { color: rgba(255,255,255,0.55); font-size: 12px; }
.doc-card-cta { margin-left: auto; color: var(--gold-2); font-size: 13px; font-weight: 700; white-space: nowrap; text-align: left; }

/* ---------- document tabs ---------- */

.doctabs {
  position: sticky; top: 58px; z-index: 50;
  background: #fff; border-bottom: 1px solid var(--line);
  display: flex; gap: 8px; padding: 12px 28px 0;
  max-width: 1360px; margin: 0 auto; width: 100%;
  align-items: center;
}
.doctabs { box-shadow: 0 1px 0 var(--line); }
.doctab {
  appearance: none; border: 1px solid transparent; border-bottom: none;
  background: transparent; cursor: pointer;
  font: 600 13.5px/1 inherit; color: var(--muted);
  padding: 11px 18px 13px; border-radius: 8px 8px 0 0;
  letter-spacing: 0.02em;
}
.doctab:hover { color: var(--ink); background: var(--paper); }
.doctab.active { color: var(--ink); background: #fff; border-color: var(--line); border-bottom: 2px solid var(--gold); }

/* ---------- layout ---------- */

.layout {
  max-width: 1360px; margin: 0 auto;
  display: grid; grid-template-columns: 258px minmax(0, 1fr);
  gap: 44px; padding: 40px 28px 100px;
  align-items: start;
}
.sidebar { position: sticky; top: 138px; max-height: calc(100vh - 158px); overflow: auto; }
.side-label {
  font-size: 10.5px; letter-spacing: 0.24em; text-transform: uppercase;
  color: var(--faint); font-weight: 700; padding: 0 12px 12px;
  border-bottom: 1px solid var(--line); margin-bottom: 8px;
}
.side-link {
  display: flex; gap: 10px; align-items: baseline;
  padding: 8px 12px; margin: 2px 0;
  border-left: 2px solid transparent;
  text-decoration: none; color: var(--muted); font-size: 13.5px; font-weight: 500;
  border-radius: 0 6px 6px 0;
}
.side-link:hover { color: var(--ink); background: #EFF1F6; }
.side-link.active { color: var(--ink); font-weight: 700; border-left-color: var(--gold); background: #F0F2F7; }
.side-num { color: var(--gold); font-size: 11px; font-weight: 800; min-width: 30px; letter-spacing: 0.04em; }

/* ---------- document header ---------- */

.dochead {
  grid-column: 2;
  background: var(--card); border: 1px solid var(--line); border-radius: 12px;
  box-shadow: var(--shadow);
  padding: 34px 38px 30px; margin-bottom: 8px;
  border-top: 3px solid var(--gold);
}
.doc-title { margin: 0; color: var(--ink); font-size: clamp(26px, 3.4vw, 38px); font-weight: 800; letter-spacing: -0.01em; line-height: 1.12; }
.doc-subtitle { margin: 12px 0 0; color: var(--text); font-size: 16px; max-width: 780px; }
.doc-regions { margin-top: 14px; font-size: 11.5px; letter-spacing: 0.26em; text-transform: uppercase; }
.doc-meta { margin-top: 20px; display: flex; flex-wrap: wrap; gap: 8px 28px; font-size: 13px; color: var(--muted); }
.meta-k { color: var(--ink); font-weight: 700; }
.doc-actions { margin-top: 22px; display: flex; gap: 10px; flex-wrap: wrap; }

.btn {
  appearance: none; cursor: pointer; text-decoration: none;
  font: 600 13.5px/1 inherit; letter-spacing: 0.02em;
  border-radius: 7px; padding: 11px 18px;
  border: 1px solid var(--line-2); background: #fff; color: var(--ink);
  transition: background 0.15s, border-color 0.15s;
}
.btn:hover { border-color: var(--faint); background: var(--paper); }
.btn-gold { background: var(--gold); border-color: var(--gold); color: #fff; }
.btn-gold:hover { background: #A8854C; border-color: #A8854C; }
.btn-sm { padding: 8px 12px; font-size: 12.5px; border-radius: 6px; }

/* ---------- main content ---------- */

.main { grid-column: 2; min-width: 0; }
.block { padding: 44px 0 52px; border-bottom: 1px solid var(--line); scroll-margin-top: 142px; }
.block:last-child { border-bottom: none; }
.sec-title { margin: 0 0 10px; color: var(--ink); font-size: clamp(22px, 2.6vw, 30px); font-weight: 800; letter-spacing: -0.008em; line-height: 1.18; }
.sec-intro { margin: 0 0 24px; color: var(--muted); font-size: 15px; max-width: 860px; }
.subhead { display: flex; align-items: center; gap: 12px; margin: 30px 0 14px; flex-wrap: wrap; }
.subhead .kicker { margin: 0; }
.fnote { color: var(--faint); font-size: 12.5px; margin: 16px 0 0; max-width: 900px; }
p { margin: 0 0 14px; }
p:last-child { margin-bottom: 0; }

/* ---------- tags & badges ---------- */

.tag {
  display: inline-block; vertical-align: middle;
  font-size: 10px; font-weight: 800; letter-spacing: 0.12em; text-transform: uppercase;
  padding: 4px 9px; border-radius: 3px; line-height: 1.3;
}
.tag-fact { background: var(--navy-800); color: #fff; }
.tag-juicio { background: var(--gold); color: #fff; }
.tag-valoracion { background: #5B6B85; color: #fff; }
.tag-estimacion { background: #6E7890; color: #fff; }
.tag-fuente-por-celda, .tag-requisito-de-recoleccion, .tag-escenario-j&h, .tag-confianza-baja {
  background: transparent; color: var(--muted); border: 1px solid var(--line-2);
}
.conf {
  display: inline-block; vertical-align: middle;
  font-size: 10px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase;
  padding: 4px 9px; border-radius: 3px; margin-left: 6px;
  border: 1px solid;
}
.conf-alta { color: var(--green); border-color: rgba(46,125,91,0.45); background: rgba(46,125,91,0.07); }
.conf-moderada { color: var(--amber); border-color: rgba(178,122,20,0.5); background: rgba(178,122,20,0.07); }
.conf-baja { color: var(--red); border-color: rgba(178,58,48,0.5); background: rgba(178,58,48,0.07); }
.hl-tags { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 10px; }

/* ---------- boxes ---------- */

.box { border-radius: 10px; padding: 22px 26px; margin: 22px 0; }
.box p { margin: 0; }
.box-navy { background: var(--navy-800); color: rgba(255,255,255,0.92); }
.box-navy .box-kicker { color: var(--gold-2); }
.box-cream { background: var(--cream); border-left: 3px solid var(--gold); color: var(--ink); }
.box-cream .box-kicker strong { color: var(--ink); font-weight: 800; }
.box-kicker {
  font-size: 10.5px; font-weight: 800; letter-spacing: 0.24em; text-transform: uppercase;
  margin-bottom: 10px; color: var(--gold);
}
.box-cream .box-kicker { color: #8A6B33; }

/* ---------- accordions ---------- */

.acc-list { margin: 8px 0 20px; }
.acc {
  border: 1px solid var(--line); border-radius: 9px; background: var(--card);
  margin-bottom: 10px; overflow: hidden;
}
.acc-head {
  appearance: none; border: none; background: transparent; cursor: pointer; width: 100%;
  display: flex; align-items: center; gap: 12px; padding: 15px 18px; text-align: left;
  font: inherit; color: inherit;
}
.acc-head:hover { background: #FAFBFD; }
.acc-code { color: var(--gold); font-weight: 800; font-size: 14px; min-width: 44px; letter-spacing: 0.03em; }
.acc-tags { display: flex; gap: 6px; flex-wrap: wrap; }
.acc-title { flex: 1; font-weight: 700; color: var(--ink); font-size: 15px; line-height: 1.4; }
.acc-caret {
  flex: none; width: 9px; height: 9px;
  border-right: 2px solid var(--faint); border-bottom: 2px solid var(--faint);
  transform: rotate(45deg); transition: transform 0.25s;
}
.acc.open .acc-caret, .risk.open .acc-caret { transform: rotate(225deg); }
.acc-body { display: grid; grid-template-rows: 0fr; transition: grid-template-rows 0.3s ease; }
.acc.open .acc-body { grid-template-rows: 1fr; }
.acc-body-inner { overflow: hidden; }
.acc.open .acc-body-inner, .risk.open .acc-body-inner { padding: 0 18px 18px; }
.acc .acc-body-inner p, .risk .acc-body-inner p { color: var(--text); margin: 0; }

/* ---------- generic cards ---------- */

.card-col { display: flex; flex-direction: column; gap: 14px; margin: 8px 0 18px; }
.hl-card, .fact-card, .lvl-card, .rec-card {
  background: var(--card); border: 1px solid var(--line); border-radius: 9px;
  padding: 18px 22px; box-shadow: 0 1px 2px rgba(16,24,40,0.04);
}
.hl-card { border-left: 3px solid var(--gold); }
.fact-card { border-left: 3px solid var(--navy-800); }
.hl-card h4, .fact-card h4, .lvl-card h4, .rec-card h4 {
  margin: 0 0 8px; color: var(--ink); font-size: 15.5px; font-weight: 800; line-height: 1.35;
}
.lvl-tag {
  display: inline-block; color: var(--gold); font-size: 10.5px; font-weight: 800;
  letter-spacing: 0.24em; text-transform: uppercase; margin-bottom: 8px;
}
.lvl-card, .rec-card { padding: 22px 26px; }
.lvl-card p, .rec-card p { color: var(--text); }

/* messages list (03) */
.msg-list { list-style: none; margin: 10px 0 20px; padding: 0; counter-reset: msg; }
.msg-list li {
  counter-increment: msg; display: grid; grid-template-columns: 56px 1fr; gap: 6px 20px;
  padding: 18px 0; border-bottom: 1px solid var(--line);
}
.msg-list li:last-child { border-bottom: none; }
.msg-list li::before {
  content: counter(msg); color: var(--gold); font-size: 30px; font-weight: 800; line-height: 1;
}
.msg-list h4 { grid-column: 2; margin: 0 0 8px; color: var(--ink); font-size: 16px; font-weight: 800; }
.msg-list p { grid-column: 2; margin: 0; color: var(--text); }

/* ---------- tables ---------- */

.table-wrap { overflow-x: auto; margin: 10px 0 6px; border: 1px solid var(--line); border-radius: 9px; background: var(--card); }
.tbl { width: 100%; border-collapse: collapse; font-size: 13.5px; min-width: 640px; }
.tbl th {
  background: var(--navy-800); color: #fff; text-align: left;
  font-size: 11px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase;
  padding: 12px 16px; white-space: nowrap;
}
.tbl td { padding: 13px 16px; border-top: 1px solid var(--line); vertical-align: top; line-height: 1.55; }
.tbl tr td:first-child { border-left: none; }
.td-strong { color: var(--ink); font-weight: 700; }
.tbl tbody tr:nth-child(even) td { background: #FAFBFD; }
.evid { margin: 18px 0; padding: 16px 20px; background: var(--card); border: 1px solid var(--line); border-left: 3px solid var(--gold); border-radius: 8px; }
.evid .box-kicker { display: inline; margin-right: 10px; }
.evid p { margin-top: 10px; }

/* ---------- risks (05) ---------- */

.risk { border: 1px solid var(--line); border-radius: 9px; background: var(--card); margin-bottom: 10px; overflow: hidden; }
.risk-head {
  appearance: none; background: transparent; border: none; cursor: pointer; width: 100%;
  display: flex; align-items: center; gap: 14px; padding: 14px 18px; text-align: left; font: inherit; color: inherit;
}
.risk-head:hover { background: #FAFBFD; }
.risk-id { color: var(--ink); font-weight: 800; min-width: 38px; font-size: 14px; }
.risk-name { flex: 1; font-weight: 700; color: var(--ink); font-size: 14.5px; line-height: 1.35; }
.band { display: inline-flex; align-items: center; gap: 3px; }
.band-cell { width: 11px; height: 11px; border-radius: 2px; background: #E8EBF2; }
.band-cell.on { background: var(--navy-800); }
.band-label { margin-left: 8px; font-size: 11px; color: var(--muted); font-weight: 700; letter-spacing: 0.06em; }
.impact { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; white-space: nowrap; }
.impact .dot { width: 9px; height: 9px; border-radius: 50%; }
.impact-alto { color: var(--red); } .impact-alto .dot { background: var(--red); }
.impact-medio { color: var(--amber); } .impact-medio .dot { background: var(--amber); }
.risk-grid { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr); gap: 8px 26px; }
.risk-grid .lbl, .hyp-grid .lbl {
  font-size: 10.5px; font-weight: 800; letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--faint); margin-bottom: 6px;
}
.hyp-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 26px; margin-bottom: 12px; }

/* ---------- dashboard (06) ---------- */

.seg-bar { margin: 4px 0 20px; }
.seg-bar-top { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 6px; }
.seg-bar-top .lbl { font-size: 11px; font-weight: 800; letter-spacing: 0.1em; color: var(--navy-800); }
.seg-bar-top .val { font-size: 13px; font-weight: 800; letter-spacing: 0.05em; }
.seg-track { position: relative; display: flex; height: 22px; border-radius: 5px; overflow: hidden; }
.seg-track > div { flex: 1; display: flex; align-items: center; justify-content: center; font-size: 10px; font-weight: 800; color: #fff; letter-spacing: 0.05em; }
.seg-bajo { background: var(--green); } .seg-mod { background: #C9A33B; } .seg-elev { background: #C06A2E; } .seg-alto { background: var(--red); }
.seg-marker { position: absolute; top: -7px; width: 0; height: 0; border-left: 7px solid transparent; border-right: 7px solid transparent; border-top: 9px solid var(--navy-900); transform: translateX(-7px); }
.seg-note { font-size: 11.5px; color: var(--muted); font-style: italic; margin: 6px 0 0; }

.stat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px 22px; margin: 0 0 22px; }
.stat-tile .num { font-size: 22px; font-weight: 800; color: var(--navy-900); line-height: 1.1; }
.stat-tile .lbl { font-size: 11.5px; color: var(--muted); margin-top: 3px; line-height: 1.3; }

.dash-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin: 8px 0 26px; }
.dash-card {
  background: var(--card); border: 1px solid var(--line); border-radius: 9px;
  padding: 16px 20px; box-shadow: 0 1px 2px rgba(16,24,40,0.04);
  border-left-width: 4px;
}
.dash-card h4 { margin: 0; font-size: 14.5px; font-weight: 800; color: var(--ink); }
.dash-card p { margin: 8px 0 0; font-size: 13px; color: var(--muted); }
.dash-top { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.dash-st { font-size: 10px; font-weight: 800; letter-spacing: 0.18em; white-space: nowrap; }
.st-verde { border-left-color: var(--green); } .st-verde .dash-st { color: var(--green); }
.st-amb { border-left-color: var(--amber); } .st-amb .dash-st { color: var(--amber); }
.st-rojo { border-left-color: var(--red); } .st-rojo .dash-st { color: var(--red); }
.st-azul { border-left-color: var(--blue); } .st-azul .dash-st { color: var(--blue); }

/* scenarios */
.scen-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin: 8px 0 6px; }
.scen-card {
  background: var(--card); border: 1px solid var(--line); border-top: 3px solid var(--gold);
  border-radius: 9px; padding: 18px 20px;
}
.scen-id { color: var(--gold); font-weight: 800; font-size: 22px; }
.scen-card h4 { margin: 4px 0 2px; color: var(--ink); font-size: 15.5px; font-weight: 800; line-height: 1.3; }
.scen-kind { color: var(--muted); font-size: 12px; margin-bottom: 10px; }
.scen-card .band { margin-bottom: 12px; }
.scen-card p { font-size: 13px; margin: 0 0 10px; }
.scen-note { color: var(--muted); font-size: 12.5px; }

/* ---------- indicators (07) ---------- */

.thr { display: flex; align-items: flex-start; gap: 8px; font-size: 12.5px; line-height: 1.5; }
.thr .dot { flex: none; width: 8px; height: 8px; border-radius: 50%; margin-top: 5px; }
.thr-amb { color: var(--text); } .thr-amb .dot { background: var(--amber); }
.thr-red { color: var(--text); } .thr-red .dot { background: var(--red); }
.thr + .thr { margin-top: 8px; }

.cal { margin-top: 6px; }
.cal-row { display: grid; grid-template-columns: 120px 1fr; gap: 20px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.cal-row:last-child { border-bottom: none; }
.cal-date { grid-column: 1; color: var(--gold); font-weight: 800; font-size: 14px; letter-spacing: 0.02em; }
.cal-row p { grid-column: 2; margin: 0; color: var(--text); font-size: 14px; }

/* ---------- recommendations (09) ---------- */

.rec-card ol { margin: 10px 0 0; padding-left: 20px; }
.rec-card li { margin-bottom: 10px; color: var(--text); }
.rec-card li:last-child { margin-bottom: 0; }

/* ---------- methodology (10) ---------- */

.meth-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 20px; }
.meth-card { background: var(--card); border: 1px solid var(--line); border-radius: 9px; padding: 20px 24px; }
.meth-card h4 { margin: 0 0 10px; color: var(--ink); font-size: 15px; font-weight: 800; }
.meth-card p, .meth-card li { font-size: 13.5px; color: var(--text); }
.meth-card ul { margin: 8px 0 0; padding-left: 18px; }
.meth-card li { margin-bottom: 8px; }

/* ---------- sources ---------- */

.src-tools { display: flex; gap: 12px; align-items: center; margin: 10px 0 18px; flex-wrap: wrap; }
.src-search, .src-cat {
  font: inherit; font-size: 13.5px; color: var(--ink);
  border: 1px solid var(--line-2); border-radius: 8px; background: #fff;
  padding: 10px 14px;
}
.src-search { flex: 1; min-width: 220px; }
.src-search:focus, .src-cat:focus { outline: 2px solid rgba(185,148,90,0.4); outline-offset: -1px; }
.src-count { color: var(--faint); font-size: 12.5px; white-space: nowrap; }
.src {
  display: grid; grid-template-columns: 40px minmax(0, 1fr); gap: 14px;
  padding: 13px 0; border-bottom: 1px solid var(--line);
}
.src-n { color: var(--gold); font-weight: 800; font-size: 13px; }
.src-t { font-weight: 600; color: var(--ink); font-size: 14px; line-height: 1.45; }
.src-cat {
  display: inline-block; margin-left: 8px; padding: 2px 8px; border-radius: 999px;
  font-size: 10px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--muted); border: 1px solid var(--line-2); vertical-align: 1px;
}
.src-u {
  grid-column: 2; color: var(--faint); font-size: 12px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  word-break: break-all; text-decoration: none;
}
.src-u:hover { color: var(--gold); }
.src-empty { color: var(--faint); font-style: italic; }

/* ---------- ficha: opciones ---------- */

.chip-row { display: flex; gap: 8px; flex-wrap: wrap; margin: 0 0 12px; }
.chip {
  appearance: none; cursor: pointer;
  font: 600 12.5px/1 inherit; letter-spacing: 0.04em;
  color: var(--muted); background: #fff;
  border: 1px solid var(--line-2); border-radius: 999px;
  padding: 8px 16px; transition: all 0.15s;
}
.chip:hover { border-color: var(--faint); color: var(--ink); }
.chip.active { background: var(--navy-800); border-color: var(--navy-800); color: #fff; }

.opt-list { margin-top: 18px; }
.opt-card {
  background: var(--card); border: 1px solid var(--line); border-radius: 10px;
  padding: 20px 24px; margin-bottom: 14px; box-shadow: 0 1px 2px rgba(16,24,40,0.04);
}
.opt-top { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.opt-area { margin-left: auto; color: var(--faint); font-size: 11px; font-weight: 700; letter-spacing: 0.18em; text-transform: uppercase; }
.opt-text { margin: 0 0 14px; color: var(--ink); font-size: 15px; font-weight: 600; line-height: 1.55; }
.base-line { color: var(--muted); font-size: 13.5px; line-height: 1.6; border-top: 1px dashed var(--line); padding-top: 12px; }
.base-line .lbl, .risk-grid .lbl, .hyp-grid .lbl { display: block; }
.base-line .lbl { margin-bottom: 4px; color: var(--gold); font-size: 10.5px; font-weight: 800; letter-spacing: 0.2em; text-transform: uppercase; }

/* ---------- ficha: secuencia ---------- */

.seq-list { list-style: none; margin: 8px 0 22px; padding: 0; counter-reset: seq; }
.seq-list li {
  counter-increment: seq; position: relative;
  padding: 10px 0 10px 46px; border-bottom: 1px solid var(--line);
  color: var(--text); font-size: 14.5px;
}
.seq-list li::before {
  content: counter(seq);
  position: absolute; left: 0; top: 9px;
  width: 30px; height: 30px; border-radius: 50%;
  background: var(--navy-800); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 800;
}
.limits { margin: 8px 0; padding: 20px 24px 6px 24px; background: #FDF6F4; border: 1px solid #F0DCD6; border-left: 3px solid var(--red); border-radius: 8px; }
.limits li { margin: 0 0 12px; color: var(--text); font-size: 14px; }
.limits li strong { color: var(--ink); }
.limits li:last-child { margin-bottom: 8px; }

/* ---------- footer ---------- */

.footer {
  position: relative; overflow: hidden;
  background: var(--navy-850); color: rgba(255,255,255,0.75);
  padding: 70px 28px 56px; text-align: center;
}
.footer::after { content: ""; position: absolute; inset: 0; background: rgba(14,24,40,0.55); pointer-events: none; }
.footer-inner { position: relative; z-index: 2; max-width: 860px; margin: 0 auto; }
.wordmark { color: #fff; font-size: 44px; font-weight: 800; letter-spacing: 0.06em; }
.wordmark .amp { color: var(--gold); }
.wm-sub { color: rgba(255,255,255,0.75); font-size: 12px; letter-spacing: 0.42em; text-transform: uppercase; margin-top: 10px; }
.wm-rule { width: 110px; height: 2px; background: var(--gold); margin: 26px auto; }
.wm-tag { font-size: 14.5px; line-height: 1.7; color: rgba(255,255,255,0.85); }
.wm-tag strong { color: #fff; }
.legal { font-size: 11.5px; line-height: 1.65; color: rgba(255,255,255,0.5); margin: 22px auto 0; max-width: 780px; }
.classif-footer { margin-top: 30px; display: inline-block; border-color: rgba(201,167,107,0.4); color: var(--gold-2); }

/* ---------- PDF modal ---------- */

.pdfmodal {
  position: fixed; inset: 0; z-index: 100; display: none;
  background: rgba(10, 16, 28, 0.82); backdrop-filter: blur(3px);
}
.pdfmodal.open { display: flex; flex-direction: column; }
.pdfmodal-bar {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  padding: 12px 20px; background: var(--navy-900); color: #fff;
}
.pdf-title { font-weight: 700; font-size: 14px; letter-spacing: 0.03em; }
.pdf-actions { display: flex; gap: 8px; }
.pdfframe { flex: 1; border: none; background: #fff; }

/* ---------- severity bands (bajo/moderado/elevado/alto) ---------- */

.band-pill, .pill-badge {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 10.5px; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase;
  padding: 5px 11px; border-radius: 999px; line-height: 1.3; white-space: nowrap;
}
.band-pill-bajo, .band-pill-baja, .pill-badge-bajo { background: rgba(46,125,91,0.12); color: var(--green); }
.band-pill-moderado, .band-pill-moderada, .pill-badge-moderado { background: rgba(201,163,59,0.15); color: #8A6B1F; }
.band-pill-elevado, .band-pill-elevada, .pill-badge-elevado { background: rgba(192,106,46,0.15); color: #A3501F; }
.band-pill-alto, .band-pill-alta, .pill-badge-alto { background: rgba(178,58,48,0.12); color: var(--red); }
.pill-badge-gold { background: rgba(185,148,90,0.18); color: #8A6B33; }
.pill-badge-navy { background: rgba(27,43,71,0.1); color: var(--navy-800); }

.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; flex: none; }
.dot-bajo { background: var(--green); }
.dot-moderado { background: #C9A33B; }
.dot-elevado { background: #C06A2E; }
.dot-alto { background: var(--red); }
.dot-legend { display: flex; flex-wrap: wrap; gap: 8px 18px; margin: 12px 0 0; }
.dot-legend-item { display: inline-flex; align-items: center; gap: 7px; font-size: 11.5px; color: var(--muted); font-weight: 600; }

/* new compact dash rows (06) */
.dash-grid-compact { display: flex; flex-direction: column; gap: 0; margin: 10px 0 20px; border: 1px solid var(--line); border-radius: 9px; overflow: hidden; background: var(--card); }
.dash-row {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 13px 18px; border-bottom: 1px solid var(--line);
  border-left: 4px solid transparent;
}
.dash-row:last-child { border-bottom: none; }
.dash-row .dash-name { color: var(--ink); font-weight: 700; font-size: 13.5px; line-height: 1.4; }
.dash-row h4 { margin: 0; color: var(--ink); font-weight: 700; font-size: 13.5px; line-height: 1.4; }
.dash-st { display: inline-flex; align-items: center; gap: 7px; font-size: 10.5px; font-weight: 800; letter-spacing: 0.12em; white-space: nowrap; }
.st-bajo { border-left-color: var(--green); } .st-bajo .dash-st { color: var(--green); }
.st-moderado { border-left-color: #C9A33B; } .st-moderado .dash-st { color: #8A6B1F; }
.st-elevado { border-left-color: #C06A2E; } .st-elevado .dash-st { color: #A3501F; }
.st-alto { border-left-color: var(--red); } .st-alto .dash-st { color: var(--red); }

/* race bar (06) */
.race-wrap { margin: 4px 0 22px; }
.race-top { display: flex; justify-content: space-between; margin-bottom: 6px; font-size: 11.5px; color: var(--muted); font-weight: 700; }
.race-track { position: relative; display: flex; height: 26px; border-radius: 6px; overflow: hidden; background: #EDEFF4; }
.race-seg { display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 800; color: #fff; white-space: nowrap; overflow: hidden; }
.race-note { font-size: 11.5px; color: var(--muted); font-style: italic; margin: 8px 0 0; }

/* hbars — simple & split horizontal bars */
.hbars, .hbars-wrap { margin: 6px 0 20px; }
.hbars-top { font-size: 11px; font-weight: 800; letter-spacing: 0.1em; color: var(--navy-800); margin-bottom: 10px; }
.hbar-row { margin-bottom: 14px; }
.hbar-row:last-child { margin-bottom: 0; }
.hbar-label-row { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 5px; gap: 10px; }
.hbar-label { font-size: 13px; font-weight: 700; color: var(--ink); }
.hbar-val { font-size: 12.5px; font-weight: 800; color: var(--muted); white-space: nowrap; }
.hbar-track { position: relative; height: 14px; border-radius: 4px; background: #EDEFF4; overflow: hidden; display: flex; }
.hbar-fill { height: 100%; border-radius: 4px; }
.hbar-track.split { background: #EDEFF4; }
.hbar-split-a, .hbar-split-b { height: 100%; }
.hbars-note { font-size: 11.5px; color: var(--muted); font-style: italic; margin-top: 10px; }
.hbar-color-gold { background: var(--gold); }
.hbar-color-navy { background: var(--navy-800); }
.hbar-color-green { background: var(--green); }
.hbar-color-amber { background: var(--amber); }
.hbar-color-red { background: var(--red); }
.hbar-color-grey, .hbar-color-gray { background: #C7CCD6; }

/* topBox / cardgrid (idea composite) */
.box-label, .box-label-row { display: flex; gap: 20px; border-radius: 10px; padding: 22px 26px; margin: 22px 0; background: var(--card); border: 1px solid var(--line); border-left: 3px solid var(--gold); }
.box-label .lblcol, .box-label-row .lblcol { flex: none; min-width: 120px; font-size: 10.5px; font-weight: 800; letter-spacing: 0.18em; text-transform: uppercase; color: var(--gold); }
.box-label .bd, .box-label-row .bd { flex: 1; color: var(--text); font-size: 14.5px; line-height: 1.6; }
.box-label .bd .note { font-size: 12.5px; color: var(--muted); font-style: italic; margin-top: 8px; }
.cardgrid { display: grid; gap: 14px; margin: 14px 0 20px; }
.minicard {
  background: var(--card); border: 1px solid var(--line); border-radius: 9px;
  padding: 16px 20px; box-shadow: 0 1px 2px rgba(16,24,40,0.04); position: relative;
}
.minicard-icon { width: 26px; height: 26px; margin-bottom: 8px; color: var(--gold); }
.minicard h4 { margin: 0 0 6px; color: var(--ink); font-size: 14.5px; font-weight: 800; line-height: 1.35; }
.minicard p { margin: 0; color: var(--text); font-size: 13px; }
.minicard-badge { position: absolute; top: 14px; right: 16px; }
.minicard-num { font-size: 26px; font-weight: 800; color: var(--navy-900); line-height: 1; margin-bottom: 6px; }

/* quadrant (06/escenarios) — flex layout mirroring the PDF engine, no absolute point positions */
.quad-wrap { display: flex; align-items: center; margin: 10px 0 8px; }
.quad-ylabel { flex: none; writing-mode: vertical-rl; transform: rotate(180deg); text-align: center; font-size: 10.5px; font-weight: 800; letter-spacing: 0.18em; text-transform: uppercase; color: var(--faint); padding-right: 10px; white-space: nowrap; }
.quad-grid { flex: 1; min-width: 0; display: grid; grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr; gap: 3px; min-height: 280px; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.quad-cell { position: relative; background: #F7F8FB; padding: 14px 16px; display: flex; flex-direction: column; align-items: center; }
.quad-cell:nth-child(odd) { background: #FBFBFD; }
.quad-cap { align-self: flex-start; font-size: 10px; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; color: var(--faint); }
.quad-pt { display: flex; flex-direction: column; align-items: center; gap: 4px; margin-top: 16px; }
.quad-badge { width: 26px; height: 26px; border-radius: 50%; display: flex; align-items: center; justify-content: center; color: #fff; font-weight: 800; font-size: 12px; box-shadow: 0 1px 3px rgba(0,0,0,0.25); }
.quad-badge-gold { background: var(--gold); }
.quad-badge-navy { background: var(--navy-800); }
.quad-badge-green { background: var(--green); }
.quad-badge-amber { background: var(--amber); }
.quad-badge-red { background: var(--red); }
.quad-ptlabel { font-size: 11px; font-weight: 700; color: var(--ink); text-align: center; }
.quad-xlabel { flex: none; text-align: center; font-size: 10.5px; font-weight: 800; letter-spacing: 0.18em; text-transform: uppercase; color: var(--faint); padding-left: 10px; white-space: nowrap; }

/* probability bands */
.pb-wrap { margin: 10px 0 8px; }
.pb-label { font-size: 13px; font-weight: 700; color: var(--ink); margin-bottom: 5px; }
.pb-track { position: relative; height: 10px; border-radius: 6px; margin-top: 4.6px; margin-bottom: 20px; background: linear-gradient(90deg, var(--green), #C9A33B, #C06A2E, var(--red)); }
.pb-marker { position: absolute; top: -5px; width: 20px; height: 20px; border-radius: 50%; background: #fff; border: 3px solid var(--navy-900); transform: translateX(-50%); box-shadow: 0 1px 3px rgba(0,0,0,0.3); }
.pb-caption { position: absolute; top: 18px; transform: translateX(-50%); font-size: 11px; font-weight: 700; color: var(--ink); background: #fff; border: 1px solid var(--line); padding: 2px 8px; border-radius: 999px; white-space: nowrap; }
.pb-axis { display: flex; justify-content: space-between; font-size: 10.5px; color: var(--faint); font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; margin: 2px 0 20px; }
.pb-note { font-size: 11.5px; color: var(--muted); font-style: italic; margin: 4px 0 14px; }
.pb-card { background: var(--card); border: 1px solid var(--line); border-radius: 9px; padding: 16px 18px; display: flex; flex-direction: column; gap: 8px; }
.pb-card .num { font-size: 24px; font-weight: 800; color: var(--navy-900); line-height: 1; }
.pb-card .num .of { font-size: 13px; font-weight: 700; color: var(--faint); margin-left: 2px; }
.pb-card .t, .pb-card .title { font-size: 12.5px; color: var(--muted); }

/* scatterdot */
.scatter-wrap { margin: 8px 0 8px; }
.scatter-row { margin-bottom: 16px; display: grid; grid-template-columns: 180px 1fr; gap: 14px; align-items: center; }
.scatter-row:last-child { margin-bottom: 0; }
.scatter-label { font-size: 13px; font-weight: 700; color: var(--ink); }
.scatter-track { position: relative; height: 8px; border-radius: 4px; background: #EDEFF4; }
.scatter-dot { position: absolute; top: 50%; width: 13px; height: 13px; border-radius: 50%; transform: translate(-50%, -50%); border: 2px solid #fff; box-shadow: 0 1px 2px rgba(0,0,0,0.25); }
.scatter-axis { display: flex; justify-content: space-between; margin: 4px 0 18px 194px; font-size: 10.5px; color: var(--faint); font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; }

/* paths ("vía" cards) */
.pathcard { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 20px 24px; margin-bottom: 14px; }
.pathcard:last-child { margin-bottom: 0; }
.pathhead { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; margin-bottom: 4px; }
.pathhead h4 { margin: 0; color: var(--ink); font-size: 15.5px; font-weight: 800; }
.pathhead .pathsub { color: var(--muted); font-size: 12.5px; margin-top: 3px; }
.pathbadge { flex: none; }
.pathcols { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 26px; margin-top: 14px; }
.pc-k { font-size: 10.5px; font-weight: 800; letter-spacing: 0.16em; text-transform: uppercase; color: var(--faint); margin-bottom: 5px; }
.pathcols p { margin: 0; color: var(--text); font-size: 13.5px; }

/* radar chart (finalistas) */
.radar-wrap { display: grid; grid-template-columns: minmax(0,1fr) minmax(220px, 320px); gap: 24px; align-items: center; margin: 12px 0 20px; }
.radar-chart { display: flex; justify-content: center; }
.radar-chart svg { width: 100%; max-width: 320px; height: auto; }
.radar-side { display: flex; flex-direction: column; gap: 10px; }
.radar-legend-item { display: flex; align-items: flex-start; gap: 9px; }
.radar-legend-item .sw { flex: none; width: 11px; height: 11px; border-radius: 3px; margin-top: 3px; }
.radar-legend-item .nm { font-size: 13px; font-weight: 700; color: var(--ink); }
.radar-legend-item .ds { font-size: 12px; color: var(--muted); margin-top: 2px; }

/* ---------- responsive ---------- */

@media (max-width: 1080px) {
  .layout { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .sidebar {
    position: sticky; top: 118px; z-index: 40; max-height: none; overflow: auto;
    display: flex; gap: 6px; overflow-x: auto; padding: 10px 0;
    background: var(--paper); margin: 0 -28px; padding-left: 28px; padding-right: 28px;
    border-bottom: 1px solid var(--line);
    min-width: 0;
  }
  .side-label { display: none; }
  .side { display: flex; gap: 6px; flex: none; }
  .side-link { border: 1px solid var(--line); border-left: 1px solid var(--line); border-radius: 999px; padding: 7px 14px; white-space: nowrap; background: #fff; }
  .side-link.active { background: var(--navy-800); color: #fff; border-color: var(--navy-800); }
  .side-link.active .side-num { color: var(--gold-2); }
  .dochead, .main { grid-column: 1; }
  .dash-grid, .scen-grid, .meth-grid, .risk-grid, .hyp-grid, .stat-grid { grid-template-columns: 1fr !important; }
  .hero-docs { grid-template-columns: 1fr; }
  .classif { display: none; }
  .cardgrid { grid-template-columns: 1fr !important; }
  .pathcols { grid-template-columns: 1fr; }
  .radar-wrap { grid-template-columns: 1fr; }
  .scatter-row { grid-template-columns: 1fr; gap: 6px; }
  .scatter-axis { margin-left: 0; }
  .quad-wrap { flex-direction: column; align-items: stretch; }
  .quad-ylabel, .quad-xlabel { writing-mode: horizontal-tb; transform: none; text-align: left; padding: 0 0 6px; }
  .box-label, .box-label-row { flex-direction: column; gap: 6px; }
  .box-label .lblcol, .box-label-row .lblcol { min-width: 0; }
  .box-label .bd, .box-label-row .bd { min-width: 0; }
}
@media (max-width: 640px) {
  .doctabs { overflow-x: auto; }
  .doctab { white-space: nowrap; }
  .cal-row { grid-template-columns: 84px 1fr; gap: 12px; }
  .msg-list li { grid-template-columns: 40px 1fr; }
  .doc-meta { gap: 6px 18px; }
}

/* ---------- print ---------- */

@media print {
  #langsw, .topbar, .doctabs, .sidebar, .footer, .doc-actions, .pdfmodal, .src-tools, .chip-row { display: none !important; }
  .acc-body { grid-template-rows: 1fr !important; }
  .layout { display: block; }
  body { background: #fff; }
  .hero { display: none; }
}

/* ---------- selector de idioma ES/EN ---------- */
.lang-switch { margin-left: auto; display: flex; gap: 2px; font-size: 12px; font-weight: 700; letter-spacing: 0.12em; }
.lang-switch a, .lang-switch span { padding: 5px 9px; border-radius: 3px; text-decoration: none; color: rgba(255,255,255,0.6); }
.lang-switch a:hover, .lang-switch a:focus-visible { color: #fff; background: rgba(255,255,255,0.08); }
.lang-switch span[aria-current] { color: var(--gold); }
/* ---------- bandas de probabilidad: etiquetas sin solaparse ---------- */
.pb-track { margin-bottom: 40px; }
.pb-caption.pb-cap-l { transform: translateX(-12px); }
.pb-caption.pb-cap-r { transform: translateX(calc(-100% + 12px)); }
.pb-axis { margin-top: 0; }
