/* Hallmark · redesign: restyle · scope: app · genre: modern-minimal (inferred)
 * theme: cartographic desk (custom) · faces: Fraunces + Archivo
 * critique: chalk map board not cream SaaS; brand blue deepened for contrast; density over cards
 * waive: 19 on remaining i18n data strings (election meta); 56 sticky (tables in separate scroll parents)
 * built: the project · redesign: restyle · v2.0.0 */
/* Fonts loaded from index.html <link> (avoid @import FOUC / partial paint). */

:root,
[data-theme="light"] {
  --bg: #e2e5df;
  --bg-deep: #d5d9d2;
  --surface: #f4f5f1;
  --surface-solid: #f4f5f1;
  --ink: #141916;
  --muted: #556058;
  --line: rgba(20, 25, 22, 0.16);
  --accent: #0c4578;
  --accent-soft: #175ea8;
  --accent-2: #b4232c;
  --on-accent: #f4f5f1;
  --danger: #9b1c1c;
  --ok: #1a6844;
  --map-bg: #b9c2bb;
  --shadow: 0 1px 0 rgba(20, 25, 22, 0.06);
  --glass: none;
  --radius: 4px;
  --radius-sm: 2px;
  --font-ui: "Archivo", "Segoe UI", sans-serif;
  --font-display: "Archivo", "Segoe UI", sans-serif;
  --font-brand: "Fraunces", Georgia, serif;
  --ease: cubic-bezier(0.23, 1, 0.32, 1);
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --dur: 160ms;
  --dur-micro: 120ms;
  --dur-short: 180ms;
  --space: 4px;
}

[data-theme="dark"] {
  --bg: #101411;
  --bg-deep: #0a0c0b;
  --surface: #171b18;
  --surface-solid: #171b18;
  --ink: #e6e9e3;
  --muted: #9aa49b;
  --line: rgba(230, 233, 227, 0.14);
  --accent: #6ba4d6;
  --accent-soft: #8bb8de;
  --accent-2: #e0787e;
  --on-accent: #101411;
  --danger: #ef7a72;
  --ok: #4cbf8a;
  --map-bg: #101411;
  --shadow: 0 1px 0 rgba(0, 0, 0, 0.35);
}

* { box-sizing: border-box; }
html, body {
  height: 100%;
  overflow-x: clip;
}
body {
  margin: 0;
  font: 14px/1.45 var(--font-ui);
  color: var(--ink);
  background: var(--bg);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  overflow: clip;
}

/* Keyboard / a11y */
.skip-link {
  position: absolute;
  left: 12px;
  top: 0;
  z-index: 100;
  padding: 8px 14px;
  border-radius: 6px;
  background: var(--surface-solid);
  color: var(--ink);
  border: 1px solid var(--line);
  font: 600 13px/1.2 var(--font-ui);
  text-decoration: none;
  transform: translateY(-120%);
  transition: transform var(--dur) var(--ease);
}
.skip-link:focus,
.skip-link:focus-visible {
  transform: translateY(12px);
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
:focus:not(:focus-visible) {
  outline: none;
}
#main:focus {
  outline: none;
}

html.theme-anim,
html.theme-anim body,
html.theme-anim .surface,
html.theme-anim header,
html.theme-anim aside {
  transition: background-color var(--dur) var(--ease), color var(--dur) var(--ease), border-color var(--dur) var(--ease);
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

/* ----- header ----- */
header.app-header {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 8px 16px;
  align-items: center;
  padding: 8px 20px;
  min-height: 56px;
  max-height: 56px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-solid);
  z-index: 20;
  position: relative;
  flex-shrink: 0;
}
.brand {
  -webkit-appearance: none;
  appearance: none;
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  display: inline-flex;
  flex-direction: row;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  width: auto;
  height: auto;
  max-height: 48px;
  min-width: 0;
  padding: 2px 4px 2px 0;
  margin: 0;
  cursor: pointer;
  color: inherit;
  text-align: left;
  align-self: center;
}
.brand-mark {
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  display: block;
  object-fit: contain;
}
.brand-name {
  font-family: var(--font-brand);
  font-size: 1.4rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1;
  white-space: nowrap;
  overflow-wrap: break-word;
  min-width: 0;
}
.lang-toggle,
.country-toggle {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 6px;
  overflow: hidden;
  background: var(--surface);
}
.lang-btn,
.country-btn {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0;
  padding: 0.35rem 0.55rem;
  cursor: pointer;
}
.lang-btn.active,
.country-btn.active {
  background: var(--accent);
  color: var(--on-accent);
}
.lang-btn:not(.active):hover,
.country-btn:not(.active):hover { color: var(--ink); }

/* Brazil-only analysis/tools stay hidden for US; Why + Explore/Compare/Movers/Data stay on. */
html[data-country="us"] .primary-nav [data-module="ideology"],
html[data-country="us"] .primary-nav [data-module="perfis"],
html[data-country="us"] #mobileTabbar [data-module="ideology"],
html[data-country="us"] #mobileTabbar [data-module="perfis"],
html[data-country="us"] #navDrawer [data-module="ideology"],
html[data-country="us"] #navDrawer [data-module="perfis"] { display: none; }
html[data-country="br"] #ecBlock { display: none; }
html[data-country="us"] #outcome option[value="invalid"] { display: none; }

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: nowrap;
  justify-content: flex-end;
  align-self: center;
}

/* Desktop primary nav — grouped dropdowns */
.primary-nav {
  display: flex;
  align-items: center;
  gap: 2px;
  flex-wrap: nowrap;
  justify-content: center;
  min-width: 0;
  overflow: visible;
}
.nav-group {
  position: relative;
  flex: 0 0 auto;
}
.nav-group-btn,
.nav-link {
  -webkit-appearance: none;
  appearance: none;
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  font: 500 13px/1 var(--font-ui);
  padding: 8px 10px;
  border-radius: var(--radius);
  cursor: pointer;
  white-space: nowrap;
  transition: color var(--dur) var(--ease), background var(--dur) var(--ease), border-color var(--dur) var(--ease);
}
.nav-group-btn::after {
  content: " ▾";
  font-size: 0.85em;
  opacity: 0.7;
}
.nav-group-btn:hover,
.nav-link:hover {
  color: var(--ink);
  background: color-mix(in srgb, var(--ink) 6%, transparent);
}
.nav-group.open > .nav-group-btn,
.nav-group.has-active > .nav-group-btn,
.nav-link.active {
  color: var(--accent);
  background: transparent;
  border-color: transparent;
  box-shadow: inset 0 -2px var(--accent);
}
.nav-menu {
  display: none !important;
  visibility: hidden;
  pointer-events: none;
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  min-width: 220px;
  padding: 6px;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: var(--surface-solid);
  box-shadow: none;
  z-index: 40;
  flex-direction: column;
  gap: 2px;
}
.nav-group.open > .nav-menu:not([hidden]) {
  display: flex !important;
  visibility: visible;
  pointer-events: auto;
}
.nav-menu[hidden] {
  display: none !important;
  visibility: hidden !important;
  pointer-events: none !important;
}
.nav-menu button {
  -webkit-appearance: none;
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--ink);
  font: 500 13px/1.3 var(--font-ui);
  text-align: left;
  padding: 10px 12px;
  border-radius: var(--radius);
  cursor: pointer;
  width: 100%;
}
.nav-menu button:hover { background: color-mix(in srgb, var(--accent) 12%, transparent); }
.nav-menu button.active {
  background: color-mix(in srgb, var(--accent) 16%, transparent);
  color: var(--accent);
}

/* Hamburger / mobile tabbar: desktop OFF */
.nav-hamburger,
#navMenuBtn {
  display: none !important;
}
.mobile-tabbar {
  display: none !important;
}

/* Mobile drawer */
.nav-drawer {
  position: fixed;
  top: 0;
  right: 0;
  width: min(320px, 88vw);
  height: 100%;
  z-index: 50;
  padding: 64px 16px 24px;
  overflow: auto;
  background: var(--surface-solid);
  border-left: 1px solid var(--line);
  box-shadow: none;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.nav-drawer[hidden] { display: none !important; }
.nav-drawer-label {
  margin: 14px 8px 4px;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0;
  text-transform: none;
  color: var(--muted);
}
.nav-drawer-label:first-child { margin-top: 0; }
.nav-drawer button {
  -webkit-appearance: none;
  appearance: none;
  border: 1px solid transparent;
  background: transparent;
  color: var(--ink);
  font: 500 14px/1.3 var(--font-ui);
  text-align: left;
  padding: 12px 12px;
  border-radius: var(--radius);
  cursor: pointer;
}
.nav-drawer button:hover { background: color-mix(in srgb, var(--ink) 6%, transparent); }
.nav-drawer button.active {
  background: color-mix(in srgb, var(--accent) 14%, transparent);
  border-color: color-mix(in srgb, var(--accent) 35%, var(--line));
  color: var(--accent);
}

/* Mobile bottom tab bar (enabled in @media below) */
.mobile-tabbar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 30;
  grid-template-columns: repeat(4, 1fr);
  gap: 2px;
  padding: 6px 8px calc(6px + env(safe-area-inset-bottom, 0px));
  border-top: 1px solid var(--line);
  background: var(--surface-solid);
}
.mobile-tabbar button {
  -webkit-appearance: none;
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--muted);
  font: 600 11px/1.2 var(--font-ui);
  padding: 8px 4px;
  border-radius: var(--radius);
  cursor: pointer;
}
.mobile-tabbar button span { display: block; }
.mobile-tabbar button.active {
  color: var(--accent);
  background: transparent;
}

/* About */
.about-page {
  grid-template-columns: minmax(0, 1fr);
  max-width: 960px;
  margin: 0 auto;
  width: 100%;
  align-content: start;
  grid-auto-rows: max-content;
  gap: 20px;
}
.about-page .about-hero {
  flex-direction: row;
  align-items: flex-start;
  gap: 20px;
  padding: 24px 0;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  box-shadow: none;
  background: transparent;
}
.about-logo {
  width: 48px;
  height: 48px;
  flex-shrink: 0;
  object-fit: contain;
  display: block;
}
.about-page .about-hero h2 {
  margin: 0;
  font-family: var(--font-brand);
  font-size: 1.75rem;
  font-weight: 700;
  text-wrap: balance;
}
.about-hero p {
  margin: 8px 0 0;
  max-width: 75ch;
  color: var(--muted);
}
.about-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}
.about-grid h3 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.15rem;
}
.about-grid .btn { align-self: start; }
.about-grid .surface {
  padding: 16px 0 0;
  border: 0;
  border-top: 1px solid var(--line);
  border-radius: 0;
  box-shadow: none;
  background: transparent;
}
.about-grid .note { margin: 0; line-height: 1.55; }
.about-actions { display: flex; flex-wrap: wrap; gap: 8px; }

/* Perfis */
.perfil-hero {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  flex-wrap: wrap;
}
.perfil-avatar {
  width: 88px;
  height: 88px;
  border-radius: var(--radius);
  object-fit: cover;
  border: 1px solid var(--line);
  background: color-mix(in srgb, var(--ink) 6%, transparent);
  flex-shrink: 0;
}
.perfil-avatar.party-mark {
  display: grid;
  place-items: center;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--on-accent);
}
.perfil-avatar.party-logo,
.list-row .perfil-thumb.party-logo {
  object-fit: contain;
  background: color-mix(in srgb, var(--surface-solid) 88%, var(--ink));
  padding: 6px;
}
.list-row .perfil-thumb.party-logo { padding: 3px; }
.perfil-initials {
  display: grid;
  place-items: center;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.4rem;
  color: var(--muted);
}
.perfil-meta { flex: 1; min-width: 200px; }
.perfil-meta h2 { margin: 0 0 6px; }
.perfil-link {
  color: var(--accent);
  text-decoration: none;
  font-weight: 500;
  cursor: pointer;
  background: none;
  border: 0;
  padding: 0;
  font: inherit;
}
.perfil-link:hover { text-decoration: underline; }
.list-row .perfil-thumb {
  width: 36px;
  height: 36px;
  border-radius: var(--radius);
  object-fit: cover;
  background: color-mix(in srgb, var(--ink) 8%, transparent);
  flex-shrink: 0;
}
.list-row .perfil-thumb.party-mark {
  display: grid;
  place-items: center;
  color: var(--on-accent);
  font-size: 10px;
  font-weight: 700;
}

.icon-btn, .btn {
  appearance: none;
  border: 1px solid var(--line);
  background: var(--surface-solid);
  color: var(--ink);
  font: 500 13px var(--font-ui);
  padding: 8px 12px;
  border-radius: 6px;
  cursor: pointer;
  transition: transform 140ms var(--ease), background-color var(--dur) var(--ease), border-color var(--dur) var(--ease), color var(--dur) var(--ease);
}
.icon-btn { width: 40px; height: 40px; padding: 0; display: grid; place-items: center; }
.btn:hover, .icon-btn:hover { border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); }
.btn:active, .icon-btn:active { transform: scale(0.97); }
.btn.primary { background: var(--accent); color: var(--on-accent); border-color: transparent; }
.icon-svg { display: block; }
.btn.ghost { background: transparent; }

label.ctrl {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 11px;
  color: var(--muted);
  letter-spacing: 0;
}
[hidden], label.ctrl[hidden] { display: none !important; }
select, input[type="search"], input[type="text"], input[type="number"], textarea {
  font: 500 13px var(--font-ui);
  color: var(--ink);
  background: var(--surface-solid);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 8px 10px;
  min-height: 38px;
}
.toolbar {
  display: flex;
  flex-wrap: nowrap;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  gap: 10px 14px;
  align-items: end;
  padding: 8px 18px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-solid);
  flex-shrink: 0;
  position: relative;
  z-index: 5;
}
.scope-bar {
  background: color-mix(in srgb, var(--surface-solid) 82%, var(--map-bg, #eef1f4));
  z-index: 6;
}
.scope-bar .scope-bar-hint {
  flex: 1 1 12rem;
  margin: 0;
  align-self: center;
  font-size: 0.82rem;
}
.place-handoffs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 0 0 0.75rem;
}
.story-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(12.5rem, 1fr));
  gap: 0.55rem;
}
.story-btn {
  text-align: left;
  justify-content: flex-start;
  white-space: normal;
  line-height: 1.25;
  min-height: 2.75rem;
}
.toolbar .ctrl { flex: 0 0 auto; min-width: 0; }
.toolbar .ctrl > span { white-space: nowrap; }
.toolbar select { max-width: min(220px, 46vw); }
.legend .muted {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
  margin-top: 4px;
}
.why-toolbar {
  background: var(--surface-solid);
}
.why-toolbar .ctrl { min-width: 0; }
.why-toolbar select { max-width: min(240px, 42vw); }

/* ----- views ----- */
.view-root { flex: 1; min-height: 0; position: relative; display: flex; flex-direction: column; }
.view { display: none; flex: 1; min-height: 0; }
.view.active { display: flex; flex-direction: column; }
@keyframes rise {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: none; }
}

.map-layout {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: 1fr min(420px, 38vw);
  position: relative;
}
#exploreLayout {
  grid-template-columns: minmax(300px, 360px) minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr);
  gap: 0;
  /* Map board shows under a short results panel instead of a tall empty white column */
  background: var(--map-bg);
}
#exploreLayout.is-panel-collapsed {
  grid-template-columns: minmax(0, 1fr);
}
#exploreLayout .map-stage { grid-column: 2; grid-row: 1; overflow: hidden; }
#exploreLayout.is-panel-collapsed .map-stage { grid-column: 1; }
#exploreLayout aside.panel.explore-aside {
  grid-column: 1;
  grid-row: 1;
  align-self: start;
  width: 100%;
  height: auto;
  max-height: 100%;
  overflow: auto;
  overscroll-behavior: contain;
  padding: 0 20px 20px;
  border: 0;
  border-right: 1px solid var(--line);
  background: var(--surface-solid);
  color: var(--ink);
  box-shadow: none;
  backdrop-filter: none;
}
#exploreLayout .aside-tab-panels {
  flex: 0 1 auto;
  overflow: visible;
  min-height: 0;
  padding-bottom: 4px;
}
#exploreLayout .aside-tabs {
  position: sticky;
  top: 0;
  z-index: 2;
  margin: 0 -20px 20px;
  padding: 0 12px;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  background: var(--surface-solid);
}
#exploreLayout .aside-tab {
  min-height: 48px;
  padding: 12px 4px 10px;
  border-bottom: 2px solid transparent;
}
#exploreLayout .aside-tab.active {
  color: var(--accent);
  background: transparent;
  border-bottom-color: var(--accent);
}
#exploreLayout .aside-tab-panel h2 { margin: 0 0 12px; }
#exploreLayout .metric-row {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 120px), 1fr));
  gap: 14px 12px;
  margin: 16px 0;
}
#exploreLayout .aside-details { margin-top: 16px; padding-top: 12px; }
#exploreLayout .aside-eco { margin: 12px 0 0; line-height: 1.5; }
.explore-charts-link {
  position: absolute;
  right: 16px;
  top: 16px;
  z-index: 6;
  box-shadow: none;
  border-radius: 6px;
}
.map-loading {
  position: absolute;
  z-index: 5;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  margin: 0;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-solid);
  color: var(--muted);
}
.map-stage { position: relative; min-height: 0; background: var(--map-bg); }
.map-stage.dual { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 2px; }
.map-pane { position: relative; min-height: 0; height: 100%; }
.map-pane .maplibregl-map, .map-fill { width: 100%; height: 100%; }
.map-pane h3 {
  position: absolute; z-index: 5; left: 54px; top: 12px; margin: 0;
  max-width: calc(100% - 66px);
  font: 600 12px var(--font-ui); padding: 6px 10px; border-radius: var(--radius);
  background: var(--surface-solid); border: 1px solid var(--line);
}
#map, #mapA, #mapB { width: 100%; height: 100%; }
.cmp-toolbar { border: 0; }
.cmp-election {
  display: flex;
  flex: 0 0 auto;
  gap: 4px;
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}
.cmp-election legend {
  padding: 0 0 4px;
  color: var(--muted);
  font-size: 11px;
}
.cmp-election select { max-width: none; }
.cmp-election select:first-of-type {
  font-variant-numeric: tabular-nums;
}
.cmp-presets {
  display: inline-flex;
  flex: 0 0 auto;
  flex-wrap: nowrap;
  align-items: center;
  gap: 6px;
  align-self: end;
  padding-bottom: 2px;
}
.cmp-presets .chip {
  padding: 7px 10px;
  white-space: nowrap;
}
.cmp-presets .chip:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
.cmp-layout .cmp-aside { min-width: 0; }
.cmp-lead { margin-top: 0; }
.cmp-leg-sep { border: 0; border-top: 1px solid var(--line); margin: 8px 0; }
.cmp-place-summary-wrap { max-height: 140px; margin-bottom: 8px; }
.cmp-place-summary-wrap[hidden], #cmpPlaceSummary[hidden] { display: none; }
.cmp-legend {
  position: absolute; left: 12px; bottom: 12px; z-index: 5;
  max-width: min(240px, 42%);
  pointer-events: none;
}
.cmp-legend .bar { width: min(220px, 100%); }
.cmp-aside .chart.mid { height: 220px; }
.cmp-sm-legend {
  position: static;
  max-width: none;
  pointer-events: auto;
  margin: 0 0 4px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  box-shadow: none;
}
.cmp-sm-legend[hidden] { display: none; }
.cmp-sm-legend .cmp-sm-swatch {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-right: 12px;
  font-size: 12px;
}
.cmp-sm-legend .cmp-sm-swatch i {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 2px;
}
.cmp-sm-legend .bar {
  height: 8px;
  width: min(220px, 100%);
  margin: 4px 0;
  border-radius: var(--radius-sm);
}
.cmp-sm-legend .row {
  display: flex;
  justify-content: space-between;
  color: var(--muted);
}
.cmp-sm-legend .muted {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
  margin-top: 4px;
}
.cmp-multi-facets h3,
#cmpMultiFacets h3 {
  margin: 12px 0 4px;
  font: 600 13px var(--font-ui);
}
.cmp-sm-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 10px;
  margin: 6px 0 4px;
}
.cmp-sm-cell {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 6px 6px 2px;
  background: var(--surface-solid);
}
.cmp-sm-cell.is-dim { opacity: 0.42; }
.cmp-sm-cell[role="button"] {
  cursor: pointer;
  border-radius: var(--radius, 4px);
}
.cmp-sm-cell[role="button"]:hover,
.cmp-sm-cell[role="button"]:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--accent) 45%, transparent);
  outline-offset: 2px;
}
.cmp-delta-up { color: var(--ok, #1a6844); font-weight: 650; }
.cmp-delta-down { color: var(--accent-2, #b4232c); font-weight: 650; }
.cmp-sm-cell h4 {
  margin: 0 0 2px;
  font: 600 11px var(--font-ui);
  color: var(--muted);
  letter-spacing: 0;
}
.cmp-sm-cell .chart.sm { height: 108px; width: 100%; }
.legend .swatch-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2px 10px;
  margin-top: 6px;
}
.legend .swatch-grid > div {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  font-size: 11px;
  line-height: 1.25;
}
.legend .enc-note {
  margin-top: 6px;
  padding-top: 6px;
  border-top: 1px solid var(--line);
}

aside.panel {
  overflow: auto;
  padding: 14px 16px 28px;
  background: var(--surface-solid);
  color: var(--ink);
  border-left: 1px solid var(--line);
}
aside.panel.explore-aside {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding-bottom: 14px;
  min-height: 0;
}
.aside-tabs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  flex-shrink: 0;
  margin: 0 0 10px;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  overflow: hidden;
  background: transparent;
}
.aside-tab {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0;
  padding: 0.5rem 0.35rem;
  cursor: pointer;
  transition: background-color var(--dur) var(--ease), color var(--dur) var(--ease);
}
.aside-tab.active {
  background: transparent;
  color: var(--accent);
  box-shadow: inset 0 -2px var(--accent);
}
.aside-tab:not(.active):hover { color: var(--ink); }
.aside-tab-panels {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding-bottom: 12px;
}
.aside-tab-panel h2 {
  margin-top: 4px;
}
.aside-tab-panel h2 + .chart { margin-top: 0; }
.aside-empty {
  margin: 8px 0 12px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.45;
  background: color-mix(in srgb, var(--bg) 70%, var(--surface-solid));
}
.aside-empty[hidden] { display: none; }
#selPlaceBody[hidden] { display: none; }
#selChart[hidden] { display: none; }
.aside-details {
  margin: 10px 0 4px;
  border-top: 1px solid var(--line);
  padding-top: 8px;
}
.aside-details summary {
  cursor: pointer;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  list-style: none;
}
.aside-details summary::-webkit-details-marker { display: none; }
.aside-details summary::before {
  content: "▸ ";
  display: inline-block;
  transition: transform var(--dur) var(--ease);
}
.aside-details[open] summary::before { transform: rotate(90deg); }
.aside-details .note { margin-top: 8px; }
.aside-eco { font-size: 11px; margin-top: 10px; }
.metric-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 110px), 1fr));
  gap: 8px 10px;
  margin: 6px 0 10px;
}
.metric {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.metric-label {
  font-size: 10px;
  font-weight: 500;
  color: var(--muted);
  overflow-wrap: anywhere;
}
.metric-value {
  font-size: 15px;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
}
aside.panel h2 {
  font-family: var(--font-display);
  font-size: 1.05rem;
  margin: 18px 0 8px;
  font-weight: 650;
}
aside.panel h2:first-child { margin-top: 4px; }
.chart {
  height: 210px;
  width: 100%;
  min-width: 0;
  min-height: 0;
  position: relative;
  overflow: hidden;
  background: transparent;
  font-family: var(--font-ui);
  font-variant-numeric: tabular-nums;
}
.chart.chart-bars { height: 120px; }
.chart.chart-hist { height: 168px; }
.chart.chart-uf { height: 360px; }
/* Module dashboard panels: one viz job per block, hairline not card chrome */
.viz-dash-block {
  margin: 0 0 20px;
  padding: 0 0 16px;
  border-bottom: 1px solid var(--line);
}
.viz-dash-block:last-child { border-bottom: 0; padding-bottom: 0; }
.viz-dash-block > h2,
.viz-dash-block > h3 {
  margin: 0 0 6px;
  font-family: var(--font-ui);
  font-size: 1rem;
  font-weight: 650;
  letter-spacing: -0.015em;
}
.viz-dash-block > .note { margin-top: 0; }
.viz-dash-block .chart { margin-top: 4px; }
.cmp-aside .viz-dash-block:last-child,
#projBody .viz-dash-block { border-bottom: 0; padding-bottom: 0; }
#projBody .grid-2 { gap: 16px 20px; align-items: start; }
.chart.tall { height: 520px; }
.chart.mid { height: 280px; }
.chart.corr { height: max(420px, min(62vh, 560px)); }
.why-page { padding-top: 14px; }
.why-surface { overflow: hidden; }
.why-charts {
  align-items: stretch;
  min-width: 0;
}
.why-charts > .chart {
  min-height: 280px;
  isolation: isolate;
}
.why-charts > #scatterChart { height: 100%; }
.grid-2 > * { min-width: 0; }
.note { color: var(--muted); font-size: 12.5px; line-height: 1.55; margin: 6px 0 10px; }
.banner {
  margin: 0 0 12px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: var(--bg-deep);
  color: var(--ink);
  font-size: 12.5px;
  font-weight: 500;
}

#legend, .legend {
  position: absolute; left: 12px; bottom: 12px; z-index: 5;
  background: var(--surface-solid);
  padding: 10px 12px; border-radius: var(--radius); border: 1px solid var(--line);
  font-size: 12px; max-width: 280px; box-shadow: none;
}
.legend i { display: inline-block; width: 10px; height: 10px; margin-right: 6px; border-radius: var(--radius-sm); }
.legend .bar { height: 8px; width: 220px; margin: 6px 0; border-radius: var(--radius-sm); }
.legend .row { display: flex; justify-content: space-between; color: var(--muted); }
.legend .legend-share-labels { font-variant-numeric: tabular-nums; }

.rank-table-wrap { max-height: 280px; overflow: auto; margin: 4px 0 12px; }
.sel-votes-wrap { max-height: 200px; margin-top: 4px; }
.why-bins-wrap { max-height: 260px; margin-bottom: 16px; }
#macroBlock { margin-top: 8px; }
#cmpTurnoutBlock { margin-top: 8px; }
.rank-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.rank-table th, .rank-table td { padding: 5px 6px; text-align: left; border-bottom: 1px solid var(--line); }
.rank-table th { color: var(--muted); font-weight: 600; background: var(--surface-solid); }
.rank-table tbody tr[data-id] { cursor: pointer; }
.rank-table tbody tr[data-id]:hover { background: color-mix(in srgb, var(--accent) 10%, transparent); }
.rank-table .rank-sep td { color: var(--muted); font-size: 11px; padding-top: 10px; border-bottom: none; }

.surface {
  background: var(--surface-solid);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px;
  box-shadow: none;
}
.grid-2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; }
.list { display: flex; flex-direction: column; gap: 6px; }
.list-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  align-items: center;
  padding: 10px 12px;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: var(--surface-solid);
  cursor: pointer;
  transition: transform var(--dur) var(--ease), border-color var(--dur) var(--ease);
}
.list-row:hover { border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); }
.profile-row { width: 100%; color: inherit; font: inherit; text-align: left; }
.profile-sub { display: block; }
.list-row.selected { outline: 2px solid var(--accent); }
.pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 7px; border-radius: 4px; font-size: 11px; font-weight: 600;
  background: color-mix(in srgb, var(--accent) 14%, transparent); color: var(--accent);
}
.muted { color: var(--muted); }
.stack { display: flex; flex-direction: column; gap: 10px; }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.slider-row { display: grid; grid-template-columns: 120px 1fr 48px; gap: 10px; align-items: center; }
.proj-slider { grid-template-columns: minmax(140px, 220px) 1fr 48px; margin: 12px 0 4px; }
.proj-controls,
.polls-controls { flex-wrap: wrap; align-items: flex-end; gap: 10px 14px; }
#projEmpty[hidden],
#pollEmpty[hidden],
#whyEmpty[hidden] { display: none; }
#projBody[hidden],
#pollBody[hidden],
#whyBody[hidden] { display: none; }
.proj-details { margin-top: 4px; }
#projSeedHint { font-size: 11px; margin-top: -4px; }
.ctrl-static {
  display: inline-block;
  min-height: 2rem;
  padding: 0.35rem 0.5rem;
  color: var(--ink);
  font-size: 0.9rem;
}
.spacer { flex: 1; }

/* Data / Ideology / Lab full pages */
.page {
  flex: 1; min-height: 0; overflow: auto;
  padding: clamp(14px, 2vw, 24px);
  display: grid;
  gap: 20px;
}
.page.wide { grid-template-columns: minmax(280px, 340px) minmax(0, 1fr); align-items: start; }
/* sticky headers live in separate scroll containers (.scroll / .rank-table-wrap), not stacked */
.page h2 {
  font-family: var(--font-display);
  margin: 0 0 8px;
  font-size: 1.35rem;
  font-weight: 650;
  letter-spacing: -0.02em;
  text-wrap: balance;
}
.content-page {
  display: block;
  padding: clamp(16px, 3vw, 36px);
}
.content-page > .surface {
  width: min(100%, 1240px);
  margin: 0 auto;
  padding: clamp(18px, 2.5vw, 30px);
}
.content-page .stack { gap: 14px; }
.content-page .stack > h2,
.content-page .stack > .note,
.content-page .stack > .banner { margin: 0; }
.content-page .banner { border-radius: 6px; }
.content-page .ctrl { min-width: 0; max-width: 100%; }
.content-page .ctrl select,
.content-page .ctrl input { max-width: 100%; }
#perfilSearch { width: 300px; }
#pollBody h3 { margin: 24px 0 10px; }
#perfilList {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 270px), 1fr));
  gap: 8px;
}
#perfilList .profile-row {
  align-content: start;
  border-radius: 6px;
}

table.data {
  border-collapse: collapse; width: 100%; font-size: 12.5px;
}
table.data th, table.data td {
  padding: 8px 10px; border-bottom: 1px solid var(--line); text-align: right; white-space: nowrap;
}
table.data th { position: sticky; top: 0; background: var(--surface-solid); cursor: pointer; font-weight: 600; z-index: 1; }
/* Hallmark · answered 56: rank-table and data th stick inside different overflow parents */
table.data td:first-child, table.data th:first-child,
table.data td:nth-child(2), table.data th:nth-child(2) { text-align: left; }
.scroll {
  overflow: auto; max-height: min(70vh, 720px);
  border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface-solid);
}

.mobile-sheet-toggle { display: none; }

.maplibregl-popup-content {
  font-family: var(--font-ui);
  color: var(--ink);
  border-radius: var(--radius);
  padding: 8px 10px;
  border: 1px solid var(--line);
  box-shadow: none;
}

/* Ideology layout + filters */
.ideo-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 320px);
  gap: clamp(16px, 2vw, 24px);
  align-items: start;
}
.ideo-hero {
  grid-column: 1 / -1;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  padding: 0 0 18px;
  background: transparent;
}
.ideo-viz-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  min-width: 0;
}
.ideo-viz-grid .span-2 { grid-column: 1 / -1; }
.ideo-side { display: grid; gap: 14px; min-width: 0; }
.ideo-side > .surface,
.ideo-viz-grid > .surface {
  border: 0;
  border-top: 1px solid var(--line);
  border-radius: 0;
  padding: 14px 0 0;
  background: transparent;
}
.viz-card { min-width: 0; }
.viz-head h3 { margin: 0 0 2px; font-size: 1.05rem; }
.chart.ideo-chart { height: 360px; }
.ideo-level-tabs { flex-wrap: wrap; gap: 8px; align-items: stretch; }
.ideo-level-hint,
.ideo-score-legend {
  margin: 0;
  font-size: 12.5px;
  color: var(--muted);
  max-width: 62ch;
}
.ideo-filters { flex-wrap: wrap; gap: 10px 14px; align-items: flex-end; }
.row.filter-row {
  flex-wrap: nowrap;
  min-width: 0;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  padding-bottom: 4px;
}
.filter-row > * { flex: 0 0 auto; }
.filter-row .ctrl { max-width: min(240px, 70vw); }
.filter-row .ctrl > span { white-space: nowrap; }
.filter-row select, .filter-row input { max-width: 100%; }
.chip.chip-stack {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  text-align: left;
  line-height: 1.15;
}
.chip .chip-sub {
  font: 500 10.5px/1.2 var(--font-ui);
  color: var(--muted);
  max-width: 18rem;
}
.chip.active .chip-sub { color: color-mix(in srgb, var(--ink) 70%, var(--muted)); }
.ideo-more {
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 8px 12px;
  background: color-mix(in srgb, var(--surface-solid) 92%, transparent);
}
.ideo-more > summary {
  cursor: pointer;
  font: 600 12.5px/1.3 var(--font-ui);
  color: var(--ink);
  list-style: none;
}
.ideo-more > summary::-webkit-details-marker { display: none; }
.ideo-more > summary::before {
  content: "▸ ";
  color: var(--muted);
}
.ideo-more[open] > summary::before { content: "▾ "; }
.ideo-more .ideo-filters { margin-top: 10px; }
.chip {
  appearance: none;
  border: 1px solid var(--line);
  background: color-mix(in srgb, var(--surface-solid) 88%, transparent);
  color: var(--ink);
  font: 600 12px/1.2 var(--font-ui);
  padding: 8px 12px;
  border-radius: 5px;
  cursor: pointer;
  transition: background var(--dur) var(--ease), border-color var(--dur) var(--ease), color var(--dur) var(--ease);
}
.chip:hover { border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); }
.chip.active {
  background: color-mix(in srgb, var(--accent) 18%, var(--surface-solid));
  border-color: color-mix(in srgb, var(--accent) 55%, var(--line));
  color: var(--ink);
}
.ideo-empty-level {
  margin: 0;
  padding: 10px 12px;
  border: 1px solid var(--line);
  background: var(--bg-deep);
}
.hemi-wrap {
  width: 100%;
  height: 280px;
  min-height: 220px;
  position: relative;
}
.hemi-wrap svg { width: 100%; height: 100%; display: block; }
.hemi-wrap .hemi-dot { cursor: pointer; }
.hemi-wrap .hemi-dot:hover,
.hemi-wrap .hemi-dot.is-selected { stroke: var(--ink); stroke-width: 2px; }
.hemi-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 10px;
  font-size: 11px;
  color: var(--muted);
  max-width: 42%;
  justify-content: flex-end;
}
.hemi-legend span { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }
.hemi-legend i {
  width: 8px; height: 8px; border-radius: 50%;
  display: inline-block; background: currentColor;
}
.field-bar-wrap { margin-top: 8px; }
.field-bar-label {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--muted);
  margin-bottom: 4px;
}
.field-bar {
  display: flex;
  height: 10px;
  border-radius: 2px;
  overflow: hidden;
  background: var(--line);
}
.field-bar i { display: block; height: 100%; }
#ideoFieldLeft { background: var(--accent-soft); }
#ideoFieldRight { background: var(--accent-2); }
.field-bar-pct {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-top: 4px;
  font-size: 12px;
}
.ideo-muni-only .ideo-viz-grid,
.ideo-muni-only .ideo-side,
.ideo-muni-only .ideo-score-legend,
.ideo-muni-only #ideoMoreFilters { display: none; }

@media (max-width: 980px) {
  .ideo-layout { grid-template-columns: 1fr; }
  .ideo-viz-grid { grid-template-columns: 1fr; }
  .ideo-viz-grid .span-2 { grid-column: auto; }
  .hemi-legend { max-width: 100%; justify-content: flex-start; }
}

@media (max-width: 900px) {
  #exploreLayout, #exploreLayout.is-panel-collapsed {
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 0;
    background: var(--surface-solid);
  }
  #exploreLayout .map-stage { flex: 0 0 max(380px, 55vh); }
  #exploreLayout aside.panel.explore-aside {
    flex: 0 0 auto;
    align-self: stretch;
    max-height: none;
    overflow: visible;
    border-right: 0;
    border-top: 1px solid var(--line);
  }
  #exploreLayout .aside-tabs { position: static; }
  #exploreLayout .aside-tab-panels { overflow: visible; }
}

@media (max-width: 720px) {
  body {
    padding-bottom: calc(56px + env(safe-area-inset-bottom, 0px));
  }
  header.app-header {
    grid-template-columns: minmax(0, 1fr) auto;
    max-height: none;
  }
  .brand-name { display: none; }
  .primary-nav { display: none !important; }
  .nav-hamburger,
  #navMenuBtn { display: grid !important; }
  .mobile-tabbar { display: grid !important; }
  .toolbar {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    gap: 10px 12px;
    padding-bottom: 12px;
    scrollbar-width: thin;
  }
  .toolbar .ctrl { flex: 0 0 auto; }
  .toolbar select { max-width: 42vw; min-width: 7.5rem; }
  .cmp-toolbar .cmp-election select { max-width: none; min-width: 0; }
  #legend, .legend {
    max-width: min(280px, calc(100vw - 72px));
    font-size: 11px;
    bottom: calc(12px + env(safe-area-inset-bottom, 0px));
  }
  .nav-drawer {
    max-height: calc(100dvh - 56px - env(safe-area-inset-bottom, 0px));
    overflow-y: auto;
  }
  .about-grid { grid-template-columns: 1fr; }
  .about-page .about-hero { padding: 18px; gap: 14px; }
  .about-logo { width: 36px; height: 36px; }
  .why-charts > #scatterChart { height: 280px; }
  .map-layout {
    grid-template-columns: 1fr;
    grid-template-rows: 1fr auto;
  }
  .map-stage { min-height: 48vh; }
  .map-stage.dual { grid-template-columns: 1fr; grid-template-rows: 1fr 1fr; }
  aside.panel {
    border-left: 0;
    border-top: 1px solid var(--line);
    max-height: 42vh;
  }
  aside.panel.explore-aside { max-height: 42vh; }
  #exploreLayout aside.panel.explore-aside { max-height: none; }
  .explore-charts-link { right: 12px; top: 12px; }
  aside.panel.collapsed { display: none; }
  .mobile-sheet-toggle {
    display: inline-flex;
    position: absolute; right: 12px; top: 12px; bottom: auto; z-index: 6;
  }
  .page.wide { grid-template-columns: minmax(0, 1fr); }
  .grid-2 { grid-template-columns: minmax(0, 1fr); }
}

/* Compare fills the viewport; map stage gets a geography-friendly height via JS */
#view-compare.active {
  flex: 1;
  min-height: 0;
  overflow: hidden;
}
#view-compare .cmp-layout {
  flex: 1 1 auto;
  min-height: 0;
  height: auto;
  grid-template-rows: minmax(0, 1fr);
  background: var(--surface-solid);
  align-items: stretch;
}
#view-compare .map-stage.dual {
  min-height: 0;
  height: 100%;
  max-height: 100%;
  align-self: stretch;
  background: var(--map-bg);
}
#view-compare .cmp-aside {
  min-height: 0;
  max-height: 100%;
  overflow: auto;
  align-self: stretch;
}

@media (min-width: 721px) and (max-width: 900px) {
  #view-compare .cmp-layout {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: minmax(280px, 1fr) minmax(200px, 42vh);
    height: auto;
    min-height: 0;
  }
  #view-compare .cmp-aside {
    border-left: 0;
    border-top: 1px solid var(--line);
    max-height: none;
  }
}

/* Phone: scrollable Compare — stacked maps + full charts (no 42vh clip) */
@media (max-width: 720px) {
  #view-compare.active {
    overflow: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
  }
  #view-compare .cmp-toolbar {
    position: sticky;
    top: 0;
    z-index: 4;
    background: var(--surface-solid);
    border-bottom: 1px solid var(--line);
  }
  #view-compare .cmp-layout {
    display: flex;
    flex-direction: column;
    flex: 0 0 auto;
    height: auto;
    min-height: 0;
    overflow: visible;
  }
  #view-compare .map-stage.dual {
    flex: 0 0 auto;
    width: 100%;
    height: min(68vh, 560px);
    min-height: 300px;
    max-height: none;
    align-self: stretch;
    grid-template-columns: 1fr;
    grid-template-rows: minmax(0, 1fr) minmax(0, 1fr);
  }
  #view-compare .cmp-aside {
    flex: 0 0 auto;
    max-height: none;
    overflow: visible;
    border-left: 0;
    border-top: 1px solid var(--line);
    padding-bottom: calc(24px + env(safe-area-inset-bottom, 0px));
  }
  #view-compare .cmp-aside .chart.mid { height: 200px; }
  #view-compare .cmp-sm-grid {
    grid-template-columns: 1fr;
  }
  #view-compare .cmp-sm-cell .chart.sm { height: 128px; }
}

#view-movers .page,
#view-data .page,
#view-lab .page {
  width: min(100%, 1480px);
  margin-inline: auto;
  align-content: start;
}
#view-movers .page > .surface,
#view-why .why-surface {
  border: 0;
  border-radius: 0;
  padding: 0;
  background: transparent;
}
#view-movers .page > .surface > h2:not(:first-child),
#view-why #whyBody > h2 {
  margin-top: 20px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}
#view-why .why-page {
  width: min(100%, 1480px);
  margin-inline: auto;
}
#view-why .why-surface { box-shadow: none; }
#view-movers .page > .surface > h2:first-child,
#view-why .why-surface > h2:first-child {
  margin-top: 0;
}
#view-data .page > .surface,
#view-lab .page > .surface {
  box-shadow: none;
  border-radius: 6px;
}
#view-lab .page > .surface:first-child {
  border-top: 1px solid var(--line);
}
#view-lab #labMap {
  border-radius: 6px !important;
}
#view-ideology .ideo-layout,
#view-perfis .content-page,
#view-pesquisas .content-page,
#view-projecao .content-page,
#view-about .about-page {
  width: min(100%, 1480px);
  margin-inline: auto;
}
#view-perfis #perfisDirectory,
#view-perfis #perfisDetail,
#view-pesquisas .content-page > .surface,
#view-projecao .content-page > .surface {
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}
#view-perfis #perfisDirectory,
#view-perfis #perfisDetail {
  padding-inline: 0;
}
#view-pesquisas .content-page > .surface,
#view-projecao .content-page > .surface {
  border-top: 1px solid var(--line);
  padding-inline: 0;
}
#view-pesquisas #pollActual {
  margin: 0;
  padding: 8px 0;
  border-top: 1px solid var(--line);
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}
#view-pesquisas #pollMeta {
  padding-top: 8px;
  border-top: 1px solid var(--line);
  max-width: 95ch;
}
#view-pesquisas #pollBody h3 { margin-top: 18px; }
#view-about .about-page { padding-top: clamp(20px, 4vw, 48px); }
#view-about .about-grid { gap: 20px 28px; }
#view-about .about-hero h2 { font-size: 1.85rem; }
#view-about .about-grid h3 { font-family: var(--font-ui); font-size: 1rem; }
#view-about .about-grid .note { max-width: 62ch; }
#view-about .about-grid .btn { margin-top: auto; }
#view-compare .cmp-aside { background: var(--surface-solid); }
#view-compare .map-pane h3 { border-radius: 5px; }
#view-compare .cmp-sm-cell {
  border-radius: 5px;
  background: var(--surface-solid);
}
table.data th,
table.data td,
.rank-table th,
.rank-table td {
  font-variant-numeric: tabular-nums;
}
select:hover,
input[type="search"]:hover,
input[type="text"]:hover,
input[type="number"]:hover,
textarea:hover {
  border-color: color-mix(in srgb, var(--accent) 45%, var(--line));
}

.country-notice {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  margin: 0;
  padding: 8px 18px;
  font-size: 12px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--panel, var(--bg));
  border-bottom: 1px solid var(--line);
  overflow-wrap: anywhere;
}
.country-notice-retry {
  flex: 0 0 auto;
  margin: 0;
  padding: 4px 10px;
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  color: var(--ink);
  background: color-mix(in srgb, var(--accent) 14%, var(--surface-solid, var(--bg)));
  border: 1px solid var(--line);
  border-radius: var(--radius, 4px);
  cursor: pointer;
}
.country-notice-retry:hover {
  border-color: color-mix(in srgb, var(--accent) 45%, var(--line));
}
.country-notice-retry:disabled {
  opacity: 0.55;
  cursor: wait;
}
.app-status {
  position: fixed;
  inset: 72px 16px auto;
  z-index: 2000;
  margin: 0 auto;
  max-width: 560px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-solid);
  box-shadow: none;
}
.app-status h1 {
  font-size: 1.35rem;
  font-variant-numeric: tabular-nums;
  text-wrap: balance;
}
#ecChart { height: 270px; }
