/* Veedurías — site styles.
 *
 * This file used to be three generations appended one after another, so about a
 * dozen selectors were defined twice and the later copy silently won. It is now
 * one pass: every selector appears once, in the section it belongs to. Tokens
 * live in main.css.
 */

/* ============================================================
   1. Shell
   ============================================================ */

.plenos-body { max-width: none; padding: 0; margin: 0; }

.plenos-nav {
    background: var(--primary);
    color: #fff;
    padding: 0 20px;
    position: sticky;
    top: 0;
    z-index: 100;
}
.plenos-nav-inner {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 12px;
    height: 50px;
}
.plenos-nav a { color: #fff; text-decoration: none; }
.plenos-nav a:hover { text-decoration: underline; }
.plenos-nav-logo { font-weight: bold; font-size: 18px; }
.plenos-nav-sep { opacity: 0.6; }
.plenos-nav-geo { font-weight: 600; }
.plenos-nav-links { display: flex; gap: 16px; margin-left: 24px; }
.plenos-nav-links a { font-size: 14px; opacity: 0.9; }
.plenos-nav-search { margin-left: auto; }
.plenos-nav-search input {
    padding: 4px 10px;
    border: none;
    border-radius: var(--radius);
    font-size: 14px;
    width: 180px;
}

.plenos-main { max-width: 1200px; margin: 0 auto; padding: 24px 20px 8px; }

.breadcrumb {
    max-width: 1200px;
    margin: 0 auto;
    padding: 12px 20px 0;
    font-size: 0.85rem;
    color: var(--accent);
}
.breadcrumb a { color: var(--accent); text-decoration: none; }
.breadcrumb a:hover { text-decoration: underline; }

.site-footer {
    border-top: 1px solid #ddd;
    margin-top: var(--space-6);
    padding: var(--space-5) 20px;
    background: var(--surface);
}
.site-footer-inner {
    max-width: 900px;
    margin: 0 auto;
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-5);
    justify-content: space-between;
    font-size: 0.9rem;
}
.site-footer-tagline { color: var(--accent); margin: 4px 0 0; }
.site-footer-links { display: flex; flex-direction: column; gap: 4px; }
.site-footer-meta { color: var(--accent); }
.site-footer-note {
    max-width: 900px;
    margin: var(--space-4) auto 0;
    font-size: 0.8rem;
    color: #777;
    border-top: 1px dotted #ddd;
    padding-top: var(--space-3);
}
.site-footer a { color: var(--accent); text-decoration: none; }
.site-footer a:hover { color: var(--primary); text-decoration: underline; }

.pagination {
    display: flex;
    gap: 16px;
    align-items: center;
    justify-content: center;
    padding: 20px 0;
    font-size: 0.9rem;
}
.pagination a { color: var(--primary); }

/* ============================================================
   2. Typography
   ============================================================ */

a {
    color: var(--primary);
    text-decoration-color: rgba(139, 0, 0, 0.35);
    text-underline-offset: 2px;
}
a:hover { text-decoration-color: currentColor; }

h1 { font-size: 1.9rem; line-height: 1.2; letter-spacing: -0.01em; margin: 0 0 12px; }
h2 { font-size: 1.25rem; line-height: 1.3; }
h3 { font-size: 1.05rem; line-height: 1.35; }

/* Prose must not sprawl the full 1200px on a wide screen. */
.page-intro, .profile-bio, .profile-note, .summary-body { max-width: var(--measure); }
.page-intro { color: var(--accent); }
.empty-note { color: #777; font-style: italic; }
.page-head { margin-bottom: 28px; }
.page-head h1 { margin-bottom: 6px; }

/* ============================================================
   3. Portal, session list, archive
   ============================================================ */

.portal { max-width: 900px; margin: 0 auto; padding: 0 20px 60px; }
.portal-hero { text-align: center; padding: 48px 0 32px; }
.portal-search {
    display: flex;
    gap: var(--space-2);
    justify-content: center;
    margin: var(--space-4) auto var(--space-2);
    max-width: 560px;
}
.portal-search .plenos-search-input { flex: 1; }
.portal-hint { color: var(--accent); font-size: 0.9rem; }
.portal-block { margin-top: 48px; }
.portal-block-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    border-bottom: 1px solid #ddd;
    padding-bottom: var(--space-2);
    margin-bottom: 16px;
}
.portal-block-head h2 { margin: 0; font-size: 1.15rem; }

.plenos-search-input {
    flex: 1;
    padding: 10px 14px;
    border: 2px solid #ddd;
    border-radius: var(--radius-lg);
    font-size: 16px;
}
.plenos-search-input:focus { border-color: var(--primary); outline: none; }
.plenos-search-btn {
    padding: 10px 20px;
    background: var(--primary);
    color: #fff;
    border: none;
    border-radius: var(--radius-lg);
    cursor: pointer;
    font-size: 16px;
}
.plenos-search-btn:hover { opacity: 0.9; }
.plenos-link { color: var(--primary); font-weight: 600; }

.meeting-list { list-style: none; padding: 0; }
.meeting-card { border-bottom: 1px solid var(--border-soft); }
.meeting-card a {
    display: flex;
    gap: 16px;
    padding: var(--space-3) 0;
    text-decoration: none;
    color: var(--text);
    align-items: baseline;
    transition: border-color .15s ease, box-shadow .15s ease;
}
.meeting-card a:hover { color: var(--primary); box-shadow: 0 2px 10px rgba(0,0,0,.06); }
.meeting-title { font-weight: 500; }
.meeting-meta { color: var(--muted); font-size: 0.9rem; }

/* Archive card: title, the reviewed session headline, and the size of the
   session at a glance. Separators drawn by CSS so missing values leave no
   stray dots. */
.meeting-card a { align-items: flex-start; }
.meeting-card-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.meeting-card-headline { font-size: 0.9rem; color: var(--accent); }
.meeting-card-meta { font-size: 0.82rem; }
.meeting-card-meta span + span::before { content: "· "; }

.archive-year { margin-top: 32px; }
.archive-year-heading {
    font-size: 1rem;
    color: var(--primary);
    border-bottom: 1px solid #ddd;
    padding-bottom: 6px;
    letter-spacing: 0.02em;
}

/* ============================================================
   4. Session header
   ============================================================ */

.meeting-header { margin-bottom: var(--space-4); }
.meeting-header h1 { margin-bottom: var(--space-2); }

.meeting-date {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--space-3);
    color: var(--muted);
    font-size: 0.9rem;
    margin: 0 0 var(--space-3);
}

.video-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.8rem;
    text-decoration: none;
    border: 1px solid var(--border);
    border-radius: var(--radius-pill);
    padding: 3px 12px;
    color: var(--primary);
    background: var(--surface);
}
.video-link::before { content: "\25B6"; font-size: 0.7em; }
.video-link:hover { border-color: var(--primary); }

/* The numbers used to be buried mid-sentence in the meta line. */
.meeting-stats {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-5);
    margin: 0;
    padding: var(--space-4) 0;
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
}
.meeting-stats dd { margin: 0; }
/* Profile stats put the value first in the markup; a <dl> cannot, so flip it here
   rather than give the two pages different classes. */
.meeting-stats .stat-label { order: -1; }
.meeting-stats .stat-note { order: 1; }

.stat { display: flex; flex-direction: column; }
.stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);
    font-variant-numeric: tabular-nums;
    line-height: 1.15;
}
.stat-label { font-size: 0.75rem; color: var(--accent); }
.meeting-stats .stat-label {
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--muted-soft);
    font-weight: 600;
}
.stat-note { display: flex; gap: var(--space-2); margin: 4px 0 0; font-size: 0.72rem; }
.stat-split--yes { color: var(--ok-fg); }
.stat-split--no { color: var(--no-fg); }

.meeting-topics { margin-top: var(--space-3); }

.meeting-clock-note {
    font-size: 0.8rem;
    color: var(--accent);
    font-style: italic;
    margin: var(--space-3) 0 0;
}

.agenda-flags {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    flex-wrap: wrap;
    margin: 0 0 var(--space-3);
}

/* ============================================================
   5. Summary and decision ledger
   ============================================================ */

.summary-panel {
    /* The panel sits above the grid, so left unbounded it ran the full 1200px and
       left the capped prose inside it stranded in a field of white. */
    max-width: 940px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-left: 3px solid var(--primary);
    padding: var(--space-4) var(--space-5);
    margin: var(--space-4) 0 var(--space-5);
    border-radius: var(--radius);
}
.summary-heading {
    margin: 0 0 var(--space-3);
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--primary);
}

/* The lead had no rule at all and rendered as plain bold body text. */
.summary-headline {
    font-family: var(--font-serif);
    font-size: 1.45rem;
    font-weight: 400;
    line-height: 1.3;
    max-width: var(--measure-deck);
    margin: 0 0 var(--space-3);
}
.summary-body {
    font-family: var(--font-serif);
    font-size: 1.02rem;
    line-height: 1.6;
    margin: 0 0 var(--space-4);
}

/* An item summary sits inside a section that already has a heading, so it reads
   as subordinate rather than competing with the session lead. */
.summary--compact .summary-headline {
    font-family: var(--font-sans);
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.4;
    max-width: var(--measure);
    margin: 0 0 var(--space-2);
}
.summary--compact .summary-body { font-size: 0.96rem; margin-bottom: var(--space-3); }

/* A ledger, not a paragraph list. Eleven bullets of 2–4 sentences each, set full
   width, was the wall of text: the outcome now leads and the text is capped. */
.decisions {
    list-style: none;
    margin: 0;
    padding: 0;
    border-top: 1px solid var(--border-soft);
}
.decision {
    display: grid;
    grid-template-columns: 8.5rem minmax(0, 1fr);
    gap: var(--space-3);
    align-items: start;
    padding: var(--space-3) 0;
    border-bottom: 1px solid var(--border-hair);
}

.decision-outcome {
    justify-self: start;
    white-space: nowrap;
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding: 3px 10px;
    border-radius: var(--radius-pill);
    background: var(--neutral-bg);
    color: var(--neutral-fg);
}
.decision--aprobada .decision-outcome,
.decision--unanimidad .decision-outcome { background: var(--ok-bg); color: var(--ok-fg); }
.decision--rechazada .decision-outcome { background: var(--no-bg); color: var(--no-fg); }
.decision--parcial .decision-outcome { background: var(--warn-bg); color: var(--warn-fg); }

.decision-body { min-width: 0; }
.decision-label { margin: 0 0 2px; font-weight: 600; font-size: 0.95rem; }
.decision-text {
    margin: 0;
    max-width: var(--measure-narrow);
    font-family: var(--font-serif);
    line-height: 1.55;
    color: #222;
}
/* A name in the prose links to a search for it, not to a profile: the same
   half-written surname can belong to two councillors, and most people named in
   a debate never spoke and have no page. Underline on hover only — inside a
   serif paragraph a permanently underlined name every other line reads as
   clutter, and the reader is here for the sentence, not the links. */
.name-link {
    color: inherit;
    text-decoration: none;
    border-bottom: 1px solid rgba(0, 0, 0, 0.22);
}
.name-link:hover,
.name-link:focus {
    color: var(--accent);
    border-bottom-color: currentColor;
}

.decision-links {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--space-2);
    margin-top: var(--space-2);
    font-size: 0.8rem;
}
.decision-link {
    text-decoration: none;
    border: 1px solid var(--border);
    border-radius: var(--radius-pill);
    padding: 2px 10px;
    color: var(--accent);
}
.decision-link:hover { border-color: var(--primary); color: var(--primary); }

.decisions--compact .decision { grid-template-columns: 7rem minmax(0, 1fr); padding: var(--space-2) 0; }
.decisions--compact .decision-text { font-size: 0.93rem; }

/* A bullet with no outcome badge has nothing to put in the first column, so the
   body would land in it and render as a 13-character-wide sliver. Declared last
   and doubly-scoped so it beats the .decisions--compact rules above. */
.decisions .decision--bare,
.decisions--compact .decision--bare { grid-template-columns: minmax(0, 1fr); }
.decisions .decision--bare .decision-text,
.decisions--compact .decision--bare .decision-text { max-width: var(--measure); }

.summary-evidence { font-size: 0.85rem; }
.summary-evidence summary { cursor: pointer; color: var(--primary); }
.summary-evidence .turn-card { margin-top: var(--space-2); }
.summary-meta { margin: var(--space-3) 0 0; font-size: 0.75rem; color: var(--muted-soft); }

/* ============================================================
   6. Session grid and agenda rail
   ============================================================ */

/* Votes moved inline under their agenda item, so the old 250px/1fr/250px grid
   left a dead gutter on every session page. */
.meeting-grid {
    display: grid;
    grid-template-columns: 260px minmax(0, 1fr);
    gap: 28px;
    align-items: start;
}
.transcript-panel { min-width: 0; }

.agenda-sidebar {
    position: sticky;
    top: 66px;
    max-height: calc(100vh - 86px);
    overflow-y: auto;
    font-size: 0.85rem;
    padding-right: 4px;
}
/* No `.agenda-sidebar h2` rule: it used to out-specify .sidebar-heading and the
   headings rendered at 15px in --primary instead of the small caps intended. */
.sidebar-heading {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--muted);
    margin: var(--space-4) 0 var(--space-2);
}
.sidebar-heading:first-child { margin-top: 0; }

.agenda-phase {
    margin: var(--space-3) 0 var(--space-1);
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--muted-soft);
}

.agenda-nav { list-style: none; padding: 0; margin: 0; }
.agenda-nav-children { list-style: none; padding-left: 14px; margin: 2px 0 var(--space-2); }
.agenda-nav-item > a {
    display: grid;
    grid-template-columns: 2.2em minmax(0, 1fr);
    gap: 6px;
    align-items: baseline;
    padding: 5px 7px;
    border-left: 2px solid transparent;
    border-radius: 2px;
    line-height: 1.35;
    color: var(--text);
    text-decoration: none;
}
.agenda-nav-item > a:hover { background: var(--border-hair); }
.agenda-nav-item.active > a { border-left-color: var(--primary); background: #f4ecec; font-weight: 600; }
.agenda-nav-title { min-width: 0; }
.agenda-nav-count {
    margin: 0 0 var(--space-1) 3.1em;
    font-size: 0.72rem;
    color: var(--muted-soft);
    font-variant-numeric: tabular-nums;
}
/* The word, not the dot, is what a screen reader gets and what a reader reads. */
.agenda-nav-outcome { font-weight: 600; }
.agenda-nav-outcome--aprobada, .agenda-nav-outcome--unanimidad { color: var(--ok-fg); }
.agenda-nav-outcome--rechazada { color: var(--no-fg); }
.agenda-nav-outcome--parcial, .agenda-nav-outcome--empate { color: var(--warn-fg); }
.agenda-nav-outcome--sin_votacion { color: var(--muted-soft); font-weight: 400; }
.agenda-nav-outcome--unknown { color: var(--warn-fg); font-weight: 400; }

.agenda-num {
    display: inline-block;
    min-width: 2.2em;
    font-variant-numeric: tabular-nums;
    color: var(--primary);
    font-weight: 700;
}


.timeline-list { list-style: none; padding: 0; }
.timeline-block { padding: 4px 8px; font-size: 0.75rem; color: var(--muted); }
/* Template emits `timeline-recess`, so the old `.timeline-block--recess` never matched. */
.timeline-recess { font-style: italic; }

.sidebar-toggle {
    display: none;
    background: none;
    border: 1px solid #ddd;
    border-radius: var(--radius);
    padding: 6px 12px;
    cursor: pointer;
    font-family: inherit;
    font-size: 0.82rem;
    margin-bottom: var(--space-2);
}

/* ============================================================
   7. Agenda sections
   ============================================================ */

.agenda-section {
    scroll-margin-top: 70px;
    padding: var(--space-4) 0;
    border-top: 1px solid var(--border);
}
.agenda-section--child {
    border-top: 1px dashed #e0e0e0;
    margin-left: 16px;
    padding-left: 16px;
}
.agenda-section--orphan { opacity: 0.85; }

.agenda-section-head {
    display: flex;
    align-items: baseline;
    gap: var(--space-2);
    flex-wrap: wrap;
}
.agenda-section-title {
    margin: 0;
    font-size: 1.12rem;
    line-height: 1.35;
    flex: 1 1 24ch;
}
.agenda-section-title a { color: var(--text); text-decoration: none; }
.agenda-section-title a:hover { text-decoration: underline; }

.agenda-section-meta {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    flex-wrap: wrap;
    font-size: 0.8rem;
    color: var(--accent);
    margin: var(--space-2) 0 var(--space-3);
}
.agenda-section-cite { margin-left: auto; }
.agenda-note { font-size: 0.85rem; color: #777; font-style: italic; }

/* Minutes approvals and acknowledgements collapse to a line. Their weight on the
   page should match their weight in the session, not the length of their debate. */
.agenda-section--minor { padding: var(--space-3) 0; }
.agenda-section--minor .agenda-section-title { font-size: 0.98rem; font-weight: 600; }
.agenda-section--minor .agenda-section-meta { margin: 4px 0 0; }
.agenda-section--minor .agenda-detail { margin-top: var(--space-2); }
.agenda-section--minor .debate-summary { padding: 3px 11px; font-size: 0.75rem; }
.agenda-detail-body { padding-top: var(--space-3); }

.agenda-children, .agenda-votes, .agenda-debate { margin-top: var(--space-5); }

/* ============================================================
   8. Debate disclosure and transcript
   ============================================================ */

.transcript-controls { display: flex; justify-content: flex-end; margin: 0 0 var(--space-2); }

.debate { margin-top: var(--space-3); }
.debate-summary,
.debate-toggle-all {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    padding: 6px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius-pill);
    background: var(--surface);
    color: var(--accent);
    font-family: inherit;
    font-size: 0.8rem;
    cursor: pointer;
    list-style: none;
    user-select: none;
}
.debate-summary::-webkit-details-marker { display: none; }
.debate-summary::before { content: "\25B8"; font-size: 0.75em; }
.debate[open] > .debate-summary::before { content: "\25BE"; }
.debate-summary:hover,
.debate-toggle-all:hover { border-color: var(--primary); color: var(--primary); }
.debate[open] > .debate-summary { margin-bottom: var(--space-3); }

/* Turns read as a transcript, not as 298 stacked boxes. The card chrome added
   visual noise per turn without adding information. */
.turns-list { display: flex; flex-direction: column; }
.turn-card {
    margin: 0;
    padding: var(--space-3) 0 var(--space-3) var(--space-3);
    background: none;
    border: 0;
    border-left: 2px solid var(--speaker-color, var(--border));
    border-radius: 0;
    scroll-margin-top: 70px;
}
.turn-card + .turn-card { border-top: 1px solid var(--border-hair); }
.turn-head {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    flex-wrap: wrap;
    margin-bottom: 5px;
}
.turn-text {
    margin: 0;
    max-width: var(--measure);
    font-family: var(--font-serif);
    line-height: 1.65;
}
.turn-card:target { background: #fffbe6; border-left-color: var(--primary); }
.turn-card--resolved { outline: 2px solid var(--primary); outline-offset: 3px; }

.speaker-badge { font-weight: 600; font-size: 0.8rem; color: var(--speaker-color, #333); }
.speaker-badge .speaker-group { font-weight: normal; opacity: 0.7; }
.speaker-badge a { text-decoration: none; color: inherit; }
.speaker-badge a:hover { text-decoration: underline; }
.speaker-unknown { color: var(--muted-soft); font-variant: small-caps; }

.turn-time { font-size: 0.72rem; color: #999; font-family: monospace; }
.turn-context { font-size: 0.78rem; color: var(--accent); }

.turn-cite {
    background: none;
    border: 1px solid #d5d5d5;
    border-radius: var(--radius-pill);
    color: var(--accent);
    font-family: inherit;
    font-size: 0.72rem;
    padding: 2px 8px;
    cursor: pointer;
}
.turn-cite:hover { border-color: var(--primary); color: var(--primary); }
.turn-cite.is-copied { border-color: #2e7d32; color: #2e7d32; }
/* One "Citar" per turn, times 298, is chrome. It appears on approach instead. */
.turn-card .turn-cite { opacity: 0; transition: opacity .12s ease; }
.turn-card:hover .turn-cite,
.turn-card:focus-within .turn-cite { opacity: 1; }
@media (hover: none) {
    .turn-card .turn-cite { opacity: 1; }
}

/* ============================================================
   9. Outcomes, votes, chips
   ============================================================ */

.outcome {
    display: inline-block;
    white-space: nowrap;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 3px 10px;
    border-radius: var(--radius-pill);
    background: var(--neutral-bg);
    color: var(--neutral-fg);
}
.outcome--aprobada, .outcome--unanimidad { background: var(--ok-bg); color: var(--ok-fg); }
.outcome--rechazada { background: var(--no-bg); color: var(--no-fg); }
.outcome--parcial, .outcome--empate { background: var(--warn-bg); color: var(--warn-fg); }
/* "Nothing was voted" is a fact worth stating but not worth shouting: it is true
   of most of an agenda. "The result is not on record" is a gap in the data and
   is marked as one. The two must not look alike. */
.outcome--sin_votacion {
    background: none;
    color: var(--muted-soft);
    border: 1px solid var(--border);
    font-weight: 600;
}
.outcome--unknown {
    background: none;
    color: var(--warn-fg);
    border: 1px dashed var(--warn-line);
}

.vote-card {
    padding: var(--space-3);
    border-radius: var(--radius-lg);
    margin-bottom: var(--space-2);
    border: 1px solid var(--border-soft);
}
.vote-approved { background: var(--ok-bg); border-color: var(--ok-line); }
.vote-rejected { background: var(--no-bg); border-color: var(--no-line); }
.vote-tie { background: var(--warn-bg); border-color: var(--warn-line); }
.vote-unknown { background: #f5f5f5; border-color: var(--neutral-line); }

.vote-head { display: flex; align-items: baseline; gap: var(--space-2); flex-wrap: wrap; }
.vote-result { font-weight: bold; font-size: 0.9rem; }
.vote-subpoint { font-size: 0.75rem; color: var(--muted); }
.vote-time { font-size: 0.72rem; font-family: monospace; color: var(--muted); }
.vote-notes { margin-top: 4px; }
.vote-note {
    display: inline-block;
    background: rgba(0,0,0,0.06);
    border-radius: 3px;
    padding: 1px 6px;
    margin-right: 4px;
    font-size: 0.75rem;
}
.vote-tally { display: flex; gap: var(--space-2); align-items: center; font-size: 0.8rem; margin-top: 6px; }
.vote-groups { display: flex; flex-wrap: wrap; gap: 5px; min-width: 0; }
/* Only shown when groups_text could not be resolved to real groups. */
.vote-groups-raw { color: var(--muted); font-style: italic; }
.vote-nobreakdown { margin: 6px 0 0; font-size: 0.78rem; color: var(--muted); font-style: italic; }
.vote-option { font-size: 0.75rem; border-radius: 3px; padding: 1px 7px; font-weight: 600; }
.vote-option--favor { background: var(--ok-bg); color: var(--ok-fg); }
.vote-option--contra { background: var(--no-bg); color: var(--no-fg); }
.vote-option--abstencion { background: var(--neutral-bg); color: var(--neutral-fg); }
/* No color here: a.vote-option would out-rank the --favor/--contra modifiers
   and flatten the chips' semantic coloring to body text. */
a.vote-option { text-decoration: none; }
a.vote-option:hover { text-decoration: underline; }
.vote-pill { font-size: 0.72rem; border-radius: var(--radius-pill); padding: 1px 9px; }
.vote-evidence { margin-top: var(--space-2); font-size: 0.85rem; }
.vote-evidence summary { cursor: pointer; color: var(--accent); }
.vote-raw { font-family: var(--font-serif); color: #555; margin: 6px 0 0; }
.vote-confidence { font-size: 0.75rem; color: var(--muted-soft); margin: 6px 0 0; }

.vote-record { list-style: none; padding: 0; }
.vote-record-row {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
    padding: var(--space-2) 0;
    border-bottom: 1px solid var(--border-soft);
    font-size: 0.88rem;
}

.agenda-type {
    display: inline-block;
    font-size: 0.62rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 2px 7px;
    border-radius: var(--radius-pill);
    background: var(--neutral-bg);
    color: var(--neutral-fg);
}
.agenda-type--punto { background: #e3f2fd; color: #1565c0; }
.agenda-type--proposicion { background: #fce4ec; color: #c62828; }
.agenda-type--preguntas, .agenda-type--pregunta { background: var(--warn-bg); color: var(--warn-fg); }
.agenda-type--ruegos, .agenda-type--ruego { background: var(--ok-bg); color: #2e7d32; }

.topic-cloud { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: var(--space-2); }
.topic-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #eef1f5;
    color: #2a3a4a;
    border-radius: var(--radius-pill);
    padding: 3px 10px;
    font-size: 0.78rem;
    text-decoration: none;
}
.topic-chip:hover { background: #dde4ec; }
.topic-cloud--large .topic-chip { font-size: 0.95rem; padding: 6px 14px; }
.topic-count { background: rgba(0,0,0,0.08); border-radius: 8px; padding: 0 6px; font-size: 0.75em; }

/* An inline background on a flex child used to stretch and read as a broken
   progress bar, hence the explicit width and alignment. */
.group-tag {
    display: inline-flex;
    align-items: center;
    align-self: flex-start;
    width: auto;
    max-width: 100%;
    background: var(--tag-bg, #666);
    color: var(--tag-fg, #fff);
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    line-height: 1.5;
    padding: 2px 9px;
    border-radius: var(--radius-pill);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.group-tag--muted { background: #e8e8e8; color: #444; }

.role-tag {
    background: var(--border-soft);
    color: #444;
    border-radius: var(--radius-pill);
    padding: 2px 9px;
    font-size: 0.72rem;
    font-weight: 600;
}

/* ============================================================
   10. Topic and agenda result lists
   ============================================================ */

.agenda-result-list { list-style: none; padding: 0; }
.agenda-result { border-bottom: 1px solid #e6e6e6; padding: var(--space-3) 0; }
.agenda-result-title { font-size: 1rem; color: var(--text); text-decoration: none; display: block; }
.agenda-result-title:hover { text-decoration: underline; }
.agenda-result-meta {
    margin-top: 6px;
    font-size: 0.82rem;
    color: var(--accent);
    display: flex;
    gap: var(--space-2);
    flex-wrap: wrap;
    align-items: center;
}

/* ============================================================
   11. People
   ============================================================ */

.person-grid {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: var(--space-3);
    align-items: stretch;
}
.person-card { display: flex; }
.person-card a {
    display: grid;
    grid-template-columns: auto 1fr;
    grid-template-areas: "avatar body" "count count";
    align-items: center;
    gap: 6px 12px;
    width: 100%;
    padding: 16px;
    background: var(--surface);
    border: 1px solid #e4e4e4;
    border-radius: var(--radius-lg);
    text-decoration: none;
    color: var(--text);
    transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease;
}
.person-card a:hover {
    border-color: var(--primary);
    box-shadow: 0 2px 10px rgba(0,0,0,.07);
    transform: translateY(-1px);
}

.person-avatar {
    grid-area: avatar;
    width: 44px; height: 44px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    background: var(--avatar-bg, #8B0000);
    color: var(--avatar-fg, #fff);
    font-weight: 700;
    font-size: 0.95rem;
    letter-spacing: 0.02em;
    flex: 0 0 auto;
    overflow: hidden;
}
.person-avatar img { width: 100%; height: 100%; object-fit: cover; }

.person-body { grid-area: body; display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.person-name {
    font-weight: 600;
    line-height: 1.25;
    /* Names wrap rather than truncate — a half-name is worse than two lines. */
    overflow-wrap: anywhere;
}
.person-count {
    grid-area: count;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid var(--border-hair);
    font-size: 0.78rem;
    color: var(--accent);
}
.person-count strong { color: var(--text); font-variant-numeric: tabular-nums; }

.unidentified { margin-top: 48px; border-top: 1px solid var(--border); padding-top: var(--space-4); }
.unidentified h2 { font-size: 1.05rem; margin-bottom: 6px; }
.unidentified-list {
    list-style: none; padding: 0; margin: 16px 0 0;
    display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: var(--space-2);
}
.unidentified-list li {
    display: flex; justify-content: space-between; align-items: baseline; gap: 10px;
    padding: var(--space-2) 12px; background: var(--surface-sunken);
    border-radius: var(--radius); font-size: 0.82rem;
}
.unidentified-count { color: var(--accent); font-variant-numeric: tabular-nums; }

.profile-header {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
    padding: 22px;
    background: var(--surface);
    border: 1px solid #e4e4e4;
    border-left: 4px solid var(--accent, var(--primary));
    border-radius: var(--radius-lg);
}
.profile-avatar {
    width: 84px; height: 84px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    background: var(--avatar-bg, #8B0000);
    color: var(--avatar-fg, #fff);
    font-weight: 700; font-size: 1.7rem;
    flex: 0 0 auto; overflow: hidden;
}
.profile-avatar img { width: 100%; height: 100%; object-fit: cover; }
.profile-id h1 { margin: 0 0 6px; }
.profile-role { display: flex; gap: var(--space-2); align-items: center; flex-wrap: wrap; margin: 0; color: var(--accent); }
.profile-term { font-size: 0.85rem; color: var(--accent); }
.profile-bio { font-family: var(--font-serif); }
.profile-note { font-size: 0.85rem; color: #777; }
.profile-stats {
    display: flex;
    gap: 28px;
    flex-wrap: wrap;
    margin: var(--space-4) 0;
    padding: 18px 0;
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
}
.profile-topics, .profile-votes, .profile-meeting { margin-top: 32px; }

/* ============================================================
   12. Search
   ============================================================ */

.search-form { display: flex; flex-wrap: wrap; gap: var(--space-2); margin: 16px 0 var(--space-4); }
.search-form select,
.search-form input[type="date"] {
    padding: 7px 9px;
    border: 1px solid #ccc;
    border-radius: 3px;
    font-family: inherit;
    background: var(--surface);
}
.search-count { color: var(--accent); font-size: 0.9rem; }
.search-results { list-style: none; padding: 0; margin: 0; }
.search-result { padding: 16px 0; border-bottom: 1px solid var(--border-soft); }
.search-result-meta { font-size: 0.82rem; color: var(--muted); }
.search-result-meta a { color: var(--primary); font-weight: 500; }
.search-result-text {
    font-family: var(--font-serif);
    line-height: 1.6;
    margin-top: 6px;
    max-width: var(--measure);
}
.search-result-text mark { background: #fff2a8; padding: 0 2px; border-radius: 2px; }

/* ============================================================
   13. Errors
   ============================================================ */

.error-page { max-width: 640px; margin: 60px auto; text-align: center; }
.error-links { list-style: none; padding: 0; display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; }

/* ============================================================
   14. Responsive
   ============================================================ */

/* The grid used to collapse at 900px while the sidebar unstuck at 768px, so
   769–900px got a stacked, sticky, height-clipped rail. One breakpoint now. */
@media (max-width: 900px) {
    .meeting-grid { grid-template-columns: 1fr; }

    .agenda-sidebar {
        position: static;
        max-height: none;
        overflow-y: visible;
        border-bottom: 1px solid var(--border-soft);
        padding-bottom: 16px;
        margin-bottom: 16px;
    }
    /* The collapse used to target `.agenda-list`, a class the template stopped
       emitting, so the toggle did nothing. */
    .agenda-sidebar.collapsed .agenda-nav,
    .agenda-sidebar.collapsed .agenda-phase,
    .agenda-sidebar.collapsed .timeline-list,
    .agenda-sidebar.collapsed .sidebar-heading { display: none; }

    .sidebar-toggle { display: block; }
}

@media (max-width: 768px) {
    .plenos-nav-inner { flex-wrap: wrap; height: auto; padding: var(--space-2) 0; }
    .plenos-nav-search { width: 100%; }
    .plenos-nav-search input { width: 100%; }

    .meeting-stats { gap: var(--space-4); }
    .profile-stats { gap: 18px; }
    .site-footer-inner { flex-direction: column; gap: 20px; }
    .agenda-section--child { margin-left: 6px; padding-left: 10px; }
}

@media (max-width: 640px) {
    /* The outcome column costs more than it earns once the text is one column. */
    .decision, .decisions--compact .decision { grid-template-columns: minmax(0, 1fr); gap: var(--space-2); }
    .summary-panel { padding: var(--space-3) var(--space-3); }
    .summary-headline { font-size: 1.25rem; }
    .transcript-controls { justify-content: flex-start; }
}

@media (max-width: 560px) {
    .person-grid { grid-template-columns: 1fr; }
    .profile-header { flex-direction: row; padding: 16px; gap: var(--space-3); }
    .profile-avatar { width: 60px; height: 60px; font-size: 1.2rem; }
}

/* --- Plain titles, facts and typed summary sections ------------------- */

/* The municipal wording stays on the page under the readable title — never
   replaced, only led. */
.agenda-official-title {
    margin: 2px 0 0;
    font-size: 0.8rem;
    color: var(--muted);
    max-width: var(--measure);
}

.summary-section {
    margin: var(--space-4) 0 var(--space-2);
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: var(--muted);
}
.summary-section:first-of-type { margin-top: var(--space-3); }

/* The figures a session turns on, each one openable to the words behind it. */
.facts {
    list-style: none;
    margin: 0 0 var(--space-4);
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2) var(--space-5);
}
.fact { display: flex; flex-direction: column; min-width: 0; }
.fact-value {
    font-size: 1.35rem;
    font-weight: 700;
    line-height: 1.1;
    color: var(--primary);
    font-variant-numeric: tabular-nums;
}
.fact-label { font-size: 0.75rem; color: var(--accent); max-width: 22ch; }
.fact-source { font-size: 0.7rem; color: var(--muted); font-style: italic; max-width: 26ch; }
.fact-evidence { margin-top: 2px; font-size: 0.72rem; }
.fact-evidence summary { color: var(--muted-soft); }
.fact-evidence[open] { min-width: min(100%, 46ch); }

@media (max-width: 640px) {
    .facts { gap: var(--space-3) var(--space-4); }
    .fact-value { font-size: 1.15rem; }
}
.facts-more { margin: 0 0 var(--space-4); font-size: 0.78rem; }
.facts-more > summary { cursor: pointer; color: var(--accent); }
.facts-more .facts { margin-top: var(--space-3); }

/* --- Item pager, agenda filters, clamped interventions ----------------- */

.item-pager {
    display: flex;
    justify-content: space-between;
    gap: var(--space-3);
    margin-top: var(--space-5);
    padding-top: var(--space-4);
    border-top: 1px solid var(--border);
}
.item-pager-link {
    display: flex;
    flex-direction: column;
    gap: 2px;
    max-width: 44%;
    text-decoration: none;
    color: var(--text);
}
.item-pager-link--next { margin-left: auto; text-align: right; }
.item-pager-label { font-size: 0.75rem; font-weight: 700; color: var(--primary); }
.item-pager-title { font-size: 0.85rem; line-height: 1.35; }
.item-pager-link:hover .item-pager-title { text-decoration: underline; }

.transcript-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--space-2);
    margin: 0 0 var(--space-2);
}
.agenda-filters { display: flex; flex-wrap: wrap; gap: 6px; }
.agenda-filter {
    background: none;
    border: 1px solid var(--border);
    border-radius: var(--radius-pill);
    padding: 4px 12px;
    font-family: inherit;
    font-size: 0.78rem;
    color: var(--accent);
    cursor: pointer;
}
.agenda-filter:hover { border-color: var(--primary); color: var(--primary); }
.agenda-filter.is-active {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}

.turn-text--clamped {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 8;
    overflow: hidden;
}
.turn-more {
    display: block;
    margin-top: 6px;
    background: none;
    border: none;
    padding: 0;
    font-family: inherit;
    font-size: 0.8rem;
    color: var(--primary);
    cursor: pointer;
}
.turn-more:hover { text-decoration: underline; }

@media (max-width: 640px) {
    .item-pager { flex-direction: column; }
    .item-pager-link, .item-pager-link--next { max-width: none; text-align: left; margin-left: 0; }
}

/* --- Typed search results ---------------------------------------------- */

.search-group { margin-top: var(--space-5); }
.search-group:first-of-type { margin-top: var(--space-4); }
.search-group-head {
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: var(--muted);
    border-bottom: 1px solid var(--border-soft);
    padding-bottom: var(--space-1);
    margin-bottom: var(--space-2);
}
.search-group-count {
    font-weight: 400;
    color: var(--muted-soft);
    font-variant-numeric: tabular-nums;
    margin-left: 4px;
}
.search-group-more { font-size: 0.78rem; color: var(--muted-soft); margin: var(--space-2) 0 0; }

/* --- Fourth-review polish ---------------------------------------------- */

.vote-tally-label {
    margin: var(--space-2) 0 0;
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--muted);
}

/* A linked time is a video deep link; say so at a glance. */
a.turn-time::before, a.vote-time::before, a.video-ts::before {
    content: "\25B6\00A0";
    font-size: 0.72em;
}

.topics-more { border: 1px dashed var(--border); background: none; cursor: pointer; font-family: inherit; }
.topics-more:hover { border-color: var(--primary); color: var(--primary); }

/* --- Person indicators -------------------------------------------------- */

/* The indicator tiles reuse the profile-stat primitives; the note line under
   each carries the chamber baseline, so no figure stands without context. */
.indicator-stats .stat { max-width: 15rem; }
.indicator-stats .stat-label a { color: inherit; }
.profile-topics h3 { margin: var(--space-4) 0 var(--space-1); }

.how-computed {
    margin: var(--space-5) 0 0;
    padding-top: var(--space-3);
    border-top: 1px solid var(--border-soft);
    font-size: 0.85rem;
    color: var(--muted);
    max-width: var(--measure);
}
.how-computed summary { cursor: pointer; color: var(--accent); font-weight: 600; }
.how-computed p { margin: var(--space-2) 0 0; }

/* --- Profile tabs and per-session activity ------------------------------ */

.profile-tabs {
    display: flex;
    gap: 2px;
    margin: var(--space-4) 0;
    border-bottom: 2px solid var(--border);
}
.profile-tabs a {
    padding: 7px 16px;
    text-decoration: none;
    color: var(--accent);
    font-size: 0.9rem;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
}
.profile-tabs a:hover { color: var(--primary); }
.profile-tabs a.is-active {
    color: var(--primary);
    font-weight: 600;
    border-bottom-color: var(--primary);
}

/* A session row is one line closed; open, it summarizes the person's activity
   and links one level deeper for the verbatim turns — never a transcript dump. */
.session-activity { border-bottom: 1px solid var(--border-soft); padding: var(--space-3) 0; }
.session-activity-head { cursor: pointer; list-style: none; }
.session-activity-head::-webkit-details-marker { display: none; }
.session-activity-head::before { content: "\25B8"; font-size: 0.7em; margin-right: 8px; color: var(--muted-soft); }
.session-activity[open] > .session-activity-head::before { content: "\25BE"; }
.session-activity-title { font-weight: 600; }
.session-activity-title time { font-weight: 400; color: var(--muted); margin-left: 8px; font-size: 0.85rem; }
.session-activity-meta { display: block; margin-left: 1.35em; font-size: 0.8rem; color: var(--accent); }
.session-activity-topics { display: block; margin-left: 1.35em; font-size: 0.75rem; color: var(--muted-soft); }
.session-activity-body { margin: var(--space-3) 0 0 1.35em; }
.session-activity-body h4 {
    margin: var(--space-3) 0 var(--space-1);
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--muted);
}
.session-activity-items { list-style: none; padding: 0; margin: 0; }
.session-activity-items li { padding: 3px 0; font-size: 0.9rem; }
.session-activity-more { margin: var(--space-3) 0 0; font-size: 0.85rem; }
.activity-items { list-style: none; padding: 0; margin: 0; }
.activity-item { padding: var(--space-2) 0; border-top: 1px solid var(--border-soft); }
.activity-item:first-child { border-top: 0; }
.activity-item-title { margin: 0; font-weight: 600; font-size: 0.9rem; }
.activity-item-title .topic-chip { font-weight: 400; margin-left: 6px; }
.activity-excerpt {
    margin: 4px 0;
    padding-left: 10px;
    border-left: 3px solid var(--border-soft);
    font-size: 0.85rem;
    color: var(--muted);
    font-style: italic;
}
.activity-item-meta { margin: 0; font-size: 0.8rem; color: var(--muted); }
.activity-item-meta .activity-primary { margin-left: 8px; font-weight: 600; }
.activity-secondary { margin-left: 8px; font-size: 0.8rem; color: var(--muted-soft); }
.activity-procedural { margin: var(--space-2) 0 0; font-size: 0.78rem; color: var(--muted-soft); }

/* Participants: who spoke, each row pointing at their record in this session. */
.participants-panel {
    max-width: 940px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: var(--space-3) var(--space-5);
    margin: 0 0 var(--space-5);
}
.participants-summary { cursor: pointer; font-weight: 600; }
.participant-list { list-style: none; margin: var(--space-3) 0 0; padding: 0; }
.participant {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: var(--space-2);
    padding: var(--space-2) 0;
    border-top: 1px solid var(--border-hair);
}
.participant-name { font-weight: 600; }
.participant-meta { color: var(--muted); font-size: 0.9rem; }

/* Topic page: year filter row and the people-cloud heading above it. */
.topic-years { display: flex; gap: 0.6rem; margin: 1rem 0; }
.topic-years a { padding: 0.15rem 0.6rem; border: 1px solid var(--border, #ddd); border-radius: var(--radius-pill); text-decoration: none; color: var(--accent); }
.topic-years a.is-active { background: var(--primary); color: #fff; border-color: var(--primary); }
.topic-people-head { margin-top: 1.5rem; }
