/* Centro de consulta. Todo lleva el prefijo cc-; los colores salen de los tokens de app.css y shell.css. */
.cc { max-width: 84rem; margin: 0 auto; padding: 1.5rem 1.6rem 4rem; display: grid; grid-template-columns: minmax(0, 1fr); gap: 1.15rem; }
.cc > * { min-width: 0; }
.cc h1 { margin: 0.1rem 0 0.25rem; font-size: clamp(1.6rem, 2.6vw, 2.2rem); letter-spacing: -0.03em; }
.cc h2 { margin: 0 0 0.25rem; font-size: 1.05rem; }
.cc h3 { margin: 0 0 0.5rem; font-size: 0.92rem; }
.cc-eyebrow { margin: 0; color: var(--muted); font-size: 0.72rem; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; }
.cc-lead { margin: 0; max-width: 58rem; color: var(--muted); font-size: 0.9rem; line-height: 1.55; }
.cc-code { padding: 0.1rem 0.4rem; background: var(--surface-subtle); border-radius: 0.3rem; font-family: ui-monospace, Menlo, monospace; font-size: 0.82em; overflow-wrap: anywhere; }
.cc-card { padding: 1.15rem 1.25rem; background: var(--surface); border: 1px solid var(--line); border-radius: 1.05rem; }
.cc-card > p { margin: 0 0 0.8rem; color: var(--muted); font-size: 0.83rem; line-height: 1.5; }
.cc-alert { padding: 0.85rem 1.1rem; color: var(--red); background: var(--red-bg); border-radius: 0.8rem; font-weight: 650; }
.cc-alert button { margin-left: 0.6rem; }
.cc-note { margin: 0; padding: 0.8rem 1rem; color: var(--ink-soft); background: var(--tint); border-radius: 0.8rem; font-size: 0.82rem; line-height: 1.5; }
.cc-note.warn { background: var(--yellow-bg); }
.cc-busy { margin: 0; padding: 2rem 1rem; color: var(--muted); text-align: center; }

.cc-scope { display: flex; flex-wrap: wrap; align-items: end; gap: 0.8rem 1rem; padding: 0.9rem 1.1rem; }
.cc-scope label { display: grid; gap: 0.25rem; margin: 0; color: var(--muted); font-size: 0.7rem; font-weight: 800; letter-spacing: 0.04em; text-transform: uppercase; }
.cc-scope select { width: auto; min-width: 11rem; min-height: 2.4rem; padding: 0.45rem 0.6rem; color: var(--ink); background: var(--surface); border: 1px solid var(--line);
    border-radius: 0.6rem; font-size: 0.88rem; font-weight: 600; letter-spacing: 0; text-transform: none; }
.cc-pill { margin-left: auto; padding: 0.35rem 0.7rem; color: var(--muted); background: var(--surface-subtle); border-radius: 999px; font-size: 0.74rem; }

.cc-tabs { display: flex; gap: 0.2rem; overflow-x: auto; border-bottom: 1px solid var(--line); }
.cc-tab { min-height: 0; padding: 0.7rem 0.95rem; color: var(--muted); background: none; border: 0; border-bottom: 3px solid transparent; border-radius: 0; font-size: 0.88rem; font-weight: 700; white-space: nowrap; }
.cc-tab:hover { color: var(--ink); background: none; }
.cc-tab[aria-selected="true"] { color: var(--brand-dark); border-bottom-color: var(--brand); }
.cc-count { margin-left: 0.35rem; padding: 0.02rem 0.4rem; color: var(--muted); background: var(--surface-subtle); border-radius: 999px; font-size: 0.68rem; font-weight: 700; }
.cc-count[hidden] { display: none; }
.cc-panel[hidden], .cc-drawer[hidden], .cc-veil[hidden] { display: none; }

.cc-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(11.5rem, 1fr)); gap: 0.8rem; margin-bottom: 1.15rem; }
.cc-tile { padding: 0.95rem 1rem; background: var(--surface); border: 1px solid var(--line); border-radius: 1rem; }
.cc-tile small { display: block; color: var(--muted); font-size: 0.74rem; }
.cc-tile strong { display: block; margin: 0.2rem 0; font-size: 1.55rem; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.cc-delta { font-size: 0.74rem; font-weight: 700; color: var(--muted); }
.cc-delta.up { color: var(--green); }
.cc-delta.down { color: var(--red); }
.cc-two { display: grid; grid-template-columns: repeat(auto-fit, minmax(21rem, 1fr)); gap: 1.15rem; }

.cc-bars { display: grid; gap: 0.55rem; }
.cc-bar { display: grid; grid-template-columns: minmax(6rem, 9.5rem) minmax(0, 1fr) 5.6rem; align-items: center; gap: 0.6rem; font-size: 0.82rem; }
.cc-bar > span:first-child { overflow-wrap: anywhere; }
.cc-bar .cc-v { text-align: right; font-variant-numeric: tabular-nums; font-weight: 700; }
.cc-meter { display: block; width: 100%; height: 0.7rem; }
.cc-meter .track { fill: var(--surface-subtle); }
.cc-meter .fill { fill: var(--brand); }
.cc-meter.alt .fill { fill: var(--rival); }
.cc-cols { display: flex; align-items: end; gap: 1.4rem; padding: 0.4rem 0.4rem 0; }
.cc-col { flex: 1; display: grid; gap: 0.3rem; justify-items: center; align-content: end; font-size: 0.78rem; font-weight: 700; }
.cc-col svg { width: 100%; max-width: 4.2rem; height: 8rem; }
.cc-col svg .fill { fill: var(--brand); }
.cc-col svg .fill.now { fill: var(--brand); }
.cc-col svg .fill.past { fill: color-mix(in srgb, var(--brand) 45%, var(--surface-subtle)); }
.cc-col small { color: var(--muted); font-weight: 500; }
.cc-facts { display: grid; gap: 0.55rem; font-size: 0.83rem; line-height: 1.5; }
.cc-facts > div { display: block; }
.cc-facts .cc-badge { margin-right: 0.4rem; }

.cc-toolbar { display: flex; flex-wrap: wrap; gap: 0.6rem; align-items: center; margin-bottom: 0.8rem; }
.cc-toolbar input[type="search"] { flex: 1 1 14rem; width: auto; min-height: 2.4rem; padding: 0.45rem 0.7rem; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: 0.65rem; }
.cc-bars + .cc-toolbar { margin-top: 1rem; }
.cc-toolbar .cc-actions { margin: 0; }
.cc-toolbar select { width: auto; min-width: 13rem; min-height: 2.4rem; padding: 0.45rem 0.6rem; border: 1px solid var(--line); border-radius: 0.6rem; background: var(--surface); }
.cc-seg { display: inline-flex; max-width: 100%; overflow-x: auto; padding: 0.15rem; background: var(--surface-subtle); border: 1px solid var(--line); border-radius: 0.7rem; }
.cc-seg button { min-height: 0; white-space: nowrap; padding: 0.3rem 0.7rem; color: var(--muted); background: none; border: 0; border-radius: 0.55rem; font-size: 0.8rem; font-weight: 700; }
.cc-seg button:hover { color: var(--ink); background: none; }
.cc-seg button[aria-pressed="true"] { color: var(--ink); background: var(--surface); box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12); }
.cc-btn { display: inline-flex; align-items: center; gap: 0.4rem; min-height: 2.4rem; padding: 0.45rem 0.85rem; color: var(--ink); background: var(--surface); border: 1px solid var(--line);
    border-radius: 0.7rem; font-size: 0.82rem; font-weight: 700; text-decoration: none; cursor: pointer; }
.cc-btn:hover { color: var(--ink); background: var(--surface-subtle); }
.cc-btn.primary { color: #fff; background: var(--brand); border-color: var(--brand); }
.cc-btn.primary:hover { color: #fff; background: var(--brand-dark); }
.cc-btn.small { min-height: 0; padding: 0.25rem 0.6rem; font-size: 0.78rem; }

.cc-wrap { overflow: auto; border: 1px solid var(--line); border-radius: 0.9rem; }
.cc table { width: 100%; min-width: 52rem; border-collapse: collapse; font-size: 0.84rem; font-variant-numeric: tabular-nums; }
.cc th { padding: 0.65rem 0.75rem; color: var(--muted); background: var(--surface-subtle); border-bottom: 1px solid var(--line); font-size: 0.7rem; font-weight: 800; letter-spacing: 0.05em; text-align: left; text-transform: uppercase; }
.cc td { padding: 0.65rem 0.75rem; border-bottom: 1px solid var(--line); vertical-align: middle; }
.cc tr:last-child > td { border-bottom: 0; }
.cc td.num, .cc th.num { text-align: right; }
.cc tbody tr.click { cursor: pointer; }
.cc tbody tr.click:hover > td { background: var(--surface-subtle); }
.cc td table { min-width: 44rem; }
.cc td.nested { background: var(--surface-subtle); }
.cc-link { min-height: 0; padding: 0; color: var(--ink); background: none; border: 0; border-radius: 0; font-size: inherit; font-weight: 750; text-align: left; text-decoration: none; }
.cc-link:hover { color: var(--brand-dark); background: none; text-decoration: underline; }
.cc-mini { display: inline-block; width: 5.5rem; height: 0.5rem; margin-right: 0.4rem; vertical-align: middle; }
.cc-mini .track { fill: var(--surface-subtle); }
.cc-mini .fill { fill: var(--brand); }
.cc-win { font-weight: 750; }
.cc-win small { display: block; color: var(--muted); font-weight: 500; }
.cc-badge { display: inline-flex; align-items: center; gap: 0.25rem; padding: 0.12rem 0.5rem; color: var(--gray); background: var(--gray-bg); border-radius: 999px; font-size: 0.72rem; font-weight: 750; }
.cc-badge.ok { color: var(--green); background: var(--green-bg); }
.cc-badge.warn { color: var(--yellow); background: var(--yellow-bg); }
.cc-badge.bad { color: var(--red); background: var(--red-bg); }
.cc-sub { display: block; color: var(--muted); font-size: 0.74rem; font-weight: 500; }
.cc-src { font-size: 0.78rem; line-height: 1.45; }
.cc-src code { font-family: ui-monospace, Menlo, monospace; font-size: 0.92em; overflow-wrap: anywhere; }

.cc-veil { position: fixed; inset: 0; z-index: 60; background: rgba(8, 12, 20, 0.45); }
.cc-drawer { position: fixed; top: 0; right: 0; bottom: 0; z-index: 61; width: min(46rem, 100%); padding: 1.4rem 1.5rem 2rem; overflow: auto; color: var(--ink);
    background: var(--surface); border-left: 1px solid var(--line); box-shadow: var(--sh-shadow); }
.cc-drawer > header { display: flex; gap: 1rem; justify-content: space-between; align-items: start; margin-bottom: 1rem; }
.cc-drawer h2 { margin: 0.1rem 0 0.25rem; font-size: clamp(1.4rem, 2.4vw, 1.9rem); letter-spacing: -0.03em; }
.cc-ico { width: 2rem; min-height: 2rem; height: 2rem; display: grid; place-items: center; flex: 0 0 auto; padding: 0; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: 0.55rem; font-weight: 600; cursor: pointer; }
.cc-ico:hover { color: var(--ink); background: var(--surface-subtle); }
.cc-years { display: grid; grid-template-columns: repeat(auto-fit, minmax(12.5rem, 1fr)); gap: 0.8rem; }
.cc-year { display: grid; gap: 0.35rem; align-content: start; padding: 0.9rem; border: 1px solid var(--line); border-radius: 0.95rem; }
.cc-year > header { display: flex; align-items: baseline; justify-content: space-between; gap: 0.5rem; }
.cc-year b { font-size: 1rem; }
.cc-year small { color: var(--muted); }
.cc-year .row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 0.1rem 0.6rem; font-size: 0.8rem; }
.cc-year .row.first { font-weight: 750; }
.cc-year .cc-meter { grid-column: 1 / -1; height: 0.4rem; }
.cc-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 1rem; }
body.cc-lock { overflow: hidden; }

@media (max-width: 62rem) {
    .cc { padding: 1.1rem 1rem 3rem; }
    .cc-pill { margin-left: 0; }
}
@media (max-width: 40rem) {
    .cc-scope select { min-width: 0; width: 100%; }
    .cc-scope label { flex: 1 1 100%; }
    .cc-bar { grid-template-columns: minmax(5rem, 7rem) minmax(0, 1fr) 4.6rem; }
}

/* ---- Public pages of results (/resultados): complete HTML, same look as the Centro de consulta. */
.pr-crumbs { margin: 0 0 0.4rem; color: var(--muted); font-size: 0.8rem; }
.pr-crumbs a { color: inherit; }
.pr-head { display: flex; flex-wrap: wrap; gap: 0.8rem 1.2rem; align-items: center; justify-content: space-between; }
.pr-head h1 { margin: 0; }
.pr-wrap { overflow-x: auto; }
.pr-table { width: 100%; border-collapse: collapse; font-size: 0.86rem; }
.pr-table th, .pr-table td { padding: 0.5rem 0.55rem; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.pr-table th { color: var(--muted); font-size: 0.72rem; font-weight: 750; letter-spacing: 0.04em; text-transform: uppercase; }
.pr-table .pr-num { text-align: right; font-variant-numeric: tabular-nums; }
.pr-table a { color: inherit; font-weight: 650; }
.pr-table .cc-badge { white-space: nowrap; }
.pr-states, .pr-offices { display: grid; grid-template-columns: repeat(auto-fill, minmax(14rem, 1fr)); gap: 0.6rem; margin: 0; padding: 0; list-style: none; }
.pr-states a, .pr-offices a { display: grid; gap: 0.15rem; padding: 0.75rem 0.9rem; color: inherit; text-decoration: none; border: 1px solid var(--line); border-radius: 0.9rem; background: var(--surface); }
.pr-states a:hover, .pr-offices a:hover { border-color: var(--brand); }
.pr-states small, .pr-offices small { color: var(--muted); font-size: 0.76rem; }

/* ---- A visitor's invitation: the welcome bar (closable, remembered) and the contextual nudge after looking at a municipality. */
.cc-welcome { display: flex; flex-wrap: wrap; gap: 0.7rem 1rem; align-items: center; justify-content: space-between; margin: 0 0 1rem; padding: 0.9rem 1.1rem; background: var(--tint); border: 1px solid color-mix(in srgb, var(--brand) 22%, transparent); border-radius: 1rem; font-size: 0.9rem; line-height: 1.5; }
.cc-welcome p { margin: 0; flex: 1 1 24rem; }
.cc-welcome-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; }
.cc-nudge { position: fixed; right: 1rem; bottom: 1rem; z-index: 59; width: min(24rem, calc(100% - 2rem)); display: grid; gap: 0.6rem; padding: 1rem 1.1rem; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: 1rem; box-shadow: 0 1.2rem 3rem rgba(14, 18, 27, 0.18); }
.cc-nudge h3 { margin: 0; font-size: 1rem; }
.cc-nudge p { margin: 0; color: var(--ink-soft); font-size: 0.86rem; line-height: 1.5; }
.cc-nudge .cc-actions { margin: 0; }

