:root {
  --navy: #082f73;
  --blue: #1559b7;
  --sky: #eaf2ff;
  --ink: #16233b;
  --muted: #65728a;
  --line: #d4deec;
  --paper: #f6f8fc;
  --white: #fff;
  --green: #16734a;
  --green-soft: #e9f7ef;
  --orange: #dd4c20;
  --orange-soft: #fff0e8;
  --amber: #91610a;
  --amber-soft: #fff7dc;
  --shadow: 0 18px 45px rgba(8, 47, 115, .09);
  --radius: 20px;
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--paper);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; min-width: 320px; background: var(--paper); }
a { color: inherit; }
button, input, select { font: inherit; }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.skip-link { position: absolute; left: -9999px; top: 8px; z-index: 99; padding: 10px 14px; background: #fff; }
.skip-link:focus { left: 8px; }

.site-header {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  width: 100%;
  max-width: 1160px;
  margin: 0 auto 32px;
  grid-column: 1 / -1;
  color: #fff;
}
.brand { display: inline-flex; flex-shrink: 0; border-radius: 10px; }
.brand img { width: 56px; height: 50px; object-fit: contain; }
.site-header nav { display: flex; align-items: center; gap: 30px; padding: 0 14px; border-radius: 10px; background: #386f99; }
.site-header nav a { text-decoration: none; font-size: .94rem; padding: 10px 0; border-bottom: 3px solid transparent; }
.site-header nav a:hover, .site-header nav a[aria-current="page"] { color: #fff; border-color: #fff; }
.site-header a:focus-visible { outline: 3px solid #ffdb73; outline-offset: 5px; }
main > .site-header { max-width: none; padding: 20px clamp(20px, 5vw, 76px); background: #073568; }
.draft-banner { padding: 8px clamp(20px, 5vw, 76px); background: var(--amber-soft); color: #6f4d0d; border-bottom: 1px solid #eadca8; font-size: .78rem; }

main { min-height: 70vh; }
.loading, .empty { max-width: 1120px; margin: 50px auto; padding: 30px; text-align: center; color: var(--muted); }
.page-shell { max-width: 1240px; margin: 0 auto; padding: 34px clamp(18px, 4vw, 54px) 70px; }

.hero {
  position: relative;
  overflow: hidden;
  background: linear-gradient(120deg, #062d6b 0%, #0d4c9b 62%, #1b76c8 100%);
  color: #fff;
  padding: 54px clamp(20px, 6vw, 82px) 92px;
}
.hero::before, .hero::after { content: ""; position: absolute; border-radius: 50%; background: rgba(255,255,255,.09); }
.hero::before { width: 430px; height: 430px; right: -110px; top: -250px; }
.hero::after { width: 280px; height: 280px; right: 18%; bottom: -220px; }
.hero-inner { position: relative; z-index: 1; max-width: 1160px; margin: 0 auto; display: grid; grid-template-columns: 1.35fr .65fr; gap: 60px; align-items: end; }
.eyebrow { margin: 0 0 10px; font-size: .78rem; font-weight: 800; letter-spacing: .13em; text-transform: uppercase; color: #a9d1ff; }
.hero h1 { max-width: 800px; margin: 0; font-size: clamp(2.35rem, 5vw, 4.75rem); line-height: .98; letter-spacing: -.045em; }
.hero .lead { max-width: 750px; margin: 22px 0 0; font-size: clamp(1rem, 1.6vw, 1.24rem); line-height: 1.55; color: #dcecff; }
.hero-note { padding: 22px; border: 1px solid rgba(255,255,255,.28); border-radius: 18px; background: rgba(3,30,77,.35); backdrop-filter: blur(8px); }
.hero-note strong { display: block; margin-bottom: 7px; font-size: 1.03rem; }
.hero-note span { color: #dcecff; font-size: .9rem; line-height: 1.5; }

.summary-grid { max-width: 1160px; margin: -48px auto 0; padding: 0 clamp(18px, 4vw, 34px); position: relative; z-index: 3; display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.summary-card { padding: 22px; background: #fff; border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow); }
.summary-card .number { display: block; color: var(--navy); font-size: clamp(1.9rem, 3vw, 2.75rem); font-weight: 800; letter-spacing: -.04em; }
.summary-card .label { display: block; margin-top: 4px; color: var(--muted); font-size: 1rem; line-height: 1.35; }
.summary-card.response .number { color: var(--green); }
.summary-card.pending .number { color: var(--orange); }
.summary-card.status-chart { --chart-red: #c62828; grid-column: 1 / -1; display: flex; align-items: flex-start; justify-content: space-between; gap: 28px; }
.status-chart h2 { margin: 0; color: var(--navy); font-size: 1.25rem; }
.status-chart p { margin: 7px 0 0; color: var(--muted); font-size: 1rem; line-height: 1.45; }
.status-chart-legend { display: flex; flex-direction: column; gap: 10px 26px; margin: 12px 0 0; padding: 0; list-style: none; }
.status-chart-legend li { display: inline-flex; align-items: center; gap: 7px; font-size: 1rem; }
.status-chart-legend strong { font-size: 1.25rem; }
.status-swatch { width: 13px; height: 13px; flex: none; border-radius: 50%; }
.status-swatch.partial { background: #edbd18; }
.status-swatch.solved { background: var(--green); }
.status-swatch.pending { background: var(--chart-red); }
.status-pie { width: 174px; aspect-ratio: 1; flex: none; }
.status-pie svg { display: block; width: 100%; height: 100%; overflow: visible; }
.pie-slice.pending { fill: url(#pie-red-fill); }
.pie-slice.partial { fill: url(#pie-yellow-fill); }
.pie-slice.solved { fill: url(#pie-green-fill); }
.pie-empty-top { fill: var(--line); }

.section { margin-top: 46px; }
.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin-bottom: 18px; }
.section-heading h2 { margin: 0; color: var(--navy); font-size: clamp(1.5rem, 2.7vw, 2.15rem); letter-spacing: -.025em; }
.section-heading p { margin: 7px 0 0; max-width: 760px; color: var(--muted); line-height: 1.55; }
.text-link { color: var(--blue); text-decoration: none; font-weight: 750; white-space: nowrap; }
.text-link:hover { text-decoration: underline; }

.topic-list { display: flex; flex-wrap: wrap; gap: 9px; }
.topic-chip { display: inline-flex; align-items: center; gap: 8px; padding: 10px 14px; border: 1px solid #bfd0eb; border-radius: 999px; background: #fff; color: var(--navy); text-decoration: none; font-size: .82rem; font-weight: 700; }
.topic-chip span { display: inline-grid; place-items: center; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 999px; background: var(--sky); font-size: .72rem; }
.topic-chip:hover { border-color: var(--blue); transform: translateY(-1px); }

.petition-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.petition-card { display: flex; min-width: 0; flex-direction: column; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: 0 8px 24px rgba(8,47,115,.05); }
.petition-card:hover { border-color: #a9bee0; box-shadow: var(--shadow); transform: translateY(-2px); }
.card-body { padding: 20px; flex: 1; }
.card-topline { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; color: var(--muted); font-size: .72rem; }
.card-topline time { padding-top: 6px; white-space: nowrap; font-size: .81rem; }
.card-statuses { display: flex; min-width: 0; flex-direction: column; align-items: flex-end; gap: 6px; }
.card-statuses .solution-badge { max-width: 215px; padding: 6px 9px; border: 0; border-radius: 999px; font-size: .81rem; }
.petition-card h3 { margin: 13px 0 8px; color: var(--navy); font-size: 1.05rem; line-height: 1.25; }
.petition-card p { margin: 0; color: #46536a; font-size: .84rem; line-height: 1.48; display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.card-meta { display: flex; gap: 15px; margin-top: 16px; color: var(--muted); font-size: .75rem; }
.card-actions { display: flex; justify-content: space-between; gap: 12px; align-items: center; padding: 14px 20px; border-top: 1px solid var(--line); background: #fbfcff; }
.card-actions a { color: var(--blue); font-size: .8rem; font-weight: 800; text-decoration: none; }

.status { display: inline-flex; align-items: center; gap: 6px; padding: 6px 9px; border-radius: 999px; font-size: .69rem; font-weight: 800; white-space: nowrap; }
.status::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.status.review { color: var(--amber); background: var(--amber-soft); }

.response-list { display: grid; gap: 10px; }
.response-row { display: grid; grid-template-columns: 105px minmax(160px,.55fr) 1fr auto; gap: 16px; align-items: center; padding: 14px 16px; border: 1px solid var(--line); border-radius: 14px; background: #fff; }
.response-row time { color: var(--blue); font-size: .8rem; font-weight: 800; }
.response-row strong { color: var(--navy); font-size: .82rem; }
.response-row p { margin: 0; color: var(--muted); font-size: .8rem; line-height: 1.4; }
.small-button, .primary-button, .ghost-button { display: inline-flex; align-items: center; justify-content: center; border-radius: 11px; text-decoration: none; font-weight: 800; }
.small-button { padding: 8px 11px; border: 1px solid #a8bee0; color: var(--blue); font-size: .74rem; }
.primary-button { padding: 12px 17px; background: var(--blue); color: #fff; }
.ghost-button { padding: 11px 16px; border: 1px solid #adc2e2; color: var(--navy); background: #fff; }

.page-hero { padding: 38px 0 26px; border-bottom: 1px solid var(--line); background: linear-gradient(120deg, #073568, #155578); }
.page-hero-inner { max-width: 1240px; margin: 0 auto; padding: 0 clamp(18px,4vw,54px); }
.breadcrumbs { margin-bottom: 15px; color: var(--blue); font-size: .78rem; }
.breadcrumbs a { text-decoration: none; }
.page-hero h1 { margin: 0; max-width: 900px; color: var(--navy); font-size: clamp(2rem,4vw,3.55rem); letter-spacing: -.04em; line-height: 1.04; }
.page-hero p { max-width: 820px; margin: 15px 0 0; color: #53627b; line-height: 1.58; }
.hero-tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }

.toolbar { display: grid; grid-template-columns: minmax(0, 1fr); margin: 0 0 22px; }
.toolbar input { width: 100%; padding: 12px 14px; border: 1px solid #bacbe4; border-radius: 12px; background: #fff; color: var(--ink); }
.result-line { margin-bottom: 14px; color: var(--muted); font-size: .8rem; }

.detail-layout { display: grid; grid-template-columns: minmax(0,1.55fr) minmax(270px,.65fr); gap: 24px; align-items: start; }
.panel { margin-bottom: 18px; padding: 22px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); }
.panel h2 { margin: 0 0 12px; color: var(--navy); font-size: 1.25rem; }
.panel p { line-height: 1.58; }
.metric-row { display: grid; grid-template-columns: repeat(3,1fr); gap: 10px; margin-bottom: 18px; }
.metric { padding: 15px; border-radius: 14px; background: var(--sky); }
.metric strong { display: block; color: var(--navy); font-size: 1.5rem; }
.metric span { color: var(--muted); font-size: .74rem; }
.review-box { padding: 16px; border: 1px solid #eadca8; border-radius: 14px; background: var(--amber-soft); color: #694b10; font-size: .81rem; line-height: 1.5; }

.timeline { position: relative; margin: 8px 0 0 9px; padding-left: 24px; border-left: 2px solid #c6d6ed; }
.timeline-item { position: relative; padding: 0 0 22px; }
.timeline-item::before { content: ""; position: absolute; width: 10px; height: 10px; left: -30px; top: 3px; border-radius: 50%; background: var(--blue); box-shadow: 0 0 0 4px var(--sky); }
.timeline-item.response::before { background: var(--green); box-shadow: 0 0 0 4px var(--green-soft); }
.timeline-item time { color: var(--blue); font-size: .73rem; font-weight: 800; }
.timeline-item h3 { margin: 5px 0; color: var(--navy); font-size: .92rem; }
.timeline-item p { margin: 0 0 8px; color: #4c5b72; font-size: .82rem; }
.timeline-item a { color: var(--blue); font-size: .75rem; font-weight: 800; }

.org-list, .document-list { display: grid; gap: 9px; }
.org-item, .document-item { padding: 12px; border: 1px solid var(--line); border-radius: 12px; }
.org-item strong, .document-item strong { display: block; color: var(--navy); font-size: .82rem; }
.org-item span, .document-item span { display: block; margin-top: 4px; color: var(--muted); font-size: .73rem; line-height: 1.4; }
.document-item a { display: inline-block; margin-top: 7px; color: var(--blue); font-size: .72rem; font-weight: 800; }
.counter-box { padding: 18px; border-radius: 16px; background: #eff4fb; color: #53627b; }
.counter-box strong { display: block; color: var(--navy); margin-bottom: 6px; }

/* Ficha de petición */
.petition-detail { max-width: 1320px; padding-top: 24px; }
.back-link { display: inline-flex; margin: 0 0 18px; color: var(--blue); text-decoration: none; font-size: .86rem; font-weight: 750; }
.back-link:hover { text-decoration: underline; }
.petition-hero-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 22px;
  align-items: start;
  padding: clamp(24px, 4vw, 42px);
  border: 1px solid var(--line);
  border-radius: 22px;
  background:
    radial-gradient(circle at 90% 10%, rgba(21,89,183,.09), transparent 28%),
    linear-gradient(135deg, #fff 0%, #fbfdff 68%, #f1f7ff 100%);
  box-shadow: 0 10px 30px rgba(8,47,115,.06);
}
.petition-date-icon, .metric-icon, .group-icon { display: inline-grid; place-items: center; border-radius: 50%; color: var(--blue); background: #e7f0ff; flex: 0 0 auto; }
.petition-date-icon { width: 58px; height: 58px; }
.petition-date-icon svg { width: 29px; height: 29px; }
.petition-date-icon svg, .metric-icon svg, .group-icon svg { fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.petition-hero-copy time { color: var(--blue); font-size: .94rem; font-weight: 800; }
.petition-hero-copy h1 { max-width: 800px; margin: 10px 0 13px; color: var(--navy); font-size: clamp(2rem, 4vw, 3.45rem); line-height: 1.04; letter-spacing: -.045em; }
.petition-hero-copy > p { max-width: 880px; margin: 0; color: #4b5b75; font-size: clamp(.95rem, 1.35vw, 1.08rem); line-height: 1.55; }
.hero-topics { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.petition-hero-status { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; padding-top: 20px; }
.petition-hero-status .status { padding: 11px 15px; border: 1px solid currentColor; border-radius: 13px; font-size: .82rem; }
.petition-hero-status .status::before { width: 9px; height: 9px; }
.solution-badge { display: inline-flex; align-items: center; max-width: 290px; padding: 12px 16px; border: 1px solid currentColor; border-radius: 13px; font-size: .94rem; font-weight: 800; line-height: 1.3; }
.solution-badge::before { content: none; }
.solution-badge.pending { color: var(--orange); background: var(--orange-soft); }
.solution-badge.partial { color: var(--amber); background: var(--amber-soft); }
.solution-badge.solved { color: var(--green); background: var(--green-soft); }

.detail-metrics { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin: 18px 0; }
.detail-metric { display: grid; grid-template-columns: auto auto 1fr; align-items: center; gap: 12px; min-width: 0; padding: 20px; border: 1px solid var(--line); border-radius: 18px; background: #fff; }
.detail-metric-link { width: 100%; color: inherit; text-align: left; cursor: pointer; }
.detail-metric-link:hover { border-color: #a8bee0; background: #f7faff; }
.detail-metric-link:focus-visible { outline: 3px solid #a7c8f7; outline-offset: 2px; }
.detail-metric .metric-icon { width: 50px; height: 50px; grid-row: 1 / span 2; }
.detail-metric .metric-icon svg { width: 25px; height: 25px; }
.detail-metric > strong { align-self: end; color: var(--navy); font-size: 2rem; line-height: .9; }
.detail-metric > span:last-child { grid-column: 2 / -1; color: var(--navy); font-size: .8rem; font-weight: 720; line-height: 1.25; }
.detail-metric.green .metric-icon { color: var(--green); background: var(--green-soft); }
.detail-metric.green > strong { color: var(--green); }
.detail-metric.orange .metric-icon { color: var(--orange); background: var(--orange-soft); }
.detail-metric.orange > strong { color: var(--orange); }

.document-groups { display: grid; gap: 12px; }
.document-group { overflow: hidden; border: 1px solid var(--line); border-radius: 17px; background: #fff; }
.document-group summary { display: flex; align-items: center; gap: 13px; min-height: 64px; padding: 10px 18px; cursor: pointer; color: var(--navy); list-style: none; user-select: none; }
.document-group summary::-webkit-details-marker { display: none; }
.document-group summary:focus-visible { outline: 3px solid #a7c8f7; outline-offset: -3px; }
.group-icon { width: 42px; height: 42px; }
.group-icon svg { width: 22px; height: 22px; }
.document-group.green .group-icon { color: var(--green); background: var(--green-soft); }
.document-group summary strong { font-size: 1rem; }
.group-chevron { width: 10px; height: 10px; margin-left: auto; border-right: 2px solid var(--blue); border-bottom: 2px solid var(--blue); transform: rotate(45deg); transition: transform .16s ease; }
.document-group[open] .group-chevron { transform: rotate(225deg); }
.document-group-body { border-top: 1px solid var(--line); }
.document-row { display: grid; grid-template-columns: 112px minmax(0, 1fr) auto; gap: 18px; align-items: center; min-height: 66px; padding: 11px 20px 11px 73px; }
.document-row + .document-row { border-top: 1px solid #e8edf5; }
.document-row time { color: var(--blue); font-size: .78rem; font-weight: 800; }
.document-copy { min-width: 0; }
.document-copy strong { display: block; overflow: hidden; color: var(--navy); font-size: .82rem; text-overflow: ellipsis; white-space: nowrap; }
.document-copy.single-copy strong { overflow: visible; text-overflow: clip; white-space: normal; }
.document-copy .document-description { display: block; margin-top: 3px; color: var(--muted); font-size: .76rem; line-height: 1.35; white-space: normal; overflow-wrap: anywhere; }
.document-button { min-width: 104px; padding: 8px 12px; border: 1px solid #9ebbe7; border-radius: 9px; color: var(--blue); text-align: center; text-decoration: none; font-size: .73rem; font-weight: 800; }
.document-button:hover { border-color: var(--blue); background: #f2f7ff; }
.document-empty { margin: 0; padding: 18px 73px; color: var(--muted); font-size: .82rem; }

.site-footer { padding: 30px clamp(20px,5vw,76px); background: #052b66; color: #fff; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.site-footer div { display: grid; gap: 4px; }
.site-footer span { color: #bdd5f4; font-size: .8rem; }
.site-footer a { color: #fff; font-size: .8rem; font-weight: 700; }

@media (max-width: 980px) {
  .hero-inner, .detail-layout { grid-template-columns: 1fr; }
  .hero-note { max-width: 600px; }
  .summary-grid { grid-template-columns: repeat(3,1fr); }
  .petition-grid { grid-template-columns: repeat(2,1fr); }
  .petition-hero-card { grid-template-columns: auto minmax(0,1fr); }
  .petition-hero-status { grid-column: 2; align-items: flex-start; padding-top: 0; }
  .detail-metrics { grid-template-columns: repeat(2,1fr); }
}

@media (max-width: 700px) {
  .site-header { gap: 14px; margin-bottom: 26px; }
  .brand img { width: 42px; height: 40px; }
  .site-header nav { gap: 12px; flex-wrap: wrap; justify-content: flex-end; }
  .site-header nav a { font-size: .76rem; }
  .hero { padding-top: 38px; }
  .hero h1 { font-size: 2.55rem; }
  .summary-grid, .petition-grid { grid-template-columns: 1fr; }
  .summary-card.status-chart { flex-direction: column; align-items: center; gap: 20px; }
  .status-chart-copy { align-self: stretch; }
  .response-row { grid-template-columns: 1fr; gap: 6px; }
  .metric-row { grid-template-columns: 1fr; }
  .site-footer { align-items: flex-start; flex-direction: column; }
  .petition-detail { padding-top: 18px; }
  .petition-hero-card { grid-template-columns: 1fr; padding: 22px; }
  .petition-date-icon { width: 48px; height: 48px; }
  .petition-hero-copy h1 { font-size: 2rem; }
  .petition-hero-status { grid-column: 1; align-items: flex-start; }
  .detail-metrics { grid-template-columns: 1fr 1fr; gap: 9px; }
  .detail-metric { grid-template-columns: auto 1fr; padding: 14px; gap: 9px; }
  .detail-metric .metric-icon { width: 42px; height: 42px; }
  .detail-metric > strong { font-size: 1.55rem; }
  .detail-metric > span:last-child { grid-column: 2; font-size: .7rem; }
  .document-row { grid-template-columns: 80px minmax(0,1fr); gap: 10px; padding: 12px 15px; }
  .document-button { grid-column: 2; justify-self: start; min-width: 0; }
  .document-empty { padding: 17px; }
  .card-topline { align-items: flex-start; }
  .card-statuses { align-items: flex-end; }
}

@media (prefers-reduced-motion: no-preference) {
  .petition-card, .topic-chip { transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease; }
}

/* Página de tema: años a la izquierda y peticiones en la columna central. */
.topic-hero { background: linear-gradient(120deg, #073568, #155578); padding-bottom: 10px; }
.topic-heading { display: flex; align-items: flex-start; gap: 24px; }
.topic-heading .petition-date-icon { width: 76px; height: 76px; }
.topic-heading h1 { overflow-wrap: anywhere; }
.topic-heading p { margin-top: 10px; }
.topic-hero .detail-metrics { margin-top: 26px; }
.topic-page { padding-top: 22px; }
.topic-toolbar { display: flex; justify-content: flex-start; align-items: center; gap: 20px; flex-wrap: wrap; margin-bottom: 16px; }
.topic-order { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; color: var(--navy); font-size: .8rem; }
.topic-order select { max-width: 100%; border: 1px solid var(--line); border-radius: 9px; padding: 10px; background: #fff; color: var(--navy); }
.listing-result-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.listing-result-toolbar .result-line { margin-bottom: 0; }
.topic-year { display: grid; grid-template-columns: 92px minmax(0, 1fr); gap: 22px; position: relative; padding-bottom: 20px; }
.topic-year::before { content: ""; position: absolute; left: 83px; top: 16px; bottom: -16px; width: 2px; background: #dce6f6; }
.topic-year:last-child::before { bottom: 20px; }
.topic-year h2 { position: relative; margin: 0; padding-top: 2px; color: var(--navy); font-size: 1.65rem; letter-spacing: -.035em; }
.topic-year h2::after { content: ""; position: absolute; top: 11px; left: 79px; width: 10px; height: 10px; border-radius: 50%; background: var(--blue); box-shadow: 0 0 0 5px #e1ebff; }
.topic-year-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.topic-petition-card { min-width: 0; display: flex; flex-direction: column; padding: 16px; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.topic-petition-card:focus-within, .topic-petition-card:hover { border-color: #87a9d9; box-shadow: 0 6px 20px #082f730b; }
.topic-petition-card .card-topline { flex-wrap: wrap; gap: 6px; }
.topic-petition-card .card-topline time { padding: 0; font-size: .79rem; }
.document-status { padding: 3px 6px; border-radius: 5px; font-size: .65rem; white-space: nowrap; }
.document-status.answered { color: var(--green); background: var(--green-soft); }
.document-status.unanswered { color: #af3815; background: var(--orange-soft); }
.topic-petition-card h3 { margin: 10px 0 7px; font-size: .91rem; line-height: 1.35; color: var(--navy); overflow-wrap: anywhere; }
.topic-petition-card h3 a { text-decoration: none; }
.topic-petition-card h3 a:hover { text-decoration: underline; }
.topic-petition-card p { margin: 0 0 16px; color: #46536a; font-size: .79rem; line-height: 1.5; }
.topic-petition-card .card-meta { margin-top: auto; flex-wrap: wrap; gap: 12px; color: var(--navy); font-size: .72rem; }
.topic-petition-card .card-meta span { display: inline-flex; align-items: center; gap: 6px; }
.topic-petition-card .card-meta svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.7; }
.topic-page :focus-visible { outline: 3px solid #508ee2; outline-offset: 3px; }
@media (max-width: 1050px) { .topic-year-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 700px) {
  .topic-heading { gap: 12px; }
  .topic-heading .petition-date-icon { width: 44px; height: 44px; }
  .topic-heading h1 { font-size: 2rem; }
  .topic-year { grid-template-columns: 1fr; padding-left: 22px; gap: 14px; }
  .topic-year::before { left: 4px; }
  .topic-year h2::after { left: -22px; }
  .topic-year-cards { grid-template-columns: 1fr; }
  .topic-hero .detail-metric { grid-template-columns: 1fr; }
  .topic-hero .metric-icon { display: none; }
  .topic-hero .detail-metric > span:last-child { grid-column: 1; }
}

/* Temas navegables y palabras clave descriptivas: jerarquías separadas. */
.taxonomy-label { display: block; font-size: .68rem; font-weight: 750; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); }
.card-themes { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; min-width: 0; }
.card-themes .taxonomy-label { flex-basis: 100%; }
.card-actions .topic-chip { font-size: .74rem; padding: 6px 9px; background: var(--sky); white-space: normal; }
.card-actions > a { flex-shrink: 0; }
.petition-topics { margin-top: 24px; }
.petition-topics .hero-topics { margin-top: 8px; }
.petition-topics .topic-chip, .petition-keywords .topic-chip { background: var(--sky); border-color: #adc5e9; }
.petition-keywords { margin-top: 18px; padding-top: 15px; border-top: 1px solid var(--line); }
.keyword-list { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.keyword-tag { color: #53627b; background: #eef1f5; border-radius: 4px; padding: 5px 8px; font-size: .76rem; line-height: 1.4; }
.unassigned-topic { font-size: .78rem; color: var(--muted); }

.solution-badge small { display: block; margin-top: 4px; font-size: .9em; font-weight: 600; }
.solution-badge.unreviewed { color: #65728a; background: #f0f3f7; border-color: #d4deec; }
.topic-petition-card .solution-badge { padding: 5px 7px; font-size: .79rem; border: 0; border-radius: 6px; }

/* Etiquetas documentales: filtros del listado general. */
.listing-tags { margin-bottom: 26px; padding: 22px; border: 1px solid var(--line); border-radius: 16px; background: #fff; }
.listing-tags h2 { margin: 0; font-size: 1.2rem; color: var(--navy); }
.listing-tags > summary { display: flex; align-items: center; justify-content: space-between; gap: 16px; cursor: pointer; list-style: none; }
.listing-tags > summary::-webkit-details-marker { display: none; }
.listing-tags > summary:focus-visible { outline: 3px solid #a7c8f7; outline-offset: 6px; border-radius: 4px; }
.tags-chevron { width: 9px; height: 9px; margin-right: 3px; flex-shrink: 0; border-right: 2px solid var(--navy); border-bottom: 2px solid var(--navy); transform: rotate(45deg); }
.listing-tags[open] .tags-chevron { transform: rotate(225deg); }
.listing-tags > p { margin: 8px 0 20px; color: var(--muted); font-size: .82rem; line-height: 1.5; }
.tag-groups { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.tag-groups fieldset { min-width: 0; margin: 0; padding: 0; border: 0; }
.tag-groups legend { margin-bottom: 12px; padding: 0; font-size: .88rem; font-weight: 750; color: var(--navy); }
.tag-options { display: flex; flex-wrap: wrap; gap: 7px; }
.tag-filter { display: inline-flex; align-items: center; gap: 7px; padding: 7px 10px; border: 1px solid #d3dce8; border-radius: 6px; background: #f4f6f9; color: #46536a; font-size: .76rem; text-align: left; cursor: pointer; }
.tag-filter:hover { border-color: var(--blue); }
.tag-filter[aria-pressed="true"] { background: var(--navy); border-color: var(--navy); color: #fff; }
.tag-count { font-size: .7rem; opacity: .8; }
.tag-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; margin-top: 18px; font-size: .78rem; color: var(--muted); }
.tag-controls button { background: none; border: 0; text-decoration: underline; color: var(--blue); cursor: pointer; }
.tag-controls button:disabled { opacity: .45; cursor: default; }
.listing-tags :focus-visible { outline: 3px solid #508ee2; outline-offset: 3px; }
@media (max-width: 700px) { .tag-groups { grid-template-columns: 1fr; } .listing-tags { padding: 16px; } }

.active-keyword { color: var(--navy); font-size: .88rem; margin: 0 0 18px; }
.active-keyword a { margin-left: 12px; color: var(--blue); }

.petition-card h3 a { font: inherit; color: inherit; text-decoration: none; }

/* Identidad visual del barrio: acuarela y motivos de línea. */
.topic-chip svg { width: 21px; height: 21px; flex: 0 0 21px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.card-themes .topic-chip svg { width: 17px; height: 17px; flex-basis: 17px; }
.hero { background: linear-gradient(115deg, #073568, #155578 85%); color: var(--navy); }
.hero::before, .hero::after { display: none; }
.hero-inner { grid-template-columns: 1fr 1fr; gap: 32px; align-items: center; }
.hero .eyebrow { color: #54758a; }
.hero h1 { font-size: clamp(2.35rem, 4.8vw, 4.3rem); }
.hero .lead { color: #4b617a; }
.hero-note { padding: 0; border: 0; background: none; backdrop-filter: none; }
.hero-note strong { color: var(--navy); margin: 12px 0 7px; }
.hero-note span { color: #5c7183; }
.neighborhood-art { display: block; width: 100%; height: auto; border-radius: 14px; mix-blend-mode: multiply; }
.page-hero { position: relative; overflow: hidden; }
.page-hero::before { content: ""; pointer-events: none; position: absolute; width: min(58%, 850px); top: 0; right: -4%; bottom: 0; background: var(--header-art, url("assets/acuarela-parque-cesped.png")) var(--header-art-position, center right) / cover no-repeat; opacity: .13; mask-image: linear-gradient(90deg, transparent, #000 65%); }
.page-hero-inner { position: relative; }
.topic-heading .petition-date-icon { color: #255b90; background: #e1ebf6; }
.topic-heading .petition-date-icon svg { width: 39px; height: 39px; stroke-width: 1.5; }
.petition-hero-card { position: relative; background: linear-gradient(120deg, #073568, #155578); }
.site-footer { position: relative; overflow: hidden; }
.site-footer::before { content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .09; background: repeating-radial-gradient(ellipse at 100% 170%, transparent 0 24px, #cbe2eb 25px 26px, transparent 27px 48px); }
.site-footer > * { position: relative; }
@media (max-width: 980px) {
  .hero-inner { grid-template-columns: 1fr; gap: 26px; }
  .hero-note { max-width: 640px; }
}
@media (max-width: 700px) {
  .hero { padding-top: 30px; }
  .hero-note strong { margin-top: 10px; }
  .topic-heading .petition-date-icon svg { width: 27px; height: 27px; }
  .page-hero::before { width: 85%; opacity: .08; }
}

/* Acuarelas individuales a partir de las cuatro fotografías de referencia. */
.neighborhood-art { max-height: 320px; object-fit: contain; }
.topic-hero::before { display: block; }
.topic-intro { display: grid; grid-template-columns: minmax(0, 1fr) 310px; gap: 30px; align-items: center; }
.theme-art { display: block; width: 100%; height: 210px; object-fit: contain; mix-blend-mode: multiply; border-radius: 12px; }
@media (max-width: 980px) {
  .topic-intro { grid-template-columns: minmax(0, 1fr) 230px; gap: 18px; }
  .theme-art { height: 170px; }
}
@media (max-width: 700px) {
  .topic-intro { grid-template-columns: 1fr; }
  .theme-art { height: auto; max-height: 230px; }
  .neighborhood-art { max-height: 270px; }
}

/* Cabeceras marinas: texto claro sobre azul profundo. */
.hero, .hero h1, .page-hero h1, .petition-hero-copy h1 { color: #fff; }
.hero .eyebrow, .hero .lead, .hero-note span, .page-hero p, .breadcrumbs, .petition-hero-copy > p, .petition-hero-copy time { color: #d6e9f5; }
.hero-note strong { color: #fff; }
.petition-hero-card .taxonomy-label, .petition-hero-card .unassigned-topic { color: #d6e9f5; }
.petition-hero-card .petition-keywords { border-color: #ffffff38; }
.neighborhood-art, .theme-art { mix-blend-mode: normal; }

/* Alternativas visuales para comparar la integración de las acuarelas. */
.neighborhood-art, .theme-art {
  -webkit-mask-image: linear-gradient(to right, transparent, #000 14%, #000 86%, transparent), linear-gradient(to bottom, transparent, #000 14%, #000 85%, transparent);
  -webkit-mask-composite: source-in;
  mask-image: linear-gradient(to right, transparent, #000 14%, #000 86%, transparent), linear-gradient(to bottom, transparent, #000 14%, #000 85%, transparent);
  mask-composite: intersect;
  border-radius: 0;
}
.neighborhood-art { width: auto; max-width: 100%; margin-inline: auto; opacity: .92; }
.theme-art { width: auto; max-width: 100%; height: auto; max-height: 210px; justify-self: center; }
.art-feathered .theme-art { opacity: .76; }
.art-mist .theme-art { opacity: .40; filter: saturate(.65); }
.art-watermark { position: relative; display: block; min-height: 210px; padding-block: 25px; }
.art-watermark .topic-heading { position: relative; z-index: 1; max-width: 85%; }
.art-watermark .theme-art { position: absolute; pointer-events: none; right: 0; top: 0; height: 100%; width: auto; max-width: 62%; max-height: none; opacity: .19; filter: saturate(.45); }
@media (max-width: 980px) { .theme-art { max-height: 170px; } }
@media (max-width: 700px) {
  .theme-art { max-height: 210px; }
  .art-watermark { min-height: 220px; padding-block: 12px; }
  .art-watermark .topic-heading { max-width: 100%; }
  .art-watermark .theme-art { max-width: 100%; height: 100%; opacity: .14; }
}

/* Tratamiento elegido: fondo de cabecera como en Todas las reclamaciones. */
.topic-intro { display: block; }

/* Portada panorámica: acuarela integrada en toda la altura de cabecera. */
.hero { padding-top: 48px; padding-bottom: 88px; background: #073568; }
.hero::before {
  display: block; content: ""; pointer-events: none; position: absolute;
  inset: 0; width: 100%; height: 100%; border-radius: 0;
  background-image: linear-gradient(90deg, #073568 0%, #073568 40%, rgba(7,53,104,.92) 50%, rgba(7,53,104,.42) 72%, rgba(56,111,153,.12) 100%), url("assets/acuarela-parque-castillo.png");
  background-position: center, right 42%;
  background-size: 100% 100%, cover;
  background-repeat: no-repeat;
}
.hero-inner { display: block; }
.hero-inner > div { max-width: 660px; }
.hero h1 { font-size: clamp(2.35rem, 4.6vw, 4.1rem); }
.hero .lead { max-width: 600px; }
@media (max-width: 980px) {
  .hero-inner > div { max-width: 600px; }
  .hero::before { background-position: center, right center; background-size: 100% 100%, cover; }
}
@media (max-width: 700px) {
  .hero { padding-top: 32px; padding-bottom: 78px; }
  .hero::before { background: linear-gradient(90deg, rgba(7,53,104,.97), rgba(7,53,104,.77)), url("assets/acuarela-parque-castillo.png") 65% center / cover no-repeat; }
}

/* Una galería escondida para las acuarelas de las cabeceras. */
.watercolor-secret { display: inline-flex; align-items: center; justify-content: center; min-width: 44px; min-height: 44px; border-radius: 50%; opacity: .65; }
.watercolor-secret:hover, .watercolor-secret:focus-visible { opacity: 1; background: #ffffff18; }
.watercolor-secret:focus-visible, .watercolor-gallery :focus-visible, .art-viewer :focus-visible { outline: 3px solid #80b7ed; outline-offset: 4px; }
.gallery-intro { margin: 0 0 28px; color: #50647d; }
.gallery-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 26px; }
.gallery-card { margin: 0; background: #fffdf8; border: 1px solid #e5e4dd; border-radius: 16px; overflow: hidden; box-shadow: 0 8px 24px #13325208; }
.gallery-card > button { position: relative; display: block; width: 100%; padding: 14px; border: 0; background: transparent; cursor: zoom-in; }
.gallery-card img { display: block; width: 100%; height: 220px; object-fit: contain; }
.gallery-card figcaption { padding: 4px 20px 20px; }
.gallery-card h2 { margin: 0 0 6px; font-size: 1.05rem; }
.art-viewer-open { overflow: hidden; }
.art-viewer { width: min(1200px, 94vw); max-width: 94vw; max-height: 94dvh; padding: 16px; border: 0; border-radius: 16px; color: #082f73; background: #fffdf8; box-shadow: 0 24px 90px #0006; }
.art-viewer::backdrop { background: #031b38df; }
.art-toolbar, .art-controls { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.art-toolbar h2 { font-size: 1.15rem; margin: 0; }
.art-viewer button { min-height: 44px; padding: 8px 14px; border: 1px solid #d8e0e9; border-radius: 8px; color: #082f73; background: #fff; cursor: pointer; font: inherit; }
.art-close { flex-shrink: 0; }
.art-full { display: block; width: 100%; height: min(70dvh, 850px); object-fit: contain; margin: 10px 0; }
.art-count { white-space: nowrap; font-size: .85rem; }
@media (max-width: 980px) { .gallery-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 600px) {
  .gallery-grid { grid-template-columns: 1fr; gap: 20px; }
  .gallery-card img { height: 250px; }
  .art-viewer { padding: 10px; }
  .art-toolbar h2 { font-size: 1rem; }
  .art-viewer button { padding: 8px 10px; font-size: .85rem; }
  .art-full { height: 62dvh; }
}

/* Navegación integrada en las cabeceras azules. */
.hero, .page-hero { padding-top: 22px; }
.petition-hero-card .site-header { margin-bottom: 0; }

/* Logo, título y enlaces comparten una fila para reducir la altura. */
.site-header { margin-bottom: 18px; }
.site-header h1 { flex: 1; min-width: 0; max-width: none; margin: 0; font-size: clamp(2rem, 3.2vw, 3.1rem); line-height: 1.06; letter-spacing: -.045em; }
.site-header nav { flex-shrink: 0; gap: 22px; }
.hero .lead { margin-top: 0; }
@media (max-width: 980px) {
  .site-header { flex-wrap: wrap; gap: 12px; }
  .site-header h1 { flex-basis: calc(100% - 80px); }
  .site-header nav { margin-left: auto; gap: 18px; }
}
@media (max-width: 600px) {
  .site-header h1 { font-size: clamp(1.7rem, 7vw, 2.2rem); }
  .site-header nav { gap: 12px; }
}

/* Encuadre amplio original, con transición ligada al borde de la acuarela. */
@media (min-width: 701px) {
  .hero::before {
    inset: -27.3% 0 auto auto;
    width: auto;
    height: 165%;
    aspect-ratio: 1446 / 1087;
    background-image: linear-gradient(90deg, rgba(7,53,104,.35), rgba(56,111,153,.12)), url("assets/acuarela-parque-castillo.png");
    background-position: center;
    background-size: 100% 100%;
    mask-image: linear-gradient(90deg, transparent, #000 65%);
  }
}
@media (min-width: 701px) and (max-width: 980px) {
  .hero::before { top: -17.5%; height: 135%; }
}

/* Galería de imágenes sin textos visibles ni pie de página. */
.gallery-navigation { padding-bottom: 4px; }
.watercolor-gallery { padding-top: 30px; }
.art-toolbar .art-close { margin-left: auto; }

.topic-petition-card .topic-card-actions { justify-content: flex-end; margin-top: 14px; padding: 12px 0 0; background: transparent; }

/* La navegación y el texto del listado comparten el margen móvil de Inicio. */
@media (max-width: 700px) {
  .listing-header { padding-inline: clamp(20px, 6vw, 82px); }
  .listing-header .page-hero-inner { padding-inline: 0; }
}

.status-chart .status-chart-caption { margin-top: 18px; max-width: 340px; font-size: .8rem; line-height: 1.5; text-align: center; }
.listing-solutions { display: flex; flex-wrap: wrap; gap: 8px; margin: -6px 0 22px; }
.listing-solutions button { padding: 10px 14px; border: 1px solid #bfd0eb; border-radius: 999px; background: #fff; color: var(--navy); font: inherit; font-size: .82rem; font-weight: 700; cursor: pointer; }
.listing-solutions button[aria-pressed="true"] { border-color: var(--blue); background: var(--blue); color: #fff; }
.listing-solutions button:focus-visible { outline: 3px solid var(--blue); outline-offset: 3px; }

.scroll-journey { position: relative; }
.scroll-topic-header { padding: 18px 0 20px; }
.scroll-topic-header::before { width: 70%; opacity: .35; }
.scroll-topic-header h2, .scroll-gallery .page-hero h2 { margin: 8px 0 0; color: white; font-size: clamp(1.5rem, 3.3vw, 2.75rem); letter-spacing: -.035em; line-height: 1.12; }
.scroll-topic-top.site-header { margin-bottom: 0; flex-wrap: nowrap; display: flex; align-items: center; justify-content: space-between; gap: 16px; color: #d6e9f5; font-size: .8rem; }
.scroll-topic-top.site-header nav { background: transparent; padding-inline: 0; }
.scroll-topic-top.site-header nav a { font-size: .8rem; }
.scroll-topic-top nav a { color: white; font-weight: 700; }
.scroll-topic-top nav a:hover { border-color: transparent; }
.scroll-topic { border-bottom: 1px solid #dce6f6; }
.scroll-topic-content { padding-top: 32px; padding-bottom: 70px; min-height: 70vh; }
.scroll-topic .topic-year-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.scroll-topic .topic-petition-card { padding: 24px; }
.scroll-topic .topic-petition-card h3 { font-size: 1.1rem; }
.scroll-topic .topic-petition-card p { font-size: .92rem; }
.scroll-gallery { background: #f7f5ef; }
.scroll-gallery-header.page-hero { position: sticky; top: 0; z-index: 10; padding: 12px 0; box-shadow: 0 3px 10px #082f7318; }
.scroll-gallery-header .page-hero-inner { display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.scroll-gallery .scroll-gallery-header h2 { margin: 0; font-size: 1.15rem; font-weight: 750; line-height: 1.2; letter-spacing: normal; }
.scroll-gallery-header nav { flex-shrink: 0; }
.scroll-gallery-header nav a { display: inline-flex; align-items: center; min-height: 32px; color: white; font-size: .8rem; font-weight: 700; text-decoration: none; }
.scroll-gallery-header nav a:focus-visible { outline: 3px solid #f4c661; outline-offset: 3px; }
.scroll-gallery .watercolor-gallery { padding-top: 36px; padding-bottom: 70px; }
.watercolor-link { color: #386f99; }
@media (max-width: 700px) {
  .scroll-gallery-header.page-hero { padding: 8px 0; }
  .scroll-gallery-header .page-hero-inner { gap: 14px; }
  .scroll-gallery .scroll-gallery-header h2 { font-size: 1rem; }
  .scroll-topic-header { padding: 12px 0 14px; }
  .scroll-topic .topic-year-cards { grid-template-columns: 1fr; }
  .scroll-topic .topic-petition-card { padding: 18px; }
  .scroll-topic-content { padding-bottom: 40px; }
}

/* Un solo bloque compacto, con ambos recuentos en la misma línea. */
.scroll-topic-header h2 { font-size: clamp(2.6rem, 4vw, 3.25rem); }
.scroll-topic-metrics { display: flex; width: fit-content; max-width: 100%; align-items: center; gap: 20px; margin-top: 10px; padding: 9px 14px; border: 2px solid #d3ddeb; border-radius: 14px; background: #fff; color: var(--navy); }
.scroll-topic-metric { display: flex; align-items: baseline; gap: 6px; white-space: nowrap; }
.scroll-topic-metric strong { font-size: 1.6rem; font-weight: 800; line-height: 1; letter-spacing: -.04em; }
.scroll-topic-metric span { font-size: .85rem; font-weight: 750; line-height: 1.25; }
.scroll-topic-metric.pending strong { color: #cf4c24; }
@media (max-width: 700px) {
  .scroll-topic-header h2 { font-size: 2rem; min-height: 0; }
  .scroll-topic-metrics { gap: 12px; padding: 8px 10px; border-radius: 12px; }
  .scroll-topic-metric { gap: 5px; }
  .scroll-topic-metric strong { font-size: 1.35rem; }
  .scroll-topic-metric span { font-size: .72rem; }
}

/* Barra contextual: conserva azul y acuarela, sin repetir cifras ni progreso. */
.scroll-topic-sticky { position: sticky; top: 0; z-index: 10; height: 0; }
.scroll-topic-bar.page-hero { position: absolute; top: 0; width: 100%; padding: 12px 0; box-shadow: 0 3px 10px #082f7318; }
.scroll-topic-bar[hidden] { display: none; }
.scroll-topic-bar::before { width: 70%; opacity: .35; }
.scroll-topic-bar .page-hero-inner { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; }
.scroll-topic-bar-title { display: flex; align-items: center; min-height: 32px; color: white; font-size: 1.15rem; font-weight: 750; line-height: 1.2; }
.scroll-topic-bar nav { flex-shrink: 0; }
.scroll-topic-bar nav a { display: inline-flex; align-items: center; min-height: 32px; color: white; font-size: .8rem; font-weight: 700; text-decoration: none; }
.scroll-topic-bar nav a:focus-visible { outline: 3px solid #f4c661; outline-offset: 3px; }
@media (max-width: 700px) {
  .scroll-topic-bar.page-hero { padding: 8px 0; }
  .scroll-topic-bar .page-hero-inner { gap: 14px; }
  .scroll-topic-bar-title { font-size: 1rem; }
}

/* El enlace conserva su coordenada vertical incluso con títulos de dos líneas. */
.scroll-journey.has-pinned-home .scroll-topic-top nav a { visibility: hidden; }
.scroll-topic-bar { pointer-events: none; }
.scroll-topic-bar nav { pointer-events: auto; }
.scroll-topic-bar.is-over-header { background: transparent; border-bottom-color: transparent; box-shadow: none; }
.scroll-topic-bar.is-over-header::before { opacity: 0; }
.scroll-topic-bar.is-over-header .scroll-topic-bar-title { visibility: hidden; }
/* Reservar el lateral del enlace al pasar títulos y cifras por su altura. */
.scroll-topic-header h2 { max-width: calc(100% - 54px); }
.scroll-topic-header .scroll-topic-metrics { max-width: calc(100% - 54px); flex-wrap: wrap; }

.organisation-chart { margin-top: -48px; padding-top: 0; padding-bottom: 0; position: relative; z-index: 3; }
.organisation-chart + .summary-grid { margin-top: 24px; }
.organisation-chart-panel { padding: 26px; background: #fff; border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow); }
.organisation-chart h2 { margin: 0; color: var(--navy); font-size: 1.25rem; }
.organisation-chart p { margin: 8px 0 0; color: var(--muted); line-height: 1.45; }
.bar-chart-legend { display: flex; flex-wrap: wrap; gap: 10px 24px; list-style: none; padding: 0; margin: 18px 0 24px; }
.bar-chart-legend li { display: flex; gap: 8px; align-items: center; }
.bar-swatch { width: 12px; height: 12px; border-radius: 3px; }
.bar-swatch.instances, .organisation-bar.instances { background: #1559b7; }
.bar-swatch.responses, .organisation-bar.responses { background: #16805c; }
.organisation-bars { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 26px 40px; }
.organisation-group h3 { margin: 0 0 12px; color: var(--ink); font-size: 1rem; }
.organisation-bar-row { display: grid; grid-template-columns: 80px minmax(0,1fr) 32px; gap: 10px; align-items: center; margin: 8px 0; font-size: .85rem; }
.organisation-bar-track { background: #eef2f8; height: 20px; border-radius: 4px; overflow: hidden; }
.organisation-bar { height: 100%; border-radius: 4px; }
.organisation-bar-row strong { text-align: right; }
@media (max-width:700px) { .organisation-chart-panel { padding: 20px 16px; } .organisation-bars { grid-template-columns: 1fr; gap: 22px; } .organisation-bar-row { grid-template-columns: 70px minmax(0,1fr) 28px; gap: 8px; } }

.organisation-chart .organisation-chart-caption { margin: 22px 0 0; }

.hero .lead + .lead { margin-top: 32px; }


/* Resumen global y reparto anual en dos columnas equilibradas. */
.summary-card.status-chart { display: grid; grid-template-columns: minmax(240px, .8fr) minmax(0, 1.5fr); align-items: start; gap: 40px; padding: 30px; }
.status-chart-copy { display: flex; flex-direction: column; align-items: center; min-width: 0; }
.status-chart-copy .status-pie { width: 180px; margin-top: 20px; }
.status-chart-copy .status-chart-legend { margin-top: 20px; align-self: center; gap: 10px; }
.yearly-claims-chart { min-width: 0; }
.yearly-claims-chart h3 { margin: 0 0 16px; color: var(--navy); font-size: 1.25rem; text-align: center; }
.yearly-claims-chart svg { display: block; width: 100%; }
.yearly-claims-chart p { margin: 14px 0 0; font-size: .8rem; text-align: center; }
.yearly-grid { stroke: #dfe5ed; stroke-width: 1; }
.yearly-tick, .yearly-year { fill: #52647c; font-size: 12px; }
.yearly-total { fill: #12305b; font-size: 13px; font-weight: 700; }
.yearly-bar.solved { fill: #16734a; }
.yearly-bar.partial { fill: #edbd18; }
.yearly-bar.pending { fill: #c62828; }
.yearly-bar.instances { fill: #1559b7; }
.yearly-bar.responses { fill: #16805c; }
.yearly-documents-chart { margin-top: 20px; padding-top: 12px; border-top: 1px solid var(--line); }
.yearly-documents-chart svg { display: block; width: 100%; max-width: 500px; margin: 0 auto; }
.organisation-chart .yearly-documents-chart p { margin: 14px 0 0; }
@media (max-width: 700px) {
  .summary-card.status-chart { grid-template-columns: minmax(0, 1fr); gap: 34px; padding: 24px 18px; }
  .yearly-claims-chart { border-top: 1px solid var(--line); padding-top: 26px; }
}

/* Organismos y años en columnas; apilados en móvil. */
.document-chart-columns {display:grid;grid-template-columns:minmax(0, 1fr) minmax(0, 1.25fr);gap:40px;align-items:start;}
.organisation-column {min-width:0;}
.document-chart-columns .organisation-bars {grid-template-columns:1fr;gap:20px;}
.document-chart-columns .yearly-documents-chart {margin:0;padding:0;border:0;min-width:0;}
.document-chart-columns h2, .document-chart-columns h3#yearly-documents-title {margin:0;color:var(--navy);font-size:1.25rem;text-align:center;}
.document-chart-columns .bar-chart-legend {justify-content:center;}
.document-chart-columns .yearly-documents-chart svg {margin:58px auto 0;max-width:100%;}
.document-chart-columns .yearly-documents-chart p {text-align:center;font-size:.8rem;}
@media(max-width:800px){
 .document-chart-columns {grid-template-columns:minmax(0,1fr);gap:28px;}
 .document-chart-columns .yearly-documents-chart {border-top:1px solid var(--line);padding-top:26px;}
 .document-chart-columns .yearly-documents-chart svg {margin-top:20px;max-width:500px;}
}
