@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=Source+Serif+4:opsz,wght@8..60,600;8..60,700&family=IBM+Plex+Mono:wght@500;600&display=swap");

:root {
  /* Exact palette from the reference observatory HTML - official electoral
     report identity: cool paper ground, near-black ink, navy accent. */
  --bg: #f8fafc;
  --card: #fff;
  --ink: #131a24;
  --mut: #657388;
  --line: #e0e6ec;
  --acc: #1b3a5c;
  --acc-soft: #eef3f8;
  --on-acc: #fff; /* text on the brand colour; tenant.js picks white or ink for contrast */
  --r: 12px;
  --sh: 0 1px 2px rgba(16, 32, 56, 0.06), 0 8px 24px rgba(16, 32, 56, 0.05);

  --tier-bajo: #c7d6e8;
  --tier-moderado: #7fa8d4;
  --tier-alto: #e8a33d;
  --tier-critico: #b23a2e;

  --display: "Inter", system-ui, sans-serif;
  --body: "Inter", system-ui, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, monospace;
}
* {
  box-sizing: border-box;
}
html,
body {
  margin: 0;
  padding: 0;
  background: var(--bg);
}
body {
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  font: 15px/1.55 var(--body);
}
.wrap {
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 20px 70px;
}
header {
  background: var(--acc);
  color: var(--on-acc);
  padding: 22px 0 0;
  margin-bottom: 22px;
}
header .wrap {
  padding-bottom: 0;
}
.brand-row {
  display: flex;
  align-items: center;
  gap: 12px;
}
.brand-mark {
  flex: none;
  animation: brand-spin 22s linear infinite;
}
@keyframes brand-spin {
  to {
    transform: rotate(360deg);
  }
}
@media (prefers-reduced-motion: reduce) {
  .brand-mark {
    animation: none;
  }
}
h1 {
  font-family: var(--display);
  font-size: 22px;
  margin: 0 0 3px;
  letter-spacing: -0.01em;
  font-weight: 700;
}
.sub {
  font-size: 12.5px;
  opacity: 0.75;
  margin: 0 0 16px;
}
nav {
  display: flex;
  gap: 2px;
  overflow-x: auto;
  scrollbar-width: none;
}
nav::-webkit-scrollbar {
  display: none;
}
nav button {
  background: none;
  border: 0;
  color: var(--on-acc);
  opacity: 0.65;
  padding: 9px 15px;
  cursor: pointer;
  font: inherit;
  font-size: 13.5px;
  border-radius: 8px 8px 0 0;
  border-bottom: 3px solid transparent;
}
nav button:hover {
  opacity: 0.9;
  background: color-mix(in srgb, var(--on-acc) 8%, transparent);
}
nav button.on {
  opacity: 1;
  font-weight: 650;
  border-bottom-color: var(--on-acc);
  background: color-mix(in srgb, var(--on-acc) 13%, transparent);
}
.view {
  display: none;
}
.view.on {
  display: block;
}
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 16px 18px;
  box-shadow: var(--sh);
}
.grid {
  display: grid;
  gap: 16px;
}
.g2 {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
}
.g3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.g4 {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}
.gmap {
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
}
@media (max-width: 900px) {
  .g2,
  .g3,
  .g4,
  .gmap {
    grid-template-columns: minmax(0, 1fr);
  }
}
h2 {
  font-family: var(--display);
  font-size: 16px;
  margin: 0 0 3px;
  font-weight: 700;
  letter-spacing: -0.005em;
  color: var(--ink);
}
h3 {
  font-size: 12px;
  margin: 0 0 10px;
  font-weight: 650;
  color: var(--mut);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
p.note {
  font-size: 12px;
  color: var(--mut);
  margin: 8px 0 0;
  line-height: 1.5;
}
.chips {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.chip {
  padding: 7px 13px;
  border: 1px solid var(--line);
  background: var(--card);
  border-radius: 999px;
  cursor: pointer;
  font-size: 13px;
  color: var(--mut);
  font-family: inherit;
  transition: 0.13s;
}
.chip:hover {
  border-color: #b9c4d0;
}
.chip.on {
  color: #fff;
  font-weight: 650;
  border-color: transparent;
}
.map-canvas {
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: #eaf0f6;
  position: relative;
}
.inset-gal {
  position: absolute;
  top: 8px;
  left: 8px;
  width: 92px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 6px;
  box-shadow: var(--sh);
  padding: 5px;
}
.inset-gal-label {
  display: block;
  font-family: var(--mono);
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--mut);
  margin-bottom: 2px;
}
.inset-gal svg {
  width: 100%;
  height: auto;
  overflow: visible;
}
svg {
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
}
.pv {
  stroke: #fff;
  stroke-width: 0.9;
  cursor: pointer;
  transition: filter 0.12s ease;
}
.pv:hover {
  filter: brightness(0.92);
}
.pv.sel {
  stroke: #131a24;
  stroke-width: 2.2;
}
.lbl {
  font-size: 9px;
  fill: #131a24;
  font-family: var(--body);
  text-anchor: middle;
  pointer-events: none;
  font-weight: 600;
  paint-order: stroke;
  stroke: #fff;
  stroke-width: 2.6px;
  stroke-linejoin: round;
}
.legend {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-top: 12px;
  font-size: 11.5px;
  color: var(--mut);
}
.bar {
  height: 10px;
  flex: 1;
  border-radius: 5px;
}
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
th {
  text-align: left;
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.045em;
  color: var(--mut);
  padding: 7px 8px;
  border-bottom: 1px solid var(--line);
  font-weight: 650;
  position: sticky;
  top: 0;
  background: var(--card);
  cursor: pointer;
  white-space: nowrap;
}
td {
  padding: 6px 8px;
  border-bottom: 1px solid #f1f4f7;
}
tbody tr {
  cursor: pointer;
}
tbody tr:hover td {
  background: #eef3f8;
}
tbody tr.sel td {
  background: #e2ecf6;
}
.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.rk {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  border-radius: 5px;
  font-size: 11px;
  font-weight: 700;
  color: #fff;
  padding: 0 5px;
}
.sw {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 3px;
  margin-right: 7px;
  vertical-align: -1px;
}
.metric {
  padding: 11px 13px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--card);
}
.metric .k {
  font-size: 11.5px;
  color: var(--mut);
  line-height: 1.35;
  min-height: 31px;
}
.metric .v {
  font-family: var(--display);
  font-size: 21px;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 2px 0 1px;
}
.metric .v small {
  font-family: var(--body);
  font-size: 12px;
  font-weight: 500;
  color: var(--mut);
  margin-left: 2px;
}
.metric .c {
  font-size: 11px;
  color: var(--mut);
  display: flex;
  justify-content: space-between;
  gap: 6px;
}
.metric .cmp {
  font-weight: 650;
}
.up {
  color: var(--tier-critico);
}
.dn {
  color: #1f7a4d;
}
.eq {
  color: var(--mut);
}
.srcline {
  font-size: 10px;
  color: #94a2b4;
  margin-top: 5px;
  line-height: 1.35;
}
.pill {
  display: inline-block;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 650;
  color: #fff;
}
.big {
  font-family: var(--display);
  font-size: 44px;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1;
}
.dimrow {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 9px;
  font-size: 12.5px;
}
.dimrow .nm {
  width: 150px;
  color: var(--mut);
  flex: none;
}
.dimrow .tr {
  flex: 1;
  height: 9px;
  background: #eef1f5;
  border-radius: 5px;
  position: relative;
}
.dimrow .fl {
  height: 100%;
  border-radius: 5px;
}
.dimrow .nx {
  position: absolute;
  top: -3px;
  width: 2px;
  height: 15px;
  background: #131a24;
  opacity: 0.42;
}
.dimrow .vl {
  width: 42px;
  text-align: right;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
  flex: none;
}
select,
input[type="search"],
textarea {
  font: inherit;
  font-size: 13px;
  padding: 7px 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--card);
  color: var(--ink);
  max-width: 100%;
}
textarea {
  width: 100%;
  resize: vertical;
  font-family: var(--body);
}
.btn {
  font: inherit;
  font-size: 13px;
  font-weight: 650;
  padding: 9px 15px;
  border-radius: 9px;
  border: 1px solid var(--acc);
  background: var(--acc);
  color: var(--on-acc);
  cursor: pointer;
}
.btn:hover {
  opacity: 0.9;
}
.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
.btn.gh {
  background: var(--card);
  color: var(--acc);
}
#tip {
  position: fixed;
  pointer-events: none;
  background: #0d1622;
  color: #fff;
  padding: 9px 12px;
  border-radius: 9px;
  font-size: 12px;
  line-height: 1.45;
  opacity: 0;
  transition: opacity 0.1s;
  z-index: 99;
  max-width: 250px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}
#tip b {
  font-size: 13px;
}
#tip .r {
  color: #8fc0ea;
}
.tag {
  display: inline-block;
  font-size: 10.5px;
  padding: 2px 8px;
  border-radius: 5px;
  background: #eef2f6;
  color: var(--mut);
  margin-right: 5px;
}
.warn {
  background: #fdf3e3;
  border: 1px solid #f0dcb8;
  color: #7a5a1c;
  font-size: 12px;
  padding: 9px 12px;
  border-radius: 9px;
  margin-top: 10px;
  line-height: 1.5;
}
.meth h4 {
  font-size: 13.5px;
  margin: 18px 0 5px;
  color: var(--acc);
}
.meth p,
.meth li {
  font-size: 13.5px;
  line-height: 1.62;
  color: #26313f;
}
.meth ul {
  padding-left: 19px;
  margin: 5px 0;
}
.stack {
  display: flex;
  height: 26px;
  border-radius: 7px;
  overflow: hidden;
  font-size: 10px;
  color: #fff;
}
.stack div {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
}

/* ---------- Fuentes (Sankey + fichas de fuente) ---------- */
#v-fuentes h2 {
  font-size: 16px;
  margin: 0 0 4px;
  font-weight: 650;
  letter-spacing: -0.005em;
}
.fintro {
  font-size: 13.5px;
  color: #3a4655;
  line-height: 1.62;
  margin: 0 0 16px;
  max-width: 92ch;
}
.flow {
  overflow-x: auto;
}
#sankey {
  width: 100%;
  min-width: 760px;
  height: auto;
  display: block;
}
.nl {
  font: 600 12px var(--body);
  fill: #131a24;
}
.ns {
  font: 400 10.5px var(--body);
  fill: #657388;
}
.ch {
  font: 600 10px var(--body);
  fill: #8a8f97;
  letter-spacing: 0.09em;
}
.rb {
  transition: opacity 0.12s;
}
.rb:hover {
  opacity: 0.75 !important;
}
.fdot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 3px;
  margin-right: 7px;
  vertical-align: -1px;
}
.fdot.big {
  width: 14px;
  height: 14px;
  border-radius: 4px;
  margin-top: 3px;
  flex: none;
}
.fleg {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  align-items: center;
  margin: 12px 0 4px;
  font-size: 12.5px;
  color: #3a4655;
}
.fleg .knote {
  color: #8a8f97;
  font-size: 11.5px;
}
.fnote {
  font-size: 12.8px;
  color: #3a4655;
  line-height: 1.65;
  margin: 12px 0 0;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  max-width: 96ch;
}
.fsec {
  font-size: 16px;
  margin: 26px 0 12px;
  font-weight: 650;
  color: var(--ink);
}
.fgrid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(330px, 1fr));
  gap: 14px;
}
.fcard {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 16px 18px;
  box-shadow: var(--sh);
}
.fhead {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin-bottom: 9px;
}
.ft {
  font-size: 15px;
  font-weight: 650;
  letter-spacing: -0.01em;
}
.fo {
  font-size: 11.5px;
  color: #8a8f97;
  margin-top: 2px;
  line-height: 1.4;
}
.fmeta {
  display: inline-block;
  font-size: 11.5px;
  color: #3a4655;
  background: #eef3f8;
  border-radius: 6px;
  padding: 4px 9px;
  margin-bottom: 10px;
}
.fp {
  font-size: 13px;
  color: #3a4655;
  line-height: 1.6;
  margin: 0 0 10px;
}
.fsub {
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #8a8f97;
  font-weight: 600;
  margin: 12px 0 5px;
}
.fl {
  margin: 0;
  padding-left: 17px;
  font-size: 12.8px;
  color: #3a4655;
  line-height: 1.55;
}
.fl li {
  margin-bottom: 3px;
}
.fl2 {
  margin: 6px 0 0;
  padding-left: 18px;
  font-size: 13.2px;
  color: #3a4655;
  line-height: 1.65;
}
.fl2 li {
  margin-bottom: 9px;
}
.fwarn {
  border-color: #f0e0b8;
  background: #fdfaf1;
}
.ftab {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
}
.ftab th {
  text-align: left;
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.045em;
  color: var(--mut);
  padding: 7px 8px;
  border-bottom: 1px solid var(--line);
  font-weight: 600;
  background: var(--card);
  position: static;
}
.ftab td {
  padding: 6px 8px;
  border-bottom: 1px solid #f1f4f7;
  vertical-align: top;
  background: transparent;
}
.ftab code {
  font: 11.5px ui-monospace, Menlo, monospace;
  color: #3a4655;
}
.nod {
  color: #a8aeb6;
}

/* ---------- Asistente ---------- */
#asisResult,
#tendResult {
  margin-top: 12px;
}
.asis-loading {
  font-size: 12.5px;
  color: var(--mut);
  padding: 10px 0;
}
.asis-answer {
  font-size: 13.5px;
  line-height: 1.6;
  color: var(--ink);
  white-space: pre-wrap;
  border-left: 3px solid var(--acc);
  padding: 10px 14px;
  margin-top: 10px;
  border-radius: 0 8px 8px 0;
  background: var(--acc-soft, rgba(37,99,235,.06));
}
.asis-refused {
  border-left-color: #d32f2f;
  background: rgba(211,47,47,.07);
  color: #b71c1c;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .asis-refused {
    background: rgba(239,83,80,.12);
    color: #ef9a9a;
  }
}
:root[data-theme="dark"] .asis-refused {
  background: rgba(239,83,80,.12);
  color: #ef9a9a;
}
.tend-spinner {
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px solid var(--line);
  border-top-color: var(--acc);
  border-radius: 50%;
  animation: tend-spin .7s linear infinite;
  vertical-align: middle;
  margin-right: 6px;
}
@keyframes tend-spin { to { transform: rotate(360deg); } }
.asis-sources {
  margin-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.asis-source {
  display: block;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 10px;
  text-decoration: none;
  color: var(--ink);
  font-size: 12px;
}
.asis-source:hover {
  border-color: var(--acc);
  background: var(--acc-soft);
}
.asis-source .src-meta {
  color: var(--mut);
  font-size: 10.5px;
  margin-top: 2px;
}
.asis-chain {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.asis-chain-item {
  border-left: 2px solid var(--acc);
  padding: 4px 0 4px 12px;
}
.asis-chain-item .t {
  font-size: 10.5px;
  color: var(--mut);
  font-family: var(--mono);
}
.trend-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}
.trend-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11.5px;
  color: var(--ink);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 4px 10px;
  cursor: pointer;
}
.trend-chip:hover,
.trend-chip.open {
  border-color: var(--acc);
  background: var(--acc-soft);
}
.trend-chip.actor {
  font-weight: 700;
}
.trend-chip .count {
  font-family: var(--mono);
  font-size: 9.5px;
  color: var(--mut);
}
.trend-samples {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin: 8px 0;
  padding: 8px 0 0;
  border-top: 1px dashed var(--line);
}
.trend-samples a {
  display: block;
  font-size: 11.5px;
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 7px 9px;
  text-decoration: none;
}
.trend-samples a:hover {
  border-color: var(--acc);
}
.caveat {
  font-size: 10.5px;
  color: var(--mut);
  margin-top: 8px;
}

/* ---------- Trends map in Assistant ---------- */
/* Side-by-side, not stacked: a full-width map pushed the actual results
   (the whole point of this tab) below the fold, forcing a scroll before a
   journalist saw a single topic. Capping the map's own column keeps both
   visible together on a normal screen. */
.tend-layout {
  display: grid;
  grid-template-columns: minmax(0, 340px) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}
.tend-map-canvas {
  max-width: 340px;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: #eaf0f6;
  position: relative;
}
.tend-map-canvas svg {
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
}
.tend-panel {
  min-width: 0;
  max-height: 560px;
  overflow-y: auto;
}
@media (max-width: 760px) {
  .tend-layout {
    grid-template-columns: minmax(0, 1fr);
  }
  .tend-map-canvas {
    max-width: 320px;
    margin: 0 auto;
  }
}
.tend-inset-gal {
  position: absolute;
  top: 6px;
  left: 6px;
  width: 55px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 4px;
  box-shadow: var(--sh);
  padding: 3px;
}
.tend-inset-gal .inset-gal-label {
  font-size: 6.5px;
}
.tend-inset-gal svg {
  width: 100%;
  height: auto;
  overflow: visible;
}
.tend-pv {
  fill: #b9c8d8;
  stroke: #fff;
  stroke-width: 0.9;
  cursor: pointer;
  transition: fill 0.15s, filter 0.12s;
}
.tend-pv:hover {
  fill: #8facc4;
}
.tend-pv.sel {
  fill: var(--acc);
  stroke: #fff;
  stroke-width: 1.5;
}
.tend-prov-label {
  font-size: 13.5px;
  font-weight: 650;
  color: var(--acc);
  margin-top: 8px;
  min-height: 20px;
}

@media print {
  header,
  nav,
  .chips,
  .noprint,
  #tip {
    display: none !important;
  }
  /* Only the active tab prints - without this every view (map, huge data
     table, Sankey...) dumped into the same PDF as the province profile. */
  .view {
    display: none !important;
  }
  .view.on {
    display: block !important;
  }
  .wrap {
    max-width: none;
    padding: 0;
  }
  .tend-panel {
    max-height: none;
    overflow: visible;
  }
}

/* ======================================================================
   Usability layer + white-label chrome
   ====================================================================== */
[hidden] {
  display: none !important;
}
nav button {
  flex: none;
  white-space: nowrap;
}
.sr {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}
.skip {
  position: absolute;
  left: 12px;
  top: -48px;
  z-index: 100;
  background: var(--card);
  color: var(--acc);
  font-weight: 650;
  padding: 9px 14px;
  border-radius: 8px;
  box-shadow: var(--sh);
}
.skip:focus {
  top: 10px;
}
:focus-visible {
  outline: 2.5px solid #2a78d6;
  outline-offset: 2px;
}
header :focus-visible {
  outline-color: var(--on-acc);
}
.pv:focus-visible {
  outline: none;
  stroke: #131a24;
  stroke-width: 2.6;
}
#main:focus {
  outline: none;
}

/* brand: logo or house mark, quick finder */
.brand-row {
  flex-wrap: wrap;
}
.brand-row h1 {
  flex: 1 1 380px;
  min-width: 0;
  margin: 0;
}
.brand-logo {
  flex: none;
  height: 40px;
  width: auto;
  max-width: 170px;
  object-fit: contain;
}
.brand-logo.placa {
  background: #fff;
  padding: 5px 9px;
  border-radius: 8px;
  height: 44px;
}
.finder input {
  width: 230px;
  max-width: 100%;
  font: inherit;
  font-size: 13.5px;
  padding: 9px 13px;
  border-radius: 9px;
  border: 1px solid color-mix(in srgb, var(--on-acc) 35%, transparent);
  background: color-mix(in srgb, var(--on-acc) 12%, transparent);
  color: var(--on-acc);
}
.finder input::placeholder {
  color: var(--on-acc);
  opacity: 0.75;
}
.finder input:focus {
  background: var(--card);
  color: var(--ink);
}
.finder input:focus::placeholder {
  color: var(--mut);
}
.sub {
  margin-top: 6px;
}

/* map + profile */
.hint {
  font-size: 11.5px;
  color: var(--mut);
  margin: 10px 0 0;
}
.prov-head {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}
.prov-title {
  font-size: 26px;
  margin: 0;
  letter-spacing: -0.015em;
}
.conf {
  font-size: 12px;
  font-weight: 650;
  padding: 3px 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--mut);
}
.conf::before {
  content: "";
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 6px;
  background: currentColor;
}
.conf.hi {
  color: #1f7a4d;
}
.conf.mid {
  color: #9a6a12;
}
.conf.lo {
  color: var(--tier-critico);
}
.idx {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  gap: 6px;
  overflow-x: auto;
  scrollbar-width: none;
  padding: 8px 0;
  margin-bottom: 12px;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
}
.idx button {
  flex: none;
  font: inherit;
  font-size: 12.5px;
  padding: 5px 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--ink);
  cursor: pointer;
}
.idx button:hover {
  border-color: var(--acc);
  color: var(--acc);
}
.reportear {
  border-left: 4px solid var(--acc);
}
.cita blockquote {
  margin: 0 0 10px;
  padding: 11px 14px;
  background: var(--acc-soft);
  border-radius: 8px;
  font-size: 13.5px;
  line-height: 1.6;
  color: #26313f;
  max-width: 86ch;
  user-select: all;
}
.sino ul {
  margin: 0;
  padding-left: 18px;
  font-size: 13px;
  line-height: 1.55;
  color: #26313f;
}
.sino li {
  margin-bottom: 6px;
}
.sino .si h3 {
  color: #1f7a4d;
}
.sino .no h3 {
  color: var(--tier-critico);
}

/* feedback */
.err {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  background: #fbeeec;
  border: 1px solid #efc7c1;
  color: #8a2a20;
  font-size: 13px;
  padding: 11px 14px;
  border-radius: 9px;
  margin-bottom: 14px;
}
#toast {
  position: fixed;
  left: 50%;
  bottom: 22px;
  transform: translate(-50%, 16px);
  background: #0d1622;
  color: #fff;
  font-size: 13px;
  padding: 10px 16px;
  border-radius: 9px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s, transform 0.15s;
  z-index: 120;
  max-width: calc(100vw - 32px);
}
#toast.on {
  opacity: 1;
  transform: translate(-50%, 0);
}

/* footer: outlet line is editable, the data credit is not */
.pie {
  border-top: 1px solid var(--line);
  margin-top: 8px;
}
.pie .wrap {
  padding-top: 18px;
  padding-bottom: 36px;
  font-size: 12px;
  color: var(--mut);
}
.pie p {
  margin: 0 0 6px;
  max-width: 100ch;
}
.pie a {
  color: var(--acc);
  font-weight: 600;
}

@media (max-width: 640px) {
  .wrap {
    padding-left: 16px;
    padding-right: 16px;
  }
  .finder {
    width: 100%;
  }
  .finder input {
    width: 100%;
  }
  .prov-title {
    font-size: 22px;
  }
}
@media (prefers-reduced-motion: reduce) {
  #toast {
    transition: none;
  }
}
@media print {
  .idx,
  .finder,
  .skip,
  #toast,
  .pie .pie-brand {
    display: none !important;
  }
}

/* ======================================================================
   OVADE: data solidity, fixed profile colours, request form
   ====================================================================== */
/* solidity badge: three pips + a word, so it never relies on colour alone */
.sol {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-left: 6px;
  font-size: 11.5px;
  font-weight: 650;
  white-space: nowrap;
  vertical-align: baseline;
}
.sol .pips {
  display: inline-flex;
  gap: 2px;
}
.sol .pips i {
  width: 7px;
  height: 10px;
  border-radius: 1.5px;
  background: #cdd5df;
}
.sol.alta {
  color: #1d6a43;
}
.sol.media {
  color: #8a5d0c;
}
.sol.baja {
  color: #a3302a;
}
.sol.alta .pips i,
.sol.media .pips i:nth-child(-n + 2),
.sol.baja .pips i:first-child {
  background: currentColor;
}

/* provinces with no Latinobarómetro sample of their own */
.pv.imp {
  stroke: #131a24;
  stroke-width: 1.3;
  stroke-dasharray: 3.5 2.5;
}
.lgimp {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  color: var(--mut);
  margin: 8px 0 0;
}
.impsw {
  flex: none;
  width: 22px;
  height: 12px;
  border: 1.3px dashed #131a24;
  border-radius: 2px;
  background: #eef2f6;
}
.lgcat {
  list-style: none;
  margin: 12px 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 6px 16px;
  font-size: 12.5px;
}
.lgcat li {
  display: flex;
  align-items: center;
  gap: 4px;
}
.lgcat li span:nth-child(2) {
  flex: 1;
}
.lgcat .sw {
  flex: none;
  width: 14px;
  height: 14px;
  margin-right: 6px;
}
.pdot {
  display: inline-block;
  width: 12px;
  height: 12px;
  border-radius: 3px;
  margin-right: 8px;
  vertical-align: -1px;
}
.pshort {
  font-size: 12px;
  color: var(--mut);
}
.limit {
  font-size: 13px;
  line-height: 1.5;
  background: #fdf3e3;
  border: 1px solid #f0dcb8;
  color: #6b4d12;
  border-radius: 8px;
  padding: 8px 11px;
  margin: 0 0 14px;
}
.linkbtn {
  border: 0;
  background: none;
  padding: 2px 0;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  color: var(--acc);
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}

/* "Solicitar información" */
.btn-req {
  flex: none;
  font: inherit;
  font-size: 13.5px;
  font-weight: 650;
  padding: 9px 15px;
  border-radius: 9px;
  border: 1.5px solid var(--on-acc);
  background: var(--on-acc);
  color: var(--acc);
  cursor: pointer;
}
.btn-req:hover {
  opacity: 0.92;
}
dialog {
  border: 0;
  border-radius: 14px;
  padding: 22px 24px;
  width: min(620px, calc(100vw - 24px));
  max-height: calc(100vh - 24px);
  overflow: auto;
  color: var(--ink);
  box-shadow: 0 24px 70px rgba(10, 20, 36, 0.35);
}
dialog::backdrop {
  background: rgba(13, 22, 34, 0.55);
}
dialog h2 {
  font-size: 20px;
}
.fld {
  display: block;
  margin-bottom: 12px;
}
.fld > span {
  display: block;
  font-size: 13px;
  font-weight: 650;
  margin-bottom: 4px;
}
.fld input,
.fld select,
.fld textarea {
  width: 100%;
  font: inherit;
  font-size: 14px;
  padding: 9px 11px;
  border: 1px solid #b9c4d0;
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
}
.fld textarea {
  resize: vertical;
}
.hp {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}
.sol-err {
  color: #a3302a;
  font-size: 13px;
  font-weight: 600;
  min-height: 1em;
  margin: 0 0 8px;
}
.sol-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

/* ======================================================================
   Legibility pass: nothing small is also pale
   ====================================================================== */
p.note,
.hint,
.caveat {
  font-size: 13px;
}
.srcline {
  font-size: 11.5px;
  color: var(--mut);
}
.metric .k {
  font-size: 12.5px;
}
.metric .c {
  font-size: 12px;
}
th,
.ftab th {
  font-size: 11.5px;
  color: #4a5668;
}
.legend {
  font-size: 12.5px;
}
.tag {
  font-size: 11.5px;
  color: #4a5668;
}
.fo,
.fsub,
.fleg .knote {
  color: #5f6b7d;
}
.fo {
  font-size: 12px;
}
.ch {
  fill: #5f6b7d;
}
.ns {
  fill: #4a5668;
}
.nod {
  color: #6b7686;
}
.dimrow {
  font-size: 13px;
}
.dimrow .nm {
  color: #4a5668;
}
#tip {
  font-size: 13px;
}
#tip .r {
  color: #a9d2f5;
}
.inset-gal-label {
  font-size: 9px;
  color: #4a5668;
}
.lbl {
  font-size: 10px;
}
.rk {
  min-width: 22px;
  height: 22px;
  font-size: 11.5px;
}
.pill {
  font-size: 12px;
  padding: 3px 10px;
}
.big {
  color: var(--ink);
}

@media (pointer: coarse), (max-width: 640px) {
  .btn,
  .btn-req,
  .chip,
  nav button,
  .idx button,
  .finder input,
  select,
  input[type="search"],
  .fld input,
  .fld select {
    min-height: 44px;
  }
  .chip {
    padding: 9px 14px;
  }
  .linkbtn {
    min-height: 44px;
  }
  .brand-row .btn-req {
    flex: 1 1 100%;
  }
  .ranking-scroll,
  .card[style*="max-height"] {
    max-height: 60vh !important;
  }
}
@media print {
  .btn-req,
  dialog,
  .linkbtn {
    display: none !important;
  }
}

/* header row: title takes what it needs, finder + request button share the rest */
.brand-row {
  row-gap: 10px;
}
.brand-row .finder {
  flex: 1 1 210px;
  max-width: 300px;
}
.brand-row .finder input {
  width: 100%;
}
@media (max-width: 760px) {
  .brand-row h1 {
    flex-basis: calc(100% - 60px);
    font-size: 19px;
  }
  .brand-row .finder {
    max-width: none;
  }
}

/* ======================================================================
   Journalist flow: start by task, quick summary on the map, essentials first
   ====================================================================== */
.start {
  margin-bottom: 16px;
  padding: 14px 16px 16px;
  background: var(--card);
  border: 1px solid var(--line);
  border-left: 4px solid var(--acc);
  border-radius: var(--r);
}
.start-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 10px;
}
.start h2 {
  font-size: 17px;
  margin: 0;
}
.start-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}
.start-row button {
  text-align: left;
  font: inherit;
  padding: 11px 13px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--bg);
  color: var(--ink);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.start-row button:hover {
  border-color: var(--acc);
  background: var(--acc-soft);
}
.start-row b {
  font-size: 14px;
  color: var(--acc);
}
.start-row span {
  font-size: 12.5px;
  color: var(--mut);
  line-height: 1.4;
}
@media (max-width: 760px) {
  .start-row {
    grid-template-columns: minmax(0, 1fr);
  }
}

.side {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
}
.peek {
  border-left: 4px solid var(--acc);
}
.peek-top,
.ess-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 14px;
  flex-wrap: wrap;
}
.peek h2,
.essential h2 {
  font-size: 20px;
  margin: 0;
}
.peek-sub {
  font-size: 12.5px;
  color: var(--mut);
  margin: 3px 0 0;
}
.peek-num,
.ess-num {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
}
.peek-num .big {
  font-size: 34px;
}
.ess-num .big {
  font-size: 44px;
}
.ess-num small {
  font-size: 12px;
  color: var(--mut);
}
.ess-lead {
  margin: 6px 0 16px;
  font-size: 14.5px;
  line-height: 1.5;
  max-width: 58ch;
}
.drivers {
  margin: 0;
  padding-left: 18px;
  font-size: 13.5px;
  line-height: 1.5;
}
.drivers li {
  margin-bottom: 6px;
}
.peek-actions,
.ess-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
  margin-top: 14px;
}
.ess-actions select {
  padding: 9px 12px;
}
.essential {
  border-left: 4px solid var(--acc);
}
.back {
  margin-bottom: 6px;
}

/* collapsible evidence */
details.sec {
  margin-bottom: 12px;
  padding: 0;
}
details.sec summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 4px 14px;
  padding: 15px 44px 15px 18px;
  position: relative;
  border-radius: var(--r);
}
details.sec summary::-webkit-details-marker {
  display: none;
}
details.sec summary::after {
  content: "";
  position: absolute;
  right: 20px;
  top: 50%;
  width: 8px;
  height: 8px;
  margin-top: -7px;
  border-right: 2px solid var(--mut);
  border-bottom: 2px solid var(--mut);
  transform: rotate(45deg);
  transition: transform 0.15s;
}
details.sec[open] summary::after {
  transform: rotate(-135deg);
  margin-top: -3px;
}
details.sec summary:hover {
  background: var(--acc-soft);
}
details.sec summary h2 {
  margin: 0;
}
details.sec .sub-s {
  font-size: 12.5px;
  color: var(--mut);
}
details.sec .sec-body {
  padding: 4px 18px 18px;
}
.idx-toggle {
  margin-left: auto;
  border-style: dashed !important;
}
@media (prefers-reduced-motion: reduce) {
  details.sec summary::after {
    transition: none;
  }
}
@media print {
  .start,
  .idx-toggle,
  .back {
    display: none !important;
  }
}
th[data-k] {
  white-space: normal;
  min-width: 84px;
  vertical-align: bottom;
  line-height: 1.25;
}

.peek-top,
.ess-top {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
}
.ess-top .ess-lead {
  margin-bottom: 12px;
}
.ess-top + .grid {
  margin-top: 4px;
}
@media (max-width: 560px) {
  .peek-top,
  .ess-top {
    grid-template-columns: minmax(0, 1fr);
  }
  .peek-num,
  .ess-num {
    order: -1;
    flex-direction: row;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 10px;
  }
}

/* ======================================================================
   Plain-language factors: each one says what it is, where the province stands
   ====================================================================== */
.frows {
  display: grid;
  gap: 16px;
}
.frow {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(120px, 1fr) 96px;
  gap: 8px 18px;
  align-items: center;
}
.frow .fq b {
  display: block;
  font-size: 14.5px;
}
.frow .fq span {
  display: block;
  font-size: 12.5px;
  color: var(--mut);
  line-height: 1.4;
  margin-top: 2px;
  max-width: 52ch;
}
.frow .tr {
  height: 11px;
  background: #e9edf2;
  border-radius: 6px;
  position: relative;
}
.frow .fl {
  height: 100%;
  border-radius: 6px;
}
.frow .nx {
  position: absolute;
  top: -4px;
  width: 2px;
  height: 19px;
  background: #131a24;
  opacity: 0.5;
}
.frow .fv {
  text-align: right;
}
.frow .fv b {
  display: block;
  font-family: var(--display);
  font-size: 22px;
  letter-spacing: -0.02em;
  line-height: 1.1;
}
.frow .fv small {
  font-size: 12px;
  color: var(--mut);
}
@media (max-width: 640px) {
  .frow {
    grid-template-columns: minmax(0, 1fr) auto;
  }
  .frow .tr {
    grid-column: 1 / -1;
    order: 3;
  }
}
.drv-que {
  display: block;
  font-size: 12.5px;
  color: var(--mut);
  margin-top: 2px;
}
.ess-tipo {
  margin: 0 0 16px;
  font-size: 13.5px;
  line-height: 1.55;
  max-width: 64ch;
  color: #26313f;
}
.chip-sep {
  align-self: stretch;
  width: 1px;
  margin: 3px 6px;
  background: var(--line);
}
details.howto {
  margin-top: 12px;
  font-size: 13px;
}
details.howto summary {
  cursor: pointer;
  font-weight: 650;
  color: var(--acc);
  padding: 6px 0;
}
details.howto ul {
  margin: 4px 0 0;
  padding-left: 18px;
  line-height: 1.55;
  color: #26313f;
}
.glos {
  display: grid;
  grid-template-columns: minmax(180px, 260px) 1fr;
  gap: 10px 20px;
  margin: 0;
  font-size: 13.5px;
  line-height: 1.55;
}
.glos dt {
  font-weight: 650;
}
.glos dt span {
  font-weight: 400;
  color: var(--mut);
  font-size: 12.5px;
}
.glos dd {
  margin: 0;
  color: #26313f;
}
@media (max-width: 640px) {
  .glos {
    grid-template-columns: minmax(0, 1fr);
    gap: 2px;
  }
  .glos dd {
    margin-bottom: 10px;
  }
}

/* ======================================================================
   Redesign: compact header, tasks first, note kit, filter bar
   ====================================================================== */
body {
  font-size: 14.5px;
}
h2 {
  letter-spacing: -0.015em;
}

/* ---- compact header: one row + tabs, cut-off notice as a thin strip ---- */
header {
  padding: 8px 0 0;
  margin-bottom: 0;
}
.brand-row {
  gap: 10px;
  row-gap: 8px;
  flex-wrap: wrap;
}
.brand-row .brand-mark {
  width: 28px;
  height: 28px;
}
.brand-row h1 {
  flex: 1 1 260px;
  font-size: 15.5px;
  line-height: 1.25;
  font-weight: 650;
  letter-spacing: -0.01em;
}
.finder-btn {
  flex: 1 1 280px;
  max-width: 420px;
  display: flex;
  align-items: center;
  gap: 9px;
  font: inherit;
  font-size: 13.5px;
  text-align: left;
  padding: 8px 12px;
  border-radius: 9px;
  border: 1px solid color-mix(in srgb, var(--on-acc) 40%, transparent);
  background: color-mix(in srgb, var(--on-acc) 14%, transparent);
  color: var(--on-acc);
  cursor: pointer;
}
.finder-btn:hover {
  background: color-mix(in srgb, var(--on-acc) 22%, transparent);
}
.finder-btn .fb-t {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 600;
}
.finder-btn em {
  font-style: normal;
  font-weight: 400;
  opacity: 0.75;
  margin-left: 4px;
}
.finder-btn kbd {
  flex: none;
  font: 600 11px var(--mono);
  padding: 1px 6px;
  border-radius: 5px;
  border: 1px solid color-mix(in srgb, var(--on-acc) 45%, transparent);
  background: none;
  color: inherit;
}
.fb-ic,
.rq-ic,
.pal-ic {
  flex: none;
  width: 15px;
  height: 15px;
  background: currentColor;
  -webkit-mask: var(--ic) center / contain no-repeat;
  mask: var(--ic) center / contain no-repeat;
}
.fb-ic,
.pal-ic {
  --ic: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Ccircle cx='7' cy='7' r='4.6' fill='none' stroke='black' stroke-width='1.8'/%3E%3Cpath d='M10.6 10.6 14 14' stroke='black' stroke-width='1.9' stroke-linecap='round'/%3E%3C/svg%3E");
}
.rq-ic {
  --ic: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Crect x='1.6' y='3' width='12.8' height='10' rx='1.6' fill='none' stroke='black' stroke-width='1.6'/%3E%3Cpath d='M2 4.4 8 9l6-4.6' fill='none' stroke='black' stroke-width='1.6' stroke-linejoin='round'/%3E%3C/svg%3E");
}
.btn-req {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 13px;
}
nav {
  margin-top: 6px;
}
nav button {
  padding: 8px 13px;
  font-size: 13.5px;
}
#btnMas::after {
  content: "";
  display: inline-block;
  width: 6px;
  height: 6px;
  margin: 0 0 3px 7px;
  border-right: 1.8px solid currentColor;
  border-bottom: 1.8px solid currentColor;
  transform: rotate(45deg);
}
.more-menu {
  position: fixed;
  z-index: 60;
  min-width: 210px;
  padding: 6px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: 0 14px 40px rgba(10, 20, 36, 0.22);
  display: flex;
  flex-direction: column;
}
.more-menu[hidden] {
  display: none;
}
.more-menu button {
  color: var(--ink);
  opacity: 1;
  text-align: left;
  border-radius: 7px;
  border-bottom: 0;
  background: none;
}
.more-menu button:hover,
.more-menu button.on {
  background: var(--acc-soft);
  color: var(--acc);
}
.cut {
  margin: 0 0 18px;
  padding: 6px 0;
  font-size: 12px;
  color: var(--mut);
  background: #eef2f7;
  border-bottom: 1px solid var(--line);
}
.cut .wrap {
  display: block;
  padding-bottom: 0;
}

/* ---- tasks first ---- */
.modulos {
  margin-bottom: 16px;
}
.modulos > h2 {
  font-size: 19px;
  margin: 0 0 10px;
}
.mod-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}
.mod-h {
  text-align: left;
  font: inherit;
  padding: 12px 14px;
  border: 1.5px solid var(--line);
  border-radius: 10px;
  background: var(--card);
  color: var(--ink);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 3px;
  position: relative;
}
.mod-h b {
  font-size: 14.5px;
  color: var(--acc);
  padding-right: 18px;
}
.mod-h span {
  font-size: 12.5px;
  color: var(--mut);
  line-height: 1.4;
}
.mod-h::after {
  content: "";
  position: absolute;
  right: 14px;
  top: 16px;
  width: 7px;
  height: 7px;
  border-right: 2px solid var(--mut);
  border-bottom: 2px solid var(--mut);
  transform: rotate(45deg);
  transition: transform 0.15s;
}
.mod-h[aria-expanded="true"] {
  border-color: var(--acc);
  background: var(--acc-soft);
}
.mod-h[aria-expanded="true"]::after {
  transform: rotate(-135deg);
  top: 20px;
}
.mod-h:hover {
  border-color: var(--acc);
}
.modulos.compact .mod-h {
  padding: 8px 12px;
}
.modulos.compact .mod-h span {
  display: none;
}
.modulos.compact > h2 {
  display: none;
}
.mod-panel {
  margin-top: 10px;
  padding: 14px 16px 16px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 10px;
}
.mod-panel[hidden] {
  display: none;
}
.mod-input {
  width: 100%;
  font: inherit;
  font-size: 15px;
  padding: 11px 14px;
  border: 1.5px solid #b9c4d0;
  border-radius: 9px;
  margin-bottom: 12px;
  background: #fff;
}
.mod-input:focus {
  border-color: var(--acc);
  outline: none;
  box-shadow: 0 0 0 3px var(--acc-soft);
}
.prov-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(168px, 1fr));
  gap: 7px;
}
.prov-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  font: inherit;
  font-size: 13.5px;
  text-align: left;
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--bg);
  cursor: pointer;
  color: var(--ink);
}
.prov-btn[hidden] {
  display: none;
}
.prov-btn:hover,
.prov-btn.on {
  border-color: var(--acc);
  background: var(--acc-soft);
}
.dot {
  flex: none;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 1.5px solid rgba(19, 26, 36, 0.35);
}
kbd {
  font: 600 11px var(--mono);
  padding: 1px 6px;
  border: 1px solid #b9c4d0;
  border-radius: 5px;
  background: #fff;
}
.cmp-pick {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.cmp-pick select {
  min-width: 190px;
}
table.delta {
  width: 100%;
  margin-bottom: 6px;
}
table.delta th {
  cursor: default;
  position: static;
  white-space: normal;
}
table.delta td {
  font-size: 13.5px;
}
table.delta td.up {
  color: #a3302a;
  font-weight: 700;
}
table.delta td.dn {
  color: #1d6a43;
  font-weight: 700;
}
.crit {
  display: grid;
  grid-template-columns: minmax(220px, 300px) 1fr;
  gap: 16px;
}
.crit-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.crit-b {
  font: inherit;
  font-size: 13.5px;
  text-align: left;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--bg);
  cursor: pointer;
}
.crit-b:hover,
.crit-b.on {
  border-color: var(--acc);
  background: var(--acc-soft);
}
.verdict {
  padding: 12px 14px;
  border-radius: 9px;
  border: 1.5px solid;
}
.verdict h3 {
  display: flex;
  gap: 7px;
  align-items: center;
  margin: 0 0 6px;
  text-transform: none;
  letter-spacing: 0;
  font-size: 14px;
}
.verdict p {
  margin: 0 0 6px;
  font-size: 13.5px;
  line-height: 1.5;
}
.verdict.ok {
  border-color: #6aa583;
  background: #f1f8f4;
  color: #173f2a;
}
.verdict.ko {
  border-color: #c98a84;
  background: #fbf2f1;
  color: #5e1d17;
}
.verdict .lim {
  color: #26313f;
}
@media (max-width: 760px) {
  .mod-row {
    grid-template-columns: minmax(0, 1fr);
  }
  .modulos.compact .mod-row {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .modulos.compact .mod-h b {
    font-size: 12.5px;
    padding-right: 12px;
  }
  .modulos.compact .mod-h::after {
    display: none;
  }
  .crit {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* ---- what you can say / what you cannot ---- */
.decide {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.decide > div {
  padding: 13px 15px;
  border-radius: 10px;
  border: 1.5px solid;
}
.decide h3 {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 14px;
  margin: 0 0 8px;
  text-transform: none;
  letter-spacing: 0;
}
.decide ul {
  margin: 0;
  padding-left: 18px;
  font-size: 13.5px;
  line-height: 1.5;
}
.decide li {
  margin-bottom: 6px;
}
.d-si {
  border-color: #6aa583;
  background: #f1f8f4;
  color: #173f2a;
}
.d-si h3 {
  color: #1d6a43;
}
.d-no {
  border-color: #c98a84;
  background: #fbf2f1;
  color: #5e1d17;
}
.d-no h3 {
  color: #a3302a;
}
.ic {
  flex: none;
  vertical-align: -2px;
}
@media (max-width: 760px) {
  .decide {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* ---- province tags and score range ---- */
.ptag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  font-weight: 600;
  line-height: 1.3;
  padding: 3px 10px;
  border-radius: 7px;
  border: 1px solid;
}
.ptag.warn {
  color: #7a4a05;
  background: #fff6e5;
  border-color: #ecc98a;
}
.ptag.pin {
  color: #3d3a7a;
  background: #f1f0fb;
  border-color: #c6c3ee;
}
.ptags {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin: 0 0 10px;
}
.ptags:empty {
  display: none;
}
#rk .ptag {
  font-size: 11px;
  padding: 1px 7px;
  margin-top: 3px;
}
.rango {
  font-size: 12px;
  font-weight: 600;
  color: #4a5668;
  background: #eef2f7;
  border-radius: 6px;
  padding: 2px 8px;
  white-space: nowrap;
}

/* ---- the note kit ---- */
.kit-head {
  display: flex;
  align-items: center;
  gap: 8px 12px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}
.kit-head .prov-title {
  margin-right: 6px;
}
.kit-main {
  border-left: 4px solid var(--acc);
}
.km-top {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 8px 24px;
  align-items: start;
  margin-bottom: 14px;
}
.km-num {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
}
.km-num .big {
  font-size: 54px;
  letter-spacing: -0.04em;
}
.km-txt .ess-lead {
  margin: 4px 0 10px;
  font-size: 16px;
  max-width: 58ch;
}
.cita {
  padding-top: 12px;
  border-top: 1px solid var(--line);
}
.cita blockquote {
  font-size: 14px;
}
.cita-act {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}
.cita-act .btn {
  padding: 11px 20px;
  font-size: 14px;
}
.ess-titular {
  margin: 0 0 12px;
  font-size: 19px;
  line-height: 1.3;
  letter-spacing: -0.01em;
  max-width: 60ch;
  text-transform: none;
  color: var(--ink, inherit);
  font-weight: 700;
}
.precaucion {
  margin: 0 0 14px;
  padding: 10px 14px;
  background: #fff6e5;
  border: 1px solid #ecc98a;
  border-left: 5px solid #d98a00;
  border-radius: 8px;
  color: #5c3a00;
}
.precaucion .pc-h {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  font-weight: 750;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.precaucion p {
  margin: 4px 0 0;
  font-size: 14px;
  line-height: 1.45;
}
.km-conf {
  margin: 12px 0 0;
  font-size: 13px;
  color: var(--mut);
}
.angulos {
  list-style: none;
  margin: 0;
  padding: 0;
}
.angulos li {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 14px;
  padding: 11px 0;
  border-top: 1px solid var(--line);
  font-size: 14px;
  line-height: 1.5;
}
.angulos li:first-child {
  border-top: 0;
}
.angulos .src {
  display: block;
  font-size: 12px;
  color: var(--mut);
}
.copybtn {
  flex: none;
  font: inherit;
  font-size: 12.5px;
  font-weight: 650;
  color: var(--acc);
  background: var(--card);
  border: 1px solid var(--acc);
  border-radius: 7px;
  padding: 5px 11px;
  cursor: pointer;
}
.copybtn:hover {
  background: var(--acc-soft);
}
.rec {
  margin-bottom: 12px;
}
.rec b {
  font-size: 13.5px;
}
.rec p {
  margin: 3px 0 0;
  font-size: 13.5px;
  color: #39465a;
  max-width: 82ch;
}
.kit-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
  margin-top: 16px;
}
.kit-actions select {
  padding: 9px 12px;
}
@media (max-width: 640px) {
  .km-top {
    grid-template-columns: minmax(0, 1fr);
  }
  .km-num {
    flex-direction: row;
    align-items: baseline;
    flex-wrap: wrap;
  }
  .km-num .big {
    font-size: 46px;
  }
  .angulos li {
    flex-direction: column;
  }
}

/* ---- map: structured filter bar and tools ---- */
.filterbar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}
.fchip {
  display: inline-flex;
  align-items: stretch;
  border: 1.5px solid var(--line);
  border-radius: 9px;
  background: var(--card);
  overflow: hidden;
}
.fchip.on {
  border-color: var(--acc);
}
.fbtn {
  font: inherit;
  font-size: 13.5px;
  font-weight: 600;
  padding: 7px 12px;
  border: 0;
  background: none;
  color: var(--ink);
  cursor: pointer;
  display: inline-flex;
  align-items: baseline;
  gap: 7px;
}
.fchip.on .fbtn {
  background: var(--acc);
  color: var(--on-acc);
}
.fcode {
  font: 600 10.5px var(--mono);
  opacity: 0.7;
}
.fhelp {
  font: 700 12px var(--body);
  width: 28px;
  border: 0;
  border-left: 1px solid var(--line);
  background: var(--bg);
  color: var(--acc);
  cursor: pointer;
}
.fhelp:hover {
  background: var(--acc-soft);
}
.fmore {
  margin-left: 2px;
}
.maptools {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.maptools .btn {
  padding: 7px 12px;
  font-size: 12.5px;
}
.seis {
  margin: 0;
  padding-left: 22px;
}
.seis li {
  margin-bottom: 12px;
}
.seis p {
  margin: 3px 0 0;
  font-size: 13.5px;
  line-height: 1.55;
  color: #26313f;
}
.fh-top {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: baseline;
}

/* ---- command palette ---- */
dialog.palette {
  padding: 0;
  width: min(620px, calc(100vw - 20px));
  margin-top: 8vh;
  overflow: hidden;
}
.pal-top {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  color: var(--mut);
}
.pal-top input {
  flex: 1;
  min-width: 0;
  font: inherit;
  font-size: 16px;
  border: 0;
  outline: none;
  color: var(--ink);
  background: none;
}
#palList {
  list-style: none;
  margin: 0;
  padding: 6px;
  max-height: min(52vh, 420px);
  overflow-y: auto;
}
#palList li {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px 10px;
  padding: 9px 11px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
}
#palList li.on {
  background: var(--acc-soft);
}
#palList .pal-meta {
  color: var(--mut);
  font-size: 12.5px;
  margin-left: auto;
}
#palList .ptag {
  font-size: 11px;
  padding: 1px 7px;
}
#palList .pal-empty {
  cursor: default;
  color: var(--mut);
}
.pal-hint {
  margin: 0;
  padding: 8px 16px;
  font-size: 12px;
  color: var(--mut);
  border-top: 1px solid var(--line);
  background: var(--bg);
}

/* ---- phone: the header collapses, dialogs use the full width ---- */
@media (max-width: 640px) {
  .brand-row h1 {
    flex-basis: calc(100% - 44px);
    font-size: 14px;
  }
  .finder-btn {
    flex: 1 1 0;
    max-width: none;
  }
  .finder-btn em,
  .finder-btn kbd {
    display: none;
  }
  .btn-req {
    flex: none !important;
    padding: 9px 11px;
  }
  .btn-req .rq-t {
    display: none;
  }
  .cut {
    font-size: 11px;
  }
  dialog.palette {
    margin-top: 4vh;
  }
}
@media print {
  .modulos,
  .cut,
  .maptools,
  .filterbar,
  .kit-actions {
    display: none !important;
  }
}

html,
body {
  overflow-x: clip;
}

svg.ic {
  display: inline-block;
  width: 14px;
  height: 14px;
  flex: none;
  vertical-align: -2px;
}

/* ---- less text: short lines on screen, detail folded ---- */
.pais {
  font-size: 12.5px;
  font-weight: 400;
  color: var(--mut);
  margin-left: 6px;
}
.copiar {
  padding-top: 12px;
  border-top: 1px solid var(--line);
}
.frase {
  margin: 0 0 10px;
  padding: 11px 14px;
  background: var(--acc-soft);
  border-radius: 8px;
  font-size: 15px;
  line-height: 1.45;
  user-select: all;
}
details.ver {
  margin-top: 10px;
  font-size: 13.5px;
}
details.ver > summary {
  cursor: pointer;
  color: var(--acc);
  font-weight: 650;
  padding: 6px 0;
}
details.ver[open] > summary {
  margin-bottom: 6px;
}
details.ver blockquote {
  margin: 0;
}
.km-top {
  margin-bottom: 12px;
}
.ess-lead {
  font-size: 17px;
  margin: 4px 0 6px;
}
.ess-tipo {
  margin: 0 0 8px;
  font-size: 14px;
}
.angulos li {
  align-items: center;
  padding: 9px 0;
}
.angulos li b {
  margin-right: 4px;
}
.mod-h span {
  font-size: 12.5px;
}

/* ---- faster to scan, faster to copy ---- */
.btn.done,
.copybtn.done {
  background: #1d6a43;
  border-color: #1d6a43;
  color: #fff;
}
.sec-h {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-bottom: 4px;
}
.sec-h h2 {
  margin: 0;
}
.recent {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.recent > span {
  font-size: 12.5px;
  font-weight: 650;
  color: var(--mut);
  margin-right: 2px;
}
.recent .prov-btn {
  background: var(--acc-soft);
}
.grid-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}
.grid-head .pais {
  margin: 0;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.seg {
  display: inline-flex;
  border: 1.5px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}
.seg button {
  font: inherit;
  font-size: 12.5px;
  font-weight: 600;
  padding: 5px 11px;
  border: 0;
  background: var(--card);
  color: var(--ink);
  cursor: pointer;
}
.seg button[aria-pressed="true"] {
  background: var(--acc);
  color: var(--on-acc);
}
.cmp-verdict h2 {
  font-size: 21px;
  line-height: 1.3;
  max-width: 34ch;
}
.cmp-frase {
  margin: 0 0 10px;
  font-size: 15.5px;
  font-weight: 650;
}
.jump {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.jump button {
  font: inherit;
  font-size: 12.5px;
  padding: 5px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--card);
  color: var(--ink);
  cursor: pointer;
}
.jump button:hover {
  border-color: var(--acc);
  color: var(--acc);
}

/* ======================================================================
   Nothing folded away: two fixed columns, map to choose, visible scale
   ====================================================================== */
.notes-layout {
  display: grid;
  grid-template-columns: 330px minmax(0, 1fr);
  gap: 20px;
  align-items: start;
}
.prov-aside {
  position: sticky;
  top: 10px;
  max-height: calc(100vh - 20px);
  overflow-y: auto;
  padding: 14px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r);
  scrollbar-width: thin;
}
.aside-h {
  display: block;
  margin: 0 0 6px;
  font-size: 13px;
  font-weight: 650;
  color: var(--ink);
}
.sel-map {
  background: #eef3f9;
}
.sel-map svg {
  max-height: 340px;
}
.inset-sel {
  width: 64px;
  top: 6px;
  left: 6px;
  padding: 3px;
}
.inset-sel .inset-gal-label {
  font-size: 7px;
}
.pvs {
  stroke: #fff;
  stroke-width: 0.9;
  cursor: pointer;
  transition: fill 0.3s ease, filter 0.12s ease;
}
.pvs:hover {
  filter: brightness(0.88);
}
.pvs.sel {
  stroke: #131a24;
  stroke-width: 2.6;
}
.pvs:focus-visible {
  outline: none;
  stroke: #131a24;
  stroke-width: 2.6;
}
.prov-aside .mod-input {
  margin-bottom: 10px;
  padding: 9px 12px;
  font-size: 14px;
}
.recent {
  display: block;
  margin: 0;
}
.recent:empty {
  display: none;
}
.pl-h {
  display: block;
  font-size: 12px;
  font-weight: 650;
  color: var(--mut);
  margin: 8px 2px 4px;
}
.prov-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4px;
}
.recent .pl-item {
  margin-bottom: 4px;
}
.pl-item {
  display: flex;
  align-items: center;
  gap: 7px;
  width: 100%;
  font: inherit;
  font-size: 13px;
  text-align: left;
  padding: 7px 9px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: var(--bg);
  color: var(--ink);
  cursor: pointer;
  min-width: 0;
}
.pl-item:hover {
  border-color: var(--acc);
  background: var(--acc-soft);
}
.pl-item.on {
  background: var(--acc);
  color: var(--on-acc);
}
.pl-item.on .dot {
  border-color: var(--on-acc);
}
.pl-n {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.pl-r {
  flex: none;
  font: 600 11px var(--mono);
  opacity: 0.7;
}
.pl-ic {
  flex: none;
  display: inline-flex;
}
.pl-ic.is-warn {
  color: #9a5b00;
}
.pl-ic.is-pin {
  color: #4b47a0;
}
.pl-item.on .pl-ic {
  color: inherit;
}
.pl-home {
  margin-top: 10px;
  background: none;
  border: 1px dashed var(--line);
  color: var(--acc);
  font-weight: 600;
}
.inicio-lead {
  margin: 6px 0 0;
  font-size: 15.5px;
  line-height: 1.55;
  max-width: 62ch;
}
.inicio-main h2 {
  font-size: 24px;
}
@media (max-width: 980px) {
  .notes-layout {
    grid-template-columns: minmax(0, 1fr);
  }
  .prov-aside {
    position: static;
    max-height: none;
  }
  .sel-map svg {
    max-height: 360px;
    margin: 0 auto;
  }
  .prov-list {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
@media (max-width: 520px) {
  .prov-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* ---- the note: two columns, every block open ---- */
.kit-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}
@media (max-width: 1180px) {
  .kit-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}
.sec-open {
  margin-bottom: 16px;
}
.sec-open .sec-h {
  margin-bottom: 10px;
}
.sec-h {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 4px 14px;
  flex-wrap: wrap;
}
.sec-h h2 {
  margin: 0;
}
.todo-h {
  font-size: 19px;
  margin: 24px 0 12px;
}
#sec-decidir .decide {
  grid-template-columns: minmax(0, 1fr);
}
.kit-main blockquote {
  margin: 10px 0 0;
  padding: 11px 14px;
  background: var(--acc-soft);
  border-radius: 8px;
  font-size: 13.5px;
  line-height: 1.6;
  color: #26313f;
}
.copiar .cita-act {
  margin-bottom: 0;
}

/* ---- scale: where the province sits among the 24 ---- */
.escala {
  margin: 4px 0 16px;
}
.esc-bar {
  position: relative;
  height: 14px;
  border-radius: 7px;
}
.esc-mark,
.esc-pais {
  position: absolute;
  top: -5px;
  width: 4px;
  height: 24px;
  border-radius: 2px;
  transform: translateX(-50%);
}
.esc-mark {
  background: #131a24;
  box-shadow: 0 0 0 2px #fff;
}
.esc-pais {
  background: transparent;
  border-left: 2px dashed #131a24;
  width: 0;
  opacity: 0.7;
}
.esc-lab {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-top: 6px;
  font-size: 12px;
  color: var(--mut);
}
.esc-key {
  margin: 6px 0 0;
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.esc-key .mk {
  width: 4px;
  height: 14px;
  background: #131a24;
  border-radius: 2px;
}
.esc-key .mk.pais {
  width: 0;
  background: none;
  border-left: 2px dashed #131a24;
  margin-left: 10px;
}

/* ---- navigation in two levels, all visible ---- */
.nav-sep {
  flex: none;
  width: 1px;
  margin: 9px 8px 6px;
  background: color-mix(in srgb, var(--on-acc) 35%, transparent);
}
nav button.t2 {
  font-size: 12.5px;
  opacity: 0.6;
}
nav button.t2:hover,
nav button.t2.on {
  opacity: 1;
}
.howto {
  margin-top: 12px;
  font-size: 13px;
}
.howto-h {
  margin: 0 0 4px;
  font-size: 13px;
  text-transform: none;
  letter-spacing: 0;
  color: var(--ink);
}
.howto ul {
  margin: 4px 0 0;
  padding-left: 18px;
  line-height: 1.55;
  color: #26313f;
}

/* ---- movement that tells you something changed ---- */
#progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  width: 0;
  background: var(--on-acc);
  box-shadow: 0 0 6px color-mix(in srgb, var(--on-acc) 60%, transparent);
  opacity: 0;
  z-index: 300;
  pointer-events: none;
}
#progress.on {
  opacity: 1;
  width: 78%;
  transition: width 1.6s cubic-bezier(0.1, 0.7, 0.2, 1);
}
#progress.on.done {
  width: 100%;
  transition: width 0.2s ease-out, opacity 0.35s 0.2s;
  opacity: 0;
}
@keyframes viewIn {
  from {
    opacity: 0.55;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
@keyframes fadeIn {
  from {
    opacity: 0.4;
  }
  to {
    opacity: 1;
  }
}
.view.on {
  animation: viewIn 0.22s ease-out;
}
#perfil > * {
  animation: fadeIn 0.25s ease-out both;
}
.pv {
  transition: fill 0.3s ease, filter 0.12s ease;
}
.pl-item,
.prov-btn,
.fbtn,
.copybtn,
.btn {
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
@keyframes shimmer {
  0% {
    background-position: 100% 0;
  }
  100% {
    background-position: 0 0;
  }
}
.sk {
  min-height: 150px;
}
.sk-b {
  height: 14px;
  margin: 10px 0;
  border-radius: 6px;
  background: linear-gradient(90deg, #e6ecf3 25%, #f3f6fa 37%, #e6ecf3 63%);
  background-size: 400% 100%;
  animation: shimmer 1.3s ease infinite;
}
@media (prefers-reduced-motion: reduce) {
  .view.on,
  #perfil > *,
  .sk-b {
    animation: none;
  }
  #progress.on {
    transition: none;
  }
  .pv,
  .pvs {
    transition: none;
  }
}
@media print {
  .prov-aside,
  #progress,
  .idx {
    display: none !important;
  }
  .notes-layout {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* selector map: full column width; beside the search on medium screens */
.sel-map svg {
  max-height: none;
}
@media (max-width: 980px) {
  .prov-aside {
    display: grid;
    grid-template-columns: minmax(0, 340px) minmax(0, 1fr);
    gap: 0 20px;
    align-items: start;
  }
  .sel-map svg {
    max-height: none;
    margin: 0;
  }
  .prov-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 640px) {
  .prov-aside {
    grid-template-columns: minmax(0, 1fr);
  }
  .sel-map svg {
    max-height: 340px;
    margin: 0 auto;
  }
}

/* ---- press kit on the map: one primary action, downloads grouped ---- */
.maptools {
  align-items: center;
}
.maptools > .btn,
.dl-menu > summary.btn {
  padding: 9px 16px;
  font-size: 13.5px;
}
.dl-menu {
  position: relative;
}
.dl-menu > summary {
  list-style: none;
  cursor: pointer;
  user-select: none;
}
.dl-menu > summary::-webkit-details-marker {
  display: none;
}
.dl-pop {
  position: absolute;
  z-index: 20;
  top: calc(100% + 6px);
  left: 0;
  min-width: 270px;
  padding: 6px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(13, 22, 34, 0.16);
}
.dl-pop button {
  display: block;
  width: 100%;
  text-align: left;
  font: inherit;
  padding: 8px 10px;
  border: 0;
  border-radius: 7px;
  background: none;
  color: var(--ink);
  cursor: pointer;
}
.dl-pop button:hover,
.dl-pop button:focus-visible {
  background: var(--acc-soft);
}
.dl-pop b {
  display: block;
  font-size: 13.5px;
}
.dl-pop span {
  display: block;
  font-size: 12px;
  color: var(--mut);
}
.kit-note {
  flex: 1 1 100%;
  margin: 2px 0 0;
  font-size: 12.5px;
  color: var(--mut);
}

/* ---- search shortcut hint and inline glossary ---- */
.finder-btn kbd {
  font-size: 12.5px;
  padding: 2px 8px;
  background: color-mix(in srgb, var(--on-acc) 22%, transparent);
  border-color: color-mix(in srgb, var(--on-acc) 70%, transparent);
}
.finder-btn .kbd-ctrl {
  display: none;
}
@media (min-width: 1000px) {
  .finder-btn .kbd-ctrl {
    display: inline-block;
  }
}
.finder-btn em {
  opacity: 0.92;
}
.gl-row {
  margin: 8px 0 0;
  font-size: 12.5px;
  color: var(--mut);
}
.gl {
  font: inherit;
  font-size: inherit;
  font-weight: 650;
  padding: 0 1px;
  margin: 0 2px;
  color: var(--acc);
  background: none;
  border: 0;
  border-bottom: 1px dotted currentColor;
  cursor: help;
}
.gl:hover,
.gl[aria-expanded="true"] {
  background: var(--acc-soft);
}
#glTip {
  position: fixed;
  z-index: 60;
  padding: 12px 14px;
  background: var(--card);
  color: var(--ink);
  border: 1px solid var(--line);
  border-left: 4px solid var(--acc);
  border-radius: 9px;
  box-shadow: 0 8px 24px rgba(13, 22, 34, 0.18);
  font-size: 13.5px;
  line-height: 1.45;
}
#glTip p {
  margin: 4px 0 8px;
}
.sin-res {
  color: var(--ink);
  line-height: 1.45;
}
#tabla td.sin-res {
  padding: 18px 12px;
  text-align: center;
}

/* ---- consistency and contrast (WCAG AA) ---- */
nav button {
  opacity: 0.82;
}
nav button.t2 {
  opacity: 0.78;
}
nav button:hover,
nav button.on,
nav button.t2:hover,
nav button.t2.on {
  opacity: 1;
}
.btn.gh {
  border-color: color-mix(in srgb, var(--acc) 55%, var(--line));
}
.btn,
.btn.gh {
  min-height: 36px;
}
.linkbtn,
.gl {
  min-height: 24px;
}

@media (max-width: 640px) {
  .maptools > .btn,
  .dl-menu > summary.btn {
    flex: 1 1 auto;
    min-height: 44px;
    text-align: center;
  }
  .dl-menu {
    flex: 1 1 auto;
  }
  .dl-pop {
    left: auto;
    right: 0;
    min-width: min(270px, calc(100vw - 32px));
  }
  .btn,
  .btn.gh,
  .cita-act .btn {
    min-height: 44px;
  }
  .ess-titular {
    font-size: 17px;
  }
  .precaucion {
    padding: 9px 11px;
  }
  .gl {
    padding: 4px 2px;
  }
  nav button {
    padding: 11px 13px;
    white-space: nowrap;
  }
}

/* =====================================================================
   Design standard: one type scale and one button system for the whole
   site. Declared last on purpose so it wins over older one-off sizes.
   ===================================================================== */
:root {
  --fs-page: 26px; /* page title: province name, start screen */
  --fs-section: 19px; /* section title: "Todos los datos de…", headline */
  --fs-card: 17px; /* card title */
  --fs-label: 12px; /* small uppercase label (h3) */
  --fs-body: 14px;
  --fs-small: 12.5px;
  --btn-h: 40px;
}
.prov-title,
.inicio-main h2 {
  font-size: var(--fs-page);
  line-height: 1.2;
}
.todo-h,
.fsec,
.ess-titular {
  font-size: var(--fs-section);
  line-height: 1.3;
}
.card h2,
.sec-h h2,
dialog h2 {
  font-size: var(--fs-card);
  line-height: 1.3;
}
h3 {
  font-size: var(--fs-label);
}

/* buttons: primary (.btn), secondary (.btn.gh), small (.copybtn), text (.linkbtn) */
.btn,
.btn.gh,
.maptools > .btn,
.dl-menu > summary.btn,
.cita-act .btn,
.peek-actions .btn,
.kit-actions .btn,
.sol-actions .btn {
  min-height: var(--btn-h);
  padding: 9px 16px;
  font-size: var(--fs-body);
  font-weight: 650;
  border-radius: 9px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  line-height: 1.2;
}
.kit-actions select,
.ess-actions select {
  min-height: var(--btn-h);
  font-size: var(--fs-body);
  border-radius: 9px;
}
.copybtn {
  font-size: var(--fs-small);
  min-height: 30px;
  padding: 5px 12px;
  border-radius: 9px;
}
.linkbtn {
  font-size: var(--fs-small);
}
.btn-req,
.btn-datos {
  min-height: 38px;
  font-size: 13.5px;
  font-weight: 650;
  padding: 8px 14px;
  border-radius: 9px;
}

/* header entry to the reference section */
.btn-datos {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-family: inherit;
  border: 1.5px solid color-mix(in srgb, var(--on-acc) 55%, transparent);
  background: none;
  color: var(--on-acc);
  cursor: pointer;
}
.btn-datos:hover,
.btn-datos.on {
  background: color-mix(in srgb, var(--on-acc) 16%, transparent);
}
.btn-datos .sd-c {
  display: inline-grid;
  place-items: center;
  width: 17px;
  height: 17px;
  border-radius: 50%;
  border: 1.5px solid currentColor;
  font: 700 11px/1 var(--body);
}

/* "Sobre los datos" section header and sub-tabs */
.datos-nav {
  margin: 4px 0 18px;
  padding: 16px 18px 0;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r);
}
.dn-top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 10px;
  flex-wrap: wrap;
}
.dn-k {
  margin: 0;
  font-family: var(--display);
  font-size: var(--fs-section);
  font-weight: 700;
  color: var(--ink);
}
.dn-sub {
  margin: 4px 0 12px;
  font-size: var(--fs-body);
  color: var(--mut);
}
.dn-tabs {
  display: flex;
  gap: 2px;
  overflow-x: auto;
  scrollbar-width: none;
}
.dn-tabs button {
  font: inherit;
  font-size: var(--fs-body);
  font-weight: 600;
  white-space: nowrap;
  padding: 10px 14px;
  border: 0;
  border-bottom: 3px solid transparent;
  background: none;
  color: var(--mut);
  cursor: pointer;
}
.dn-tabs button:hover {
  color: var(--ink);
}
.dn-tabs button[aria-current="page"] {
  color: var(--acc);
  border-bottom-color: var(--acc);
}
.pie-datos-links {
  font-size: var(--fs-small);
}

/* layer help: focused on the selected map */
#btnLeerCapa {
  margin-top: 6px;
}
.fv-list {
  list-style: none;
  margin: 6px 0 0;
  padding: 0;
}
.fv-list li {
  display: flex;
  align-items: baseline;
  gap: 7px;
  padding: 5px 0;
  border-bottom: 1px solid var(--line);
  font-size: var(--fs-body);
}
.fv-list .fdot {
  flex: none;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  display: inline-block;
}
.fv-n {
  margin-left: auto;
  font-size: var(--fs-small);
  color: var(--mut);
  white-space: nowrap;
}
.fv-pie {
  margin: 6px 0 0;
  font-size: var(--fs-small);
  color: var(--mut);
}

@media (max-width: 640px) {
  :root {
    --fs-page: 22px;
    --fs-section: 17px;
    --fs-card: 16px;
    --btn-h: 44px;
  }
  .btn-datos .sd-t {
    display: none;
  }
  .btn-datos {
    padding: 9px 11px;
  }
  .datos-nav {
    padding: 14px 14px 0;
  }
}
@media (max-width: 1000px) {
  .btn-datos .sd-t {
    display: none;
  }
  .btn-datos {
    padding: 8px 11px;
  }
}

/* ---- quick-note mode: the rest of the sheet folds under "Investigar a fondo" ---- */
details.a-fondo {
  margin-top: 22px;
}
details.a-fondo > summary {
  list-style: none;
  cursor: pointer;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 2px 12px;
  align-items: center;
  padding: 14px 18px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r);
}
details.a-fondo > summary::-webkit-details-marker {
  display: none;
}
details.a-fondo > summary::after {
  content: "Abrir ▾";
  grid-column: 2;
  grid-row: 1 / span 2;
  font-size: var(--fs-small);
  font-weight: 650;
  color: var(--acc);
}
details.a-fondo[open] > summary {
  margin-bottom: 16px;
}
details.a-fondo[open] > summary::after {
  content: "Cerrar ▴";
}
details.a-fondo > summary:hover {
  border-color: color-mix(in srgb, var(--acc) 45%, var(--line));
}
.af-t {
  font-family: var(--display);
  font-size: var(--fs-section);
  font-weight: 700;
  color: var(--ink);
}
.af-s {
  font-size: var(--fs-small);
  color: var(--mut);
}

/* ---- "Qué se está diciendo": listening summary inside the sheet ---- */
#sec-escucha {
  border-top: 3px solid #7a4a9e;
}
.esc-tag {
  flex: none;
  font-size: 11.5px;
  font-weight: 650;
  color: #5b3577;
  background: #f3edf8;
  border-radius: 999px;
  padding: 2px 9px;
}
.esc-lead {
  margin: 8px 0 8px;
  font-size: var(--fs-body);
}
span.trend-chip {
  cursor: default;
}
.esc-posts {
  list-style: none;
  margin: 12px 0 0;
  padding: 0;
}
.esc-posts li {
  padding: 8px 0;
  border-top: 1px solid var(--line);
  font-size: 13.5px;
  line-height: 1.45;
}
.esc-posts a {
  color: var(--ink);
  text-decoration: none;
}
.esc-posts a:hover {
  text-decoration: underline;
}
.esc-meta {
  display: block;
  margin-top: 2px;
  font-size: var(--fs-small);
  color: var(--mut);
}
#sec-escucha .caveat {
  margin: 10px 0 6px;
}
@media (max-width: 640px) {
  details.a-fondo > summary {
    padding: 12px 14px;
  }
  .sec-h {
    flex-wrap: wrap;
  }
}

/* ---- feedback: «¿Te sirvió?» after copying, never blocking the work ---- */
.opina {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 70;
  width: min(340px, calc(100vw - 32px));
  padding: 12px 14px;
  background: var(--card);
  color: var(--ink);
  border: 1px solid var(--line);
  border-left: 4px solid var(--acc);
  border-radius: 10px;
  box-shadow: 0 10px 28px rgba(13, 22, 34, 0.18);
  font-size: var(--fs-body);
}
.opina[hidden] {
  display: none;
}
.op-q {
  margin: 0 0 8px;
  font-weight: 650;
}
.op-acts {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.op-x {
  margin-left: auto;
  width: 30px;
  height: 30px;
  border: 0;
  border-radius: 8px;
  background: none;
  color: var(--mut);
  font-size: 18px;
  cursor: pointer;
}
.op-x:hover {
  background: var(--acc-soft);
  color: var(--ink);
}
.op-mot {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 8px;
}
.op-mot [aria-pressed="true"] {
  background: var(--acc);
  color: var(--on-acc);
}
.opina textarea {
  width: 100%;
  margin-bottom: 8px;
  font: inherit;
  font-size: var(--fs-small);
  padding: 7px 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  resize: vertical;
}
.retro-mods,
.retro-val {
  border: 0;
  padding: 0;
  margin: 12px 0;
}
.retro-mods legend,
.retro-val legend {
  font-size: 12.5px;
  font-weight: 650;
  margin-bottom: 6px;
  color: var(--ink);
}
.retro-mods {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px 14px;
}
.retro-mods label {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: var(--fs-body);
}
.val-row {
  display: flex;
  gap: 8px;
}
.val-row label {
  position: relative;
}
.val-row input {
  position: absolute;
  opacity: 0;
}
.val-row span {
  display: inline-grid;
  place-items: center;
  width: 44px;
  height: 40px;
  border: 1.5px solid var(--line);
  border-radius: 9px;
  font-weight: 700;
  cursor: pointer;
}
.val-row input:checked + span {
  background: var(--acc);
  border-color: var(--acc);
  color: var(--on-acc);
}
.val-row input:focus-visible + span {
  outline: 2px solid var(--acc);
  outline-offset: 2px;
}
.val-lab {
  display: flex;
  justify-content: space-between;
  max-width: 252px;
  margin: 4px 0 0;
  font-size: 11.5px;
  color: var(--mut);
}
@media (max-width: 640px) {
  .retro-mods {
    grid-template-columns: minmax(0, 1fr);
  }
  .opina {
    right: 16px;
    left: 16px;
    width: auto;
  }
}
.retro-mods input,
.val-row input {
  width: auto;
  min-height: 0;
  padding: 0;
}
.retro-mods label {
  justify-content: flex-start;
  text-align: left;
}
.retro-mods input {
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: var(--acc);
}

/* ======================================================================
   Loading states, quiet effects, and a readable type floor
   ====================================================================== */
:root {
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

/* ---- connection pill: slow server, offline, back online ---- */
#netbar {
  position: fixed;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 250;
  max-width: min(580px, calc(100vw - 24px));
  padding: 9px 18px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.4;
  text-align: center;
  background: #1b3a5c;
  color: #fff;
  box-shadow: 0 10px 30px rgba(10, 20, 36, 0.3);
  animation: pillIn 0.35s var(--ease) both;
}
#netbar[data-tone="warn"] {
  background: #fff6e5;
  color: #6b4d12;
  border: 1px solid #ecc98a;
}
#netbar[data-tone="ok"] {
  background: #eaf6ef;
  color: #17573a;
  border: 1px solid #9fd0b4;
}
@keyframes pillIn {
  from {
    opacity: 0;
    transform: translate(-50%, -10px);
  }
}
.noscript {
  margin: 0;
  padding: 14px 20px;
  background: #fff6e5;
  color: #5a3b05;
  text-align: center;
  font-size: 14px;
}

/* ---- skeletons with the shape of what is coming ---- */
.sk-wrap {
  display: grid;
  gap: 0;
}
.sk-row {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 12px 0;
}
.sk-row .sk-b {
  margin: 0;
  height: 16px;
}
.map-canvas {
  position: relative;
}
.map-canvas[data-loading] {
  min-height: 300px;
}
.map-canvas[data-loading]::before {
  content: "";
  position: absolute;
  inset: 12% 22%;
  border-radius: 46% 54% 50% 50% / 55% 45% 55% 45%;
  background: linear-gradient(90deg, #dde6f0 25%, #edf2f8 37%, #dde6f0 63%);
  background-size: 400% 100%;
  animation: shimmer 1.3s ease infinite;
}
.btn-spin {
  display: inline-block;
  width: 13px;
  height: 13px;
  margin-right: 8px;
  vertical-align: -2px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: tend-spin 0.7s linear infinite;
}
.is-busy {
  pointer-events: none;
  opacity: 0.85;
}

/* ---- the one signature motion: the note arrives in order ---- */
#perfil > * {
  animation: kitIn 0.45s var(--ease) both;
  animation-delay: calc(var(--i, 0) * 50ms);
}
@keyframes kitIn {
  from {
    opacity: 0.4;
    transform: translateY(8px);
  }
}
.esc-mark {
  animation: markPop 0.6s var(--ease) 0.3s both;
}
@keyframes markPop {
  from {
    transform: translateX(-50%) scale(0.3);
    opacity: 0.3;
  }
}

/* ---- everything else stays quiet: soft hover, a small press ---- */
.btn,
.btn-req,
.copybtn,
.pl-item,
.prov-btn,
.fbtn,
.fhelp,
.mod-h,
nav button,
.idx button,
.linkbtn {
  transition: background-color 0.2s var(--ease), border-color 0.2s var(--ease), color 0.2s var(--ease), box-shadow 0.2s var(--ease), transform 0.2s var(--ease);
}
.btn:not(:disabled):hover,
.btn-req:hover {
  box-shadow: 0 6px 16px rgba(16, 32, 56, 0.16);
  transform: translateY(-1px);
}
.btn:active,
.btn-req:active,
.copybtn:active,
.pl-item:active,
.prov-btn:active,
.fbtn:active,
nav button:active,
.idx button:active {
  transform: scale(0.97);
  box-shadow: none;
}
.pv.sel,
.pvs.sel {
  filter: drop-shadow(0 2px 4px rgba(10, 20, 36, 0.45));
}

/* ---- readability: figures align, lines stay short, nothing is tiny ---- */
.num,
.big,
.pl-r,
.fv b,
.fcode,
.esc-lab,
.rango,
.pill,
.metric .v,
.rk,
td.num,
table.delta td {
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum";
}
.note,
.fp,
.fintro,
.inicio-lead,
.ess-lead,
.ess-tipo,
.esc-lead,
.rec p,
.caveat,
.hint {
  max-width: 68ch;
}
.srcline,
.stack,
.asis-chain-item .t,
.asis-source .src-meta,
.caveat,
.fsub,
.tag,
th,
.ftab th,
#palList .ptag,
#rk .ptag,
.metric .c,
.pill,
.rk,
.esc-tag,
.fleg .knote,
.fmeta,
.fo,
.hint,
.legend,
.metric .k,
.sol,
.trend-chip,
.trend-chip .count,
.trend-samples a,
.val-lab {
  font-size: 12px;
}
.cut {
  font-size: 12px;
}
.lbl {
  font-size: 11px;
}

/* ---- "¿Para qué sirve este dato?": one decision per row, any width ---- */
.criterio {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 14px;
}
.criterio li {
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}
.criterio li:last-child {
  border: 0;
  padding-bottom: 0;
}
.criterio b {
  display: block;
  font-size: 14px;
  margin-bottom: 5px;
}
.criterio p {
  display: flex;
  gap: 8px;
  margin: 3px 0;
  font-size: 13.5px;
  line-height: 1.5;
}
.criterio svg.ic {
  margin-top: 3px;
}
.criterio .c-si {
  color: #1d6a43;
}
.criterio .c-no {
  color: #8a2a20;
}
.criterio .c-nota {
  color: var(--mut);
  font-size: 13px;
}

/* ---- people who ask for less motion get none ---- */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    animation-delay: 0s !important;
    transition-duration: 0.01ms !important;
  }
}

/* GSAP drives these motions now; the CSS versions above remain as the fallback
   when the script is missing (the `gsap` class is only added if it loaded). */
.gsap .view.on,
.gsap #perfil > *,
.gsap .esc-mark {
  animation: none;
}

/* ---- user stories pass: notices, guide, follow list, cases, sensitivity ---- */
.rel-aviso,
.insumo {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  margin: 12px 0 0;
  padding: 9px 12px;
  border-radius: 9px;
  font-size: 13px;
  line-height: 1.45;
  color: #26313f;
  background: var(--acc-soft);
  border: 1px solid #d3dfec;
}
.rel-aviso .ic {
  flex: none;
  margin-top: 2px;
  color: var(--acc);
}
.insumo {
  display: block;
  margin: 0 0 14px;
}
.ptag.ej {
  color: #4a5666;
  background: #f1f4f8;
  border-color: #cfd8e2;
  margin-left: 8px;
}
.qes {
  margin-left: 8px;
  font-size: 12.5px;
}
.guia-lee {
  margin: 6px 0 12px;
  font-size: 14px;
  color: #26313f;
}
.guia-tareas {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
}
.guia-tareas li {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px;
}
.sigo-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 6px 0 12px;
}
.sigo-chips .chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
  color: var(--ink);
}
.chip-x {
  border: 0;
  background: none;
  font: inherit;
  font-size: 16px;
  line-height: 1;
  padding: 4px 6px;
  margin: -4px -6px -4px 0;
  cursor: pointer;
  color: var(--mut);
}
.sigo-form {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.sigo-form input {
  flex: 1 1 200px;
  min-width: 0;
}
.casos {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}
.caso {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px 14px;
  background: #fbfcfe;
}
.caso h3 {
  margin: 0 0 8px;
  font-size: 14.5px;
}
.caso p {
  margin: 0 0 8px;
  font-size: 13.5px;
  line-height: 1.5;
}
.caso .c-nota {
  margin: 0;
  color: #4a5666;
}
.sens .amp {
  font-size: 12px;
  font-weight: 600;
  color: #7a4a05;
  background: #fff6e5;
  border: 1px solid #ecc98a;
  border-radius: 6px;
  padding: 1px 6px;
  margin-left: 4px;
}
.sens a {
  color: var(--acc);
}
dialog .chk {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  font-size: 14px;
  line-height: 1.5;
}
dialog .chk input {
  margin-top: 3px;
  width: 20px;
  height: 20px;
  flex: none;
}

/* ---- touch targets: 44 px for everything you press on a phone or touch screen ---- */
@media (pointer: coarse), (max-width: 640px) {
  .finder-btn,
  .btn-datos,
  .btn-req,
  .pl-item,
  .fbtn,
  .fhelp,
  .mod-input,
  .skip,
  .chip,
  .copybtn,
  .trend-chip,
  .jump button,
  .idx button,
  summary {
    min-height: 44px;
  }
  .fhelp,
  .chip-x,
  .btn-datos,
  .sens a {
    min-width: 44px;
  }
  .gl {
    min-width: 44px;
    min-height: 44px;
  }
  #rk tr {
    height: 44px;
  }
  .linkbtn,
  .qes {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    padding: 0 6px;
  }
  .sens a,
  td a {
    display: inline-block;
    padding: 14px 0;
  }
  .chip-x {
    margin: -4px -10px -4px 0;
  }
}

/* ---- refactor pass: figures line up, every control answers hover / press / focus ---- */
.big,
.num,
.vl,
.fv,
.rk,
td,
th,
.pl-item b,
.esc-lab,
.kit-main .pill {
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum";
}
.btn,
.btn-req,
.btn-datos,
.finder-btn,
.chip,
.pl-item,
.fbtn,
.copybtn,
.linkbtn,
.trend-chip,
.jump button,
.idx button,
nav button {
  transition: background-color 0.2s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.2s cubic-bezier(0.16, 1, 0.3, 1), color 0.2s cubic-bezier(0.16, 1, 0.3, 1), transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}
.btn:active,
.btn-req:active,
.chip:active,
.pl-item:active,
.copybtn:active,
.fbtn:active {
  transform: translateY(1px);
}
:where(button, a[href], summary, select, input, textarea, [role="button"], [tabindex="0"]):focus-visible {
  outline: 3px solid #2563eb;
  outline-offset: 2px;
}
@media (prefers-reduced-motion: reduce) {
  .btn:active,
  .btn-req:active,
  .chip:active,
  .pl-item:active,
  .copybtn:active,
  .fbtn:active {
    transform: none;
  }
}

/* ---- phone: the four sections live under the thumb, and the note comes first ---- */
@media (max-width: 640px) {
  body {
    padding-bottom: calc(68px + env(safe-area-inset-bottom, 0px));
  }
  header nav {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 90;
    margin: 0;
    gap: 0;
    overflow: visible;
    background: var(--acc);
    border-top: 1px solid rgba(255, 255, 255, 0.18);
    padding-bottom: env(safe-area-inset-bottom, 0px);
    box-shadow: 0 -6px 20px rgba(16, 32, 56, 0.18);
  }
  header nav button {
    flex: 1 1 0;
    min-width: 0;
    min-height: 60px;
    padding: 8px 4px;
    border-radius: 0;
    border-bottom: 0;
    border-top: 3px solid transparent;
    font-size: 12.5px;
    line-height: 1.2;
    opacity: 0.78;
  }
  header nav button.on {
    opacity: 1;
    font-weight: 700;
    border-top-color: var(--on-acc);
    background: rgba(255, 255, 255, 0.12);
  }
  #toast {
    bottom: calc(80px + env(safe-area-inset-bottom, 0px));
  }
  /* with a province open, its note goes before the map and the list */
  .notes-layout:has(.kit-head) .prov-aside {
    order: 2;
  }
  .notes-layout:has(.kit-head) .prov-aside .aside-h:first-child {
    margin-top: 0;
  }
}

/* phone tab bar: labels wrap onto two lines instead of running into each other */
@media (max-width: 640px) {
  header nav button {
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    white-space: normal;
    overflow-wrap: anywhere;
    text-wrap: balance;
    font-size: 12px;
    line-height: 1.15;
    padding: 6px 3px;
  }
}
@media (max-width: 360px) {
  header nav button {
    font-size: 11.5px;
  }
}

/* ---- simple-use helpers: undo in the toast, breadcrumb, back to top ---- */
#toast:has(button) {
  pointer-events: auto;
}
#toast button {
  border: 0;
  background: none;
  color: #9cc3ff;
  font: inherit;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 3px;
  padding: 6px 4px 6px 8px;
  cursor: pointer;
}
.migas {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 8px;
  font-size: 13px;
  color: var(--mut);
}
.migas .linkbtn {
  font-size: 13px;
}
.subir {
  position: fixed;
  right: 14px;
  bottom: 18px;
  z-index: 80;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--card);
  color: var(--acc);
  box-shadow: var(--sh);
  cursor: pointer;
}
.subir[hidden] {
  display: none;
}
@media (max-width: 640px) {
  .subir {
    bottom: calc(80px + env(safe-area-inset-bottom, 0px));
  }
}

/* ---- fast mode: search first, one thing to copy, the copy button always in reach ---- */
.copy-bar {
  display: none;
}
.aside-buscar {
  grid-column: 1 / -1;
  margin-bottom: 14px;
}
.aside-buscar .aside-h {
  display: block;
  margin: 0 0 6px;
}
.aside-buscar .mod-input {
  width: 100%;
  font-size: 16px; /* 16 px keeps phones from zooming in when the field is focused */
}
.copiar-h {
  margin: 0 0 6px;
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--mut);
}
.copiar .frase {
  margin: 0 0 12px;
}
@media (max-width: 640px) {
  .cut {
    display: none;
  }
  /* the copy button follows you down the sheet, just above the tab bar */
  .copy-bar.on {
    display: block;
    position: sticky;
    bottom: calc(70px + env(safe-area-inset-bottom, 0px));
    z-index: 20;
    margin: 12px -4px 0;
    padding: 10px 4px;
    background: var(--bg);
    border-top: 1px solid var(--line);
  }
  .copy-bar .btn {
    width: 100%;
  }
}
.copiar {
  margin-bottom: 18px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}
@media (max-width: 640px) {
  /* "Datos para tu nota": the figure on the left, its copy button on the right (not stacked and centred) */
  .angulos li {
    flex-direction: row;
    align-items: center;
    text-align: left;
    gap: 10px;
  }
  .angulos li > div {
    flex: 1 1 auto;
    min-width: 0;
  }
  .angulos .copybtn {
    flex: none;
    min-width: 76px;
  }
}

/* ---- empty state that says what to do and points at it ---- */
.vacio {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 22px 20px;
  border: 2px dashed #9fb4cc;
  border-radius: 12px;
  background: var(--acc-soft);
  color: var(--acc);
}
svg.vacio-flecha {
  width: 56px;
  height: 38px;
  max-width: none;
  flex: none;
  animation: vacioEmpuja 1.5s ease-in-out infinite;
}
.vacio-t {
  margin: 0 0 4px;
  font-size: 20px;
  font-weight: 750;
  line-height: 1.2;
  color: var(--ink);
}
.vacio-x {
  margin: 0;
  font-size: 14.5px;
  line-height: 1.45;
  color: #3a4657;
}
@keyframes vacioEmpuja {
  0%,
  100% {
    transform: translateX(0);
  }
  50% {
    transform: translateX(-9px);
  }
}
@keyframes vacioEmpujaArriba {
  0%,
  100% {
    transform: rotate(90deg) translateX(0);
  }
  50% {
    transform: rotate(90deg) translateX(-9px);
  }
}
@media (max-width: 900px) {
  .vacio--mapa .vacio-flecha {
    transform: rotate(90deg);
    animation-name: vacioEmpujaArriba;
  }
}
@media (max-width: 760px) {
  .vacio--tend .vacio-flecha {
    transform: rotate(90deg);
    animation-name: vacioEmpujaArriba;
  }
}
@media (prefers-reduced-motion: reduce) {
  .vacio-flecha {
    animation: none;
  }
}

/* no extra scrolling: while you type a province, the map steps aside so the matches are right under the field */
@media (max-width: 900px) {
  .prov-aside:has(#provFiltro:not(:placeholder-shown)) .aside-map {
    display: none;
  }
}

/* phone: the header closes with some air and a soft edge instead of ending right under the buttons */
@media (max-width: 640px) {
  header {
    padding: 12px 0 16px;
    border-radius: 0 0 20px 20px;
    box-shadow: 0 6px 18px rgba(16, 32, 56, 0.16);
  }
  #main {
    padding-top: 16px;
  }
}
@media (max-width: 640px) {
  /* on the home the search field is right below: don't show the same question twice */
  body:has(#perfil .inicio-main) .finder-btn {
    display: none;
  }
  body:has(#perfil .inicio-main) .brand-row h1 {
    flex: 1 1 0;
  }
}

/* ---- Compare: two colours, one per side, everywhere they appear ---- */
:root {
  --cmp-a: #1f5fae;
  --cmp-b: #d97706;
  --cmp-b-ink: #9a4f03; /* the amber as text: reaches 4.5:1 on white */
}
.cdot {
  display: inline-block;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  margin-right: 7px;
  vertical-align: baseline;
  flex: none;
}
.cdot.a {
  background: var(--cmp-a);
}
.cdot.b {
  background: var(--cmp-b);
}
.cmp-hero {
  border-top: 4px solid transparent;
  border-image: linear-gradient(90deg, var(--cmp-a) 0 50%, var(--cmp-b) 50% 100%) 1;
  margin-bottom: 16px;
}
.cmp-sel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  gap: 12px;
  align-items: end;
}
.cmp-lado {
  display: block;
}
.cmp-lado > span {
  display: block;
  margin-bottom: 6px;
  font-size: 13px;
  font-weight: 700;
}
.cmp-lado select {
  width: 100%;
  font-size: 16px;
  font-weight: 600;
  min-height: 44px;
  border-width: 2px;
}
.cmp-lado.a select {
  border-color: var(--cmp-a);
}
.cmp-lado.b select {
  border-color: var(--cmp-b);
}
.cmp-lado.a > span {
  color: var(--cmp-a);
}
.cmp-lado.b > span {
  color: var(--cmp-b-ink);
}
.cmp-swap {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--card);
  color: var(--acc);
  cursor: pointer;
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1), background-color 0.2s;
}
.cmp-swap:hover {
  background: var(--acc-soft);
  transform: rotate(180deg);
}
.cmp-col.a h3 {
  color: var(--cmp-a);
}
.cmp-col.b h3 {
  color: var(--cmp-b-ink);
}
.cmp-col {
  border-top: 3px solid transparent;
  padding-top: 8px;
}
.cmp-col.a {
  border-top-color: var(--cmp-a);
}
.cmp-col.b {
  border-top-color: var(--cmp-b);
}
table.delta th .cdot {
  margin-right: 5px;
}
.cmp-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}
.cmp-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  padding: 8px 14px;
  border: 2px solid #c9d6e6;
  border-radius: 999px;
  background: var(--card);
  color: var(--ink);
  font: inherit;
  font-size: 14px;
  font-weight: 650;
  cursor: pointer;
  transition: border-color 0.2s cubic-bezier(0.16, 1, 0.3, 1), transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), background-color 0.2s;
}
.cmp-chip:hover {
  border-color: var(--acc);
  background: var(--acc-soft);
  transform: translateY(-1px);
}
.cmp-chip .cdot {
  margin-right: 2px;
}
.cmp-chip svg {
  color: var(--mut);
}
.cmp-sug {
  border-top: 4px solid transparent;
  border-image: linear-gradient(90deg, var(--cmp-a) 0 50%, var(--cmp-b) 50% 100%) 1;
}
.cmp-sug select {
  min-height: 44px;
  border-width: 2px;
  font-weight: 600;
}
@media (max-width: 640px) {
  .cmp-sel {
    grid-template-columns: minmax(0, 1fr);
  }
  .cmp-swap {
    justify-self: center;
    margin: -2px 0;
    transform: rotate(90deg);
  }
  .cmp-swap:hover {
    transform: rotate(270deg);
  }
}

/* the tab that is easy to miss: a small amber dot that pulses until it has been used once */
nav button.nuevo {
  position: relative;
}
nav button.nuevo::after {
  content: "";
  position: absolute;
  top: 6px;
  right: 6px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #f2a52b;
  box-shadow: 0 0 0 0 rgba(242, 165, 43, 0.7);
  animation: nuevoPulso 1.8s ease-out infinite;
}
@keyframes nuevoPulso {
  70% {
    box-shadow: 0 0 0 9px rgba(242, 165, 43, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(242, 165, 43, 0);
  }
}
@media (max-width: 640px) {
  header nav button.nuevo::after {
    top: 8px;
    right: 14px;
  }
}
@media (prefers-reduced-motion: reduce) {
  nav button.nuevo::after {
    animation: none;
  }
  .cmp-swap,
  .cmp-chip {
    transition: none;
  }
}

/* ---- Compare: "touch me" glow, a slow shine across the suggestions, rings on focus ---- */
.cmp-chip {
  position: relative;
  overflow: hidden;
  isolation: isolate;
}
.cmp-chip::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(110deg, transparent 35%, rgba(255, 255, 255, 0.85) 50%, transparent 65%);
  transform: translateX(-130%);
  animation: brilloChip 4.2s ease-in-out infinite;
}
.cmp-chip:nth-of-type(2)::before {
  animation-delay: 0.45s;
}
.cmp-chip:nth-of-type(3)::before {
  animation-delay: 0.9s;
}
@keyframes brilloChip {
  0%,
  55% {
    transform: translateX(-130%);
  }
  100% {
    transform: translateX(130%);
  }
}
.cmp-chip {
  border-color: #b7c9e0;
  box-shadow: 0 0 0 0 rgba(31, 95, 174, 0);
}
.cmp-chip:hover,
.cmp-chip:focus-visible {
  border-color: var(--cmp-a);
  box-shadow: 0 0 0 4px rgba(31, 95, 174, 0.16), 0 8px 18px rgba(31, 95, 174, 0.22);
  transform: translateY(-2px);
}
.cmp-chip:active {
  transform: translateY(0) scale(0.98);
}
.cmp-chip:hover svg {
  color: var(--cmp-b);
  transform: translateX(3px);
}
.cmp-chip svg {
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), color 0.2s;
}
.cmp-lado.a select:hover,
.cmp-lado.a select:focus {
  box-shadow: 0 0 0 4px rgba(31, 95, 174, 0.18);
}
.cmp-lado.b select:hover,
.cmp-lado.b select:focus {
  box-shadow: 0 0 0 4px rgba(217, 119, 6, 0.2);
}
.cmp-swap {
  box-shadow: 0 0 0 0 rgba(31, 95, 174, 0.35);
  animation: swapLatido 2.6s ease-out infinite;
}
.cmp-swap:hover {
  animation: none;
  box-shadow: 0 0 0 5px rgba(31, 95, 174, 0.18);
}
@keyframes swapLatido {
  70% {
    box-shadow: 0 0 0 10px rgba(31, 95, 174, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(31, 95, 174, 0);
  }
}
@media (prefers-reduced-motion: reduce) {
  .cmp-chip::before,
  .cmp-swap {
    animation: none;
  }
  .cmp-chip:hover,
  .cmp-chip:focus-visible {
    transform: none;
  }
}
/* keep the card's rounded corners: the two-colour bar is a pseudo-element, not a border image */
.cmp-hero,
.cmp-sug {
  position: relative;
  overflow: hidden;
  border-top: 1px solid var(--line);
  border-image: none;
}
.cmp-hero::before,
.cmp-sug::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 4px;
  background: linear-gradient(90deg, var(--cmp-a) 0 50%, var(--cmp-b) 50% 100%);
}

/* ---- less scrolling ---- */
.idx button.on {
  background: var(--acc);
  border-color: var(--acc);
  color: var(--on-acc);
  font-weight: 700;
}
[id^="sec-"] {
  scroll-margin-top: 64px;
}
.copiar-nota {
  margin: -6px 0 12px;
  font-size: 12.5px;
  color: var(--mut);
}
@media (max-width: 640px) {
  .card {
    padding: 14px;
  }
  .kit-grid,
  .notes-main .grid {
    gap: 12px;
  }
  /* with a province open, the map and the 24-name list would add ~1,500 px at the end of the page: the header search and the breadcrumb already cover "another province" */
  .notes-layout:has(.kit-head) .prov-aside {
    display: none;
  }
  /* map layers in one swipeable row instead of a 400 px block of chips */
  #capas {
    flex-wrap: nowrap;
    overflow-x: auto;
    scroll-snap-type: x proximity;
    scrollbar-width: none;
    margin-right: -16px;
    padding-right: 16px;
    -webkit-mask-image: linear-gradient(90deg, #000 88%, transparent);
    mask-image: linear-gradient(90deg, #000 88%, transparent);
  }
  #capas::-webkit-scrollbar {
    display: none;
  }
  #capas > * {
    flex: none;
    scroll-snap-align: start;
  }
}
