.observablehq,
#observablehq-center,
#observablehq-main,
#observablehq-footer,
#observablehq-header {
    background: transparent;
}

.observablehq a {
    color: #1d4d3d;
}

.observablehq h1,
.observablehq h2,
.observablehq h3,
.observablehq h4,
.observablehq h5,
.observablehq h6 {
    max-width: none;
}

.observablehq p,
.observablehq table,
.observablehq .card,
.observablehq .hero-panel,
.observablehq .metrics-grid,
.observablehq .table-shell,
.observablehq .region-explorer,
.observablehq .state-explorer {
    max-width: none;
}

.observablehq--block {
    margin: 0;
    width: 100%;
}

.observablehq--block:empty {
    display: none;
}

#observablehq-main .observablehq--block > .observablehq {
    display: block;
    width: 100%;
    max-width: none;
}

#observablehq-header {
    border-bottom: none;
    position: sticky;
    top: 0;
    height: auto;
    padding: 0;
    background: transparent;
    left: auto;
    right: auto;
    z-index: 1000;
    display: block;
    margin: 0;
}

#observablehq-header ~ #observablehq-main {
    margin-top: 0;
}

.site-shell {
    width: var(--layout-width);
    margin: 0 auto;
}

#observablehq-center {
    width: var(--layout-width);
    margin: 0 auto;
}

.site-topbar {
    display: flex;
    justify-content: flex-start;
    gap: 1.5rem;
    align-items: flex-end;
    padding: 1.2rem 1rem 1rem;
}

.brand-lockup {
    display: flex;
    justify-content: flex-start;
    flex: 1 1 auto;
}

.brand-home {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 0.7rem;
    color: inherit;
    text-decoration: none;
}

.brand-logo {
    display: block;
    width: auto;
    height: 44px;
    object-fit: contain;
    object-position: left center;
    flex: 0 0 auto;
}

.brand-text {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.brand-kicker {
    color: var(--theme-foreground-muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-size: 0.72rem;
}

.brand-title {
    color: var(--theme-foreground);
    font-weight: 700;
    font-size: 1.2rem;
}

.site-nav {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    margin-left: auto;
}

.site-nav a {
    color: var(--theme-foreground);
    text-decoration: none;
    padding-bottom: 0.15rem;
    border-bottom: 2px solid transparent;
}

.site-nav a:hover {
    border-color: var(--theme-accent);
}

#observablehq-main,
#observablehq-footer {
    width: 100%;
    margin: 0 auto;
}

#observablehq-main {
    padding: 0 0 3rem;
}

#observablehq-main.observablehq {
    line-height: 1.45;
}

.hero-panel {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    gap: 1.5rem;
    align-items: stretch;
    margin: 2rem 0 1.5rem;
}

.dashboard-hero {
    display: block;
    width: 100%;
    margin: 1rem 0 1.25rem;
}

.dashboard-toolbar {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    column-gap: 1rem;
    align-items: start;
    margin-bottom: 1rem;
    padding: 0.9rem 1rem;
    border-radius: 18px;
    background: linear-gradient(
        135deg,
        rgba(255, 255, 255, 0.98),
        rgba(248, 250, 247, 0.98)
    );
    border: 1px solid rgba(217, 221, 215, 0.95);
    box-shadow: 0 14px 36px rgba(20, 31, 39, 0.05);
}

.dashboard-toolbar__title h1 {
    margin: 0;
    font-family: var(--font-sans);
    font-size: clamp(1.5rem, 2vw, 2rem);
    line-height: 1.12;
    font-weight: 700;
}

.dashboard-toolbar__title p {
    margin: 0.2rem 0 0;
    color: var(--theme-foreground-muted);
    font-size: 0.92rem;
    white-space: nowrap;
}

.dashboard-toolbar__side {
    display: grid;
    justify-items: end;
    align-content: start;
    gap: 0.3rem;
}

.dashboard-toolbar__meta {
    display: flex;
    justify-content: end;
    align-items: center;
    font-size: 0.78rem;
    color: var(--theme-foreground-muted);
    white-space: nowrap;
    margin-top: -0.15rem;
}

.dashboard-toolbar__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    justify-content: end;
}

.dashboard-stage {
    display: grid;
    width: 100%;
    grid-template-columns: minmax(280px, 340px) minmax(0, 1fr);
    gap: 1rem;
    align-items: stretch;
}

.dashboard-sidebar {
    display: grid;
    gap: 0.5rem;
    align-content: start;
}

.dashboard-main {
    display: grid;
}

.panel-card {
    border-radius: 20px;
    box-shadow: 0 14px 36px rgba(20, 31, 39, 0.05);
    border-color: rgba(217, 221, 215, 0.95);
    padding: 0.95rem;
}

.panel-card--map {
    min-height: 620px;
}

.map-stage {
    position: relative;
}

.map-overlay-card {
    position: absolute;
    left: 1rem;
    bottom: 1rem;
    width: min(320px, calc(100% - 2rem));
    padding: 0.85rem 0.95rem 0.95rem;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.93);
    border: 1px solid rgba(217, 221, 215, 0.95);
    box-shadow: 0 14px 28px rgba(20, 31, 39, 0.08);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
    z-index: 4;
}

.map-overlay-card .section-heading {
    margin-bottom: 0.55rem;
}

.map-overlay-card .section-heading h3 {
    margin: 0;
    font-family: var(--font-serif);
    font-size: 1.02rem;
}

.map-overlay-card .section-heading p {
    margin: 0.18rem 0 0;
    font-size: 0.8rem;
    line-height: 1.34;
}

.map-overlay-card .approval-bar {
    gap: 0.55rem;
}

.map-overlay-card .approval-bar__legend {
    margin-bottom: 0;
    font-size: 0.76rem;
}

.map-overlay-card .approval-bar__track {
    min-height: 38px;
}

.map-overlay-card .approval-bar__segment strong {
    font-size: 0.84rem;
}

.map-overlay-card .approval-bar__meta {
    gap: 0.2rem;
    font-size: 0.76rem;
}

.panel-card .metrics-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem;
    margin: 0;
}

.panel-card .metric-card {
    padding: 0.62rem 0.68rem;
}

.panel-card .metric-value {
    font-size: 1.18rem;
}

.panel-card .metric-label {
    font-size: 0.74rem;
}

.metric-value-row {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    margin-top: 0.45rem;
}

.panel-card .metric-delta {
    margin-top: 0;
    font-size: 0.68rem;
    padding: 0.16rem 0.42rem;
}

.panel-card--compact,
.panel-card--summary {
    padding-top: 0.82rem;
    padding-bottom: 0.82rem;
    box-shadow: 0 0 8px rgba(20, 31, 39, 0.07);
}

.panel-card--summary-strip {
    margin-bottom: 1rem;
}

.summary-strip__grid .metrics-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.75rem;
    margin: 0;
}

.summary-strip__grid .metric-card {
    padding: 0.72rem 0.78rem;
}

.summary-strip__grid .metric-value {
    font-size: 1.45rem;
}

.summary-strip__grid .metric-label {
    font-size: 0.78rem;
}

.summary-strip__grid .metric-value-row {
    gap: 0.38rem;
}

.summary-strip__grid .metric-delta {
    padding: 0.14rem 0.4rem;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 700;
    line-height: 1;
    border: 1px solid transparent;
    transform: translateY(1px);
}

.panel-card--timeline {
    min-height: 100%;
}

.approval-bar {
    display: grid;
    gap: 0.5rem;
}

.approval-bar__legend,
.approval-bar__meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem 1rem;
    font-size: 0.78rem;
    color: var(--theme-foreground-muted);
}

.swatch {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 999px;
    margin-right: 0.35rem;
}

.swatch-approved {
    background: #2f6b4f;
}
.swatch-pending {
    background: #d96b72;
}
.swatch-neutral {
    background: #dce5de;
}

.approval-bar__track {
    display: flex;
    min-height: 32px;
    overflow: hidden;
    border-radius: 14px;
    background: #eef1ed;
}

.approval-bar__segment {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: fit-content;
    color: white;
    font-weight: 700;
}

.approval-bar__segment strong {
    padding: 0 0.65rem;
    font-size: 0.95rem;
}

.approval-bar__segment--approved {
    background: linear-gradient(135deg, #2f6b4f, #4e8868);
}

.approval-bar__segment--pending {
    background: linear-gradient(135deg, #d96b72, #ca5560);
}

.approval-group {
    display: grid;
    gap: 0.35rem;
    border-bottom: 1px solid var(--theme-border, #d3d8df);
    padding-bottom: 0.5rem;
}

.approval-group__header {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--color-ink);
}

.approval-divider {
    border: none;
    border-top: 1px solid var(--theme-border, #d3d8df);
    margin: 0;
}

.dashboard-bottom {
    margin-top: 0;
}

.hero-copy,
.hero-aside,
.card,
.metric-card,
.table-shell,
.region-explorer,
.state-explorer,
.brazil-map {
    background: #ffffff;
    border: 1px solid rgba(215, 210, 199, 0.9);
    border-radius: 22px;
    box-shadow: 0 22px 60px rgba(20, 31, 39, 0.06);
}

@supports (backdrop-filter: blur(14px)) {
    .card,
    .metric-card,
    .table-shell,
    .region-explorer,
    .state-explorer,
    .brazil-map {
        background: var(--theme-card-background);
        -webkit-backdrop-filter: blur(14px);
        backdrop-filter: blur(14px);
    }
}

.hero-copy {
    padding: 2rem;
}

.hero-copy h1 {
    font-family: var(--font-serif);
    font-size: clamp(2.4rem, 4vw, 4.2rem);
    line-height: 0.95;
    margin: 0 0 1rem;
}

.hero-copy p {
    max-width: 60ch;
    color: var(--theme-foreground-muted);
    font-size: 1.03rem;
}

.hero-kicker {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--theme-foreground-focus);
    margin-bottom: 1rem;
}

.hero-meta {
    display: grid;
    gap: 0.65rem;
    margin: 1.5rem 0;
}

.hero-meta strong {
    font-size: 1.8rem;
    display: block;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 1.25rem;
}

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    min-height: 44px;
    padding: 0 1rem;
    border-radius: 999px;
    text-decoration: none;
    font-weight: 600;
    border: 1px solid transparent;
}

.button-primary {
    color: white;
    background: linear-gradient(135deg, #2f6b4f, #1d4d3d);
    box-shadow: 0 10px 22px rgba(29, 77, 61, 0.18);
}

.button-primary:visited,
.button-primary:hover,
.button-primary:active {
    color: white;
}

.button-disabled,
.button-disabled:visited,
.button-disabled:hover,
.button-disabled:active {
    color: rgba(255, 255, 255, 0.88);
    background: linear-gradient(135deg, #88a898, #6f8f7f);
    box-shadow: none;
    cursor: not-allowed;
    pointer-events: none;
    opacity: 0.72;
}

.button-secondary {
    color: var(--theme-foreground);
    background: rgba(255, 255, 255, 0.55);
    border-color: rgba(215, 210, 199, 0.9);
}

.hero-aside {
    padding: 1.6rem;
    display: grid;
    gap: 1rem;
    align-content: start;
}

.hero-aside p {
    margin: 0;
    color: var(--theme-foreground-muted);
}

.metrics-grid {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 1rem;
    margin: 1.25rem 0 1.5rem;
}

.metric-card {
    padding: 1.1rem 1rem;
    position: relative;
}

.metric-card::before {
    content: "";
    position: absolute;
    inset: 0 0 auto;
    height: 4px;
    border-radius: 22px 22px 0 0;
    background: linear-gradient(
        90deg,
        rgba(47, 107, 79, 0.9),
        rgba(200, 154, 43, 0.9)
    );
}

.metric-card.tone-accent::before {
    background: var(--theme-accent);
}

.metric-label {
    margin: 0;
    font-size: 0.82rem;
    color: var(--theme-foreground-muted);
}

.metric-value {
    display: block;
    margin-top: 0.6rem;
    font-size: 2rem;
    line-height: 1;
}

.metric-detail {
    margin: 0.65rem 0 0;
    color: var(--theme-foreground-muted);
    font-size: 0.9rem;
}

.metric-delta {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-top: 0.75rem;
    padding: 0.2rem 0.5rem;
    border-radius: 999px;
    font-size: 0.8rem;
    background: rgba(47, 107, 79, 0.08);
}

.metric-delta.up {
    color: #1d4d3d;
    background: rgba(47, 107, 79, 0.12);
    border-color: rgba(47, 107, 79, 0.14);
}

.metric-delta.down {
    color: #8a3b2b;
    background: rgba(168, 87, 66, 0.1);
    border-color: rgba(168, 87, 66, 0.14);
}

.metric-delta.flat {
    color: var(--theme-foreground-muted);
    background: rgba(109, 119, 130, 0.08);
    border-color: rgba(109, 119, 130, 0.1);
}

.metric-delta[data-tooltip] {
    position: relative;
    cursor: default;
}

.metric-delta[data-tooltip]::after {
    content: attr(data-tooltip);
    position: absolute;
    top: calc(100% + 6px);
    left: 50%;
    transform: translateX(-50%) scale(0.9);
    white-space: nowrap;
    padding: 0.45rem 0.75rem;
    border-radius: 10px;
    background: rgba(22, 32, 43, 0.94);
    color: #fff;
    font-size: 0.72rem;
    font-weight: 500;
    pointer-events: none;
    opacity: 0;
    transition:
        opacity 0.15s ease,
        transform 0.15s ease;
    z-index: 100;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

.metric-delta[data-tooltip]:hover::after,
.metric-delta[data-tooltip].tooltip-open::after {
    opacity: 1;
    transform: translateX(-50%) scale(1);
}

.grid-two,
.grid-three {
    display: grid;
    gap: 1rem;
    margin: 1rem 0 1.5rem;
}

.grid-two {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}
.grid-three {
    grid-template-columns: 1.2fr 0.8fr 1fr;
}

.card {
    padding: 1.2rem;
    min-width: 0;
}

.card h2,
.section-heading h2 {
    margin: 0 0 0.3rem;
    font-family: var(--font-serif);
    font-size: 1.22rem;
}

.card p,
.section-heading p {
    margin: 0;
    color: var(--theme-foreground-muted);
    font-size: 0.88rem;
}

.section-heading {
    display: flex;
    justify-content: space-between;
    align-items: end;
    gap: 1rem;
    margin-bottom: 0.55rem;
}

.section-heading__link {
    flex-shrink: 0;
    font-size: 0.82rem;
    font-weight: 500;
    color: var(--theme-foreground-focus);
    text-decoration: none;
    white-space: nowrap;
    padding-bottom: 0.1rem;
}

.section-heading__link:hover {
    text-decoration: underline;
}

.snapshot-card {
    display: grid;
    gap: 0.8rem;
}

.snapshot-card__label {
    display: block;
    font-size: 0.74rem;
    color: var(--theme-foreground-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.snapshot-card__value {
    display: block;
    margin-top: 0.18rem;
    font-size: 1rem;
    font-weight: 700;
    color: var(--theme-foreground);
}

.region-summary {
    display: grid;
    gap: 0.8rem;
}

.region-summary__row {
    display: grid;
    gap: 0.28rem;
}

.region-summary__header,
.region-summary__meta {
    display: flex;
    justify-content: space-between;
    gap: 0.75rem;
    font-size: 0.8rem;
}

.region-summary__header strong {
    font-size: 0.86rem;
}

.region-summary__meta {
    color: var(--theme-foreground-muted);
}

.region-summary__track {
    width: 100%;
    height: 8px;
    border-radius: 999px;
    background: #edf1ec;
    overflow: hidden;
}

.region-summary__fill {
    display: block;
    height: 100%;
    border-radius: 999px;
    background: linear-gradient(90deg, #7aa57c, #2f6b4f);
}

.region-ranking {
    display: grid;
    gap: 0.8rem;
}

.region-ranking__row {
    display: grid;
    gap: 0.28rem;
}

.region-ranking__header,
.region-ranking__meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
}

.region-ranking__label {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    min-width: 0;
}

.region-ranking__position {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.15rem;
    height: 1.15rem;
    border-radius: 999px;
    background: rgba(29, 77, 61, 0.08);
    color: #1d4d3d;
    font-size: 0.68rem;
    font-weight: 700;
}

.region-ranking__header strong {
    font-size: 0.9rem;
}

.region-ranking__value {
    font-size: 0.84rem;
    font-weight: 700;
    color: var(--theme-foreground);
    white-space: nowrap;
}

.region-ranking__track {
    width: 100%;
    height: 10px;
    border-radius: 999px;
    background: #edf1ec;
    overflow: hidden;
}

.region-ranking__fill {
    display: block;
    height: 100%;
    border-radius: 999px;
    background: linear-gradient(90deg, #7aa57c, #2f6b4f);
}

.region-ranking__meta {
    font-size: 0.78rem;
    color: var(--theme-foreground-muted);
}

.approval-evolution-card {
    margin-top: 1.5rem;
}

.approval-evolution-chart {
    display: grid;
    gap: 0.85rem;
}

.approval-evolution-chart__legend {
    display: flex;
    flex-wrap: wrap;
    gap: 0.85rem 1.25rem;
    color: var(--theme-foreground-muted);
    font-size: 0.82rem;
}

.approval-evolution-chart__legend span {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
}

.approval-evolution-chart__legend i {
    display: inline-block;
    width: 0.8rem;
    height: 0.8rem;
    border-radius: 999px;
}

.approval-evolution-chart figure[class^="plot-"] {
    max-width: 100%;
}

.approval-evolution-chart svg text {
    font-family: var(--font-sans);
}

.state-ranking {
    display: grid;
    gap: 0.62rem;
}

.state-ranking__row {
    display: grid;
    gap: 0.24rem;
}

.state-ranking__header,
.state-ranking__meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
}

.state-ranking__label {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    min-width: 0;
    flex-wrap: wrap;
}

.state-ranking__position {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.15rem;
    height: 1.15rem;
    border-radius: 999px;
    background: rgba(29, 77, 61, 0.08);
    color: #1d4d3d;
    font-size: 0.68rem;
    font-weight: 700;
}

.state-ranking__flag {
    height: 18px;
    width: auto;
    border-radius: 2px;
    box-shadow: 0 0 0 1px rgba(0,0,0,0.1);
    flex-shrink: 0;
}

.state-ranking__header strong {
    font-size: 0.9rem;
}

.state-ranking__name {
    color: var(--theme-foreground-muted);
    font-size: 0.8rem;
}

.state-ranking__value {
    font-size: 0.84rem;
    font-weight: 700;
    color: var(--theme-foreground);
    white-space: nowrap;
}

.state-ranking__track {
    width: 100%;
    height: 10px;
    border-radius: 999px;
    background: #edf1ec;
    overflow: hidden;
}

.state-ranking__fill {
    display: block;
    height: 100%;
    border-radius: 999px;
    background: linear-gradient(90deg, #456b96, #1f466f);
}

.state-ranking__meta {
    font-size: 0.78rem;
    color: var(--theme-foreground-muted);
}

.brazil-map {
    padding: 1rem;
    position: relative;
    min-height: 560px;
    overflow: hidden;
}

.map-canvas {
    width: 100%;
    overflow: hidden;
    border-radius: 18px;
}

.map-legend {
    display: grid;
    gap: 0.35rem;
    margin-bottom: 0.8rem;
}

.map-legend__header {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    align-items: center;
    flex-wrap: wrap;
}

.map-legend__label {
    font-size: 0.84rem;
    color: var(--theme-foreground-muted);
}

.map-legend__swatches {
    display: flex;
    gap: 0.9rem;
    font-size: 0.82rem;
    color: var(--theme-foreground-muted);
}

.map-note {
    margin: 0;
    font-size: 0.84rem;
    color: var(--theme-foreground-muted);
}

.chart-note {
    margin-top: 0.75rem;
    font-size: 0.82rem;
    color: var(--theme-foreground-muted);
}

.brazil-map svg {
    width: 100%;
    height: auto;
    display: block;
    max-height: 620px;
    max-width: 100%;
    overflow: hidden;
}

.map-back-btn {
    display: inline-flex;
    align-items: center;
    margin-bottom: 0.6rem;
    font-size: 0.88rem;
}

.map-state-badge {
    position: absolute;
    top: 1rem;
    right: 1rem;
    z-index: 3;
    min-width: 3rem;
    padding: 0.55rem 0.8rem;
    border-radius: 999px;
    background: linear-gradient(135deg, #0f766e 0%, #176a5d 100%);
    border: 1px solid rgba(15, 118, 110, 0.28);
    box-shadow: 0 10px 24px rgba(15, 118, 110, 0.22);
    color: #ffffff;
    font-size: 0.9rem;
    font-weight: 700;
    line-height: 1;
    text-align: center;
}

.map-loading {
    margin: 0.5rem 0 0;
    padding: 0.55rem 0.9rem;
    border-radius: 999px;
    background: rgba(15, 118, 110, 0.08);
    color: var(--theme-foreground-focus);
    font-size: 0.84rem;
    font-weight: 600;
    display: inline-block;
}

.map-loading[data-tone="error"] {
    background: rgba(180, 35, 24, 0.12);
    color: #8b1e14;
}

.brazil-map--regional svg {
    background: linear-gradient(
        180deg,
        rgba(246, 248, 245, 0.9),
        rgba(239, 243, 238, 0.95)
    );
    border: 1px solid rgba(217, 221, 215, 0.95);
    border-radius: 26px;
    padding: 0.75rem;
    box-sizing: border-box;
}

.state-shape {
    transition:
        transform 120ms ease,
        opacity 120ms ease;
}

.state-shape--muted {
    opacity: 0.92;
}

.state-shape:hover {
    transform: translateY(-1px);
    opacity: 0.92;
}

.map-tooltip {
    position: absolute;
    z-index: 2;
    display: grid;
    gap: 0.15rem;
    padding: 0.8rem 0.9rem;
    border-radius: 16px;
    background: rgba(22, 58, 95, 0.94);
    color: white;
    pointer-events: none;
    min-width: 160px;
}

.map-tooltip[hidden] {
    display: none;
}

.donut-group {
    cursor: default;
}

.donut-shadow {
    filter: drop-shadow(0 6px 12px rgba(32, 48, 64, 0.12));
}

.donut-stat {
    fill: white;
    font-size: 11px;
    font-weight: 700;
    font-family: var(--font-sans);
}

.donut-caption {
    fill: var(--theme-foreground);
    font-size: 12px;
    font-weight: 600;
    font-family: var(--font-sans);
}

.table-shell,
.region-explorer,
.state-explorer {
    padding: 1.2rem;
    margin: 1rem 0 1.5rem;
}

.table-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: end;
    margin-bottom: 1rem;
}

.control {
    display: grid;
    gap: 0.35rem;
    min-width: 180px;
}

.control span {
    font-size: 0.84rem;
    color: var(--theme-foreground-muted);
}

.checkbox-group {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    padding-top: 0.15rem;
}

.checkbox-pill {
    display: inline-flex;
    align-items: center;
    padding: 0.3rem 0.75rem;
    border-radius: 999px;
    border: 1px solid var(--theme-border);
    background: rgba(255, 255, 255, 0.8);
    font-size: 0.84rem;
    cursor: pointer;
    transition:
        background 0.15s ease,
        border-color 0.15s ease,
        color 0.15s ease;
    user-select: none;
}

.checkbox-pill input[type="checkbox"] {
    display: none;
}

.checkbox-pill:has(input:checked) {
    background: rgba(15, 118, 110, 0.12);
    border-color: rgba(15, 118, 110, 0.4);
    color: var(--theme-foreground-focus);
    font-weight: 600;
}

.checkbox-pill:hover {
    border-color: rgba(15, 118, 110, 0.35);
    background: rgba(15, 118, 110, 0.06);
}

.control select,
.control input {
    min-height: 44px;
    border-radius: 12px;
    border: 1px solid rgba(215, 210, 199, 0.9);
    background: rgba(255, 255, 255, 0.8);
    padding: 0 0.85rem;
    color: var(--theme-foreground);
}

.table-meta {
    margin-bottom: 0.8rem;
    color: var(--theme-foreground-muted);
}

.table-wrap {
    overflow: auto;
    max-width: 100%;
}

.table-pagination {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem 1rem;
    flex-wrap: wrap;
    margin: -0.2rem 0 0.9rem;
}

.table-pagination__summary {
    font-size: 0.84rem;
    color: var(--theme-foreground-muted);
}

.table-pagination__actions {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    flex-wrap: wrap;
}

.table-pagination__button {
    min-height: 36px;
    padding: 0 0.8rem;
    border: 1px solid rgba(211, 216, 223, 0.96);
    border-radius: 10px;
    background: #ffffff;
    color: var(--theme-foreground);
    font: inherit;
    font-size: 0.86rem;
    font-weight: 600;
    cursor: pointer;
    transition:
        background-color 0.18s ease,
        border-color 0.18s ease,
        color 0.18s ease,
        box-shadow 0.18s ease;
}

.table-pagination__button:hover:not(:disabled) {
    background: #fafaf8;
    border-color: rgba(163, 172, 184, 0.95);
}

.table-pagination__button[data-active="true"] {
    background: rgba(15, 118, 110, 0.08);
    border-color: rgba(15, 118, 110, 0.18);
    color: #0b5e57;
}

.table-pagination__button:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.table-pagination__ellipsis {
    padding: 0 0.15rem;
    color: var(--theme-foreground-muted);
    font-size: 0.9rem;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.94rem;
}

.data-table th,
.data-table td {
    padding: 0.85rem 0.65rem;
    border-bottom: 1px solid rgba(215, 210, 199, 0.75);
    vertical-align: top;
}

.data-table th {
    text-align: left;
    color: var(--theme-foreground-muted);
    font-weight: 600;
}

.cell-sub {
    display: block;
    color: var(--theme-foreground-muted);
    font-size: 0.8rem;
    margin-top: 0.15rem;
}

.status-pill {
    display: inline-flex;
    align-items: center;
    padding: 0.28rem 0.55rem;
    border-radius: 999px;
    background: rgba(47, 107, 79, 0.12);
    font-size: 0.82rem;
}

.status-pill[data-status="Plano aprovado"] {
    background: rgba(47, 107, 79, 0.14);
    color: #1d4d3d;
}
.status-pill[data-status="Possui plano"] {
    background: rgba(120, 168, 127, 0.18);
    color: #2f6b4f;
}
.status-pill[data-status="Em elaboração"] {
    background: rgba(200, 154, 43, 0.18);
    color: #7a5b12;
}
.status-pill[data-status="Sem plano"] {
    background: rgba(154, 143, 122, 0.16);
    color: #5f5749;
}
.status-pill[data-status="Sem resposta"] {
    background: rgba(109, 119, 130, 0.16);
    color: #43515f;
}
.status-pill[data-status="Sem ofício"] {
    background: rgba(215, 210, 199, 0.55);
    color: #5c5a52;
}

.table-badge {
    display: inline-flex;
    align-items: center;
    min-width: 2.25rem;
    justify-content: center;
    padding: 0.2rem 0.5rem;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 600;
    border: 1px solid rgba(215, 210, 199, 0.9);
    background: rgba(255, 255, 255, 0.75);
    color: var(--theme-foreground-muted);
}

.table-badge[data-tone="positive"] {
    background: rgba(47, 107, 79, 0.1);
    color: #1d4d3d;
    border-color: rgba(47, 107, 79, 0.18);
}

.table-badge[data-tone="negative"] {
    background: rgba(217, 107, 114, 0.1);
    color: #8c3f46;
    border-color: rgba(217, 107, 114, 0.18);
}

.note {
    color: var(--theme-foreground-muted);
    font-size: 0.9rem;
}

.footer-shell {
    padding: 1.2rem 0 2.5rem;
    color: var(--theme-foreground-muted);
    font-size: 0.9rem;
}

.page-note-divider {
    border: none;
    border-top: 1px solid var(--theme-border);
    margin: 2.5rem 0 1.5rem;
}

.page-note {
    color: var(--theme-foreground-muted);
    font-size: 0.88rem;
    line-height: 1.65;
    margin: 0;
}

/* PEMOB visual system */
:root {
    --font-sans:
        "IBM Plex Sans", "Aptos", "Segoe UI", "Noto Sans", "Helvetica Neue",
        sans-serif;
    --font-serif:
        "IBM Plex Serif", "Iowan Old Style", "Palatino Linotype",
        "Book Antiqua", serif;
    --layout-width: min(1320px, calc(100vw - 32px));
    --theme-background: #f7f7f4;
    --theme-background-strong: #f0f1ec;
    --theme-foreground: #1f2937;
    --theme-foreground-muted: #5b6470;
    --theme-foreground-focus: #0f766e;
    --theme-border: #d3d8df;
    --theme-card-background: rgba(255, 255, 255, 0.96);
    --theme-accent: #b45309;
    --theme-accent-soft: #fbf3ea;
    --theme-success-soft: #edf6f4;
    --theme-info: #356c8c;
    --theme-danger: #b42318;
    --theme-shadow-sm: 0 1px 2px rgba(20, 32, 43, 0.04);
    --theme-shadow-md: 0 8px 18px rgba(20, 32, 43, 0.05);
    --theme-shadow-lg: 0 14px 28px rgba(20, 32, 43, 0.06);
    --theme-shadow-xl: 0 24px 46px rgba(20, 32, 43, 0.08);
    --theme-radius-sm: 10px;
    --theme-radius-md: 14px;
    --theme-radius-lg: 18px;
    --theme-radius-xl: 24px;
}

html {
    background: var(--theme-background);
}

body {
    background:
        radial-gradient(
            circle at top left,
            rgba(15, 118, 110, 0.08),
            transparent 26%
        ),
        radial-gradient(
            circle at bottom right,
            rgba(180, 83, 9, 0.08),
            transparent 24%
        ),
        linear-gradient(180deg, #fafaf8 0%, #f7f7f4 100%);
    color: var(--theme-foreground);
    font-family: var(--font-sans);
    font-size: 14px;
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
}

.observablehq a {
    color: var(--theme-foreground-focus);
    transition: color 0.18s ease;
}

.observablehq a:hover {
    color: #0b5e57;
}

#observablehq-center {
    width: var(--layout-width);
}

.site-shell {
    width: var(--layout-width);
    margin: 0 auto;
}

.site-topbar {
    position: sticky;
    top: 0;
    z-index: 20;
    align-items: center;
    padding: 1rem 1.25rem;
    margin: 1rem 0 1.5rem;
    border: 1px solid rgba(211, 216, 223, 0.82);
    border-radius: var(--theme-radius-xl);
    background: rgba(250, 250, 248, 0.9);
    box-shadow: var(--theme-shadow-md);
    -webkit-backdrop-filter: blur(14px);
    backdrop-filter: blur(14px);
}

.brand-home {
    gap: 0.9rem;
}

.brand-logo {
    height: 46px;
}

.brand-kicker {
    font-size: 0.68rem;
    letter-spacing: 0.14em;
    color: var(--theme-foreground-focus);
    font-weight: 700;
}

.brand-title {
    font-size: 1.08rem;
    letter-spacing: -0.01em;
    color: var(--theme-foreground);
}

.site-nav {
    gap: 0.5rem;
    margin-left: auto;
}

.site-nav a {
    padding: 0.52rem 1.05rem;
    border-bottom: none;
    border-radius: 999px;
    color: var(--theme-foreground-muted);
    font-weight: 600;
    font-size: 0.88rem;
    background: rgba(255, 255, 255, 0.72);
    border: 1.5px solid rgba(31, 41, 55, 0.14);
    box-shadow: 0 1px 3px rgba(20, 31, 39, 0.06);
    transition:
        background 0.15s ease,
        color 0.15s ease,
        border-color 0.15s ease,
        box-shadow 0.15s ease;
}

.site-nav a:hover {
    background: rgba(15, 118, 110, 0.08);
    color: var(--theme-foreground-focus);
    border-color: rgba(15, 118, 110, 0.28);
}

.site-nav a[aria-current="page"] {
    background: var(--theme-foreground-focus);
    color: #fff;
    border-color: transparent;
    box-shadow: 0 2px 8px rgba(15, 118, 110, 0.28);
}

.site-nav a[aria-current="page"]:hover {
    background: #0b5e57;
    color: #fff;
    border-color: transparent;
}

#observablehq-main {
    padding-bottom: 2.5rem;
}

.dashboard-toolbar {
    padding: 1.15rem 1.2rem;
    border-radius: var(--theme-radius-lg);
    border: 1px solid rgba(211, 216, 223, 0.86);
    background: linear-gradient(
        180deg,
        rgba(255, 255, 255, 0.98),
        rgba(247, 247, 244, 0.96)
    );
    box-shadow: var(--theme-shadow-md);
}

.dashboard-toolbar__title h1 {
    font-size: clamp(1.65rem, 2vw, 2.15rem);
    letter-spacing: -0.02em;
}

.dashboard-toolbar__title p,
.dashboard-toolbar__meta {
    color: var(--theme-foreground-muted);
}

.dashboard-stage {
    gap: 1.25rem;
    grid-template-columns: minmax(300px, 360px) minmax(0, 1fr);
}

.hero-copy,
.hero-aside,
.card,
.metric-card,
.table-shell,
.region-explorer,
.state-explorer,
.brazil-map {
    background: var(--theme-card-background);
    border: 1px solid rgba(211, 216, 223, 0.86);
    border-radius: var(--theme-radius-lg);
    box-shadow: var(--theme-shadow-sm);
    backdrop-filter: none;
}

.card,
.table-shell,
.region-explorer,
.state-explorer {
    box-shadow: var(--theme-shadow-sm);
}

.card:hover,
.table-shell:hover,
.region-explorer:hover,
.state-explorer:hover,
.metric-card:hover,
.brazil-map:hover {
    box-shadow: var(--theme-shadow-md);
}

.panel-card {
    padding: 1rem;
    border-radius: var(--theme-radius-lg);
}

.section-heading {
    margin-bottom: 0.8rem;
}

.card h2,
.section-heading h2,
.map-overlay-card .section-heading h3 {
    font-family: var(--font-sans);
    font-size: 1rem;
    font-weight: 700;
    color: var(--theme-foreground);
    letter-spacing: -0.01em;
}

.card p,
.section-heading p,
.map-note,
.chart-note,
.table-meta,
.note,
.footer-shell,
.approval-bar__legend,
.approval-bar__meta,
.region-ranking__meta,
.state-ranking__meta,
.map-legend__label,
.map-legend__swatches,
.control span {
    color: var(--theme-foreground-muted);
}

.metric-card {
    padding: 1rem;
    border-radius: var(--theme-radius-md);
    background:
        linear-gradient(90deg, #0f766e, #b45309) top / 100% 3px no-repeat,
        var(--theme-card-background);
}

.metric-card::before {
    content: none;
}

.metric-card.tone-accent {
    background:
        linear-gradient(90deg, #b45309, #b45309) top / 100% 3px no-repeat,
        var(--theme-accent-soft);
}

.metric-label {
    font-size: 0.76rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.metric-value {
    margin-top: 0.5rem;
    font-size: 1.85rem;
    color: var(--theme-foreground);
}

.metric-delta {
    border: 1px solid transparent;
    font-weight: 700;
}

.metric-delta.up {
    color: #0b5e57;
    background: rgba(15, 118, 110, 0.08);
    border-color: rgba(15, 118, 110, 0.14);
}

.metric-delta.down {
    color: #8e1c13;
    background: rgba(180, 35, 24, 0.08);
    border-color: rgba(180, 35, 24, 0.14);
}

.metric-delta.flat {
    background: #f0f1ec;
    border-color: rgba(211, 216, 223, 0.9);
}

.approval-bar__track,
.region-ranking__track,
.state-ranking__track {
    background: #f0f1ec;
}

.approval-bar__segment--approved,
.region-ranking__fill {
    background: linear-gradient(90deg, #0f766e, #3f9388);
}

.approval-bar__segment--pending {
    background: linear-gradient(90deg, #b42318, #dc6d62);
}

.state-ranking__fill {
    background: linear-gradient(90deg, #356c8c, #163a5f);
}

.region-ranking__position,
.state-ranking__position {
    background: rgba(15, 118, 110, 0.08);
    color: var(--theme-foreground-focus);
}

.button {
    min-height: 42px;
    padding: 0 1rem;
    border-radius: var(--theme-radius-sm);
    font-size: 0.92rem;
    font-weight: 600;
    transition:
        background-color 0.18s ease,
        border-color 0.18s ease,
        color 0.18s ease,
        box-shadow 0.18s ease;
}

.button-primary {
    background: #0f766e;
    box-shadow: none;
}

.button-primary:hover {
    background: #0b5e57;
}

.button-secondary {
    background: #ffffff;
    border-color: rgba(211, 216, 223, 0.96);
    color: var(--theme-foreground);
}

.button-secondary:hover {
    background: #fafaf8;
}

.map-overlay-card {
    border-radius: var(--theme-radius-lg);
    background: rgba(255, 255, 255, 0.96);
    border-color: rgba(211, 216, 223, 0.86);
    box-shadow: var(--theme-shadow-lg);
    -webkit-backdrop-filter: blur(14px);
    backdrop-filter: blur(14px);
}

.brazil-map {
    padding: 1rem;
    border-radius: var(--theme-radius-lg);
}

.map-canvas {
    border-radius: var(--theme-radius-lg);
    background: linear-gradient(180deg, #fafaf8, #f0f1ec);
    border: 1px solid rgba(211, 216, 223, 0.72);
}

.brazil-map--regional svg {
    background: transparent;
    border: none;
    border-radius: 0;
    padding: 0.75rem;
}

.map-tooltip {
    border-radius: var(--theme-radius-md);
    background: rgba(22, 32, 43, 0.94);
    box-shadow: var(--theme-shadow-xl);
}

.table-shell,
.region-explorer,
.state-explorer {
    padding: 1rem;
    border-radius: var(--theme-radius-lg);
}

.table-controls {
    gap: 1rem;
}

.control select,
.control input {
    min-height: 44px;
    border-radius: var(--theme-radius-sm);
    border: 1px solid rgba(211, 216, 223, 0.96);
    background: #ffffff;
    box-shadow: inset 0 1px 2px rgba(20, 32, 43, 0.03);
    transition:
        border-color 0.18s ease,
        box-shadow 0.18s ease;
}

.control select:focus,
.control input:focus {
    outline: none;
    border-color: rgba(63, 147, 136, 0.95);
    box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.12);
}

.data-table {
    font-size: 0.92rem;
}

.data-table th,
.data-table td {
    padding: 0.9rem 0.75rem;
    border-bottom: 1px solid rgba(229, 231, 235, 0.9);
}

.data-table th {
    font-size: 0.76rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #8a94a3;
    background: #fafaf8;
}

.data-table tbody tr {
    transition: background-color 0.18s ease;
}

.data-table tbody tr:hover {
    background: rgba(15, 118, 110, 0.04);
}

.status-pill,
.table-badge {
    font-weight: 600;
    border-radius: 999px;
}

.status-pill {
    border: 1px solid transparent;
}

.status-pill[data-status="Plano aprovado"] {
    background: rgba(15, 118, 110, 0.1);
    color: #0b5e57;
    border-color: rgba(15, 118, 110, 0.16);
}

.status-pill[data-status="Possui plano"] {
    background: rgba(63, 147, 136, 0.12);
    color: #0f766e;
    border-color: rgba(63, 147, 136, 0.2);
}

.status-pill[data-status="Em elaboração"] {
    background: rgba(201, 151, 0, 0.12);
    color: #8c6f00;
    border-color: rgba(201, 151, 0, 0.18);
}

.status-pill[data-status="Sem plano"] {
    background: #f0f1ec;
    color: #5b6470;
    border-color: rgba(211, 216, 223, 0.9);
}

.status-pill[data-status="Sem resposta"] {
    background: rgba(91, 100, 112, 0.1);
    color: #3f4752;
    border-color: rgba(91, 100, 112, 0.16);
}

.status-pill[data-status="Sem ofício"] {
    background: #fafaf8;
    color: #5b6470;
    border-color: rgba(211, 216, 223, 0.9);
}

.table-badge {
    border-color: rgba(211, 216, 223, 0.96);
    background: #ffffff;
    color: var(--theme-foreground-muted);
}

.table-badge[data-tone="positive"] {
    background: rgba(15, 118, 110, 0.08);
    color: #0b5e57;
    border-color: rgba(15, 118, 110, 0.16);
}

.table-badge[data-tone="negative"] {
    background: rgba(180, 35, 24, 0.08);
    color: #8e1c13;
    border-color: rgba(180, 35, 24, 0.14);
}

.data-table th:nth-child(4),
.data-table td:nth-child(4),
.data-table th:nth-child(7),
.data-table td:nth-child(7),
.data-table th:nth-child(8),
.data-table td:nth-child(8) {
    text-align: center;
}

.data-table th:nth-child(6),
.data-table td:nth-child(6) {
    text-align: right;
}

.footer-shell {
    padding-top: 0.5rem;
}

.footer-content {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1.5rem;
}

.footer-info {
    flex: 1;
}

.footer-info p {
    margin: 0;
    line-height: 1.55;
}

.footer-info p + p {
    margin-top: 0.25rem;
}

.footer-logo {
    display: block;
    height: 52px;
    width: auto;
    object-fit: contain;
    object-position: right center;
    flex: 0 0 auto;
    opacity: 0.8;
}

@media (max-width: 1100px) {
    .metrics-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
    .grid-three {
        grid-template-columns: 1fr;
    }
    .hero-panel {
        grid-template-columns: 1fr;
    }
    .dashboard-toolbar,
    .dashboard-stage {
        grid-template-columns: 1fr;
    }
    .dashboard-toolbar__side {
        justify-items: start;
    }
    .dashboard-toolbar__meta,
    .dashboard-toolbar__actions {
        justify-content: start;
    }
    .summary-strip__grid .metrics-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .map-overlay-card {
        position: static;
        width: 100%;
        margin-top: 0.8rem;
    }
}

@media (max-width: 720px) {
    .site-topbar {
        align-items: start;
        flex-direction: column;
    }
    .brand-home {
        align-items: flex-start;
    }
    .brand-logo {
        height: 38px;
    }
    .site-nav {
        flex-wrap: nowrap;
        gap: 0.3rem;
        justify-content: space-between;
        width: 100%;
    }
    .site-nav a {
        font-size: 0.8rem;
        padding: 0.45rem 0.5rem;
        text-align: center;
        flex: 1;
    }
    .metrics-grid,
    .grid-two {
        grid-template-columns: 1fr;
    }
    .panel-card .metrics-grid {
        grid-template-columns: 1fr;
    }
    .summary-strip__grid .metrics-grid {
        grid-template-columns: 1fr;
    }
    .map-legend__header {
        align-items: start;
    }
    .table-controls {
        display: grid;
        grid-template-columns: 1fr 1fr;
        align-items: end;
    }
    .table-controls > .control:first-child,
    .table-controls > .control:has(.checkbox-group),
    .table-controls > .button {
        grid-column: 1 / -1;
    }
    .hero-copy,
    .hero-aside,
    .card,
    .table-shell,
    .region-explorer,
    .state-explorer,
    .metric-card {
        padding: 1rem;
    }
    .dashboard-toolbar {
        padding: 0.9rem;
    }
    .panel-card--map {
        min-height: auto;
    }
    .brazil-map {
        min-height: auto;
    }
    #observablehq-main,
    #observablehq-footer,
    .site-shell {
        width: min(100vw - 20px, 1200px);
    }
    .footer-content {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    .footer-logo {
        height: 40px;
        align-self: center;
        object-position: center;
    }
}
