:root {
  color-scheme: light;
  --conv-bg: #f2f3ef;
  --conv-surface: #fff;
  --conv-soft: #f7f8f5;
  --conv-line: #d9ded6;
  --conv-line-strong: #bcc6bc;
  --conv-text: #17221b;
  --conv-muted: #667069;
  --conv-green-dark: #0e3525;
  --conv-green: #216044;
  --conv-teal: #23857e;
  --conv-gold: #c99b36;
  --conv-rust: #b95d3d;
  --conv-neutral: #a7afa9;
  --conv-shadow: 0 8px 26px rgba(18, 45, 30, .07);
  --conv-radius: 10px;
}

* { box-sizing: border-box; }
html, body { max-width: 100%; overflow-x: hidden; }
body { margin: 0; background: var(--conv-bg); color: var(--conv-text); font: 14px/1.45 Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
button, input { font: inherit; }
h1, h2, p { margin: 0; }

.conv-header { display: flex; align-items: center; justify-content: space-between; gap: 24px; min-height: 92px; padding: 17px clamp(18px, 3vw, 46px); border-bottom: 1px solid var(--conv-line); background: rgba(255, 255, 255, .97); }
.conv-brand { display: flex; align-items: center; gap: 18px; min-width: 0; }
.conv-brand img { width: 104px; height: auto; flex: 0 0 auto; }
.conv-brand > div { padding-left: 18px; border-left: 1px solid var(--conv-line); }
.conv-brand h1 { color: var(--conv-green-dark); font-size: clamp(25px, 2.6vw, 38px); line-height: 1.08; letter-spacing: -.035em; }
.conv-brand p { margin-top: 5px; color: var(--conv-muted); font-size: clamp(13px, 1.2vw, 16px); }
.conv-header-meta { display: grid; justify-items: end; gap: 6px; color: var(--conv-muted); font-size: 11px; text-align: right; }
.conv-header-meta nav { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 12px; }
.conv-header-meta a { color: var(--conv-green); font-weight: 780; text-decoration: none; }
.conv-header-meta strong { color: var(--conv-teal); font-size: 11px; }
.conv-header-meta strong.is-error { color: var(--conv-rust); }

.conv-dashboard { width: min(1780px, 100%); margin: 0 auto; padding: 16px clamp(14px, 2vw, 30px) 30px; }
.conv-kpis { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); margin-bottom: 14px; border: 1px solid var(--conv-line); border-radius: var(--conv-radius); background: var(--conv-surface); box-shadow: var(--conv-shadow); }
.conv-kpis article { position: relative; min-width: 0; padding: 16px 17px; }
.conv-kpis article + article::before { content: ""; position: absolute; inset: 14px auto 14px 0; width: 1px; background: var(--conv-line); }
.conv-kpis span, .conv-kpis small { display: block; color: var(--conv-muted); }
.conv-kpis span { margin-bottom: 5px; font-size: 10px; font-weight: 800; letter-spacing: .025em; text-transform: uppercase; }
.conv-kpis strong { display: block; overflow: hidden; color: var(--conv-green-dark); font-size: clamp(19px, 1.65vw, 27px); line-height: 1.12; text-overflow: ellipsis; white-space: nowrap; }
.conv-kpis small { margin-top: 5px; font-size: 10px; }
.conv-kpi-opportunity strong { color: var(--conv-rust); }

.conv-map-panel, .conv-detail-panel, .conv-panel, .conv-methodology { border: 1px solid var(--conv-line); border-radius: var(--conv-radius); background: var(--conv-surface); box-shadow: var(--conv-shadow); }
.conv-territory { display: grid; grid-template-columns: minmax(0, 2.5fr) minmax(310px, .8fr); gap: 14px; align-items: stretch; }
.conv-map-panel, .conv-panel { min-width: 0; padding: 14px; }
.conv-section-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 42px; margin-bottom: 10px; }
.conv-section-head h2 { font-size: 15px; line-height: 1.2; letter-spacing: .01em; text-transform: uppercase; }
.conv-section-head p { margin-top: 3px; color: var(--conv-muted); font-size: 11px; }
.conv-section-head button { min-height: 34px; border: 1px solid var(--conv-line-strong); border-radius: 6px; background: #fff; color: var(--conv-green); padding: 0 12px; font-size: 11px; font-weight: 800; cursor: pointer; }
.conv-section-head button:hover, .conv-section-head button:focus-visible { border-color: var(--conv-green); outline: none; }

.conv-map-stage { position: relative; min-height: 590px; }
.conv-leaflet-map { height: 590px; min-height: 500px; border: 1px solid var(--conv-line-strong); border-radius: 7px; background: #e6ebe8; overflow: hidden; }
.conv-layer-control, .conv-map-legend { position: absolute; z-index: 650; border: 1px solid rgba(23, 34, 27, .18); border-radius: 6px; background: rgba(255, 255, 255, .96); box-shadow: 0 6px 18px rgba(18, 45, 30, .13); }
.conv-layer-control { top: 11px; right: 11px; display: grid; gap: 6px; min-width: 170px; padding: 9px 10px; }
.conv-layer-control strong { padding-bottom: 5px; border-bottom: 1px solid var(--conv-line); font-size: 12px; text-transform: uppercase; }
.conv-layer-control label { display: flex; align-items: center; gap: 6px; font-size: 11px; }
.conv-layer-control input { margin: 0; accent-color: var(--conv-green); }
.conv-map-legend { bottom: 12px; left: 12px; display: grid; gap: 7px; width: 236px; max-width: calc(100% - 24px); padding: 10px; color: var(--conv-muted); font-size: 10px; }
.conv-map-legend strong { color: var(--conv-text); font-size: 11px; text-transform: uppercase; }
.conv-map-legend span { display: flex; align-items: center; gap: 7px; }
.conv-map-legend i { width: 18px; height: 11px; flex: 0 0 auto; border: 1px solid rgba(23, 34, 27, .18); border-radius: 2px; }
.conv-map-tooltip strong { display: block; margin-bottom: 3px; color: var(--conv-green-dark); }
.conv-leaflet-map .leaflet-tooltip { border-color: var(--conv-line-strong); border-radius: 6px; box-shadow: 0 6px 18px rgba(18, 45, 30, .15); color: var(--conv-text); line-height: 1.45; }
.conv-seat-symbol, .conv-seat-legend { position: relative; display: inline-block; width: 8px; height: 8px; flex: 0 0 auto; border: 1px solid #101b14; border-radius: 50%; background: #fff; }
.conv-seat-symbol::after, .conv-seat-legend::after { content: ""; position: absolute; top: 50%; left: 50%; width: 3px; height: 3px; border-radius: 50%; background: #101b14; transform: translate(-50%, -50%); }
.conv-seat-icon { z-index: 700 !important; border: 0; background: transparent; }

.conv-detail-panel { min-width: 0; overflow: hidden; }
.conv-detail-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 44px; padding: 10px 15px; background: var(--conv-green-dark); color: #fff; }
.conv-detail-head span { font-size: 11px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; }
.conv-detail-head strong { font-size: 11px; }
.conv-detail-body { display: grid; align-content: start; gap: 20px; min-height: 602px; padding: 22px 18px; }
.conv-detail-kicker { color: var(--conv-teal); font-size: 10px; font-weight: 800; text-transform: uppercase; }
.conv-detail-body h2 { margin-top: 4px; color: var(--conv-green-dark); font-size: clamp(24px, 2.1vw, 34px); line-height: 1.08; }
.conv-detail-code { margin-top: 8px; color: var(--conv-muted); font-size: 12px; }
.conv-class-badge { padding: 10px 12px; border-left: 4px solid var(--conv-neutral); background: var(--conv-soft); font-size: 12px; font-weight: 800; }
.conv-class-badge[data-class="alta_votacao_alta_emenda"] { border-color: var(--conv-green); color: var(--conv-green-dark); }
.conv-class-badge[data-class="alta_votacao_baixa_emenda"] { border-color: var(--conv-teal); color: #0d5f5a; }
.conv-class-badge[data-class="baixa_votacao_alta_emenda"] { border-color: var(--conv-gold); color: #74530d; }
.conv-class-badge[data-class="baixa_votacao_baixa_emenda"] { border-color: var(--conv-rust); color: #7d3524; }
.conv-detail-metrics { display: grid; gap: 0; margin: 0; }
.conv-detail-metrics div { display: grid; grid-template-columns: 1fr auto; gap: 12px; align-items: baseline; padding: 12px 0; border-bottom: 1px solid var(--conv-line); }
.conv-detail-metrics dt { color: var(--conv-muted); font-size: 11px; }
.conv-detail-metrics dd { margin: 0; color: var(--conv-green-dark); font-size: 14px; font-weight: 800; text-align: right; }
.conv-detail-note { align-self: end; padding: 12px; border-left: 3px solid var(--conv-gold); background: #faf6ea; color: #61563e; font-size: 11px; }

.conv-analysis { display: grid; grid-template-columns: minmax(0, 2fr) minmax(300px, .9fr); gap: 14px; margin-top: 14px; }
.conv-chart { width: 100%; height: 360px; min-height: 300px; }
.conv-opportunities-panel { grid-column: 1 / -1; }
.conv-opportunities-panel .conv-chart { height: 380px; }
.conv-section-head > span { color: var(--conv-rust); font-size: 12px; font-weight: 800; }
.conv-matrix-panel { position: relative; }
.conv-matrix { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); grid-template-rows: repeat(2, minmax(0, 1fr)); gap: 2px; height: 310px; margin: 18px 5px 8px 22px; background: var(--conv-line); }
.conv-matrix-cell { display: grid; place-content: center; gap: 4px; min-width: 0; padding: 14px; color: #fff; text-align: center; }
.conv-matrix-cell strong { font-size: clamp(25px, 2.4vw, 39px); line-height: 1; }
.conv-matrix-cell span { font-size: 11px; font-weight: 800; }
.conv-matrix-cell small { opacity: .9; font-size: 10px; }
.conv-matrix-cell[data-class="alta_votacao_alta_emenda"] { background: var(--conv-green); }
.conv-matrix-cell[data-class="alta_votacao_baixa_emenda"] { background: var(--conv-teal); }
.conv-matrix-cell[data-class="baixa_votacao_alta_emenda"] { background: var(--conv-gold); color: #33260c; }
.conv-matrix-cell[data-class="baixa_votacao_baixa_emenda"] { background: var(--conv-rust); }
.conv-matrix-axis { color: var(--conv-muted); font-size: 9px; font-weight: 800; letter-spacing: .04em; text-align: center; text-transform: uppercase; }
.conv-matrix-axis-y { position: absolute; top: 56%; left: 4px; transform: rotate(-90deg) translateX(-50%); transform-origin: left center; }

.conv-methodology { margin-top: 14px; overflow: hidden; }
.conv-methodology summary { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 17px; cursor: pointer; list-style: none; }
.conv-methodology summary::-webkit-details-marker { display: none; }
.conv-methodology summary strong { color: var(--conv-green-dark); font-size: 13px; text-transform: uppercase; }
.conv-methodology summary span { color: var(--conv-muted); font-size: 10px; }
.conv-methodology > div { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; padding: 16px 17px; border-top: 1px solid var(--conv-line); color: var(--conv-muted); font-size: 11px; }

@media (max-width: 1220px) {
  .conv-kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .conv-kpis article:nth-child(4)::before { display: none; }
  .conv-territory { grid-template-columns: minmax(0, 2fr) minmax(280px, .85fr); }
  .conv-analysis { grid-template-columns: 1fr; }
  .conv-opportunities-panel { grid-column: auto; }
}

@media (max-width: 860px) {
  .conv-header { align-items: flex-start; flex-direction: column; }
  .conv-header-meta { justify-items: start; text-align: left; }
  .conv-header-meta nav { justify-content: flex-start; }
  .conv-territory { grid-template-columns: 1fr; }
  .conv-detail-body { min-height: auto; }
  .conv-methodology > div { grid-template-columns: 1fr; }
}

@media (max-width: 620px) {
  .conv-header { min-height: auto; padding-block: 14px; }
  .conv-brand { align-items: flex-start; gap: 11px; }
  .conv-brand img { width: 78px; }
  .conv-brand > div { padding-left: 11px; }
  .conv-brand h1 { font-size: 24px; }
  .conv-header-meta > span { max-width: 280px; }
  .conv-dashboard { padding-top: 10px; }
  .conv-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .conv-kpis article:nth-child(odd)::before { display: none; }
  .conv-kpis article:nth-child(4)::before { display: block; }
  .conv-kpis strong { font-size: 19px; }
  .conv-map-panel { padding: 10px; }
  .conv-map-stage { min-height: 510px; }
  .conv-leaflet-map { height: 510px; min-height: 440px; }
  .conv-layer-control { position: static; grid-template-columns: repeat(3, minmax(0, 1fr)); width: 100%; min-width: 0; margin-bottom: 8px; }
  .conv-layer-control strong { grid-column: 1 / -1; }
  .conv-layer-control label { align-items: flex-start; font-size: 10px; }
  .conv-map-legend { bottom: 9px; left: 9px; width: 218px; }
  .conv-chart { height: 310px; }
  .conv-opportunities-panel .conv-chart { height: 340px; }
  .conv-matrix { height: 280px; }
  .conv-matrix-cell { padding: 8px; }
  .conv-matrix-cell strong { font-size: 25px; }
}

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; } }
