.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: #fff;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-size: 0.72rem;
}

.brand-title {
    color: #fff;
    font-weight: 700;
    font-size: 1.2rem;
}

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

.site-nav a {
    color: #fff;
    text-decoration: none;
    padding-bottom: 0.15rem;
    border-bottom: 2px solid transparent;
}

.site-nav a:hover {
    border-color: rgba(255, 255, 255, 0.55);
}

#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;
    gap: 0.35rem;
    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-card__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.9rem;
}

.metric-top-right {
    flex-shrink: 0;
    padding: 0.28rem 0.55rem;
    border-radius: 999px;
    border: 1px solid rgba(53, 108, 140, 0.18);
    background: rgba(53, 108, 140, 0.08);
    font-size: 0.8rem;
    font-weight: 700;
    line-height: 1.1;
    text-align: right;
    color: #27485d;
    font-variant-numeric: tabular-nums;
    letter-spacing: 0.01em;
}

.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;
}

.section-block {
    --section-accent: #356c8c;
    margin: 3.75rem 0 0;
    padding-top: 1.3rem;
    border-top: 1px solid rgba(120, 132, 145, 0.22);
}

.section-block:first-of-type {
    margin-top: 2rem;
}

.section-block__header {
    display: grid;
    gap: 0.45rem;
    margin-bottom: 1rem;
    max-width: 72rem;
}

.section-block__eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    width: fit-content;
    padding: 0.2rem 0.6rem;
    border-radius: 999px;
    background: color-mix(in srgb, var(--section-accent) 10%, white);
    color: color-mix(in srgb, var(--section-accent) 78%, #1f2937);
    font-size: 0.72rem;
    font-weight: 700;
    line-height: 1;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.section-block__header h2 {
    margin: 0;
    font-family: var(--font-serif);
    font-size: clamp(1.55rem, 2.2vw, 2.15rem);
    line-height: 1.04;
    color: var(--theme-foreground);
}

.section-block__header p {
    margin: 0;
    max-width: 74ch;
    color: var(--theme-foreground-muted);
    font-size: 0.96rem;
    line-height: 1.5;
}

.section-block__body {
    display: grid;
    gap: 1rem;
}

.section-block--geo {
    --section-accent: #356c8c;
}

.section-block--suspensiva {
    --section-accent: #b68a2d;
}

.section-block--licitacao {
    --section-accent: #2f6b4f;
}

.section-block--obra {
    --section-accent: #b85c3d;
}

.section-block--dados {
    --section-accent: #5b6470;
}

.card--chapter,
.table-shell--terminal {
    position: relative;
}

.card--chapter::before,
.table-shell--terminal::before {
    content: "";
    position: absolute;
    inset: 0 0 auto;
    height: 5px;
    border-radius: 22px 22px 0 0;
    background: linear-gradient(
        90deg,
        color-mix(in srgb, var(--section-accent) 92%, white),
        color-mix(in srgb, var(--section-accent) 50%, white)
    );
}

.card--chapter {
    --section-accent: #356c8c;
    padding-top: 1.35rem;
}

.card--chapter-geo {
    --section-accent: #356c8c;
}

.card--chapter-suspensiva {
    --section-accent: #b68a2d;
}

.card--chapter-licitacao {
    --section-accent: #2f6b4f;
}

.card--chapter-obra {
    --section-accent: #b85c3d;
}

.table-shell--terminal {
    --section-accent: #5b6470;
    padding-top: 1.45rem;
}

.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(28, 88, 41, 0.9);
    border-radius: var(--theme-radius-xl);
    background: rgb(38, 114, 53);
    box-shadow: var(--theme-shadow-md);
    color: #fff;
    -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: #fff;
    font-weight: 700;
}

.brand-title {
    font-size: 1.08rem;
    letter-spacing: -0.01em;
    color: #fff;
}

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

.site-nav a {
    padding: 0.52rem 1.05rem;
    border-bottom: none;
    border-radius: 999px;
    color: #fff;
    font-weight: 600;
    font-size: 0.88rem;
    background: #92400e;
    border: 1.5px solid rgba(255, 255, 255, 0.22);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.16);
    transition:
        background 0.15s ease,
        color 0.15s ease,
        border-color 0.15s ease,
        box-shadow 0.15s ease;
}

.site-nav a:hover {
    background: #b45309;
    color: #fff;
    border-color: rgba(255, 255, 255, 0.32);
}

.site-nav a[aria-current="page"] {
    background: #7c2d12;
    color: #fff;
    border-color: rgba(255, 255, 255, 0.38);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.site-nav a[aria-current="page"]:hover {
    background: #9a3412;
    color: #fff;
    border-color: rgba(255, 255, 255, 0.45);
}

#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;
}

.sources-update-inline {
    margin-top: 0.9rem;
}

.sources-update-inline__title,
.sources-update-inline__text {
    margin: 0;
}

.sources-update-inline__title {
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #5a6f86;
}

.sources-update-inline__text {
    margin-top: 0.3rem;
    line-height: 1.65;
    color: var(--theme-text, #203040);
}

@media (max-width: 1100px) {
    .metrics-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
    .metrics-grid--alteracoes {
        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;
    }
    .metrics-grid--alteracoes {
        grid-template-columns: repeat(2, minmax(0, 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;
    }
}


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

.observablehq a {
    color: #1d4d3d;
}

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

#observablehq-main > h1:first-of-type {
    display: none;
}

.observablehq p,
.observablehq table,
.observablehq .card,
.observablehq .metrics-grid,
.observablehq .table-shell,
.observablehq .filters-bar {
    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;
}

/* Header — !important necessário para sobrescrever o CSS base do framework,
   que em dev mode carrega depois do custom CSS */
#observablehq-header {
    border-bottom: none !important;
    position: sticky !important;
    top: 0 !important;
    left: auto !important;
    right: auto !important;
    height: auto !important;
    padding: 0 !important;
    background: transparent !important;
    z-index: 1000;
    display: block;
    margin: 0;
}

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

.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;
    flex-wrap: wrap;
}

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

.site-nav a {
    color: #fff;
    text-decoration: none;
    padding: 0.52rem 1.05rem;
    border: 1.5px solid rgba(255, 255, 255, 0.22);
    border-radius: 999px;
    background: #92400e;
    font-weight: 600;
    font-size: 0.88rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.16);
    transition: background 0.15s, border-color 0.15s, color 0.15s, box-shadow 0.15s;
}

.site-nav a:hover {
    background: #b45309;
    border-color: rgba(255, 255, 255, 0.32);
    color: #fff;
}

.site-nav a[aria-current="page"] {
    background: #7c2d12;
    border-color: rgba(255, 255, 255, 0.38);
    color: #fff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.site-nav a[aria-current="page"]:hover {
    background: #9a3412;
    border-color: rgba(255, 255, 255, 0.45);
    color: #fff;
}

.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: #fff;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-size: 0.72rem;
}

.brand-title {
    color: #fff;
    font-weight: 700;
    font-size: 1.2rem;
}

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

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

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

/* Filters bar */
.page-titlebar {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1rem;
    margin: 0 0 1rem;
}

.page-titlebar__heading h1 {
    margin: 0;
    font-family: var(--font-serif);
    font-size: clamp(1.6rem, 3vw, 2.2rem);
    line-height: 1.1;
    color: var(--theme-foreground);
}

.page-titlebar__meta {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.15rem;
    padding-bottom: 0.15rem;
    white-space: nowrap;
}

.page-titlebar__meta-label {
    font-size: 0.74rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--theme-foreground-muted);
}

.page-titlebar__meta-value {
    font-size: 1rem;
    color: var(--theme-foreground);
}

.filters-bar {
    display: flex;
    flex-wrap: nowrap;
    gap: 0.75rem;
    align-items: flex-end;
    padding: 0.75rem 1rem;
    background: rgba(255,255,255,0.96);
    border: 1px solid rgba(215,210,199,0.9);
    border-radius: 18px;
    box-shadow: 0 4px 18px rgba(20,31,39,0.05);
    margin-bottom: 1.25rem;
}

@media (max-width: 1100px) {
    .filters-bar {
        display: grid;
        grid-template-columns: 1fr;
        gap: 0.9rem;
        align-items: stretch;
    }

    .filters-bar > .observablehq--block,
    .filters-bar > .observablehq--block:first-child,
    .filters-bar > .observablehq--block:nth-child(2),
    .filters-bar > .observablehq--block:last-child {
        flex: 1 1 100%;
        width: 100%;
    }

    .filters-bar > .observablehq--block:last-child {
        display: flex;
        justify-content: flex-end;
    }

    .filters-bar > .observablehq--block:first-child {
        order: 1;
    }

    .filters-bar > .observablehq--block:nth-child(2) {
        order: 2;
    }

    .filters-bar > .observablehq--block:last-child {
        order: 3;
    }
}

/* Cada célula Observable dentro da barra não deve forçar largura 100% */
.filters-bar > .observablehq--block {
    width: auto;
    margin: 0;
    min-width: 0;
    flex: 1 1 0;
}

/* Busca (primeiro bloco) ocupa mais espaço */
.filters-bar > .observablehq--block:first-child {
    flex: 2 1 0;
}

.filters-bar > .observablehq--block:nth-child(2) {
    flex: 3 1 0;
}

.filters-bar > .observablehq--block:last-child {
    flex: 0 0 auto;
}

.filters-bar label {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    font-size: 0.82rem;
    color: var(--theme-foreground-muted);
    font-weight: 500;
}

.filters-cascade {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.75rem;
    align-items: end;
    width: 100%;
}

.filters-cascade__item {
    min-width: 0;
}

.filters-reset {
    height: 2.5rem;
    padding: 0 1rem;
    border: 1px solid #d3d8df;
    border-radius: 999px;
    background: #fff;
    color: #1f2937;
    font: inherit;
    font-size: 0.82rem;
    font-weight: 600;
    white-space: nowrap;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s, color 0.15s;
}

.filters-reset:hover {
    border-color: #356c8c;
    background: #f0f6fa;
    color: #21465b;
}

.filters-summary {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.55rem;
    margin: -0.45rem 0 1.25rem;
}

.filters-summary__count {
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--theme-foreground-muted);
}

.filters-summary__chip {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.42rem 0.72rem;
    border: 1px solid #d5dbe3;
    border-radius: 999px;
    background: #fff;
    color: #314154;
    font: inherit;
    font-size: 0.78rem;
    line-height: 1.2;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s, color 0.15s;
}

.filters-summary__chip:hover {
    border-color: #356c8c;
    background: #f0f6fa;
    color: #21465b;
}

.filters-summary__chip span {
    font-size: 0.95em;
    font-weight: 700;
}

@media (max-width: 1100px) {
    .filters-cascade {
        grid-template-columns: 1fr;
    }

    .filters-reset {
        width: 100%;
        justify-content: center;
    }

    .filters-bar form[class^="inputs-"] > div,
    .filters-bar form[class*=" inputs-"] > div {
        align-items: center;
    }
}

.filters-bar form[class^="inputs-"],
.filters-bar form[class*=" inputs-"] {
    width: 100%;
    max-width: none;
    margin: 0;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0.3rem;
}

.filters-bar form[class^="inputs-"] > label,
.filters-bar form[class*=" inputs-"] > label {
    width: auto;
    margin: 0;
    padding: 0;
    font-size: 0.82rem;
    color: var(--theme-foreground-muted);
    font-weight: 500;
}

.filters-bar form[class^="inputs-"] > div,
.filters-bar form[class*=" inputs-"] > div {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 0.45rem;
}

.filters-bar form[class^="inputs-"] > div > input,
.filters-bar form[class^="inputs-"] > div > select,
.filters-bar form[class*=" inputs-"] > div > input,
.filters-bar form[class*=" inputs-"] > div > select,
.filters-bar form[class^="inputs-"] select,
.filters-bar form[class*=" inputs-"] select {
    appearance: none;
    -webkit-appearance: none;
    width: 100%;
    height: 2.5rem;
    min-height: 2.5rem;
    padding: 0.32rem 2.25rem 0.32rem 0.8rem;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    background: #f3f4f6;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='none' stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M2.25 4.5 6 8.25 9.75 4.5'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.8rem center;
    background-size: 12px 12px;
    color: #1f2937;
    font: inherit;
    font-weight: 500;
    line-height: 1.2;
    box-shadow: none;
    transition: border-color 0.15s, background 0.15s;
}

.filters-bar form[class^="inputs-"] > div > input:hover,
.filters-bar form[class^="inputs-"] > div > input:focus,
.filters-bar form[class^="inputs-"] > div > select:hover,
.filters-bar form[class^="inputs-"] > div > select:focus,
.filters-bar form[class*=" inputs-"] > div > input:hover,
.filters-bar form[class*=" inputs-"] > div > input:focus,
.filters-bar form[class*=" inputs-"] > div > select:hover,
.filters-bar form[class*=" inputs-"] > div > select:focus,
.filters-bar form[class^="inputs-"] select:hover,
.filters-bar form[class^="inputs-"] select:focus,
.filters-bar form[class*=" inputs-"] select:hover,
.filters-bar form[class*=" inputs-"] select:focus {
    border-color: #cbd5e1;
    background: #fff;
    outline: none;
}

.filters-bar form[class^="inputs-"] > div > output,
.filters-bar form[class*=" inputs-"] > div > output {
    width: auto;
    min-width: max-content;
    margin: 0;
    font-size: 0.78rem;
    color: #5b6470;
    white-space: nowrap;
}

.filters-bar input[type="search"]::placeholder {
    color: #9ca3af;
}

.filters-bar form[class^="inputs-"] > div > input[type="search"],
.filters-bar form[class*=" inputs-"] > div > input[type="search"] {
    appearance: none;
    -webkit-appearance: none;
    background-image: none;
    padding-right: 0.8rem;
}

.filters-bar .multi-picker {
    width: 100%;
}

.filters-bar .multi-picker__label {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    width: 100%;
    font-size: 0.82rem;
    color: var(--theme-foreground-muted);
    font-weight: 500;
}

.filters-bar .multi-picker__toggle {
    display: inline-flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    width: 100%;
    height: 2.5rem;
    min-height: 2.5rem;
    padding: 0.32rem 0.8rem;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    background: #f3f4f6;
    color: #1f2937;
    font: inherit;
    font-weight: 500;
    line-height: 1.2;
    cursor: pointer;
    text-align: left;
    transition: border-color 0.15s, background 0.15s;
}

.filters-bar .multi-picker__toggle::after {
    content: "▾";
    flex: 0 0 auto;
    font-size: 0.75rem;
    color: #6b7280;
}

.filters-bar .multi-picker__toggle:hover,
.filters-bar .multi-picker__toggle.is-open {
    border-color: #cbd5e1;
    background: #fff;
}

.filters-bar .multi-picker__panel {
    position: absolute;
    top: calc(100% + 0.4rem);
    left: 0;
    z-index: 40;
    width: min(34rem, 70vw);
    max-height: min(22rem, 60vh);
    overflow: auto;
    padding: 0.75rem;
    border: 1px solid rgba(215,210,199,0.95);
    border-radius: 14px;
    background: rgba(255,255,255,0.98);
    box-shadow: 0 18px 40px rgba(20,31,39,0.12);
}

.filters-bar .multi-picker__actions {
    display: flex;
    gap: 0.45rem;
    margin-bottom: 0.65rem;
}

.filters-bar .multi-picker__action-btn {
    padding: 0.25rem 0.6rem;
    border: 1px solid #d3d8df;
    border-radius: 999px;
    background: #fff;
    color: #5b6470;
    font-size: 0.75rem;
    cursor: pointer;
}

.filters-bar .multi-picker__action-btn:hover {
    background: #f9fafb;
}

.filters-bar .multi-picker__grid {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.filters-bar .multi-picker__chip {
    padding: 0.35rem 0.7rem;
    border: 1px solid #d3d8df;
    border-radius: 999px;
    background: #fff;
    color: #5b6470;
    font-size: 0.78rem;
    line-height: 1.25;
    cursor: pointer;
    transition: all 0.15s;
}

.filters-bar .multi-picker__chip:hover {
    border-color: #9ca3af;
}

.filters-bar .multi-picker__chip.is-active {
    border-color: #356c8c;
    background: #356c8c;
    color: #fff;
}

/* Metrics grid */
.metrics-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1rem;
    margin: 0 0 1.25rem;
}

.metrics-grid--alteracoes {
    grid-template-columns: repeat(6, minmax(0, 1fr));
}

.metric-card {
    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);
    padding: 1.1rem 1rem;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

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

.metric-card.tone-green::before { background: #0f766e; }
.metric-card.tone-gold::before  { background: #b45309; }
.metric-card.tone-blue::before  { background: #356c8c; }
.metric-card.tone-red::before   { background: #b42318; }

.metric-card__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.9rem;
    min-height: 2.8rem;
}

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

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

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

.metric-delta {
    display: inline-block;
    align-self: flex-start;
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.01em;
    white-space: nowrap;
    line-height: 1;
    vertical-align: middle;
    padding: 0.2rem 0.5rem;
    border-radius: 999px;
    cursor: default;
    margin-left: 0.4rem;
}

.metric-delta--positive {
    color: #0f766e;
    background: #d7ebe7;
}

.metric-delta--negative {
    color: #9a3412;
    background: #fee2e1;
}

.metric-delta--neutral {
    color: #475569;
    background: #f3f4f6;
}

.metric-delta.has-tooltip {
    position: relative;
    z-index: 1;
}

.metric-delta.has-tooltip::after {
    content: attr(data-tooltip);
    position: absolute;
    top: calc(100% + 6px);
    left: 50%;
    transform: translateX(-50%);
    background: #1f2937;
    color: #fff;
    font-size: 0.72rem;
    font-weight: 500;
    padding: 0.3rem 0.6rem;
    border-radius: 6px;
    white-space: nowrap;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.15s;
    z-index: 10;
}

.metric-delta.has-tooltip:hover::after {
    opacity: 1;
}

/* ── Pílulas de diff na tabela ── */
.diff-pill {
    display: inline-block;
    font-size: 0.72rem;
    font-weight: 600;
    padding: 0.15rem 0.5rem;
    border-radius: 999px;
    white-space: nowrap;
    cursor: default;
}

.diff-pill--alterado {
    color: #92400e;
    background: #fef3c7;
}

.diff-pill--novo {
    color: #065f46;
    background: #d1fae5;
}

.metric-detail {
    margin: auto 0 0;
    padding-top: 0.55rem;
    color: var(--theme-foreground-muted);
    font-size: 0.82rem;
}

/* Charts grid */
.grid-two {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
    margin: 0 0 1.25rem;
}

.card {
    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);
    padding: 1.2rem;
    min-width: 0;
}

.card--suspensiva-analysis {
    background: #fff8f0;
}

.card--licitacao-analysis {
    background: #f3fbf5;
}

.card--inicio-obra-analysis {
    background: #e9f2fb;
}

.card h2 {
    margin: 0 0 0.3rem;
    font-family: var(--font-serif);
    font-size: 1.1rem;
}

.card p {
    margin: 0 0 0.75rem;
    color: var(--theme-foreground-muted);
    font-size: 0.85rem;
}

/* Tooltip de regra */
.rule-tooltip {
    position: relative;
    display: inline-flex;
    align-items: center;
    margin-left: 0.4rem;
    vertical-align: middle;
}

.rule-tooltip__trigger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.2rem;
    height: 1.2rem;
    border-radius: 50%;
    border: 1.5px solid var(--theme-foreground-muted, #6b7280);
    background: transparent;
    color: var(--theme-foreground-muted, #6b7280);
    font-size: 0.7rem;
    font-weight: 700;
    cursor: help;
    line-height: 1;
    padding: 0;
    transition: background 0.15s, color 0.15s;
}

.rule-tooltip__trigger:hover {
    background: var(--theme-foreground-muted, #6b7280);
    color: #fff;
}

.rule-tooltip.is-open .rule-tooltip__trigger {
    background: var(--theme-foreground-muted, #6b7280);
    color: #fff;
}

.rule-tooltip__content {
    display: none;
    position: absolute;
    top: calc(100% + 0.5rem);
    left: 0;
    z-index: 100;
    min-width: 300px;
    max-width: 420px;
    padding: 0.85rem 1rem;
    background: #1f2937;
    color: #f3f4f6;
    border-radius: 10px;
    box-shadow: 0 8px 30px rgba(0,0,0,0.25);
    font-size: 0.8rem;
    line-height: 1.5;
    font-family: var(--font-sans, "IBM Plex Sans", sans-serif);
    font-weight: 400;
}

.rule-tooltip__content::before {
    content: "";
    position: absolute;
    top: -6px;
    left: 0.5rem;
    width: 12px;
    height: 12px;
    background: #1f2937;
    transform: rotate(45deg);
    border-radius: 2px;
}

.rule-tooltip:hover .rule-tooltip__content,
.rule-tooltip:focus-within .rule-tooltip__content,
.rule-tooltip.is-open .rule-tooltip__content {
    display: block;
}

.rule-tooltip__content strong {
    color: #fbbf24;
}

.rule-tooltip__content ul {
    margin: 0.4rem 0 0;
    padding-left: 1.1rem;
}

.rule-tooltip__content li {
    margin-bottom: 0.25rem;
}

@media (hover: none), (pointer: coarse) {
    .rule-tooltip:hover .rule-tooltip__content,
    .rule-tooltip:focus-within .rule-tooltip__content {
        display: none;
    }

    .rule-tooltip.is-open .rule-tooltip__content {
        display: block;
    }

    .rule-tooltip__content {
        position: fixed;
        left: 1rem;
        right: 1rem;
        top: auto;
        bottom: 1rem;
        min-width: 0;
        max-width: none;
        max-height: min(70vh, 30rem);
        overflow: auto;
        overscroll-behavior: contain;
        z-index: 2000;
    }

.rule-tooltip__content::before {
    display: none;
}
}

.context-action-row {
    margin: -0.1rem 0 1rem;
}

.context-link-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.45rem 0.9rem;
    border: 1px solid rgba(47, 107, 79, 0.22);
    border-radius: 999px;
    background: rgba(240, 249, 244, 0.98);
    color: #1d4d3d;
    font-size: 0.8rem;
    font-weight: 700;
    line-height: 1.1;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s, transform 0.15s;
}

.context-link-btn:hover {
    background: #e0f2e8;
    border-color: rgba(29, 77, 61, 0.3);
    transform: translateY(-1px);
}

.reference-modal {
    position: fixed;
    inset: 0;
    z-index: 3000;
    display: grid;
    place-items: center;
    padding: 1.25rem;
}

.reference-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.62);
    backdrop-filter: blur(4px);
}

.reference-modal__dialog {
    position: relative;
    z-index: 1;
    width: min(1100px, calc(100vw - 2.5rem));
    max-height: calc(100vh - 2.5rem);
    display: grid;
    grid-template-rows: auto minmax(0, 1fr) auto;
    gap: 0.9rem;
    padding: 1rem;
    border-radius: 24px;
    border: 1px solid rgba(217, 221, 215, 0.95);
    background: rgba(255, 255, 255, 0.98);
    box-shadow: 0 28px 80px rgba(15, 23, 42, 0.22);
}

.reference-modal__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
}

.reference-modal__titles h3 {
    margin: 0;
    font-family: var(--font-sans);
    font-size: 1.15rem;
    line-height: 1.2;
    color: var(--theme-foreground);
}

.reference-modal__titles p {
    margin: 0.35rem 0 0;
    color: var(--theme-foreground-muted);
    font-size: 0.85rem;
    line-height: 1.45;
}

.reference-modal__close,
.reference-modal__link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 2.25rem;
    padding: 0.45rem 0.95rem;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 700;
    text-decoration: none;
}

.reference-modal__close {
    border: 1px solid rgba(148, 163, 184, 0.35);
    background: #fff;
    color: #334155;
    cursor: pointer;
}

.reference-modal__close:hover {
    background: #f8fafc;
}

.reference-modal__body {
    overflow: auto;
    border-radius: 18px;
    background: linear-gradient(180deg, #f8fafc, #f1f5f9);
    padding: 0.65rem;
}

.reference-modal__image {
    display: block;
    width: 100%;
    height: auto;
    border-radius: 14px;
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.12);
}

.reference-modal__footer {
    display: flex;
    justify-content: flex-end;
}

.reference-modal__link {
    border: 1px solid rgba(16, 185, 129, 0.26);
    background: #ecfdf5;
    color: #047857;
}

.reference-modal__link:hover {
    background: #d1fae5;
}

/* Column picker */
.col-picker {
    margin-bottom: 0.75rem;
}

.col-picker__toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.4rem 0.9rem;
    border: 1.5px solid #d3d8df;
    border-radius: 8px;
    background: #fff;
    color: #1f2937;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s;
}

.col-picker__toggle::before {
    content: "▸";
    font-size: 0.7rem;
    transition: transform 0.2s;
}

.col-picker__toggle.is-open {
    border-color: #356c8c;
    background: #f0f6fa;
}

.col-picker__toggle.is-open::before {
    transform: rotate(90deg);
}

.col-picker__toggle:hover {
    border-color: #356c8c;
}

.col-picker__panel {
    margin-top: 0.5rem;
    padding: 0.75rem;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    background: #fafbfc;
}

.col-picker__actions {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 0.6rem;
}

.col-picker__action-btn {
    padding: 0.25rem 0.6rem;
    border: 1px solid #d3d8df;
    border-radius: 6px;
    background: #fff;
    color: #5b6470;
    font-size: 0.75rem;
    cursor: pointer;
    transition: background 0.15s;
}

.col-picker__action-btn:hover {
    background: #f3f4f6;
}

.col-picker__grid {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
}

.col-picker__chip {
    padding: 0.3rem 0.65rem;
    border: 1.5px solid #d3d8df;
    border-radius: 999px;
    background: #fff;
    color: #6b7280;
    font-size: 0.75rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s;
    line-height: 1.3;
}

.col-picker__chip:hover {
    border-color: #9ca3af;
}

.col-picker__chip.is-active {
    background: #356c8c;
    border-color: #356c8c;
    color: #fff;
}

.col-picker__chip.is-active:hover {
    background: #2a5670;
    border-color: #2a5670;
}

/* Table */
.table-shell {
    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);
    padding: 1.2rem;
    margin: 0 0 1.5rem;
}

.table-shell--terminal {
    background:
        linear-gradient(180deg, rgba(242, 245, 247, 0.92), rgba(255, 255, 255, 0) 88px),
        #ffffff;
    border-color: rgba(196, 203, 210, 0.95);
    box-shadow: 0 26px 68px rgba(20,31,39,0.08);
    margin-bottom: 0;
}

.table-scroll {
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
}

.table-scroll form[class^="inputs-"][class$="-table"],
.table-scroll form[class*=" inputs-"][class$="-table"] {
    width: 100%;
    min-width: 100%;
}

.table-scroll form[class^="inputs-"][class$="-table"] table,
.table-scroll form[class*=" inputs-"][class$="-table"] table {
    width: 100%;
    min-width: 100%;
    max-width: none;
}

.datatable-block {
    display: grid;
    gap: 0.9rem;
    width: 100%;
    min-width: 0;
}

.datatable-block .dataTables_wrapper {
    width: 100%;
    max-width: 100%;
    min-width: 0;
}

.datatable-scroll {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
}

.datatable-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    width: 100%;
    min-width: 0;
}

.datatable-toolbar--bottom {
    align-items: flex-start;
}

.datatable-block .dataTables_wrapper .dataTables_length,
.datatable-block .dataTables_wrapper .dataTables_filter {
    margin-bottom: 0.85rem;
    float: none;
    text-align: left;
}

.datatable-block .dataTables_length label,
.datatable-block .dataTables_filter label {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    font-size: 0.82rem;
    color: var(--theme-foreground-muted);
    font-weight: 500;
}

.datatable-block .dataTables_filter input,
.datatable-block .dataTables_length select,
.datatable-filter {
    appearance: none;
    -webkit-appearance: none;
    min-height: 2.4rem;
    padding: 0.36rem 0.8rem;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    background: #f3f4f6;
    color: #1f2937;
    font: inherit;
    box-shadow: none;
}

.datatable-block .dataTables_filter input {
    min-width: 240px;
}

.datatable-block .dataTables_length select,
.datatable-filter[type="search"],
.datatable-filter:not([type]) {
    background-image: none;
}

.datatable-block .dataTables_length select,
.datatable-filter:not([type="search"]) {
    padding-right: 2rem;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='none' stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M2.25 4.5 6 8.25 9.75 4.5'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 12px 12px;
}

.datatable-block .dataTables_filter input:hover,
.datatable-block .dataTables_filter input:focus,
.datatable-block .dataTables_length select:hover,
.datatable-block .dataTables_length select:focus,
.datatable-filter:hover,
.datatable-filter:focus {
    border-color: #cbd5e1;
    background-color: #fff;
    outline: none;
}

.datatable-filters-row th {
    padding-top: 0.55rem;
    padding-bottom: 0.55rem;
}

.datatable-filter {
    width: 100%;
    min-width: 0;
}

.datatable-filters-row .datatable-filter[type="search"] {
    min-width: 8rem;
}

.datatable-filters-row .datatable-filter.col-data {
    width: 5.8rem;
    min-width: 5.8rem;
}

.datatable-filters-row .datatable-filter.col-convenio {
    width: 6.4rem;
    min-width: 6.4rem;
}

.datatable-filters-row .datatable-filter.col-tci {
    width: 5.4rem;
    min-width: 5.4rem;
}

.datatable-filters-row .datatable-filter.col-uf {
    width: 3.2rem;
    min-width: 3.2rem;
}

.datatable-filters-row .datatable-filter.col-secretaria,
.datatable-filters-row .datatable-filter.col-tipo {
    width: 4.4rem;
    min-width: 4.4rem;
}

.datatable-filters-row .datatable-filter.col-campo {
    width: 10rem;
    min-width: 10rem;
}

.datatable-filters-row .datatable-filter.col-anterior,
.datatable-filters-row .datatable-filter.col-atual {
    width: 11rem;
    min-width: 11rem;
}

.datatable-block table.dataTable thead > tr > th {
    color: var(--theme-foreground);
    font-weight: 700;
}

.datatable-block .col-data {
    width: 6.2rem;
    min-width: 6.2rem;
}

.datatable-block .col-convenio {
    width: 7rem;
    min-width: 7rem;
}

.datatable-block .col-tci {
    width: 5.2rem;
    min-width: 5.2rem;
}

.datatable-block .col-uf {
    width: 3.5rem;
    min-width: 3.5rem;
}

.datatable-block .col-secretaria {
    width: 4.5rem;
    min-width: 4.5rem;
}

.datatable-block .col-tipo {
    width: 4.5rem;
    min-width: 4.5rem;
}

.datatable-block .col-campo,
.datatable-block .col-anterior,
.datatable-block .col-atual {
    min-width: 11rem;
}

.datatable-block table.dataTable tbody td.dt-body-wrap {
    white-space: normal;
}

.datatable-block .dataTables_info,
.datatable-block .dataTables_paginate {
    margin-top: 0;
    font-size: 0.8rem;
    color: var(--theme-foreground-muted);
}

.datatable-block .dataTables_paginate .paginate_button {
    border-radius: 999px !important;
}

.datatable-block .dataTables_wrapper .dataTables_paginate,
.datatable-block .dataTables_wrapper .dataTables_info {
    float: none;
}

.datatable-block .dataTables_wrapper .dataTables_paginate {
    display: flex;
    justify-content: flex-end;
    gap: 0.2rem;
}

.datatable-toolbar .dataTables_length,
.datatable-toolbar .dataTables_filter,
.datatable-toolbar .dataTables_info,
.datatable-toolbar .dataTables_paginate {
    margin: 0;
}

.datatable-toolbar .dataTables_filter {
    margin-left: auto;
}

.datatable-block table.dataTable {
    width: max-content !important;
    min-width: 100%;
}

.base-datatable-block .datatable-filters-row .datatable-filter[type="search"] {
    min-width: 6.25rem;
}

.base-datatable-block .datatable-filters-row .datatable-filter.col-diff {
    width: 5.4rem;
    min-width: 5.4rem;
}

.base-datatable-block .datatable-filters-row .datatable-filter.col-convenio {
    width: 6.2rem;
    min-width: 6.2rem;
}

.base-datatable-block .datatable-filters-row .datatable-filter.col-tci {
    width: 6.5rem;
    min-width: 6.5rem;
}

.base-datatable-block .datatable-filters-row .datatable-filter.col-secretaria {
    width: 4.8rem;
    min-width: 4.8rem;
}

.base-datatable-block .datatable-filters-row .datatable-filter.col-date {
    width: 6.75rem;
    min-width: 6.75rem;
}

.base-datatable-block .datatable-filters-row .datatable-filter.col-medium {
    width: 7.5rem;
    min-width: 7.5rem;
}

.base-datatable-block .datatable-filters-row .datatable-filter.col-status {
    width: 9.5rem;
    min-width: 9.5rem;
}

.base-datatable-block .datatable-filters-row .datatable-filter.col-money {
    width: 7.75rem;
    min-width: 7.75rem;
    text-align: right;
}

.base-datatable-block .datatable-filters-row .datatable-filter.col-long {
    width: 10.5rem;
    min-width: 10.5rem;
}

.base-datatable-block .datatable-filters-row .datatable-filter.col-default {
    width: 8rem;
    min-width: 8rem;
}

.base-datatable-block .col-diff {
    width: 5.6rem;
    min-width: 5.6rem;
}

.base-datatable-block .col-convenio {
    width: 6.2rem;
    min-width: 6.2rem;
}

.base-datatable-block .col-tci {
    width: 6.5rem;
    min-width: 6.5rem;
}

.base-datatable-block .col-secretaria {
    width: 4.8rem;
    min-width: 4.8rem;
}

.base-datatable-block .col-date {
    width: 6.75rem;
    min-width: 6.75rem;
}

.base-datatable-block .col-medium {
    width: 7.5rem;
    min-width: 7.5rem;
}

.base-datatable-block .col-status {
    width: 9.5rem;
    min-width: 9.5rem;
}

.base-datatable-block .col-money {
    width: 7.75rem;
    min-width: 7.75rem;
    text-align: right;
}

.base-datatable-block .col-long {
    width: 10.5rem;
    min-width: 10.5rem;
}

.base-datatable-block .col-default {
    width: 8rem;
    min-width: 8rem;
}

.table-shell h2 {
    margin: 0 0 0.75rem;
    font-family: var(--font-serif);
    font-size: 1.1rem;
}

.table-controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 0.9rem;
}

.clear-filters-btn {
    appearance: none;
    border: 1px solid rgba(220,38,38,0.22);
    background: #fef2f2;
    color: #dc2626;
    border-radius: 999px;
    padding: 0.55rem 0.9rem;
    font-size: 0.82rem;
    font-weight: 700;
    cursor: pointer;
    margin-bottom: 0;
}

.clear-filters-btn:hover {
    background: #fee2e2;
}

.export-btn {
    appearance: none;
    border: 1px solid rgba(15,118,110,0.22);
    background: #ecfdf5;
    color: #0f766e;
    border-radius: 999px;
    padding: 0.55rem 0.9rem;
    font-size: 0.82rem;
    font-weight: 700;
    cursor: pointer;
    margin-bottom: 0;
    margin-left: auto;
}

.export-btn:hover:not(:disabled) {
    background: #d1fae5;
}

.export-btn:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

/* Page section */
.page-section {
    padding: 1.5rem 0 0;
}

/* Footer */
.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 0 1.5rem;
    gap: 1rem;
}

.footer-info p {
    margin: 0.2rem 0;
    color: var(--theme-foreground-muted);
    font-size: 0.82rem;
}

.footer-logo {
    height: 36px;
    width: auto;
    opacity: 0.7;
}

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

/* ── Cascade breakdown chart ─────────────────────────────────── */

.casc-chart {
    display: grid;
    gap: 0;
    width: 100%;
    min-width: 0;
}

.casc-clear {
    justify-self: end;
    margin-bottom: 0.6rem;
    border: 1px solid rgba(180, 83, 9, 0.22);
    background: #fff7ed;
    color: #9a3412;
    border-radius: 999px;
    padding: 0.35rem 0.7rem;
    font-size: 0.76rem;
    font-weight: 700;
    cursor: pointer;
}

.casc-clear:hover {
    background: #ffedd5;
}

.casc-active {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 0.45rem;
    margin-bottom: 0.75rem;
}

.casc-active__chip {
    appearance: none;
    border: 1px solid var(--chip-border, rgba(53,108,140,0.18));
    background: var(--chip-bg, rgba(53,108,140,0.08));
    color: var(--chip-fg, #234b63);
    border-radius: 999px;
    padding: 0.28rem 0.7rem;
    font-size: 0.76rem;
    font-weight: 700;
    cursor: pointer;
}

.casc-active__chip:hover {
    background: var(--chip-bg-hover, rgba(53,108,140,0.14));
}

.casc-level {
    display: grid;
    gap: 0.55rem;
    padding: 1.1rem 1.2rem;
    background: rgba(255,255,255,0.96);
    border: 1px solid rgba(215,210,199,0.9);
    border-radius: 18px;
    box-shadow: 0 4px 18px rgba(20,31,39,0.05);
}

.casc-level__header {
    display: flex;
    align-items: baseline;
    gap: 0.6rem;
    flex-wrap: wrap;
}

.casc-level__title {
    font-size: 0.96rem;
    font-weight: 700;
    color: var(--theme-foreground);
}

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

.casc-month-chart {
    display: grid;
    gap: 0.55rem;
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
    padding: 1.1rem 1.2rem;
    background: rgba(255,255,255,0.96);
    border: 1px solid rgba(215,210,199,0.9);
    border-radius: 18px;
    box-shadow: 0 4px 18px rgba(20,31,39,0.05);
}

.casc-month-chart__body {
    display: flex;
    gap: 1.25rem;
    align-items: stretch;
    flex-wrap: wrap;
}

.casc-month-chart__scroll {
    overflow-x: auto;
    flex: 0 1 640px;
    min-width: 0;
    padding-bottom: 0.25rem;
}

.casc-month-summary {
    flex: 1 1 240px;
    min-width: 220px;
    display: flex;
    flex-direction: column;
    gap: 0.7rem;
    padding: 0.9rem 1rem;
    background: rgba(250, 248, 244, 0.7);
    border: 1px solid rgba(215, 210, 199, 0.9);
    border-radius: 14px;
}

.casc-month-summary__title {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--theme-foreground-muted);
}

.casc-month-summary__total {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
    padding-bottom: 0.6rem;
    border-bottom: 1px solid rgba(215, 210, 199, 0.7);
}

.casc-month-summary__total-n {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--theme-foreground);
}

.casc-month-summary__total-vlr {
    font-size: 1.35rem;
    font-weight: 700;
    font-family: var(--font-serif);
    color: var(--theme-foreground);
}

.casc-month-summary__list {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
    overflow-y: auto;
    max-height: 220px;
}

.casc-month-summary__item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.casc-month-summary__item-txt {
    display: flex;
    justify-content: space-between;
    gap: 0.6rem;
    flex: 1;
    font-size: 0.82rem;
    color: var(--theme-foreground);
}

.casc-month-summary__item-txt span {
    color: var(--theme-foreground-muted);
    white-space: nowrap;
}

.casc-month-chart__scroll svg {
    display: block;
    max-width: none;
}

.casc-bar {
    display: flex;
    height: 40px;
    border-radius: 10px;
    overflow: hidden;
    gap: 2px;
}

.card--licitacao-analysis .casc-bar {
    gap: 0;
}

.casc-bar__seg {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 0;
    transition: opacity 0.15s;
    cursor: default;
}

.casc-bar__seg.is-clickable {
    cursor: pointer;
}

.casc-bar__seg:hover {
    opacity: 0.82;
}

.casc-bar__seg.is-selected {
    box-shadow: inset 0 0 0 3px rgba(255,255,255,0.92);
}

.casc-bar__seg-num {
    color: rgba(255,255,255,0.92);
    font-size: 0.78rem;
    font-weight: 700;
    padding: 0 0.4rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.casc-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem 1.1rem;
}

.casc-legend__item {
    display: flex;
    align-items: center;
    gap: 0.42rem;
    font-size: 0.8rem;
}

.casc-legend__item.is-clickable {
    cursor: pointer;
    border-radius: 999px;
    padding: 0.15rem 0.45rem 0.15rem 0.2rem;
    transition: background-color 0.15s, box-shadow 0.15s;
}

.casc-legend__item.is-clickable:hover {
    background: rgba(53,108,140,0.08);
}

.casc-legend__item.is-selected {
    background: rgba(53,108,140,0.12);
    box-shadow: inset 0 0 0 1px rgba(53,108,140,0.18);
}

.casc-legend__dot {
    width: 10px;
    height: 10px;
    border-radius: 999px;
    flex-shrink: 0;
}

.casc-legend__text {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    color: var(--theme-foreground-muted);
}

.casc-legend__text strong {
    color: var(--theme-foreground);
    font-weight: 500;
}

.casc-legend__pct {
    font-size: 0.72rem;
    font-weight: 700;
    opacity: 0.85;
}

.casc-connector {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0 1.5rem;
    height: 36px;
}

.casc-connector__line {
    width: 2px;
    height: 36px;
    background: linear-gradient(to bottom, rgba(100,116,139,0.25), rgba(100,116,139,0.6));
    border-radius: 2px;
    margin-left: 1.5rem;
}

.casc-connector__label {
    font-size: 0.76rem;
    color: var(--theme-foreground-muted);
    font-style: italic;
}

.casc-empty {
    font-size: 0.88rem;
    color: var(--theme-foreground-muted);
    padding: 0.75rem 0;
}

/* ── Urgency alert strip ─────────────────────────────────────── */

.urgency-alert {
    display: flex;
    align-items: flex-start;
    gap: 0.85rem;
    padding: 0.9rem 1.1rem;
    border-radius: 14px;
    background: #fff7ed;
    border: 1px solid #fdba74;
    margin-bottom: 0.75rem;
}

.urgency-alert__icon {
    font-size: 1.3rem;
    line-height: 1;
    flex-shrink: 0;
}

.urgency-alert__body {
    display: grid;
    gap: 0.2rem;
}

.urgency-alert__title {
    font-weight: 700;
    font-size: 0.92rem;
    color: #9a3412;
}

.urgency-alert__text {
    font-size: 0.82rem;
    color: #7c2d12;
    line-height: 1.4;
}

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

    .card.card--suspensiva-analysis {
        background: #fff8f0;
    }

    .card.card--licitacao-analysis {
        background: #f3fbf5;
    }

    .card.card--inicio-obra-analysis {
        background: #e9f2fb;
    }
}

/* ── Paginação ─────────────────────────────────────────────── */
.pager {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
  margin-bottom: 0.75rem;
}

.pager-btn {
  min-width: 32px;
  height: 32px;
  padding: 0 6px;
  border: 1px solid var(--theme-foreground-faint, #d1d5db);
  border-radius: 6px;
  background: transparent;
  color: var(--theme-foreground, #374151);
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}

.pager-btn:hover:not(:disabled) {
  background: var(--theme-foreground-faintest, #f3f4f6);
  border-color: var(--theme-foreground-muted, #9ca3af);
}

.pager-btn.active {
  background: #1d4d3d;
  border-color: #1d4d3d;
  color: #fff;
  cursor: default;
}

.pager-btn.disabled,
.pager-btn:disabled {
  opacity: 0.35;
  cursor: default;
}

.pager-info {
  font-size: 0.78rem;
  color: var(--theme-foreground-muted, #6b7280);
  margin-right: 8px;
  white-space: nowrap;
  align-self: center;
}

.pager-ellipsis {
  min-width: 24px;
  text-align: center;
  color: var(--theme-foreground-muted, #9ca3af);
  font-size: 0.85rem;
  user-select: none;
}

@media (max-width: 760px) {
    .page-titlebar {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    .page-titlebar__meta {
        align-items: flex-start;
        white-space: normal;
    }
    .metrics-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .metric-card__header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.45rem;
        min-height: 0;
    }
    .metric-top-right {
        align-self: flex-start;
        max-width: 100%;
        font-size: 0.72rem;
        padding: 0.22rem 0.45rem;
    }
    .grid-two {
        grid-template-columns: 1fr;
    }

    .table-shell {
        padding: 0.9rem;
    }

    .table-scroll {
        margin: 0 -0.15rem;
        padding-bottom: 0.35rem;
    }

    .table-scroll form[class^="inputs-"][class$="-table"],
    .table-scroll form[class*=" inputs-"][class$="-table"] {
        width: max-content;
        min-width: 100%;
        overflow: visible;
    }

    .table-scroll form[class^="inputs-"][class$="-table"] table,
    .table-scroll form[class*=" inputs-"][class$="-table"] table {
        width: max-content;
        min-width: 860px;
    }

    .context-action-row {
        margin-bottom: 0.9rem;
    }

    .reference-modal {
        padding: 0.8rem;
    }

    .reference-modal__dialog {
        width: min(100vw - 1.6rem, 1000px);
        max-height: calc(100vh - 1.6rem);
        padding: 0.85rem;
        border-radius: 20px;
    }

    .reference-modal__header {
        flex-direction: column;
    }

    .reference-modal__footer {
        justify-content: stretch;
    }

    .reference-modal__link,
    .reference-modal__close {
        width: 100%;
    }

    .sources-update-inline__text {
        line-height: 1.7;
    }
}
