/* Shell institucional e navegação analítica. CSS isolado do legado do Radar. */
:root {
  --site-header-height: 78px;
  --rail-width: 76px;
  --sidebar-expanded: 248px;
  --scroll-green: #2bf08a;
}
html { scroll-padding-top: calc(var(--site-header-height) + 24px); scrollbar-color: var(--scroll-green) #25052f; scrollbar-width: thin; }
body { min-width: 320px; }
* { scrollbar-color: #079d58 #f1e9f4; scrollbar-width: thin; }
html::-webkit-scrollbar { width: 12px; height: 12px; }
html::-webkit-scrollbar-track { background: #25052f; }
html::-webkit-scrollbar-thumb { background: #2bf08a; border: 3px solid #25052f; border-radius: 999px; }
*::-webkit-scrollbar { width: 9px; height: 9px; }
*::-webkit-scrollbar-track { background: #f1e9f4; border-radius: 999px; }
*::-webkit-scrollbar-thumb { background: #079d58; border: 2px solid #f1e9f4; border-radius: 999px; }
*::-webkit-scrollbar-thumb:hover { background: #12c96d; }
[hidden] { display: none !important; }

.site-header { height: var(--site-header-height); display: block; padding: 0; }
.official-nav-wrap { display: flex; align-items: center; justify-content: space-between; gap: 18px; min-height: var(--site-header-height); width: min(calc(100% - 40px),1180px); margin-inline: auto; }
.official-brand { display: inline-grid; align-content: center; flex-shrink: 0; text-decoration: none; }
.official-brand-role { display: block; width: 80%; margin-bottom: 2px; color: #fff; text-align: center; font: 700 11px/1.1 Arial,sans-serif; }
.institutional-desktop-nav { display: flex; align-items: center; gap: clamp(10px,1.3vw,19px); min-width: 0; font-size: 14.72px; font-weight: 700; }
.institutional-desktop-nav a { color: #fff; white-space: nowrap; position: relative; }
.institutional-desktop-nav a:not(.official-nav-cta)::after { content: ''; position: absolute; left: 0; right: 100%; bottom: -4px; height: 2px; background: #2bf08a; transition: right .18s ease; }
.institutional-desktop-nav a:hover::after,.institutional-desktop-nav a:focus-visible::after { right: 0; }
.official-nav-cta { display: inline-flex; align-items: center; min-height: 42px; padding: 8px 16px; border-radius: 999px; color: #25052f !important; background: #2bf08a; }
.official-nav-cta:hover { background: #55f5a4; }
.official-menu-button { display: none; width: 46px; height: 46px; flex: 0 0 46px; place-content: center; gap: 5px; border: 1px solid rgba(255,255,255,.35); border-radius: 12px; background: transparent; }
.official-menu-button span { display: block; width: 22px; height: 2px; background: #fff; }
.institutional-mobile-nav { padding: 12px 20px 20px; background: #25052f; max-height: calc(100dvh - var(--site-header-height)); overflow-y: auto; box-shadow: 0 16px 30px rgba(0,0,0,.22); }
.institutional-mobile-nav a { display: block; padding: 10px 4px; border-bottom: 1px solid rgba(255,255,255,.12); color: #fff; font-weight: 700; }
.institutional-mobile-nav a[aria-current] { color: #2bf08a; }

.app-shell { width: 100%; }
.main { margin-top: var(--site-header-height); margin-left: var(--rail-width); width: calc(100% - var(--rail-width)); min-width: 0; transition: margin-left .18s ease; }
.content { max-width: 1280px; padding: 34px clamp(20px,3vw,44px) 32px; }
.sidebar { top: var(--site-header-height); width: var(--rail-width); height: calc(100dvh - var(--site-header-height)); min-height: 0; padding: 18px 12px 16px; overflow-x: hidden; overflow-y: auto; scrollbar-color: #2bf08a #25052f; transition: width .18s ease,transform .18s ease,box-shadow .18s ease; z-index: 30; }
.sidebar.is-expanded { width: var(--sidebar-expanded); box-shadow: 16px 0 40px rgba(37,5,47,.22); }
body.sidebar-pinned .main { margin-left: var(--sidebar-expanded); width: calc(100% - var(--sidebar-expanded)); }
.sidebar .rail-copy { display: none; }
.sidebar.is-expanded .rail-copy { display: block; }
.sidebar-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-bottom: 24px; }
.rail-symbol { display: grid; place-items: center; width: 50px; height: 40px; color: #a8ffd2; }
.rail-symbol svg,.sidebar-pin svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.7; }
.sidebar-pin { display: inline-flex; align-items: center; justify-content: center; gap: 9px; width: 50px; height: 38px; border: 1px solid rgba(255,255,255,.2); border-radius: 10px; background: rgba(255,255,255,.06); color: #fff; font-size: 12px; }
.sidebar.is-expanded .sidebar-pin { width: 100%; justify-content: flex-start; padding: 0 12px; }
.sidebar.is-pinned .sidebar-pin { background: #079d58; }
.sidebar.is-pinned .sidebar-pin svg { transform: rotate(180deg); }
.sidebar.is-expanded .rail-symbol { display: none; }
.sidebar-close { display: none; }
.sidebar .brand-lockup { padding: 0 10px 20px; }
.sidebar .brand-lockup strong { font-size: 20px; letter-spacing: -.02em; }
.sidebar .brand-lockup small { font-size: 12px; }
.sidebar .candidate-card { margin: 0 0 22px; padding: 14px 12px; }
.sidebar .candidate-card span,.sidebar .candidate-card small { font-size: 11px; }
.sidebar .candidate-card strong { font-size: 15px; }
.sidebar .nav { gap: 8px; }
.sidebar .nav-link { min-height: 48px; width: 50px; justify-content: center; gap: 13px; padding: 10px 12px; font-size: 14px; white-space: nowrap; }
.sidebar.is-expanded .nav-link { width: 100%; justify-content: flex-start; }
.sidebar .nav-icon { display: inline-flex; width: 22px; flex: 0 0 22px; }
.sidebar .nav-icon svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.sidebar .nav-title { font-size: 11px; }
.sidebar-foot { margin-top: auto; padding: 16px 0 0; min-height: 52px; }
.sidebar-source { display: flex; align-items: center; gap: 10px; padding: 0 9px; }
.sidebar-source .source-seal { width: 32px; height: 32px; margin: 0; flex: 0 0 32px; }
.sidebar-foot p { font-size: 12px; padding: 0 9px; margin-top: 10px; }
.sidebar-source .rail-copy { font-size: 12px; }
.radar-mobile-toggle { display: none; }
.sidebar-backdrop { position: fixed; inset: var(--site-header-height) 0 0; z-index: 25; border: 0; background: rgba(37,5,47,.4); }

/* Nenhuma margem negativa ou largura superior à coluna do dashboard. */
.institutional-footer { display: block; width: 100%; max-width: 100%; min-width: 0; margin: 12px 0 0; padding: 54px clamp(20px,3vw,44px) 24px; background: linear-gradient(125deg,#002c25,#171028); }
.official-footer-grid,.official-footer-bottom { width: min(100%,1180px); margin-inline: auto; }
.official-footer-grid { display: grid; grid-template-columns: minmax(0,1.3fr) minmax(0,.75fr) minmax(0,1fr); gap: 40px; }
.official-footer-grid > div { min-width: 0; }
.official-footer-grid h2 { margin: 0 0 14px; font-size: 18px; font-weight: 700; color: #fff; }
.official-footer-grid p { margin: 18px 0 0; color: rgba(255,255,255,.72); font-size: 15px; line-height: 1.65; }
.official-footer-links { display: grid; gap: 8px; }
.official-footer-links a { color: rgba(255,255,255,.78); font-size: 15px; overflow-wrap: anywhere; }
.official-footer-links a:hover { color: #55f5a4; }
.official-footer-radar { padding: 11px 12px; border: 1px solid rgba(91,246,164,.5); border-radius: 12px; color: #5bf6a4 !important; font-weight: 700; margin-top: 4px; }
.official-footer-channels a { display: flex; align-items: center; gap: 10px; min-width: 0; }
.official-footer-channels span { min-width: 0; overflow-wrap: anywhere; }
.official-footer-channels svg { width: 20px; height: 20px; flex: 0 0 20px; fill: none; stroke: currentColor; stroke-width: 1.8; }
.official-footer-channels .filled { fill: currentColor; stroke: none; }
.official-contact-icon { color: #5bf6a4; width: 20px; flex: 0 0 20px; text-align: center; }
.official-footer-legal { display: grid; gap: 10px; margin-top: 22px; padding-top: 16px; border-top: 1px solid rgba(255,255,255,.15); }
.official-footer-legal a,.official-footer-legal button { color: rgba(255,255,255,.72); font-size: 14px; text-decoration: underline; text-align: left; }
.official-footer-legal button { border: 0; padding: 0; background: transparent; }
.official-footer-bottom { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 20px; margin-top: 40px; padding-top: 22px; border-top: 1px solid rgba(255,255,255,.15); color: rgba(255,255,255,.6); font-size: 13px; }
.official-ada-credit { display: inline-flex; align-items: center; gap: 9px; padding: 7px 13px 7px 8px; border: 1px solid rgba(91,246,164,.42); border-radius: 999px; background: rgba(91,246,164,.06); white-space: normal; }
.official-ada-icon { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 9px; background: #3c3f45; color: #5bf6a4; font-size: 24px; }
.official-ada-credit strong { color: #5bf6a4; }

.control-bar { display: grid; grid-template-columns: auto 100px minmax(170px,1fr) minmax(145px,1fr) auto auto; gap: 14px; }
.control-bar label { min-width: 0; padding-left: 12px; }
.control-bar select,.control-bar input { width: 100%; }
.hero > div,.panel,.panel-head > div,.compare-controls,.compare-result { min-width: 0; }
.compare-controls select { width: 0; min-width: 0; max-width: 100%; }
.map-footer { flex-wrap: wrap; }.geo-source { white-space: normal; }
.summary-metrics { grid-template-columns: repeat(4,minmax(0,1fr)); }
.ranking-tools { display: grid; gap: 10px; margin: 16px 0 10px; }
.ranking-tools label { display: grid; gap: 5px; color: #5d6171; font-size: 12px; }
.ranking-tools select { width: 100%; min-width: 0; min-height: 42px; border: 1px solid #dfe2e8; border-radius: 10px; padding: 9px 10px; background: #fff; color: #35103f; font-size: 15px; }
.ranking-tools .ranking-view { display: flex; gap: 6px; }
.ranking-view button { flex: 1; min-width: 0; border: 1px solid #dfe2e8; background: #fff; border-radius: 9px; min-height: 40px; color: #5d6171; font-size: 12px; font-weight: 700; }
.ranking-view button[aria-pressed=true] { background: #e9faef; border-color: #079d58; color: #075a42; }
.ranking-caption { margin: 0; font-size: 12px; color: #5d6171; line-height: 1.45; }
.rank-city { white-space: normal; line-height: 1.25; }
.section-table-wrap table { min-width: 0; table-layout: fixed; }
.section-table-wrap th:first-child { width: 16%; }
.section-table-wrap th:nth-child(2) { width: 43%; }
.section-table-wrap th:nth-child(3) { width: 27%; }
.section-table-wrap th:last-child { width: 14%; }
.section-table-wrap th,.section-table-wrap td { overflow-wrap: anywhere; vertical-align: top; }
.local-name { display: block; font-weight: 700; color: #35103f; }
.local-address { display: block; margin-top: 5px; color: #5d6171; font-size: 12px; line-height: 1.4; }
.section-key { display: block; white-space: nowrap; font-weight: 700; font-size: 14px; }
.section-key small { display: block; font-size: 11px; font-weight: 400; }
.local-source-note { margin: 12px 0 0; font-size: 12px; line-height: 1.5; color: #5d6171; }
.section-reset { padding: 6px 10px; margin-top: 7px; background: #e9faef; border: 1px solid #c9eedb; border-radius: 9px; color: #075a42; font-size: 12px; }
.campaign-finance-highlight { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,.9fr); align-items: center; gap: 32px; margin: 24px 0; padding: clamp(24px,4vw,42px); border-radius: 28px; color: #fff; background: linear-gradient(125deg,#25052f,#661873 60%,#08784f); }
.campaign-finance-highlight h2 { max-width: 15ch; margin: 10px 0 16px; font-size: clamp(30px,3.5vw,48px); line-height: 1.08; }
.campaign-finance-highlight p { margin: 0; color: rgba(255,255,255,.78); font-size: 15px; }
.campaign-finance-highlight .eyebrow { color: rgba(255,255,255,.78); font-size: 12px; }
.campaign-finance-value { display: grid; min-width: 0; padding: 24px; border: 1px solid rgba(255,255,255,.24); border-radius: 20px; background: rgba(255,255,255,.09); }
.campaign-finance-value > span { font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: .1em; }
.campaign-finance-value strong { margin: 8px 0; color: #55f5a4; font-size: clamp(30px,3.4vw,52px); line-height: 1.1; white-space: nowrap; }
.campaign-finance-value small,.finance-source { color: rgba(255,255,255,.72); font-size: 12px; }
.finance-source { display: inline-block; margin-top: 14px; text-decoration: underline; }
.history-cargo-notice { margin-top: 14px; border-radius: 12px; padding: 14px 16px; background: #fff7dc; font-size: 14px; color: #795c16; }
.history-summary { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 14px; margin: 20px 0; }
.history-card { padding: 18px; border: 1px solid #dfe2e8; border-radius: 16px; background: #fff; }
.history-card strong { display: block; font-size: 28px; color: #35103f; }
.history-card small { display: block; color: #5d6171; }
@media(max-width:1180px) {
  .institutional-desktop-nav { display: none; }
  .official-menu-button { display: grid; }
  .control-bar { grid-template-columns: minmax(0,1fr) minmax(0,1fr); }
  .control-label { grid-column: 1/-1; }
  .control-bar label { border: 0; padding: 0; }
  .control-bar .search-field { grid-column: 1/-1; }
  .clear-button { justify-self: start; }
  .data-state { justify-self: end; }
}
@media(max-width:900px) {
  :root { --rail-width: 0px; }
  .main,body.sidebar-pinned .main { width: 100%; margin-left: 0; }
  .sidebar { width: min(280px,calc(100vw - 24px)); transform: translateX(-105%); box-shadow: none; pointer-events: none; }
  .sidebar.open,.sidebar.is-expanded.open { width: min(280px,calc(100vw - 24px)); transform: translateX(0); pointer-events: auto; box-shadow: 16px 0 40px rgba(37,5,47,.25); }
  .sidebar.open .rail-copy { display: block; }
  .sidebar.open .nav-link { width: 100%; justify-content: flex-start; }
  .sidebar .rail-symbol,.sidebar-pin { display: none; }
  .sidebar-close { display: block; margin-left: auto; width: 40px; height: 40px; border: 1px solid rgba(255,255,255,.25); border-radius: 10px; background: transparent; color: #fff; font-size: 25px; }
  .radar-mobile-toggle { display: inline-flex; align-items: center; gap: 8px; min-height: 42px; border: 1px solid #dfe2e8; border-radius: 10px; background: #fff; color: #075a42; padding: 8px 12px; font-weight: 700; margin-bottom: 20px; }
  .official-footer-grid { grid-template-columns: minmax(0,1fr) minmax(0,1fr); }
  .official-footer-brand { grid-column: 1/-1; }
  .campaign-finance-highlight { grid-template-columns: 1fr; }
  .history-summary { grid-template-columns: 1fr; }
}
@media(max-width:640px) {
  :root { --site-header-height: 68px; }
  .official-nav-wrap { width: calc(100% - 24px); }
  .official-brand-role { font-size: 10px; }
  .content { padding: 26px 16px; }
  .control-bar { grid-template-columns: minmax(0,1fr); }
  .control-label,.control-bar .search-field { grid-column: auto; }
  .control-bar input,.control-bar select { min-height: 44px; }
  .data-state { justify-self: start; }
  .official-footer-grid { grid-template-columns: minmax(0,1fr); gap: 30px; }
  .institutional-footer { padding: 40px 20px 24px; }
  .official-footer-grid p { font-size: 15px; }
  .summary-metrics { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .section-table-wrap tr { padding: 14px; }
  .section-table-wrap td { display: grid; grid-template-columns: 96px minmax(0,1fr); gap: 12px; text-align: left; }
  .section-table-wrap td.numeric { text-align: left; }
  .section-table-wrap td.empty-cell { display: block; }
  .campaign-finance-value { padding: 20px 16px; }
  .campaign-finance-value strong { font-size: clamp(27px,8.3vw,42px); }
}
@media(prefers-reduced-motion:reduce) { .sidebar,.main { transition: none; } }

/* Resets dos novos botões e contenção flex sem esconder conteúdo do documento. */
.ranking-row { width:100%; border:0; background:transparent; text-align:left; font:inherit; }
.rank-bar { display:block; }
.ranking-panel .ranking-list { grid-template-columns:minmax(0,1fr); max-height:420px; }
.control-bar .data-state { margin-left:0; }
.panel-head { flex-wrap:wrap; }
.compare-controls select { flex-basis:0; }
.summary-content > div { min-width:0; }
@media(min-width:901px) and (max-width:1250px) { .summary-content { display:grid; } }
@media(min-width:641px) and (max-width:760px) { .section-table-wrap td { align-items:flex-start; } }
@media(max-width:760px) { .section-table-wrap td { min-width:0; } .section-table-wrap td > div,.section-table-wrap td > span { min-width:0; } }

.institutional-mobile-nav .official-nav-cta { display:inline-flex; width:max-content; margin-top:12px; border:0; }
.ranking-view button:disabled { opacity:.48; cursor:not-allowed; }
.section-table-wrap th { position:sticky; top:0; z-index:1; }
@media(max-width:760px) { .section-key small { display:none; } }
